PAL12607: Static objects in Geometry GUI libraries.

This commit is contained in:
jfa 2006-06-14 09:50:02 +00:00
parent 6e638ed221
commit c2ae4af70b
26 changed files with 224 additions and 480 deletions

View File

@ -57,15 +57,6 @@
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
@ -146,37 +137,40 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
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();
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() );
}
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()
aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog
} // acceptMouseEvent()
}
return false;
}
@ -218,6 +212,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return BasicGUI::GetBasicGUI( parent );
return new BasicGUI( parent );
}
}

View File

@ -44,15 +44,10 @@
//=================================================================================
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);

View File

@ -41,20 +41,6 @@
#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
@ -110,6 +96,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return BlocksGUI::GetBlocksGUI( parent );
return new BlocksGUI( parent );
}
}

View File

@ -23,7 +23,6 @@
// File : BuildGUI.h
// Author : Julia DOROVSKIKH
// Module : GEOM
// $Header$
#ifndef BLOCKSGUI_H
#define BLOCKSGUI_H
@ -36,19 +35,11 @@
//=================================================================================
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -36,21 +36,6 @@
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
@ -59,7 +44,6 @@ BooleanGUI::BooleanGUI( GeometryGUI* parent ) : GEOMGUI( parent )
{
}
//=======================================================================
// function : ~BooleanGUI()
// purpose : Destructor
@ -105,6 +89,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return BooleanGUI::GetBooleanGUI( parent );
return new BooleanGUI( parent );
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -37,21 +36,13 @@
//=================================================================================
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -31,6 +31,8 @@
#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
@ -40,20 +42,6 @@
#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
@ -63,7 +51,6 @@ BuildGUI::BuildGUI( GeometryGUI* parent )
{
}
//=======================================================================
// function : ~BuildGUI()
// purpose : Destructor
@ -93,7 +80,7 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
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;
}
@ -113,6 +100,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return BuildGUI::GetBuildGUI( parent );
return new BuildGUI( parent );
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -37,19 +36,11 @@
//=================================================================================
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -59,21 +59,6 @@
#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
@ -82,7 +67,6 @@ DisplayGUI::DisplayGUI( GeometryGUI* parent ) : GEOMGUI( parent )
{
}
//=======================================================================
// function : DisplayGUI::~DisplayGUI()
// purpose : Destructor
@ -98,63 +82,64 @@ DisplayGUI::~DisplayGUI()
//=======================================================================
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;
}
}
@ -168,7 +153,10 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
//=====================================================================================
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;
@ -186,7 +174,9 @@ void DisplayGUI::DisplayAll()
_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();
}
@ -201,7 +191,7 @@ void DisplayGUI::EraseAll()
{
SUIT_OverrideCursor();
SUIT_Application* app = SUIT_Session::session()->activeApplication();
SUIT_Application* app = getGeometryGUI()->getApp();
if ( app ) {
SUIT_ViewWindow* vw = app->desktop()->activeWindow();
if ( vw ) {
@ -233,7 +223,7 @@ 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() );
@ -253,7 +243,7 @@ void DisplayGUI::Display()
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();
@ -263,7 +253,9 @@ void DisplayGUI::Display()
_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();
}
@ -289,7 +281,7 @@ void DisplayGUI::Erase()
{
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() );
@ -305,11 +297,11 @@ void DisplayGUI::Erase()
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();
@ -319,7 +311,9 @@ void DisplayGUI::Erase()
_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();
}
@ -334,7 +328,7 @@ void DisplayGUI::Erase()
}
}
GEOM_Displayer(anActiveStudy).Erase( listIO, true );
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->clearSelected();
getGeometryGUI()->getApp()->selectionMgr()->clearSelected();
}
//=====================================================================================
@ -346,7 +340,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
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 );
@ -382,7 +376,7 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow )
{
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();
@ -413,12 +407,12 @@ void DisplayGUI::InvertDisplayMode( SUIT_ViewWindow* viewWindow )
//=====================================================================================
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;
@ -435,7 +429,8 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
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() );
@ -480,6 +475,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return DisplayGUI::GetDisplayGUI( parent );
return new DisplayGUI( parent );
}
}

View File

@ -17,30 +17,26 @@
// 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 :
@ -49,15 +45,10 @@
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);
@ -84,9 +75,6 @@ public :
// 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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -37,6 +37,7 @@
#include "OCCViewer_ViewManager.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Tools.h"
#include "SalomeApp_Application.h"
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
@ -50,15 +51,6 @@
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
@ -84,6 +76,9 @@ EntityGUI::~EntityGUI()
//=======================================================================
bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
@ -97,7 +92,7 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
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 )
@ -113,8 +108,10 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
//=====================================================================================
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;
@ -160,13 +157,16 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap
//==================================================================================
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() ) {
@ -188,9 +188,11 @@ void EntityGUI::EraseSimulationShape()
//=====================================================================================
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;
@ -224,6 +226,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return EntityGUI::GetEntityGUI( parent );
return new EntityGUI( parent );
}
}

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -41,15 +41,10 @@
//=================================================================================
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);

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -31,6 +31,8 @@
#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
@ -38,20 +40,6 @@
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
@ -60,7 +48,6 @@ GenerationGUI::GenerationGUI(GeometryGUI* parent) : GEOMGUI(parent)
{
}
//=======================================================================
// function : ~GenerationGUI()
// purpose : Destructor
@ -76,21 +63,24 @@ GenerationGUI::~GenerationGUI()
//=======================================================================
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;
@ -107,6 +97,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI(GeometryGUI* parent)
{
return GenerationGUI::GetGenerationGUI(parent);
return new GenerationGUI(parent);
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -37,19 +36,11 @@
//=================================================================================
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -38,20 +38,6 @@
#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
@ -76,12 +62,14 @@ GroupGUI::~GroupGUI()
//=======================================================================
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();
@ -103,12 +91,9 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
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;
@ -124,7 +109,7 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
break;
}
default:
suitApp->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
@ -144,6 +129,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI(GeometryGUI* p)
{
return GroupGUI::GetGroupGUI(p);
return new GroupGUI(p);
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -39,19 +38,11 @@ class GroupGUI : public GEOMGUI
{
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -31,6 +31,7 @@
#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
@ -43,21 +44,6 @@
#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
@ -66,7 +52,6 @@ MeasureGUI::MeasureGUI( GeometryGUI* parent ) : GEOMGUI( parent )
{
}
//=======================================================================
// function : ~MeasureGUI()
// purpose : Destructor
@ -82,7 +67,9 @@ MeasureGUI::~MeasureGUI()
//=======================================================================
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 )
@ -99,7 +86,7 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
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;
@ -116,6 +103,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return MeasureGUI::GetMeasureGUI( parent );
return new MeasureGUI( parent );
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -37,16 +36,11 @@
//=================================================================================
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -45,21 +45,6 @@
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
@ -68,7 +53,6 @@ OperationGUI::OperationGUI(GeometryGUI* parent) : GEOMGUI(parent)
{
}
//=======================================================================
// function : ~OperationGUI()
// purpose : Destructor
@ -84,6 +68,9 @@ OperationGUI::~OperationGUI()
//=======================================================================
bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if (!app) return false;
getGeometryGUI()->EmitSignalDeactivateDialog();
switch (theCommandID)
@ -94,7 +81,7 @@ bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
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;
@ -110,6 +97,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI(GeometryGUI* parent)
{
return OperationGUI::GetOperationGUI(parent);
return new OperationGUI(parent);
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -38,19 +37,11 @@
//=================================================================================
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -33,26 +33,15 @@
#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()
@ -62,7 +51,6 @@ PrimitiveGUI::PrimitiveGUI(GeometryGUI* parent) : GEOMGUI(parent)
{
}
//=======================================================================
// function : ~PrimitiveGUI
// purpose : Destructor
@ -78,45 +66,36 @@ PrimitiveGUI::~PrimitiveGUI()
//=======================================================================
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;
@ -133,6 +112,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return PrimitiveGUI::GetPrimitiveGUI( parent );
return new PrimitiveGUI( parent );
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -38,19 +37,11 @@
//=================================================================================
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -31,6 +31,8 @@
#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
@ -46,21 +48,6 @@
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
@ -69,7 +56,6 @@ RepairGUI::RepairGUI( GeometryGUI* parent ) : GEOMGUI( parent )
{
}
//=======================================================================
// function : ~RepairGUI()
// purpose : Destructor
@ -85,6 +71,9 @@ RepairGUI::~RepairGUI()
//=======================================================================
bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if (!app) return false;
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
@ -100,7 +89,7 @@ bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
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;
}
@ -121,6 +110,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return RepairGUI::GetRepairGUI( parent );
return new RepairGUI( parent );
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -38,20 +37,11 @@
//=================================================================================
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

View File

@ -17,7 +17,7 @@
// 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
//
//
//
@ -32,6 +32,8 @@
#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
@ -43,21 +45,6 @@
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
@ -66,7 +53,6 @@ TransformationGUI::TransformationGUI(GeometryGUI* parent) : GEOMGUI(parent)
{
}
//=======================================================================
// function : ~TransformationGUI()
// purpose : Destructor
@ -82,6 +68,9 @@ TransformationGUI::~TransformationGUI()
//=======================================================================
bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if (!app) return false;
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
@ -112,11 +101,11 @@ bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
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;
@ -133,6 +122,6 @@ extern "C"
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return TransformationGUI::GetTransformationGUI( parent );
return new TransformationGUI( parent );
}
}

View File

@ -17,14 +17,13 @@
// 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
@ -38,19 +37,11 @@
//=================================================================================
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