FCDEffectParameterSurface Class Reference
[COLLADA Effect Classes [ColladaFX]]

A COLLADA surface parameter. More...

#include <FCDEffectParameterSurface.h>

Inheritance diagram for FCDEffectParameterSurface:

FCDEffectParameter FCDObject FUObject List of all members.

Public Member Functions

 FCDEffectParameterSurface (FCDocument *document)
 Constructor: do not use directly.
virtual ~FCDEffectParameterSurface ()
 Destructor: do not use directly.
virtual Type GetType () const
 Retrieves the type of effect parameter class.
FCDEffectParameterSurfaceInitGetInitMethod ()
 Retrieves the initialization method for the surface parameter.
const FCDEffectParameterSurfaceInitGetInitMethod () const
 See above.
void SetInitMethod (FCDEffectParameterSurfaceInit *method)
 Sets the initialization method for the surface parameter.
size_t GetImageCount () const
 Retrieves the number of COLLADA images that make up this surface.
FCDImageListGetImages ()
 Retrieves the list of images that make up this surface.
const FCDImageListGetImages () const
 See above.
FCDImageGetImage (size_t index=0)
 Retrieves a specific image.
const FCDImageGetImage (size_t index=0) const
 See above.
size_t FindImage (const FCDImage *image) const
 Retrieves the index that matches the given image.
size_t AddImage (FCDImage *image)
 Adds an image to the list.
void RemoveImage (FCDImage *image)
 Removes an image from the list.
const FMVector3GetSize () const
 Retrieves the wanted dimensions of the surface.
void SetSize (const FMVector3 &dimensions)
 Sets the wanted dimensions of the surface.
float GetViewportRatio () const
 Retrieves the viewport ratio to use when the surface is a render target.
void SetViewportRatio (float ratio)
 Sets the viewport ratio to use when the surface is a render target.
uint16 GetMipLevelCount () const
 Retrieves the wanted number of mip-levels.
void SetMipLevelCount (uint16 levelCount)
 Sets the wanted number of mip-levels.
bool IsGenerateMipMaps () const
 Retrieves whether to generate the mip-map levels on load.
void SetGenerateMipMaps (bool _generateMipmaps)
 Sets whether to generate the mip-map levels of load.
const char * GetName (size_t index=0) const
 Retrieves a specific sub-id.
virtual FCDEffectParameterClone ()
 Creates a full copy of the effect parameter.
virtual void Overwrite (FCDEffectParameter *target)
 [INTERNAL] Overwrites the target parameter with this parameter.
virtual FUStatus LoadFromXML (xmlNode *parameterNode)
 [INTERNAL] Reads in the effect parameter from a given COLLADA XML tree node.
virtual xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the effect parameter to the given COLLADA XML tree node.

Detailed Description

A COLLADA surface parameter.

This parameters hold the texture loading information. The texture placement information should be held by the sampler parameter.

See also:
FCDEffectParameterSampler


Constructor & Destructor Documentation

FCDEffectParameterSurface::FCDEffectParameterSurface FCDocument document  ) 
 

Constructor: do not use directly.

Instead, use the FCDEffectParameterList::AddParameter function.

Parameters:
document The COLLADA document that owns the effect parameter.

virtual FCDEffectParameterSurface::~FCDEffectParameterSurface  )  [virtual]
 

Destructor: do not use directly.

Instead, use the FCDEffectParameterList::ReleaseParameter function. When released, the effect parameter list will also release all its parameters, if it owns them.


Member Function Documentation

size_t FCDEffectParameterSurface::AddImage FCDImage image  ) 
 

Adds an image to the list.

The initialization method indexes the images from this list. This function will verify that this image does not already exist within the list, so use the returned index.

Parameters:
image The new image.
Returns:
The index of the image within the list.

virtual FCDEffectParameter* FCDEffectParameterSurface::Clone  )  [virtual]
 

Creates a full copy of the effect parameter.

Todo:
The cloning does not clone the initialization method correctly.
Returns:
The cloned effect parameter. You will need to delete this pointer.

Implements FCDEffectParameter.

size_t FCDEffectParameterSurface::FindImage const FCDImage image  )  const
 

Retrieves the index that matches the given image.

Parameters:
image The image to match.
Returns:
The index within the list for this image. This index may be -1 if no match was found.

FCDImage* FCDEffectParameterSurface::GetImage size_t  index = 0  )  [inline]
 

Retrieves a specific image.

Parameters:
index The index of the image.
Returns:
The image. This pointer will be NULL if the index is out-of-bounds.

size_t FCDEffectParameterSurface::GetImageCount  )  const [inline]
 

Retrieves the number of COLLADA images that make up this surface.

There should never be more than six images to build a surface. In the large majority of cases, expect one image.

