Plot2d_Prs* CreatePrs( const char* entry = 0 );
/* operations */
+ void updateTitles();
void setTitle( const QString& title );
QString getTitle() const { return myTitle; }
void displayCurve( Plot2d_Curve* curve, bool update = false );
int testOperation( const QMouseEvent& );
void readPreferences();
void writePreferences();
- void updateTitles();
QString getInfo( const QPoint& pnt );
virtual void wheelEvent( QWheelEvent* );
/*!
Renames curve if it is found
*/
-void SPlot2d_Viewer::rename( const Handle(SALOME_InteractiveObject)& IObject, QString newName )
+void SPlot2d_Viewer::rename( const Handle(SALOME_InteractiveObject)& IObject,
+ const QString& newName, Plot2d_ViewFrame* fr )
{
- Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
- if(aViewFrame == NULL) return;
+ Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame();
+ if( !aViewFrame )
+ return;
- Plot2d_Curve* curve = getCurveByIO( IObject );
- if ( curve ) {
- curve->setVerTitle( newName );
- int key = aViewFrame->hasCurve( curve );
- if ( key ) {
- aViewFrame->setCurveTitle( key, newName );
+ QIntDictIterator<Plot2d_Curve> it( aViewFrame->getCurves() );
+ for( ; it.current(); ++it )
+ {
+ SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.current() );
+ if( aCurve && aCurve->hasIO() && aCurve->getIO()->isSame( IObject ) )
+ {
+ aCurve->setVerTitle( newName );
+ int key = aViewFrame->hasCurve( aCurve );
+ if( key )
+ aViewFrame->setCurveTitle( key, newName );
+ }
+
+ if( aCurve && aCurve->hasTableIO() && aCurve->getTableIO()->isSame( IObject ) )
+ aCurve->getTableIO()->setName( newName.latin1() );
+ }
+ aViewFrame->updateTitles();
+}
+
+void SPlot2d_Viewer::renameAll( const Handle(SALOME_InteractiveObject)& IObj, const QString& name )
+{
+ SUIT_ViewManager* vm = getViewManager();
+ if( vm )
+ {
+ const QPtrVector<SUIT_ViewWindow>& wnds = vm->getViews();
+ for( int i=0; i<wnds.size(); i++ )
+ {
+ Plot2d_ViewWindow* pwnd = dynamic_cast<Plot2d_ViewWindow*>( wnds.at( i ) );
+ rename( IObj, name, pwnd->getViewFrame() );
}
}
}
return NULL;
}
-SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObject)& theIObject )
+SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObject)& theIObject,
+ Plot2d_ViewFrame* fr )
{
if ( !theIObject.IsNull() ) {
- Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
+ Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame();
if(aViewFrame) {
QIntDictIterator<Plot2d_Curve> it( aViewFrame->getCurves() );
for ( ; it.current(); ++it ) {
/* interactive object management */
void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool update = true ) {}
void unHighlightAll() {}
- void rename( const Handle(SALOME_InteractiveObject)& IObject, QString newName );
+ void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 );
+ void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& );
bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
/* display */
/* operations */
- SPlot2d_Curve* getCurveByIO( const Handle(SALOME_InteractiveObject)& theIObject );
+ SPlot2d_Curve* getCurveByIO( const Handle(SALOME_InteractiveObject)&, Plot2d_ViewFrame* = 0 );
Plot2d_ViewFrame* getActiveViewFrame();
Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );