ISeeML  1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
iSeeML::Object Class Referenceabstract

This class is the base class of ISeeML: every class of ISeeML inherits this one. More...

#include <Object.hpp>

Inheritance diagram for iSeeML::Object:
Inheritance graph
[legend]

Public Member Functions

virtual ~Object ()
 This virtual class needs a virtual destructor.
 
virtual const string className () const
 Description method, giving the object's class name. More...
 
virtual iSeeML::Objectclone () const =0
 Description method, giving a copy of the current object. More...
 
virtual void writeTo (ostream &O) const =0
 Description method, writing a description of the object into a given output stream. More...
 
bool sameClass (const iSeeML::Object &other)
 Method verifying that a given object has the same type (same class name) than the current one. More...
 

Static Public Member Functions

template<class T >
static const T & min (const T &a, const T &b)
 Method giving the minimum of two elements. More...
 
template<class T >
static const T & max (const T &a, const T &b)
 Method giving the maximum of two elements. More...
 
static double sqr (const double &x)
 Method giving the square of a double. More...
 
static double mod2pi (const double &theta)
 Method giving the angle between - $\pi$ (excluded) and $\pi$ (included), which is equal to a given angle modulo 2 $\pi$. More...
 
static double rad2deg (const double &theta)
 Method transforming an angle in radian, $x \pi$ with $x$ between -1 (excluded) and 1 (included), into its equivalent in degree, i.e. More...
 
static double deg2rad (const double &theta)
 Method transforming an angle in degree, $90 x$ with $x$ between -1 (excluded) and 1 (included), into its equivalent in radian, i.e. More...
 
static bool isPositive (const double &x)
 Method telling whether a double is strictly positive. More...
 
static bool isNegative (const double &x)
 Method telling whether a double is strictly negative. More...
 
static bool isZero (const double &x)
 Method comparing a double to zero. More...
 
static int sign (const double &x)
 Method giving the sign of a double. More...
 

Protected Member Functions

virtual int algDimension () const
 Description method for algebraic vectors, giving the dimension of the containing space (default is zero). More...
 
virtual double algCoord (const int) const
 Description method for algebraic vectors, giving coordinate of given index for this vector. More...
 
virtual void algWriteTo (ostream &O) const
 Description method for algebraic vectors, writing this vector in a given output stream: coordinates for each dimension are written, between paranthesis and separated by commas. More...
 

Related Functions

(Note that these are not member functions.)

ostream & operator<< (ostream &O, const iSeeML::Object &o)
 Modification method, writing a description of a ISeeML object in a given output stream. More...
 

Detailed Description

This class is the base class of ISeeML: every class of ISeeML inherits this one.

Every ISeeML object has to overload className(), clone() and writeTo() virtual methods. Method className is used to detect problems with virtual methods (e.g. "equality operator" of geometric objects). Method clone is used in arrays of objects. Method writeTo is used by output stream's operator<<.

This class also provides a set of common methods (sqr, ..., max), some of them using a private static small value.

Author
Alexis Scheuer.
Version
1.0

Member Function Documentation

virtual double iSeeML::Object::algCoord ( const int  ) const
inlineprotectedvirtual

Description method for algebraic vectors, giving coordinate of given index for this vector.

This method is not in a seperate class, to avoid multiple inheritance (which drastically increases the computation time).

Parameters
ithe index of the searched coordinate.
Precondition
an error message is generated if check flag ISEEML_CHECK_OBJECT_PRECOND (see CompilerFlags.h) is defined, as this method should not be called (it should be overloaded).
Returns
0.

Reimplemented in iSeeML::rob::OrPtConfig, iSeeML::geom::Vector, iSeeML::rob::CurvConfig, and iSeeML::geom::Point.

virtual int iSeeML::Object::algDimension ( ) const
inlineprotectedvirtual

Description method for algebraic vectors, giving the dimension of the containing space (default is zero).

This method is not in a seperate class, to avoid multiple inheritance (which drastically increases the computation time).

This representation is mainly used to define a unified writeTo. Dimension cannot be static, as it is virtual.

Reimplemented in iSeeML::rob::OrPtConfig, iSeeML::geom::Vector, iSeeML::rob::CurvConfig, and iSeeML::geom::Point.

virtual void iSeeML::Object::algWriteTo ( ostream &  O) const
inlineprotectedvirtual

Description method for algebraic vectors, writing this vector in a given output stream: coordinates for each dimension are written, between paranthesis and separated by commas.

This method is not in a seperate class, to avoid multiple inheritance (which drastically increases the computation time).

Parameters
Othe output stream in which description is written.
See also
algCoord, algDimension, writeTo.
virtual const string iSeeML::Object::className ( ) const
inlinevirtual

Description method, giving the object's class name.

This method is virtual in order to return the correct value through polymorphism, while a static field is also defined (but this one is private in abstract class).

