FCDEffectCode Class Reference

A COLLADA code inclusion. More...

#include <FCDEffectCode.h>

Inheritance diagram for FCDEffectCode:

FCDObject FUObject List of all members.

Public Types

enum  Type { INCLUDE, CODE }
 The list of support code inclusion types. More...

Public Member Functions

 FCDEffectCode (FCDocument *document)
 Constructor: do not use directly.
 ~FCDEffectCode ()
 Destructor: do not use directly.
Type GetType () const
 Retrieves the form of the code inclusion.
void SetType (Type _type)
 Sets the form of the code inclusion.
const string & GetSid () const
 Retrieves the sub-id of the code inclusion.
void SetSid (const string &_sid)
 Sets the sub-id of the code inclusion.
const fstring & GetCode () const
 Retrieves the inlined code.
void SetCode (const fstring &_code)
 Sets the inlined code.
const fstring & GetFilename () const
 Retrieves the filename of the code file to open.
void SetFilename (const fstring &_filename)
 Sets the filename of the code file.
FCDEffectCodeClone () const
 [INTERNAL] Clones the code inclusion.
FUStatus LoadFromXML (xmlNode *codeNode)
 [INTERNAL] Reads in the code inclusion from a given COLLADA XML tree node.
xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the code inclusion to the given COLLADA XML tree node.

Detailed Description

A COLLADA code inclusion.

Code inclusions come in two forms: file includes and inline code. For file includes, you will want to grab the filename of the file using the GetFilename function and for inline code, you can get the code directly through the GetCode function.

Code inclusions are referenced through sub-ids by the effect pass shaders. Regardless of the extension of the filename of file includes, the code inclusions' language is solely determined by the effect profile they belong to.


Member Enumeration Documentation

enum FCDEffectCode::Type
 

The list of support code inclusion types.

Enumerator:
CODE  Inlined code.

See also:
GetCode


Constructor & Destructor Documentation

FCDEffectCode::FCDEffectCode FCDocument document  ) 
 

Constructor: do not use directly.

Instead, use the FCDEffectProfile::AddCode or the FCDEffectTechnique::AddCode functions.

Parameters:
document The COLLADA document that owns this code inclusion.

FCDEffectCode::~FCDEffectCode  ) 
 

Destructor: do not use directly.

Instead, use the FCDEffectProfile::ReleaseCode or the FCDEffectTechnique::ReleaseCode functions.


Member Function Documentation

FCDEffectCode* FCDEffectCode::Clone  )  const
 

[INTERNAL] Clones the code inclusion.

Returns:
The cloned effect object. You will must delete this pointer.

const fstring& FCDEffectCode::GetCode  )  const [inline]
 

Retrieves the inlined code.

First verify that this code inclusion contains inlined code using the GetType function.

Returns:
The inlined code.

const fstring& FCDEffectCode::GetFilename  )  const [inline]
 

Retrieves the filename of the code file to open.

First verify that this code inclusion contains a filename using the GetType function.

Returns:
The code filename.

const string& FCDEffectCode::GetSid  )  const [inline]
 

Retrieves the sub-id of the code inclusion.

Used to match the code inclusion within the effect pass shaders.

Returns:
The sub-id.

Type FCDEffectCode::GetType  )  const [inline]
 

Retrieves the form of the code inclusion.

Returns:
The form.

FUStatus FCDEffectCode::LoadFromXML xmlNode *  codeNode  ) 
 

[INTERNAL] Reads in the code inclusion from a given COLLADA XML tree node.

Code inclusions cover the <code> element and the <include> element.

Parameters:
codeNode The COLLADA XML tree node.
Returns:
The status of the import. If the status is not successful, it may be dangerous to extract information from the code inclusion.

void FCDEffectCode::SetCode const fstring &  _code  )  [inline]
 

Sets the inlined code.

As a side-effect, calling this function forces the type of the code inclusion.

Parameters:
_code The inlined code.

void FCDEffectCode::SetFilename const fstring &  _filename  )  [inline]
 

Sets the filename of the code file.

As a side-effect, calling this function forces the type of the code inclusion.

Parameters:
_filename The code filename.

void FCDEffectCode::SetSid const string &  _sid  )  [inline]
 

Sets the sub-id of the code inclusion.

This value may change on export, as the sub-id must be unique within its scope.

Parameters:
_sid The sub-id.

void FCDEffectCode::SetType Type  _type  )  [inline]
 

Sets the form of the code inclusion.

Changing the form of the code inclusion will not remove the inline code or the filename.

Parameters:
_type The form.

xmlNode* FCDEffectCode::WriteToXML xmlNode *  parentNode  )  const
 

[INTERNAL] Writes out the code inclusion to the given COLLADA XML tree node.

Parameters:
parentNode The COLLADA XML parent node in which to insert the code inclusion.
Returns:
The created element XML tree node.


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:41 2006 for FCollada by  doxygen 1.4.6-NO