A Sample is a generic concept used to describe a PolygonNode or NurbsSample.
Having a generic term for this concept allows the user to write code to traverse an object's geometry in a generic fashion without resorting to special case handling based on a specific geometry type.
using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube ); CSampleRefArray samples( myCube.GetActivePrimitive().GetGeometry().GetSamples() ); LONG lCount = samples.GetCount(); for ( LONG i=0; i<lCount; i++ ) { Sample sample(samples[i]); app.LogMessage( L"Sample.Index " + CValue(sample.GetIndex()).GetAsText() ); }
#include <xsi_sample.h>
Public Member Functions |
|
Sample () | |
~Sample () | |
Sample (const CRef &in_ref) | |
Sample (const Sample &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
Sample & | operator= (const Sample &in_obj) |
Sample & | operator= (const CRef &in_ref) |
LONG | GetIndex () const |
SubComponent | GetSubComponent () const |
Sample | Navigate (siNavigateComponentType in_siNavigate) const |
Sample | ( | ) |
Default constructor.
~Sample | ( | ) |
Default destructor.
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from SIObject.
Reimplemented in NurbsSample, and PolygonNode.
siClassID GetClassID | ( | ) | const [virtual] |
Returns the type of the API class.
Reimplemented from SIObject.
Reimplemented in NurbsSample, and PolygonNode.
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
in_obj | constant class object. |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
in_ref | constant class object. |
Reimplemented from SIObject.
Reimplemented in NurbsSample, and PolygonNode.
LONG GetIndex | ( | ) | const |
Returns the index of this Sample object relative to its Facet object.
Reimplemented in PolygonNode.
SubComponent GetSubComponent | ( | ) | const |
Creates a SubComponent object from this Sample object,
Sample Navigate | ( | siNavigateComponentType | in_siNavigate | ) | const |
Navigates the Sample objects of the underlying geometry as specifed by the navigation component type. Navigation is circular -- for instance, navigating beyond the last component will return the first and vice versa.
in_siNavigate | Type of direction for navigating the Sample objects. |