Open CASCADE Technology  6.9.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. More...

#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. More...
 
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. More...
 
Graphic3d_TypeOfTexture Type () const
 
const TCollection_AsciiStringGetId () const
 This ID will be used to manage resource in graphic driver. More...
 
virtual Image_PixMap_Handle GetImage () const
 This method will be called by graphic driver each time when texture resource should be created. Default constructors allow defining the texture source as path to texture image or directly as pixmap. If the source is defined as path, then the image will be dynamically loaded when this method is called (and no copy will be preserved in this class instance). Inheritors may dynamically generate the image. Notice, image data should be in Bottom-Up order (see Image_PixMap::IsTopDown())! More...
 
const Handle
< Graphic3d_TextureParams > & 
GetParams () const
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Static Public Member Functions

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

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. More...
 
 Graphic3d_TextureRoot (const Image_PixMap_Handle &thePixmap, const Graphic3d_TypeOfTexture theType)
 Creates a texture from pixmap. Please note that the implementation expects the image data to be in Bottom-Up order (see Image_PixMap::IsTopDown()). More...
 

Protected Attributes

Handle< Graphic3d_TextureParamsmyParams
 
TCollection_AsciiString myTexId
 
Image_PixMap_Handle myPixMap
 
OSD_Path myPath
 

Detailed Description

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

Constructor & Destructor Documentation

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

Creates a texture from a file Warning: Note that if <FileName> is NULL the texture must be realized using LoadTexture(image) method.

Graphic3d_TextureRoot::Graphic3d_TextureRoot ( const Image_PixMap_Handle thePixmap,
const Graphic3d_TypeOfTexture  theType 
)
protected

Creates a texture from pixmap. Please note that the implementation expects the image data to be in Bottom-Up order (see Image_PixMap::IsTopDown()).

Member Function Documentation

void Graphic3d_TextureRoot::Destroy ( ) const
const TCollection_AsciiString& Graphic3d_TextureRoot::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.

Returns
texture identifier.
virtual Image_PixMap_Handle Graphic3d_TextureRoot::GetImage ( ) const
virtual

This method will be called by graphic driver each time when texture resource should be created. Default constructors allow defining the texture source as path to texture image or directly as pixmap. If the source is defined as path, then the image will be dynamically loaded when this method is called (and no copy will be preserved in this class instance). Inheritors may dynamically generate the image. Notice, image data should be in Bottom-Up order (see Image_PixMap::IsTopDown())!

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

Checks if a texture class is valid or not.

Returns
true if the construction of the class is correct
const OSD_Path& Graphic3d_TextureRoot::Path ( ) const

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

static TCollection_AsciiString Graphic3d_TextureRoot::TexturesFolder ( )
static

The path to textures determined from CSF_MDTVTexturesDirectory or CASROOT environment variables.

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
OSD_Path Graphic3d_TextureRoot::myPath
protected
Image_PixMap_Handle Graphic3d_TextureRoot::myPixMap
protected
TCollection_AsciiString Graphic3d_TextureRoot::myTexId
protected

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