mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-15 21:21:22 +05:00
PAL12607: Static objects in Geometry GUI libraries.
This commit is contained in:
parent
6e638ed221
commit
c2ae4af70b
@ -57,15 +57,6 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : GetBasicGUI()
|
|
||||||
// purpose : Get the only BasicGUI object [ static ]
|
|
||||||
//=======================================================================
|
|
||||||
BasicGUI* BasicGUI::GetBasicGUI( GeometryGUI* parent )
|
|
||||||
{
|
|
||||||
return new BasicGUI( parent );
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : BasicGUI()
|
// function : BasicGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -146,12 +137,15 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
|
|||||||
QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
|
QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
|
||||||
|
|
||||||
// Create Point dialog, OCC viewer
|
// 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;
|
BasicGUI_PointDlg* aPntDlg = (BasicGUI_PointDlg*) aDlg;
|
||||||
if ( aPntDlg->acceptMouseEvent() )
|
if ( aPntDlg->acceptMouseEvent() )
|
||||||
{
|
{
|
||||||
OCCViewer_Viewer* anOCCViewer = ((OCCViewer_ViewManager*)(theViewWindow->getViewManager()))->getOCCViewer();
|
OCCViewer_Viewer* anOCCViewer =
|
||||||
|
((OCCViewer_ViewManager*)(theViewWindow->getViewManager()))->getOCCViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
|
Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
|
||||||
|
|
||||||
gp_Pnt aPnt;
|
gp_Pnt aPnt;
|
||||||
@ -218,6 +212,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return BasicGUI::GetBasicGUI( parent );
|
return new BasicGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,15 +44,10 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class BasicGUI : public GEOMGUI
|
class BasicGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
BasicGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
BasicGUI( GeometryGUI* parent );
|
||||||
~BasicGUI();
|
~BasicGUI();
|
||||||
|
|
||||||
// Get the only BasicGUI object
|
|
||||||
static BasicGUI* GetBasicGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
||||||
bool OnMousePress(QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow);
|
bool OnMousePress(QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow);
|
||||||
|
|
||||||
|
@ -41,20 +41,6 @@
|
|||||||
|
|
||||||
#include "SalomeApp_Application.h"
|
#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()
|
// function : BlocksGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -110,6 +96,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return BlocksGUI::GetBlocksGUI( parent );
|
return new BlocksGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
// File : BuildGUI.h
|
// File : BuildGUI.h
|
||||||
// Author : Julia DOROVSKIKH
|
// Author : Julia DOROVSKIKH
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef BLOCKSGUI_H
|
#ifndef BLOCKSGUI_H
|
||||||
#define BLOCKSGUI_H
|
#define BLOCKSGUI_H
|
||||||
@ -36,19 +35,11 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class BlocksGUI : public GEOMGUI
|
class BlocksGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
BlocksGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
BlocksGUI( GeometryGUI* parent );
|
||||||
~BlocksGUI();
|
~BlocksGUI();
|
||||||
|
|
||||||
// Get the only BuildGUI object
|
|
||||||
static BlocksGUI* GetBlocksGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
bool OnGUIEvent (int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent (int theCommandID, SUIT_Desktop* parent);
|
||||||
|
|
||||||
private:
|
|
||||||
static BlocksGUI* myGUIObject; // the only BlocksGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,21 +36,6 @@
|
|||||||
|
|
||||||
using namespace std;
|
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()
|
// function : BooleanGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -59,7 +44,6 @@ BooleanGUI::BooleanGUI( GeometryGUI* parent ) : GEOMGUI( parent )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ~BooleanGUI()
|
// function : ~BooleanGUI()
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -105,6 +89,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return BooleanGUI::GetBooleanGUI( parent );
|
return new BooleanGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : BooleanGUI.h
|
// File : BooleanGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef BOOLEANGUI_H
|
#ifndef BOOLEANGUI_H
|
||||||
#define BOOLEANGUI_H
|
#define BOOLEANGUI_H
|
||||||
@ -37,21 +36,13 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class BooleanGUI : public GEOMGUI
|
class BooleanGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
BooleanGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum BooleanOperation { COMMON = 1, CUT = 2, FUSE = 3, SECTION = 4 };
|
enum BooleanOperation { COMMON = 1, CUT = 2, FUSE = 3, SECTION = 4 };
|
||||||
|
|
||||||
|
BooleanGUI( GeometryGUI* parent );
|
||||||
~BooleanGUI();
|
~BooleanGUI();
|
||||||
|
|
||||||
// Get the only BooleanGUI object
|
|
||||||
static BooleanGUI* GetBooleanGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
||||||
|
|
||||||
private:
|
|
||||||
static BooleanGUI* myGUIObject; // the only BooleanGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include "SUIT_Desktop.h"
|
#include "SUIT_Desktop.h"
|
||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
|
|
||||||
|
#include "SalomeApp_Application.h"
|
||||||
|
|
||||||
#include "BuildGUI_EdgeDlg.h" // Method EDGE
|
#include "BuildGUI_EdgeDlg.h" // Method EDGE
|
||||||
#include "BuildGUI_WireDlg.h" // Method WIRE
|
#include "BuildGUI_WireDlg.h" // Method WIRE
|
||||||
#include "BuildGUI_FaceDlg.h" // Method FACE
|
#include "BuildGUI_FaceDlg.h" // Method FACE
|
||||||
@ -40,20 +42,6 @@
|
|||||||
|
|
||||||
#include "GeometryGUI.h"
|
#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()
|
// function : BuildGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -63,7 +51,6 @@ BuildGUI::BuildGUI( GeometryGUI* parent )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ~BuildGUI()
|
// function : ~BuildGUI()
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -93,7 +80,7 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break;
|
case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
|
getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,6 +100,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return BuildGUI::GetBuildGUI( parent );
|
return new BuildGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : BuildGUI.h
|
// File : BuildGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef BUILDGUI_H
|
#ifndef BUILDGUI_H
|
||||||
#define BUILDGUI_H
|
#define BUILDGUI_H
|
||||||
@ -37,19 +36,11 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class BuildGUI : public GEOMGUI
|
class BuildGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
BuildGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
BuildGUI( GeometryGUI* parent );
|
||||||
~BuildGUI();
|
~BuildGUI();
|
||||||
|
|
||||||
// Get the only BuildGUI object
|
|
||||||
static BuildGUI* GetBuildGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
||||||
|
|
||||||
private:
|
|
||||||
static BuildGUI* myGUIObject; // the only BuildGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -59,21 +59,6 @@
|
|||||||
#include <qmenubar.h>
|
#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()
|
// function : DisplayGUI::DisplayGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -82,7 +67,6 @@ DisplayGUI::DisplayGUI( GeometryGUI* parent ) : GEOMGUI( parent )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : DisplayGUI::~DisplayGUI()
|
// function : DisplayGUI::~DisplayGUI()
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -98,63 +82,64 @@ DisplayGUI::~DisplayGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||||
{
|
{
|
||||||
DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() );
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
LightApp_SelectionMgr *Sel = getGeometryGUI()->getApp()->selectionMgr();
|
if (!app) return false;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr *Sel = app->selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
Sel->selectedObjects( selected );
|
Sel->selectedObjects( selected );
|
||||||
|
|
||||||
switch (theCommandID) {
|
switch (theCommandID) {
|
||||||
case 211: // MENU VIEW - WIREFRAME/SHADING
|
case 211: // MENU VIEW - WIREFRAME/SHADING
|
||||||
{
|
{
|
||||||
myDisplayGUI->InvertDisplayMode();
|
InvertDisplayMode();
|
||||||
int newMode = myDisplayGUI->GetDisplayMode();
|
int newMode = GetDisplayMode();
|
||||||
getGeometryGUI()->action( 211 )->setMenuText( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
|
getGeometryGUI()->action( 211 )->setMenuText
|
||||||
|
( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
|
||||||
getGeometryGUI()->menuMgr()->update();
|
getGeometryGUI()->menuMgr()->update();
|
||||||
// SUIT_Session::session()->activeApplication()->desktop()->menuBar()->
|
|
||||||
// changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 212: // MENU VIEW - DISPLAY ALL
|
case 212: // MENU VIEW - DISPLAY ALL
|
||||||
{
|
{
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
myDisplayGUI->DisplayAll();
|
DisplayAll();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 213: // MENU VIEW - DISPLAY ONLY
|
case 213: // MENU VIEW - DISPLAY ONLY
|
||||||
{
|
{
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
myDisplayGUI->DisplayOnly();
|
DisplayOnly();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 214: // MENU VIEW - ERASE ALL
|
case 214: // MENU VIEW - ERASE ALL
|
||||||
{
|
{
|
||||||
myDisplayGUI->EraseAll();
|
EraseAll();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 215: // MENU VIEW - ERASE
|
case 215: // MENU VIEW - ERASE
|
||||||
{
|
{
|
||||||
myDisplayGUI->Erase();
|
Erase();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 216: // MENU VIEW - DISPLAY
|
case 216: // MENU VIEW - DISPLAY
|
||||||
{
|
{
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
myDisplayGUI->Display();
|
Display();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 80311: // POPUP VIEWER - WIREFRAME
|
case 80311: // POPUP VIEWER - WIREFRAME
|
||||||
{
|
{
|
||||||
myDisplayGUI->ChangeDisplayMode( 0 );
|
ChangeDisplayMode( 0 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 80312: // POPUP VIEWER - SHADING
|
case 80312: // POPUP VIEWER - SHADING
|
||||||
{
|
{
|
||||||
myDisplayGUI->ChangeDisplayMode( 1 );
|
ChangeDisplayMode( 1 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,7 +153,10 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
void DisplayGUI::DisplayAll()
|
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;
|
if ( !appStudy ) return;
|
||||||
_PTR(Study) aStudy = appStudy->studyDS();
|
_PTR(Study) aStudy = appStudy->studyDS();
|
||||||
if ( !aStudy ) return;
|
if ( !aStudy ) return;
|
||||||
@ -186,7 +174,9 @@ void DisplayGUI::DisplayAll()
|
|||||||
_PTR(SObject) valSO ( anIter->Value() );
|
_PTR(SObject) valSO ( anIter->Value() );
|
||||||
_PTR(SObject) refSO;
|
_PTR(SObject) refSO;
|
||||||
if ( !valSO->ReferencedObject( 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();
|
anIter->Next();
|
||||||
}
|
}
|
||||||
@ -201,7 +191,7 @@ void DisplayGUI::EraseAll()
|
|||||||
{
|
{
|
||||||
SUIT_OverrideCursor();
|
SUIT_OverrideCursor();
|
||||||
|
|
||||||
SUIT_Application* app = SUIT_Session::session()->activeApplication();
|
SUIT_Application* app = getGeometryGUI()->getApp();
|
||||||
if ( app ) {
|
if ( app ) {
|
||||||
SUIT_ViewWindow* vw = app->desktop()->activeWindow();
|
SUIT_ViewWindow* vw = app->desktop()->activeWindow();
|
||||||
if ( vw ) {
|
if ( vw ) {
|
||||||
@ -233,7 +223,7 @@ void DisplayGUI::Display()
|
|||||||
{
|
{
|
||||||
SALOME_ListIO listIO;
|
SALOME_ListIO listIO;
|
||||||
|
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
if ( !app ) return;
|
if ( !app ) return;
|
||||||
|
|
||||||
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
@ -263,7 +253,9 @@ void DisplayGUI::Display()
|
|||||||
_PTR(SObject) valSO ( anIter->Value() );
|
_PTR(SObject) valSO ( anIter->Value() );
|
||||||
_PTR(SObject) refSO;
|
_PTR(SObject) refSO;
|
||||||
if ( !valSO->ReferencedObject( 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();
|
anIter->Next();
|
||||||
}
|
}
|
||||||
@ -289,7 +281,7 @@ void DisplayGUI::Erase()
|
|||||||
{
|
{
|
||||||
SALOME_ListIO listIO;
|
SALOME_ListIO listIO;
|
||||||
|
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
if ( !app ) return;
|
if ( !app ) return;
|
||||||
|
|
||||||
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
@ -319,7 +311,9 @@ void DisplayGUI::Erase()
|
|||||||
_PTR(SObject) valSO ( anIter->Value() );
|
_PTR(SObject) valSO ( anIter->Value() );
|
||||||
_PTR(SObject) refSO;
|
_PTR(SObject) refSO;
|
||||||
if ( !valSO->ReferencedObject( 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();
|
anIter->Next();
|
||||||
}
|
}
|
||||||
@ -334,7 +328,7 @@ void DisplayGUI::Erase()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
GEOM_Displayer(anActiveStudy).Erase( listIO, true );
|
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();
|
SUIT_OverrideCursor();
|
||||||
|
|
||||||
if ( !viewWindow )
|
if ( !viewWindow )
|
||||||
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
|
||||||
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
|
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
|
||||||
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
|
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
|
||||||
aView->SetDisplayMode( mode );
|
aView->SetDisplayMode( mode );
|
||||||
@ -382,7 +376,7 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow )
|
|||||||
{
|
{
|
||||||
int dispMode = 0;
|
int dispMode = 0;
|
||||||
if ( !viewWindow )
|
if ( !viewWindow )
|
||||||
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
|
||||||
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
|
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
|
||||||
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
|
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
|
||||||
dispMode = aView->GetDisplayMode();
|
dispMode = aView->GetDisplayMode();
|
||||||
@ -413,12 +407,12 @@ void DisplayGUI::InvertDisplayMode( SUIT_ViewWindow* viewWindow )
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
|
void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
|
||||||
{
|
{
|
||||||
if ( !viewWindow )
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
|
||||||
|
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
|
||||||
if ( !app ) return;
|
if ( !app ) return;
|
||||||
|
|
||||||
|
if ( !viewWindow )
|
||||||
|
viewWindow = app->desktop()->activeWindow();
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
if ( !aSelMgr ) return;
|
if ( !aSelMgr ) return;
|
||||||
|
|
||||||
@ -435,7 +429,8 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
|
|||||||
|
|
||||||
for( ;It.More(); It.Next() ) {
|
for( ;It.More(); It.Next() ) {
|
||||||
SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel());
|
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 ( vtkPrs && !vtkPrs->IsNull() ) {
|
||||||
if ( mode == 0 )
|
if ( mode == 0 )
|
||||||
aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
|
aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
|
||||||
@ -480,6 +475,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return DisplayGUI::GetDisplayGUI( parent );
|
return new DisplayGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,23 +24,19 @@
|
|||||||
// File : DisplayGUI.h
|
// File : DisplayGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef DISPLAYGUI_H
|
#ifndef DISPLAYGUI_H
|
||||||
#define DISPLAYGUI_H
|
#define DISPLAYGUI_H
|
||||||
|
|
||||||
#include "GEOMGUI.h"
|
#include "GEOMGUI.h"
|
||||||
#include "GEOMBase.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
|
#if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS
|
||||||
#define DISPLAYGUI_WNT_EXPORT __declspec( dllexport )
|
#define DISPLAYGUI_WNT_EXPORT __declspec( dllexport )
|
||||||
#else
|
#else
|
||||||
#define DISPLAYGUI_WNT_EXPORT
|
#define DISPLAYGUI_WNT_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GEOMBase_Display
|
// class : GEOMBase_Display
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -49,15 +45,10 @@
|
|||||||
class SUIT_ViewWindow;
|
class SUIT_ViewWindow;
|
||||||
class DisplayGUI : public GEOMGUI
|
class DisplayGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
DisplayGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
DisplayGUI( GeometryGUI* parent );
|
||||||
~DisplayGUI();
|
~DisplayGUI();
|
||||||
|
|
||||||
// Get the only DisplayGUI object
|
|
||||||
static DisplayGUI* GetDisplayGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
// Dispatch menu command
|
// Dispatch menu command
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
||||||
|
|
||||||
@ -84,9 +75,6 @@ public :
|
|||||||
// Set display mode for selected objects in the viewer given
|
// Set display mode for selected objects in the viewer given
|
||||||
// (current viewer if <viewWindow> = 0 )
|
// (current viewer if <viewWindow> = 0 )
|
||||||
void ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindo = 0 );
|
void ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindo = 0 );
|
||||||
|
|
||||||
private:
|
|
||||||
static DisplayGUI* myGUIObject; // the only DisplayGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "OCCViewer_ViewManager.h"
|
#include "OCCViewer_ViewManager.h"
|
||||||
#include "SalomeApp_Study.h"
|
#include "SalomeApp_Study.h"
|
||||||
#include "SalomeApp_Tools.h"
|
#include "SalomeApp_Tools.h"
|
||||||
|
#include "SalomeApp_Application.h"
|
||||||
|
|
||||||
#include <TopoDS_Compound.hxx>
|
#include <TopoDS_Compound.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
@ -50,15 +51,6 @@
|
|||||||
using namespace boost;
|
using namespace boost;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : GetEntityGUI()
|
|
||||||
// purpose : Get the only EntityGUI object [ static ]
|
|
||||||
//=======================================================================
|
|
||||||
EntityGUI* EntityGUI::GetEntityGUI( GeometryGUI* parent )
|
|
||||||
{
|
|
||||||
return new EntityGUI( parent );
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : EntityGUI()
|
// function : EntityGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -84,6 +76,9 @@ EntityGUI::~EntityGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||||
{
|
{
|
||||||
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if ( !app ) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
QDialog* aDlg = NULL;
|
QDialog* aDlg = NULL;
|
||||||
|
|
||||||
@ -97,7 +92,7 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
|||||||
aDlg = new EntityGUI_SubShapeDlg(getGeometryGUI(), parent, "");
|
aDlg = new EntityGUI_SubShapeDlg(getGeometryGUI(), parent, "");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( aDlg )
|
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)
|
void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
|
||||||
{
|
{
|
||||||
SUIT_ViewManager* aVM =
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager();
|
if ( !app ) return;
|
||||||
|
|
||||||
|
SUIT_ViewManager* aVM = app->desktop()->activeWindow()->getViewManager();
|
||||||
if (aVM->getType() != OCCViewer_Viewer::Type())
|
if (aVM->getType() != OCCViewer_Viewer::Type())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -160,13 +157,16 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap
|
|||||||
//==================================================================================
|
//==================================================================================
|
||||||
void EntityGUI::EraseSimulationShape()
|
void EntityGUI::EraseSimulationShape()
|
||||||
{
|
{
|
||||||
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if ( !app ) return;
|
||||||
|
|
||||||
// get all view windows at the desktop
|
// 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
|
//get all view windows, which belong to the active study
|
||||||
QPtrList<SUIT_ViewWindow> aWndLstAS;
|
QPtrList<SUIT_ViewWindow> aWndLstAS;
|
||||||
SUIT_ViewWindow* vw;
|
SUIT_ViewWindow* vw;
|
||||||
for ( vw = aWndLst.first(); vw; vw = aWndLst.next() )
|
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 );
|
aWndLstAS.append( vw );
|
||||||
|
|
||||||
for ( vw = aWndLstAS.first(); vw; vw = aWndLstAS.next() ) {
|
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)
|
bool EntityGUI::SObjectExist(const _PTR(SObject)& theFatherObject, const char* IOR)
|
||||||
{
|
{
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
( SUIT_Session::session()->activeApplication()->activeStudy() );
|
if ( !app ) return false;
|
||||||
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
if ( !appStudy ) return false;
|
if ( !appStudy ) return false;
|
||||||
|
|
||||||
_PTR(Study) aStudy = appStudy->studyDS();
|
_PTR(Study) aStudy = appStudy->studyDS();
|
||||||
_PTR(ChildIterator) it ( aStudy->NewChildIterator(theFatherObject) );
|
_PTR(ChildIterator) it ( aStudy->NewChildIterator(theFatherObject) );
|
||||||
_PTR(SObject) RefSO;
|
_PTR(SObject) RefSO;
|
||||||
@ -224,6 +226,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return EntityGUI::GetEntityGUI( parent );
|
return new EntityGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,15 +41,10 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class EntityGUI : public GEOMGUI
|
class EntityGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
EntityGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
||||||
~EntityGUI();
|
~EntityGUI();
|
||||||
|
|
||||||
// Get the only EntityGUI object
|
|
||||||
static EntityGUI* GetEntityGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
||||||
|
|
||||||
void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
|
void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
#include "SUIT_Desktop.h"
|
#include "SUIT_Desktop.h"
|
||||||
|
|
||||||
|
#include "SalomeApp_Application.h"
|
||||||
|
|
||||||
#include "GenerationGUI_PrismDlg.h" // Method PRISM
|
#include "GenerationGUI_PrismDlg.h" // Method PRISM
|
||||||
#include "GenerationGUI_RevolDlg.h" // Method REVOL
|
#include "GenerationGUI_RevolDlg.h" // Method REVOL
|
||||||
#include "GenerationGUI_FillingDlg.h" // Method FILLING
|
#include "GenerationGUI_FillingDlg.h" // Method FILLING
|
||||||
@ -38,20 +40,6 @@
|
|||||||
|
|
||||||
using namespace std;
|
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()
|
// function : GenerationGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -60,7 +48,6 @@ GenerationGUI::GenerationGUI(GeometryGUI* parent) : GEOMGUI(parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ~GenerationGUI()
|
// function : ~GenerationGUI()
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -76,6 +63,9 @@ GenerationGUI::~GenerationGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
||||||
{
|
{
|
||||||
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if ( !app ) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
QDialog* aDlg = NULL;
|
QDialog* aDlg = NULL;
|
||||||
@ -87,7 +77,7 @@ bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent, ""); break;
|
case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent, ""); break;
|
||||||
case 4034: aDlg = new GenerationGUI_PipeDlg ( 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)
|
||||||
@ -107,6 +97,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI(GeometryGUI* parent)
|
GEOMGUI* GetLibGUI(GeometryGUI* parent)
|
||||||
{
|
{
|
||||||
return GenerationGUI::GetGenerationGUI(parent);
|
return new GenerationGUI(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : GenerationGUI.h
|
// File : GenerationGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef GENERATIONGUI_H
|
#ifndef GENERATIONGUI_H
|
||||||
#define GENERATIONGUI_H
|
#define GENERATIONGUI_H
|
||||||
@ -37,19 +36,11 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class GenerationGUI : public GEOMGUI
|
class GenerationGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
GenerationGUI(GeometryGUI* parent); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
GenerationGUI(GeometryGUI* parent);
|
||||||
~GenerationGUI();
|
~GenerationGUI();
|
||||||
|
|
||||||
// Get the only GenerationGUI object
|
|
||||||
static GenerationGUI* GetGenerationGUI(GeometryGUI* parent);
|
|
||||||
|
|
||||||
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
||||||
|
|
||||||
private:
|
|
||||||
static GenerationGUI* myGUIObject; // the only GenerationGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -38,20 +38,6 @@
|
|||||||
#include "SalomeApp_Study.h"
|
#include "SalomeApp_Study.h"
|
||||||
#include "LightApp_SelectionMgr.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()
|
// function : GroupGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -76,12 +62,14 @@ GroupGUI::~GroupGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
||||||
{
|
{
|
||||||
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if ( !app ) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
QDialog* aDlg = NULL;
|
QDialog* aDlg = NULL;
|
||||||
|
|
||||||
SUIT_Application* suitApp = SUIT_Session::session()->activeApplication();
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(suitApp->activeStudy());
|
|
||||||
if ( !appStudy ) return false;
|
if ( !appStudy ) return false;
|
||||||
_PTR(Study) aStudy = appStudy->studyDS();
|
_PTR(Study) aStudy = appStudy->studyDS();
|
||||||
|
|
||||||
@ -103,12 +91,9 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
aList.Clear();
|
aList.Clear();
|
||||||
|
|
||||||
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(suitApp);
|
|
||||||
if (app) {
|
|
||||||
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
if (aSelMgr)
|
if (aSelMgr)
|
||||||
aSelMgr->selectedObjects(aList);
|
aSelMgr->selectedObjects(aList);
|
||||||
}
|
|
||||||
|
|
||||||
if (aList.Extent() == 1) {
|
if (aList.Extent() == 1) {
|
||||||
Standard_Boolean aResult = Standard_False;
|
Standard_Boolean aResult = Standard_False;
|
||||||
@ -124,7 +109,7 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
suitApp->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,6 +129,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI(GeometryGUI* p)
|
GEOMGUI* GetLibGUI(GeometryGUI* p)
|
||||||
{
|
{
|
||||||
return GroupGUI::GetGroupGUI(p);
|
return new GroupGUI(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : GroupGUI.h
|
// File : GroupGUI.h
|
||||||
// Author : Sergey ANIKIN
|
// Author : Sergey ANIKIN
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef GROUPGUI_H
|
#ifndef GROUPGUI_H
|
||||||
#define GROUPGUI_H
|
#define GROUPGUI_H
|
||||||
@ -39,19 +38,11 @@ class GroupGUI : public GEOMGUI
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
protected:
|
|
||||||
GroupGUI(GeometryGUI* parent); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
GroupGUI(GeometryGUI* parent);
|
||||||
~GroupGUI();
|
~GroupGUI();
|
||||||
|
|
||||||
// Get the only GroupGUI object
|
|
||||||
static GroupGUI* GetGroupGUI(GeometryGUI* parent);
|
|
||||||
|
|
||||||
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
||||||
|
|
||||||
private:
|
|
||||||
static GroupGUI* myGUIObject; // the only GroupGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
|
|
||||||
#include "SalomeApp_Tools.h"
|
#include "SalomeApp_Tools.h"
|
||||||
|
#include "SalomeApp_Application.h"
|
||||||
|
|
||||||
#include "MeasureGUI_PropertiesDlg.h" // Method PROPERTIES
|
#include "MeasureGUI_PropertiesDlg.h" // Method PROPERTIES
|
||||||
#include "MeasureGUI_CenterMassDlg.h" // Method CENTER MASS
|
#include "MeasureGUI_CenterMassDlg.h" // Method CENTER MASS
|
||||||
@ -43,21 +44,6 @@
|
|||||||
#include "MeasureGUI_CheckCompoundOfBlocksDlg.h" // Method CHECKCOMPOUND
|
#include "MeasureGUI_CheckCompoundOfBlocksDlg.h" // Method CHECKCOMPOUND
|
||||||
#include "MeasureGUI_PointDlg.h" // Method POINTCOORDINATES
|
#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()
|
// function : MeasureGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -66,7 +52,6 @@ MeasureGUI::MeasureGUI( GeometryGUI* parent ) : GEOMGUI( parent )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ~MeasureGUI()
|
// function : ~MeasureGUI()
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -82,7 +67,9 @@ MeasureGUI::~MeasureGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
||||||
{
|
{
|
||||||
MeasureGUI* myMeasureGUI = GetMeasureGUI( getGeometryGUI() );
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if ( !app ) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
switch ( theCommandID )
|
switch ( theCommandID )
|
||||||
@ -99,7 +86,7 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
case 708 : new MeasureGUI_PointDlg (getGeometryGUI(), parent); break; // POINT COORDINATES
|
case 708 : new MeasureGUI_PointDlg (getGeometryGUI(), parent); break; // POINT COORDINATES
|
||||||
|
|
||||||
default:
|
default:
|
||||||
SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
|
app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -116,6 +103,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return MeasureGUI::GetMeasureGUI( parent );
|
return new MeasureGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : MeasureGUI.h
|
// File : MeasureGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef MEASUREGUI_H
|
#ifndef MEASUREGUI_H
|
||||||
#define MEASUREGUI_H
|
#define MEASUREGUI_H
|
||||||
@ -37,16 +36,11 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class MeasureGUI : public GEOMGUI
|
class MeasureGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
MeasureGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
MeasureGUI( GeometryGUI* parent );
|
||||||
~MeasureGUI();
|
~MeasureGUI();
|
||||||
static MeasureGUI* GetMeasureGUI( GeometryGUI* parent );
|
|
||||||
bool OnGUIEvent( int , SUIT_Desktop* );
|
|
||||||
|
|
||||||
private:
|
bool OnGUIEvent( int , SUIT_Desktop* );
|
||||||
static MeasureGUI* myGUIObject;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -45,21 +45,6 @@
|
|||||||
|
|
||||||
using namespace std;
|
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()
|
// function : OperationGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -68,7 +53,6 @@ OperationGUI::OperationGUI(GeometryGUI* parent) : GEOMGUI(parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ~OperationGUI()
|
// function : ~OperationGUI()
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -84,6 +68,9 @@ OperationGUI::~OperationGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
||||||
{
|
{
|
||||||
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if (!app) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
@ -94,7 +81,7 @@ bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
case 506: (new OperationGUI_ChamferDlg (getGeometryGUI(), parent))->show(); break;
|
case 506: (new OperationGUI_ChamferDlg (getGeometryGUI(), parent))->show(); break;
|
||||||
case 507: (new OperationGUI_ClippingDlg (getGeometryGUI(), parent))->show(); break;
|
case 507: (new OperationGUI_ClippingDlg (getGeometryGUI(), parent))->show(); break;
|
||||||
default:
|
default:
|
||||||
getGeometryGUI()->getApp()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -110,6 +97,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI(GeometryGUI* parent)
|
GEOMGUI* GetLibGUI(GeometryGUI* parent)
|
||||||
{
|
{
|
||||||
return OperationGUI::GetOperationGUI(parent);
|
return new OperationGUI(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : OperationGUI.h
|
// File : OperationGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef OPERATIONGUI_H
|
#ifndef OPERATIONGUI_H
|
||||||
#define OPERATIONGUI_H
|
#define OPERATIONGUI_H
|
||||||
@ -38,19 +37,11 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class OperationGUI : public GEOMGUI
|
class OperationGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
OperationGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
OperationGUI( GeometryGUI* parent );
|
||||||
~OperationGUI();
|
~OperationGUI();
|
||||||
|
|
||||||
// Get the only OperationGUI object
|
|
||||||
static OperationGUI* GetOperationGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
||||||
|
|
||||||
private:
|
|
||||||
static OperationGUI* myGUIObject; // the only OperationGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,26 +33,15 @@
|
|||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
#include "SUIT_Desktop.h"
|
#include "SUIT_Desktop.h"
|
||||||
|
|
||||||
|
#include "SalomeApp_Application.h"
|
||||||
|
|
||||||
#include "PrimitiveGUI_BoxDlg.h" // Method BOX
|
#include "PrimitiveGUI_BoxDlg.h" // Method BOX
|
||||||
#include "PrimitiveGUI_CylinderDlg.h" // Method CYLINDER
|
#include "PrimitiveGUI_CylinderDlg.h" // Method CYLINDER
|
||||||
#include "PrimitiveGUI_SphereDlg.h" // Method SPHERE
|
#include "PrimitiveGUI_SphereDlg.h" // Method SPHERE
|
||||||
#include "PrimitiveGUI_TorusDlg.h" // Method TORUS
|
#include "PrimitiveGUI_TorusDlg.h" // Method TORUS
|
||||||
#include "PrimitiveGUI_ConeDlg.h" // Method CONE
|
#include "PrimitiveGUI_ConeDlg.h" // Method CONE
|
||||||
using namespace std;
|
|
||||||
PrimitiveGUI* PrimitiveGUI::myGUIObject = 0;
|
|
||||||
|
|
||||||
//=======================================================================
|
using namespace std;
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : PrimitiveGUI()
|
// function : PrimitiveGUI()
|
||||||
@ -62,7 +51,6 @@ PrimitiveGUI::PrimitiveGUI(GeometryGUI* parent) : GEOMGUI(parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ~PrimitiveGUI
|
// function : ~PrimitiveGUI
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -78,6 +66,9 @@ PrimitiveGUI::~PrimitiveGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||||
{
|
{
|
||||||
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if (!app) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
QDialog* aDlg = NULL;
|
QDialog* aDlg = NULL;
|
||||||
@ -85,36 +76,24 @@ bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
|||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
case 4021: // BOX
|
case 4021: // BOX
|
||||||
{
|
|
||||||
aDlg = new PrimitiveGUI_BoxDlg(getGeometryGUI(), parent, "");
|
aDlg = new PrimitiveGUI_BoxDlg(getGeometryGUI(), parent, "");
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 4022: // CYLINDER
|
case 4022: // CYLINDER
|
||||||
{
|
|
||||||
aDlg = new PrimitiveGUI_CylinderDlg(getGeometryGUI(), parent, "");
|
aDlg = new PrimitiveGUI_CylinderDlg(getGeometryGUI(), parent, "");
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 4023: // SPHERE
|
case 4023: // SPHERE
|
||||||
{
|
|
||||||
aDlg = new PrimitiveGUI_SphereDlg(getGeometryGUI(), parent, "");
|
aDlg = new PrimitiveGUI_SphereDlg(getGeometryGUI(), parent, "");
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 4024: // TORUS
|
case 4024: // TORUS
|
||||||
{
|
|
||||||
aDlg = new PrimitiveGUI_TorusDlg(getGeometryGUI(), parent, "");
|
aDlg = new PrimitiveGUI_TorusDlg(getGeometryGUI(), parent, "");
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 4025: // CONE
|
case 4025: // CONE
|
||||||
{
|
|
||||||
aDlg = new PrimitiveGUI_ConeDlg(getGeometryGUI(), parent, "");
|
aDlg = new PrimitiveGUI_ConeDlg(getGeometryGUI(), parent, "");
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
{
|
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (aDlg != NULL)
|
if (aDlg != NULL)
|
||||||
aDlg->show();
|
aDlg->show();
|
||||||
@ -133,6 +112,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return PrimitiveGUI::GetPrimitiveGUI( parent );
|
return new PrimitiveGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : PrimitiveGUI.h
|
// File : PrimitiveGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef PRIMITIVEGUI_H
|
#ifndef PRIMITIVEGUI_H
|
||||||
#define PRIMITIVEGUI_H
|
#define PRIMITIVEGUI_H
|
||||||
@ -38,19 +37,11 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class PrimitiveGUI : public GEOMGUI
|
class PrimitiveGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
PrimitiveGUI(GeometryGUI* parent); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
PrimitiveGUI(GeometryGUI* parent);
|
||||||
~PrimitiveGUI();
|
~PrimitiveGUI();
|
||||||
|
|
||||||
// Get the only PrimitiveGUI object
|
|
||||||
static PrimitiveGUI* GetPrimitiveGUI(GeometryGUI* parent);
|
|
||||||
|
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
||||||
|
|
||||||
private:
|
|
||||||
static PrimitiveGUI* myGUIObject; // the only PrimitiveGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include "SUIT_Desktop.h"
|
#include "SUIT_Desktop.h"
|
||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
|
|
||||||
|
#include "SalomeApp_Application.h"
|
||||||
|
|
||||||
#include "RepairGUI_SewingDlg.h" // Method SEWING
|
#include "RepairGUI_SewingDlg.h" // Method SEWING
|
||||||
#include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES
|
#include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES
|
||||||
#include "RepairGUI_RemoveHolesDlg.h" // Method SUPPRESS HOLE
|
#include "RepairGUI_RemoveHolesDlg.h" // Method SUPPRESS HOLE
|
||||||
@ -46,21 +48,6 @@
|
|||||||
|
|
||||||
using namespace std;
|
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()
|
// function : RepairGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -69,7 +56,6 @@ RepairGUI::RepairGUI( GeometryGUI* parent ) : GEOMGUI( parent )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ~RepairGUI()
|
// function : ~RepairGUI()
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -85,6 +71,9 @@ RepairGUI::~RepairGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||||
{
|
{
|
||||||
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if (!app) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
QDialog* aDlg = NULL;
|
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 609: aDlg = new RepairGUI_FreeBoundDlg (getGeometryGUI(), parent, ""); break;
|
||||||
case 610: aDlg = new RepairGUI_FreeFacesDlg (getGeometryGUI(), parent, ""); break;
|
case 610: aDlg = new RepairGUI_FreeFacesDlg (getGeometryGUI(), parent, ""); break;
|
||||||
default:
|
default:
|
||||||
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +110,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return RepairGUI::GetRepairGUI( parent );
|
return new RepairGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : RepairGUI.h
|
// File : RepairGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef REPAIRGUI_H
|
#ifndef REPAIRGUI_H
|
||||||
#define REPAIRGUI_H
|
#define REPAIRGUI_H
|
||||||
@ -38,20 +37,11 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class RepairGUI : public GEOMGUI
|
class RepairGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
RepairGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
RepairGUI( GeometryGUI* parent );
|
||||||
~RepairGUI();
|
~RepairGUI();
|
||||||
|
|
||||||
// Get the only RepairGUI object
|
|
||||||
static RepairGUI* GetRepairGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
||||||
|
|
||||||
private:
|
|
||||||
static RepairGUI* myGUIObject; // the only RepairGUI object
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
#include "SUIT_Session.h"
|
#include "SUIT_Session.h"
|
||||||
#include "SUIT_Desktop.h"
|
#include "SUIT_Desktop.h"
|
||||||
|
|
||||||
|
#include "SalomeApp_Application.h"
|
||||||
|
|
||||||
#include "TransformationGUI_MultiTranslationDlg.h" // Method MULTI TRANSLATION
|
#include "TransformationGUI_MultiTranslationDlg.h" // Method MULTI TRANSLATION
|
||||||
#include "TransformationGUI_MultiRotationDlg.h" // Method MULTI ROTATION
|
#include "TransformationGUI_MultiRotationDlg.h" // Method MULTI ROTATION
|
||||||
#include "TransformationGUI_TranslationDlg.h" // Method TRANSLATION
|
#include "TransformationGUI_TranslationDlg.h" // Method TRANSLATION
|
||||||
@ -43,21 +45,6 @@
|
|||||||
|
|
||||||
using namespace std;
|
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()
|
// function : TransformationGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -66,7 +53,6 @@ TransformationGUI::TransformationGUI(GeometryGUI* parent) : GEOMGUI(parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ~TransformationGUI()
|
// function : ~TransformationGUI()
|
||||||
// purpose : Destructor
|
// purpose : Destructor
|
||||||
@ -82,6 +68,9 @@ TransformationGUI::~TransformationGUI()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||||
{
|
{
|
||||||
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
|
if (!app) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
QDialog* aDlg = NULL;
|
QDialog* aDlg = NULL;
|
||||||
|
|
||||||
@ -112,7 +101,7 @@ bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
|||||||
aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" );
|
aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,6 +122,6 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return TransformationGUI::GetTransformationGUI( parent );
|
return new TransformationGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// File : TransformationGUI.h
|
// File : TransformationGUI.h
|
||||||
// Author : Damien COQUERET
|
// Author : Damien COQUERET
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#ifndef TRANSFORMATIONGUI_H
|
#ifndef TRANSFORMATIONGUI_H
|
||||||
#define TRANSFORMATIONGUI_H
|
#define TRANSFORMATIONGUI_H
|
||||||
@ -38,19 +37,11 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class TransformationGUI : public GEOMGUI
|
class TransformationGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
TransformationGUI( GeometryGUI* parent ); // hide constructor to avoid direct creation
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
TransformationGUI( GeometryGUI* parent );
|
||||||
~TransformationGUI();
|
~TransformationGUI();
|
||||||
|
|
||||||
// Get the only TransformationGUI object
|
|
||||||
static TransformationGUI* GetTransformationGUI( GeometryGUI* parent );
|
|
||||||
|
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
||||||
|
|
||||||
private:
|
|
||||||
static TransformationGUI* myGUIObject; // the only TransformationGUI object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user