PrOrganizedPoints Class Reference

PrOrganizedPoints - This class implements an interface to a planar graph embedded in $R^2$ or $R^3$. More...

#include <PrOrganizedPoints.h>

Inheritance diagram for PrOrganizedPoints:

PrExplicitConnectivity PrFastUnorganized_OP PrUnorganized_OP PrPlanarGraph_OP PrRectangularGrid_OP PrTriangulation_OP List of all members.

Pure virtual functions...

virtual int getNumNodes () const=0
 return the number of nodes in the graph.
virtual Vector3D get3dNode (int i) const=0
 return the i-th node in the graph if the nodes are three-dimensional
virtual void set3dNode (int i, const Vector3D &p)=0
 set the coordinates of the i-th node in the graph if the nodes are three-dimensional.
virtual void getNeighbours (int i, std::vector< int > &neighbours) const=0
 Return the indices of the neighbours of the i-th node in: 1.
virtual bool isBoundary (int i) const=0
 is the i-th node a boundary node or interior node?
virtual double getU (int i) const=0
 return the u parameter value of the i-th node.
virtual double getV (int i) const=0
 return the v parameter value of the i-th node.
virtual void setU (int i, double u)=0
 reset the u parameter value of the i-th node.
virtual void setV (int i, double v)=0
 reset the v parameter value of the i-th node.
virtual ~PrOrganizedPoints ()
 Empty default destructor.

Other functions

virtual int findNumBdyNodes () const
 count the number of boundary nodes in the graph.
virtual int findNumEdges () const
 count the number of edges in the graph
int findNumComponents () const
 Compute the number of connected components of the graph.
void labelNode (int i, int ic, std::vector< int > &component) const
 Locate all nodes connnected to node 'i', and mark their corresponding entry in the vector 'component' with the value 'ic'.
int findNumBdyComponents () const
 Compute the number of separate boundaries of the graph.
void labelBdyNode (int i, int ic, std::vector< int > &component) const
 Locate all nodes on the same boundary as the node 'i' (supposedly a boundary node) and mark their corresponding entry in the vector 'component' with the value 'ic'.
int indexComponents (std::vector< int > &component, std::vector< int > &newIndex) const
 Locate all connected components of the graph, give each of them an unique index (starting from 0), and giving all nodes of each component "local" indexes pertaining to that component.
void labelNode (int i, int ic, int &index, std::vector< int > &component, std::vector< int > &newIndex) const
 Locate all nodes in the same connected component as the node 'i', and label their corresponding entries in the vector 'component' with the value 'ic'.
int findIndex (Vector3D &point) const
 find the index of the node whose (x,y,z) point is exactly equal to the given point.
void topologicalDistToBdy (std::vector< int > &label) const
 Compute for each node the number of edges that must be traversed in order to reach the boundary (For boundary edges, this number is 0).
void getCommonNeighbours (int j, int k, std::vector< int > &neighbours) const
 Return the common neighbours of the j-th and k-th node in some arbitrary order.
void get2Neighbours (int i, std::vector< int > &neighbours) const
 Get the 2-neighbours of the node 'i'.
static bool isMinimum (int i, std::vector< int > &face)
 Check if there are any elements of the vector 'face' that are inferior to the value of 'i'.

Public Member Functions

Print routines
virtual void printXYZNodes (std::ostream &os, bool num=0) const
 Print out the XYZ nodes of the graph. If num = true, print first the number of nodes.
virtual void printUVNodes (std::ostream &os, bool num=0) const
 Print out the UV nodes of the graph. If num = 1, print first the number of nodes.
virtual void printUVXYZNodes (std::ostream &os, bool num=0) const
 Print out the nodes of the graph. If num = 1, print first the number of nodes.
virtual void printXYZEdges (std::ostream &os) const
 Print out the edges of the graph.
virtual void printUVEdges (std::ostream &os) const
 Print out the edges of the parametrization.
virtual void printInfo (std::ostream &os) const
 Print general information about this PrOrganizedPoints object (number of nodes, etc.).

Detailed Description

