Open CASCADE Technology 7.8.0
Public Member Functions | Protected Attributes
Graphic3d_CubeMap Class Referenceabstract

Base class for cubemaps. It is iterator over cubemap sides. More...

#include <Graphic3d_CubeMap.hxx>

Inheritance diagram for Graphic3d_CubeMap:
Inheritance graph
[legend]

Public Member Functions

 Graphic3d_CubeMap (const TCollection_AsciiString &theFileName, Standard_Boolean theToGenerateMipmaps=Standard_False)
 Constructor defining loading cubemap from file.
 
 Graphic3d_CubeMap (const Handle< Image_PixMap > &thePixmap=Handle< Image_PixMap >(), Standard_Boolean theToGenerateMipmaps=Standard_False)
 Constructor defining direct cubemap initialization from PixMap.
 
Standard_Boolean More () const
 Returns whether the iterator has reached the end (true if it hasn't).
 
Graphic3d_CubeMapSide CurrentSide () const
 Returns current cubemap side (iterator state).
 
void Next ()
 Moves iterator to the next cubemap side. Uses OpenGL cubemap sides order +X -> -X -> +Y -> -Y -> +Z -> -Z.
 
void SetZInversion (Standard_Boolean theZIsInverted)
 Sets Z axis inversion (vertical flipping).
 
Standard_Boolean ZIsInverted () const
 Returns whether Z axis is inverted.
 
Standard_Boolean HasMipmaps () const
 Returns whether mipmaps of cubemap will be generated or not.
 
void SetMipmapsGeneration (Standard_Boolean theToGenerateMipmaps)
 Sets whether to generate mipmaps of cubemap or not.
 
virtual Handle< Image_CompressedPixMapCompressedValue (const Handle< Image_SupportedFormats > &theSupported)=0
 Returns current cubemap side as compressed PixMap. Returns null handle if current side is invalid or if image is not in supported compressed format.
 
virtual Handle< Image_PixMapValue (const Handle< Image_SupportedFormats > &theSupported)=0
 Returns PixMap containing current side of cubemap. Returns null handle if current side is invalid.
 
Graphic3d_CubeMapReset ()
 Sets iterator state to +X cubemap side.
 
virtual ~Graphic3d_CubeMap ()
 Empty destructor.
 
- Public Member Functions inherited from Graphic3d_TextureMap
void EnableSmooth ()
 enable texture smoothing
 
Standard_Boolean IsSmoothed () const
 Returns TRUE if the texture is smoothed.
 
void DisableSmooth ()
 disable texture smoothing
 
void EnableModulate ()
 enable texture modulate mode. the image is modulate with the shading of the surface.
 
void DisableModulate ()
 disable texture modulate mode. the image is directly decal on the surface.
 
Standard_Boolean IsModulate () const
 Returns TRUE if the texture is modulate.
 
void EnableRepeat ()
 use this methods if you want to enable texture repetition on your objects.
 
void DisableRepeat ()
 use this methods if you want to disable texture repetition on your objects.
 
Standard_Boolean IsRepeat () const
 Returns TRUE if the texture repeat is enable.
 
Graphic3d_LevelOfTextureAnisotropy AnisoFilter () const
 
void SetAnisoFilter (const Graphic3d_LevelOfTextureAnisotropy theLevel)
 
- Public Member Functions inherited from Graphic3d_TextureRoot
 ~Graphic3d_TextureRoot ()
 Destructor.
 
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
 
const TCollection_AsciiStringGetId () const
 This ID will be used to manage resource in graphic driver.
 
Standard_Size Revision () const
 Return image revision.
 
void UpdateRevision ()
 Update image revision. Can be used for signaling changes in the texture source (e.g. file update, pixmap update) without re-creating texture source itself (since unique id should be never modified).
 
virtual Handle< Image_CompressedPixMapGetCompressedImage (const Handle< Image_SupportedFormats > &theSupported)
 This method will be called by graphic driver each time when texture resource should be created. It is called in front of GetImage() for uploading compressed image formats natively supported by GPU.
 
virtual Handle< Image_PixMapGetImage (const Handle< Image_SupportedFormats > &theSupported)
 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())!
 
const Handle< Graphic3d_TextureParams > & GetParams () const
 
Standard_Boolean IsColorMap () const
 Return flag indicating color nature of values within the texture; TRUE by default.
 
void SetColorMap (Standard_Boolean theIsColor)
 Set flag indicating color nature of values within the texture.
 
Standard_Boolean HasMipmaps () const
 Returns whether mipmaps should be generated or not.
 
void SetMipmapsGeneration (Standard_Boolean theToGenerateMipmaps)
 Sets whether to generate mipmaps or not.
 
Standard_Boolean IsTopDown () const
 Returns whether row's memory layout is top-down.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
