PrParametrizeBdy Class Reference

This class implements an algorithm for parametrizing the boundary of a planar graph in $R^3$. More...

#include <PrParametrizeBdy.h>

List of all members.

Public Member Functions

 PrParametrizeBdy ()
 Default constructor.
virtual ~PrParametrizeBdy ()
 Empty default constructor.
virtual void attach (boost::shared_ptr< PrOrganizedPoints > graph)
 Set the graph.
void setParamKind (PrBdyParamKind bdyparamtype=PrCHORDLENGTHBDY)
 Set type of parametrization to be used along the boundary.
double boundaryLength (int i1, int i2)
 Calculate the "length" of the section of the xyz boundary between nodes boundary i and j according to the kind of parametrization specified by setParamKind().
bool parametrize ()
 Parametrize the boundary of the planar graph.
bool parametrizeSide (int i1, int i2)
 Parametrize the boundary nodes between two boundary nodes i1,i2 of a given planar graph by chord length.
bool parametrize (int c1, int c2, int c3, int c4, double umin=0.0, double umax=1.0, double vmin=0.0, double vmax=1.0)
 Parametrize the boundary of the given planar graph.
void findCornersFromXYZ (int *c)
 Find four corner nodes c[0],c[1],c[2],c[3] by taking c[0] to be an arbitrary boundary node and choosing c[1],c[2],c[3] so that the lengths of four boundary curves delimited by c[0],c[1],c[2],c[3] are as equal in "chord" length (defined by setParamKind()) as possible.
void findCornersFromUV (int *c)
 Find the indices c[0],c[1],c[2],c[3] of the four vertices of the graph whose (u,v) points are the furthest SW, SE, NE, and NW in that order.

Protected Member Functions

int findBdyNode ()
 Find the bounday node with the least index.
int getNextBdyNode (int i)
 Given a boundary node i, return the next boundary node in an anticlockwise direction around the boundary.
double chord (const Vector3D &a, const Vector3D &b)
 Return "length" of chord between two points in $R^3$.

Protected Attributes

PrBdyParamKind bdyparamtype_
boost::shared_ptr< PrOrganizedPointsg_
vector< int > neighbours_


Detailed Description

This class implements an algorithm for parametrizing the boundary of a planar graph in $R^3$.

Typical choices are uniform and chord length, either round the whole boundary or along each "side".

Definition at line 53 of file PrParametrizeBdy.h.


Member Function Documentation

void PrParametrizeBdy::setParamKind ( PrBdyParamKind  bdyparamtype = PrCHORDLENGTHBDY  )  [inline]

Set type of parametrization to be used along the boundary.

Unless you have a strong reason to do so you should set the parametrization to "PrCHORDLENGTHBDY". (Other choices are PrCENTRIPETAL and PrUNIFBDY).

Definition at line 88 of file PrParametrizeBdy.h.

References bdyparamtype_.

double PrParametrizeBdy::boundaryLength ( int  i1,
int  i2 
)

Calculate the "length" of the section of the xyz boundary between nodes boundary i and j according to the kind of parametrization specified by setParamKind().

Choices are PrCHORDLENGTHBDY, PrCENTRIPETAL and PrUNIFBDY.

Definition at line 85 of file PrParametrizeBdy.C.

References chord(), g_, and getNextBdyNode().

Referenced by findCornersFromXYZ(), parametrize(), and parametrizeSide().

bool PrParametrizeBdy::parametrize (  ) 

Parametrize the boundary of the planar graph.

The parameter domain will be the unit circle.

Definition at line 129 of file PrParametrizeBdy.C.

References boundaryLength(), chord(), findBdyNode(), g_, and getNextBdyNode().

bool PrParametrizeBdy::parametrizeSide ( int  i1,
int  i2 
)

Parametrize the boundary nodes between two boundary nodes i1,i2 of a given planar graph by chord length.

The two nodes i1 and i2 are assumed to be have u and v values. The boundary parameter points between i1 and i2, starting from i1 in an anticlockwise direction around the boundary, will be placed along the straight line between the two parameter points.

Definition at line 170 of file PrParametrizeBdy.C.

References boundaryLength(), chord(), g_, getNextBdyNode(), and neighbours_.

Referenced by parametrize().

bool PrParametrizeBdy::parametrize ( int  c1,
int  c2,
int  c3,
int  c4,
double  umin = 0.0,
double  umax = 1.0,
double  vmin = 0.0,
double  vmax = 1.0 
)

Parametrize the boundary of the given planar graph.

The parameter domain will be the rectangle [umin,umax]*[vmin,vmax]. Node c1 will be mapped to (umin,vmin), c2 to (umax,vmin), c3 to (umax,vmax) and c4 to (umin,vmax). The nodes c1,c2,c3,c4 should be boundary nodes and should be in anticlockwise sequence around the boundary. The kind of parametrization along the four sides of the square will be specified by setParamKind().

Definition at line 216 of file PrParametrizeBdy.C.

References g_, and parametrizeSide().

void PrParametrizeBdy::findCornersFromXYZ ( int *  c  ) 

Find four corner nodes c[0],c[1],c[2],c[3] by taking c[0] to be an arbitrary boundary node and choosing c[1],c[2],c[3] so that the lengths of four boundary curves delimited by c[0],c[1],c[2],c[3] are as equal in "chord" length (defined by setParamKind()) as possible.

The array c should be allocated outside with length 4.

Definition at line 251 of file PrParametrizeBdy.C.

References boundaryLength(), chord(), findBdyNode(), g_, and getNextBdyNode().

void PrParametrizeBdy::findCornersFromUV ( int *  c  ) 

Find the indices c[0],c[1],c[2],c[3] of the four vertices of the graph whose (u,v) points are the furthest SW, SE, NE, and NW in that order.

The array c should be allocated outside with length 4.

Definition at line 284 of file PrParametrizeBdy.C.

References g_.


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