Ceylan::Maths::Linear::Tripoint Class Reference

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

#include <CeylanTripoint.h>

Inheritance diagram for Ceylan::Maths::Linear::Tripoint:

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

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

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

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 = 3
 Tells what is the dimension for this point.

Protected Attributes

Real _coordinates [Dimensions]
 The three coordinates of this tripoint.

Static Protected Attributes

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

Friends

class Vector3
 Must access to each other's coordinates.
class Matrix3
 Must access to each other's coordinates.
CEYLAN_DLL friend bool operator== (const Tripoint &t1, const Tripoint &t2)
 Tells whether the two tripoints have the same elements.
CEYLAN_DLL friend bool operator!= (const Tripoint &t1, const Tripoint &t2)
 Tells whether the two tripoints have the same elements.
CEYLAN_DLL friend Tripoint operator+ (const Tripoint &t, const Vector3 &v)
 Translates a 3D point of specified 3D vector: result = t + v.
CEYLAN_DLL friend Tripoint operator- (const Tripoint &t, const Vector3 &v)
 Translates a 3D point of specified opposite 3D vector: result = t - v.
CEYLAN_DLL friend Vector3 vectorize (const Tripoint &t)
 Transforms a 3D point into a 3D vector, which will have exactly the same coordinates.
CEYLAN_DLL friend Vector3 vectorize (const Tripoint &t1, const Tripoint &t2)
 Constructs a 3D vector from two 3D points: result = t2 - t1.


Detailed Description

Three-dimensional 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.

Definition at line 72 of file CeylanTripoint.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

Tripoint::Tripoint ( Real  x0 = 0,
Real  x1 = 0,
Real  x2 = 0 
) [explicit]

Constructs a new vector with specified coordinates.

Note:
If no argument is specified, constructs the null vector.

Definition at line 62 of file CeylanTripoint.cc.

References _coordinates.

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

Basic virtual destructor.

Definition at line 73 of file CeylanTripoint.cc.


Member Function Documentation

Real Tripoint::getElementAt ( MatrixIndex  index  )  const [virtual]

Returns indexed element.

Index ranges from 0 to Dimensions-1.

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

Implements Ceylan::Maths::Linear::Point.

Definition at line 103 of file CeylanTripoint.cc.

References _coordinates, and Dimensions.

TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat (  )  [static, inherited]

void Point::nullify (  )  [virtual, inherited]

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

Definition at line 52 of file CeylanPoint.cc.

References Ceylan::Maths::Linear::Point::setAllElementsTo().

void Tripoint::setAllElementsTo ( Real  commonValue  )  [virtual]

Sets this point so that all its elements equal commonValue.

Implements Ceylan::Maths::Linear::Point.

Definition at line 91 of file CeylanTripoint.cc.

References _coordinates, and Dimensions.

void Tripoint::setElementAt ( MatrixIndex  index,
Real  newValue 
) [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.

Implements Ceylan::Maths::Linear::Point.

Definition at line 120 of file CeylanTripoint.cc.

References _coordinates, and Dimensions.

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().

void Tripoint::setTo ( Real  x0,
Real  x1,
Real  x2 
) [virtual]

Reassigns this tripoint's coordinates.

Definition at line 80 of file CeylanTripoint.cc.

References _coordinates.

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 Tripoint::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

Reimplemented from Ceylan::Maths::Linear::Point.

Definition at line 137 of file CeylanTripoint.cc.

References _coordinates, Ceylan::DigitOutputPrecision, Dimensions, Ceylan::Log::LogPlug::error(), Ceylan::TextDisplayable::GetOutputFormat(), Ceylan::high, and Ceylan::TextDisplayable::html.


Friends And Related Function Documentation

friend class Matrix3 [friend]

Must access to each other's coordinates.

Definition at line 84 of file CeylanTripoint.h.

CEYLAN_DLL friend bool operator!= ( const Tripoint t1,
const Tripoint t2 
) [friend]

Tells whether the two tripoints have the same elements.

CEYLAN_DLL friend Tripoint operator+ ( const Tripoint t,
const Vector3 v 
) [friend]

Translates a 3D point of specified 3D vector: result = t + v.

CEYLAN_DLL friend Tripoint operator- ( const Tripoint t,
const Vector3 v 
) [friend]

Translates a 3D point of specified opposite 3D vector: result = t - v.

CEYLAN_DLL friend bool operator== ( const Tripoint t1,
const Tripoint t2 
) [friend]

Tells whether the two tripoints have the same elements.

Note:
Exact comparison of floating point values is meaningless on most cases, hence strict equality is replaced here by relative equality.
See also:
Maths::AreRelativelyEqual.

friend class Vector3 [friend]

Must access to each other's coordinates.

Definition at line 80 of file CeylanTripoint.h.

CEYLAN_DLL friend Vector3 vectorize ( const Tripoint t1,
const Tripoint t2 
) [friend]

Constructs a 3D vector from two 3D points: result = t2 - t1.

CEYLAN_DLL friend Vector3 vectorize ( const Tripoint t  )  [friend]

Transforms a 3D point into a 3D vector, which will have exactly the same coordinates.


Member Data Documentation

The three coordinates of this tripoint.

Definition at line 239 of file CeylanTripoint.h.

Referenced by getElementAt(), setAllElementsTo(), setElementAt(), setTo(), toString(), and Tripoint().

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 from Ceylan::Maths::Linear::Point.

Definition at line 231 of file CeylanTripoint.h.

Referenced by getElementAt(), setAllElementsTo(), setElementAt(), and toString().


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

Generated on Thu Jun 4 20:40:33 2009 for Ceylan by  doxygen 1.5.8