A facet is a generic concept used to describe a Geometry's PolygonFace, NurbsSurface or NurbsCurve.
Having a generic term for this concept allows the user to write code to traverse an object 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 ); CFacetRefArray facets( myCube.GetActivePrimitive().GetGeometry().GetFacets() ); app.LogMessage( facets.GetClassIDName() ); LONG lFacetCount = facets.GetCount(); for ( LONG i=0; i<lFacetCount; i++ ) { Facet facet(facets[i]); CSegmentRefArray segments( facet.GetSegments() ); app.LogMessage( L"Facet.Index " + CValue(facet.GetIndex()).GetAsText() ); LONG lSegmentCount = segments.GetCount(); for (LONG j=0; j<lSegmentCount; j++) { Segment seg = segments[j]; app.LogMessage( L"Facet.Segment.Index " + CValue(seg.GetIndex()).GetAsText() ); } }
#include <xsi_facet.h>
Public Member Functions | |
Facet () | |
~Facet () | |
Facet (const CRef &in_ref) | |
Facet (const Facet &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
Facet & | operator= (const Facet &in_obj) |
Facet & | operator= (const CRef &in_ref) |
CSegmentRefArray | GetSegments () const |
CPointRefArray | GetPoints () const |
LONG | GetNbPoints () const |
LONG | GetIndex () const |
CSampleRefArray | GetSamples () const |
SubComponent | GetSubComponent () const |
Facet | Navigate (siNavigateComponentType in_siNavigate) const |
Facet | ( | ) |
Default constructor.
~Facet | ( | ) |
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 NurbsSurface, and PolygonFace.
siClassID GetClassID | ( | ) | const [virtual] |
Returns the type of the API class.
Reimplemented from SIObject.
Reimplemented in NurbsSurface, and PolygonFace.
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 NurbsSurface, and PolygonFace.
CSegmentRefArray GetSegments | ( | ) | const |
CPointRefArray GetPoints | ( | ) | const |
LONG GetNbPoints | ( | ) | const |
Returns the number of points on this Facet object.
LONG GetIndex | ( | ) | const |
Returns the index of this Facet object in the CFacetRefArray.
CSampleRefArray GetSamples | ( | ) | const |
SubComponent GetSubComponent | ( | ) | const |
Creates a SubComponent object from this Facet object,
Facet Navigate | ( | siNavigateComponentType | in_siNavigate | ) | const |
Navigates the Facet objects of the underlying geometry as specifed by the navigation component type (siNavigateComponentType). 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 Facet objects (one of the siNavigateComponentType values). |