# CSLScene Class Reference

`#include <Scene.h>`

Inheritance diagram for CSLScene:

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 ()
virtual SI_Error | Write (SI_Char *in_szFileName)
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 is the top level object for a dotXSI abstraction using the SemanticLayer (see the SI_Scene template reference). From this class, you can access all the models, primitives, materials etc.

## Member Function Documentation

SI_Error Open | ( | SI_Char * | in_szFileName | ) |

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

Parameters:

  | SI_Char* | File to open.

Returns:
  SI_Error Error code.

SI_Error Open | ( | SI_Char * | in_szFileName,
|  | SI_READ_CALLBACK_FNC | in_pFunc |
| ) |  |  |

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

Parameters:

  | SI_Char* | File to open.
  | SI_READ_CALLBACK_FNC | read callback

Returns:
  SI_Error Error code.

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

Create a new dotXSI file.

Parameters:

  | SI_Char* | File to create.
  | SI_Int | Major version of the file.
  | SI_Int | Minor version of the file.
  | SI_Int | Format of the file (text or binary) for dotXSI

Returns:
  SI_Error Error code.

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

Create a new dotXSI file.

Parameters:

  | SI_Int | Major version of the file.
  | SI_Int | Minor version of the file.
  | SI_Int | Format of the file (text or binary) for dotXSI

Returns:
  SI_Error Error code.

SI_Error Open | ( | CXSIParser * | in_parser | ) |

Create a new dotXSI file.

Parameters:

  | CXSIParser | Parser to use

Returns:
  SI_Error Error code.

SI_Error Read | ( |  | ) |

Populate the semantic layer with data present in the file.

Returns:
  SI_Error Error code.

virtual SI_Error Write | ( |  | ) | `[virtual]`

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

Returns:
  SI_Error Error code.

Reimplemented in CSLCOLLADAScene.

virtual SI_Error Write | ( | SI_Char * | in_szFileName | ) | `[virtual]`

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

Parameters:

  | SI_Char* | File to create.

Returns:
  SI_Error Error code.

Reimplemented in CSLCOLLADAScene.

SI_Error Close | ( |  | ) |

Close the opened/created file.

Returns:
  SI_Error Error code.

CSLModel* FindModel | ( | SI_Char * | in_szModelName | ) |

Find a SI_Model by name

Parameters:

  | SI_Char* | The model's name

Returns:
  CSLModel* The model, or NULL if not found.

CSLModel* FindModelRecursively | ( | SI_Char * | in_szModelName,
|  | CSLModel * | in_pModel |
| ) |  |  |

Find a SI_Model, recursively.

Parameters:

  | SI_Char* | The model's name
  | CSLModel* | A Pointer to a CSLModel

Returns:
  CSLModel* The model, or NULL if not found.

CSLAnimatableType* FindParameter | ( | SI_Char * | in_szParameterName | ) |

Find a parameter by name.

Parameters:

  | SI_Char* | The Softimage path to the parameter (see below)

Returns:
  CSLAnimatableParameter* The parameter.

Note:
  When we say "the Softimage path to a parameter", we mean 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.

SI_Error GetValue | ( | SI_Char * | in_szParameterName,
|  | SI_Float * | out_pfValue |
| ) |  |  |

Gets a parameter value.

Parameters:

  | SI_Char* | The Softimage path to the parameter (see below)
  | SI_Float* | The parameter's value

Returns:
  SI_Error Error code

SI_Error SetValue | ( | SI_Char * | in_szParameterName,
|  | SI_Float | in_fValue |
| ) |  |  |

Sets a parameter value.

Parameters:

  | SI_Char* | The Softimage path to the parameter (see below)
  | SI_Float | The parameter's new value

Returns:
  SI_Error Error code

CSLAmbience* Ambience | ( |  | ) |

Gets the ambience object.

Returns:
  CSLAmbience* The ambience object

CSLAmbience* CreateAmbience | ( |  | ) |

Creation of Ambience

Returns:
  CSLAmbience*

SI_Error DestroyAmbience | ( |  | ) |

Removes the Ambience object

Returns:
  SI_Error Error code

CSLCoordinateSystem* CoordinateSystem | ( |  | ) |

Gets the coordinatesystem object

Returns:
  CSLCoordinateSystem* The CoordinateSystem object

CSLEnvelopeList* EnvelopeList | ( |  | ) |

Gets the EnvelopeList object

Returns:
  CSLEnvelopeList* The EnvelopeList object

CSLFog* Fog | ( |  | ) |

Gets the Fog object

Returns:
  CSLFog* The Fog object

CSLMaterialLibrary* GetMaterialLibrary | ( |  | ) |

Gets the MaterialLibrary object

Returns:
  CSLMaterialLibrary* The MaterialLibrary object

CSLModel* Root | ( |  | ) |

Gets the Root Model

Returns:
  CSLModel* The Root Model

CXSIParser* Parser | ( |  | ) |

Gets the CXSIParser object

Returns:
  CXSIParser* the CXSIParser object

CSLAngle* Angle | ( |  | ) |

Gets the Angle object

Returns:
  CSLAngle* The Angle object

CSLFileInfo* FileInfo | ( |  | ) |

Gets the FileInfo object

