Two-dimensional point, whose coordinates are floating-point values (Real). More...
#include <CeylanBipoint.h>
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
Bipoint (Real x0=0, Real x1=0) | |
Constructs a new vector with specified coordinates. | |
virtual | ~Bipoint () throw () |
Basic virtual destructor. | |
virtual void | setTo (Real x0, Real x1) |
Reassigns this Bipoint's coordinates. | |
virtual void | setAllElementsTo (Real commonValue) |
Sets this point so that all its elements equal commonValue. | |
virtual Real | getX () const |
Returns the abscissa of this point. | |
virtual Real | getY () const |
Returns the ordinate of this point. | |
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 Real | Distance (const Bipoint &first, const Bipoint &second) |
Returns the distance between the two bipoints. | |
static Real | DistancePow2 (const Bipoint &first, const Bipoint &second) |
Returns the square of the distance between the two bipoints. | |
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 = 2 |
Tells what is the dimension for this point. | |
Protected Attributes | |
Real | _coordinates [Dimensions] |
The three coordinates of this Bipoint. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Friends | |
class | Vector2 |
Must access to each other's coordinates. | |
class | Matrix2 |
Must access to each other's coordinates. | |
CEYLAN_DLL friend bool | operator== (const Bipoint &t1, const Bipoint &t2) |
Tells whether the two Bipoints have the same elements. | |
CEYLAN_DLL friend bool | operator!= (const Bipoint &t1, const Bipoint &t2) |
Tells whether the two Bipoints are different. | |
CEYLAN_DLL friend Bipoint | operator+ (const Bipoint &t, const Vector2 &v) |
Translates a 2D point of specified 2D vector: result = t + v. | |
CEYLAN_DLL friend Bipoint | operator- (const Bipoint &t, const Vector2 &v) |
Translates a 2D point of specified opposite 2D vector: result = t - v. | |
CEYLAN_DLL friend Vector2 | vectorize (const Bipoint &t) |
Transforms a 2D point into a 2D vector, which will have the same coordinates. | |
CEYLAN_DLL friend Vector2 | vectorize (const Bipoint &t1, const Bipoint &t2) |
Constructs a 2D vector from two 2D points: result = t2 - t1. |
Two-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.
Definition at line 70 of file CeylanBipoint.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
Constructs a new vector with specified coordinates.
Definition at line 62 of file CeylanBipoint.cc.
References _coordinates.
Bipoint::~Bipoint | ( | ) | throw () [virtual] |
Basic virtual destructor.
Definition at line 72 of file CeylanBipoint.cc.
Returns the distance between the two bipoints.
Definition at line 231 of file CeylanBipoint.cc.
References getX(), getY(), Ceylan::Maths::Pow2(), and Ceylan::Maths::Sqrt().
Returns the square of the distance between the two bipoints.
Definition at line 241 of file CeylanBipoint.cc.
References getX(), getY(), and Ceylan::Maths::Pow2().
Real Bipoint::getElementAt | ( | MatrixIndex | index | ) | const [virtual] |
Returns indexed element.
Index ranges from 0 to Dimensions-1.
MathsException | if index is out of bounds, and if in debug mode. |
Implements Ceylan::Maths::Linear::Point.
Definition at line 117 of file CeylanBipoint.cc.
References _coordinates, and Dimensions.
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 toString().
Real Bipoint::getX | ( | ) | const [virtual] |
Returns the abscissa of this point.
Definition at line 102 of file CeylanBipoint.cc.
References _coordinates.
Referenced by Distance(), DistancePow2(), and Ceylan::Locatable2D::setCenter().
Real Bipoint::getY | ( | ) | const [virtual] |
Returns the ordinate of this point.
Definition at line 109 of file CeylanBipoint.cc.
References _coordinates.
Referenced by Distance(), DistancePow2(), and Ceylan::Locatable2D::setCenter().
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 Bipoint::setAllElementsTo | ( | Real | commonValue | ) | [virtual] |
Sets this point so that all its elements equal commonValue.
Implements Ceylan::Maths::Linear::Point.
Definition at line 89 of file CeylanBipoint.cc.
References _coordinates, and Dimensions.
void Bipoint::setElementAt | ( | MatrixIndex | index, | |
Real | newValue | |||
) | [virtual] |
Sets indexed element to specified value.
Index ranges from 0 to Dimensions-1.
MathsException | if index is out of bounds, and if in debug mode. |
Implements Ceylan::Maths::Linear::Point.
Definition at line 133 of file CeylanBipoint.cc.
References _coordinates, and Dimensions.
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().
Reassigns this Bipoint's coordinates.
Definition at line 79 of file CeylanBipoint.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.
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 Bipoint::toString | ( | VerbosityLevels | level = high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. |
Reimplemented from Ceylan::Maths::Linear::Point.
Definition at line 149 of file CeylanBipoint.cc.
References _coordinates, Ceylan::DigitOutputPrecision, Dimensions, Ceylan::Log::LogPlug::error(), Ceylan::TextDisplayable::GetOutputFormat(), Ceylan::high, and Ceylan::TextDisplayable::html.
friend class Matrix2 [friend] |
Must access to each other's coordinates.
Definition at line 82 of file CeylanBipoint.h.
Tells whether the two Bipoints are different.
Translates a 2D point of specified 2D vector: result = t + v.
Translates a 2D point of specified opposite 2D vector: result = t - v.
Tells whether the two Bipoints have the same elements.
friend class Vector2 [friend] |
Must access to each other's coordinates.
Definition at line 78 of file CeylanBipoint.h.
Constructs a 2D vector from two 2D points: result = t2 - t1.
Transforms a 2D point into a 2D vector, which will have the same coordinates.
Real Ceylan::Maths::Linear::Bipoint::_coordinates[Dimensions] [protected] |
The three coordinates of this Bipoint.
Definition at line 276 of file CeylanBipoint.h.
Referenced by Bipoint(), getElementAt(), getX(), getY(), setAllElementsTo(), setElementAt(), setTo(), and toString().
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::Bipoint::Dimensions = 2 [static] |
Tells what is the dimension for this point.
Reimplemented from Ceylan::Maths::Linear::Point.
Definition at line 268 of file CeylanBipoint.h.
Referenced by getElementAt(), setAllElementsTo(), setElementAt(), and toString().