iColladaConvertor Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
iColladaConvertor Struct Reference

Representation of a convertor from COLLADA files to Crystal Space files. More...

`#include <ivaria/collada.h>`

Inheritance diagram for iColladaConvertor:

List of all members.

## Public Member Functions
virtual const char * | Convert ()=0
| Converts the loaded COLLADA file into the loaded Crystal Space file.
virtual bool | ConvertEffects ()=0
| Converts the effects (COLLADA FX) section of the COLLADA file.
virtual bool | ConvertGeometry (iDocumentNode *geometrySection)=0
| Converts the geometry section of the COLLADA file.
virtual bool | ConvertPhysics (iDocumentNode *physicsSection)=0
| Converts the physics section of the COLLADA file.
virtual bool | ConvertRiggingAnimation (iDocumentNode *riggingSection)=0
| Converts the rigging and animation sections of the COLLADA file.
virtual bool | ConvertScene (iDocumentNode *camerasSection, iDocumentNode *lightsSection, iDocumentNode *visualScenesSection)=0
| Converts the scene section of the COLLADA file.
virtual csRef< iDocument > | GetColladaDocument ()=0
| Returns the Collada Document.
virtual csRef< iDocument > | GetCrystalDocument ()=0
| Returns the Crystal Space Document.
virtual const char * | Load (const char *str)=0
| Load a COLLADA file from a null-terminated C-string into the COLLADA Conversion System.
virtual const char * | Load (iString *str)=0
| Load a COLLADA file from an iString object into the COLLADA Conversion System.
virtual const char * | Load (iFile *file)=0
| Load a COLLADA file from an iFile object into the COLLADA Conversion System.
virtual const char * | Load (iDataBuffer *db)=0
| Load a COLLADA file from an iDataBuffer object into the COLLADA Conversion System.
virtual const char * | SetOutputFiletype (csColladaFileType filetype)=0
| Sets the Crystal Space output file type.
virtual void | SetSectorScene (bool toggle)=0
| Set if each scene is an entire sector.
virtual void | SetWarnings (bool toggle=false)=0
| Turn debugging warnings on or off.
virtual const char * | Write (const char *filepath)=0
| Writes the converted Crystal Space file out to disk.

## Detailed Description

Representation of a convertor from COLLADA files to Crystal Space files.

Main creators of instances implementing this interface:

- Crystal Space COLLADA Conversion System ( crystalspace.utilities.colladaconvertor)

Main ways to get pointers to this interface:

- CS_QUERY_REGISTRY()

Definition at line 79 of file collada.h.

## Member Function Documentation

virtual const char* iColladaConvertor::Convert | ( |  | ) | `[pure virtual]`

Converts the loaded COLLADA file into the loaded Crystal Space file.

This function will completely convert a loaded COLLADA file into Crystal Space format. It is required that both a COLLADA file must be loaded, and that a Crystal Space document must be ready. It will convert to the document type specified when the Crystal Space document was loaded.

This function essentially calls all of the other convert functions and then finalizes the iDocument so it can be completely written out to a file.

Returns:
  0 is everything is ok; otherwise an error message

Remarks:
  If debugging warnings are enabled, this function will display error messages in the console window. Otherwise, error messages will only be available through the return value.

Warning:
  An error will result if SetOutputFileType() is not called prior to this function.

See also:
  ConvertGeometry(iDocumentNode *geometrySection)
  ConvertLighting(iDocumentNode *lightingSection)
  ConvertTextureShading(iDocumentNode *textureSection)
  ConvertRiggingAnimation(iDocumentNode *riggingSection)
  ConvertPhysics(iDocumentNode *physicsSection)
  Write(const char* path)
  Load(iFile *file, csColladaFileType typeEnum)

virtual bool iColladaConvertor::ConvertEffects | ( |  | ) | `[pure virtual]`

Converts the effects (COLLADA FX) section of the COLLADA file.

This converts the COLLADA FX portion of the COLLADA file to Crystal Space format. Specifically, it converts the <library_images> elements to textures and all <effect> elements to Crystal Space materials and shaders. Currently, only <profile_COMMON> is supported, but support for <profile_GLSL> and <profile_CG> are coming.

Returns:
  true on success, false otherwise

virtual bool iColladaConvertor::ConvertGeometry | ( | iDocumentNode * | geometrySection | ) | `[pure virtual]`

Converts the geometry section of the COLLADA file.

This converts the <mesh> elements of a COLLADA file to Crystal Space format. The function will update the internal Crystal Space document, which can then be used to write out to a file.

Parameters:

  geometrySection | A pointer to the <library_geometries> element, in the COLLADA document.

virtual bool iColladaConvertor::ConvertPhysics | ( | iDocumentNode * | physicsSection | ) | `[pure virtual]`

Converts the physics section of the COLLADA file.

virtual bool iColladaConvertor::ConvertRiggingAnimation | ( | iDocumentNode * | riggingSection | ) | `[pure virtual]`

