1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0025931: Visualization - Possibility to initialize an environment texture by Image_PixMap instance

This commit is contained in:
san 2015-03-13 17:17:46 +03:00 committed by bugmaster
parent c4af16fbf3
commit 1a6751b196
2 changed files with 19 additions and 1 deletions

View File

@ -23,7 +23,8 @@ inherits TextureRoot from Graphic3d
uses
NameOfTextureEnv from Graphic3d,
AsciiString from TCollection
AsciiString from TCollection,
PixMap_Handle from Image
raises
@ -37,6 +38,9 @@ is
Create (theName : NameOfTextureEnv from Graphic3d) returns TextureEnv from Graphic3d;
---Purpose: Creates an environment texture from a predefined texture name set.
Create (thePixMap : PixMap_Handle from Image) returns TextureEnv from Graphic3d;
---Purpose: Creates an environment texture from the pixmap.
Name (me) returns NameOfTextureEnv from Graphic3d;
---Purpose:
-- Returns the name of the predefined textures or NOT_ENV_UNKNOWN

View File

@ -64,6 +64,20 @@ Graphic3d_TextureEnv::Graphic3d_TextureEnv (const Graphic3d_NameOfTextureEnv the
Graphic3d_Vec4 (0.0f, 1.0f, 0.0f, 0.0f));
}
// =======================================================================
// function : Graphic3d_TextureEnv
// purpose :
// =======================================================================
Graphic3d_TextureEnv::Graphic3d_TextureEnv (const Handle(Image_PixMap)& thePixMap)
: Graphic3d_TextureRoot (thePixMap, Graphic3d_TOT_2D_MIPMAP),
myName (Graphic3d_NOT_ENV_UNKNOWN)
{
myParams->SetFilter (Graphic3d_TOTF_TRILINEAR);
myParams->SetGenMode (Graphic3d_TOTM_SPHERE,
Graphic3d_Vec4 (1.0f, 0.0f, 0.0f, 0.0f),
Graphic3d_Vec4 (0.0f, 1.0f, 0.0f, 0.0f));
}
// =======================================================================
// function : Name
// purpose :