CSLScene Class Reference

#include <Scene.h>

Inheritance diagram for CSLScene:

CSLCOLLADAScene List of all members.

Public Member Functions

SI_Error  Open (SI_Char *in_szFileName)
SI_Error  Open (SI_Char *in_szFileName, SI_READ_CALLBACK_FNC in_pFunc)
SI_Error  Create (SI_Char *in_szFileName, SI_Int in_nVersionMajor, SI_Int in_nVersionMinor, SI_Int in_nFormat=FORMAT_TEXT)
SI_Error  Create (SI_Int in_nVersionMajor, SI_Int in_nVersionMinor, SI_Int in_nFormat=FORMAT_TEXT)
SI_Error  Open (CXSIParser *in_parser)
SI_Error  Read ()
virtual SI_Error  Write (bool in_bSynchronize=true)
virtual SI_Error  Write (SI_Char *in_szFileName, bool in_bSynchronize=true)
SI_Error  Close ()
CSLModel FindModel (SI_Char *in_szModelName)
CSLModel FindModelRecursively (SI_Char *in_szModelName, CSLModel *in_pModel)
CSLAnimatableType FindParameter (SI_Char *in_szParameterName)
SI_Error  GetValue (SI_Char *in_szParameterName, SI_Float *out_pfValue)
SI_Error  SetValue (SI_Char *in_szParameterName, SI_Float in_fValue)
CSLAmbience Ambience ()
CSLAmbience CreateAmbience ()
SI_Error  DestroyAmbience ()
CSLCoordinateSystem CoordinateSystem ()
CSLEnvelopeList EnvelopeList ()
CSLFog Fog ()
CSLMaterialLibrary GetMaterialLibrary ()
CSLModel Root ()
CXSIParser Parser ()
CSLAngle Angle ()
CSLFileInfo FileInfo ()
CSLSceneInfo SceneInfo ()
CSLLogger Logger ()
CSIBCString FileName ()
CSLImageLibrary GetImageLibrary ()
SI_Error  DestroyFog ()
CSLFog CreateFog ()
SI_Error  DestroyEnvelopeList ()
virtual CSLEnvelopeList CreateEnvelopeList ()
virtual CSLImageLibrary CreateImageLibrary ()
SI_Error  DestroyImageLibrary ()
virtual CSLMaterialLibrary ConnectMaterialLibrary (CSLMaterialLibrary *in_pNewMaterialLibrary)
CSLAngle ConnectAngle (CSLAngle *in_pNewAngle)
CSLFileInfo ConnectFileInfo (CSLFileInfo *in_pNewFileInfo)
CSLSceneInfo ConnectSceneInfo (CSLSceneInfo *in_pToConnect)
CSLFog ConnectFog (CSLFog *in_pNewFog)
CSLAmbience ConnectAmbience (CSLAmbience *in_pNewAmbience)
CSLCoordinateSystem ConnectCoordinateSystem (CSLCoordinateSystem *in_pNewCoordSystem)
CSLEnvelopeList ConnectEnvelopeList (CSLEnvelopeList *in_pNewEnvList)
CSLImageLibrary ConnectImageLibrary (CSLImageLibrary *in_pImageLibrary)
SI_Error  RegisterCallback (SI_Char *in_pName, SLTemplateCallback *in_pTemplateCallback)
SI_Error  UnregisterCallback (SI_Char *in_pName)
SI_Error  UnregisterAllCallbacks ()
SLTemplateCallback Callback (SI_Char *in_pName)
SI_Bool  SupportsTemplates (SI_Int in_nMajor, SI_Int in_nMinor)
SI_Void  SetWarningCallback (SI_WARNING_CALLBACK_FNC in_pfncCallback)
SI_Void  SetReadCallback (SI_READ_CALLBACK_FNC in_pfncCallback)
SI_Error  GetRefCount (CSLTemplate **in_ppObjects, SI_Int **out_ppRefCounts, SI_Int in_iObjectCount, CSLTemplate::ETemplateType in_eType)

Detailed Description

This class manages a scene (reading/writing scene data, etc.).

This is the top level object for a dotXSI abstraction using the SemanticLayer. From this class, you can access all the models, primitives, materials etc.