Converts the rigging and animation sections of the COLLADA file.

virtual bool iColladaConvertor::ConvertScene | ( | iDocumentNode * | camerasSection,
|  | iDocumentNode * | lightsSection,
|  | iDocumentNode * | visualScenesSection
| ) |  | `[pure virtual]`

Converts the scene section of the COLLADA file.

This function converts the <library_cameras>, <library_lights>, <library_nodes>, and <library_visual_scenes> sections of the COLLADA document. Note that unlike the other conversion functions, this function requires multiple arguments to be passed for conversion - one for each of these library elements.

Parameters:

  camerasSection | A pointer to the iDocumentNode representing the <library_cameras> element of the COLLADA document.
  lightsSection | A pointer to the iDocumentNode representing the <library_lights> element of the COLLADA document.
  nodesSection | A pointer to the iDocumentNode representing the <library_nodes> element of the COLLADA document.
  visualScenesSection | A pointer to the iDocumentNode representing the <library_visual_scenes> element of the COLLADA document.

Returns:
  true on success, false otherwise

See also:
  ConvertEffects(iDocumentNode *effectsSection)

virtual csRef<iDocument> iColladaConvertor::GetColladaDocument | ( |  | ) | `[pure virtual]`

Returns the Collada Document.

virtual csRef<iDocument> iColladaConvertor::GetCrystalDocument | ( |  | ) | `[pure virtual]`

Returns the Crystal Space Document.

virtual const char* iColladaConvertor::Load | ( | const char * | str | ) | `[pure virtual]`

Load a COLLADA file from a null-terminated C-string into the COLLADA Conversion System.

Parameters:

  str | A string containing the location of the file to be loaded in VFS

Returns:
  0 if everything is ok; otherwise an error message

Remarks:
  This will replace the current file being used to read data from.

virtual const char* iColladaConvertor::Load | ( | iString * | str | ) | `[pure virtual]`

Load a COLLADA file from an iString object into the COLLADA Conversion System.

Parameters:

  str | An iString containing the location of the file to be loaded in VFS

Returns:
  0 if everything is ok; otherwise an error message

Remarks:
  This will replace the current file being used to read data from.

virtual const char* iColladaConvertor::Load | ( | iFile * | file | ) | `[pure virtual]`

Load a COLLADA file from an iFile object into the COLLADA Conversion System.

Parameters:

  file | An iFile object which points to the document to be loaded

Returns:
  0 if everything is ok; otherwise an error message

Remarks:
  This will replace the current file being used to read data from.

Warning:
  This version of the Load function assumes that the caller created the iFile object, and thus it is the caller's responsibility to close/destroy the object.

virtual const char* iColladaConvertor::Load | ( | iDataBuffer * | db | ) | `[pure virtual]`

Load a COLLADA file from an iDataBuffer object into the COLLADA Conversion System.

Parameters:

  db | An iDataBuffer object which contains a document to be loaded

Returns:
  0 if everything is ok; otherwise an error message

Remarks:
  This will replace the current file being used to read data from.

virtual const char* iColladaConvertor::SetOutputFiletype | ( | csColladaFileType | filetype | ) | `[pure virtual]`

Sets the Crystal Space output file type.

This function is designed to tell the COLLADA Conversion System what type of file will be written to.

Parameters:

  filetype | The type of file to be written out. Will be one of: CS_LIBRARY_FILE, a Crystal Space library file CS_MAP_FILE, a Crystal Space world file

Returns:
  0 if everything is ok; otherwise an error message

Remarks:
  This function should be called before beginning the conversion process. If it has not been called, the conversion functions will return an error message.

virtual void iColladaConvertor::SetSectorScene | ( | bool | toggle | ) | `[pure virtual]`

Set if each scene is an entire sector.

Else the top level objects in each scene are considered a sector.

Parameters:

  toggle | If true, each scene is considered a sector.

virtual void iColladaConvertor::SetWarnings | ( | bool | toggle = `false` | ) | `[pure virtual]`

Turn debugging warnings on or off.

This will turn on all possible debug information for the plugin. It also will check to verify that files and data structures conform to specified standards.

Parameters:

  toggle | If true, turns on debug warnings.

Debug warnings are off by default. There is a lot of information given by turning debugging warnings on. It is suggested that it it remains off unless there appears to be a problem with the plugin.

virtual const char* iColladaConvertor::Write | ( | const char * | filepath | ) | `[pure virtual]`

Writes the converted Crystal Space file out to disk.

This is used to write the Crystal Space file out to disk, once a conversion process has been completed.

Parameters:

  filepath | The path in VFS where the file should be written to

Returns:
  0 if operation completed successfully; otherwise an error message

Remarks:
  This operation does not check to determine if the COLLADA file has been converted, or if the Crystal Space document holds anything of value. It Merely writes the document out to disk.

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

- ivaria/collada.h