#include <xsi_trianglevertex.h>
An array of TriangleVertex objects that represents all points of a Triangle object.
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() );
}
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 |
| CTriangleVertexRefArray | ( | const CTriangleVertexRefArray & | in_array | ) |
Copy constructor.
| in_array | constant CTriangleVertexRefArray reference object. |
| CRef GetItem | ( | LONG | in_index | ) | const [virtual] |
Returns a TriangleVertex object at a specified index in the array.
| in_index | The index of the TriangleVertex. |
Reimplemented from CRefArray.
Returns the TriangleVertex object in the array matching the specified name.
| in_name | The name of the TriangleVertex. |
Reimplemented from CRefArray.
| LONG GetCount | ( | ) | const [virtual] |
Returns the number of TriangleVertex objects in the array.
Reimplemented from CRefArray.
| bool IsValid | ( | ) | const [virtual] |
Returns true if this array is a valid object or 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.
| MATH::CVector3Array GetNormalArray | ( | ) | const |
Returns an array of CVector3 objects representing the normals of all TriangleVertex objects in this array.
| CVertexColorArray GetColorArray | ( | ) | const |
Returns an array of CVertexColor objects representing the colors of all TriangleVertex objects in this array.
| CUVArray GetUVArray | ( | ) | const |
Returns an array of CUV objects representing the UV coordinates of all TriangleVertex objects in this array.