Member Function Documentation

SI_Error Open ( SI_Char *  in_szFileName  ) 

Opens a dotXSI file for reading and writing. The file must exist for the function to succeed.

Parameters:
[in]  in_szFileName  File to open.
Returns:
Error code.

SI_Error Open ( SI_Char *  in_szFileName,
SI_READ_CALLBACK_FNC  in_pFunc  
)

Opens a dotXSI file for reading and writing. The file must exist for the function to succeed.

Parameters:
[in]  in_szFileName  File to open.
[in]  in_pFunc  read callback
Returns:
Error code.

SI_Error Create ( SI_Char *  in_szFileName,
SI_Int  in_nVersionMajor,
SI_Int  in_nVersionMinor,
SI_Int  in_nFormat = FORMAT_TEXT  
)

Creates a new dotXSI file.

Parameters:
[in]  in_szFileName  File to create.
[in]  in_nVersionMajor  Major version of the file.
[in]  in_nVersionMinor  Minor version of the file.
[in]  in_nFormat  Format of the file (text or binary) for dotXSI
Returns:
Error code.

SI_Error Create ( SI_Int  in_nVersionMajor,
SI_Int  in_nVersionMinor,
SI_Int  in_nFormat = FORMAT_TEXT  
)

Creates a new dotXSI file.

Parameters:
[in]  in_nVersionMajor  Major version of the file.
[in]  in_nVersionMinor  Minor version of the file.
[in]  in_nFormat  Format of the file (text or binary) for dotXSI
Returns:
Error code.

SI_Error Open ( CXSIParser in_parser  ) 

Creates a new dotXSI file.

Parameters:
[in]  in_parser  Parser to use
Returns:
Error code.

SI_Error Read (  ) 

Populates the semantic layer with data present in the file.

Returns:
Error code.

virtual SI_Error Write ( bool  in_bSynchronize = true  )  [virtual]

Writes a dotXSI file containing the data present in the semantic layer.

Parameters:
[in]  in_bSynchronize  True to synchronize
Returns:
Error code.

virtual SI_Error Write ( SI_Char *  in_szFileName,
bool  in_bSynchronize = true  
) [virtual]

Writes a dotXSI file containing the data present in the semantic layer.

Parameters:
[in]  in_szFileName  File to create.
[in]  in_bSynchronize  True to synchronize
Returns:
Error code.

Reimplemented in CSLCOLLADAScene.

SI_Error Close (  ) 

Closes the opened/created file.

Returns:
Error code.

CSLModel* FindModel ( SI_Char *  in_szModelName  ) 

Finds a SI_Model by name

Parameters:
[in]  in_szModelName  The model's name
Returns:
The model, or NULL if not found.

CSLModel* FindModelRecursively ( SI_Char *  in_szModelName,
CSLModel in_pModel  
)

Finds a SI_Model, recursively.

Parameters:
[in]  in_szModelName  The model's name
[in]  in_pModel  A Pointer to a CSLModel
Returns:
The model, or NULL if not found.

CSLAnimatableType* FindParameter ( SI_Char *  in_szParameterName  ) 

Finds a parameter by name.

Parameters:
[in]  in_szParameterName  The Softimage path to the parameter; that is, the scripting name for the parameter. For example "MyModel.kine.local.posx" would refer to the X component of the position in the model "MyModel" transformation matrix.
Returns:
The parameter.

SI_Error GetValue ( SI_Char *  in_szParameterName,
SI_Float *  out_pfValue  
)

Returns a parameter value.

Parameters:
[in]  in_szParameterName  The Softimage path to the parameter; that is, the scripting name for the parameter. For example "MyModel.kine.local.posx" would refer to the X component of the position in the model "MyModel" transformation matrix.
[out]  out_pfValue  The parameter's value
Returns:
Error code

SI_Error SetValue ( SI_Char *  in_szParameterName,
SI_Float  in_fValue  
)

Sets a parameter value.

Parameters:
[in]  in_szParameterName  The Softimage path to the parameter; that is, the scripting name for the parameter. For example "MyModel.kine.local.posx" would refer to the X component of the position in the model "MyModel" transformation matrix.
[in]  in_fValue  The parameter's new value
Returns:
Error code