PrOrganizedPoints - This class implements an interface to a planar graph embedded in $R^2$ or $R^3$.

The two common examples are a triangulation and a topologically rectangular grid, but it can also represent point clouds with no explicit connectivity, as long as the boundary is identified. The methods in this class are used by PrParametrize.

Definition at line 52 of file PrOrganizedPoints.h.


Member Function Documentation

virtual void PrOrganizedPoints::getNeighbours ( int  i,
std::vector< int > &  neighbours 
) const [pure virtual]

Return the indices of the neighbours of the i-th node in: 1.

Any anticlockwise order if i is an interior node. 2. The unique anticlockwise order if i is a boundary node. This routine should be implemented in any derived class by first calling clear() followed successively by push_back() on the neighbours vector.

Implemented in PrTriangulation_OP.

Referenced by findNumEdges(), PrExplicitConnectivity::findNumFaces(), PrExplicitConnectivity::isTriangulation(), PrPlanarGraph_OP::PrPlanarGraph_OP(), and PrTriangulation_OP::PrTriangulation_OP().

void PrOrganizedPoints::labelNode ( int  i,
int  ic,
std::vector< int > &  component 
) const

Locate all nodes connnected to node 'i', and mark their corresponding entry in the vector 'component' with the value 'ic'.

Parameters:
i index specifying the node
ic the 'label value' to write to the concerned entries in the 'component' vector
Return values:
component the vector where the labels will be written. Its size should be equal to the number of nodes in the PrOrganizedPoints object before calling this function.

Referenced by findNumComponents().

void PrOrganizedPoints::labelBdyNode ( int  i,
int  ic,
std::vector< int > &  component 
) const

Locate all nodes on the same boundary as the node 'i' (supposedly a boundary node) and mark their corresponding entry in the vector 'component' with the value 'ic'.

Parameters:
i index specifying a boundary node
ic the 'label value' to write to the concerned entries in the 'component' vector
Return values:
component the vector where the labels will be written. Its size should be equal to the number of nodes in the PrOrganizedPoints object before calling this function.

Referenced by findNumBdyComponents().

int PrOrganizedPoints::indexComponents ( std::vector< int > &  component,
std::vector< int > &  newIndex 
) const

Locate all connected components of the graph, give each of them an unique index (starting from 0), and giving all nodes of each component "local" indexes pertaining to that component.

Return values:
component will be resized to number of nodes. Each entry will contain the index of the component in which the corresponding node is located
newIndex will be resized to number of nodes. Each entry will contain the LOCAL index of the corresponding node in the component it belongs to.

void PrOrganizedPoints::labelNode ( int  i,
int  ic,
int &  index,
std::vector< int > &  component,
std::vector< int > &  newIndex 
) const

Locate all nodes in the same connected component as the node 'i', and label their corresponding entries in the vector 'component' with the value 'ic'.

These nodes are also given "local" indexes for that coponent. These indexes will be written to the corresponding entries of the 'newIndex' vector.

Parameters:
i the index of the node specifying the connected component to examine.
ic the label to give to the entries in the 'component'-vector that correspond with nodes in the specified connected component.
index start value for local indexing of nodes within the component.
Return values:
component this vector is where the labeling is written. Before calling the function, the user should ensure that its size is equal to the total number of nodes in the graph.
newIndex this vector is where the new local coordinates are written. Before calling the function, the user should ensure that its size is equal to the total number of nodes in the graph.

int PrOrganizedPoints::findIndex ( Vector3D &  point  )  const

find the index of the node whose (x,y,z) point is exactly equal to the given point.

This can be useful for relocating "corner" points after triangulating (if the graph is a triangulation).

void PrOrganizedPoints::topologicalDistToBdy ( std::vector< int > &  label  )  const

Compute for each node the number of edges that must be traversed in order to reach the boundary (For boundary edges, this number is 0).

Return values:
label this vector will contain the computed number for each node. Its size will therefore be equal to the number of nodes.


The documentation for this class was generated from the following files:
Generated on Tue Jun 12 11:05:05 2007 for GoTools Parametrization Library by  doxygen 1.5.1