BALL::GraphVertex< Vertex, Edge, Face > Class Template Reference

#include <BALL/STRUCTURE/graphVertex.h>

List of all members.

Public Types

Type definitions
typedef HashSet< Edge * >::Iterator EdgeIterator
typedef HashSet< Edge * >
::ConstIterator 
ConstEdgeIterator
typedef HashSet< Face * >::Iterator FaceIterator
typedef HashSet< Face * >
::ConstIterator 
ConstFaceIterator

Public Member Functions

Constructors and Destructors
 GraphVertex ()
 GraphVertex (const GraphVertex< Vertex, Edge, Face > &vertex, bool deep=false)
virtual ~GraphVertex ()
Assignment
void set (const GraphVertex< Vertex, Edge, Face > &vertex, bool deep=false)
GraphVertex< Vertex, Edge, Face > & operator= (const GraphVertex< Vertex, Edge, Face > &vertex)
Accessors
void insert (Edge *edge)
void insert (Face *face)
void remove (Edge *edge)
void remove (Face *face)
Position numberOfEdges () const
Position numberOfFaces () const
void setIndex (Index index)
Index getIndex () const
bool join (const Vertex &vertex)
bool substitute (Vertex *vertex)
Predicates
virtual bool operator== (const Vertex &) const
virtual bool operator!= (const Vertex &) const
virtual bool operator*= (const Vertex &) const
Face * has (Face *face) const
Edge * has (Edge *edge) const
bool hasEdges () const
bool hasFaces () const

Friends

Class friends
  • class GraphEdge<Vertex,Edge,Face>;
  • class GraphFace<Vertex,Edge,Face>;
  • class GraphTriangle<Vertex,Edge,Face>;
class GraphEdge< Vertex, Edge, Face >
class GraphFace< Vertex, Edge, Face >
class GraphTriangle< Vertex, Edge, Face >

External Iterators

HashSet< Edge * > edges_
HashSet< Face * > faces_
Index index_
EdgeIterator beginEdge ()
ConstEdgeIterator beginEdge () const
EdgeIterator endEdge ()
ConstEdgeIterator endEdge () const
FaceIterator beginFace ()
ConstFaceIterator beginFace () const
FaceIterator endFace ()
ConstFaceIterator endFace () const

Detailed Description

template<typename Vertex, typename Edge, typename Face>
class BALL::GraphVertex< Vertex, Edge, Face >

Generic GraphVertex Class.


Member Typedef Documentation

template<typename Vertex, typename Edge, typename Face>
typedef HashSet<Edge*>::ConstIterator BALL::GraphVertex< Vertex, Edge, Face >::ConstEdgeIterator
template<typename Vertex, typename Edge, typename Face>
typedef HashSet<Face*>::ConstIterator BALL::GraphVertex< Vertex, Edge, Face >::ConstFaceIterator
template<typename Vertex, typename Edge, typename Face>
typedef HashSet<Edge*>::Iterator BALL::GraphVertex< Vertex, Edge, Face >::EdgeIterator
template<typename Vertex, typename Edge, typename Face>
typedef HashSet<Face*>::Iterator BALL::GraphVertex< Vertex, Edge, Face >::FaceIterator

Constructor & Destructor Documentation

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

Default constructor. This method creates a new GraphVertex object.

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

Copy constructor. Create a new GraphVertex object from another.

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

References BALL::GraphVertex< Vertex, Edge, Face >::edges_, and BALL::GraphVertex< Vertex, Edge, Face >::faces_.

template<typename Vertex , typename Edge , typename Face >
BALL::GraphVertex< Vertex, Edge, Face >::~GraphVertex ( ) [virtual]

Destructor. Destructs the GraphVertex object.


Member Function Documentation

template<typename Vertex , typename Edge , typename Face >
GraphVertex< Vertex, Edge, Face >::EdgeIterator BALL::GraphVertex< Vertex, Edge, Face >::beginEdge ( )
template<typename Vertex , typename Edge , typename Face >
GraphVertex< Vertex, Edge, Face >::ConstEdgeIterator BALL::GraphVertex< Vertex, Edge, Face >::beginEdge ( ) const
template<typename Vertex , typename Edge , typename Face >
GraphVertex< Vertex, Edge, Face >::FaceIterator BALL::GraphVertex< Vertex, Edge, Face >::beginFace ( )
template<typename Vertex , typename Edge , typename Face >
GraphVertex< Vertex, Edge, Face >::ConstFaceIterator BALL::GraphVertex< Vertex, Edge, Face >::beginFace ( ) const
template<typename Vertex , typename Edge , typename Face >
GraphVertex< Vertex, Edge, Face >::EdgeIterator BALL::GraphVertex< Vertex, Edge, Face >::endEdge ( )
template<typename Vertex , typename Edge , typename Face >
GraphVertex< Vertex, Edge, Face >::ConstEdgeIterator BALL::GraphVertex< Vertex, Edge, Face >::endEdge ( ) const
template<typename Vertex , typename Edge , typename Face >
GraphVertex< Vertex, Edge, Face >::ConstFaceIterator BALL::GraphVertex< Vertex, Edge, Face >::endFace ( ) const
template<typename Vertex , typename Edge , typename Face >
GraphVertex< Vertex, Edge, Face >::FaceIterator BALL::GraphVertex< Vertex, Edge, Face >::endFace ( )
template<typename Vertex , typename Edge , typename Face >
Index BALL::GraphVertex< Vertex, Edge, Face >::getIndex ( ) const

Return the index of the vertex.

Returns:
Index the index of the vertex

References BALL::GraphVertex< Vertex, Edge, Face >::index_.

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

Test whether the vertex is meber of a given edge.

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

References BALL::HashSet< Key >::begin(), BALL::GraphVertex< Vertex, Edge, Face >::edges_, and BALL::HashSet< Key >::end().

template<typename Vertex , typename Edge , typename Face>
Face * BALL::GraphVertex< Vertex, Edge, Face >::has ( Face *  face) const

Test whether the vertex is meber of a given face.

Parameters:
facea pointer to the the face to be tested
Returns:
Face* a pointer to the face if it exists, otherwise NULL

References BALL::HashSet< Key >::begin(), BALL::HashSet< Key >::end(), and BALL::GraphVertex< Vertex, Edge, Face >::faces_.

template<typename Vertex , typename Edge , typename Face >
bool BALL::GraphVertex< Vertex, Edge, Face >::hasEdges ( ) const

Test whether the vertex has edges.

References BALL::GraphVertex< Vertex, Edge, Face >::edges_, and BALL::HashSet< Key >::isEmpty().

template<typename Vertex , typename Edge , typename Face >
bool BALL::GraphVertex< Vertex, Edge, Face >::hasFaces ( ) const

Test whether the vertex has faces.

References BALL::GraphVertex< Vertex, Edge, Face >::faces_, and BALL::HashSet< Key >::isEmpty().

template<typename Vertex , typename Edge, typename Face >
void BALL::GraphVertex< Vertex, Edge, Face >::insert ( Edge *  edge)

Insert a new edge into the HashSet of edges the GraphVertex belongs to.

Parameters:
edgea pointer to the new edge

References BALL::GraphVertex< Vertex, Edge, Face >::edges_, and BALL::HashSet< Key >::insert().

template<typename Vertex , typename Edge, typename Face>
void BALL::GraphVertex< Vertex, Edge, Face >::insert ( Face *  face)

Insert a new face into the HashSet of faces the GraphVertex belongs to.

Parameters:
facea pointer to the new face

References BALL::GraphVertex< Vertex, Edge, Face >::faces_, and BALL::HashSet< Key >::insert().

template<typename Vertex, typename Edge , typename Face >
bool BALL::GraphVertex< Vertex, Edge, Face >::join ( const Vertex vertex)

Join two GraphVertices if they are similar. All edges and faces of the given Vertex are inserted.

Parameters:
vertexthe Vertex to join with
Returns:
bool true if the vertices can be joined, false otherwise

References BALL::GraphVertex< Vertex, Edge, Face >::edges_, BALL::GraphVertex< Vertex, Edge, Face >::faces_, and BALL::HashSet< Key >::insert().

template<typename Vertex , typename Edge , typename Face >
Position BALL::GraphVertex< Vertex, Edge, Face >::numberOfEdges ( ) const

