BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members
BALL::VIEW::Vertex2 Class Reference

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

Inheritance diagram for BALL::VIEW::Vertex2:
BALL::VIEW::Line BALL::VIEW::Tube BALL::VIEW::TwoColoredLine BALL::VIEW::TwoColoredTube

Public Member Functions

Constructors
 Vertex2 ()
 
 Vertex2 (const Vertex2 &vertex)
 
Destructors
virtual ~Vertex2 ()
 
virtual void clear ()
 
Assignment methods
void set (const Vertex2 &vertex)
 
const Vertex2operator= (const Vertex2 &vertex)
 
void swap (Vertex2 &vertex)
 
Accessors: inspectors and mutators
void setVertex1 (const Vector3 &v)
 
void setVertex1 (const float x, const float y, const float z)
 
Vector3getVertex1 ()
 
const Vector3getVertex1 () const
 
void getVertex1 (Vector3 &v) const
 
void getVertex1 (float &x, float &y, float &z) const
 
void setVertex1Address (const Vector3 &v)
 
void setDefaultVertex1Address ()
 
Vector3getVertex1Address () const
 
void setVertex2 (const Vector3 &v)
 
void setVertex2 (const float x, const float y, const float z)
 
Vector3getVertex2 ()
 
const Vector3getVertex2 () const
 
void getVertex2 (Vector3 &v) const
 
void getVertex2 (float &x, float &y, float &z) const
 
void setVertex2Address (const Vector3 &v)
 
void setDefaultVertex2Address ()
 
Vector3getVertex2Address () const
 
void setVertices (const Vector3 &vertex1, const Vector3 &vertex2)
 
void setVertices (const float vertex1_x, const float vertex1_y, const float vertex1_z, const float vertex2_x, const float vertex2_y, const float vertex2_z)
 
void setVertexAddresses (const Vector3 &vertex1, const Vector3 &vertex2)
 
void getVertices (Vector3 &vertex1, Vector3 &vertex2)
 
void getVertices (float &vertex1_x, float &vertex1_y, float &vertex1_z, float &vertex2_x, float &vertex2_y, float &vertex2_z)
 
void setDefaultVertexAddresses ()
 
Predicates
bool isDefaultVertex1Address () const
 
bool isDefaultVertex2Address () const
 
bool isDefaultVertexAddresses () const
 
debuggers and diagnostics
virtual bool isValid () const
 
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 

Detailed Description

Vertex2 is a base class for all GeometricObject 's that have two vertices. It provides the derived class with methods for accessing that vertices. Further there is the possibility to give an address to a Vector3 as vertice. So if the values of these given vectors changes, the values of the vectors changes as well. To avoid segmentation faults these vector addresses must be valid as long as the Vertex2 exists.

Definition at line 32 of file vertex2.h.

Constructor & Destructor Documentation

BALL::VIEW::Vertex2::Vertex2 ( )

Default Constructor. The vectors are set to (0.0, 0.0, 0.0). The vertex addresses are set to the addresses of the own vectors.

BALL::VIEW::Vertex2::Vertex2 ( const Vertex2 vertex)

Copy constructor.

virtual BALL::VIEW::Vertex2::~Vertex2 ( )
virtual

Destructor.

Member Function Documentation

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

Explicit default initialization. Set the vectors to the vector (0.0, 0.0, 0.0). The vertex addresses are set to the addresses of the own vectors .

Reimplemented in BALL::VIEW::TwoColoredTube, BALL::VIEW::TwoColoredLine, BALL::VIEW::Tube, and BALL::VIEW::Line.

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

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

Parameters
soutput stream where to output the state
depththe dumping depth
See also
Vector3::operator <<

Reimplemented in BALL::VIEW::TwoColoredTube, BALL::VIEW::TwoColoredLine, BALL::VIEW::Tube, and BALL::VIEW::Line.

Vector3& BALL::VIEW::Vertex2::getVertex1 ( )

Mutable inspection of the first vector

Returns
Vector3& mutable reference to the first vector
See also
setVertex1
const Vector3& BALL::VIEW::Vertex2::getVertex1 ( ) const

Non-mutable inspection of the first vector

void BALL::VIEW::Vertex2::getVertex1 ( Vector3 v) const

Inspection of the first vector . Access the first vector of this vertex by using Vector3.

Parameters
vthe vector receiving the first vector
See also
setVertex1
void BALL::VIEW::Vertex2::getVertex1 ( float x,
float y,
float z 
) const

Access the components of the first vector by using float.

See also
setVertex1
Vector3* BALL::VIEW::Vertex2::getVertex1Address ( ) const

Mutable inspection of the first vertex address.

Returns
Vector3* pointer to the first vector that contains the value
See also
setVertex1Address
Vector3& BALL::VIEW::Vertex2::getVertex2 ( )

Mutable inspection of the second vector.

Returns
Vector3& mutable reference to the second vector
See also
setVertex2
const Vector3& BALL::VIEW::Vertex2::getVertex2 ( ) const

Non-mutable inspection of the second vector . For further information see getVertex2.

void BALL::VIEW::Vertex2::getVertex2 ( Vector3 v) const