Class name is used in error messages, and to verify type in redefinitions of some virtual methods.

Returns
the class name as a string.
See also
ClassName.
virtual iSeeML::Object& iSeeML::Object::clone ( ) const
pure virtual

Description method, giving a copy of the current object.

This clone is dynamically allocated (and can be built easily using a copy constructor), it has to be deleted later.

Precondition
memory should not be full. If memory is full and ISEEML_CHECK_NIL_POINTER is defined (see CompilerFlags.h), an error message is generated and the program exits.
Returns
a copy/clone of the current object.

Implemented in iSeeML::rob::FscPath, iSeeML::rob::LinCurvPath, iSeeML::rob::OrPtConfig, iSeeML::rob::DubinsPath, iSeeML::rob::CurvConfig, iSeeML::geom::Vector, iSeeML::rob::ArrayPaths, and iSeeML::geom::Point.

static double iSeeML::Object::deg2rad ( const double &  theta)
inlinestatic

Method transforming an angle in degree, $90 x$ with $x$ between -1 (excluded) and 1 (included), into its equivalent in radian, i.e.

$x \pi$ .

Parameters
thetaan angle in degree.
Returns
the angle in gradian.
static bool iSeeML::Object::isNegative ( const double &  x)
inlinestatic

Method telling whether a double is strictly negative.

Computes the double's opposite, and checks if it is positive.

Parameters
xthe double checked.
Returns
true if the opposite of the double is positive.
See also
isPositive.
static bool iSeeML::Object::isPositive ( const double &  x)
inlinestatic

Method telling whether a double is strictly positive.

Parameters
xthe double checked.
Returns
true if the double is bigger than ISeeML' small value.
static bool iSeeML::Object::isZero ( const double &  x)
inlinestatic

Method comparing a double to zero.

Parameters
xthe double compared to zero.
Returns
true if the double's absolute value is smaller than ISeeML' small value.
Examples:
wxGuiFwd.cpp.
template<class T >
static const T& iSeeML::Object::max ( const T &  a,
const T &  b 
)
inlinestatic

Method giving the maximum of two elements.

This method uses templates, the elements do not have to be ISeeML objects.

Parameters
aA first element,
ba second one.
Returns
the maximum between the two given elements.
template<class T >
static const T& iSeeML::Object::min ( const T &  a,
const T &  b 
)
inlinestatic

Method giving the minimum of two elements.

This method uses templates, the elements do not have to be ISeeML objects.

Parameters
aA first element,
ba second one.
Returns
the minimum between the two given elements.
static double iSeeML::Object::mod2pi ( const double &  theta)
inlinestatic

Method giving the angle between - $\pi$ (excluded) and $\pi$ (included), which is equal to a given angle modulo 2 $\pi$.

Parameters
thetaan angle.
Returns
the given angle modulo 2 $\pi$, between - $\pi$ (excluded) and $\pi$ (included).
static double iSeeML::Object::rad2deg ( const double &  theta)
inlinestatic

Method transforming an angle in radian, $x \pi$ with $x$ between -1 (excluded) and 1 (included), into its equivalent in degree, i.e.

$90 x$ .

Parameters
thetaan angle in gradian.
Returns
the angle in degree.
bool iSeeML::Object::sameClass ( const iSeeML::Object other)
inline

Method verifying that a given object has the same type (same class name) than the current one.

Parameters
otherthe given object.
Returns
whether the two objects have the same class name.
See also
className.
static int iSeeML::Object::sign ( const double &  x)
inlinestatic

Method giving the sign of a double.

Parameters
xthe double which sign is searched.
Returns
the sign of the double, as an integer in {-1, 0, 1}.
See also
isZero, isPositive, isNegative.
static double iSeeML::Object::sqr ( const double &  x)
inlinestatic

Method giving the square of a double.

Parameters
xthe double whose square is wanted.
Returns
the square of the given double.
virtual void iSeeML::Object::writeTo ( ostream &  O) const
pure virtual

Description method, writing a description of the object into a given output stream.

This method is preferred to a toString method, as writting into a stream is much easier than writting into a string.

Parameters
Othe output stream in which description is written.

Implemented in iSeeML::rob::FscPath, iSeeML::rob::LinCurvPath, iSeeML::rob::OrPtConfig, iSeeML::rob::DubinsPath, iSeeML::geom::Vector, iSeeML::rob::CurvConfig, iSeeML::geom::Point, and iSeeML::rob::CompoundPath.

Friends And Related Function Documentation

ostream & operator<< ( ostream &  O,
const iSeeML::Object o 
)
related

Modification method, writing a description of a ISeeML object in a given output stream.

Parameters
Othe output stream in which description is written,
othe ISeeML object whose description is written.
Returns
the output stream, after writing in it.
See also
iSeeML::Object::writeTo.

The documentation for this class was generated from the following file: