Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

VIEW::Vertex Class Reference
[Helper Base Classes for derived GeometricObject 's]

Vertex is a base class for all GeometricObject 's that have a single vertex. More...

#include <vertex1.h>

Inheritance diagram for VIEW::Vertex:

VIEW::Label VIEW::Point List of all members.

Public Member Functions

Constructors
 Vertex () throw ()
 Default Constructor.
 Vertex (const Vertex &vertex) throw ()
 Copy constructor.
Destructors
virtual ~Vertex () throw ()
 Destructor.
virtual void clear () throw ()
 Explicit default initialization.
Assignment methods
void set (const Vertex &v) throw ()
 Assignment.
const Vertexoperator= (const Vertex &v) throw ()
 Assignment operator.
void swap (Vertex &v) throw ()
 Swapping of vertices.
Accessors: inspectors and mutators
void setVertex (const Vector3 &v) throw ()
 Change the vector of this vertex.
void setVertex (const float x, const float y, const float z) throw ()
 Change the vector of this vertex.
Vector3getVertex () throw ()
 Mutable inspection of the vector of this vertex.
const Vector3getVertex () const throw ()
 Non-mutable inspection of the vector of this vertex.
void getVertex (Vector3 &v) const throw ()
 Inspection of the vector of this vertex.
void getVertex (float &x, float &y, float &z) const throw ()
 Access the components of the vector of this vertex by using float.
void setVertexAddress (const Vector3 &v) throw ()
 Change the vector address of this vertex to the vector address represented by the parameter v.
void setDefaultVertexAddress () throw ()
 Change the vector address of this vertex to the default address.
Vector3getVertexAddress () const throw ()
 Access the pointer of the vector that contains the value of this vertex.
Predicates
bool isDefaultVertexAddress () const throw ()
 Vertex address test.
debuggers and diagnostics
virtual bool isValid () const throw ()
 Internal state and consistency self-validation.
virtual void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Internal value dump.

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.


Constructor & Destructor Documentation

VIEW::Vertex::Vertex  )  throw ()
 

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.

VIEW::Vertex::Vertex const Vertex vertex  )  throw ()
 

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 VIEW::Vertex::~Vertex  )  throw () [virtual]
 

Destructor.


Member Function Documentation

virtual void VIEW::Vertex::clear  )  throw () [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 VIEW::Label, and VIEW::Point.

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

Internal value dump.

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

Parameters:
s output stream where to output the state of this vertex
depth the dumping depth
See also:
Vector3::operator <<

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

void VIEW::Vertex::getVertex float &  x,
float &  y,
float &  z
const throw ()
 

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

See also:
setVertex

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

Inspection of the vector of this vertex.

See also:
setVertex

const Vector3& VIEW::Vertex::getVertex  )  const throw ()
 

Non-mutable inspection of the vector of this vertex.

For further information see getVertex.

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

Mutable inspection of the vector of this vertex.

See also:
setVertex

Vector3* VIEW::Vertex::getVertexAddress  )  const throw ()
 

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

See also:
setVertexAddress

bool VIEW::Vertex::isDefaultVertexAddress  )  const throw ()
 

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 VIEW::Vertex::isValid  )  const throw () [virtual]
 

Internal state and consistency self-validation.

Calls Vector3::isValid

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

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

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 VIEW::Vertex::set const Vertex v  )  throw ()
 

Assignment.

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

void VIEW::Vertex::setDefaultVertexAddress  )  throw ()
 

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 VIEW::Vertex::setVertex const float  x,
const float  y,
const float  z
throw ()
 

Change the vector of this vertex.

See also:
getVertex

void VIEW::Vertex::setVertex const Vector3 v  )  throw ()
 

Change the vector of this vertex.

See also:
getVertex

void VIEW::Vertex::setVertexAddress const Vector3 v  )  throw ()
 

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:
v the new vector address of this vertex
See also:
getVertexAddress

void VIEW::Vertex::swap Vertex v  )  throw ()
 

Swapping of vertices.

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