BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Private Attributes | List of all members
BALL::VIEW::Vertex Class Reference

#include <BALL/VIEW/DATATYPE/vertex1.h>

Inheritance diagram for BALL::VIEW::Vertex:
BALL::VIEW::Label BALL::VIEW::Point

Public Member Functions

Constructors
 Vertex ()
 
 Vertex (const Vertex &vertex)
 
Destructors
virtual ~Vertex ()
 
virtual void clear ()
 
Assignment methods
void set (const Vertex &v)
 
const Vertexoperator= (const Vertex &v)
 
void swap (Vertex &v)
 
Accessors: inspectors and mutators
void setVertex (const Vector3 &v)
 
void setVertex (const float x, const float y, const float z)
 
Vector3getVertex ()
 
const Vector3getVertex () const
 
void getVertex (Vector3 &v) const
 
void getVertex (float &x, float &y, float &z) const
 
void setVertexAddress (const Vector3 &v)
 
void setDefaultVertexAddress ()
 
Vector3getVertexAddress () const
 
Predicates
bool isDefaultVertexAddress () const
 
debuggers and diagnostics
virtual bool isValid () const
 
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 

Private Attributes

Vector3 vertex1_
 
Vector3vertex1_ptr_
 

Detailed Description

Vertex is a base class for all GeometricObject 's that have a single vertex. It provides the derived class with methods for accessing that vertex. Further there is the possibility to give an address to a vector Vector3 as vertex. So if the value of that given vector changes the value of this vertex changes as well. To avoid segmentation faults this vector address must be valid as long as this vertex exists.

Definition at line 31 of file vertex1.h.

Constructor & Destructor Documentation

BALL::VIEW::Vertex::Vertex ( )

Default Constructor. The vector of this vertex is set to (0.0, 0.0, 0.0). The vertex address is set to the address of the own vector of this vertex.

BALL::VIEW::Vertex::Vertex ( const Vertex vertex)

Copy constructor. The vector of vertex is copied to the vector of this vertex. The vertex address of this vertex is set to the value of the vertex address of vertex vertex.

virtual BALL::VIEW::Vertex::~Vertex ( )
virtual

Destructor.

Member Function Documentation

virtual void BALL::VIEW::Vertex::clear ( )
virtual

Explicit default initialization. Set the vector of this vertex to the vector (0.0, 0.0, 0.0). The vertex address of this vertex is set to the address of the own vector of this vertex.

Reimplemented in BALL::VIEW::Label, and BALL::VIEW::Point.

virtual void BALL::VIEW::Vertex::dump ( std::ostream &  s = std::cout,
Size  depth = 0 
) const
virtual

Internal value dump. Dump the current state of this vertex to the output ostream s with dumping depth depth.

Parameters
soutput stream where to output the state of this vertex
depththe dumping depth
See Also
Vector3::operator <<

Reimplemented in BALL::VIEW::Label, and BALL::VIEW::Point.

Vector3& BALL::VIEW::Vertex::getVertex ( )

Mutable inspection of the vector of this vertex.

See Also
setVertex
const Vector3& BALL::VIEW::Vertex::getVertex ( ) const

Non-mutable inspection of the vector of this vertex. For further information see getVertex.

void BALL::VIEW::Vertex::getVertex ( Vector3 v) const

Inspection of the vector of this vertex.

See Also
setVertex
void BALL::VIEW::Vertex::getVertex ( float x,
float y,
float z 
) const

Access the components of the vector of this vertex by using float.

See Also
setVertex
Vector3* BALL::VIEW::Vertex::getVertexAddress ( ) const

Access the pointer of the vector that contains the value of this vertex.

See Also
setVertexAddress
bool BALL::VIEW::Vertex::isDefaultVertexAddress ( ) const

Vertex address test. Tests if the vertex address of this vertex points to the vector of this vertex.

See Also
setVertexAddress
getVertexAddress
setDefaultVertexAddress
virtual bool BALL::VIEW::Vertex::isValid ( ) const
virtual

Internal state and consistency self-validation. Calls Vector3::isValid

Reimplemented in BALL::VIEW::Label, and BALL::VIEW::Point.

const Vertex& BALL::VIEW::Vertex::operator= ( const Vertex v)

Assignment operator. Calls set. The vector and the vertex address of this vertex is initialized to the vector and the vertex address of the vertex v.

void BALL::VIEW::Vertex::set ( const Vertex v)

Assignment. The vector and the vertex address of this vertex is initialized to the vector and vertex address of the vertex v.

void BALL::VIEW::Vertex::setDefaultVertexAddress ( )

Change the vector address of this vertex to the default address. This method resets the vertex address to the vector address of this vertex. So the value of the vector of this vertex will no longer be ignored and all access methods will return it again. This method unhooks the object from any other objects prio connected with setVertexAddress.

See Also
setVertexAddress
void BALL::VIEW::Vertex::setVertex ( const Vector3 v)

Change the vector of this vertex.

See Also
getVertex
void BALL::VIEW::Vertex::setVertex ( const float  x,
const float  y,
const float  z 
)

Change the vector of this vertex.

See Also
getVertex
void BALL::VIEW::Vertex::setVertexAddress ( const Vector3 v)

Change the vector address of this vertex to the vector address represented by the parameter v. If a vector address is given the value of the vector of this vertex is ignored. Instead if the method getVertex (or any other access method) is called the value of the vector given by the vertex address is returned. The vector to which the vertex address points must exist and be valid as long as this vertex exists. An object that uses this method can hook itself onto another object (speaking in terms of position). If the object changes its position so the object derived from this vertex changes its position.

Parameters
vthe new vector address of this vertex
See Also
getVertexAddress
void BALL::VIEW::Vertex::swap ( Vertex v)

Swapping of vertices. Swap the vector and vertex address of this vertex with the vector and vertex address of the vertex v.

Member Data Documentation

Vector3 BALL::VIEW::Vertex::vertex1_
private

Definition at line 198 of file vertex1.h.

Vector3* BALL::VIEW::Vertex::vertex1_ptr_
private

Definition at line 201 of file vertex1.h.