+ TCollection_AsciiString (Standard_Atomic_Increment (&THE_TEXTURE_COUNTER));
}
+// =======================================================================
+// function : Graphic3d_TextureRoot
+// purpose :
+// =======================================================================
+Graphic3d_TextureRoot::Graphic3d_TextureRoot (const Handle(Image_PixMap)& thePixMap,
+ const Graphic3d_TypeOfTexture theType)
+: myParams (new Graphic3d_TextureParams()),
+ myPixMap (thePixMap),
+ myType (theType)
+{
+ myTexId = TCollection_AsciiString ("Graphic3d_TextureRoot_")
+ + TCollection_AsciiString (Standard_Atomic_Increment (&THE_TEXTURE_COUNTER));
+}
+
// =======================================================================
// function : Destroy
// purpose :
// =======================================================================
Handle(Image_PixMap) Graphic3d_TextureRoot::GetImage() const
{
+ // Case 1: texture source is specified as pixmap
+ if (!myPixMap.IsNull())
+ {
+ return myPixMap;
+ }
+
+ // Case 2: texture source is specified as path
TCollection_AsciiString aFilePath;
myPath.SystemName (aFilePath);
if (aFilePath.IsEmpty())
// =======================================================================
Standard_Boolean Graphic3d_TextureRoot::IsDone() const
{
+ // Case 1: texture source is specified as pixmap
+ if (!myPixMap.IsNull())
+ {
+ return !myPixMap->IsEmpty();
+ }
+
+ // Case 2: texture source is specified as path
OSD_File aTextureFile (myPath);
return aTextureFile.Exists();
}