CSLAmbience* Ambience (  ) 

Returns the ambience object.

Returns:
The ambience object

CSLAmbience* CreateAmbience (  ) 

Creates an Ambience object

Returns:
Pointer to the ambience object

SI_Error DestroyAmbience (  ) 

Removes the Ambience object

Returns:
Error code

CSLCoordinateSystem* CoordinateSystem (  ) 

Returns the coordinatesystem object

Returns:
Pointer to the CoordinateSystem object

CSLEnvelopeList* EnvelopeList (  ) 

Returns the EnvelopeList object

Returns:
Pointer to the EnvelopeList object

CSLFog* Fog (  ) 

Returns the Fog object

Returns:
Pointer to the Fog object

CSLMaterialLibrary* GetMaterialLibrary (  ) 

Returns the MaterialLibrary object

Returns:
Pointer to the MaterialLibrary object

CSLModel* Root (  ) 

Returns the Root Model

Returns:
Pointer to the Root Model

CXSIParser* Parser (  ) 

Returns the CXSIParser object

Returns:
Pointer to the CXSIParser object

CSLAngle* Angle (  ) 

Returns the Angle object

Returns:
Pointer to the Angle object

CSLFileInfo* FileInfo (  ) 

Returns the FileInfo object

Returns:
Pointer to the FileInfo object

CSLSceneInfo* SceneInfo (  ) 

Returns the SceneInfo object

Returns:
Pointer to the object containing the scene information (SI_Scene template)

CSLLogger* Logger (  ) 

Returns the Logger object

Returns:
Pointer to the Logger object

CSIBCString& FileName (  ) 

Returns the filename for the current scene

Returns:
The filename

CSLImageLibrary* GetImageLibrary (  ) 

Returns the image library

Returns:
Pointer to the image library or null if there's none

SI_Error DestroyFog (  ) 

Removes the Fog object

Returns:
Error code

CSLFog* CreateFog (  ) 

Creates Fog

Returns:
Pointer to the Fog

SI_Error DestroyEnvelopeList (  ) 

Removes the EnvelopeList object

Returns:
Error code

virtual CSLEnvelopeList* CreateEnvelopeList (  )  [virtual]

Creates an envelope list

Returns:
Pointer to the envelope list

Reimplemented in CSLCOLLADAScene.

virtual CSLImageLibrary* CreateImageLibrary (  )  [virtual]

Creates an Image Library

Returns:
Pointer to the image library
Since:
dotXSI 3.6

Reimplemented in CSLCOLLADAScene.

SI_Error DestroyImageLibrary (  ) 

Removes of the Image Library

Returns:
Error code
Since:
dotXSI 3.6

virtual CSLMaterialLibrary* ConnectMaterialLibrary ( CSLMaterialLibrary in_pNewMaterialLibrary  )  [virtual]

Connects an existing CSLMaterialLibrary object to the scene

Parameters:
[in]  in_pNewMaterialLibrary  The new CSLMaterialLibrary
Returns:
Pointer to the old CSLMaterialLibrary

CSLAngle* ConnectAngle ( CSLAngle in_pNewAngle  ) 

Connects an existing CSLAngle object to the scene

Parameters:
[in]  in_pNewAngle  The new CSLAngle
Returns:
Pointer to the old CSLAngle object

CSLFileInfo* ConnectFileInfo ( CSLFileInfo in_pNewFileInfo  ) 

Connects an existing CSLFileInfo object to the scene

Parameters:
[in]  in_pNewFileInfo  The new CSLFileInfo
Returns:
Pointer to the old CSLFileInfo object

CSLSceneInfo* ConnectSceneInfo ( CSLSceneInfo in_pToConnect  ) 

Connects an existing CSLSceneInfo object to the scene

Parameters:
[in]  in_pToConnect  The new CSLSceneInfo
Returns:
Pointer to the old CSLSceneInfo object

CSLFog* ConnectFog ( CSLFog in_pNewFog  ) 

Connects an existing CSLFog object to the scene

Parameters:
[in]  in_pNewFog  The new CSLFog
Returns:
Pointer to the old CSLFog object

CSLAmbience* ConnectAmbience ( CSLAmbience in_pNewAmbience  ) 

