Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CSLBaseShape Class Reference

#include <BaseShape.h>

Inheritance diagram for CSLBaseShape::

CSLTemplate CSIBCNode CSLShape CSLShape_35 List of all members.

Public Types

Public Methods

Protected Methods


Detailed Description

Describes the shape of a mesh

The CSLBaseShape class contains information about the position coordinates, normal coordinates and color values of a mesh.

There are two possible types of shape: ordered & indexed. The set of functions that can be used depends on the type of shape that is described by each class instance.

For example, the function CreateNormals will work on an ordered shape, but won't on an indexed shape. On the other hand, the function CreateIndexedNormals will work on an indexed shape, but won't on an ordered shape. However, the functions DestroyNormals and GetNormalCount will work with both types (ordered & indexed).

Example - Using CSLBaseShape

                CSLModel *l_pMeshModel = RootModel->AddMesh();

                //
                // Set some default values
                //

                l_pMeshModel->SetName("MyMesh");
                l_pMeshModel->Visibility()->SetVisibility(SI_TRUE);
                l_pMeshModel->Transform()->SetScale(CSIBCVector3D(1.0, 1.0, 1.0) );
                l_pMeshModel->GlobalMaterial()->SetPropagationType(CSLGlobalMaterial::SI_INHERITED);

                //
                // Set default material
                //

                l_pMeshModel->GlobalMaterial()->SetMaterial(l_pMeshModel->Scene()->GetMaterialLibrary()->GetMaterialList()[0] );

                //
                // Get the CSLMesh pointer from the model
                //
                        
                CSLMesh *l_pMesh = (CSLMesh *) l_pMeshModel->Primitive();

                //
                // Get a pointer to the Mesh's shape
                //

                CSLBaseShape *l_pShape = l_pMesh->Shape();

                //
                // Add 8 vertices
                //

                CSLBaseShape::CSLVector3DArray *l_Vertices = l_pShape->GetVertexList();
                l_Vertices->Resize(8);

                //
                // Add 8 normals
                //

                CSLBaseShape::CSLVector3DArray *l_Normals = l_pShape->CreateNormals();
                l_Normals.Resize(8);

                //
                // Now set the positions / normal
                //

                for (int i=0;i<8;i++)
                {
                        (*l_Vertices)[vindex].Set(0.0f, 0.0f, 0.0f);
                                
                        (*l_Normals)[vindex].Set (0.0f, 1.0f, 0.0f);
                }


Member Typedef Documentation

typedef CSLArrayProxy<CSIBCColorf, SI_Float, 4> CSLBaseShape::CSLColorArray
 

Proxy class that allows modifying a list of CSIBCColorf objects like an array.

typedef CSLArrayProxy<SLIndexedColor, SI_Float, 5> CSLBaseShape::CSLIndexedColorArray
 

Proxy class that allows modifying a list of SLIndexedColor objects like an array.

typedef CSLArrayProxy<SLIndexedVector2D, SI_Float, 3> CSLBaseShape::CSLIndexedVector2DArray
 

Proxy class that allows modifying a list of SLIndexedVector2D objects like an array.

typedef CSLArrayProxy<SLIndexedVector3D, SI_Float, 4> CSLBaseShape::CSLIndexedVector3DArray
 

Proxy class that allows modifying a list of SLIndexedVector3D objects like an array.

typedef CSLArrayProxy<CSIBCVector2D, SI_Float, 2> CSLBaseShape::CSLVector2DArray
 

Proxy class that allows modifying a list of CSIBCVector2D objects like an array.

typedef CSLArrayProxy<CSIBCVector3D, SI_Float, 3> CSLBaseShape::CSLVector3DArray
 

Proxy class that allows modifying a list of CSIBCVector3D objects like an array.


Member Enumeration Documentation

enum CSLBaseShape::EShapeType
 

The EShapeType enum contains possible types for a shape

Enumeration values:
SI_ORDERED  The shape is of ordered type
SI_INDEXED  The shape is of indexed type


Constructor & Destructor Documentation

CSLBaseShape::~CSLBaseShape   [virtual]
 

Destructor

CSLBaseShape::CSLBaseShape CSLScene   in_pScene,
CSLModel   in_pModel,
CdotXSITemplate   in_pTemplate,
EShapeType    in_Type
[protected]
 

Constructor

Parameters:
in_pScene  Pointer to the scene containing the BaseShape
in_pModel  Pointer to the model containing the BaseShape
in_pTemplate  Pointer to the CdotXSITemplate containing the BaseShape
in_Type  The shape type to be used in the BaseShape


Member Function Documentation

CSLBaseShape::CSLColorArray * CSLBaseShape::CreateColors  
 

Create a color values array.

Returns:
CSLColorArray* Pointer to the newly created array.

