Public Member Functions
CFacetRefArray Class Reference

Detailed Description

An array of Facet objects representing all segments of the underlying Geometry object.

Warning:
This specialized array is returned by Geometry::GetFacets, it is not meant to be created and modified in user-defined functions. If you want to add and remove arbitrary items to a collection, you must use a CRefArray instead.
See also:
Geometry::GetFacets
Example:
        using namespace XSI;
        using namespace MATH;

        Application app;
        Model root = app.GetActiveSceneRoot();

        X3DObject myCube;
        root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube );

        CFacetRefArray facets( myCube.GetActivePrimitive().GetGeometry().GetFacets() );

        CVector3Array normArray = facets.GetNormalArray();

        app.LogMessage( facets.GetClassIDName() );
        app.LogMessage( CValue(normArray.GetCount()).GetAsText() );

        for (LONG i=0; i<normArray.GetCount(); i++)
        {
            app.LogMessage( L"Normal " + CValue(i).GetAsText() );

            app.LogMessage(
                CValue(normArray[i].GetX()).GetAsText() + L"," +
                CValue(normArray[i].GetY()).GetAsText() + L"," +
                CValue(normArray[i].GetZ()).GetAsText() );
        }

#include <xsi_facet.h>

Inheritance diagram for CFacetRefArray:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  CFacetRefArray ()
  CFacetRefArray (const CFacetRefArray &in_array)
CRef  GetItem (LONG in_index) const
CRef  GetItem (const CString &in_name) const
LONG  GetCount () const
bool  IsValid () const
MATH::CVector3Array  GetNormalArray () const
CLongArray  GetIndexArray () const
SubComponent  GetSubComponent () const
CFacetRefArray  Navigate (siNavigateComponentType in_siNavigate) const

Constructor & Destructor Documentation

Constructor.

CFacetRefArray ( const CFacetRefArray in_array )

Copy constructor.

Parameters:
in_array constant CFacetRefArray reference object.

Member Function Documentation

CRef GetItem ( LONG  in_index ) const [virtual]

Returns a Facet object at a specified index in the array.

Parameters:
in_index The index of the Facet to get.
Returns:
A reference to the specified Facet object.

Reimplemented from CRefArray.

Reimplemented in CNurbsSurfaceRefArray, and CPolygonFaceRefArray.

CRef GetItem ( const CString in_name ) const [virtual]

Returns the Facet object in the array matching the specified name.

Parameters:
in_name The name of the Facet to get.
Returns:
A reference to the specified Facet object.

Reimplemented from CRefArray.

Reimplemented in CNurbsSurfaceRefArray, and CPolygonFaceRefArray.

LONG GetCount ( ) const [virtual]

Returns the number of Facet objects in the array.

Returns:
The number of Facet objects.

Reimplemented from CRefArray.

Reimplemented in CNurbsSurfaceRefArray, and CPolygonFaceRefArray.

bool IsValid ( ) const [virtual]

Returns whether this array is a valid object.

Returns:
True if valid, false otherwise.

Reimplemented from CRefArray.

Reimplemented in CNurbsSurfaceRefArray, and CPolygonFaceRefArray.

MATH::CVector3Array GetNormalArray ( ) const

Returns an array of normals expressed with CVector3 objects.

Returns:
Array of CVector3 objects.

Reimplemented in CPolygonFaceRefArray.

CLongArray GetIndexArray ( ) const

Returns an array of indices in this CFacetRefArray.

Returns:
Array of (LONG) indices.
SubComponent GetSubComponent ( ) const

Creates a SubComponent object from this Facet array,

Returns:
A SubComponent object
CFacetRefArray Navigate ( siNavigateComponentType  in_siNavigate ) const

Navigates the Facet objects of the underlying geometry as specifed by the navigation component type (siNavigateComponentType). An array of Facet objects corresponding to each Facet object visited is returned. Navigation is circular -- for instance, navigating beyond the last component will return the first and vice versa.

Parameters:
in_siNavigate Type of direction for navigating the Facet objects (one of the siNavigateComponentType values).
Returns:
An array of refernces to Facet objects.

The documentation for this class was generated from the following file: