CPolygonNodeRefArray Class Reference
CPolygonNodeRefArray Class Reference

#include <xsi_polygonnode.h>

Class Description

An array of PolygonNode objects representing the edge junction in a polygon.

This specialized array is returned by Vertex::GetNodes, PolygonMesh::GetNodes, PolygonFace::GetNodes, and Edge::GetNodes, it is not meant to be created and modified in user-defined functions. If you want to add and remove arbitrary items to a collection, you must use a CRefArray instead.
See also:
Vertex::GetNodes, PolygonMesh::GetNodes, PolygonFace::GetNodes, Edge::GetNodes
                using namespace XSI;
                using namespace MATH;

                Application app;
                Model root = app.GetActiveSceneRoot();

                X3DObject myCone;
                root.AddGeometry( L"Cone", L"MeshSurface", L"", myCone );

                PolygonMesh mesh( myCone.GetActivePrimitive().GetGeometry(0) );
                CPolygonNodeRefArray pnodes(mesh.GetNodes());

                LONG lCount = pnodes.GetCount();
                app.LogMessage( CString(L"Number of nodes: ") + CValue(lCount).GetAsText() );

                CVector3 norm;
                PolygonNode pnode;
                for ( LONG i=0; i<lCount; i++ )
                        bool bValid;
                        pnode = pnodes[i];
                        norm = pnode.GetNormal(bValid);

                                L"Normal: (" + CString(CValue(bValid).GetAsText()) +
                                L") " +
                                CValue(norm.GetX()).GetAsText() + L"," +
                                CValue(norm.GetY()).GetAsText() + L"," +
                                CValue(norm.GetZ()).GetAsText() );
Inheritance diagram for CPolygonNodeRefArray:
CSampleRefArray CRefArray

List of all members.

Public Member Functions

  CPolygonNodeRefArray (const CPolygonNodeRefArray &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

Constructor & Destructor Documentation

Copy constructor.

in_array constant CPolygonNodeRefArray reference object.

Member Function Documentation

CRef GetItem ( LONG  in_index ) const [virtual]

Returns a PolygonNode reference object at a specified index in the array.

in_index The index of the PolygonNode.
A reference to the PolygonNode object.

Reimplemented from CSampleRefArray.

CRef GetItem ( const CString in_name ) const [virtual]

Returns a PolygonNode reference object matching the specified name in the array.

in_name The name of the PolygonNode.
A reference to the PolygonNode object.

Reimplemented from CSampleRefArray.

LONG GetCount ( ) const [virtual]

Returns the number of PolygonNode objects in the array.

The number of PolygonNode objects.

Reimplemented from CSampleRefArray.

bool IsValid ( ) const [virtual]

Returns true if this array is a valid object or false otherwise.

true if valid, false otherwise.

Reimplemented from CSampleRefArray.

MATH::CVector3Array GetNormalArray ( ) const

Returns an array of normals expressed with CVector3 objects.

Array of CVector3 objects.

The documentation for this class was generated from the following file: