using namespace std;
-//=======================================================================
-// function : GetBasicGUI()
-// purpose : Get the only BasicGUI object [ static ]
-//=======================================================================
-BasicGUI* BasicGUI::GetBasicGUI( GeometryGUI* parent )
-{
- return new BasicGUI( parent );
-}
-
//=======================================================================
// function : BasicGUI()
// purpose : Constructor
QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
// Create Point dialog, OCC viewer
- if ( aDlg && aDlg->isA( "BasicGUI_PointDlg" ) && theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() && pe->state() != Qt::ControlButton )
+ if ( aDlg && aDlg->isA( "BasicGUI_PointDlg" ) &&
+ theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() &&
+ pe->state() != Qt::ControlButton )
{
BasicGUI_PointDlg* aPntDlg = (BasicGUI_PointDlg*) aDlg;
if ( aPntDlg->acceptMouseEvent() )
+ {
+ OCCViewer_Viewer* anOCCViewer =
+ ((OCCViewer_ViewManager*)(theViewWindow->getViewManager()))->getOCCViewer();
+ Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
+
+ gp_Pnt aPnt;
+
+ ic->InitSelected();
+ if ( pe->state() == Qt::ShiftButton )
+ ic->ShiftSelect(); // Append selection
+ else
+ ic->Select(); // New selection
+
+ ic->InitSelected();
+ if ( ic->MoreSelected() )
{
- OCCViewer_Viewer* anOCCViewer = ((OCCViewer_ViewManager*)(theViewWindow->getViewManager()))->getOCCViewer();
- Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
-
- gp_Pnt aPnt;
-
- ic->InitSelected();
- if( pe->state() == Qt::ShiftButton )
- ic->ShiftSelect(); // Append selection
- else
- ic->Select(); // New selection
-
- ic->InitSelected();
- if( ic->MoreSelected() )
- {
- TopoDS_Shape aShape = ic->SelectedShape();
- if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
- aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
- }
- else
- {
- OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
- aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
- }
-
- aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog
- } // acceptMouseEvent()
- }
+ TopoDS_Shape aShape = ic->SelectedShape();
+ if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
+ aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
+ }
+ else
+ {
+ OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
+ aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
+ }
+
+ aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog
+ } // acceptMouseEvent()
+ }
return false;
}
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return BasicGUI::GetBasicGUI( parent );
+ return new BasicGUI( parent );
}
}
//=================================================================================
class BasicGUI : public GEOMGUI
{
-protected:
- BasicGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
public:
+ BasicGUI( GeometryGUI* parent );
~BasicGUI();
- // Get the only BasicGUI object
- static BasicGUI* GetBasicGUI( GeometryGUI* parent );
-
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
bool OnMousePress(QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow);
#include "SalomeApp_Application.h"
-BlocksGUI* BlocksGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetBlocksGUI()
-// purpose : Get the only BlocksGUI object [ static ]
-//=======================================================================
-BlocksGUI* BlocksGUI::GetBlocksGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 )
- myGUIObject = new BlocksGUI( parent );
-
- return myGUIObject;
-}
-
//=======================================================================
// function : BlocksGUI()
// purpose : Constructor
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return BlocksGUI::GetBlocksGUI( parent );
+ return new BlocksGUI( parent );
}
}
// File : BuildGUI.h
// Author : Julia DOROVSKIKH
// Module : GEOM
-// $Header$
#ifndef BLOCKSGUI_H
#define BLOCKSGUI_H
//=================================================================================
class BlocksGUI : public GEOMGUI
{
- protected:
- BlocksGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
public:
+ BlocksGUI( GeometryGUI* parent );
~BlocksGUI();
- // Get the only BuildGUI object
- static BlocksGUI* GetBlocksGUI( GeometryGUI* parent );
-
bool OnGUIEvent (int theCommandID, SUIT_Desktop* parent);
-
-private:
- static BlocksGUI* myGUIObject; // the only BlocksGUI object
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
using namespace std;
-BooleanGUI* BooleanGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetBooleanGUI()
-// purpose : Get the only BooleanGUI object [ static ]
-//=======================================================================
-BooleanGUI* BooleanGUI::GetBooleanGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 ) {
- // init BooleanGUI only once
- myGUIObject = new BooleanGUI( parent );
- }
- return myGUIObject;
-}
-
//=======================================================================
// function : BooleanGUI()
// purpose : Constructor
{
}
-
//=======================================================================
// function : ~BooleanGUI()
// purpose : Destructor
QDialog* aDlg = new BooleanGUI_Dialog( anOperation, getGeometryGUI(), parent, "");
aDlg->show();
-
+
return true;
}
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return BooleanGUI::GetBooleanGUI( parent );
+ return new BooleanGUI( parent );
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BooleanGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef BOOLEANGUI_H
#define BOOLEANGUI_H
//=================================================================================
class BooleanGUI : public GEOMGUI
{
-protected:
- BooleanGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
public:
enum BooleanOperation { COMMON = 1, CUT = 2, FUSE = 3, SECTION = 4 };
+ BooleanGUI( GeometryGUI* parent );
~BooleanGUI();
- // Get the only BooleanGUI object
- static BooleanGUI* GetBooleanGUI( GeometryGUI* parent );
-
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
-
-private:
- static BooleanGUI* myGUIObject; // the only BooleanGUI object
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+
#include "BuildGUI_EdgeDlg.h" // Method EDGE
#include "BuildGUI_WireDlg.h" // Method WIRE
#include "BuildGUI_FaceDlg.h" // Method FACE
#include "GeometryGUI.h"
-BuildGUI* BuildGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetBuildGUI()
-// purpose : Get the only BuildGUI object [ static ]
-//=======================================================================
-BuildGUI* BuildGUI::GetBuildGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 )
- myGUIObject = new BuildGUI( parent );
-
- return myGUIObject;
-}
-
//=======================================================================
// function : BuildGUI()
// purpose : Constructor
{
}
-
//=======================================================================
// function : ~BuildGUI()
// purpose : Destructor
bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{
getGeometryGUI()->EmitSignalDeactivateDialog();
-
+
QDialog* aDlg = NULL;
switch ( theCommandID )
case 4084: aDlg = new BuildGUI_ShellDlg ( getGeometryGUI(), parent, "" ); break;
case 4085: aDlg = new BuildGUI_SolidDlg ( getGeometryGUI(), parent, "" ); break;
case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break;
-
+
default:
- SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
+ getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
break;
}
-
+
if ( aDlg != NULL )
aDlg->show();
-
+
return true;
}
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return BuildGUI::GetBuildGUI( parent );
+ return new BuildGUI( parent );
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BuildGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef BUILDGUI_H
#define BUILDGUI_H
//=================================================================================
class BuildGUI : public GEOMGUI
{
-protected:
- BuildGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
public :
+ BuildGUI( GeometryGUI* parent );
~BuildGUI();
- // Get the only BuildGUI object
- static BuildGUI* GetBuildGUI( GeometryGUI* parent );
-
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
-
-private:
- static BuildGUI* myGUIObject; // the only BuildGUI object
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include <qmenubar.h>
-DisplayGUI* DisplayGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : DisplayGUI::GetDisplayGUI()
-// purpose : Get the only DisplayGUI object [ static ]
-//=======================================================================
-DisplayGUI* DisplayGUI::GetDisplayGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 ) {
- // init DisplayGUI only once
- myGUIObject = new DisplayGUI( parent );
- }
- return myGUIObject;
-}
-
//=======================================================================
// function : DisplayGUI::DisplayGUI()
// purpose : Constructor
{
}
-
//=======================================================================
// function : DisplayGUI::~DisplayGUI()
// purpose : Destructor
//=======================================================================
bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
- DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() );
- LightApp_SelectionMgr *Sel = getGeometryGUI()->getApp()->selectionMgr();
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if (!app) return false;
+
+ LightApp_SelectionMgr *Sel = app->selectionMgr();
SALOME_ListIO selected;
Sel->selectedObjects( selected );
switch (theCommandID) {
case 211: // MENU VIEW - WIREFRAME/SHADING
{
- myDisplayGUI->InvertDisplayMode();
- int newMode = myDisplayGUI->GetDisplayMode();
- getGeometryGUI()->action( 211 )->setMenuText( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
+ InvertDisplayMode();
+ int newMode = GetDisplayMode();
+ getGeometryGUI()->action( 211 )->setMenuText
+ ( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
getGeometryGUI()->menuMgr()->update();
-// SUIT_Session::session()->activeApplication()->desktop()->menuBar()->
-// changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
break;
}
case 212: // MENU VIEW - DISPLAY ALL
{
getGeometryGUI()->EmitSignalDeactivateDialog();
- myDisplayGUI->DisplayAll();
+ DisplayAll();
break;
}
case 213: // MENU VIEW - DISPLAY ONLY
{
getGeometryGUI()->EmitSignalDeactivateDialog();
- myDisplayGUI->DisplayOnly();
+ DisplayOnly();
break;
}
case 214: // MENU VIEW - ERASE ALL
{
- myDisplayGUI->EraseAll();
+ EraseAll();
break;
}
case 215: // MENU VIEW - ERASE
{
- myDisplayGUI->Erase();
+ Erase();
break;
}
case 216: // MENU VIEW - DISPLAY
{
getGeometryGUI()->EmitSignalDeactivateDialog();
- myDisplayGUI->Display();
+ Display();
break;
}
case 80311: // POPUP VIEWER - WIREFRAME
{
- myDisplayGUI->ChangeDisplayMode( 0 );
+ ChangeDisplayMode( 0 );
break;
}
case 80312: // POPUP VIEWER - SHADING
{
- myDisplayGUI->ChangeDisplayMode( 1 );
+ ChangeDisplayMode( 1 );
break;
}
default:
{
- SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
}
//=====================================================================================
void DisplayGUI::DisplayAll()
{
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return;
+
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !appStudy ) return;
_PTR(Study) aStudy = appStudy->studyDS();
if ( !aStudy ) return;
_PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) refSO;
if ( !valSO->ReferencedObject( refSO ) ) {
- listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) );
+ listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
+ SC->ComponentDataType().c_str(),
+ valSO->GetName().c_str()) );
}
anIter->Next();
}
{
SUIT_OverrideCursor();
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ SUIT_Application* app = getGeometryGUI()->getApp();
if ( app ) {
SUIT_ViewWindow* vw = app->desktop()->activeWindow();
if ( vw ) {
void DisplayGUI::Display()
{
SALOME_ListIO listIO;
-
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !anActiveStudy ) return;
-
+
//get SalomeApp selection manager
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr ) return;
-
+
SALOME_ListIO aList;
aSelMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO It( aList );
-
+
SUIT_OverrideCursor();
for( ;It.More();It.Next() ) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) {
_PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
- if ( SO && QString( SO->GetID().c_str() ) == QString( SO->GetFatherComponent()->GetID().c_str() ) ) {
+ if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
_PTR(SComponent) SC ( SO->GetFatherComponent() );
// if component is selected
listIO.Clear();
_PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) refSO;
if ( !valSO->ReferencedObject( refSO ) ) {
- listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) );
- }
+ listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
+ SC->ComponentDataType().c_str(),
+ valSO->GetName().c_str()) );
+ }
anIter->Next();
}
break;
{
SALOME_ListIO listIO;
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !anActiveStudy ) return;
-
+
//get SalomeApp selection manager
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr ) return;
-
+
SALOME_ListIO aList;
aSelMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO It( aList );
SUIT_OverrideCursor();
- for( ;It.More();It.Next() ) {
+ for( ; It.More(); It.Next() ) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) {
_PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
- if ( SO && QString( SO->GetID().c_str() ) == QString( SO->GetFatherComponent()->GetID().c_str() ) ) {
+ if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
_PTR(SComponent) SC ( SO->GetFatherComponent() );
// if component is selected
listIO.Clear();
_PTR(SObject) valSO ( anIter->Value() );
_PTR(SObject) refSO;
if ( !valSO->ReferencedObject( refSO ) ) {
- listIO.Append( new SALOME_InteractiveObject( valSO->GetID().c_str(), SC->ComponentDataType().c_str() ,valSO->GetName().c_str() ) );
- }
+ listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
+ SC->ComponentDataType().c_str(),
+ valSO->GetName().c_str()) );
+ }
anIter->Next();
}
break;
}
}
GEOM_Displayer(anActiveStudy).Erase( listIO, true );
- ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->clearSelected();
+ getGeometryGUI()->getApp()->selectionMgr()->clearSelected();
}
//=====================================================================================
SUIT_OverrideCursor();
if ( !viewWindow )
- viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
+ viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
aView->SetDisplayMode( mode );
AIS_ListOfInteractive List1;
ic->ObjectsInCollector( List1 );
List.Append( List1 );
-
+
AIS_ListIteratorOfListOfInteractive ite( List );
while( ite.More() ) {
if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
}
ite.Next();
}
-
+
ic->SetDisplayMode( newmode, Standard_False );
}
}
{
int dispMode = 0;
if ( !viewWindow )
- viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
+ viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
dispMode = aView->GetDisplayMode();
//=====================================================================================
void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
{
- if ( !viewWindow )
- viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
-
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
+ if ( !viewWindow )
+ viewWindow = app->desktop()->activeWindow();
+
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr ) return;
-
+
SUIT_OverrideCursor();
SALOME_ListIO aList;
-
+
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
SVTK_View* aView = vw->getView();
for( ;It.More(); It.Next() ) {
SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel());
- SVTK_Prs* vtkPrs = stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
+ SVTK_Prs* vtkPrs =
+ stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
if ( vtkPrs && !vtkPrs->IsNull() ) {
if ( mode == 0 )
aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return DisplayGUI::GetDisplayGUI( parent );
+ return new DisplayGUI( parent );
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : DisplayGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef DISPLAYGUI_H
#define DISPLAYGUI_H
#include "GEOMGUI.h"
#include "GEOMBase.h"
-//#ifdef WNT
-//#include <SALOME_WNT.hxx>
-//#else
-//#define SALOME_WNT_EXPORT
-//#endif
+
#if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS
#define DISPLAYGUI_WNT_EXPORT __declspec( dllexport )
#else
#define DISPLAYGUI_WNT_EXPORT
#endif
+
//=================================================================================
// class : GEOMBase_Display
// purpose :
class SUIT_ViewWindow;
class DisplayGUI : public GEOMGUI
{
-protected:
- DisplayGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
-public :
+public:
+ DisplayGUI( GeometryGUI* parent );
~DisplayGUI();
- // Get the only DisplayGUI object
- static DisplayGUI* GetDisplayGUI( GeometryGUI* parent );
-
// Dispatch menu command
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
// Set display mode for selected objects in the viewer given
// (current viewer if <viewWindow> = 0 )
void ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindo = 0 );
-
-private:
- static DisplayGUI* myGUIObject; // the only DisplayGUI object
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "OCCViewer_ViewManager.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Tools.h"
+#include "SalomeApp_Application.h"
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
using namespace boost;
using namespace std;
-//=======================================================================
-// function : GetEntityGUI()
-// purpose : Get the only EntityGUI object [ static ]
-//=======================================================================
-EntityGUI* EntityGUI::GetEntityGUI( GeometryGUI* parent )
-{
- return new EntityGUI( parent );
-}
-
//=======================================================================
// function : EntityGUI()
// purpose : Constructor
//=======================================================================
bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return false;
+
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
aDlg = new EntityGUI_SubShapeDlg(getGeometryGUI(), parent, "");
break;
default:
- SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
if ( aDlg )
//=====================================================================================
void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
{
- SUIT_ViewManager* aVM =
- SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager();
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return;
+
+ SUIT_ViewManager* aVM = app->desktop()->activeWindow()->getViewManager();
if (aVM->getType() != OCCViewer_Viewer::Type())
return;
mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
mySimulationShape1->Set(S1);
mySimulationShape1->SetColor(Quantity_NOC_RED);
-
+
ic->Deactivate(mySimulationShape1);
ic->Display(mySimulationShape1, Standard_False);
mySimulationShape1->UnsetColor();
//==================================================================================
void EntityGUI::EraseSimulationShape()
{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return;
+
// get all view windows at the desktop
- QPtrList<SUIT_ViewWindow> aWndLst = SUIT_Session::session()->activeApplication()->desktop()->windows();
+ QPtrList<SUIT_ViewWindow> aWndLst = app->desktop()->windows();
//get all view windows, which belong to the active study
QPtrList<SUIT_ViewWindow> aWndLstAS;
SUIT_ViewWindow* vw;
for ( vw = aWndLst.first(); vw; vw = aWndLst.next() )
- if ( vw->getViewManager()->study() == SUIT_Session::session()->activeApplication()->activeStudy() )
+ if ( vw->getViewManager()->study() == app->activeStudy() )
aWndLstAS.append( vw );
-
+
for ( vw = aWndLstAS.first(); vw; vw = aWndLstAS.next() ) {
if ( vw->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(vw->getViewManager()))->getOCCViewer();
//=====================================================================================
bool EntityGUI::SObjectExist(const _PTR(SObject)& theFatherObject, const char* IOR)
{
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
- ( SUIT_Session::session()->activeApplication()->activeStudy() );
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return false;
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !appStudy ) return false;
+
_PTR(Study) aStudy = appStudy->studyDS();
_PTR(ChildIterator) it ( aStudy->NewChildIterator(theFatherObject) );
_PTR(SObject) RefSO;
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return EntityGUI::GetEntityGUI( parent );
+ return new EntityGUI( parent );
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
//=================================================================================
class EntityGUI : public GEOMGUI
{
-protected:
- EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
public :
+ EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
~EntityGUI();
- // Get the only EntityGUI object
- static EntityGUI* GetEntityGUI( GeometryGUI* parent );
-
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
+#include "SalomeApp_Application.h"
+
#include "GenerationGUI_PrismDlg.h" // Method PRISM
#include "GenerationGUI_RevolDlg.h" // Method REVOL
#include "GenerationGUI_FillingDlg.h" // Method FILLING
using namespace std;
-GenerationGUI* GenerationGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetGenerationGUI()
-// purpose : Get the only GenerationGUI object [ static ]
-//=======================================================================
-GenerationGUI* GenerationGUI::GetGenerationGUI(GeometryGUI* parent)
-{
- if ( myGUIObject == 0 )
- myGUIObject = new GenerationGUI(parent);
-
- return myGUIObject;
-}
-
//=======================================================================
// function : GenerationGUI()
// purpose : Constructor
{
}
-
//=======================================================================
// function : ~GenerationGUI()
// purpose : Destructor
//=======================================================================
bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return false;
+
getGeometryGUI()->EmitSignalDeactivateDialog();
-
+
QDialog* aDlg = NULL;
- switch ( theCommandID )
+ switch (theCommandID)
{
case 4031: aDlg = new GenerationGUI_PrismDlg ( getGeometryGUI(), parent, ""); break;
case 4032: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent, ""); break;
case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent, ""); break;
case 4034: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent, ""); break;
- default: SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
+ default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
}
- if ( aDlg != NULL )
+ if (aDlg != NULL)
aDlg->show();
-
+
return true;
}
#endif
GEOMGUI* GetLibGUI(GeometryGUI* parent)
{
- return GenerationGUI::GetGenerationGUI(parent);
+ return new GenerationGUI(parent);
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef GENERATIONGUI_H
#define GENERATIONGUI_H
//=================================================================================
class GenerationGUI : public GEOMGUI
{
-protected:
- GenerationGUI(GeometryGUI* parent); // hide constructor to avoid direct creation
-
-public :
+public:
+ GenerationGUI(GeometryGUI* parent);
~GenerationGUI();
- // Get the only GenerationGUI object
- static GenerationGUI* GetGenerationGUI(GeometryGUI* parent);
-
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
-
-private:
- static GenerationGUI* myGUIObject; // the only GenerationGUI object
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SalomeApp_Study.h"
#include "LightApp_SelectionMgr.h"
-GroupGUI* GroupGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetGroupGUI()
-// purpose : Get the only GroupGUI object [ static ]
-//=======================================================================
-GroupGUI* GroupGUI::GetGroupGUI(GeometryGUI* parent)
-{
- if ( myGUIObject == 0 )
- myGUIObject = new GroupGUI(parent);
-
- return myGUIObject;
-}
-
//=======================================================================
// function : GroupGUI()
// purpose : Constructor
//=======================================================================
bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return false;
+
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
- SUIT_Application* suitApp = SUIT_Session::session()->activeApplication();
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(suitApp->activeStudy());
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
if ( !appStudy ) return false;
_PTR(Study) aStudy = appStudy->studyDS();
SALOME_ListIO aList;
aList.Clear();
- SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(suitApp);
- if (app) {
- LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
- if (aSelMgr)
- aSelMgr->selectedObjects(aList);
- }
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
+ if (aSelMgr)
+ aSelMgr->selectedObjects(aList);
if (aList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
break;
}
default:
- suitApp->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
#endif
GEOMGUI* GetLibGUI(GeometryGUI* p)
{
- return GroupGUI::GetGroupGUI(p);
+ return new GroupGUI(p);
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GroupGUI.h
// Author : Sergey ANIKIN
// Module : GEOM
-// $Header$
#ifndef GROUPGUI_H
#define GROUPGUI_H
{
Q_OBJECT
-protected:
- GroupGUI(GeometryGUI* parent); // hide constructor to avoid direct creation
-
-public :
+public:
+ GroupGUI(GeometryGUI* parent);
~GroupGUI();
- // Get the only GroupGUI object
- static GroupGUI* GetGroupGUI(GeometryGUI* parent);
-
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
-
-private:
- static GroupGUI* myGUIObject; // the only GroupGUI object
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Session.h"
#include "SalomeApp_Tools.h"
+#include "SalomeApp_Application.h"
#include "MeasureGUI_PropertiesDlg.h" // Method PROPERTIES
#include "MeasureGUI_CenterMassDlg.h" // Method CENTER MASS
#include "MeasureGUI_CheckCompoundOfBlocksDlg.h" // Method CHECKCOMPOUND
#include "MeasureGUI_PointDlg.h" // Method POINTCOORDINATES
-MeasureGUI* MeasureGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetMeasureGUI()
-// purpose : Get the only MeasureGUI object [ static ]
-//=======================================================================
-MeasureGUI* MeasureGUI::GetMeasureGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 ) {
- // init MeasureGUI only once
- myGUIObject = new MeasureGUI( parent );
- }
- return myGUIObject;
-}
-
//=======================================================================
// function : MeasureGUI()
// purpose : Constructor
{
}
-
//=======================================================================
// function : ~MeasureGUI()
// purpose : Destructor
//=======================================================================
bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{
- MeasureGUI* myMeasureGUI = GetMeasureGUI( getGeometryGUI() );
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return false;
+
getGeometryGUI()->EmitSignalDeactivateDialog();
switch ( theCommandID )
case 708 : new MeasureGUI_PointDlg (getGeometryGUI(), parent); break; // POINT COORDINATES
default:
- SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
+ app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
break;
}
return true;
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return MeasureGUI::GetMeasureGUI( parent );
+ return new MeasureGUI( parent );
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : MeasureGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef MEASUREGUI_H
#define MEASUREGUI_H
//=================================================================================
class MeasureGUI : public GEOMGUI
{
-protected:
- MeasureGUI( GeometryGUI* parent );
+public:
+ MeasureGUI( GeometryGUI* parent );
+ ~MeasureGUI();
-public :
- ~MeasureGUI();
- static MeasureGUI* GetMeasureGUI( GeometryGUI* parent );
- bool OnGUIEvent( int , SUIT_Desktop* );
-
-private:
- static MeasureGUI* myGUIObject;
+ bool OnGUIEvent( int , SUIT_Desktop* );
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
using namespace std;
-OperationGUI* OperationGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetOperationGUI()
-// purpose : Get the only OperationGUI object [ static ]
-//=======================================================================
-OperationGUI* OperationGUI::GetOperationGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 ) {
- // init OperationGUI only once
- myGUIObject = new OperationGUI( parent );
- }
- return myGUIObject;
-}
-
//=======================================================================
// function : OperationGUI()
// purpose : Constructor
{
}
-
//=======================================================================
// function : ~OperationGUI()
// purpose : Destructor
//=======================================================================
bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if (!app) return false;
+
getGeometryGUI()->EmitSignalDeactivateDialog();
switch (theCommandID)
case 506: (new OperationGUI_ChamferDlg (getGeometryGUI(), parent))->show(); break;
case 507: (new OperationGUI_ClippingDlg (getGeometryGUI(), parent))->show(); break;
default:
- getGeometryGUI()->getApp()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
}
return true;
#endif
GEOMGUI* GetLibGUI(GeometryGUI* parent)
{
- return OperationGUI::GetOperationGUI(parent);
+ return new OperationGUI(parent);
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : OperationGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef OPERATIONGUI_H
#define OPERATIONGUI_H
//=================================================================================
class OperationGUI : public GEOMGUI
{
-protected:
- OperationGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
public :
+ OperationGUI( GeometryGUI* parent );
~OperationGUI();
- // Get the only OperationGUI object
- static OperationGUI* GetOperationGUI( GeometryGUI* parent );
-
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
-
-private:
- static OperationGUI* myGUIObject; // the only OperationGUI object
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
+#include "SalomeApp_Application.h"
+
#include "PrimitiveGUI_BoxDlg.h" // Method BOX
#include "PrimitiveGUI_CylinderDlg.h" // Method CYLINDER
#include "PrimitiveGUI_SphereDlg.h" // Method SPHERE
#include "PrimitiveGUI_TorusDlg.h" // Method TORUS
#include "PrimitiveGUI_ConeDlg.h" // Method CONE
-using namespace std;
-PrimitiveGUI* PrimitiveGUI::myGUIObject = 0;
-//=======================================================================
-// function : GetPrimitiveGUI()
-// purpose : Get the only PrimitiveGUI object [ static ]
-//=======================================================================
-PrimitiveGUI* PrimitiveGUI::GetPrimitiveGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 ) {
- // init PrimitiveGUI only once
- myGUIObject = new PrimitiveGUI( parent );
- }
- return myGUIObject;
-}
+using namespace std;
//=======================================================================
// function : PrimitiveGUI()
{
}
-
//=======================================================================
// function : ~PrimitiveGUI
// purpose : Destructor
//=======================================================================
bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if (!app) return false;
+
getGeometryGUI()->EmitSignalDeactivateDialog();
-
+
QDialog* aDlg = NULL;
switch (theCommandID)
- {
+ {
case 4021: // BOX
- {
aDlg = new PrimitiveGUI_BoxDlg(getGeometryGUI(), parent, "");
break;
- }
case 4022: // CYLINDER
- {
aDlg = new PrimitiveGUI_CylinderDlg(getGeometryGUI(), parent, "");
break;
- }
case 4023: // SPHERE
- {
aDlg = new PrimitiveGUI_SphereDlg(getGeometryGUI(), parent, "");
break;
- }
case 4024: // TORUS
- {
aDlg = new PrimitiveGUI_TorusDlg(getGeometryGUI(), parent, "");
break;
- }
case 4025: // CONE
- {
aDlg = new PrimitiveGUI_ConeDlg(getGeometryGUI(), parent, "");
break;
- }
default:
- {
- SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
- }
}
- if ( aDlg != NULL )
+ if (aDlg != NULL)
aDlg->show();
-
+
return true;
}
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return PrimitiveGUI::GetPrimitiveGUI( parent );
+ return new PrimitiveGUI( parent );
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef PRIMITIVEGUI_H
#define PRIMITIVEGUI_H
//=================================================================================
class PrimitiveGUI : public GEOMGUI
{
-protected:
- PrimitiveGUI(GeometryGUI* parent); // hide constructor to avoid direct creation
-
-public :
+public:
+ PrimitiveGUI(GeometryGUI* parent);
~PrimitiveGUI();
- // Get the only PrimitiveGUI object
- static PrimitiveGUI* GetPrimitiveGUI(GeometryGUI* parent);
-
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
-
-private:
- static PrimitiveGUI* myGUIObject; // the only PrimitiveGUI object
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+
#include "RepairGUI_SewingDlg.h" // Method SEWING
#include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES
#include "RepairGUI_RemoveHolesDlg.h" // Method SUPPRESS HOLE
using namespace std;
-RepairGUI* RepairGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetRepairGUI()
-// purpose : Get the only RepairGUI object [ static ]
-//=======================================================================
-RepairGUI* RepairGUI::GetRepairGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 ) {
- // init RepairGUI only once
- myGUIObject = new RepairGUI( parent );
- }
- return myGUIObject;
-}
-
//=======================================================================
// function : RepairGUI()
// purpose : Constructor
{
}
-
//=======================================================================
// function : ~RepairGUI()
// purpose : Destructor
//=======================================================================
bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if (!app) return false;
+
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
case 609: aDlg = new RepairGUI_FreeBoundDlg (getGeometryGUI(), parent, ""); break;
case 610: aDlg = new RepairGUI_FreeFacesDlg (getGeometryGUI(), parent, ""); break;
default:
- SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return RepairGUI::GetRepairGUI( parent );
+ return new RepairGUI( parent );
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : RepairGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef REPAIRGUI_H
#define REPAIRGUI_H
//=================================================================================
class RepairGUI : public GEOMGUI
{
-protected:
- RepairGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
-public :
+public:
+ RepairGUI( GeometryGUI* parent );
~RepairGUI();
- // Get the only RepairGUI object
- static RepairGUI* GetRepairGUI( GeometryGUI* parent );
-
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
-
-private:
- static RepairGUI* myGUIObject; // the only RepairGUI object
-
};
#endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
+#include "SalomeApp_Application.h"
+
#include "TransformationGUI_MultiTranslationDlg.h" // Method MULTI TRANSLATION
#include "TransformationGUI_MultiRotationDlg.h" // Method MULTI ROTATION
#include "TransformationGUI_TranslationDlg.h" // Method TRANSLATION
using namespace std;
-TransformationGUI* TransformationGUI::myGUIObject = 0;
-
-//=======================================================================
-// function : GetTransformationGUI()
-// purpose : Get the only TransformationGUI object [ static ]
-//=======================================================================
-TransformationGUI* TransformationGUI::GetTransformationGUI( GeometryGUI* parent )
-{
- if ( myGUIObject == 0 ) {
- // init TransformationGUI only once
- myGUIObject = new TransformationGUI( parent );
- }
- return myGUIObject;
-}
-
//=======================================================================
// function : TransformationGUI()
// purpose : Constructor
{
}
-
//=======================================================================
// function : ~TransformationGUI()
// purpose : Destructor
//=======================================================================
bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if (!app) return false;
+
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" );
break;
default:
- SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
+ app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
- if ( aDlg != NULL )
+ if (aDlg != NULL)
aDlg->show();
return true;
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return TransformationGUI::GetTransformationGUI( parent );
+ return new TransformationGUI( parent );
}
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : TransformationGUI.h
// Author : Damien COQUERET
// Module : GEOM
-// $Header$
#ifndef TRANSFORMATIONGUI_H
#define TRANSFORMATIONGUI_H
//=================================================================================
class TransformationGUI : public GEOMGUI
{
-protected:
- TransformationGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
-
-public :
+public:
+ TransformationGUI( GeometryGUI* parent );
~TransformationGUI();
- // Get the only TransformationGUI object
- static TransformationGUI* GetTransformationGUI( GeometryGUI* parent );
-
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
-
-private:
- static TransformationGUI* myGUIObject; // the only TransformationGUI object
};
#endif