Standard_Boolean IsKind (const opencascade::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.
 
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.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
Standard_Integer GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object.
 
Standard_Integer DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Attributes

Graphic3d_CubeMapSide myCurrentSide
 Iterator state.
 
Standard_Boolean myEndIsReached
 Indicates whether end of iteration has been reached or hasn't.
 
Standard_Boolean myZIsInverted
 Indicates whether Z axis is inverted that allows to synchronize vertical flip of cubemap.
 
- Protected Attributes inherited from Graphic3d_TextureRoot
Handle< Graphic3d_TextureParamsmyParams
 associated texture parameters
 
TCollection_AsciiString myTexId
 unique identifier of this resource (for sharing graphic resource); should never be modified outside constructor
 
Handle< Image_PixMapmyPixMap
 image pixmap - as one of the ways for defining the texture source
 
OSD_Path myPath
 image file path - as one of the ways for defining the texture source
 
Standard_Size myRevision
 image revision - for signaling changes in the texture source (e.g. file update, pixmap update)
 
Graphic3d_TypeOfTexture myType
 texture type
 
Standard_Boolean myIsColorMap
 flag indicating color nature of values within the texture
 
Standard_Boolean myIsTopDown
 Stores rows's memory layout.
 
Standard_Boolean myHasMipmaps
 Indicates whether mipmaps should be generated or not.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Graphic3d_TextureRoot
static TCollection_AsciiString TexturesFolder ()
 The path to textures determined from CSF_MDTVTexturesDirectory or CASROOT environment variables.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 
- Protected Member Functions inherited from Graphic3d_TextureMap
 Graphic3d_TextureMap (const TCollection_AsciiString &theFileName, const Graphic3d_TypeOfTexture theType)
 
 Graphic3d_TextureMap (const Handle< Image_PixMap > &thePixMap, const Graphic3d_TypeOfTexture theType)
 
- Protected Member Functions inherited from Graphic3d_TextureRoot
 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.
 
 Graphic3d_TextureRoot (const Handle< Image_PixMap > &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()).
 
void generateId ()
 Unconditionally generate new texture id. Should be called only within constructor.
 
virtual Handle< Image_PixMapGetImage () const
 Method for supporting old API; another GetImage() method should be implemented instead.
 
- Static Protected Member Functions inherited from Graphic3d_TextureRoot
static void convertToCompatible (const Handle< Image_SupportedFormats > &theSupported, const Handle< Image_PixMap > &theImage)
 Try converting image to compatible format.
 

Detailed Description

Base class for cubemaps. It is iterator over cubemap sides.

Constructor & Destructor Documentation

◆ Graphic3d_CubeMap() [1/2]

Graphic3d_CubeMap::Graphic3d_CubeMap ( const TCollection_AsciiString theFileName,
Standard_Boolean  theToGenerateMipmaps = Standard_False 
)

Constructor defining loading cubemap from file.

◆ Graphic3d_CubeMap() [2/2]

Graphic3d_CubeMap::Graphic3d_CubeMap ( const Handle< Image_PixMap > &  thePixmap = HandleImage_PixMap >(),
Standard_Boolean  theToGenerateMipmaps = Standard_False 
)

Constructor defining direct cubemap initialization from PixMap.

◆ ~Graphic3d_CubeMap()

virtual Graphic3d_CubeMap::~Graphic3d_CubeMap ( )
virtual

Empty destructor.

Member Function Documentation

◆ CompressedValue()

virtual Handle< Image_CompressedPixMap > Graphic3d_CubeMap::CompressedValue ( const Handle< Image_SupportedFormats > &  theSupported)
pure virtual

Returns current cubemap side as compressed PixMap. Returns null handle if current side is invalid or if image is not in supported compressed format.

Implemented in Graphic3d_CubeMapPacked, and Graphic3d_CubeMapSeparate.

◆ CurrentSide()

Graphic3d_CubeMapSide Graphic3d_CubeMap::CurrentSide ( ) const
inline

Returns current cubemap side (iterator state).

◆ HasMipmaps()

Standard_Boolean Graphic3d_CubeMap::HasMipmaps ( ) const
inline

Returns whether mipmaps of cubemap will be generated or not.

◆ More()

Standard_Boolean Graphic3d_CubeMap::More ( ) const
inline

Returns whether the iterator has reached the end (true if it hasn't).

◆ Next()

void Graphic3d_CubeMap::Next ( )
inline

Moves iterator to the next cubemap side. Uses OpenGL cubemap sides order +X -> -X -> +Y -> -Y -> +Z -> -Z.

◆ Reset()

Graphic3d_CubeMap & Graphic3d_CubeMap::Reset ( )
inline

Sets iterator state to +X cubemap side.

◆ SetMipmapsGeneration()

void Graphic3d_CubeMap::SetMipmapsGeneration ( Standard_Boolean  theToGenerateMipmaps)
inline

Sets whether to generate mipmaps of cubemap or not.

◆ SetZInversion()

void Graphic3d_CubeMap::SetZInversion ( Standard_Boolean  theZIsInverted)
inline

Sets Z axis inversion (vertical flipping).

◆ Value()

virtual Handle< Image_PixMap > Graphic3d_CubeMap::Value ( const Handle< Image_SupportedFormats > &  theSupported)
pure virtual

Returns PixMap containing current side of cubemap. Returns null handle if current side is invalid.

Implemented in Graphic3d_CubeMapPacked, and Graphic3d_CubeMapSeparate.

◆ ZIsInverted()

Standard_Boolean Graphic3d_CubeMap::ZIsInverted ( ) const
inline

Returns whether Z axis is inverted.

Field Documentation

◆ myCurrentSide

Graphic3d_CubeMapSide Graphic3d_CubeMap::myCurrentSide
protected

Iterator state.

◆ myEndIsReached

Standard_Boolean Graphic3d_CubeMap::myEndIsReached
protected

Indicates whether end of iteration has been reached or hasn't.

◆ myZIsInverted

Standard_Boolean Graphic3d_CubeMap::myZIsInverted
protected

Indicates whether Z axis is inverted that allows to synchronize vertical flip of cubemap.


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