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

GraphTriangle< Vertex, Edge, Face > Class Template Reference
[Molecular Surface Computation]

Generic GraphTriangle Class. More...

#include <graphFace.h>

List of all members.

Public Member Functions

Constructors and Destructors
 GraphTriangle () throw ()
 Default constructor.
 GraphTriangle (const GraphTriangle< Vertex, Edge, Face > &face, bool deep=false) throw ()
 Copy constructor.
 GraphTriangle (Vertex *vertex1, Vertex *vertex2, Vertex *vertex3, Edge *edge1, Edge *edge2, Edge *edge3, Index index) throw ()
 Detailled constructor.
virtual ~GraphTriangle () throw ()
 Destructor.
Assignment
void set (const GraphTriangle< Vertex, Edge, Face > &face, bool deep=false) throw ()
 Assign from another GraphTriangle.
GraphTriangle< Vertex, Edge,
Face > & 
operator= (const GraphTriangle< Vertex, Edge, Face > &face) throw ()
 Assign from another GraphTriangle.
void set (Vertex *vertex1, Vertex *vertex2, Vertex *vertex3, Edge *edge1, Edge *edge2, Edge *edge3, Index index) throw ()
 Assign to a lot of nice objects.
Accessors
void setVertex (Position i, Vertex *vertex) throw (Exception::IndexOverflow)
 Set one of the vertices of the GraphTriangle.
VertexgetVertex (Position i) const throw (Exception::IndexOverflow)
 Return one of the vertices of the GraphTriangle.
void setEdge (Position i, Edge *edge) throw (Exception::IndexOverflow)
 Set one of the edges of the GraphTriangle.
Edge * getEdge (Position i) const throw (Exception::IndexOverflow)
 Return one of the edges of the GraphTriangle.
void setIndex (Index index) throw ()
 Set the index of the GraphTriangle.
Index getIndex () const throw ()
 Return the index of the GraphTriangle.
bool getEdges (const Vertex *vertex, Edge *&edge1, Edge *&edge2) const throw ()
 Find the two edges of the GraphTriangle that belong to the given vertex.
bool getEdge (const Vertex *vertex1, const Vertex *vertex2, Edge *&edge) const throw ()
 Find the edge of the GraphTriangle that belongs to the two given vertices.
Index getSimilarEdge (const Edge *edge, Edge *&similar_edge) const throw ()
 Find the edge of the GraphFace that is similar to the given edge.
Index getRelativeIndex (const Vertex *vertex) const throw ()
 Return the relative index of a vertex in the GraphTriangle.
Index getRelativeIndex (const Edge *edge) const throw ()
 Return the relative index of an edge in the GraphTriangle.
Vertexthird (const Vertex *v1, const Vertex *v2) const throw ()
 Return a pointer to the third vertex of the GraphTriangle.
Edge * third (const Edge *e1, const Edge *e2) const throw ()
 Return a pointer to the third edge of the GraphTriangle.
Edge * getOppositeEdge (const Vertex *vertex) const throw ()
 Get the edge of the GraphFace which lies on the opposite side of the given vertex.
VertexgetOppositeVertex (const Edge *edge) const throw ()
 Get the vertex of the GraphFace which lies on the opposite side of the given edge.
bool substitute (const Vertex *old_vertex, Vertex *new_vertex) throw ()
 Substitute a vertex by an other one.
bool substitute (const Edge *old_edge, Edge *new_edge) throw ()
 Substitute an edge by an other one.
Predicates
virtual bool operator== (const Face &) const throw ()
 Equality operator.
virtual bool operator!= (const Face &) const throw ()
 Inequality operator.
virtual bool operator *= (const Face &) const throw ()
 Similarity operator.
Vertexhas (Vertex *vertex) const throw ()
 Test whether a vertex is meber of the face.
Edge * has (Edge *edge) const throw ()
 Test whether an edge is meber of the face.

Protected Attributes

Vertexvertex_ [3]
Edge * edge_ [3]
Index index_

Friends

Class friends
  • class GraphVertex<Vertex,Edge,Face>; - class GraphEdge<Vertex,Edge,Face>;


class GraphVertex<Vertex,Edge,Face>
class GraphEdge<Vertex,Edge,Face>


Detailed Description

template<typename Vertex, typename Edge, typename Face>
class GraphTriangle< Vertex, Edge, Face >

Generic GraphTriangle Class.


Constructor & Destructor Documentation

template<typename Vertex, typename Edge, typename Face>
GraphTriangle< Vertex, Edge, Face >::GraphTriangle  )  throw ()
 

Default constructor.

This method creates a new GraphTriangle object.

template<typename Vertex, typename Edge, typename Face>
GraphTriangle< Vertex, Edge, Face >::GraphTriangle const GraphTriangle< Vertex, Edge, Face > &  face,
bool  deep = false
throw ()
 

Copy constructor.

Create a new GraphTriangle object from another.

Parameters:
face the GraphTriangle object to be copied
deep if deep = false, all pointers are set to NULL (default). Otherwise the new GraphTriangle object is linked to the neighbours of the old GraphTriangle object.

template<typename Vertex, typename Edge, typename Face>
GraphTriangle< Vertex, Edge, Face >::GraphTriangle Vertex vertex1,
Vertex vertex2,
Vertex vertex3,
Edge *  edge1,
Edge *  edge2,
Edge *  edge3,
Index  index
throw ()
 

Detailled constructor.

Create a new GraphTriangle object from some nice objects

Parameters:
vertex1 assigned to the first vertex
vertex2 assigned to the second vertex
vertex3 assigned to the third vertex
edge1 assigned to the first edge
edge2 assigned to the second edge
edge3 assigned to the third edge
index assigned to the index

template<typename Vertex, typename Edge, typename Face>
GraphTriangle< Vertex, Edge, Face >::~GraphTriangle  )  throw () [virtual]
 

Destructor.

Destructs the GraphTriangle object.


Member Function Documentation

template<typename Vertex, typename Edge, typename Face>
bool GraphTriangle< Vertex, Edge, Face >::getEdge const Vertex vertex1,
const Vertex vertex2,
Edge *&  edge
const throw ()
 

Find the edge of the GraphTriangle that belongs to the two given vertices.

Parameters:
vertex1 a pointer to the first given vertex
vertex2 a pointer to the second given vertex
edge a pointer to the found edge
Returns:
bool true if the edge can be found, false otherwise

template<typename Vertex, typename Edge, typename Face>
Edge * GraphTriangle< Vertex, Edge, Face >::getEdge Position  i  )  const throw (Exception::IndexOverflow)
 

Return one of the edges of the GraphTriangle.

Parameters:
i the relative index of the edge which should be given back. If i is greater than three, an exception is thrown.
Returns:
Edge* a pointer to the asked vertex

template<typename Vertex, typename Edge, typename Face>
bool GraphTriangle< Vertex, Edge, Face >::getEdges const Vertex vertex,
Edge *&  edge1,
Edge *&  edge2
const throw ()
 

Find the two edges of the GraphTriangle that belong to the given vertex.

Parameters:
vertex a pointer to the given vertex
edge1 a pointer to the first found edge
edge2 a pointer to the second found edge
Returns:
bool true if the edges can be found, false otherwise

template<typename Vertex, typename Edge, typename Face>
Index GraphTriangle< Vertex, Edge, Face >::getIndex  )  const throw ()
 

Return the index of the GraphTriangle.

Returns:
Index the index of the GraphTriangle

template<typename Vertex, typename Edge, typename Face>
Edge * GraphTriangle< Vertex, Edge, Face >::getOppositeEdge const Vertex vertex  )  const throw ()
 

Get the edge of the GraphFace which lies on the opposite side of the given vertex.

Parameters:
vertex a pointer to a vertex of the GraphTriangle
Returns:
Edge* a pointer to the opposite Edge

template<typename Vertex, typename Edge, typename Face>
Vertex * GraphTriangle< Vertex, Edge, Face >::getOppositeVertex const Edge *  edge  )  const throw ()
 

Get the vertex of the GraphFace which lies on the opposite side of the given edge.

Parameters:
edge a pointer to an edge of the GraphTriangle
Returns:
Vertex* a pointer to the opposite vertex

template<typename Vertex, typename Edge, typename Face>
Index GraphTriangle< Vertex, Edge, Face >::getRelativeIndex const Edge *  edge  )  const throw ()
 

Return the relative index of an edge in the GraphTriangle.

Returns:
Index the relative index of the edge

template<typename Vertex, typename Edge, typename Face>
Index GraphTriangle< Vertex, Edge, Face >::getRelativeIndex const Vertex vertex  )  const throw ()
 

Return the relative index of a vertex in the GraphTriangle.

Returns:
Index the relative index of the vertex

template<typename Vertex, typename Edge, typename Face>
Index GraphTriangle< Vertex, Edge, Face >::getSimilarEdge const Edge *  edge,
Edge *&  similar_edge
const throw ()
 

Find the edge of the GraphFace that is similar to the given edge.

Parameters:
edge a pointer to the given edge
similar_edge a pointer to the similar edge of te GraphFace if it can be found, otherwise NULL
Returns:
Index the relative index of the similar edge if it can be found, otherwise -1

template<typename Vertex, typename Edge, typename Face>
Vertex * GraphTriangle< Vertex, Edge, Face >::getVertex Position  i  )  const throw (Exception::IndexOverflow)
 

Return one of the vertices of the GraphTriangle.

Parameters:
i the relative index of the vertex which should be given back. If i is greater than three, an exception is thrown.
Returns:
Vertex* a pointer to the asked vertex

template<typename Vertex, typename Edge, typename Face>
Edge * GraphTriangle< Vertex, Edge, Face >::has Edge *  edge  )  const throw ()
 

Test whether an edge is meber of the face.

Parameters:
edge a pointer to the edge to test
Returns:
Edge* a pointer to the edge if it exists, otherwise NULL

template<typename Vertex, typename Edge, typename Face>
Vertex * GraphTriangle< Vertex, Edge, Face >::has Vertex vertex  )  const throw ()
 

Test whether a vertex is meber of the face.

Parameters:
vertex a pointer to the the vertex to test
Returns:
Vertex* a pointer to the vertex if it exists, otherwise NULL

template<typename Vertex, typename Edge, typename Face>
bool GraphTriangle< Vertex, Edge, Face >::operator *= const Face &   )  const throw () [virtual]
 

Similarity operator.

Returns:
bool true

Reimplemented in RSFace, and Triangle.

template<typename Vertex, typename Edge, typename Face>
bool GraphTriangle< Vertex, Edge, Face >::operator!= const Face &   )  const throw () [virtual]
 

Inequality operator.

Returns:
bool false

Reimplemented in RSFace, and Triangle.

template<typename Vertex, typename Edge, typename Face>
GraphTriangle< Vertex, Edge, Face > & GraphTriangle< Vertex, Edge, Face >::operator= const GraphTriangle< Vertex, Edge, Face > &  face  )  throw ()
 

Assign from another GraphTriangle.

The GraphTriangle object is linked to the neighbours of the GraphTriangle object to assifgn from.

Parameters:
face the GraphTriangle object to assign from

template<typename Vertex, typename Edge, typename Face>
bool GraphTriangle< Vertex, Edge, Face >::operator== const Face &   )  const throw () [virtual]
 

Equality operator.

Returns:
bool true

Reimplemented in RSFace, and Triangle.

template<typename Vertex, typename Edge, typename Face>
void GraphTriangle< Vertex, Edge, Face >::set Vertex vertex1,
Vertex vertex2,
Vertex vertex3,
Edge *  edge1,
Edge *  edge2,
Edge *  edge3,
Index  index
throw ()
 

Assign to a lot of nice objects.

Parameters:
vertex1 assigned to the first vertex
vertex2 assigned to the second vertex
vertex3 assigned to the third vertex
edge1 assigned to the first edge
edge2 assigned to the second edge
edge3 assigned to the third edge
index assigned to the index

template<typename Vertex, typename Edge, typename Face>
void GraphTriangle< Vertex, Edge, Face >::set const GraphTriangle< Vertex, Edge, Face > &  face,
bool  deep = false
throw ()
 

Assign from another GraphTriangle.

Parameters:
face the GraphTriangle object to assign from
deep if deep = false, all pointers are set to NULL (default). Otherwise the GraphTriangle object is linked to the neighbours of the GraphTriangle object to assign from.

template<typename Vertex, typename Edge, typename Face>
void GraphTriangle< Vertex, Edge, Face >::setEdge Position  i,
Edge *  edge
throw (Exception::IndexOverflow)
 

Set one of the edges of the GraphTriangle.

Parameters:
i the relative index of the edge which should be set. If i is greater than three, an exception is thrown.
edge a pointer to the new edge

template<typename Vertex, typename Edge, typename Face>
void GraphTriangle< Vertex, Edge, Face >::setIndex Index  index  )  throw ()
 

Set the index of the GraphTriangle.

Parameters:
index the new index

template<typename Vertex, typename Edge, typename Face>
void GraphTriangle< Vertex, Edge, Face >::setVertex Position  i,
Vertex vertex
throw (Exception::IndexOverflow)
 

Set one of the vertices of the GraphTriangle.

Parameters:
i the relative index of the vertex which should be set. If i is greater three, an exception is thrown.
vertex a pointer to the new vertex

template<typename Vertex, typename Edge, typename Face>
bool GraphTriangle< Vertex, Edge, Face >::substitute const Edge *  old_edge,
Edge *  new_edge
throw ()
 

Substitute an edge by an other one.

Parameters:
old_edge the edge that has to be substituted
new_edge the new edge
Returns:
bool true, if the edge can be substituted, false otherwise

template<typename Vertex, typename Edge, typename Face>
bool GraphTriangle< Vertex, Edge, Face >::substitute const Vertex old_vertex,
Vertex new_vertex
throw ()
 

Substitute a vertex by an other one.

Parameters:
old_vertex the vertex that has to be substituted
new_vertex the new vertex
Returns:
bool true, if the vertex can be substituted, false otherwise

template<typename Vertex, typename Edge, typename Face>
Edge * GraphTriangle< Vertex, Edge, Face >::third const Edge *  e1,
const Edge *  e2
const throw ()
 

Return a pointer to the third edge of the GraphTriangle.

Parameters:
e1 a pointer to the first edge
e2 a pointer to the second edge
Returns:
Edge* a pointer to the third edge

template<typename Vertex, typename Edge, typename Face>
Vertex * GraphTriangle< Vertex, Edge, Face >::third const Vertex v1,
const Vertex v2
const throw ()
 

Return a pointer to the third vertex of the GraphTriangle.

Parameters:
v1 a pointer to the first vertex
v2 a pointer to the second vertex
Returns:
Vertex* a pointer to the third vertex