An array of cluster elements in a Cluster object.
A cluster maps the geometry component (Point, Segment, Facet, Sample point) indices to cluster element indices. The value of the element in a cluster element array is the geometry component's index.
A cluster element array is read-only.
using namespace XSI; using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myGrid; root.AddGeometry( L"Grid", L"MeshSurface", L"", myGrid ); CLongArray indices(9); indices[0] = 8; indices[1] = 16; indices[2] = 24; indices[3] = 32; indices[4] = 40; indices[5] = 48; indices[6] = 56; indices[7] = 64; indices[8] = 72; Cluster myCls; myGrid.GetActivePrimitive().GetGeometry().AddCluster(siVertexCluster, L"", indices, myCls ); CClusterElementArray elements(myCls.GetElements()); CLongArray values(elements.GetArray()); for (LONG i=0; i<values.GetCount(); ++i) { app.LogMessage(L"Element " + CValue(i).GetAsText() + L"= " + CValue(values[i]).GetAsText()); }
#include <xsi_cluster.h>
Public Member Functions |
|
CClusterElementArray () | |
CClusterElementArray (const CClusterElementArray &in_array) | |
virtual | ~CClusterElementArray () |
CClusterElementArray & | operator= (const CClusterElementArray &in_array) |
CLongArray | GetArray () const |
LONG | GetCount () const |
LONG | GetItem (LONG in_index) const |
CLongArray | GetItemsByIndex (const CLongArray &in_indices) const |
LONG | FindIndex (LONG in_element) const |
Default constructor
CClusterElementArray | ( | const CClusterElementArray & | in_array | ) |
Copy constructor.
in_array | constant CClusterElementArray object. |
virtual ~CClusterElementArray | ( | ) | [virtual] |
Default destructor
CClusterElementArray& operator= | ( | const CClusterElementArray & | in_array | ) |
Creates an array from a reference object.
in_array | constant CClusterElementArray object. |
CLongArray GetArray | ( | ) | const |
Returns an array of element values.
LONG GetCount | ( | ) | const |
Returns the number of cluster element values
LONG GetItem | ( | LONG | in_index | ) | const |
Returns the cluster element value at a given index (0-based)
in_index | Element index. |
CLongArray GetItemsByIndex | ( | const CLongArray & | in_indices | ) | const |
Returns cluster element values by indices.
in_indices | Array of indices |
LONG FindIndex | ( | LONG | in_element | ) | const |
Searches the array for a given element and returns its index
in_element | Element index. |