BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Protected Attributes | List of all members
BALL::GraphTriangle< Vertex, Edge, Face > Class Template Reference

#include <BALL/STRUCTURE/graphEdge.h>

Public Member Functions

Constructors and Destructors
 GraphTriangle ()
 
 GraphTriangle (const GraphTriangle< Vertex, Edge, Face > &face, bool deep=false)
 
 GraphTriangle (Vertex *vertex1, Vertex *vertex2, Vertex *vertex3, Edge *edge1, Edge *edge2, Edge *edge3, Index index)
 
virtual ~GraphTriangle ()
 
Assignment
void set (const GraphTriangle< Vertex, Edge, Face > &face, bool deep=false)
 
GraphTriangle< Vertex, Edge,
Face > & 
operator= (const GraphTriangle< Vertex, Edge, Face > &face)
 
void set (Vertex *vertex1, Vertex *vertex2, Vertex *vertex3, Edge *edge1, Edge *edge2, Edge *edge3, Index index)
 
Accessors
void setVertex (Position i, Vertex *vertex) throw (Exception::IndexOverflow)
 
VertexgetVertex (Position i) const throw (Exception::IndexOverflow)
 
void setEdge (Position i, Edge *edge) throw (Exception::IndexOverflow)
 
Edge * getEdge (Position i) const throw (Exception::IndexOverflow)
 
void setIndex (Index index)
 
Index getIndex () const
 
bool getEdges (const Vertex *vertex, Edge *&edge1, Edge *&edge2) const
 
bool getEdge (const Vertex *vertex1, const Vertex *vertex2, Edge *&edge) const
 
Index getSimilarEdge (const Edge *edge, Edge *&similar_edge) const
 
Index getRelativeIndex (const Vertex *vertex) const
 
Index getRelativeIndex (const Edge *edge) const
 
Vertexthird (const Vertex *v1, const Vertex *v2) const
 
Edge * third (const Edge *e1, const Edge *e2) const
 
Edge * getOppositeEdge (const Vertex *vertex) const
 
VertexgetOppositeVertex (const Edge *edge) const
 
bool substitute (const Vertex *old_vertex, Vertex *new_vertex)
 
bool substitute (const Edge *old_edge, Edge *new_edge)
 
Predicates
virtual bool operator== (const Face &) const
 
virtual bool operator!= (const Face &) const
 
virtual bool operator*= (const Face &) const
 
Vertexhas (Vertex *vertex) const
 
Edge * has (Edge *edge) const
 

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 BALL::GraphTriangle< Vertex, Edge, Face >

Generic GraphTriangle Class.

Definition at line 24 of file graphEdge.h.

Constructor & Destructor Documentation

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

Default constructor. This method creates a new GraphTriangle object.

Definition at line 901 of file graphFace.h.

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

Copy constructor. Create a new GraphTriangle object from another.

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

Definition at line 915 of file graphFace.h.

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

Detailled constructor. Create a new GraphTriangle object from some nice objects

Parameters
vertex1assigned to the first vertex
vertex2assigned to the second vertex
vertex3assigned to the third vertex
edge1assigned to the first edge
edge2assigned to the second edge
edge3assigned to the third edge
indexassigned to the index

Definition at line 941 of file graphFace.h.

template<typename Vertex , typename Edge , typename Face >
BALL::GraphTriangle< Vertex, Edge, Face >::~GraphTriangle ( )
virtual

Destructor. Destructs the GraphTriangle object.

Definition at line 956 of file graphFace.h.

Member Function Documentation

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

Return one of the edges of the GraphTriangle.

Parameters
ithe 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

Definition at line 1070 of file graphFace.h.

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

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

Parameters
vertex1a pointer to the first given vertex
vertex2a pointer to the second given vertex
edgea pointer to the found edge
Returns
bool true if the edge can be found, false otherwise

Definition at line 1142 of file graphFace.h.

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

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

Parameters
vertexa pointer to the given vertex
edge1a pointer to the first found edge
edge2a pointer to the second found edge
Returns
bool true if the edges can be found, false otherwise

Definition at line 1100 of file graphFace.h.

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

Return the index of the GraphTriangle.

Returns
Index the index of the GraphTriangle

Definition at line 1092 of file graphFace.h.

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

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

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

Definition at line 1267 of file graphFace.h.

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

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

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

Definition at line 1283 of file graphFace.h.

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

Return the relative index of a vertex in the GraphTriangle.

Returns
Index the relative index of the vertex

Definition at line 1193 of file graphFace.h.

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

Return the relative index of an edge in the GraphTriangle.

Returns
Index the relative index of the edge

Definition at line 1208 of file graphFace.h.

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

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

Parameters
edgea pointer to the given edge
similar_edgea 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

Definition at line 1169 of file graphFace.h.

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

Return one of the vertices of the GraphTriangle.

Parameters
ithe 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

Definition at line 1040 of file graphFace.h.

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

Test whether a vertex is meber of the face.

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

Definition at line 1351 of file graphFace.h.

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

Test whether an edge is meber of the face.

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

Definition at line 1370 of file graphFace.h.

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

Inequality operator.

Returns
bool false

Reimplemented in BALL::RSFace, and BALL::Triangle.

Definition at line 1337 of file graphFace.h.

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

Similarity operator.

Returns
bool true

Reimplemented in BALL::RSFace, and BALL::Triangle.

Definition at line 1344 of file graphFace.h.

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

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

Parameters
facethe GraphTriangle object to assign from

Definition at line 992 of file graphFace.h.

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

Equality operator.

Returns
bool true

Reimplemented in BALL::RSFace, and BALL::Triangle.

Definition at line 1330 of file graphFace.h.

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

Assign from another GraphTriangle.

Parameters
facethe GraphTriangle object to assign from
deepif 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.

Definition at line 963 of file graphFace.h.

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

Assign to a lot of nice objects

Parameters
vertex1assigned to the first vertex
vertex2assigned to the second vertex
vertex3assigned to the third vertex
edge1assigned to the first edge
edge2assigned to the second edge
edge3assigned to the third edge
indexassigned to the index

Definition at line 1010 of file graphFace.h.

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

Set one of the edges of the GraphTriangle.

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

Definition at line 1055 of file graphFace.h.

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

Set the index of the GraphTriangle.

Parameters
indexthe new index

Definition at line 1085 of file graphFace.h.

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

Set one of the vertices of the GraphTriangle.

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

Definition at line 1025 of file graphFace.h.

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

Substitute a vertex by an other one.

Parameters
old_vertexthe vertex that has to be substituted
new_vertexthe new vertex
Returns
bool true, if the vertex can be substituted, false otherwise

Definition at line 1299 of file graphFace.h.

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

Substitute an edge by an other one.

Parameters
old_edgethe edge that has to be substituted
new_edgethe new edge
Returns
bool true, if the edge can be substituted, false otherwise

Definition at line 1315 of file graphFace.h.

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

Return a pointer to the third vertex of the GraphTriangle.

Parameters
v1a pointer to the first vertex
v2a pointer to the second vertex
Returns
Vertex* a pointer to the third vertex

Definition at line 1223 of file graphFace.h.

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

Return a pointer to the third edge of the GraphTriangle.

Parameters
e1a pointer to the first edge
e2a pointer to the second edge
Returns
Edge* a pointer to the third edge

Definition at line 1245 of file graphFace.h.

Friends And Related Function Documentation

template<typename Vertex, typename Edge, typename Face>
friend class GraphEdge< Vertex, Edge, Face >
friend

Definition at line 635 of file graphFace.h.

template<typename Vertex, typename Edge, typename Face>
friend class GraphVertex< Vertex, Edge, Face >
friend

Definition at line 634 of file graphFace.h.

Member Data Documentation

template<typename Vertex, typename Edge, typename Face>
Edge* BALL::GraphTriangle< Vertex, Edge, Face >::edge_[3]
protected

Definition at line 891 of file graphFace.h.

template<typename Vertex, typename Edge, typename Face>
Index BALL::GraphTriangle< Vertex, Edge, Face >::index_
protected

Definition at line 894 of file graphFace.h.

template<typename Vertex, typename Edge, typename Face>
Vertex* BALL::GraphTriangle< Vertex, Edge, Face >::vertex_[3]
protected

Definition at line 888 of file graphFace.h.