solved a remaining issue about puting textures on shapes

This commit is contained in:
gdd 2011-09-26 15:15:41 +00:00
parent 1aff347400
commit bd4d3a51c9
3 changed files with 11 additions and 8 deletions

View File

@ -60,6 +60,7 @@
#include <AIS_TexturedShape.hxx> #include <AIS_TexturedShape.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <StdSelect_DisplayMode.hxx>
#include <Graphic3d_MaterialAspect.hxx> #include <Graphic3d_MaterialAspect.hxx>
@ -739,8 +740,7 @@ bool EntityGUI_FeatureDetectorDlg::execute( ObjectList& objects )
GEOM::GEOM_IBlocksOperations_var aBlocksOperations = myGeomGUI->GetGeomGen()->GetIBlocksOperations( getStudyId() ); GEOM::GEOM_IBlocksOperations_var aBlocksOperations = myGeomGUI->GetGeomGen()->GetIBlocksOperations( getStudyId() );
GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices(P1,P2,P3,P4); GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices(P1,P2,P3,P4);
getDisplayer()->SetTexture(theImgFileName.toStdString()); getDisplayer()->SetTexture(theImgFileName.toStdString());
// getDisplayer()->SetDisplayMode(3); getDisplayer()->SetDisplayMode((Standard_Integer) StdSelect_DM_HLR);
vp->getView()->SetSurfaceDetail(V3d_TEX_ALL);
// OCCViewer_Viewer* anOCCViewer =((OCCViewer_ViewWindow*)theViewWindow)->getViewManager())->getOCCViewer(); // OCCViewer_Viewer* anOCCViewer =((OCCViewer_ViewWindow*)theViewWindow)->getViewManager())->getOCCViewer();
// Handle(AIS_InteractiveContext) aContext = anOCCViewer->getAISContext(); // Handle(AIS_InteractiveContext) aContext = anOCCViewer->getAISContext();

View File

@ -73,6 +73,7 @@
#include <Prs3d_PointAspect.hxx> #include <Prs3d_PointAspect.hxx>
#include <StdSelect_TypeOfEdge.hxx> #include <StdSelect_TypeOfEdge.hxx>
#include <StdSelect_TypeOfFace.hxx> #include <StdSelect_TypeOfFace.hxx>
#include <StdSelect_DisplayMode.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
@ -727,14 +728,10 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
} }
if ( HasTexture() ) if ( HasTexture() )
{ {
MESSAGE("GEOM_Displayer::Update HasTexture() == true") AISShape->SetTextureFileName(TCollection_AsciiString(myTexture.c_str()));
AISShape->SetTextureMapOn(); AISShape->SetTextureMapOn();
AISShape->DisableTextureModulate(); AISShape->DisableTextureModulate();
AISShape->SetMaterial(Graphic3d_NOM_SATIN); // AISShape->SetDisplayMode( (Standard_Integer) StdSelect_DM_HLR );
AISShape->SetDisplayMode( 3 );
AISShape->SetTextureFileName(TCollection_AsciiString(myTexture.c_str()));
// Attributes()->ShadingAspect()
MESSAGE("AISShape->TextureFile() = "<<AISShape->TextureFile())
} }
else else
{ {
@ -922,6 +919,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
} }
} }
// AISShape->SetName(???); ??? necessary to set name ??? // AISShape->SetName(???); ??? necessary to set name ???
// AISShape->SetDisplayMode(3);
occPrs->AddObject( AISShape ); occPrs->AddObject( AISShape );
// In accordance with ToActivate() value object will be activated/deactivated // In accordance with ToActivate() value object will be activated/deactivated

View File

@ -207,6 +207,11 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
AIS_Shape::Compute(aPresentationManager, aPrs, aMode); AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
break; break;
} }
case StdSelect_DM_HLR:
{
AIS_TexturedShape::Compute(aPresentationManager, aPrs, 3);
break;
}
} }
if (isShowVectors()) if (isShowVectors())