/**
* \ingroup GUI
* A Base object for definition of connector object to
- * Salome Viewer. Reimplemented in NewGeom_SalomeViewer class
+ * Salome Viewer. Reimplemented in SHAPERGUI_SalomeViewer class
*/
class MODULEBASE_EXPORT ModuleBase_IViewer : public QObject
{
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#include "NewGeom_Module.h"
-#include "NewGeom_DataModel.h"
-#include "NewGeom_OCCSelector.h"
-#include <NewGeom_NestedButton.h>
+#include "SHAPERGUI.h"
+#include "SHAPERGUI_DataModel.h"
+#include "SHAPERGUI_OCCSelector.h"
+#include <SHAPERGUI_NestedButton.h>
#include <XGUI_Workshop.h>
#include <XGUI_PropertyPanel.h>
extern "C" {
-NewGeom_EXPORT CAM_Module* createModule()
+SHAPERGUI_EXPORT CAM_Module* createModule()
{
- return new NewGeom_Module();
+ return new SHAPERGUI();
}
-NewGeom_EXPORT char* getModuleVersion()
+SHAPERGUI_EXPORT char* getModuleVersion()
{
return (char*)"0.0";
}
/**
* Class for preferences management
*/
-class NewGeom_PrefMgr: public ModuleBase_IPrefMgr
+class SHAPERGUI_PrefMgr: public ModuleBase_IPrefMgr
{
public:
/// Constructor
/// \param theMgr preferences manager of SALOME
/// \param theModName name of the module
- NewGeom_PrefMgr(LightApp_Preferences* theMgr, const QString& theModName):myMgr(theMgr), myModName(theModName) {}
+ SHAPERGUI_PrefMgr(LightApp_Preferences* theMgr, const QString& theModName):myMgr(theMgr), myModName(theModName) {}
virtual int addPreference(const QString& theLbl, int pId,
SUIT_PreferenceMgr::PrefItemType theType,
//******************************************************
-NewGeom_Module::NewGeom_Module()
+SHAPERGUI::SHAPERGUI()
: LightApp_Module("NewGeom"),
mySelector(0), myIsOpened(0), myPopupMgr(0)
{
connect(myWorkshop, SIGNAL(commandStatusUpdated()),
this, SLOT(onUpdateCommandStatus()));
- myProxyViewer = new NewGeom_SalomeViewer(this);
+ myProxyViewer = new SHAPERGUI_SalomeViewer(this);
ModuleBase_Preferences::setResourceMgr(application()->resourceMgr());
ModuleBase_Preferences::loadCustomProps();
}
//******************************************************
-NewGeom_Module::~NewGeom_Module()
+SHAPERGUI::~SHAPERGUI()
{
}
//******************************************************
-void NewGeom_Module::initialize(CAM_Application* theApp)
+void SHAPERGUI::initialize(CAM_Application* theApp)
{
LightApp_Module::initialize(theApp);
inspectSalomeModules();
}
//******************************************************
-void NewGeom_Module::windows(QMap<int, int>& theWndMap) const
+void SHAPERGUI::windows(QMap<int, int>& theWndMap) const
{
theWndMap.insert(LightApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea);
}
//******************************************************
-void NewGeom_Module::viewManagers(QStringList& theList) const
+void SHAPERGUI::viewManagers(QStringList& theList) const
{
theList.append(OCCViewer_Viewer::Type());
}
//******************************************************
-void NewGeom_Module::connectToStudy(CAM_Study* theStudy)
+void SHAPERGUI::connectToStudy(CAM_Study* theStudy)
{
// if there are created viewer managers, we should try to create viewer
// selector and initialize viewer with it. It sets interactive contect to the
}
//******************************************************
-bool NewGeom_Module::activateModule(SUIT_Study* theStudy)
+bool SHAPERGUI::activateModule(SUIT_Study* theStudy)
{
bool isDone = LightApp_Module::activateModule(theStudy);
- NewGeom_DataModel* aDataModel = dynamic_cast<NewGeom_DataModel*>(dataModel());
+ SHAPERGUI_DataModel* aDataModel = dynamic_cast<SHAPERGUI_DataModel*>(dataModel());
aDataModel->initRootObject();
if (isDone) {
}
//******************************************************
-bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy)
+bool SHAPERGUI::deactivateModule(SUIT_Study* theStudy)
{
myProxyViewer->activateViewer(false);
setMenuShown(false);
}
//******************************************************
-void NewGeom_Module::onViewManagerAdded(SUIT_ViewManager* theMgr)
+void SHAPERGUI::onViewManagerAdded(SUIT_ViewManager* theMgr)
{
if (!mySelector) {
mySelector = createSelector(theMgr);
}
//******************************************************
-void NewGeom_Module::onViewManagerRemoved(SUIT_ViewManager* theMgr)
+void SHAPERGUI::onViewManagerRemoved(SUIT_ViewManager* theMgr)
{
if (mySelector) {
if (theMgr->getType() == OCCViewer_Viewer::Type()) {
}
//******************************************************
-QtxPopupMgr* NewGeom_Module::popupMgr()
+QtxPopupMgr* SHAPERGUI::popupMgr()
{
if (!myPopupMgr)
myPopupMgr = new QtxPopupMgr( 0, this );
}
//******************************************************
-void NewGeom_Module::onDefaultPreferences()
+void SHAPERGUI::onDefaultPreferences()
{
// reset main resources
ModuleBase_Preferences::resetResourcePreferences(preferences());
}
//******************************************************
-void NewGeom_Module::onUpdateCommandStatus()
+void SHAPERGUI::onUpdateCommandStatus()
{
getApp()->updateActions();
}
//******************************************************
-NewGeom_OCCSelector* NewGeom_Module::createSelector(SUIT_ViewManager* theMgr)
+SHAPERGUI_OCCSelector* SHAPERGUI::createSelector(SUIT_ViewManager* theMgr)
{
if (theMgr->getType() == OCCViewer_Viewer::Type()) {
OCCViewer_Viewer* aViewer = static_cast<OCCViewer_Viewer*>(theMgr->getViewModel());
- NewGeom_OCCSelector* aSelector = new NewGeom_OCCSelector(aViewer, getApp()->selectionMgr());
+ SHAPERGUI_OCCSelector* aSelector = new SHAPERGUI_OCCSelector(aViewer, getApp()->selectionMgr());
LightApp_SelectionMgr* aMgr = getApp()->selectionMgr();
QList<SUIT_Selector*> aList;
aMgr->selectors(aList);
}
//******************************************************
-CAM_DataModel* NewGeom_Module::createDataModel()
+CAM_DataModel* SHAPERGUI::createDataModel()
{
- return new NewGeom_DataModel(this);
+ return new SHAPERGUI_DataModel(this);
}
-QAction* NewGeom_Module::addFeature(const QString& theWBName, const ActionInfo& theInfo)
+QAction* SHAPERGUI::addFeature(const QString& theWBName, const ActionInfo& theInfo)
{
return addFeature(theWBName,
theInfo.id,
}
//******************************************************
-QAction* NewGeom_Module::addFeature(const QString& theWBName, const QString& theId,
+QAction* SHAPERGUI::addFeature(const QString& theWBName, const QString& theId,
const QString& theTitle, const QString& theTip,
const QIcon& theIcon, const QKeySequence& theKeys,
bool isCheckable)
return aAction;
}
-bool NewGeom_Module::isFeatureOfNested(const QAction* theAction)
+bool SHAPERGUI::isFeatureOfNested(const QAction* theAction)
{
- return dynamic_cast<const NewGeom_NestedButton*>(theAction);
+ return dynamic_cast<const SHAPERGUI_NestedButton*>(theAction);
}
-QAction* NewGeom_Module::addFeatureOfNested(const QString& theWBName,
+QAction* SHAPERGUI::addFeatureOfNested(const QString& theWBName,
const ActionInfo& theInfo,
const QList<QAction*>& theNestedActions)
{
int aId = myActionsList.size();
myActionsList.append(theInfo.id);
SUIT_Desktop* aDesk = application()->desktop();
- NewGeom_NestedButton* anAction = new NewGeom_NestedButton(aDesk, theNestedActions);
+ SHAPERGUI_NestedButton* anAction = new SHAPERGUI_NestedButton(aDesk, theNestedActions);
anAction->setData(theInfo.id);
anAction->setCheckable(theInfo.checkable);
anAction->setChecked(theInfo.checked);
//******************************************************
-QAction* NewGeom_Module::addDesktopCommand(const QString& theId, const QString& theTitle,
+QAction* SHAPERGUI::addDesktopCommand(const QString& theId, const QString& theTitle,
const QString& theTip, const QIcon& theIcon,
const QKeySequence& theKeys, bool isCheckable,
const char* theMenuSourceText, const int theMenuPosition)
}
//******************************************************
-void NewGeom_Module::addDesktopMenuSeparator(const char* theMenuSourceText, const int theMenuPosition)
+void SHAPERGUI::addDesktopMenuSeparator(const char* theMenuSourceText, const int theMenuPosition)
{
int aMenu = createMenu(tr(theMenuSourceText), -1, -1);
createMenu(separator(), aMenu, -1, theMenuPosition);
}
-bool NewGeom_Module::addActionInToolbar( QAction* theAction, const QString& theToolBarTitle )
+bool SHAPERGUI::addActionInToolbar( QAction* theAction, const QString& theToolBarTitle )
{
if( !theAction )
return false;
}
//******************************************************
-QList<QAction*> NewGeom_Module::commandList() const
+QList<QAction*> SHAPERGUI::commandList() const
{
QList<QAction*> aActions;
for (int i = 0; i < myActionsList.size(); i++) {
}
//******************************************************
-QStringList NewGeom_Module::commandIdList() const
+QStringList SHAPERGUI::commandIdList() const
{
return myActionsList;
}
//******************************************************
-QMainWindow* NewGeom_Module::desktop() const
+QMainWindow* SHAPERGUI::desktop() const
{
return application()->desktop();
}
//******************************************************
-QString NewGeom_Module::commandId(const QAction* theCmd) const
+QString SHAPERGUI::commandId(const QAction* theCmd) const
{
int aId = actionId(theCmd);
if (aId < myActionsList.size())
}
//******************************************************
-QAction* NewGeom_Module::command(const QString& theId) const
+QAction* SHAPERGUI::command(const QString& theId) const
{
int aId = myActionsList.indexOf(theId);
if ((aId != -1) && (aId < myActionsList.size())) {
}
//******************************************************
-void NewGeom_Module::setNestedActions(const QString& theId, const QStringList& theActions)
+void SHAPERGUI::setNestedActions(const QString& theId, const QStringList& theActions)
{
myNestedActions[theId] = theActions;
}
//******************************************************
-QStringList NewGeom_Module::nestedActions(const QString& theId) const
+QStringList SHAPERGUI::nestedActions(const QString& theId) const
{
if (myNestedActions.contains(theId))
return myNestedActions[theId];
}
//******************************************************
-void NewGeom_Module::setDocumentKind(const QString& theId, const QString& theKind)
+void SHAPERGUI::setDocumentKind(const QString& theId, const QString& theKind)
{
myDocumentType[theId] = theKind;
}
//******************************************************
-QString NewGeom_Module::documentKind(const QString& theId) const
+QString SHAPERGUI::documentKind(const QString& theId) const
{
if (myDocumentType.contains(theId))
return myDocumentType[theId];
}
//******************************************************
-void NewGeom_Module::selectionChanged()
+void SHAPERGUI::selectionChanged()
{
LightApp_Module::selectionChanged();
myWorkshop->salomeViewerSelectionChanged();
}
//******************************************************
-void NewGeom_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
+void SHAPERGUI::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
{
myWorkshop->contextMenuMgr()->updateViewerMenu();
myWorkshop->contextMenuMgr()->addViewerMenu(theMenu);
//******************************************************
-void NewGeom_Module::createPreferences()
+void SHAPERGUI::createPreferences()
{
LightApp_Preferences* pref = preferences();
if (!pref)
int catId = pref->addPreference(aModName, -1 );
if ( catId == -1 )
return;
- NewGeom_PrefMgr aMgr(pref, aModName);
+ SHAPERGUI_PrefMgr aMgr(pref, aModName);
ModuleBase_Preferences::createEditContent(&aMgr, catId);
pref->retrieve();
}
//******************************************************
-void NewGeom_Module::preferencesChanged(const QString& theSection, const QString& theParam)
+void SHAPERGUI::preferencesChanged(const QString& theSection, const QString& theParam)
{
SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
QString aVal = aResMgr->stringValue(theSection, theParam);
myWorkshop->displayer()->redisplayObjects();
}
-void NewGeom_Module::inspectSalomeModules()
+void SHAPERGUI::inspectSalomeModules()
{
QStringList aModuleNames;
getApp()->modules(aModuleNames, false);
}
}
-bool NewGeom_Module::abortAllOperations()
+bool SHAPERGUI::abortAllOperations()
{
return workshop()->operationMgr()->abortAllOperations();
}
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#ifndef NewGeom_Module_H
-#define NewGeom_Module_H
+#ifndef SHAPERGUI_H
+#define SHAPERGUI_H
-#include "NewGeom.h"
-#include "NewGeom_SalomeViewer.h"
+#include "SHAPER_SHAPERGUI.h"
+#include "SHAPERGUI_SalomeViewer.h"
#include <LightApp_Module.h>
#include <XGUI_SalomeConnector.h>
#include <QMap>
class XGUI_Workshop;
-class NewGeom_OCCSelector;
+class SHAPERGUI_OCCSelector;
class OCCViewer_Viewer;
class CAM_Study;
* An implementation of SALOME connector class for implementation of
* XGUI functionality as a module of SALOME
*/
-class NewGeom_EXPORT NewGeom_Module : public LightApp_Module, public XGUI_SalomeConnector
+class SHAPERGUI_EXPORT SHAPERGUI : public LightApp_Module, public XGUI_SalomeConnector
{
Q_OBJECT
public:
- NewGeom_Module();
- virtual ~NewGeom_Module();
+ SHAPERGUI();
+ virtual ~SHAPERGUI();
//----- LightAPP_Module interface ---------------
private:
/// Create selector for OCC Viewer
/// \param theMgr view manager
- NewGeom_OCCSelector* createSelector(SUIT_ViewManager* theMgr);
+ SHAPERGUI_OCCSelector* createSelector(SUIT_ViewManager* theMgr);
/// List of registered actions
QStringList myActionsList;
XGUI_Workshop* myWorkshop;
/// OCC viewer selector instance
- NewGeom_OCCSelector* mySelector;
+ SHAPERGUI_OCCSelector* mySelector;
/// Proxy viewer for connection to OCC Viewer in SALOME
- NewGeom_SalomeViewer* myProxyViewer;
+ SHAPERGUI_SalomeViewer* myProxyViewer;
/// Map of nested actions [ActionID: list of nested actions Id]
QMap<QString, QStringList> myNestedActions;
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#include "NewGeom_DataModel.h"
-#include "NewGeom_Module.h"
+#include "SHAPERGUI_DataModel.h"
+#include "SHAPERGUI.h"
#include <XGUI_Workshop.h>
#include <QFile>
#include <QDir>
-NewGeom_DataModel::NewGeom_DataModel(NewGeom_Module* theModule)
+SHAPERGUI_DataModel::SHAPERGUI_DataModel(SHAPERGUI* theModule)
: LightApp_DataModel(theModule), myStudyPath(""), myModule(theModule)
{
}
-NewGeom_DataModel::~NewGeom_DataModel()
+SHAPERGUI_DataModel::~SHAPERGUI_DataModel()
{
}
-bool NewGeom_DataModel::open(const QString& thePath, CAM_Study* theStudy, QStringList theFiles)
+bool SHAPERGUI_DataModel::open(const QString& thePath, CAM_Study* theStudy, QStringList theFiles)
{
LightApp_DataModel::open( thePath, theStudy, theFiles );
if (theFiles.size() == 0)
return true;
}
-bool NewGeom_DataModel::save(QStringList& theFiles)
+bool SHAPERGUI_DataModel::save(QStringList& theFiles)
{
LightApp_DataModel::save( theFiles );
XGUI_Workshop* aWorkShop = myModule->workshop();
return true;
}
-bool NewGeom_DataModel::saveAs(const QString& thePath, CAM_Study* theStudy, QStringList& theFiles)
+bool SHAPERGUI_DataModel::saveAs(const QString& thePath, CAM_Study* theStudy, QStringList& theFiles)
{
myStudyPath = thePath;
return save(theFiles);
}
-bool NewGeom_DataModel::close()
+bool SHAPERGUI_DataModel::close()
{
myModule->workshop()->closeDocument();
removeDirectory(myTmpDirectory);
return LightApp_DataModel::close();
}
-bool NewGeom_DataModel::create(CAM_Study* theStudy)
+bool SHAPERGUI_DataModel::create(CAM_Study* theStudy)
{
return true;
}
-bool NewGeom_DataModel::isModified() const
+bool SHAPERGUI_DataModel::isModified() const
{
SessionPtr aMgr = ModelAPI_Session::get();
return aMgr->isModified();
}
-bool NewGeom_DataModel::isSaved() const
+bool SHAPERGUI_DataModel::isSaved() const
{
return !isModified();
}
-void NewGeom_DataModel::update(LightApp_DataObject* theObj, LightApp_Study* theStudy)
+void SHAPERGUI_DataModel::update(LightApp_DataObject* theObj, LightApp_Study* theStudy)
{
// Nothing to do here: we always keep the data tree in the up-to-date state
// The only goal of this method is to hide default behavior from LightApp_DataModel
return;
}
-void NewGeom_DataModel::initRootObject()
+void SHAPERGUI_DataModel::initRootObject()
{
LightApp_Study* study = dynamic_cast<LightApp_Study*>( module()->application()->activeStudy() );
CAM_ModuleObject *aModelRoot = dynamic_cast<CAM_ModuleObject*>(root());
}
}
-void NewGeom_DataModel::removeDirectory(const QString& theDirectoryName)
+void SHAPERGUI_DataModel::removeDirectory(const QString& theDirectoryName)
{
Qtx::rmDir(theDirectoryName);
}
#ifndef NEWGEOM_DATAMODEL_H
#define NEWGEOM_DATAMODEL_H
-#include "NewGeom.h"
+#include "SHAPER_SHAPERGUI.h"
#include <LightApp_DataModel.h>
-class NewGeom_Module;
+class SHAPERGUI;
/**
* \ingroup Salome
* A Data Model class provides a connection of SALOME data structure and OpenParts application data model
*/
-class NewGeom_EXPORT NewGeom_DataModel : public LightApp_DataModel
+class SHAPERGUI_EXPORT SHAPERGUI_DataModel : public LightApp_DataModel
{
Q_OBJECT
public:
/// Constructor
/// \param theModule a module instance
- NewGeom_DataModel(NewGeom_Module* theModule);
- virtual ~NewGeom_DataModel();
+ SHAPERGUI_DataModel(SHAPERGUI* theModule);
+ virtual ~SHAPERGUI_DataModel();
/// Open a data file
/// \param thePath a path to the directory
/// it should be created because the files reading is postponed in the module. The directory
// should be removed after the model document is closed.
- NewGeom_Module* myModule;
+ SHAPERGUI* myModule;
};
#endif
/*
- * NewGeom_NestedButton.cpp
+ * SHAPERGUI_NestedButton.cpp
*
* Created on: Apr 13, 2015
* Author: sbh
*/
-#include <NewGeom_NestedButton.h>
+#include <SHAPERGUI_NestedButton.h>
#include <QAction>
#include <QFrame>
#include <QToolButton>
#include <QEvent>
-NewGeom_NestedButton::NewGeom_NestedButton(QObject* theParent,
+SHAPERGUI_NestedButton::SHAPERGUI_NestedButton(QObject* theParent,
const QList<QAction*>& theNestedActions)
: QWidgetAction(theParent),
myNestedActions(theNestedActions),
{
}
-NewGeom_NestedButton::~NewGeom_NestedButton()
+SHAPERGUI_NestedButton::~SHAPERGUI_NestedButton()
{
}
-void NewGeom_NestedButton::showAdditionalButtons(bool isShow)
+void SHAPERGUI_NestedButton::showAdditionalButtons(bool isShow)
{
myAdditionalButtonsWidget->setVisible(isShow);
if (isShow) {
}
}
-QWidget * NewGeom_NestedButton::createWidget(QWidget * theParent)
+QWidget * SHAPERGUI_NestedButton::createWidget(QWidget * theParent)
{
myButtonFrame = new QFrame(theParent);
QHBoxLayout* aBoxLay = new QHBoxLayout(myButtonFrame);
return myButtonFrame;
}
-bool NewGeom_NestedButton::event(QEvent* theEvent)
+bool SHAPERGUI_NestedButton::event(QEvent* theEvent)
{
if (theEvent->type() == QEvent::ActionChanged) {
if (myThisButton) {
}
-void NewGeom_NestedButton::actionStateChanged()
+void SHAPERGUI_NestedButton::actionStateChanged()
{
if (isEnabled()) {
QString s = "true";
/*
- * NewGeom_NestedButton.h
+ * SHAPERGUI_NestedButton.h
*
* Created on: Apr 13, 2015
* Author: sbh
* \ingroup Salome
* Custom (nested) button in salome mode.
*/
-class NewGeom_NestedButton : public QWidgetAction
+class SHAPERGUI_NestedButton : public QWidgetAction
{
Q_OBJECT
public:
/// Constructor
/// \param theParent a parent objects
/// \param theNestedActions a list of nested actions
- NewGeom_NestedButton(QObject* theParent, const QList<QAction*>& theNestedActions);
- virtual ~NewGeom_NestedButton();
+ SHAPERGUI_NestedButton(QObject* theParent, const QList<QAction*>& theNestedActions);
+ virtual ~SHAPERGUI_NestedButton();
private slots:
/// Shows/hides the additional buttons widget
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#include "NewGeom_OCCSelector.h"
+#include "SHAPERGUI_OCCSelector.h"
-NewGeom_OCCSelector::NewGeom_OCCSelector(OCCViewer_Viewer* theViewer, SUIT_SelectionMgr* theMgr)
+SHAPERGUI_OCCSelector::SHAPERGUI_OCCSelector(OCCViewer_Viewer* theViewer, SUIT_SelectionMgr* theMgr)
: LightApp_OCCSelector(theViewer, theMgr)
{
}
-NewGeom_OCCSelector::~NewGeom_OCCSelector()
+SHAPERGUI_OCCSelector::~SHAPERGUI_OCCSelector()
{
}
-void NewGeom_OCCSelector::getSelection(SUIT_DataOwnerPtrList& thePtrList) const
+void SHAPERGUI_OCCSelector::getSelection(SUIT_DataOwnerPtrList& thePtrList) const
{
OCCViewer_Viewer* vw = viewer();
if (!vw)
return;
}
-void NewGeom_OCCSelector::setSelection(const SUIT_DataOwnerPtrList& thePtrList)
+void SHAPERGUI_OCCSelector::setSelection(const SUIT_DataOwnerPtrList& thePtrList)
{
OCCViewer_Viewer* vw = viewer();
if (!vw)
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#ifndef NewGeom_OCCSelector_H
-#define NewGeom_OCCSelector_H
+#ifndef SHAPERGUI_OCCSelector_H
+#define SHAPERGUI_OCCSelector_H
-#include "NewGeom.h"
+#include "SHAPER_SHAPERGUI.h"
#include <LightApp_OCCSelector.h>
* \ingroup Salome
* Redefinition of standard OCC selector in order to adapt it to NewGeom needs
*/
-class NewGeom_EXPORT NewGeom_OCCSelector : public LightApp_OCCSelector
+class SHAPERGUI_EXPORT SHAPERGUI_OCCSelector : public LightApp_OCCSelector
{
public:
/// Constructor
/// \param theViewer a viewer
/// \param theMgr a selection manager
- NewGeom_OCCSelector(OCCViewer_Viewer* theViewer, SUIT_SelectionMgr* theMgr);
- virtual ~NewGeom_OCCSelector();
+ SHAPERGUI_OCCSelector(OCCViewer_Viewer* theViewer, SUIT_SelectionMgr* theMgr);
+ virtual ~SHAPERGUI_OCCSelector();
protected:
/// Redifinition of virtual function
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#include "NewGeom_SalomeViewer.h"
-#include "NewGeom_OCCSelector.h"
+#include "SHAPERGUI_SalomeViewer.h"
+#include "SHAPERGUI_OCCSelector.h"
#include <OCCViewer_ViewPort3d.h>
#include <OCCViewer_ViewFrame.h>
#include <QMouseEvent>
#include <QContextMenuEvent>
-NewGeom_SalomeView::NewGeom_SalomeView(OCCViewer_Viewer* theViewer)
+SHAPERGUI_SalomeView::SHAPERGUI_SalomeView(OCCViewer_Viewer* theViewer)
: ModuleBase_IViewWindow(), myCurrentView(0)
{
myViewer = theViewer;
}
-Handle(V3d_View) NewGeom_SalomeView::v3dView() const
+Handle(V3d_View) SHAPERGUI_SalomeView::v3dView() const
{
Handle(V3d_View) aView;
if (myCurrentView) {
return aView;
}
-QWidget* NewGeom_SalomeView::viewPort() const
+QWidget* SHAPERGUI_SalomeView::viewPort() const
{
QWidget* aViewPort = 0;
if (myCurrentView) {
-NewGeom_SalomeViewer::NewGeom_SalomeViewer(QObject* theParent)
+SHAPERGUI_SalomeViewer::SHAPERGUI_SalomeViewer(QObject* theParent)
: ModuleBase_IViewer(theParent),
mySelector(0), myView(0), myIsSelectionChanged(false)
{
}
-NewGeom_SalomeViewer::~NewGeom_SalomeViewer()
+SHAPERGUI_SalomeViewer::~SHAPERGUI_SalomeViewer()
{
if (myView)
delete myView;
//**********************************************
-Handle(AIS_InteractiveContext) NewGeom_SalomeViewer::AISContext() const
+Handle(AIS_InteractiveContext) SHAPERGUI_SalomeViewer::AISContext() const
{
if (mySelector && mySelector->viewer())
return mySelector->viewer()->getAISContext();
}
//**********************************************
-Handle(V3d_Viewer) NewGeom_SalomeViewer::v3dViewer() const
+Handle(V3d_Viewer) SHAPERGUI_SalomeViewer::v3dViewer() const
{
if (mySelector)
return mySelector->viewer()->getViewer3d();
}
//**********************************************
-Handle(AIS_Trihedron) NewGeom_SalomeViewer::trihedron() const
+Handle(AIS_Trihedron) SHAPERGUI_SalomeViewer::trihedron() const
{
return mySelector->viewer()->getTrihedron();
}
//**********************************************
-Handle(V3d_View) NewGeom_SalomeViewer::activeView() const
+Handle(V3d_View) SHAPERGUI_SalomeViewer::activeView() const
{
if (mySelector) {
OCCViewer_Viewer* aViewer = mySelector->viewer();
}
//**********************************************
-QWidget* NewGeom_SalomeViewer::activeViewPort() const
+QWidget* SHAPERGUI_SalomeViewer::activeViewPort() const
{
QWidget* aViewPort;
if (mySelector) {
}
//**********************************************
-void NewGeom_SalomeViewer::setSelector(NewGeom_OCCSelector* theSel)
+void SHAPERGUI_SalomeViewer::setSelector(SHAPERGUI_OCCSelector* theSel)
{
if (mySelector) {
if (mySelector == theSel)
OCCViewer_Viewer* aViewer = mySelector->viewer();
SUIT_ViewManager* aMgr = aViewer->getViewManager();
- myView = new NewGeom_SalomeView(mySelector->viewer());
+ myView = new SHAPERGUI_SalomeView(mySelector->viewer());
// TODO: Provide ModuleBase_IViewWindow interface
connect(aMgr, SIGNAL(lastViewClosed(SUIT_ViewManager*)), this, SIGNAL(lastViewClosed()));
}
//**********************************************
-void NewGeom_SalomeViewer::onSelectionChanged()
+void SHAPERGUI_SalomeViewer::onSelectionChanged()
{
// Selection event must be sent only after mouse release
myIsSelectionChanged = true;
}
//**********************************************
-void NewGeom_SalomeViewer::onMousePress(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
+void SHAPERGUI_SalomeViewer::onMousePress(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
{
myView->setCurrentView(theView);
emit mousePress(myView, theEvent);
}
//**********************************************
-void NewGeom_SalomeViewer::onMouseRelease(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
+void SHAPERGUI_SalomeViewer::onMouseRelease(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
{
myView->setCurrentView(theView);
emit mouseRelease(myView, theEvent);
}
//**********************************************
-void NewGeom_SalomeViewer::onMouseDoubleClick(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
+void SHAPERGUI_SalomeViewer::onMouseDoubleClick(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
{
myView->setCurrentView(theView);
emit mouseDoubleClick(myView, theEvent);
}
//**********************************************
-void NewGeom_SalomeViewer::onMouseMove(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
+void SHAPERGUI_SalomeViewer::onMouseMove(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
{
myView->setCurrentView(theView);
emit mouseMove(myView, theEvent);
}
//**********************************************
-bool NewGeom_SalomeViewer::canDragByMouse() const
+bool SHAPERGUI_SalomeViewer::canDragByMouse() const
{
OCCViewer_Viewer* aViewer = mySelector->viewer();
SUIT_ViewWindow* aWnd = aViewer->getViewManager()->getActiveView();
//**********************************************
-void NewGeom_SalomeViewer::onKeyPress(SUIT_ViewWindow* theView, QKeyEvent* theEvent)
+void SHAPERGUI_SalomeViewer::onKeyPress(SUIT_ViewWindow* theView, QKeyEvent* theEvent)
{
emit keyPress(myView, theEvent);
}
//**********************************************
-void NewGeom_SalomeViewer::onKeyRelease(SUIT_ViewWindow* theView, QKeyEvent* theEvent)
+void SHAPERGUI_SalomeViewer::onKeyRelease(SUIT_ViewWindow* theView, QKeyEvent* theEvent)
{
emit keyRelease(myView, theEvent);
}
//**********************************************
-void NewGeom_SalomeViewer::onTryCloseView(SUIT_ViewWindow*)
+void SHAPERGUI_SalomeViewer::onTryCloseView(SUIT_ViewWindow*)
{
emit tryCloseView(myView);
}
//**********************************************
-void NewGeom_SalomeViewer::onDeleteView(SUIT_ViewWindow*)
+void SHAPERGUI_SalomeViewer::onDeleteView(SUIT_ViewWindow*)
{
if(myWindowScale.contains(myView->v3dView()))
myWindowScale.remove(myView->v3dView());
}
//**********************************************
-void NewGeom_SalomeViewer::onViewCreated(SUIT_ViewWindow* theView)
+void SHAPERGUI_SalomeViewer::onViewCreated(SUIT_ViewWindow* theView)
{
myView->setCurrentView(theView);
}
//**********************************************
-void NewGeom_SalomeViewer::onActivated(SUIT_ViewManager* theMgr)
+void SHAPERGUI_SalomeViewer::onActivated(SUIT_ViewManager* theMgr)
{
myView->setCurrentView(theMgr->getActiveView());
emit activated(myView);
}
//**********************************************
-void NewGeom_SalomeViewer::enableSelection(bool isEnabled)
+void SHAPERGUI_SalomeViewer::enableSelection(bool isEnabled)
{
if (mySelector)
if (mySelector->viewer()->isSelectionEnabled() != isEnabled)
}
//**********************************************
-bool NewGeom_SalomeViewer::isSelectionEnabled() const
+bool SHAPERGUI_SalomeViewer::isSelectionEnabled() const
{
if (mySelector)
return mySelector->viewer()->isSelectionEnabled();
}
//**********************************************
-void NewGeom_SalomeViewer::enableMultiselection(bool isEnable)
+void SHAPERGUI_SalomeViewer::enableMultiselection(bool isEnable)
{
if (mySelector)
mySelector->viewer()->enableMultiselection(isEnable);
}
//**********************************************
-bool NewGeom_SalomeViewer::isMultiSelectionEnabled() const
+bool SHAPERGUI_SalomeViewer::isMultiSelectionEnabled() const
{
if (mySelector)
return mySelector->viewer()->isMultiSelectionEnabled();
}
//**********************************************
-bool NewGeom_SalomeViewer::enableDrawMode(bool isEnabled)
+bool SHAPERGUI_SalomeViewer::enableDrawMode(bool isEnabled)
{
// TODO: Has to be replaced when SALOME patch become available
if (mySelector)
}
//**********************************************
-void NewGeom_SalomeViewer::reconnectActions(SUIT_ViewWindow* theWindow,
+void SHAPERGUI_SalomeViewer::reconnectActions(SUIT_ViewWindow* theWindow,
const bool theUseNewGeomSlot)
{
OCCViewer_ViewWindow* aWindow = dynamic_cast<OCCViewer_ViewWindow*>(theWindow);
}
//**********************************************
-void NewGeom_SalomeViewer::fitAll()
+void SHAPERGUI_SalomeViewer::fitAll()
{
if (mySelector) {
SUIT_ViewManager* aMgr = mySelector->viewer()->getViewManager();
}
//**********************************************
-void NewGeom_SalomeViewer::setViewProjection(double theX, double theY, double theZ, double theTwist)
+void SHAPERGUI_SalomeViewer::setViewProjection(double theX, double theY, double theZ, double theTwist)
{
if (!mySelector)
return;
}
//***************************************
-void NewGeom_SalomeViewer::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
+void SHAPERGUI_SalomeViewer::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
if (!aContext.IsNull()) {
}
//***************************************
-void NewGeom_SalomeViewer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
+void SHAPERGUI_SalomeViewer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
if (!aContext.IsNull()) {
}
//***************************************
-bool NewGeom_SalomeViewer::hasSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
+bool SHAPERGUI_SalomeViewer::hasSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
{
bool aFoundFilter = false;
Handle(AIS_InteractiveContext) aContext = AISContext();
}
//***************************************
-void NewGeom_SalomeViewer::clearSelectionFilters()
+void SHAPERGUI_SalomeViewer::clearSelectionFilters()
{
Handle(AIS_InteractiveContext) aContext = AISContext();
if (!aContext.IsNull()) {
}
//***************************************
-void NewGeom_SalomeViewer::update()
+void SHAPERGUI_SalomeViewer::update()
{
Handle(AIS_InteractiveContext) aContext = AISContext();
if (!aContext.IsNull()) {
}
//***************************************
-void NewGeom_SalomeViewer::onViewTransformed(OCCViewer_ViewWindow::OperationType theType)
+void SHAPERGUI_SalomeViewer::onViewTransformed(OCCViewer_ViewWindow::OperationType theType)
{
emit viewTransformed((int) theType);
}
//***************************************
-void NewGeom_SalomeViewer::onViewPortMapped()
+void SHAPERGUI_SalomeViewer::onViewPortMapped()
{
emit trihedronVisibilityChanged(true);
}
//***************************************
-void NewGeom_SalomeViewer::activateViewer(bool toActivate)
+void SHAPERGUI_SalomeViewer::activateViewer(bool toActivate)
{
if (!mySelector || !mySelector->viewer())
return;
}
}
-void NewGeom_SalomeViewer::Zfitall()
+void SHAPERGUI_SalomeViewer::Zfitall()
{
if (!mySelector || !mySelector->viewer())
return;
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#ifndef NewGeom_SalomeViewer_H
-#define NewGeom_SalomeViewer_H
+#ifndef SHAPERGUI_SalomeViewer_H
+#define SHAPERGUI_SalomeViewer_H
-#include "NewGeom.h"
+#include "SHAPER_SHAPERGUI.h"
#include <ModuleBase_IViewer.h>
#include <ModuleBase_IViewWindow.h>
class QMouseEvent;
class QKeyEvent;
-class NewGeom_OCCSelector;
+class SHAPERGUI_OCCSelector;
class OCCViewer_Viewer;
class SUIT_ViewManager;
* A class for providing access of NewGeom functionality to
* SALOME view window functionality
*/
-class NewGeom_SalomeView: public ModuleBase_IViewWindow
+class SHAPERGUI_SalomeView: public ModuleBase_IViewWindow
{
public:
/// Constructor
/// \param theViewer a reference to a viewer
- NewGeom_SalomeView(OCCViewer_Viewer* theViewer);
+ SHAPERGUI_SalomeView(OCCViewer_Viewer* theViewer);
virtual Handle(V3d_View) v3dView() const;
* A class for providing access of NewGeom functionality to
* SALOME viewer functionality
*/
-class NewGeom_SalomeViewer : public ModuleBase_IViewer
+class SHAPERGUI_SalomeViewer : public ModuleBase_IViewer
{
Q_OBJECT
public:
/// Constructor
/// \param theParent a parent object
- NewGeom_SalomeViewer(QObject* theParent);
+ SHAPERGUI_SalomeViewer(QObject* theParent);
- ~NewGeom_SalomeViewer();
+ ~SHAPERGUI_SalomeViewer();
//! Returns AIS_InteractiveContext from current OCCViewer
virtual Handle(AIS_InteractiveContext) AISContext() const;
/// Set selector
/// \param theSel a selector instance
- void setSelector(NewGeom_OCCSelector* theSel);
+ void setSelector(SHAPERGUI_OCCSelector* theSel);
/// Add selection filter to the viewer
virtual void addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
virtual void clearSelectionFilters();
/// Returns current selector
- NewGeom_OCCSelector* selector() const
+ SHAPERGUI_OCCSelector* selector() const
{
return mySelector;
}
void onViewPortMapped();
private:
- NewGeom_OCCSelector* mySelector;
- NewGeom_SalomeView* myView;
+ SHAPERGUI_OCCSelector* mySelector;
+ SHAPERGUI_SalomeView* myView;
bool myIsSelectionChanged;
};
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#ifndef NewGeom_H
-#define NewGeom_H
+#ifndef SHAPER_SHAPERGUI_H
+#define SHAPER_SHAPERGUI_H
-#if defined NewGeom_EXPORTS
+#if defined SHAPERGUI_EXPORTS
#if defined WIN32
-#define NewGeom_EXPORT __declspec( dllexport )
+#define SHAPERGUI_EXPORT __declspec( dllexport )
#else
-#define NewGeom_EXPORT
+#define SHAPERGUI_EXPORT
#endif
#else
#if defined WIN32
-#define NewGeom_EXPORT __declspec( dllimport )
+#define SHAPERGUI_EXPORT __declspec( dllimport )
#else
-#define NewGeom_EXPORT
+#define SHAPERGUI_EXPORT
#endif
#endif