Public Member Functions
Texture Class Reference

Detailed 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() );

#include <xsi_texture.h>

Inheritance diagram for Texture:
Inheritance graph
[legend]

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
Textureoperator= (const Texture &in_obj)
Textureoperator= (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_refconstant reference object.
Texture ( const Texture in_obj)

Copy constructor.

Parameters:
in_objconstant 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_ClassIDclass 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_objconstant 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_refconstant 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_flagsbit 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_aUVWValuesarray 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: