From: san Date: Fri, 13 Mar 2015 14:17:46 +0000 (+0300) Subject: 0025931: Visualization - Possibility to initialize an environment texture by Image_Pi... X-Git-Tag: V6_9_0_beta~44 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=1a6751b196f94112b19101d786b3bcb65ea3f7e9;p=occt-copy.git 0025931: Visualization - Possibility to initialize an environment texture by Image_PixMap instance --- diff --git a/src/Graphic3d/Graphic3d_TextureEnv.cdl b/src/Graphic3d/Graphic3d_TextureEnv.cdl index b2cf10910b..cbf5adabbe 100644 --- a/src/Graphic3d/Graphic3d_TextureEnv.cdl +++ b/src/Graphic3d/Graphic3d_TextureEnv.cdl @@ -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 diff --git a/src/Graphic3d/Graphic3d_TextureEnv.cxx b/src/Graphic3d/Graphic3d_TextureEnv.cxx index 03921575ed..3468f86145 100644 --- a/src/Graphic3d/Graphic3d_TextureEnv.cxx +++ b/src/Graphic3d/Graphic3d_TextureEnv.cxx @@ -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 :