Inspection of the second vector . Access the second vector of this vertex by using Vector3.

Parameters
vthe vector receiving the second vector
See also
setVertex2
Vector3
void BALL::VIEW::Vertex2::getVertex2 ( float x,
float y,
float z 
) const

Inspection of the components of the second vector .

See also
setVertex2
Vector3* BALL::VIEW::Vertex2::getVertex2Address ( ) const

Mutable inspection of the second vertex address .

Returns
Vector3* pointer to the second vector that contains the value
See also
setVertex2Address
void BALL::VIEW::Vertex2::getVertices ( Vector3 vertex1,
Vector3 vertex2 
)

Inspection of the first and second vector .

Parameters
vertex1the vector receiving the first vector
vertex2the vector receiving the second vector
See also
setVertices
void BALL::VIEW::Vertex2::getVertices ( float vertex1_x,
float vertex1_y,
float vertex1_z,
float vertex2_x,
float vertex2_y,
float vertex2_z 
)

Access the components of the first and second vector of this vertex2 by using float.

See also
setVertices
bool BALL::VIEW::Vertex2::isDefaultVertex1Address ( ) const

first vertex address test. Tests if the first vertex address points to the first vector .

Returns
bool true if the first vertex address points to the first vector . false otherwise
See also
setVertex1Address
getVertex1Address
setDefaultVertex1Address
bool BALL::VIEW::Vertex2::isDefaultVertex2Address ( ) const

second vertex address test. Test if the second vertex address points to the second vector .

Returns
bool true if the second vertex address points to the second vector . false otherwise
See also
setVertex2Address
getVertex2Address
setDefaultVertex2Address
bool BALL::VIEW::Vertex2::isDefaultVertexAddresses ( ) const

both vertex addresses test.

Returns
bool true if both vertex addresses each points to its own vector . false otherwise
See also
setVertex1Address
getVertex1Address
setVertex2Address
getVertex2Address
setDefaultVertex1Address
setDefaultVertex2Address
virtual bool BALL::VIEW::Vertex2::isValid ( ) const
virtual

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

Reimplemented in BALL::VIEW::TwoColoredTube, BALL::VIEW::TwoColoredLine, BALL::VIEW::Tube, and BALL::VIEW::Line.

const Vertex2& BALL::VIEW::Vertex2::operator= ( const Vertex2 vertex)

Assignment operator. Calls set. The vectors and the vertex addresses are initialized to the vectors and the vertex addresses of the vertex2 vertex.

void BALL::VIEW::Vertex2::set ( const Vertex2 vertex)

Assignment. The vectors and the vertex addresses are initialized to the vectors and vertex addresses of the vertex2 vertex.

void BALL::VIEW::Vertex2::setDefaultVertex1Address ( )

Change the first vector address to the default address. So the value of the first vector 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 setVertex1Address.

See also
Vertex::setVertex1Address
void BALL::VIEW::Vertex2::setDefaultVertex2Address ( )

Change the second vector address to the default address. This method resets the second vertex address to the second vector of this vertex2. So the value of the second vector of this vertex2 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 setVertex2Address.

See also
Vertex::setVertex2Address
void BALL::VIEW::Vertex2::setDefaultVertexAddresses ( )

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

See also
Vertex::setVertex2Addresses
void BALL::VIEW::Vertex2::setVertex1 ( const Vector3 v)

Change the first vector .

Parameters
vthe new first vector
See also
getVertex1
void BALL::VIEW::Vertex2::setVertex1 ( const float  x,
const float  y,
const float  z 
)

Change the first vector .

See also
getVertex1
void BALL::VIEW::Vertex2::setVertex1Address ( const Vector3 v)

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

Parameters
vthe new first vector address
See also
getVertex1Address
void BALL::VIEW::Vertex2::setVertex2 ( const Vector3 v)

Change the second vector .

Parameters
vthe new second vector
See also
getVertex2
void BALL::VIEW::Vertex2::setVertex2 ( const float  x,
const float  y,
const float  z 
)

Change the second vector .

See also
getVertex2
void BALL::VIEW::Vertex2::setVertex2Address ( const Vector3 v)

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

Parameters
vthe new second vector address
See also
getVertex2Address
void BALL::VIEW::Vertex2::setVertexAddresses ( const Vector3 vertex1,
const Vector3 vertex2 
)

Change the vector addresses of the first and second vector. See setVertex1Address or setVertex2Address for further information concerning vector addresses.

Parameters
vertex1the new first vector address
vertex2the new second vector address
See also
setVertex1Address
setVertex2Address
void BALL::VIEW::Vertex2::setVertices ( const Vector3 vertex1,
const Vector3 vertex2 
)

Change the first and second vector .

Parameters
vertex1the new first vector
vertex2the new second vector
See also
getVertices
void BALL::VIEW::Vertex2::setVertices ( const float  vertex1_x,
const float  vertex1_y,
const float  vertex1_z,
const float  vertex2_x,
const float  vertex2_y,
const float  vertex2_z 
)

Change the first and second vector .

See also
getVertices
void BALL::VIEW::Vertex2::swap ( Vertex2 vertex)

Swapping of vertices.