FCDGeometrySource Class Reference
[COLLADA Document Geometry Entity]

A COLLADA data source for geometric meshes. More...

#include <FCDGeometrySource.h>

Inheritance diagram for FCDGeometrySource:

FCDObjectWithId FCDObject FUObject List of all members.

Public Member Functions

 FCDGeometrySource (FCDocument *document)
 Constructor: do not use directly.
virtual ~FCDGeometrySource ()
 Destructor: do not use directly.
const fstring & GetName () const
 Retrieves the name of the data source.
FloatListGetSourceData ()
 Retrieves the pure data of the data source.
const FloatListGetSourceData () const
 See above.
uint32 GetSourceStride () const
 Retrieves the stride of the data within the source.
const string & GetSourceId () const
FCDAnimatedListGetAnimatedValues ()
 Retrieves the list of animated values for the data of the source.
const FCDAnimatedListGetAnimatedValues () const
 See above.
xmlNode * GetSourceNode ()
FUDaeGeometryInput::Semantic GetSourceType () const
 Retrieves the type of data contained within the source.
void SetName (const fstring &_name)
 Sets the user-friendly name of the data source.
void SetSourceData (const FloatList &_sourceData, uint32 _sourceStride, size_t offset=0, size_t count=0)
 Overwrites the data contained within the data source.
void SetSourceNode (xmlNode *_sourceNode)
 [INTERNAL] Sets the XML tree node associated with the data source.
void SetSourceType (FUDaeGeometryInput::Semantic type)
 Sets the type of data contained within this data source.
FCDGeometrySourceClone () const
 [INTERNAL] Clones this data source.
FUStatus LoadFromXML (xmlNode *sourceNode)
 [INTERNAL] Reads in the <source> element from a given COLLADA XML tree node.
xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the <source> element to the given COLLADA XML tree node.

Detailed Description

A COLLADA data source for geometric meshes.

A COLLADA data source for geometric meshes contains a list of floating-point values and the information to parse these floating-point values into meaningful content: the stride of the list and the type of data that the floating-point values represent. When the floating-point values are split according to the stride, you get multiple elemental values of the given type. A data source may also have a user-generated name to identify the data within. The name is optional and is used to keep around the user-friendly name for texture coordinate sets or color sets.

The values of the COLLADA data source may be animated individually, or together: as an element.


Constructor & Destructor Documentation

FCDGeometrySource::FCDGeometrySource FCDocument document  ) 
 

Constructor: do not use directly.

Use FCDGeometryMesh::AddSource or FCDGeometryMesh::AddValueSource instead.

Parameters:
document The COLLADA document which owns the data source.

virtual FCDGeometrySource::~FCDGeometrySource  )  [virtual]
 

Destructor: do not use directly.

The geometric mesh which contains the data source will release it.


Member Function Documentation

FCDGeometrySource* FCDGeometrySource::Clone  )  const
 

[INTERNAL] Clones this data source.

You will need to release this pointer manually.

Returns:
An identical copy of the data source.

FCDAnimatedList& FCDGeometrySource::GetAnimatedValues  )  [inline]
 

Retrieves the list of animated values for the data of the source.

Returns:
The list of animated values.

const fstring& FCDGeometrySource::GetName  )  const [inline]
 

Retrieves the name of the data source.

The name is optional and is used to keep around a user-friendly name for texture coordinate sets or color sets.

Returns:
The name of the data source.

FloatList& FCDGeometrySource::GetSourceData  )  [inline]
 

Retrieves the pure data of the data source.

This is a dynamically-sized array of floating-point values that contains all the data of the source.

Returns:
The pure data of the data source.

const string& FCDGeometrySource::GetSourceId  )  const [inline]
 

Deprecated:
Retrieves the COLLADA id for the source. Use the class parent's GetDaeId function instead.
Returns:
The COLLADA id.

xmlNode* FCDGeometrySource::GetSourceNode  )  [inline]
 

Deprecated:
[INTERNAL] Retrieves the XML tree node that represent this source. This is used when computing the list of animated values.
Todo:
Take the XML tree node out of this class.
Returns:
The XML tree node. This pointer is invalid if accessed after the document is fully parsed.

uint32 FCDGeometrySource::GetSourceStride  )  const [inline]
 

Retrieves the stride of the data within the source.

There is no guarantee that the number of data values within the source is a multiple of the stride, yet you should always verify that the stride is at least the wanted dimension. For example, there is no guarantee that your vertex position data source has a stride of 3. 3dsMax is known to always export 3D texture coordinate positions.

Returns:
The stride of the data.

FUDaeGeometryInput::Semantic FCDGeometrySource::GetSourceType  )  const [inline]
 

Retrieves the type of data contained within the source.

Common values for the type of data are POSITION, NORMAL, COLOR and TEXCOORD. Please see FUDaeGeometryInput for more information.

See also:
FUDaeGeometryInput.
Returns:
The type of data contained within the source.

FUStatus FCDGeometrySource::LoadFromXML xmlNode *  sourceNode  ) 
 

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

Parameters:
sourceNode 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 data source.

void FCDGeometrySource::SetName const fstring &  _name  )  [inline]
 

Sets the user-friendly name of the data source.

The name is optional and is used to keep around a user-friendly name for texture coordinate sets or color sets.

Parameters:
_name The user-friendly name of the data source.

void FCDGeometrySource::SetSourceData const FloatList _sourceData,
uint32  _sourceStride,
size_t  offset = 0,
size_t  count = 0
 

Overwrites the data contained within the data source.

Parameters:
_sourceData The new data for this source.
_sourceStride The stride for the new data.
offset The offset at which to start retrieving the new data. This argument defaults at 0 to indicate that the data copy should start from the beginning.
count The number of data entries to copy into the data source. This argument defaults at 0 to indicate that the data copy should include everything.

void FCDGeometrySource::SetSourceNode xmlNode *  _sourceNode  )  [inline]
 

[INTERNAL] Sets the XML tree node associated with the data source.

Todo:
Take the XML tree node out of this class.
Parameters:
_sourceNode A XML tree node.

void FCDGeometrySource::SetSourceType FUDaeGeometryInput::Semantic  type  ) 
 

Sets the type of data contained within this data source.

Parameters:
type The new type of data for this data source.

xmlNode* FCDGeometrySource::WriteToXML xmlNode *  parentNode  )  const
 

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

Parameters:
parentNode The COLLADA XML parent node in which to insert the data source.
Returns:
The created <source> element XML tree node.


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