#include <xsi_polygonface.h>
An array of PolygonFace objects representing the polygons in a polygon mesh.
using namespace MATH; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube ); PolygonMesh mesh( myCube.GetActivePrimitive().GetGeometry() ); CPolygonFaceRefArray polygons( mesh.GetPolygons() ); CVector3Array normArray = polygons.GetNormalArray(); app.LogMessage( polygons.GetClassIDName() ); app.LogMessage( CValue((LONG)normArray.GetCount()).GetAsText() ); for (LONG i=0; i<normArray.GetCount(); ++i) { app.LogMessage(L"Normal " + CValue((LONG)i).GetAsText() ); app.LogMessage( CValue(normArray[i].GetX()).GetAsText() + L"," + CValue(normArray[i].GetY()).GetAsText() + L"," + CValue(normArray[i].GetZ()).GetAsText() ); }
Public Member Functions |
|
CPolygonFaceRefArray (const CPolygonFaceRefArray &in_array) | |
CRef | GetItem (LONG in_index) const |
CRef | GetItem (const CString &in_name) const |
LONG | GetCount () const |
bool | IsValid () const |
MATH::CVector3Array | GetNormalArray () const |
CVertexRefArray | GetNeighborVertices (LONG in_lDistance=1) const |
CEdgeRefArray | GetNeighborEdges (LONG in_lDistance=1) const |
CPolygonFaceRefArray | GetNeighborPolygons (LONG in_lDistance=1) const |
CPolygonFaceRefArray | GrowNeighborPolygons (LONG in_lDistance=1) const |
MATH::CVector3Array | GetPolygonNodeNormalArray () const |
CLongArray | GetPolygonNodePolygonFaceIndexArray () const |
CPolygonFaceRefArray | ( | const CPolygonFaceRefArray & | in_array | ) |
Copy constructor.
in_array | constant CPolygonFaceRefArray reference object. |
CRef GetItem | ( | LONG | in_index | ) | const [virtual] |
Returns a PolygonFace object at a specified index in the array.
in_index | The index of the PolygonFace. |
Reimplemented from CFacetRefArray.
Returns the PolygonFace object matching the specified name.
in_name | The name of the PolygonFace. |
Reimplemented from CFacetRefArray.
LONG GetCount | ( | ) | const [virtual] |
Returns the number of PolygonFace objects in the array.
Reimplemented from CFacetRefArray.
bool IsValid | ( | ) | const [virtual] |
Returns true if this array is a valid object or false otherwise.
Reimplemented from CFacetRefArray.
MATH::CVector3Array GetNormalArray | ( | ) | const |
Returns an array of normals expressed with CVector3 objects.
Reimplemented from CFacetRefArray.
CVertexRefArray GetNeighborVertices | ( | LONG | in_lDistance = 1 |
) | const |
CEdgeRefArray GetNeighborEdges | ( | LONG | in_lDistance = 1 |
) | const |
CPolygonFaceRefArray GetNeighborPolygons | ( | LONG | in_lDistance = 1 |
) | const |
Returns an array of PolygonFace neighbors within a given distance.
in_lDistance | Value representing the degree of neighborhood (eg: degree=2 for a polygon means its adjacent vertices plus the adjacent vertices of the adjacent polygons). |
CPolygonFaceRefArray GrowNeighborPolygons | ( | LONG | in_lDistance = 1 |
) | const |
Returns an array of PolygonFace objects that are adjacent to each PolygonFace objects of this array, within a given distance.
in_lDistance | Value representing the degree of neighborhood (eg: degree=2 for a polygon means its adjacent vertices plus the adjacent vertices of the adjacent polygons). |
MATH::CVector3Array GetPolygonNodeNormalArray | ( | ) | const |
Returns an array of normals for all PolygonNode objects in the array. The normals are expressed with CVector3 objects.
CLongArray GetPolygonNodePolygonFaceIndexArray | ( | ) | const |
Returns an array containing the number of PolygonNode objects and the corresponding PolygonNode indices.for each PolygonFace in the array. The information is stored in the array as follows:
[Number of PNode for PFace(0), PNode indices, ... Number of PNode for PFace(N), PNode indices]