Public Member Functions
CICEAttributeDataArray< T > Class Template Reference

Detailed Description

template<class T>
class XSI::CICEAttributeDataArray< T >

This template class encapsulates ICEAttribute data as a 1D array. CICEAttributeDataArray objects are read-only and can be filled with the methods supplied with the ICEAttribute class. CICEAttributeDataArray is zero-based and can be one of the following types:

All types are associated to specific ICEAttribute types. Therefore, you need to declare the right array object type that matches the ICEAttribute data type you want to access. Otherwise a runtime error will occur and the returned array will be empty.

See also:
ICEAttribute::GetDataArray, ICEAttribute::GetDataArrayChunk, Type Definitions for CICEAttributeDataArray
Since:
7.0
Example:
This example demonstrates how to iterate over the PointPosition attribute data on a grid primitive.
        using namespace XSI;
        CValue CreatePrim( const CString& in_presetobj, const CString& in_geometrytype, const CString& in_name, const CString& in_parent );

        X3DObject grid = CreatePrim( L"Grid", L"MeshSurface", L"", L"");

        ICEAttribute attr = grid.GetActivePrimitive().GetGeometry().GetICEAttributeFromName( L"PointPosition" );

        CICEAttributeDataArrayVector3f points;
        attr.GetDataArray( points );

        Application xsi;
        for( ULONG i=0; i<points.GetCount( ); i++ )
        {
            xsi.LogMessage( CString( points[ i ] ) );
        }

        // Helper
        CValue CreatePrim( const CString& in_presetobj, const CString& in_geometrytype, const CString& in_name, const CString& in_parent )
        {
            CValueArray args(4);
            CValue retval;
            args[0]= in_presetobj;
            args[1]= in_geometrytype;
            args[2]= in_name;
            args[3]= in_parent;

            Application app;
            app.ExecuteCommand( L"CreatePrim", args, retval );
            return retval;
        }

#include <xsi_iceattributedataarray.h>

Inheritance diagram for CICEAttributeDataArray< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  CICEAttributeDataArray ()
  ~CICEAttributeDataArray ()
const T &  operator[] (ULONG in_index) const

Constructor & Destructor Documentation

CICEAttributeDataArray ( ) [inline]

Constructor.

~CICEAttributeDataArray ( ) [inline]

Destructor.


Member Function Documentation

const T& operator[] ( ULONG  in_index ) const [inline]

Accessor to the encapsulated array. This operator is called when reading the data so the return value is read-only.

Parameters:
in_index Index in the array. The index must be smaller than the number of elements in the array, otherwise the results are unpredictable. If the array is constant, the function always return the first item's value.
Returns:
A read-only reference to the indexed item.

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