1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0028811: Visualization - merge texturing support into AIS_Shape class and get rid of AIS_TexturedShape

AIS_Shape and AIS_ColoredShape now computes Shaded presentation
with UV coordinates if texture mapping is enabled in Drawer.

OpenGl_Context::SetTextureMatrix() - fixed inconsistent handling
of texture cooridnates translation vector.

vtexture command has been extended to handle new arguments:
* -trsfTrans, -trsfScale, -trsfAngle defining transformation matrix
* -setFilter, -setAnisoFilter to setup texture filtering
This commit is contained in:
kgv
2017-07-17 15:19:33 +03:00
committed by bugmaster
parent 798849860f
commit a6dee93dfa
19 changed files with 648 additions and 481 deletions

View File

@@ -2,13 +2,15 @@
#include "Sample2D_Image.h"
IMPLEMENT_STANDARD_RTTIEXT(Sample2D_Image,AIS_TexturedShape)
#include <Graphic3d_Texture2Dmanual.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Sample2D_Image,AIS_Shape)
Sample2D_Image::Sample2D_Image(TCollection_AsciiString& aFileName,
const Standard_Real X,
const Standard_Real Y,
const Standard_Real aScale)
:AIS_TexturedShape(TopoDS_Shape())
:AIS_Shape(TopoDS_Shape())
{
myFilename = aFileName;
myX = X;
@@ -35,9 +37,7 @@ void Sample2D_Image::SetContext(const Handle(AIS_InteractiveContext)& theContext
AIS_InteractiveObject::SetContext(theContext);
MakeShape();
this->Set(TopoDS_Shape(myFace));
this->SetTextureFileName(myFilename);
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->Aspect()->SetTextureMap (new Graphic3d_Texture2Dmanual (myFilename));
myDrawer->ShadingAspect()->Aspect()->SetTextureMapOn();
}