FCDMaterial Class Reference
[COLLADA Document Object Model.]

A COLLADA material. More...

#include <FCDMaterial.h>

Inheritance diagram for FCDMaterial:

FCDEntity FCDObjectWithId FCDObject FUObject List of all members.

Public Member Functions

 FCDMaterial (FCDocument *document)
 Constructor: do not use directly.
virtual ~FCDMaterial ()
 Destructor: do not use directly.
virtual Type GetType () const
 Retrieves the entity type for this class.
FCDEffectGetEffect ()
 Retrieves the effect instantiated for this material.
const FCDEffectGetEffect () const
 See above.
void SetEffect (FCDEffect *_effect)
 Sets the effect instantiated for this material.
FCDMaterialTechniqueHintListGetTechniqueHints ()
 Retrieves the list of the material platform-technique hints.
const FCDMaterialTechniqueHintListGetTechniqueHints () const
 See above.
FCDEffectParameterListGetParameters ()
 Retrieves the list of effect parameter overrides.
const FCDEffectParameterListGetParameters () const
 See above.
FCDEffectParameterFindParameterBySemantic (const string &semantic)
 Retrieves an effect parameter override.
void FindParametersBySemantic (const string &semantic, FCDEffectParameterList &parameters)
 Retrieves a subset of the effect parameter override list.
void FindParametersByReference (const string &reference, FCDEffectParameterList &parameters)
 Retrieves a subset of the effect parameter override list.
FCDMaterialClone ()
 [INTERNAL] Clones the material object.
void Flatten ()
 [INTERNAL] Flattens the material, pushing all the effect parameter overrides into the effect parameter generators and moving all the parameters to the effect technique level of abstraction.
virtual FUStatus LoadFromXML (xmlNode *materialNode)
 [INTERNAL] Reads in the <material> element from a given COLLADA XML tree node.
virtual xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the <material> element to the given COLLADA XML tree node.

Detailed Description

A COLLADA material.

A COLLADA material is one of many abstraction level that defines how to render mesh polygon sets. It instantiates an effect and may overrides some of the effect parameters with its own values.

Unless you care about the construction history or memory, you should probably use the FCDMaterialInstance::FlattenMaterial function.


Constructor & Destructor Documentation

FCDMaterial::FCDMaterial FCDocument document  ) 
 

Constructor: do not use directly.

Instead, use the FCDMaterialLibrary::AddMaterial function.

Parameters:
document The COLLADA document that owns the material.

virtual FCDMaterial::~FCDMaterial  )  [virtual]
 

Destructor: do not use directly.

The material library will release all the materials when it is released. If you want to remove a material from the material library: use the FCDMaterialLibrary::RemoveMaterial function.


Member Function Documentation

FCDMaterial* FCDMaterial::Clone  ) 
 

[INTERNAL] Clones the material object.

Everything is cloned, including the effect parameter. You will need release the cloned material directly, by deleting the pointer.

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

FCDEffectParameter* FCDMaterial::FindParameterBySemantic const string &  semantic  ) 
 

Retrieves an effect parameter override.

Looks for the effect parameter override with the correct semantic, in order to bind or set its value. This function searches through the material and the level of abstractions below.

Parameters:
semantic The effect parameter semantic to match.
Returns:
The effect parameter override that matches the semantic. This pointer will be NULL if no effect parameter override matches the given semantic.

void FCDMaterial::FindParametersByReference const string &  reference,
FCDEffectParameterList parameters
 

Retrieves a subset of the effect parameter override list.

Look for the effect parameter overrides with the correct reference. This function searches through the material and the level of abstractions below.

Parameters:
reference The effect parameter reference to match. In the case of effect parameter generators, the reference is replaced by the sub-id.
parameters The list of parameters to fill in. This list is not cleared.

void FCDMaterial::FindParametersBySemantic const string &  semantic,
FCDEffectParameterList parameters
 

Retrieves a subset of the effect parameter override list.

Look for the effect parameter overrides with the correct semantic. This function searches through the material and the level of abstractions below.

Parameters:
semantic The effect parameter semantic to match.
parameters The list of parameters to fill in. This list is not cleared.

void FCDMaterial::Flatten  ) 
 

[INTERNAL] Flattens the material, pushing all the effect parameter overrides into the effect parameter generators and moving all the parameters to the effect technique level of abstraction.

To flatten the material, use the FCDMaterialInstance::FlattenMaterial function.

FCDEffect* FCDMaterial::GetEffect  )  [inline]
 

Retrieves the effect instantiated for this material.

The parameters of the effect may be overwritten by this material. You should either flatten the material using the FlattenMaterial function or verify the parameter values manually using the parameter list accessors.

Returns:
The instantiated effect. This pointer will be NULL if the material has no rendering.

FCDEffectParameterList* FCDMaterial::GetParameters  )  [inline]
 

Retrieves the list of effect parameter overrides.

Returns:
The list of effect parameter overrides.

FCDMaterialTechniqueHintList& FCDMaterial::GetTechniqueHints  )  [inline]
 

Retrieves the list of the material platform-technique hints.

Returns:
The list of material platform-technique hints.

virtual Type FCDMaterial::GetType  )  const [inline, virtual]
 

Retrieves the entity type for this class.

This function is part of the FCDEntity class interface.

Returns:
The entity type: MATERIAL.

Reimplemented from FCDEntity.

virtual FUStatus FCDMaterial::LoadFromXML xmlNode *  materialNode  )  [virtual]
 

[INTERNAL] Reads in the <material> element from a given COLLADA XML tree node.

Parameters:
materialNode 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 material.

Reimplemented from FCDEntity.

void FCDMaterial::SetEffect FCDEffect _effect  )  [inline]
 

Sets the effect instantiated for this material.

Parameters:
_effect The effect instantiated for this material.

virtual xmlNode* FCDMaterial::WriteToXML xmlNode *  parentNode  )  const [virtual]
 

[INTERNAL] Writes out the <material> element to the given COLLADA XML tree node.

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

Reimplemented from FCDEntity.


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