CSLBaseShape::CSLIndexedColorArray * CSLBaseShape::CreateIndexedColors  
 

Create an indexed color values array.

Returns:
CSLIndexedColorArray* Pointer to the newly created indexed array.

CSLBaseShape::CSLIndexedVector3DArray * CSLBaseShape::CreateIndexedNormals  
 

Create an indexed normal coordinates array.

Returns:
CSLIndexedVector3DArray* Pointer to the newly created indexed array.

CSLBaseShape::CSLVector3DArray * CSLBaseShape::CreateNormals  
 

Create a normal coordinates array.

Returns:
CSLVector3DArray* Pointer to the newly created array.

SI_Error CSLBaseShape::DestroyColors  
 

Destroy the color values array.

Returns:
SI_Error Error code.

SI_Error CSLBaseShape::DestroyNormals  
 

Destroy the normal coordinates array.

Returns:
SI_Error Error code.

SI_Error CSLBaseShape::Fix   [virtual]
 

Clean invalid data from the template.

Returns:
SI_Error Error code

Reimplemented from CSLTemplate.

SI_Int CSLBaseShape::GetColorCount  
 

Return the number of color values.

Returns:
SI_Int Number of colors.

CSLBaseShape::CSLColorArray * CSLBaseShape::GetColorList  
 

Return the color values array proxy.

Returns:
CSLColorArray* Pointer to an array proxy of colors.

CSIBCColorf * CSLBaseShape::GetColorListPtr  
 

Returns an array of CSIBCColorf containing the color values.

Returns:
CSIBCColorf* Array of CSIBCColorf.

CSLBaseShape::CSLIndexedColorArray * CSLBaseShape::GetIndexedColorList  
 

Return the indexed color values array proxy.

Returns:
CSLIndexedVector3DArray* Pointer to an array proxy of indexed colors.

SLIndexedColor * CSLBaseShape::GetIndexedColorListPtr  
 

Returns an array of SLIndexedColor containing the indexed color values.

Returns:
SLIndexedColor* Array of SLIndexedColor.

CSLBaseShape::CSLIndexedVector3DArray * CSLBaseShape::GetIndexedNormalList  
 

Return the indexed normal coordinate array proxy.

Returns:
CSLIndexedVector3DArray* Pointer to an array proxy of indexed normals.

SLIndexedVector3D * CSLBaseShape::GetIndexedNormalListPtr  
 

Returns an array of SLIndexedVector3D containing the indexed normal coordinates.

Returns:
SLIndexedVector3D* Array of SLIndexedVector3D.

CSLBaseShape::CSLIndexedVector3DArray * CSLBaseShape::GetIndexedVertexList  
 

Return the indexed vertex coordinate array proxy.

Returns:
CSLIndexedVector3DArray* Pointer to an array proxy of indexed vertices.

SLIndexedVector3D * CSLBaseShape::GetIndexedVertexListPtr  
 

Returns an array of SLIndexedVector3D containing the indexed vertex coordinates.

Returns:
SLIndexedVector3D* Array of SLIndexedVector3D.

SI_Int CSLBaseShape::GetNormalCount  
 

Return the number of normal coordinates.

Returns:
SI_Int Number of normals.

CSLBaseShape::CSLVector3DArray * CSLBaseShape::GetNormalList  
 

Return the normal coordinate array proxy.

Returns:
CSLVector3DArray* Pointer to an array proxy of normals.

CSIBCVector3D * CSLBaseShape::GetNormalListPtr  
 

Returns an array of CSBCVector3D containing the normal coordinates.

Returns:
CSIBCVector3D* Array of CSIBCVector3D.

SI_Int CSLBaseShape::GetVertexCount  
 

Return the number of vertex coordinates.

Returns:
SI_Int Number of vertices.

CSLBaseShape::CSLVector3DArray * CSLBaseShape::GetVertexList  
 

Return the vertex coordinate array proxy.

Returns:
CSLVector3DArray* Pointer to an array proxy of vertices.

CSIBCVector3D * CSLBaseShape::GetVertexListPtr  
 

Returns an array of CSBCVector3D containing the vertex coordinates.

Returns:
CSIBCVector3D* Array of CSIBCVector3D.

CSLBaseShape::EShapeType CSLBaseShape::ShapeType  
 

Indicate which type of shape this object describes.

Returns:
EShapeType Type of shape

SI_Error CSLBaseShape::Synchronize   [virtual]
 

Synchronize will ensure that the animated parameter is up to date.

Returns:
SI_Error Error code

Reimplemented from CSLTemplate.

Reimplemented in CSLShape, and CSLShape_35.


The documentation for this class was generated from the following files: © Copyright 2001-2003 Avid Technology, Inc. All rights reserved.

© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.