Texture Class Reference
 
 
 
Texture Class Reference

This reference page is linked to from the following overview topics: Populating the Preset Manager.


#include <xsi_texture.h>


Class Description

Specific Shader object which is a member of the Texture Shaders family (siTextureShaderFamily).

See also:
OGLMaterial
Example:
                using namespace XSI;
                Application app;
                Model root = app.GetActiveSceneRoot();

                X3DObject myCube;
                root.AddGeometry( L"Cube",L"MeshSurface",L"" ,myCube );

                Material myMaterial;
                myCube.AddMaterial(L"Phong",false,L"",myMaterial);

                // Adding an image
                CValueArray args(4L);
                CValue outArg;
                args[0] = CValue( CString(L"Image") );
                args[1] = CValue(myCube.GetRef());
                args[2] = CValue((short)1);
                args[3] = CValue(false);

                app.ExecuteCommand( L"BlendInPresets", args, outArg );

                // Adding a texture support
                args[0] = myCube.GetRef();
                args[1] = (LONG)siTxtPlanarXY;
                args[2] = (LONG)siTxtDefaultSpherical;
                args[3] = CString(L"Texture_Support");
                app.ExecuteCommand( L"CreateTextureSupport", args, outArg );

                Texture myTexture= myMaterial.GetCurrentTexture();
                app.LogMessage( L"The texture: " +  myTexture.GetFullName() );
Inheritance diagram for Texture:
Shader ProjectItem SIObject CBase

List of all members.

Public Member Functions

  Texture ()
  ~Texture ()
  Texture (const CRef &in_ref)
  Texture (const Texture &in_obj)
bool  IsA (siClassID in_ClassID) const
siClassID  GetClassID () const
Texture operator= (const Texture &in_obj)
Texture operator= (const CRef &in_ref)
CStatus  GetTransformValues (LONG in_flags, CDoubleArray &out_aUVWValues)
ImageClip2  GetImageClip () const

Constructor & Destructor Documentation

Texture ( )

Default constructor.

~Texture ( )

Default destructor.

Texture ( const CRef in_ref )

Constructor.

Parameters:
in_ref constant reference object.
Texture ( const Texture in_obj )

Copy constructor.

Parameters:
in_obj constant class object.

Member Function Documentation

bool IsA ( siClassID  in_ClassID ) const [virtual]

Returns true if a given class type is compatible with this API class.

Parameters:
in_ClassID class type.
Returns:
true if the class is compatible, false otherwise.

Reimplemented from Shader.

siClassID GetClassID ( ) const [virtual]

Returns the type of the API class.

Returns:
The class type.

Reimplemented from Shader.

Texture& operator= ( const Texture in_obj )

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:
in_obj constant class object.
Returns:
The new Texture object.
Texture& operator= ( const CRef in_ref )

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:
in_ref constant class object.
Returns:
The new Texture object.

Reimplemented from Shader.

CStatus GetTransformValues ( LONG  in_flags,
CDoubleArray out_aUVWValues 
)

Calculates the UVW values. The values are read from cluster properties, and the following texture objects are used in the calculation:

You can specify the texture transformation effects you want to apply using bit flags. Note that some texture transformation effects will only be approximate, such as in the case of creating texture repeats where this method cannot resample the surface to create the additional sample points required.

Parameters:
in_flags bit flags to specify which transformations to apply to the UVW cluster property content. The bit flags values are the ones located in the siTextureEffectsComputation enum.
Return values:
out_aUVWValues array containing the UVW. This array is in the same order as the cluster property.
Returns:
CStatus::OK success
CStatus::Fail failure.
ImageClip2 GetImageClip ( ) const

Returns the image clip bound to this texture.

Note:
Textures of type color map lookup have no image nodes, so in those cases no ImageClip2 object is returned.
Since:
5.0

The documentation for this class was generated from the following file: