else {
// second case : get empty initial view frame as new ViewFrame object
aViewFrame = myInitialViewFrame;
+ // mkr : PAL8237 : remove first "gag" Main from children
+ aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
}
if( aViewFrame ) {
else {
// 2. get empty initial view frame as new ViewFrame object
aViewFrame = myInitialViewFrame;
+ // mkr : PAL8237 : remove first "gag" Main from children
+ aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
}
if ( aViewFrame ) {
else
myColor = DRAW_COLOR;
}
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
}
SUPERVGUI_CanvasLink::~SUPERVGUI_CanvasLink()
}
}
myLink->destroy();
+
+ emit objectCreatedDeleted(); // mkr : PAL8237
}
+
delete this;
if (aPort && !aValue.isEmpty() && myMain->getDataflow()->GraphLevel() == 0) {
aPort->setValue(aValue);
anIndex = aPoint->getIndex()+1;
if (anIndex < 1) anIndex = 1;
}
- if (myLink && !SUPERV_isNull(myLink))
+ if (myLink && !SUPERV_isNull(myLink)) {
myLink->AddCoord(anIndex, mySelectedPoint.x(), mySelectedPoint.y());
+ emit objectCreatedDeleted(); // mkr : PAL8237
+ }
merge();
myMain->getCanvas()->update();
}
void SUPERVGUI_CanvasLink::removePoint() {
if (mySelectedItem && mySelectedItem->rtti() == SUPERVGUI_Canvas::Rtti_LinkPoint) {
SUPERVGUI_CanvasPointPrs* aPoint = (SUPERVGUI_CanvasPointPrs*) mySelectedItem;
- if (myLink && !SUPERV_isNull(myLink))
+ if (myLink && !SUPERV_isNull(myLink)) {
myLink->RemoveCoord(aPoint->getIndex());
+ emit objectCreatedDeleted(); // mkr : PAL8237
+ }
merge();
myMain->getCanvas()->update();
}
QString getToolTipText() const;
+ signals:
+ void objectCreatedDeleted(); // mkr : PAL8237
+
public slots:
virtual void remove();
void addPoint();
}
isIgnore = false;
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
+ emit objectCreatedDeleted();
}
SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode()
if (aPort) {
connect(aPort, SIGNAL(destroyed(QObject*)), this, SLOT(onDestroyed(QObject*)));
if (!isIgnore) getPrs()->updatePorts();
+
+ emit objectCreatedDeleted(); // mkr : PAL8237
}
}
SUPERVGUI_Canvas* aCanvas = myMain->getCanvas();
setDestroyed();
myNode->destroy();
+
+ emit objectCreatedDeleted(); // mkr : PAL8237
+
delete this;
aCanvas->update();
}
virtual QString getToolTipText() const;
+ signals:
+ void objectCreatedDeleted(); // mkr : PAL8237
+
public slots:
void suspendResume();
void kill();
virtual void pastePort();
void managePorts();
void exportToLib();
-
+
protected:
// redefined by most of CanvasNode successors
virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
// setName(myPort->Name());
setName(myMain->getCanvas()->getPortName(thePort));
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
}
SUPERVGUI_CanvasPort::~SUPERVGUI_CanvasPort()
Trace("SUPERVGUI_CanvasPort::remove");
myPort->destroy();
+
+ emit objectDeleted(); // mkr : PAL8237
+
delete this;
}
void removeLink(SUPERVGUI_CanvasLink* theLink);
void updateLinks();
+ signals:
+ void objectDeleted(); // mkr : PAL8237
+
public slots:
void sketchLink();
virtual void remove();
myPopup->insertSeparator();
myShowToolBarItem = myPopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), myMain, SLOT( onShowToolbar() ) );
}
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectCreated()), myMain, SLOT(onObjectCreatedDeleted()));
}
SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(canvas(), myMain, aLinkEngine);
aLink->show();
+ emit objectCreated(); // mkr : PAL8237
+
canvas()->update();
myIsLinkCreating = false;
bool isAnyLinkCreating() const { return myIsLinkCreating; }
void startSketch(SUPERVGUI_CanvasPort* thePort);
+ signals:
+ void objectCreated(); // mkr : PAL8237
+
public slots:
void addToStudy();
void onTimeout();
#include "NOTIFICATION.hxx"
#include "SALOME_Event.hxx"
#include "SUPERVGraph_ViewFrame.h"
+#include "SUPERVGraph_ViewModel.h"
#include "LogWindow.h"
#include "OB_Browser.h"
aVF->getToolBar()->show();
}
+// mkr : PAL8237 : synchronize many views of the same dataflow
+void SUPERVGUI_Main::onObjectCreatedDeleted()
+{
+ if ( study ) {
+ if ( STD_Application* app = dynamic_cast<STD_Application*>( study->application() ) ) {
+ ViewManagerList aVMList;
+ app->viewManagers( SUPERVGraph_Viewer::Type(), aVMList );
+ SUIT_ViewManager* aVM;
+ for ( aVM = aVMList.first(); aVM; aVM = aVMList.next() ) {
+ QPtrVector<SUIT_ViewWindow> aVWList = aVM->getViews();
+ for ( int i = 0; i < aVWList.count(); i++ ) {
+ SUPERVGraph_ViewFrame* aVW = dynamic_cast<SUPERVGraph_ViewFrame*>( aVWList[i] );
+ QObjectList* aMainList = aVW->queryList("SUPERVGUI_Main");
+ if ( aMainList->count() == 1 ) {
+ SUPERVGUI_Main* aMain = dynamic_cast<SUPERVGUI_Main*>( aMainList->first() );
+ if ( aMain )
+ if ( !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
+ &&
+ aMain != this ) // not equal mains
+ aMain->getCanvas()->merge();
+ }
+ }
+ }
+ }
+ }
+}
+
void SUPERVGUI_Main::run( const bool andSuspend ) {
Trace("SUPERVGUI_Main::run");
if ( SUPERV_isNull(dataflow) )
void onSubGraphActivated( SUIT_ViewWindow* );
void onShowToolbar();
+
+ void onObjectCreatedDeleted(); // mkr : PAL8237
private slots:
void chooseData(QListViewItem* item);