Returns:
  CSLFileInfo* The FileInfo object

CSLSceneInfo* SceneInfo | ( |  | ) |

Gets the SceneInfo object

Returns:
  CSLSceneInfo* The SceneInfo object

CSLLogger* Logger | ( |  | ) |

Gets the Logger object

Returns:
  CSLLogger* The Logger object

CSIBCString& FileName | ( |  | ) |

Gets the filename for the current scene

Returns:
  CSIBCString& The filename

CSLImageLibrary* GetImageLibrary | ( |  | ) |

Get the image library

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

SI_Error DestroyFog | ( |  | ) |

Removes the Fog object

Returns:
  SI_Error Error code

CSLFog* CreateFog | ( |  | ) |

Creation of Fog

Returns:
  CSLFog*

SI_Error DestroyEnvelopeList | ( |  | ) |

Removes the EnvelopeList object

Returns:
  SI_Error Error code

virtual CSLEnvelopeList* CreateEnvelopeList | ( |  | ) | `[virtual]`

Creation of envelope list

Returns:
  CSLEnvelopeList*

Reimplemented in CSLCOLLADAScene.

virtual CSLImageLibrary* CreateImageLibrary | ( |  | ) | `[virtual]`

Creation of an Image Library

Returns:
  CSLImageLibrary*

Note:
  Introduced in 3.6

Reimplemented in CSLCOLLADAScene.

SI_Error DestroyImageLibrary | ( |  | ) |

Removal of the Image Library

Returns:
  Error code

Note:
  Introduced in 3.6

virtual CSLMaterialLibrary* ConnectMaterialLibrary | ( | CSLMaterialLibrary * | in_pNewMaterialLibrary | ) | `[virtual]`

Connect an existing CSLMaterialLibrary object to the scene

Parameters:

  | CSLMaterialLibrary* | The new CSLMaterialLibrary

Returns:
  CSLMaterialLibrary* The old CSLMaterialLibrary

CSLAngle* ConnectAngle | ( | CSLAngle * | in_pNewAngle | ) |

Connect an existing CSLAngle object to the scene

Parameters:

  | CSLAngle* | The new CSLAngle

Returns:
  CSLAngle* The old CSLAngle

CSLFileInfo* ConnectFileInfo | ( | CSLFileInfo * | in_pNewFileInfo | ) |

Connect an existing CSLFileInfo object to the scene

Parameters:

  | CSLFileInfo* | The new CSLFileInfo

Returns:
  CSLFileInfo* The old CSLFileInfo

CSLSceneInfo* ConnectSceneInfo | ( | CSLSceneInfo * | in_pToConnect | ) |

Connect an existing CSLSceneInfo object to the scene

Parameters:

  | CSLSceneInfo* | The new CSLSceneInfo

Returns:
  CSLSceneInfo* The old CSLSceneInfo

CSLFog* ConnectFog | ( | CSLFog * | in_pNewFog | ) |

Connect an existing CSLFog object to the scene

Parameters:

  | CSLFog* | The new CSLFog

Returns:
  CSLFog* The old CSLFog

CSLAmbience* ConnectAmbience | ( | CSLAmbience * | in_pNewAmbience | ) |

Connect an existing CSLAmbience object to the scene

Parameters:

  | CSLAmbience* | The new CSLAmbience

Returns:
  CSLAmbience* The old CSLAmbience

CSLCoordinateSystem* ConnectCoordinateSystem | ( | CSLCoordinateSystem * | in_pNewCoordSystem | ) |

Connect an existing CSLCoordinateSystem object to the scene

Parameters:

  | CSLCoordinateSystem* | The new CSLCoordinateSystem

Returns:
  CSLCoordinateSystem* The old CSLCoordinateSystem

CSLEnvelopeList* ConnectEnvelopeList | ( | CSLEnvelopeList * | in_pNewEnvList | ) |

Connect an existing CSLEnvelopeList object to the scene

Parameters:

  | CSLEnvelopeList* | The new CSLEnvelopeList

Returns:
  CSLEnvelopeList* The old CSLEnvelopeList

CSLImageLibrary* ConnectImageLibrary | ( | CSLImageLibrary * | in_pImageLibrary | ) |

Connect Image library

Parameters:

  | 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

Note:
  The parser must support 3.6 templates in order to connect an image library

SI_Error RegisterCallback | ( | SI_Char * | in_pName,
|  | SLTemplateCallback * | in_pTemplateCallback |
| ) |  |  |

Register a new template callback

Parameters:

  | SI_Char* | The template name
  | SLTemplateCallback | * The template callback structure

Returns:
  SI_Error 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 | ) |

Unregister a template callback

Parameters:

  | SI_Char* | The template name

Returns:
  SI_Error Error code

SI_Error UnregisterAllCallbacks | ( |  | ) |

Unregister all template callback

Returns:
  SI_Error Error code

SLTemplateCallback* Callback | ( | SI_Char * | in_pName | ) |

Get a callback by name

Parameters:

  | SI_Char* | Template name

Returns:
  SLTemplateCallback* 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_nMajor | Major version of the parser
  | in_nMinor | Minor version of the parser

Returns:
  SI_Bool 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_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_pfncCallback | Callback function

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

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

Parameters:

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

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

- Scene.h