Connects an existing CSLAmbience object to the scene

Parameters:
[in]  in_pNewAmbience  The new CSLAmbience
Returns:
Pointer to the old CSLAmbience object

CSLCoordinateSystem* ConnectCoordinateSystem ( CSLCoordinateSystem in_pNewCoordSystem  ) 

Connects an existing CSLCoordinateSystem object to the scene

Parameters:
[in]  in_pNewCoordSystem  The new CSLCoordinateSystem
Returns:
Pointer to the old CSLCoordinateSystem object

CSLEnvelopeList* ConnectEnvelopeList ( CSLEnvelopeList in_pNewEnvList  ) 

Connects an existing CSLEnvelopeList object to the scene

Parameters:
[in]  in_pNewEnvList  The new CSLEnvelopeList
Returns:
Pointer to the old CSLEnvelopeList object

CSLImageLibrary* ConnectImageLibrary ( CSLImageLibrary in_pImageLibrary  ) 

Connects Image library

Note:
The parser must support 3.6 templates in order to connect an image library
Parameters:
[in]  in_pImageLibrary  Pointer to the pre-allocated image library to connect
Returns:
Pointer to the newly connected image library or null if there's already an image library or if the parser does not support 3.6 templates

SI_Error RegisterCallback ( SI_Char *  in_pName,
SLTemplateCallback in_pTemplateCallback  
)

Registers a new template callback

Parameters:
[in]  in_pName  The template name
[in]  in_pTemplateCallback  The template callback structure
Returns:
Error code
Example:
Adding a new template callback
            //
            // Remember the native callbacks
            //

            SLTemplateCallback* l_pOldCallback = Scene->Callback ( "SI_Mesh" );
            memcpy ( &m_sNativeCallbacks, l_pOldCallback, sizeof ( SLTemplateCallback ));

            //
            // Create new set of callbacks
            //

            SLTemplateCallback  l_NewCallbacks;
            memcpy ( &l_NewCallbacks, l_pOldCallback, sizeof ( SLTemplateCallback ));

            //
            // Add a PostChilren callback and keep the others to the default
            //

            l_NewCallbacks.m_PostChildrenCallback  = SIMeshPostRTPCallback;

            //
            // Register the new callbacks
            //

            in_pCurrentScene->RegisterCallback ( "SI_Mesh", &l_NewCallbacks );

SI_Error UnregisterCallback ( SI_Char *  in_pName  ) 

Unregisters a template callback

Parameters:
[in]  in_pName  The template name
Returns:
Error code

SI_Error UnregisterAllCallbacks (  ) 

Unregisters all template callback

Returns:
Error code

SLTemplateCallback* Callback ( SI_Char *  in_pName  ) 

Returns a callback by name

Parameters:
[in]  in_pName  Template name
Returns:
Pointer to a callback struct

SI_Bool SupportsTemplates ( SI_Int  in_nMajor,
SI_Int  in_nMinor  
)

Checks if the parser of the scene supports templates of a specific version of the dotXSI format

Parameters:
[in]  in_nMajor  Major version of the parser
[in]  in_nMinor  Minor version of the parser
Return values:
true  if the version is supported
false  otherwise

SI_Void SetWarningCallback ( SI_WARNING_CALLBACK_FNC  in_pfncCallback  )  [inline]

Sets the callback that receives warning messages

Parameters:
[in]  in_pfncCallback  Callback function

SI_Void SetReadCallback ( SI_READ_CALLBACK_FNC  in_pfncCallback  )  [inline]

Sets the callback that gets call for reading every template

Parameters:
[in]  in_pfncCallback  Callback function

SI_Error GetRefCount ( CSLTemplate **  in_ppObjects,
SI_Int **  out_ppRefCounts,
SI_Int  in_iObjectCount,
CSLTemplate::ETemplateType  in_eType  
)

Returns the refcount (how many others uses the specified template)

Parameters:
[in]  in_ppObjects  which objects to check
[out]  out_ppRefCounts  Counts for each one
[in]  in_iObjectCount  How many objects in the array
[in]  in_eType  Types (either CSLTemplate::SI_MODEL or CSLTemplate::SI_MATERIAL)


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