#include <CeylanVector.h>
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
Vector () | |
Constructs a new vector. | |
virtual | ~Vector () throw () |
Basic virtual destructor. | |
virtual void | nullify () |
Sets this vector to the null vector (all coordinates zeroed). | |
virtual void | setAllElementsTo (Real commonValue)=0 |
Sets this vector so that all its elements equal commonValue. | |
virtual void | normalize ()=0 |
Normalizes this vector, so that its norm equals one. | |
virtual Real | magnitude () const =0 |
Returns this vector's magnitude. | |
virtual const std::string | toString (VerbosityLevels level=high) const |
Returns a user-friendly description of the state of this object. | |
Static Public Member Functions | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Static Public Attributes | |
static const MatrixIndex | Dimensions = 0 |
Tells what is the dimension for this vector. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. |
Indices ranges for 0 to Dimensions-1
Some methods could be gathered in this abstract class, instead of child classes (ex: setAllElementsTo could use the Dimensions attribute so that this method could be generically defined). The problem is however that Dimensions should be static, but it would not be overloaded by child classes. Even from a Vector3, lines such as 'for ( MatrixIndex i = 0 ; i < Dimensions ; i++ )' would use Vector::Dimensions, and not Vector3::Dimensions. A solution could be to define a getDimensions method. As it would have to be overloaded, inlining is not an option, a nd the overhead would remain significant. Better define these methods in each child class, even if their text is exactly duplicated.
Definition at line 76 of file CeylanVector.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
Vector::Vector | ( | ) |
Vector::~Vector | ( | ) | throw () [virtual] |
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
virtual Real Ceylan::Maths::Linear::Vector::magnitude | ( | ) | const [pure virtual] |
Returns this vector's magnitude.
Implemented in Ceylan::Maths::Linear::Vector2, and Ceylan::Maths::Linear::Vector3.
virtual void Ceylan::Maths::Linear::Vector::normalize | ( | ) | [pure virtual] |
Normalizes this vector, so that its norm equals one.
LinearException | if the null vector is passed, since it is the only one that cannot be normalized. |
Implemented in Ceylan::Maths::Linear::Vector2, and Ceylan::Maths::Linear::Vector3.
void Vector::nullify | ( | ) | [virtual] |
Sets this vector to the null vector (all coordinates zeroed).
Reimplemented in Ceylan::Maths::Linear::Vector2, and Ceylan::Maths::Linear::Vector3.
Definition at line 53 of file CeylanVector.cc.
References setAllElementsTo().
virtual void Ceylan::Maths::Linear::Vector::setAllElementsTo | ( | Real | commonValue | ) | [pure virtual] |
Sets this vector so that all its elements equal commonValue.
Implemented in Ceylan::Maths::Linear::Vector2, and Ceylan::Maths::Linear::Vector3.
Referenced by nullify().
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const string Vector::toString | ( | VerbosityLevels | level = high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. |
Implements Ceylan::TextDisplayable.
Reimplemented in Ceylan::Maths::Linear::Vector2, and Ceylan::Maths::Linear::Vector3.
Definition at line 62 of file CeylanVector.cc.
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
const MatrixIndex Ceylan::Maths::Linear::Vector::Dimensions = 0 [static] |
Tells what is the dimension for this vector.
Reimplemented in Ceylan::Maths::Linear::Vector2, and Ceylan::Maths::Linear::Vector3.
Definition at line 156 of file CeylanVector.h.