Open CASCADE Technology 6.6.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Graphic3d_TextureRoot Class Reference

This is the texture root class enable the dialog with the GraphicDriver allows the loading of texture.

#include <Graphic3d_TextureRoot.hxx>

Inheritance diagram for Graphic3d_TextureRoot:
Inheritance graph
[legend]

Public Member Functions

void Destroy () const
 ~Graphic3d_TextureRoot ()
virtual Standard_Boolean IsDone () const
 Checks if a texture class is valid or not.

const OSD_PathPath () const
 Returns the full path of the defined texture.
It could be empty path if GetImage() is overridden to load image not from file.

Graphic3d_TypeOfTexture Type () const
TCollection_AsciiString GetId () const
 This ID will be used to manage resource in graphic driver.
.
Default implementation generates unique ID although inheritors may re-initialize it.
.
Multiple Graphic3d_TextureRoot instancies with same ID
will be treated as single texture with different parameters
to optimize memory usage though this will be more natural
to use same instance of Graphic3d_TextureRoot when possible.
.
Notice that inheritor may set this ID to empty string.
In this case independent graphical resource will be created
for each instance of Graphic3d_AspectFillArea3d where texture will be used.
.

virtual Image_PixMap_Handle GetImage () const
 This method will be called by graphic driver each time when texture resource should be created.
Default implementation will dynamically load image from specified path within this method
(and no copy will be preserved in this class instance).
Inheritors may dynamically generate the image or return cached instance.

const
Handle_Graphic3d_TextureParams & 
GetParams () const

Static Public Member Functions

static TCollection_AsciiString TexturesFolder ()
 The path to textures determined from CSF_MDTVTexturesDirectory or CASROOT environment variables.

Protected Member Functions

 Graphic3d_TextureRoot (const TCollection_AsciiString &theFileName, const Graphic3d_TypeOfTexture theType)
 Creates a texture from a file
Warning: Note that if <FileName> is NULL the texture must be realized
using LoadTexture(image) method.

Protected Attributes

Handle_Graphic3d_TextureParams myParams
TCollection_AsciiString myTexId
OSD_Path myPath

Constructor & Destructor Documentation

Graphic3d_TextureRoot::~Graphic3d_TextureRoot ( ) [inline]
Graphic3d_TextureRoot::Graphic3d_TextureRoot ( const TCollection_AsciiString theFileName,
const Graphic3d_TypeOfTexture  theType 
) [protected]

Member Function Documentation

void Graphic3d_TextureRoot::Destroy ( ) const
TCollection_AsciiString Graphic3d_TextureRoot::GetId ( ) const
Returns:
texture identifier.
virtual Image_PixMap_Handle Graphic3d_TextureRoot::GetImage ( ) const [virtual]
Returns:
the image for texture.
const Handle_Graphic3d_TextureParams& Graphic3d_TextureRoot::GetParams ( ) const
Returns:
low-level texture parameters
virtual Standard_Boolean Graphic3d_TextureRoot::IsDone ( ) const [virtual]
Returns:
true if the construction of the class is correct
const OSD_Path& Graphic3d_TextureRoot::Path ( ) const
static TCollection_AsciiString Graphic3d_TextureRoot::TexturesFolder ( ) [static]
Returns:
the root folder with default textures.
Graphic3d_TypeOfTexture Graphic3d_TextureRoot::Type ( ) const
Returns:
the texture type.

Field Documentation

Handle_Graphic3d_TextureParams Graphic3d_TextureRoot::myParams [protected]

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines