#include <PrTriangulation_OP.h>
Inheritance diagram for PrTriangulation_OP:
Public Member Functions | |
PrTriangulation_OP () | |
Default constructor. | |
PrTriangulation_OP (double *xyz_points, int np, int *triangles, int nt) | |
Constructor.Construct the PrTriangulation_OP from an array of nodes and an array of triangles. | |
PrTriangulation_OP (double *xyz_points, double *uv_points, int np, int *triangles, int nt) | |
Constructor.Construct the PrTriangulation_OP from an array of nodes and an array of triangles. | |
PrTriangulation_OP (PrExplicitConnectivity &op) | |
Constructor. | |
~PrTriangulation_OP () | |
Derived from base class | |
virtual int | getNumNodes () const |
return the number of nodes in the graph. | |
virtual Vector3D | get3dNode (int i) const |
return the i-th node in the graph if the nodes are three-dimensional | |
virtual void | set3dNode (int i, const Vector3D &p) |
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 |
Return the indices of the neighbours of the i-th node in: 1. | |
virtual bool | isBoundary (int i) const |
is the i-th node a boundary node or interior node? | |
virtual int | findNumFaces () const |
count the number of faces in the graph | |
virtual double | getU (int i) const |
return the u parameter value of the i-th node. | |
virtual double | getV (int i) const |
return the v parameter value of the i-th node. | |
virtual void | setU (int i, double u) |
reset the u parameter value of the i-th node. | |
virtual void | setV (int i, double v) |
reset the v parameter value of the i-th node. | |
Other functions | |
virtual void | getTriangles (int i, Go::ScratchVect< int, 20 > &triangles) const |
Get all triangles that are incident with node 'i'. | |
bool | swapTriangles (int t1, int t2) |
swap triangle t1 and t2 | |
void | swapNodes (int n1, int n2) |
swap node n1 and n2 | |
bool | splitTriangles (int t1, int t2, Vector3D &v) |
splits the common edge of triangles t1 and t2 and inserts the new vertex v there. | |
bool | splitVertex (int i, int j, std::vector< int > &new_nodes) |
Split the boundary vertex indexed 'i' into two, and replace the edge between 'i' and 'j' with two boundary edges. | |
PrNode & | getPrNode (int i) |
Get reference to node indexed 'i'. | |
const PrNode & | getPrNode (int i) const |
const PrTriangle & | getPrTriangle (int i) const |
Get reference to triangle indexed 'i'. | |
PrTriangle & | getPrTriangle (int i) |
Get reference to triangle indexed 'i'. | |
std::vector< PrTriangle > & | getTriangleArray () |
Get reference to all triangles in the triangulation. | |
std::vector< PrNode > & | getNodeArray () |
Get reference to all nodes in the triangulation. | |
void | printXYZTriangles (std::ostream &os, bool num=false) const |
Print out the triangles of the graph, useful for plotting If num = 1, print first the number of triangles. | |
void | printUVTriangles (std::ostream &os, bool num=false) const |
Print out the uv triangles of the graph, useful for plotting If num = 1, print first the number of triangles. | |
void | print (std::ostream &os) const |
print whole class | |
void | scan (std::istream &is) |
scan whole class | |
void | printRawData (std::ostream &os) const |
print minimum data | |
void | scanRawData (std::istream &is) |
scan minimum data | |
void | printUV (std::ostream &os) const |
for converting uv to xyz with z=0 |
It implements the virtual functions in PrOrganizedPoints. This kind of triangulation can be parametrized by PrParametrize.
Definition at line 48 of file PrTriangulation_OP.h.
PrTriangulation_OP::PrTriangulation_OP | ( | double * | xyz_points, | |
int | np, | |||
int * | triangles, | |||
int | nt | |||
) |
Constructor.Construct the PrTriangulation_OP from an array of nodes and an array of triangles.
The nodes array should contain x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,... and the triangle array i0,j0,k0,i1,j1,k1,i2,j2,k2,i3,j3,.... where the i-th node is the 3D point (xi,yi,zi) and the r-th triangle has the three nodes indexed ir, jr, and kr in the node array. These nodes must be ordered anticlockwise (consistently throughout the triangulation). The length of the array "xyz_points" is 3 * np and the length of the array "triangles" is 3 * nt. The uv points for the nodes are set to zero.
The function buildTopology is called which finds the three neighbouring triangles of each triangle and the first triangle of each node.
Definition at line 146 of file PrTriangulation_OP.C.
PrTriangulation_OP::PrTriangulation_OP | ( | double * | xyz_points, | |
double * | uv_points, | |||
int | np, | |||
int * | triangles, | |||
int | nt | |||
) |
Constructor.Construct the PrTriangulation_OP from an array of nodes and an array of triangles.
The xyz_points array should contain x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,... The uv_points array should contain u0,v0,u1,v1,u2,v2,u3,... and the triangle array i0,j0,k0,i1,j1,k1,i2,j2,k2,i3,j3,.... where the i-th node is the 3D point (xi,yi,zi) and the r-th triangle has the three nodes indexed ir, jr, and kr in the node array. These nodes must be ordered anticlockwise (consistently throughout the triangulation). The length of the array "xyzpoints" is 3 * np and The length of the array "uv_points" is 2 * np and the length of the array "triangles" is 3 * nt.
The function buildTopology is called which finds the three neighbouring triangles of each triangle and the first triangle of each node.
Definition at line 207 of file PrTriangulation_OP.C.
PrTriangulation_OP::PrTriangulation_OP | ( | PrExplicitConnectivity & | op | ) |
Constructor.
Construct the PrTriangulation_OP from a PrExplicitConnectivity class ASSUMING the PrOrganizedPoints class is a triangulation (every face has three vertices).
Definition at line 268 of file PrTriangulation_OP.C.
References PrExplicitConnectivity::findNumFaces(), PrOrganizedPoints::get3dNode(), PrOrganizedPoints::getNeighbours(), PrOrganizedPoints::getNumNodes(), PrOrganizedPoints::getU(), PrOrganizedPoints::getV(), and PrOrganizedPoints::isBoundary().
virtual void PrTriangulation_OP::getNeighbours | ( | int | i, | |
std::vector< int > & | neighbours | |||
) | const [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.
Implements PrOrganizedPoints.
bool PrTriangulation_OP::splitVertex | ( | int | i, | |
int | j, | |||
std::vector< int > & | new_nodes | |||
) |
Split the boundary vertex indexed 'i' into two, and replace the edge between 'i' and 'j' with two boundary edges.
The requirements are that node 'i' should be on the boundary, and 'j' should share an edge with 'i'.