Ceylan::Maths::Linear::Point Class Reference

Abstract point, whose coordinates are floating-point values (Real). More...

#include <CeylanPoint.h>

Inheritance diagram for Ceylan::Maths::Linear::Point:
Inheritance graph
[legend]
Collaboration diagram for Ceylan::Maths::Linear::Point:
Collaboration graph
[legend]

List of all members.

Public Types

enum  TextOutputFormat { rawText, html }
 

Defines what text output formats for TextDisplayable instances are available.

More...

Public Member Functions

 Point ()
 Constructs a new point.
virtual ~Point () throw ()
 Basic virtual destructor.
virtual void nullify ()
 Sets this Point to the null Point (all coordinates zeroed).
virtual void setAllElementsTo (Real commonValue)=0
 Sets this point so that all its elements equal commonValue.
virtual Real getElementAt (MatrixIndex index) const =0
 Returns indexed element.
virtual void setElementAt (MatrixIndex index, Real newValue)=0
 Sets indexed element to specified value.
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 point.

Static Protected Attributes

static TextOutputFormat _OutputFormat = rawText
 The text format to be used currently by TextDisplayable instances.

Detailed Description

Abstract point, whose coordinates are floating-point values (Real).

Points and vectors are basically the same beasts, except they can mean different things to the developer. The Vector class is more versatile.

Note:
Beware of counter-intuitive operator priorities.
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 Matrix3, lines such as 'for ( MatrixIndex i = 0 ; i < Dimensions ; i++ )' would use Matrix::Dimensions, and not Matrix3::Dimensions. A solution could be to define a getDimensions method. As it would have to be overloaded, inlining is not an option, and the overhead would remain significant. Better define these methods in each child class, even if their text is exactly duplicated.

Definition at line 75 of file CeylanPoint.h.


Member Enumeration Documentation

Defines what text output formats for TextDisplayable instances are available.

Enumerator:
rawText 
html 

Definition at line 124 of file CeylanTextDisplayable.h.


Constructor & Destructor Documentation

Point::Point (  ) 

Constructs a new point.

Definition at line 38 of file CeylanPoint.cc.

Point::~Point (  )  throw () [virtual]

Basic virtual destructor.

Definition at line 45 of file CeylanPoint.cc.


Member Function Documentation

virtual Real Ceylan::Maths::Linear::Point::getElementAt ( MatrixIndex  index  )  const [pure virtual]

Returns indexed element.

Index ranges from 0 to Dimensions-1.

Exceptions:
MathsException if index is out of bounds and if in debug mode.

Implemented in Ceylan::Maths::Linear::Bipoint, and Ceylan::Maths::Linear::Tripoint.

TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat (  )  [static, inherited]
void Point::nullify (  )  [virtual]

Sets this Point to the null Point (all coordinates zeroed).

Definition at line 52 of file CeylanPoint.cc.

References setAllElementsTo().

virtual void Ceylan::Maths::Linear::Point::setAllElementsTo ( Real  commonValue  )  [pure virtual]

Sets this point so that all its elements equal commonValue.

Implemented in Ceylan::Maths::Linear::Bipoint, and Ceylan::Maths::Linear::Tripoint.

Referenced by nullify().

virtual void Ceylan::Maths::Linear::Point::setElementAt ( MatrixIndex  index,
Real  newValue 
) [pure virtual]

Sets indexed element to specified value.

Index ranges from 0 to Dimensions-1.

Exceptions:
MathsException if index is out of bounds and if in debug mode.

Implemented in Ceylan::Maths::Linear::Bipoint, and Ceylan::Maths::Linear::Tripoint.

void TextDisplayable::SetOutputFormat ( TextOutputFormat  newOutputFormat  )  [static, inherited]

Sets the current overall text format to be used by TextDisplayable instances.

Parameters:
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.

Parameters:
displayables a list of pointers to TextDisplayable instances/
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
toString, Ceylan::VerbosityLevels

Definition at line 45 of file CeylanTextDisplayable.cc.

References Ceylan::formatStringList().

const string Point::toString ( VerbosityLevels  level = high  )  const [virtual]

Returns a user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
TextDisplayable

Implements Ceylan::TextDisplayable.

Reimplemented in Ceylan::Maths::Linear::Bipoint, and Ceylan::Maths::Linear::Tripoint.

Definition at line 61 of file CeylanPoint.cc.


Member Data Documentation

TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited]

The text format to be used currently by TextDisplayable instances.

Note:
Defaults to raw text.

Definition at line 158 of file CeylanTextDisplayable.h.

Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().

Tells what is the dimension for this point.

Reimplemented in Ceylan::Maths::Linear::Bipoint, and Ceylan::Maths::Linear::Tripoint.

Definition at line 160 of file CeylanPoint.h.


The documentation for this class was generated from the following files:
Generated on Mon Nov 29 13:41:23 2010 for Ceylan by  doxygen 1.6.3