2009-02-13 17:16:39 +05:00
|
|
|
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
|
2003-07-09 20:33:44 +06:00
|
|
|
//
|
2009-02-13 17:16:39 +05:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
2005-08-18 12:15:31 +06:00
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2.1 of the License.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
//
|
2009-02-13 17:16:39 +05:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2003-07-09 20:33:44 +06:00
|
|
|
//
|
2009-02-13 17:16:39 +05:00
|
|
|
// GEOM GEOMGUI : GUI for Geometry component
|
|
|
|
// File : GeometryGUI.h
|
|
|
|
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
|
2003-07-09 20:33:44 +06:00
|
|
|
//
|
2004-01-07 20:46:21 +05:00
|
|
|
#ifndef GEOMETRYGUI_H
|
|
|
|
#define GEOMETRYGUI_H
|
2003-05-12 21:24:23 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
#include "GEOM_GEOMGUI.hxx"
|
|
|
|
|
2009-02-13 17:16:39 +05:00
|
|
|
#include <SalomeApp_Module.h>
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2009-02-13 17:16:39 +05:00
|
|
|
#include <GEOM_Client.hxx>
|
|
|
|
#include <SALOME_InteractiveObject.hxx>
|
|
|
|
#include <SALOMEDSClient.hxx>
|
2005-08-18 12:15:31 +06:00
|
|
|
|
2009-02-13 17:16:39 +05:00
|
|
|
#include "GEOMGUI.h"
|
2005-08-18 12:15:31 +06:00
|
|
|
|
|
|
|
// QT Includes
|
2009-02-13 17:16:39 +05:00
|
|
|
#include <QMap>
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2005-08-18 12:15:31 +06:00
|
|
|
// OCCT Includes
|
|
|
|
#include <gp_Ax3.hxx>
|
|
|
|
|
|
|
|
// IDL headers
|
|
|
|
#include "SALOMEconfig.h"
|
|
|
|
#include CORBA_CLIENT_HEADER(SALOMEDS)
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
typedef QMap<QString, GEOMGUI*> GUIMap;
|
|
|
|
|
|
|
|
class QDialog;
|
2009-02-13 17:16:39 +05:00
|
|
|
class QMenu;
|
2005-06-02 13:17:09 +06:00
|
|
|
class GEOMGUI_OCCSelector;
|
2005-11-03 13:30:14 +05:00
|
|
|
class LightApp_VTKSelector;
|
|
|
|
class LightApp_Selection;
|
2005-06-02 13:17:09 +06:00
|
|
|
class SUIT_ViewManager;
|
|
|
|
|
2003-05-12 21:24:23 +06:00
|
|
|
//=================================================================================
|
|
|
|
// class : GeometryGUI
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
2008-03-07 12:45:34 +05:00
|
|
|
class GEOMGUI_EXPORT GeometryGUI : public SalomeApp_Module
|
2003-05-12 21:24:23 +06:00
|
|
|
{
|
2004-12-01 15:39:14 +05:00
|
|
|
Q_OBJECT;
|
|
|
|
|
2005-06-02 13:17:09 +06:00
|
|
|
public:
|
2004-12-01 15:39:14 +05:00
|
|
|
// Constructor
|
2005-08-18 12:15:31 +06:00
|
|
|
GeometryGUI();
|
2003-05-12 21:24:23 +06:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
// Destructor
|
2004-06-16 21:24:55 +06:00
|
|
|
~GeometryGUI();
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2005-11-03 13:30:14 +05:00
|
|
|
virtual LightApp_Displayer* displayer();
|
2005-06-02 13:17:09 +06:00
|
|
|
virtual void initialize( CAM_Application* );
|
|
|
|
virtual QString engineIOR() const;
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2005-08-18 12:15:31 +06:00
|
|
|
static bool InitGeomGen(); //BugID IPAL9186: SRN: To be called by Python scripts
|
2005-06-15 17:50:44 +06:00
|
|
|
|
2005-08-19 17:51:38 +06:00
|
|
|
static GEOM::GEOM_Gen_var GetGeomGen();// { return GeometryGUI::myComponentGeom; }
|
2005-08-18 12:15:31 +06:00
|
|
|
|
|
|
|
static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject);
|
|
|
|
static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy);
|
|
|
|
|
2009-02-13 17:16:39 +05:00
|
|
|
static char* JoinObjectParameters(const QStringList& theParametersList);
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
GEOM_Client& GetShapeReader() { return myShapeReader; }
|
|
|
|
Standard_CString& GetFatherior() { return myFatherior; }
|
2005-06-02 13:17:09 +06:00
|
|
|
//void SetState( const int state ) { myState = state; }
|
|
|
|
//int GetState() const { return myState; }
|
2005-08-18 12:15:31 +06:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
// Get active dialog box
|
|
|
|
QDialog* GetActiveDialogBox(){ return myActiveDialogBox; }
|
|
|
|
// Set active dialog box
|
|
|
|
void SetActiveDialogBox( QDialog* aDlg );
|
|
|
|
|
|
|
|
// Non modal dialog boxes management
|
|
|
|
void EmitSignalDeactivateDialog();
|
|
|
|
void EmitSignalCloseAllDialogs();
|
|
|
|
void EmitSignalDefaultStepValueChanged( double newVal );
|
|
|
|
|
2005-06-02 13:17:09 +06:00
|
|
|
void OnGUIEvent( int id );
|
2005-08-18 12:15:31 +06:00
|
|
|
|
2005-06-02 13:17:09 +06:00
|
|
|
// virtual bool SetSettings();
|
|
|
|
// virtual void SupportedViewType ( int* buffer, int bufferSize );
|
|
|
|
virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&, SUIT_ViewWindow* = 0 );
|
|
|
|
|
|
|
|
// virtual void DefinePopup( QString & theContext, QString & theParent, QString & theObject);
|
2009-02-13 17:16:39 +05:00
|
|
|
// virtual bool CustomPopup( QAD_Desktop* parent, QMenu* popup, const QString& theContext,
|
2005-06-02 13:17:09 +06:00
|
|
|
// const QString& theParent, const QString& theObject );
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
// The Working Plane management
|
2005-06-02 13:17:09 +06:00
|
|
|
void SetWorkingPlane( gp_Ax3 wp ) { myWorkingPlane = wp; }
|
|
|
|
gp_Ax3 GetWorkingPlane() { return myWorkingPlane; }
|
|
|
|
void ActiveWorkingPlane();
|
|
|
|
|
|
|
|
virtual void windows( QMap<int, int>& ) const;
|
|
|
|
virtual void viewManagers( QStringList& ) const;
|
|
|
|
|
2009-02-13 17:16:39 +05:00
|
|
|
virtual void contextMenuPopup( const QString&, QMenu*, QString& );
|
2005-06-22 12:29:29 +06:00
|
|
|
virtual void createPreferences();
|
|
|
|
virtual void preferencesChanged( const QString&, const QString& );
|
2008-03-07 12:45:34 +05:00
|
|
|
int getLocalSelectionMode() const;
|
|
|
|
void setLocalSelectionMode(const int mode);
|
2005-06-02 13:17:09 +06:00
|
|
|
|
2009-02-13 17:16:39 +05:00
|
|
|
virtual void storeVisualParameters (int savePoint);
|
|
|
|
virtual void restoreVisualParameters(int savePoint);
|
|
|
|
|
2005-06-02 13:17:09 +06:00
|
|
|
public slots:
|
2005-06-08 18:39:43 +06:00
|
|
|
virtual bool deactivateModule( SUIT_Study* );
|
|
|
|
virtual bool activateModule( SUIT_Study* );
|
2006-03-13 20:11:51 +05:00
|
|
|
virtual void OnKeyPress ( SUIT_ViewWindow*, QKeyEvent* );
|
|
|
|
virtual void OnMousePress( SUIT_ViewWindow*, QMouseEvent* );
|
|
|
|
virtual void OnMouseMove ( SUIT_ViewWindow*, QMouseEvent* );
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
virtual void onViewManagerAdded( SUIT_ViewManager* );
|
|
|
|
virtual void onViewManagerRemoved( SUIT_ViewManager* );
|
2005-06-02 13:17:09 +06:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void OnGUIEvent();
|
|
|
|
void onWindowActivated( SUIT_ViewWindow* );
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
signals :
|
2005-06-02 13:17:09 +06:00
|
|
|
void SignalDeactivateActiveDialog();
|
|
|
|
void SignalCloseAllDialogs();
|
|
|
|
void SignalDefaultStepValueChanged( double newVal );
|
|
|
|
|
|
|
|
protected:
|
2005-11-03 13:30:14 +05:00
|
|
|
virtual LightApp_Selection* createSelection() const;
|
2005-06-02 13:17:09 +06:00
|
|
|
|
|
|
|
private:
|
|
|
|
GEOMGUI* getLibrary( const QString& libraryName );
|
2005-08-18 12:15:31 +06:00
|
|
|
void createGeomAction( const int id, const QString& po_id,
|
|
|
|
const QString& icon_id = QString(""),
|
|
|
|
const int key = 0, const bool toggle = false );
|
|
|
|
void createPopupItem( const int, const QString& clients, const QString& types,
|
|
|
|
const bool isSingle = false, const int isVisible = -1,
|
|
|
|
const bool isExpandAll = false, const bool isOCC = false,
|
|
|
|
const int parentId = -1 );
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2005-08-19 17:51:38 +06:00
|
|
|
public:
|
|
|
|
static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine!!!
|
|
|
|
private:
|
2005-06-02 13:17:09 +06:00
|
|
|
GUIMap myGUIMap; // GUI libraries map
|
|
|
|
QDialog* myActiveDialogBox; // active dialog box
|
|
|
|
GEOM_Client myShapeReader; // geom shape reader
|
|
|
|
Standard_CString myFatherior;
|
|
|
|
int myState; // identify a method
|
|
|
|
gp_Ax3 myWorkingPlane;
|
|
|
|
QMap<int,QString> myRules; // popup rules
|
|
|
|
|
2009-02-13 17:16:39 +05:00
|
|
|
QList<GEOMGUI_OCCSelector*> myOCCSelectors;
|
|
|
|
QList<LightApp_VTKSelector*> myVTKSelectors;
|
2005-09-27 12:32:15 +06:00
|
|
|
|
2005-11-03 13:30:14 +05:00
|
|
|
LightApp_Displayer* myDisplayer;
|
2008-03-07 12:45:34 +05:00
|
|
|
int myLocalSelectionMode; //Select Only
|
2005-09-30 13:00:00 +06:00
|
|
|
|
|
|
|
friend class DisplayGUI;
|
2003-05-12 21:24:23 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|