This class is the base class of ISeeML: every class of ISeeML inherits this one.
More...
#include <Object.hpp>
|
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::Object & | clone () 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...
|
|
|
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 - (excluded) and (included), which is equal to a given angle modulo 2 . More...
|
|
static double | rad2deg (const double &theta) |
| Method transforming an angle in radian, with 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, with 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...
|
|
|
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...
|
|
|
(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...
|
|
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
◆ algCoord()
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
-
i | the 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.
◆ algDimension()
virtual int iSeeML::Object::algDimension |
( |
| ) |
const |
|
inlineprotectedvirtual |
◆ algWriteTo()
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
-
O | the output stream in which description is written. |
- See also
- algCoord, algDimension, writeTo.
◆ className()
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.
◆ clone()
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.
◆ deg2rad()
static double iSeeML::Object::deg2rad |
( |
const double & |
theta | ) |
|
|
inlinestatic |
Method transforming an angle in degree,
with
between -1 (excluded) and 1 (included), into its equivalent in radian, i.e.
.
- Parameters
-
- Returns
- the angle in gradian.
◆ isNegative()
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
-
- Returns
- true if the opposite of the double is positive.
- See also
- isPositive.
◆ isPositive()
static bool iSeeML::Object::isPositive |
( |
const double & |
x | ) |
|
|
inlinestatic |
Method telling whether a double is strictly positive.
- Parameters
-
- Returns
- true if the double is bigger than ISeeML' small value.
◆ isZero()
static bool iSeeML::Object::isZero |
( |
const double & |
x | ) |
|
|
inlinestatic |
Method comparing a double to zero.
- Parameters
-
x | the double compared to zero. |
- Returns
- true if the double's absolute value is smaller than ISeeML' small value.
- Examples
- wxGuiFwd.cpp.
◆ max()
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
-
a | A first element, |
b | a second one. |
- Returns
- the maximum between the two given elements.
◆ min()
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
-
a | A first element, |
b | a second one. |
- Returns
- the minimum between the two given elements.
◆ mod2pi()
static double iSeeML::Object::mod2pi |
( |
const double & |
theta | ) |
|
|
inlinestatic |
◆ rad2deg()
static double iSeeML::Object::rad2deg |
( |
const double & |
theta | ) |
|
|
inlinestatic |
Method transforming an angle in radian,
with
between -1 (excluded) and 1 (included), into its equivalent in degree, i.e.
.
- Parameters
-
theta | an angle in gradian. |
- Returns
- the angle in degree.
◆ sameClass()
Method verifying that a given object has the same type (same class name) than the current one.
- Parameters
-
- Returns
- whether the two objects have the same class name.
- See also
- className.
◆ sign()
static int iSeeML::Object::sign |
( |
const double & |
x | ) |
|
|
inlinestatic |
Method giving the sign of a double.
- Parameters
-
x | the double which sign is searched. |
- Returns
- the sign of the double, as an integer in {-1, 0, 1}.
- See also
- isZero, isPositive, isNegative.
◆ sqr()
static double iSeeML::Object::sqr |
( |
const double & |
x | ) |
|
|
inlinestatic |
Method giving the square of a double.
- Parameters
-
x | the double whose square is wanted. |
- Returns
- the square of the given double.
◆ writeTo()
virtual void iSeeML::Object::writeTo |
( |
ostream & |
O | ) |
const |
|
pure virtual |
◆ operator<<()
Modification method, writing a description of a ISeeML object in a given output stream.
- Parameters
-
O | the output stream in which description is written, |
o | the 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:
- /mnt/data/ajs/Loria/Compte/Recherche/Prog/C++/ISeeML/include/iSeeML/Object.hpp