CTriangleVertexRefArray Class Reference
 
 
 
CTriangleVertexRefArray Class Reference

#include <xsi_trianglevertex.h>


Class Description

An array of TriangleVertex objects that represents all points of a Triangle object.

Warning:
This specialized array is returned by Triangle::GetPoints, 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:
Triangle::GetPoints, Triangle, Geometry
Example:
                using namespace XSI;
                using namespace MATH;
                Application app;
                Model root = app.GetActiveSceneRoot();

                X3DObject myCube;
                root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube );

                Triangle triangle(myCube.GetActivePrimitive().GetGeometry().GetTriangles().GetItem(0));
                CTriangleVertexRefArray vertices(triangle.GetPoints());

                CVertexColorArray colors(vertices.GetColorArray());
                LONG ulCount = colors.GetCount();

                for (LONG i=0; i<ulCount; i++ )
                {
                        app.LogMessage( L"Vertex Color " +
                                CValue((LONG)i).GetAsText() + L": " +
                                CValue(colors[i].r).GetAsText() + L"," +
                                CValue(colors[i].g).GetAsText() + L"," +
                                CValue(colors[i].b).GetAsText() + L"," +
                                CValue(colors[i].a).GetAsText() );
                }
Inheritance diagram for CTriangleVertexRefArray:
CRefArray

List of all members.

Public Member Functions

  CTriangleVertexRefArray (const CTriangleVertexRefArray &in_array)
CRef  GetItem (LONG in_index) const
CRef  GetItem (const CString &in_name) const
LONG  GetCount () const
bool  IsValid () const
MATH::CVector3Array  GetPositionArray () const
MATH::CVector3Array  GetNormalArray () const
CVertexColorArray  GetColorArray () const
CUVArray  GetUVArray () const

Constructor & Destructor Documentation

Copy constructor.

Parameters:
in_array constant CTriangleVertexRefArray reference object.

Member Function Documentation

CRef GetItem ( LONG  in_index ) const [virtual]

Returns a TriangleVertex object at a specified index in the array.

Parameters:
in_index The index of the TriangleVertex.
Returns:
The Triangle object.

Reimplemented from CRefArray.

CRef GetItem ( const CString in_name ) const [virtual]

Returns the TriangleVertex object in the array matching the specified name.

Parameters:
in_name The name of the TriangleVertex.
Returns:
The Triangle object.

Reimplemented from CRefArray.

LONG GetCount ( ) const [virtual]

Returns the number of TriangleVertex objects in the array.

Returns:
The number of TriangleVertex objects.

Reimplemented from CRefArray.

bool IsValid ( ) const [virtual]

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

Returns:
true if valid, false otherwise.

Reimplemented from CRefArray.

MATH::CVector3Array GetPositionArray ( ) const

Returns an array of CVector3 objects representing the positions of all TriangleVertex objects in this array.

Returns:
Array of CVector3 objects.
MATH::CVector3Array GetNormalArray ( ) const

Returns an array of CVector3 objects representing the normals of all TriangleVertex objects in this array.

Returns:
Array of CVector3 objects.
CVertexColorArray GetColorArray ( ) const

Returns an array of CVertexColor objects representing the colors of all TriangleVertex objects in this array.

Returns:
Array of CVertexColor objects.
CUVArray GetUVArray ( ) const

Returns an array of CUV objects representing the UV coordinates of all TriangleVertex objects in this array.

Returns:
Array of CUV objects.

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