X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMGUI%2FGEOM_Displayer.cxx;h=0896c4ea972cc942173001d6d65743ede8271fff;hb=09ece3edc1896e16a412b35810d76411f06d68ec;hp=14540e207d2ef2a2694bd3d5b8ed829c9e44e872;hpb=25a3dc91508bb59688142bc616b10facc61dfc3d;p=modules%2Fgeom.git diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 14540e207..0896c4ea9 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -77,10 +78,31 @@ #include #include +#include +#include + #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + // OCCT Includes #include #include @@ -126,6 +148,11 @@ #include +#include "vtkSMSourceProxy.h" +#include "pqServerManagerModel.h" +#include "vtkPVTrivialProducer.h" +#include "vtkSMViewProxy.h" + #if OCC_VERSION_LARGE >= 0x070400ff #include #endif @@ -1688,6 +1715,44 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs ) } } +//================================================================= +/*! + * GEOM_Displayer::Update + * Update PV3D presentation + * [ Reimplemented from SALOME_Displayer ] + */ +//================================================================= +void GEOM_Displayer::Update( SALOME_PV3DPrs* prs ) +{ + SPV3D_Prs* pv3dPrs = dynamic_cast( prs ); + + SalomeApp_Study* study = getStudy(); + + if ( !pv3dPrs || myShape.IsNull() || !study ) + return; + + if ( myType == GEOM_MARKER && myShape.ShapeType() == TopAbs_FACE ) + { + // + // specific processing for local coordinate system presentation + // + // NYI - Update(PV3DPrs) for the local coordinate system + } + else + { + // + // processing for usual geometry presentation + // + { + pv3dPrs->SetName( myNameInObjBrowser ); + GEOM_Actor *actor = GEOM_Actor::New(); + updateActorProperties( actor, true ); + pv3dPrs->FillUsingActor( actor ); + } + } +} + + //================================================================= /*! * GEOM_Displayer::BuildPrs @@ -1783,6 +1848,7 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry, GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object ); if ( !GeomBaseObject->_is_nil() ) { + myNameInObjBrowser = getName( GeomBaseObject ); myType = GeomBaseObject->GetType(); // downcast to GEOM object @@ -2381,11 +2447,15 @@ bool GEOM_Displayer::canBeDisplayed( const QString& entry, const QString& viewer { _PTR(SObject) anObj = getStudy()->studyDS()->FindObjectID( (const char*)entry.toUtf8() ); //if ( ! GeometryGUI::IsInGeomComponent( anObj )) return false; - GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(anObj)); // enable displaying of GEOM objects - GEOM::GEOM_FieldStep_var aFieldStepObj = GEOM::GEOM_FieldStep::_narrow(GeometryGUI::ClientSObjectToObject(anObj)); // enable displaying of GEOM field steps - GEOM::GEOM_Gen_var aCompObj = GEOM::GEOM_Gen::_narrow(GeometryGUI::ClientSObjectToObject(anObj)); // enable displaying of whole GEOM component - return ( !CORBA::is_nil( aGeomObj ) || !CORBA::is_nil( aFieldStepObj ) || !CORBA::is_nil( aCompObj ) ) && - (viewer_type == SOCC_Viewer::Type() || viewer_type == SVTK_Viewer::Type()); + CORBA::Object_var anOrbObj = GeometryGUI::ClientSObjectToObject(anObj); + bool isCorbaObj = (!CORBA::is_nil(anOrbObj)); + GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(anOrbObj); // enable displaying of GEOM objects + GEOM::GEOM_FieldStep_var aFieldStepObj = GEOM::GEOM_FieldStep::_narrow(anOrbObj); // enable displaying of GEOM field steps + GEOM::GEOM_Gen_var aCompObj = GEOM::GEOM_Gen::_narrow(anOrbObj); // enable displaying of whole GEOM component + bool isGeomObj = (!CORBA::is_nil( aGeomObj ) || !CORBA::is_nil( aFieldStepObj ) || !CORBA::is_nil( aCompObj )); + bool ret = ( isGeomObj ) && + (viewer_type == SOCC_Viewer::Type() || viewer_type == SVTK_Viewer::Type() || viewer_type == SPV3D_ViewModel::Type()); + return ret; } int GEOM_Displayer::SetDisplayMode( const int theMode )