FCDGeometrySource Class Reference
[COLLADA Document Geometry Entity]

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

#include <FCDGeometrySource.h>

Inheritance diagram for FCDGeometrySource:

FCDObjectWithId FCDObject FUParameterizable FUTrackable FUObject List of all members.

Public Member Functions

 FCDGeometrySource (FCDocument *document)
 Constructor: do not use directly.
virtual ~FCDGeometrySource ()
 Destructor.
FCDGeometrySourceClone (FCDGeometrySource *clone=NULL) const
 Copies the data source into a clone.
const fstringGetName () const
 Retrieves the name of the data source.
float * GetData ()
 Retrieves the pure data of the data source.
const float * GetData () const
 See above.
FCDParameterListAnimatableFloatGetSourceData ()
 [INTERNAL] Retrieve the reference to the source data.
const FCDParameterListAnimatableFloatGetSourceData () const
float ** GetDataPtr ()
 Retrieves a ptr to the data of the data source.
const float ** GetDataPtr () const
 See above.
size_t GetDataCount () const
 Retrieves the amount of data inside the source.
void SetDataCount (size_t count)
 Sets the amount of data contained inside the source.
uint32 GetStride () const
 Retrieves the stride of the data within the source.
size_t GetValueCount () const
 Retrieves the number of individual source values contained in the source.
size_t GetValueReserved () const
 Retrieves the max number of values this input can handle before memory is reallocated.
void SetValueCount (size_t count)
 Sets the number of individual source values contained in the source.
const float * GetValue (size_t index) const
 Retrieves one source value out of this source. See above.
void SetValue (size_t index, const float *value)
 Sets one source value out of this source.
FUDaeGeometryInput::Semantic GetType () const
 Retrieves the type of data contained within the source.
void SetType (FUDaeGeometryInput::Semantic type)
 Sets the type of data contained within the source.
FUObjectContainer< FCDAnimated > & GetAnimatedValues ()
 Retrieves the list of animated values for the data of the source.
const FUObjectContainer< FCDAnimated > & GetAnimatedValues () const
 See above.
void SetName (const fstring &_name)
 Sets the user-friendly name of the data source.
void SetData (const FloatList &_sourceData, uint32 _sourceStride, size_t count=0, size_t offset=0)
 Overwrites the data contained within the data source.
void SetStride (uint32 _stride)
 Sets the stride for the source data.
void SetSourceType (FUDaeGeometryInput::Semantic type)
 [INTERNAL] Set the source type.
FCDExtraGetExtra ()
 Retrieves the extra information contained by this data source.
const FCDExtraGetExtra () const
 See above.
FCDGeometrySourceClone () const
 [INTERNAL] Clones this data source.

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 the individual source 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.

Each source 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.


Member Function Documentation

FCDGeometrySource* FCDGeometrySource::Clone  )  const
 

[INTERNAL] Clones this data source.

You will need to release the returned pointer manually.

Returns:
An identical copy of the data source.

FCDGeometrySource* FCDGeometrySource::Clone FCDGeometrySource clone = NULL  )  const
 

Copies the data source into a clone.

The clone may reside in another document.

Parameters:
clone The empty clone. If this pointer is NULL, a new data source will be created and you will need to release the returned pointer manually.
Returns:
The clone.

FUObjectContainer<FCDAnimated>& FCDGeometrySource::GetAnimatedValues  )  [inline]
 

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

Returns:
The list of animated values.

float* FCDGeometrySource::GetData  )  [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.

size_t FCDGeometrySource::GetDataCount  )  const [inline]
 

Retrieves the amount of data inside the source.

Returns:
The number of data entries in the source.

float** FCDGeometrySource::GetDataPtr  )  [inline]
 

Retrieves a ptr to the data of the data source.

This allows external objects to store pointers to our data even when the data memory is reallocated

Returns:
The ptr to the pure data of the data source.

FCDExtra* FCDGeometrySource::GetExtra  ) 
 

Retrieves the extra information contained by this data source.

Returns:
The extra tree. This pointer will be NULL, in the const-version of this function, if there is no extra information. In the modifiable-version of this function: you will always get a valid extra tree that you can fill in.

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.

FCDParameterListAnimatableFloat& FCDGeometrySource::GetSourceData  )  [inline]
 

[INTERNAL] Retrieve the reference to the source data.

Returns:
The reference to the source data.

uint32 FCDGeometrySource::GetStride  )  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::GetType  )  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.

const float* FCDGeometrySource::GetValue size_t  index  )  const [inline]
 

Retrieves one source value out of this source. See above.

Parameters:
index The index of the source value.
Returns:
The source value.

size_t FCDGeometrySource::GetValueCount  )  const [inline]
 

Retrieves the number of individual source values contained in the source.

Returns:
The number of source values.

size_t FCDGeometrySource::GetValueReserved  )  const [inline]
 

Retrieves the max number of values this input can handle before memory is reallocated.

Returns:
The number of source values.

void FCDGeometrySource::SetData const FloatList _sourceData,
uint32  _sourceStride,
size_t  count = 0,
size_t  offset = 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::SetDataCount size_t  count  ) 
 

Sets the amount of data contained inside the source.

It is preferable to set the stride and to use SetValueCount. No initialization of new values is done.

Parameters:
count The amount of data for the source to contain.

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::SetSourceType FUDaeGeometryInput::Semantic  type  )  [inline]
 

[INTERNAL] Set the source type.

Parameters:
type The source type.

void FCDGeometrySource::SetStride uint32  _stride  )  [inline]
 

Sets the stride for the source data.

Parameters:
_stride The stride for the source data.

void FCDGeometrySource::SetType FUDaeGeometryInput::Semantic  type  )  [inline]
 

Sets the type of data contained within the source.

Modifying the source type of an existing source is not recommended. Common values for the type of data are POSITION, NORMAL, COLOR and TEXCOORD. Please see FUDaeGeometryInput for more information.

See also:
FUDaeGeometryInput.
Parameters:
type The type of data to be contained within the source.

void FCDGeometrySource::SetValue size_t  index,
const float *  value
[inline]
 

Sets one source value out of this source.

Parameters:
index The index of the source value.
value The new value.

void FCDGeometrySource::SetValueCount size_t  count  )  [inline]
 

Sets the number of individual source values contained in the source.

No initialization of new values is done.

Parameters:
count The number of individual source values to contain in this source.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:39 2008 for FCollada by  doxygen 1.4.6-NO