A Segment is a generic concept used to describe a PolygonMesh's Edge.
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 ); CSegmentRefArray segments( myCube.GetActivePrimitive().GetGeometry().GetSegments() ); LONG lCount = segments.GetCount(); for ( LONG i=0; i<lCount; i++ ) { Segment segment(segments[i]); app.LogMessage( L"Segment.Index " + CValue(segment.GetIndex()).GetAsText() ); }
#include <xsi_segment.h>
Public Member Functions | |
Segment () | |
~Segment () | |
Segment (const CRef &in_ref) | |
Segment (const Segment &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
Segment & | operator= (const Segment &in_obj) |
Segment & | operator= (const CRef &in_ref) |
CPointRefArray | GetPoints () const |
LONG | GetIndex () const |
CSampleRefArray | GetSamples () const |
SubComponent | GetSubComponent () const |
Segment | Navigate (siNavigateComponentType in_siNavigate) const |
Segment | ( | ) |
Default constructor.
~Segment | ( | ) |
Default destructor.
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
siClassID GetClassID | ( | ) | const [virtual] |
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. |
CPointRefArray GetPoints | ( | ) | const |
LONG GetIndex | ( | ) | const |
CSampleRefArray GetSamples | ( | ) | const |
SubComponent GetSubComponent | ( | ) | const |
Creates a SubComponent object from this Segment object,
Segment Navigate | ( | siNavigateComponentType | in_siNavigate | ) | const |
Navigates the Segment 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 Segment objects. |