X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOBJECT%2FGEOM_Actor.cxx;h=bc9c5c9f19dee6f0d1792b8d58a7d30acb3cac60;hb=4d4cef4054e35fe6b16c7ba463f5360516d704ec;hp=eeb5f0dc31be7ac75588590a8ff1723a6896e46e;hpb=6c5c2bd009df3635175f57855c5dfd3299736b6f;p=modules%2Fgeom.git diff --git a/src/OBJECT/GEOM_Actor.cxx b/src/OBJECT/GEOM_Actor.cxx index eeb5f0dc3..bc9c5c9f1 100644 --- a/src/OBJECT/GEOM_Actor.cxx +++ b/src/OBJECT/GEOM_Actor.cxx @@ -37,6 +37,7 @@ #include "GEOM_EdgeSource.h" #include "GEOM_WireframeFace.h" #include "GEOM_ShadingFace.h" +#include "GEOM_PainterPolyDataMapper.h" #include "SVTK_Actor.h" #include @@ -103,11 +104,17 @@ GEOM_Actor::GEOM_Actor(): myHighlightActor(GEOM_DeviceActor::New(),true), myAppendFilter(vtkAppendPolyData::New(),true), - myPolyDataMapper(vtkPolyDataMapper::New(),true), + // Use mapper as an instance of GEOM_PainterPolyDataMapper class + // to prevent drawing of mappers' content (due to an empty definition + // of GEOM_PainterPolyDataMapper::RenderPiece(...)). + // !!! Presentation of GEOM_Actor is drawing only with help of actors + // defined in this class !!! + myPolyDataMapper(GEOM_PainterPolyDataMapper::New(),true), myHighlightProp(vtkProperty::New()), myPreHighlightProp(vtkProperty::New()), - myShadingFaceProp(vtkProperty::New()) + myShadingFaceProp(vtkProperty::New()), + myShadingBackFaceProp(vtkProperty::New()) { #ifdef MYDEBUG MESSAGE (this<< " GEOM_Actor::GEOM_Actor"); @@ -140,13 +147,13 @@ GEOM_Actor::GEOM_Actor(): aProperty->SetPointSize(3); aProperty->SetColor(1, 1, 0); - myAppendFilter->AddInput(myIsolatedEdgeSource->GetOutput()); + myAppendFilter->AddInput(myIsolatedEdgeSource->GetOutput()); myIsolatedEdgeActor->SetInput(myIsolatedEdgeSource->GetOutput(),false); aProperty = myIsolatedEdgeActor->GetProperty(); aProperty->SetRepresentation(VTK_WIREFRAME); aProperty->SetColor(1, 0, 0); - myAppendFilter->AddInput(myOneFaceEdgeSource->GetOutput()); + myAppendFilter->AddInput(myOneFaceEdgeSource->GetOutput()); myOneFaceEdgeActor->SetInput(myOneFaceEdgeSource->GetOutput(),false); aProperty = myOneFaceEdgeActor->GetProperty(); aProperty->SetRepresentation(VTK_WIREFRAME); @@ -166,7 +173,7 @@ GEOM_Actor::GEOM_Actor(): myShadingFaceActor->SetInput(myShadingFaceSource->GetOutput(),true); - myShadingFaceProp->SetRepresentation(VTK_SURFACE); + myShadingFaceProp->SetRepresentation(VTKViewer::Representation::Surface); myShadingFaceProp->SetInterpolationToGouraud(); myShadingFaceProp->SetAmbient(1.0); myShadingFaceProp->SetDiffuse(1.0); @@ -177,10 +184,14 @@ GEOM_Actor::GEOM_Actor(): myShadingFaceActor->SetProperty(myShadingFaceProp.GetPointer()); + StoreBoundaryColors(); + + myNbIsos[0] = -1; + myNbIsos[1] = -1; + // Toggle display mode setDisplayMode(0); // WIRE FRAME SetVectorMode(0); // - } @@ -192,6 +203,7 @@ GEOM_Actor::~GEOM_Actor() myHighlightProp->Delete(); myPreHighlightProp->Delete(); myShadingFaceProp->Delete(); + myShadingBackFaceProp->Delete(); } GEOM_Actor* @@ -282,8 +294,45 @@ GEOM_Actor:: setDisplayMode(int theMode) { #ifdef MYDEBUG - MESSAGE ( "GEOM_Actor::SetDisplayMode = "<