Return the number of edges the GraphVertex belongs to.

Returns:
Position the number of edges the GraphVertex belongs to

References BALL::GraphVertex< Vertex, Edge, Face >::edges_, and BALL::HashSet< Key >::size().

template<typename Vertex , typename Edge , typename Face >
Position BALL::GraphVertex< Vertex, Edge, Face >::numberOfFaces ( ) const

Return the number of faces the GraphVertex belongs to.

Returns:
Position the number of faces the GraphVertex belongs to

References BALL::GraphVertex< Vertex, Edge, Face >::faces_, and BALL::HashSet< Key >::size().

template<typename Vertex, typename Edge , typename Face >
bool BALL::GraphVertex< Vertex, Edge, Face >::operator!= ( const Vertex ) const [virtual]

Inequality operator.

Returns:
bool false

Reimplemented in BALL::RSVertex, BALL::SASVertex, BALL::SESVertex, and BALL::TrianglePoint.

template<typename Vertex, typename Edge , typename Face >
bool BALL::GraphVertex< Vertex, Edge, Face >::operator*= ( const Vertex ) const [virtual]

Similarity operator.

Returns:
bool true

Reimplemented in BALL::RSVertex, BALL::SASVertex, BALL::SESVertex, and BALL::TrianglePoint.

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

Assign from another GraphVertex. The GraphVertex object is linked to the neighbours of the GraphVertex object to assign from.

Parameters:
vertexthe GraphVertex object to assign from

References BALL::GraphVertex< Vertex, Edge, Face >::edges_, BALL::GraphVertex< Vertex, Edge, Face >::faces_, and BALL::GraphVertex< Vertex, Edge, Face >::index_.

template<typename Vertex, typename Edge , typename Face >
bool BALL::GraphVertex< Vertex, Edge, Face >::operator== ( const Vertex ) const [virtual]

Equality operator.

Returns:
bool true

Reimplemented in BALL::RSVertex, BALL::SASVertex, BALL::SESVertex, and BALL::TrianglePoint.

template<typename Vertex , typename Edge, typename Face>
void BALL::GraphVertex< Vertex, Edge, Face >::remove ( Face *  face)

Remove a face from the HashSet of faces the GraphVertex belongs to.

Parameters:
facea pointer to the face to remove

References BALL::HashSet< Key >::erase(), and BALL::GraphVertex< Vertex, Edge, Face >::faces_.

template<typename Vertex , typename Edge, typename Face >
void BALL::GraphVertex< Vertex, Edge, Face >::remove ( Edge *  edge)

Remove an edge from the HashSet of edges the GraphVertex belongs to.

Parameters:
edgea pointer to the edge to remove

References BALL::GraphVertex< Vertex, Edge, Face >::edges_, and BALL::HashSet< Key >::erase().

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

Assign from another GraphVertex.

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

References BALL::GraphVertex< Vertex, Edge, Face >::edges_, BALL::GraphVertex< Vertex, Edge, Face >::faces_, and BALL::GraphVertex< Vertex, Edge, Face >::index_.

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

Set the index of the vertex.

Parameters:
indexthe new index

References BALL::GraphVertex< Vertex, Edge, Face >::index_.

template<typename Vertex, typename Edge , typename Face >
bool BALL::GraphVertex< Vertex, Edge, Face >::substitute ( Vertex vertex)

Subsitute the GraphVertex by a similar one. The GraphVertex is substituted in all his Edges and Faces.

Parameters:
vertexa pointer to the vertex to substitute
Returns:
bool true if the vertex can be substituted, false otherwise

References BALL::HashSet< Key >::begin(), BALL::GraphVertex< Vertex, Edge, Face >::edges_, BALL::HashSet< Key >::end(), and BALL::GraphVertex< Vertex, Edge, Face >::faces_.


Friends And Related Function Documentation

template<typename Vertex, typename Edge, typename Face>
friend class GraphEdge< Vertex, Edge, Face > [friend]
template<typename Vertex, typename Edge, typename Face>
friend class GraphFace< Vertex, Edge, Face > [friend]
template<typename Vertex, typename Edge, typename Face>
friend class GraphTriangle< Vertex, Edge, Face > [friend]

Member Data Documentation