this, SLOT( onCloseView( SUIT_ViewManager* ) ) );
LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
if (aStudy )
- aStudy->removeViewMgr(vm->getGlobalId());
+ aStudy->removeObjectProperties( vm->getGlobalId() );
CAM_Application::removeViewManager( vm );
{
myLastEntry = *it;
vf->BeforeDisplay( this, prs );
- vf->Display( prs );
+ vf->Display( this, prs );
vf->AfterDisplay( this, prs );
if ( updateViewer )
delete prs; // delete presentation because displayer is its owner
setVisibilityState(*it, Qtx::ShownState);
}
-
}
}
if ( prs ) {
myLastEntry = *it;
vf->BeforeErase( this, prs );
- vf->Erase( prs, forced );
+ vf->Erase( this, prs, forced );
vf->AfterErase( this, prs );
if ( updateViewer )
vf->Repaint();
\param updateViewer - is it necessary to update viewer
\param theViewFrame - view
*/
-void LightApp_Displayer::EraseAll( const bool forced, const bool updateViewer, SALOME_View* theViewFrame ) const
+void LightApp_Displayer::EraseAll( const bool forced, const bool updateViewer, SALOME_View* theViewFrame )
{
SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
if ( vf ) {
- vf->EraseAll( forced );
+ vf->EraseAll( this, forced );
if ( updateViewer )
vf->Repaint();
}
virtual void Erase( const QStringList&, const bool forced = false,
const bool updateViewer = true, SALOME_View* = 0);
void Erase( const QString&, const bool forced = false, const bool updateViewer = true, SALOME_View* = 0 );
- virtual void EraseAll( const bool forced = false, const bool updateViewer = true, SALOME_View* = 0 ) const;
+ virtual void EraseAll( const bool forced = false, const bool updateViewer = true, SALOME_View* = 0 );
virtual bool IsDisplayed( const QString&, SALOME_View* = 0 ) const;
void UpdateViewer() const;
return "Interface Applicative";
}
-
-
-
-
/*!
Set a visual property of the object
- \param theViewId - Id of the viewer namager
+ \param theViewMgrId - Id of the viewer namager
\param theEntry - Entry of the object
\param thePropName - the name of the visual property
\param theValue - the value of the visual property
*/
-void LightApp_Study::setObjectProperty(int theViewId, QString theEntry, QString thePropName, QVariant theValue) {
-
- //Try to find viewer manager in the map
- ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewId);
- if(v_it == myViewMgrMap.end()) {
-
- //1) Create property map
- PropMap aPropMap;
- aPropMap.insert(thePropName, theValue);
-
- //2) Create object map
- ObjMap anObjMap;
- anObjMap.insert(theEntry,aPropMap);
-
- //3) Insert in the view manager map
- myViewMgrMap.insert(theViewId, anObjMap);
-
- } else {
- ObjMap& anObjMap = v_it.value();
- ObjMap::Iterator o_it = anObjMap.find(theEntry);
- if(o_it == anObjMap.end()) {
- //1) Create property map
- PropMap aPropMap;
- aPropMap.insert(thePropName, theValue);
-
- //2) Insert in the object map
- anObjMap.insert(theEntry, aPropMap);
- } else {
- PropMap& aPropMap = o_it.value();
- aPropMap.insert(thePropName, theValue);
- }
- }
+void LightApp_Study::setObjectProperty( int theViewMgrId,
+ const QString& theEntry,
+ const QString& thePropName,
+ const QVariant& theValue )
+{
+ myViewMgrMap[theViewMgrId][theEntry][thePropName] = theValue;
}
/*!
\param theDefValue - the default value of the visual property.
\return value of the visual propetry. If value is't found then return theDefValue.
*/
-QVariant LightApp_Study::getObjectProperty(int theViewMgrId, QString theEntry, QString thePropName, QVariant theDefValue) const {
- QVariant& aResult = theDefValue;
- ViewMgrMap::ConstIterator v_it = myViewMgrMap.find(theViewMgrId);
- if(v_it != myViewMgrMap.end()){
+QVariant LightApp_Study::getObjectProperty( int theViewMgrId,
+ const QString& theEntry,
+ const QString& thePropName,
+ const QVariant& theDefValue ) const
+{
+ QVariant aResult = theDefValue;
+ ViewMgrMap::ConstIterator v_it = myViewMgrMap.find( theViewMgrId );
+ if ( v_it != myViewMgrMap.end() ) {
const ObjMap& anObjectMap = v_it.value();
- ObjMap::ConstIterator o_it = anObjectMap.find(theEntry);
- if(o_it != anObjectMap.end()) {
+ ObjMap::ConstIterator o_it = anObjectMap.find( theEntry );
+ if ( o_it != anObjectMap.end() ) {
const PropMap& aPropMap = o_it.value();
- PropMap::ConstIterator p_it = aPropMap.find(thePropName);
- if(p_it != aPropMap.end()) {
+ PropMap::ConstIterator p_it = aPropMap.find( thePropName );
+ if ( p_it != aPropMap.end() ) {
aResult = p_it.value();
}
}
}
/*!
- Remove view manager with all objects.
- \param theViewMgrId - Id of the viewer manager.
+ Set a visual property of the object for all registered viewers
+ \param theEntry - Entry of the object
+ \param thePropName - the name of the visual property
+ \param theValue - the value of the visual property
*/
-void LightApp_Study::removeViewMgr( int theViewMgrId ) {
- myViewMgrMap.remove(theViewMgrId);
+void LightApp_Study::setObjectProperty( const QString& theEntry,
+ const QString& thePropName,
+ const QVariant& theValue )
+{
+ const ViewMgrMap& vm = getObjectProperties();
+ ViewMgrMap::ConstIterator v_it;
+ for ( v_it = vm.begin(); v_it != vm.end(); ++v_it ) {
+ setObjectProperty( v_it.key(), theEntry, thePropName, theValue );
+ }
}
+/*!
+ Set a visual property for all registered objects for given viewer
+ \param theViewMgrId - Id of the viewer manager.
+ \param thePropName - the name of the visual property
+ \param theValue - the value of the visual property
+*/
+void LightApp_Study::setObjectProperty( int theViewMgrId,
+ const QString& thePropName,
+ const QVariant& theValue )
+{
+ const ObjMap& om = getObjectProperties( theViewMgrId );
+ ObjMap::ConstIterator o_it;
+ for ( o_it = om.begin(); o_it != om.end(); ++o_it ) {
+ setObjectProperty( theViewMgrId, o_it.key(), thePropName, theValue );
+ }
+}
/*!
Get a map of the properties of the object identified by theViewMgrId and theEntry.
\param theEntry - Entry of the object.
\return a map of the properties of the object.
*/
-const PropMap& LightApp_Study::getObjectPropMap(int theViewMgrId, QString theEntry) {
- ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
- if (v_it != myViewMgrMap.end()) {
- ObjMap& anObjectMap = v_it.value();
- ObjMap::Iterator o_it = anObjectMap.find(theEntry);
- if(o_it != anObjectMap.end()) {
- return o_it.value();
- } else {
- PropMap aPropMap;
- anObjectMap.insert(theEntry, aPropMap);
- return anObjectMap.find(theEntry).value();
- }
- } else {
- PropMap aPropMap;
- ObjMap anObjMap;
- anObjMap.insert(theEntry,aPropMap);
- myViewMgrMap.insert(theViewMgrId, anObjMap);
-
- ObjMap& anObjectMap = myViewMgrMap.find(theViewMgrId).value();
- return anObjectMap.find(theEntry).value();
- }
+const PropMap& LightApp_Study::getObjectProperties( int theViewMgrId, const QString& theEntry )
+{
+ ViewMgrMap::Iterator v_it = myViewMgrMap.find( theViewMgrId );
+ if ( v_it == myViewMgrMap.end() )
+ v_it = myViewMgrMap.insert( theViewMgrId, ObjMap() );
+
+ ObjMap& anObjectMap = v_it.value();
+ ObjMap::Iterator o_it = anObjectMap.find( theEntry );
+ if ( o_it == anObjectMap.end() )
+ o_it = anObjectMap.insert( theEntry, PropMap() );
+
+ return o_it.value();
}
/*!
\param theViewMgrId - Id of the viewer manager.
\param theEntry - Entry of the object.
*/
-void LightApp_Study::setObjectPropMap(int theViewMgrId, QString theEntry, PropMap thePropMap) {
- //Try to find viewer manager in the map
- ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
- if(v_it == myViewMgrMap.end()) {
-
- //1) Create object map
- ObjMap anObjMap;
- anObjMap.insert(theEntry,thePropMap);
-
- //3) Insert in the view manager map
- myViewMgrMap.insert(theViewMgrId, anObjMap);
- } else {
- ObjMap& anObjMap = v_it.value();
- anObjMap.insert(theEntry,thePropMap);
- }
+void LightApp_Study::setObjectProperties( int theViewMgrId,
+ const QString& theEntry,
+ const PropMap& thePropMap )
+{
+ myViewMgrMap[theViewMgrId][theEntry] = thePropMap;
+}
+
+/*!
+ Remove view manager with all objects.
+ \param theViewMgrId - Id of the viewer manager.
+*/
+void LightApp_Study::removeObjectProperties( int theViewMgrId )
+{
+ myViewMgrMap.remove( theViewMgrId );
}
+
/*!
Remove object's properties from all view managers.
\param theEntry - Entry of the object.
*/
-void LightApp_Study::removeObjectFromAll( QString theEntry ) {
- ViewMgrMap::Iterator v_it = myViewMgrMap.begin();
- for( ;v_it != myViewMgrMap.end(); v_it++ ) {
- v_it.value().remove(theEntry);
- }
+void LightApp_Study::removeObjectProperties( const QString& theEntry )
+{
+ ViewMgrMap::Iterator v_it;
+ for ( v_it = myViewMgrMap.begin(); v_it != myViewMgrMap.end(); v_it++ )
+ v_it.value().remove( theEntry );
}
/*!
Get all objects and it's properties from view manager identified by theViewMgrId.
\param theEntry - Entry of the object.
*/
-const ObjMap& LightApp_Study::getObjectMap ( int theViewMgrId ) {
- ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
- if( v_it == myViewMgrMap.end() ) {
- ObjMap anObjMap;
- myViewMgrMap.insert(theViewMgrId , anObjMap);
- return myViewMgrMap.find(theViewMgrId).value();
- }
+const ObjMap& LightApp_Study::getObjectProperties( int theViewMgrId )
+{
+ ViewMgrMap::Iterator v_it = myViewMgrMap.find( theViewMgrId );
+ if ( v_it == myViewMgrMap.end() )
+ v_it = myViewMgrMap.insert( theViewMgrId, ObjMap() );
return v_it.value();
}
+/*!
+ Get global properties map
+*/
+const ViewMgrMap& LightApp_Study::getObjectProperties() const
+{
+ return myViewMgrMap;
+}
+
/*!
Set 'visibility state' property of the object.
\param theEntry - Entry of the object.
\param theState - visibility status
*/
-void LightApp_Study::setVisibilityState(const QString& theEntry, Qtx::VisibilityState theState) {
+void LightApp_Study::setVisibilityState( const QString& theEntry, Qtx::VisibilityState theState )
+ {
LightApp_Application* app = (LightApp_Application*)application();
- if(!app)
- return;
+ if ( !app ) return;
SUIT_DataBrowser* db = app->objectBrowser();
- if(!db)
- return;
-
- SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
-
- if(treeModel)
- treeModel->setVisibilityState(theEntry,theState);
+ if ( !db ) return;
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( db->model() );
+ if ( treeModel )
+ treeModel->setVisibilityState( theEntry, theState );
}
/*!
Set 'visibility state' property for all object.
\param theEntry - Entry of the object.
*/
-void LightApp_Study::setVisibilityStateForAll(Qtx::VisibilityState theState) {
-
+void LightApp_Study::setVisibilityStateForAll( Qtx::VisibilityState theState )
+{
LightApp_Application* app = (LightApp_Application*)application();
- if(!app)
- return;
+ if ( !app ) return;
SUIT_DataBrowser* db = app->objectBrowser();
- if(!db)
- return;
-
- SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
-
- if(treeModel)
- treeModel->setVisibilityStateForAll(theState);
+ if ( !db ) return;
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( db->model() );
+ if ( treeModel )
+ treeModel->setVisibilityStateForAll( theState );
}
/*!
\param theEntry - Entry of the object.
\return 'visibility state' property of the object.
*/
-Qtx::VisibilityState LightApp_Study::visibilityState(const QString& theEntry) const {
+Qtx::VisibilityState LightApp_Study::visibilityState( const QString& theEntry ) const
+{
+ Qtx::VisibilityState state = Qtx::UnpresentableState;
LightApp_Application* app = (LightApp_Application*)application();
- if(app) {
-
+ if ( app ) {
SUIT_DataBrowser* db = app->objectBrowser();
- if(db) {
- SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
- if(treeModel)
- return treeModel->visibilityState(theEntry);
+ if ( db ) {
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( db->model() );
+ if ( treeModel )
+ state = treeModel->visibilityState( theEntry );
}
}
- return Qtx::UnpresentableState;
+ return state;
}
/*!
virtual QString getVisualComponentName() const;
- virtual void setObjectProperty ( int theViewMgrId, QString theEntry, QString thePropName, QVariant theValue );
- virtual QVariant getObjectProperty ( int theViewMgrId, QString theEntry, QString thePropName, QVariant theDefValue ) const;
- virtual void removeViewMgr ( int theViewMgrId );
- virtual void setObjectPropMap ( int theViewMgrId, QString theEntry, PropMap thePropMap );
- virtual const PropMap& getObjectPropMap ( int theViewMgrId, QString theEntry ) ;
- virtual void removeObjectFromAll( QString theEntry );
- virtual const ObjMap& getObjectMap ( int theViewMgrId );
- virtual const ViewMgrMap& getViewMgrMap ( int theViewMgrId ) { return myViewMgrMap; };
+ virtual void setObjectProperty( int, const QString&, const QString&, const QVariant& );
+ virtual void setObjectProperty( const QString&, const QString&, const QVariant& );
+ virtual void setObjectProperty( int, const QString&, const QVariant& );
+ virtual void setObjectProperties( int, const QString&, const PropMap& );
+ virtual QVariant getObjectProperty( int, const QString&, const QString&, const QVariant& ) const;
+ virtual const PropMap& getObjectProperties( int, const QString& );
+ virtual const ObjMap& getObjectProperties( int );
+ virtual const ViewMgrMap& getObjectProperties() const;
+ virtual void removeObjectProperties( int );
+ virtual void removeObjectProperties( const QString& );
virtual void setVisibilityState(const QString& theEntry, Qtx::VisibilityState theState);
virtual Qtx::VisibilityState visibilityState(const QString& theEntry) const;
public:
Plot2d_Prs( bool theDelete = false );
Plot2d_Prs( Plot2d_Object* obj, bool theDelete = false );
- ~Plot2d_Prs();
+ virtual ~Plot2d_Prs();
objectList getObjects() const;
void AddObject( Plot2d_Object* obj );
#include "SALOME_Prs.h"
+/*!
+ Constructor
+*/
+SALOME_Prs::SALOME_Prs(const char* e) : myIsClippable(true)
+{
+ myEntry = std::string( e ? e : "" );
+}
+
+/*!
+ Get entry
+*/
+const char* SALOME_Prs::GetEntry() const
+{
+ return myEntry.c_str();
+}
+
/*!
Dispatches display operation to proper Display() method of SALOME_View
*/
/*!
Gives control to SALOME_Prs object, so that it could perform double dispatch
*/
-void SALOME_View::Display( const SALOME_Prs* prs )
+void SALOME_View::Display( SALOME_Displayer* d, const SALOME_Prs* prs )
{
prs->DisplayIn( this );
+ if ( d ) d->UpdateVisibility( this, prs, true );
}
/*!
Gives control to SALOME_Prs object, so that it could perform double dispatch
*/
-void SALOME_View::Erase( const SALOME_Prs* prs, const bool forced )
+void SALOME_View::Erase( SALOME_Displayer* d, const SALOME_Prs* prs, const bool forced )
{
prs->EraseIn( this, forced );
+ if ( d ) d->UpdateVisibility( this, prs, false );
}
/*!
/*!
Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
*/
-void SALOME_View::EraseAll( const bool )
+void SALOME_View::EraseAll( SALOME_Displayer* d, const bool )
{
// MESSAGE( "SALOME_View::EraseAll() called!" );
+ if ( d ) d->UpdateVisibility( this, 0, false );
}
/*!
// MESSAGE( "SALOME_Displayer::Update( SALOME_Prs2d* ) called! Probably, presentation is being updated in uncompatible viewframe." );
}
+/*!
+ Virtual method, should be reimplemented in successors, by default does nothing.
+*/
+void SALOME_Displayer::UpdateVisibility( SALOME_View*, const SALOME_Prs*, bool )
+{
+}
class SALOME_ListIO;
class Handle_SALOME_InteractiveObject;
+#include <string>
+
/*!
\class SALOME_Prs
Base class for SALOME graphic object wrappers - presentations.
{
public:
//! Constructor
- SALOME_Prs() : myIsClippable (true) {};
-
+ explicit SALOME_Prs( const char* );
+
//! Destructor
virtual ~SALOME_Prs() {}
+ //! Get entry
+ const char* GetEntry() const;
+
//! Key method for double dispatch of display operation
virtual void DisplayIn( SALOME_View* ) const = 0;
}
protected:
-
+ std::string myEntry;
bool myIsClippable;
};
class PRS_EXPORT SALOME_OCCPrs : public SALOME_Prs
{
public:
+ //! Constructor
+ explicit SALOME_OCCPrs(const char* e) : SALOME_Prs(e) {}
+
//! It uses double dispatch in order to
//! invoke Display() method corresponding to the actual type of presentation.
virtual void DisplayIn( SALOME_View* ) const;
class PRS_EXPORT SALOME_VTKPrs : public SALOME_Prs
{
public:
+ //! Constructor
+ explicit SALOME_VTKPrs(const char* e) : SALOME_Prs(e) {}
+
//! It uses double dispatch in order to
//! invoke Display() method corresponding to the actual type of presentation.
virtual void DisplayIn( SALOME_View* ) const;
class PRS_EXPORT SALOME_Prs2d : public SALOME_Prs
{
public:
+ //! Constructor
+ explicit SALOME_Prs2d(const char* e) : SALOME_Prs(e) {}
+
//! It uses double dispatch in order to
//! invoke Display() method corresponding to the actual type of presentation.
virtual void DisplayIn( SALOME_View* ) const;
//! This Display() method should be called to display given presentation
//! created anywhere by anybody. It simply passes control to SALOME_Prs object
//! so that it could perform double dispatch.
- void Display( const SALOME_Prs* );
+ void Display( SALOME_Displayer*, const SALOME_Prs* );
//! This Erase() method should be called to erase given presentation
//! created anywhere by anybody. It simply passes control to SALOME_Prs object
//! so that it could perform double dispatch.
- void Erase( const SALOME_Prs*, const bool = false );
+ void Erase( SALOME_Displayer*, const SALOME_Prs*, const bool = false );
+
+ //! This EraseAll() method should be called to erase all presentations
+ //! created anywhere by anybody.
+ virtual void EraseAll( SALOME_Displayer*, const bool = false );
//! This LocalSelection() method should be called to activate sub-shapes selection
//! created anywhere by anybody. It simply passes control to SALOME_Prs object
virtual void Erase( const SALOME_OCCPrs*, const bool = false );//!< Erase SALOME_OCCPrs
virtual void Erase( const SALOME_VTKPrs*, const bool = false );//!< Erase SALOME_VTKPrs
virtual void Erase( const SALOME_Prs2d*, const bool = false );//!< Erase SALOME_Prs2d
- virtual void EraseAll( const bool = false );
// Add new Erase() methods here...
// LocalSelection() methods for ALL kinds of presentation should appear here
virtual void BeforeErase( SALOME_View*, const SALOME_Prs2d* ) {} //! Null body here
virtual void AfterErase ( SALOME_View*, const SALOME_Prs2d* ) {} //! Null body here
+ // Axiluary method called to update visibility state of presentation
+ virtual void UpdateVisibility( SALOME_View*, const SALOME_Prs*, bool );
};
#endif
/*!
Default constructor
*/
-SOCC_Prs::SOCC_Prs()
+SOCC_Prs::SOCC_Prs( const char* entry )
+ : SALOME_OCCPrs( entry )
{
myToActivate = true;
}
/*!
Standard constructor
*/
-SOCC_Prs::SOCC_Prs( const Handle(AIS_InteractiveObject)& obj )
+SOCC_Prs::SOCC_Prs( const char* entry, const Handle(AIS_InteractiveObject)& obj )
+ : SALOME_OCCPrs( entry )
{
AddObject( obj );
}
class SOCC_EXPORT SOCC_Prs : public SALOME_OCCPrs
{
public:
- SOCC_Prs();
+ explicit SOCC_Prs( const char* entry );
// Default constructor
- SOCC_Prs( const Handle(AIS_InteractiveObject)& obj );
+ SOCC_Prs( const char* entry, const Handle(AIS_InteractiveObject)& obj );
// Standard constructor
~SOCC_Prs();
// Destructor
Erase all presentations
\param forced - removes all objects from context
*/
-void SOCC_Viewer::EraseAll( const bool forced )
+void SOCC_Viewer::EraseAll( SALOME_Displayer* d, const bool forced )
{
// get SALOMEDS Study
// Temporarily commented to avoid awful dependecy on SALOMEDS
//}
}
+ SALOME_View::EraseAll( d, forced );
+
Repaint();
updateTrihedron();
}
*/
SALOME_Prs* SOCC_Viewer::CreatePrs( const char* entry )
{
- SOCC_Prs* prs = new SOCC_Prs();
+ SOCC_Prs* prs = new SOCC_Prs(entry);
if ( entry )
{
if(entry2aisobjects.count(entry)>0)
/* Reimplemented from SALOME_View */
virtual void Display( const SALOME_OCCPrs* );
virtual void Erase( const SALOME_OCCPrs*, const bool = false );
- virtual void EraseAll( const bool = false );
+ virtual void EraseAll( SALOME_Displayer*, const bool = false );
virtual SALOME_Prs* CreatePrs( const char* entry = 0 );
virtual void LocalSelection( const SALOME_OCCPrs*, const int );
/*!
Default constructor
*/
-SPlot2d_Prs::SPlot2d_Prs()
-:Plot2d_Prs()
+SPlot2d_Prs::SPlot2d_Prs( const char* entry )
+ : SALOME_Prs2d( entry ), Plot2d_Prs()
{
}
/*!
Standard constructor
*/
-SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Object* obj )
-:Plot2d_Prs(obj)
+SPlot2d_Prs::SPlot2d_Prs( const char* entry, const Plot2d_Object* obj )
+ : SALOME_Prs2d( entry ), Plot2d_Prs( obj )
{
}
Standard constructor
*/
SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Prs* prs )
+ : SALOME_Prs2d( 0 )
{
mySecondY = prs->isSecondY();
myObjects = prs->getObjects();
+ const SPlot2d_Prs* sp = dynamic_cast<const SPlot2d_Prs*>( prs );
+ if ( sp )
+ myEntry = sp->myEntry;
myIsAutoDel = false; // VSR: error? should auto-delete flag be removed
}
{
public:
// Default constructor
- SPlot2d_Prs();
+ explicit SPlot2d_Prs( const char* entry );
// Standard constructor
- SPlot2d_Prs( const Plot2d_Object* obj );
+ SPlot2d_Prs( const char* entry , const Plot2d_Object* obj );
+ // Copy constructor
SPlot2d_Prs( const Plot2d_Prs* prs );
// Destructor
/*!
Removes all curves from the view
*/
-void SPlot2d_Viewer::EraseAll(const bool /*forced*/)
+void SPlot2d_Viewer::EraseAll(SALOME_Displayer* d, const bool forced)
{
Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
if(aViewFrame) aViewFrame->EraseAll();
+ SALOME_View::EraseAll(d, forced);
}
/*!
SALOME_Prs* SPlot2d_Viewer::CreatePrs( const char* entry )
{
Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
- SPlot2d_Prs *prs = new SPlot2d_Prs();
+ SPlot2d_Prs *prs = new SPlot2d_Prs( entry );
if(aViewFrame)
{
CurveDict aCurves = aViewFrame->getCurves();
/* Reimplemented from SALOME_View */
void Display( const SALOME_Prs2d* );
void Erase( const SALOME_Prs2d*, const bool = false );
- virtual void EraseAll(const bool = false);
+ virtual void EraseAll(SALOME_Displayer*, const bool = false);
virtual void Repaint();
virtual SALOME_Prs* CreatePrs( const char* entry = 0 );
/*!
Default constructor
*/
-SVTK_Prs::SVTK_Prs() : myObjects( 0 )
+SVTK_Prs::SVTK_Prs( const char* entry ) : SALOME_VTKPrs(entry), myObjects( 0 )
{
}
/*!
Standard constructor
*/
-SVTK_Prs::SVTK_Prs( const vtkActor* obj )
+SVTK_Prs::SVTK_Prs( const char* entry, const vtkActor* obj ) : SALOME_VTKPrs(entry)
{
AddObject( obj );
}
class SVTK_EXPORT SVTK_Prs : public SALOME_VTKPrs
{
public:
- SVTK_Prs();
+ explicit SVTK_Prs( const char* entry );
// Default constructor
- SVTK_Prs( const vtkActor* obj );
+ SVTK_Prs( const char* entry, const vtkActor* obj );
// Standard constructor
~SVTK_Prs();
// Destructor
Erase all presentations
\param forced - removes all objects from view
*/
-void SVTK_Viewer::EraseAll( const bool forced )
+void SVTK_Viewer::EraseAll( SALOME_Displayer* d, const bool forced )
{
// Temporarily commented to avoid awful dependecy on SALOMEDS
// TODO: better mechanism of storing display/erse status in a study
}
}
}
+
+ SALOME_View::EraseAll( d, forced );
+
Repaint();
}
*/
SALOME_Prs* SVTK_Viewer::CreatePrs( const char* entry )
{
- SVTK_Prs* prs = new SVTK_Prs();
+ SVTK_Prs* prs = new SVTK_Prs( entry );
if ( entry ) {
if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(getViewManager()->getActiveView()))
if(SVTK_View* aView = aViewWindow->getView()){
//! See #SALOME_View::Erase( const SALOME_VTKPrs*, const bool = false )
void Erase( const SALOME_VTKPrs*, const bool = false );
- //! See #SALOME_View::EraseAll( const bool = false )
- void EraseAll( const bool = false );
+ //! See #SALOME_View::EraseAll( SALOME_Displayer*, const bool = false )
+ void EraseAll( SALOME_Displayer*, const bool = false );
//! See #SALOME_View::getVisible( SALOME_ListIO& )
virtual void GetVisible( SALOME_ListIO& );