Returns:
The number of images.

FCDImageList& FCDEffectParameterSurface::GetImages  )  [inline]
 

Retrieves the list of images that make up this surface.

There should never be more than six images to build a surface. In the large majority of cases, expect one image.

Returns:
The list of images.

FCDEffectParameterSurfaceInit* FCDEffectParameterSurface::GetInitMethod  )  [inline]
 

Retrieves the initialization method for the surface parameter.

The initialization method is a powerful method of describing how to build complex textures, such as cube maps, from one or multiple image files.

Returns:
The surface initialization method. This pointer will be NULL, if no initialization method is provided.

uint16 FCDEffectParameterSurface::GetMipLevelCount  )  const [inline]
 

Retrieves the wanted number of mip-levels.

This parameter is optional and may be zero to indicate that you should retrieve the mip-levels from the image file(s) or generate a full mip-chain, depending on the mip-map generate flag.

See also:
GetMipMapGenerate
Returns:
The wanted number of mip-levels.

const char* FCDEffectParameterSurface::GetName size_t  index = 0  )  const [inline]
 

Retrieves a specific sub-id.

Todo:
I'm not too sure of the implications of the names, at this level of abstraction: once I'm clear why they exists, add the necessary interface to access/pull/push items from/to the list.
Parameters:
index The sub-id index.
Returns:
The sub-id. This pointer will be NULL if the index is out-of-bounds.

const FMVector3& FCDEffectParameterSurface::GetSize  )  const [inline]
 

Retrieves the wanted dimensions of the surface.

This parameter is optional and may contain all zeroes to indicate that you should read the surface dimensions from the image file(s).

Returns:
The wanted dimensions.

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

Retrieves the type of effect parameter class.

Returns:
The parameter class type: SURFACE.

Implements FCDEffectParameter.

float FCDEffectParameterSurface::GetViewportRatio  )  const [inline]
 

Retrieves the viewport ratio to use when the surface is a render target.

Returns:
The viewport ratio.

bool FCDEffectParameterSurface::IsGenerateMipMaps  )  const [inline]
 

Retrieves whether to generate the mip-map levels on load.

The alternative is to load the mip-map levels from the image files.

Returns:
Whether to generate the mip-map levels on load.

virtual FUStatus FCDEffectParameterSurface::LoadFromXML xmlNode *  parameterNode  )  [virtual]
 

[INTERNAL] Reads in the effect parameter from a given COLLADA XML tree node.

Parameters:
parameterNode 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 parameter.

Reimplemented from FCDEffectParameter.

virtual void FCDEffectParameterSurface::Overwrite FCDEffectParameter target  )  [virtual]
 

[INTERNAL] Overwrites the target parameter with this parameter.

This function is used during the flattening of materials.

Parameters:
target The target parameter to overwrite.

Reimplemented from FCDEffectParameter.

void FCDEffectParameterSurface::RemoveImage FCDImage image  ) 
 

Removes an image from the list.

The initialization method indexes the images from this list. This function will shift all the indexes in the initialization method so that they continue matching the correct image.

Parameters:
image The image to remove. Its memory is not released.

void FCDEffectParameterSurface::SetGenerateMipMaps bool  _generateMipmaps  )  [inline]
 

Sets whether to generate the mip-map levels of load.

The alternative is to load the mip-map levels from the image files.

Parameters:
_generateMipmaps Whether to generate the mip-map levels on load.

void FCDEffectParameterSurface::SetInitMethod FCDEffectParameterSurfaceInit method  ) 
 

Sets the initialization method for the surface parameter.

The initialization method is a powerful method of describing how to build complex textures, such as cube maps, from one or multiple image files.

Parameters:
method The new initialization method. The old initialization method will be released. You should create a new initialization method for each surface parameter.

void FCDEffectParameterSurface::SetMipLevelCount uint16  levelCount  )  [inline]
 

Sets the wanted number of mip-levels.

This parameter is optional and can be zero to indicate that you should retrieve the mip-levels from the image file(s) or generate a full mip-chain, depending on the mip-map generate flag.

Parameters:
levelCount The wanted number of mip-levels.

void FCDEffectParameterSurface::SetSize const FMVector3 dimensions  )  [inline]
 

Sets the wanted dimensions of the surface.

This parameter is optional and can contain all zeroes to indicate that you should read the surface dimensions from the image file(s).

Parameters:
dimensions The wanted dimensions.

void FCDEffectParameterSurface::SetViewportRatio float  ratio  )  [inline]
 

Sets the viewport ratio to use when the surface is a render target.

Parameters:
ratio The viewport ratio.

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

[INTERNAL] Writes out the effect parameter to the given COLLADA XML tree node.

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

Reimplemented from FCDEffectParameter.


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