VisuGUI_Slider.cxx \
VisuGUI_InputPane.cxx \
VisuGUI_CacheDlg.cxx \
- VisuGUI_FieldFilter.cxx
+ VisuGUI_FieldFilter.cxx \
+ VisuGUI_ViewExtender.cxx \
+ VisuGUI_ClippingPlaneMgr.cxx
MOC_FILES= \
VisuGUI_moc.cxx \
VisuGUI_TransparencyDlg_moc.cxx \
VisuGUI_Slider_moc.cxx \
VisuGUI_InputPane_moc.cxx \
- VisuGUI_CacheDlg_moc.cxx
+ VisuGUI_CacheDlg_moc.cxx \
+ VisuGUI_ViewExtender_moc.cxx \
+ VisuGUI_ClippingPlaneMgr_moc.cxx
nodist_libVISU_la_SOURCES=$(MOC_FILES)
<translation>auto</translation>
</message>
</context>
+ <context>
+ <name>VisuGUI_ClippingPlaneMgr</name>
+ <message>
+ <source>TITLE</source>
+ <translation>Clipping planes configuration</translation>
+ </message>
+ <message>
+ <source>TITLE_PLANES</source>
+ <translation>Planes definition</translation>
+ </message>
+ <message>
+ <source>LBL_NAME</source>
+ <translation>Name of the plane</translation>
+ </message>
+ <message>
+ <source>BYVECTOR_TITLE</source>
+ <translation>Normal vector</translation>
+ </message>
+ <message>
+ <source>BYPLANE_TITLE</source>
+ <translation>Main plane</translation>
+ </message>
+ <message>
+ <source>CHK_AUTOAPPLY</source>
+ <translation>Auto apply</translation>
+ </message>
+ <message>
+ <source>CHK_SHOW_PREVIEW</source>
+ <translation>Show preview</translation>
+ </message>
+ <message>
+ <source>ORIGIN_TITLE</source>
+ <translation>Origin</translation>
+ </message>
+ <message>
+ <source>DIRECTION_TITLE</source>
+ <translation>Direction</translation>
+ </message>
+ <message>
+ <source>LBL_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>LBL_DISTANCE</source>
+ <translation>Distance</translation>
+ </message>
+ <message>
+ <source>LBL_ROTATION</source>
+ <translation>Rotation around %1</translation>
+ </message>
+ <message>
+ <source>BTN_NEW</source>
+ <translation>New</translation>
+ </message>
+ <message>
+ <source>BTN_DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ </context>
+ <context>
+ <name>VisuGUI_ViewExtender</name>
+ <message>
+ <source>MNU_CLIPPING_PLANE_MGR</source>
+ <translation>Clipping planes</translation>
+ </message>
+ <message>
+ <source>DSK_CLIPPING_PLANE_MGR</source>
+ <translation>Manage clipping planes in the viewer</translation>
+ </message>
+ <message>
+ <source>VISU_VIEW_TOOLBAR</source>
+ <translation>VISU tools</translation>
+ </message>
+ </context>
</TS>
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "VisuGUI_ClippingPlaneMgr.h"
+
+#include "VisuGUI.h"
+#include "VisuGUI_Tools.h"
+
+#include <SUIT_Desktop.h>
+#include <QtxDoubleSpinBox.h>
+
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QListView>
+#include <QLineEdit>
+#include <QTabWidget>
+#include <QWidget>
+#include <QGroupBox>
+#include <QGridLayout>
+#include <QComboBox>
+#include <QCheckBox>
+#include <QPushButton>
+
+
+using namespace std;
+
+VisuGUI_ClippingPlaneMgr::VisuGUI_ClippingPlaneMgr(VisuGUI* theModule)
+ : QDialog(VISU::GetDesktop(theModule), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ myModule(theModule)
+{
+ setWindowTitle(tr("TITLE"));
+ setSizeGripEnabled(true);
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setModal(false);
+
+ QVBoxLayout* aMainLayout = new QVBoxLayout(this);
+ aMainLayout->setSpacing(6);
+ aMainLayout->setMargin(11);
+
+ QHBoxLayout* aPlanesBox = new QHBoxLayout(this);
+ aPlanesBox->setMargin(6);
+ aMainLayout->addLayout(aPlanesBox);
+
+ myPlanesList = new QListView(this);
+ aPlanesBox->addWidget(myPlanesList);
+
+ // Planes parameters box
+ QFrame* aPlanesFrame = new QFrame(this);
+ aPlanesFrame->setWindowTitle(tr("TITLE_PLANES"));
+ aPlanesBox->addWidget(aPlanesFrame);
+
+ QVBoxLayout* aFrameLayout = new QVBoxLayout(aPlanesFrame);
+ aFrameLayout->setSpacing(5);
+ aFrameLayout->setMargin(6);
+
+ QHBoxLayout* aNameBox = new QHBoxLayout(aPlanesFrame);
+ aFrameLayout->addLayout(aNameBox);
+ aNameBox->setSpacing(5);
+
+ aNameBox->addWidget(new QLabel(tr("LBL_NAME"), aPlanesFrame));
+ myNameEdt = new QLineEdit(aPlanesFrame);
+ aNameBox->addWidget(myNameEdt);
+
+ myMethodTab = new QTabWidget(aPlanesFrame);
+ aFrameLayout->addWidget(myMethodTab);
+
+ myMethodTab->addTab(createVectorTab(), tr("BYVECTOR_TITLE"));
+ myMethodTab->addTab(createPlanesTab(), tr("BYPLANE_TITLE"));
+
+ myAutoApply = new QCheckBox(tr("CHK_AUTOAPPLY"), aPlanesFrame);
+ aFrameLayout->addWidget(myAutoApply);
+
+ // Buttons for management of planes
+ QHBoxLayout* aManageBox = new QHBoxLayout(this);
+ aMainLayout->addLayout(aManageBox);
+ aManageBox->setMargin(6);
+
+ QPushButton* aNewBtn = new QPushButton(tr("BTN_NEW"), this);
+ aManageBox->addWidget(aNewBtn);
+
+ QPushButton* aDeleteBtn = new QPushButton(tr("BTN_DELETE"), this);
+ aManageBox->addWidget(aDeleteBtn);
+
+ aManageBox->addStretch();
+
+ myShowPreview = new QCheckBox(tr("CHK_SHOW_PREVIEW"), this);
+ aManageBox->addWidget(myShowPreview);
+
+ // Dialog buttons
+ QGroupBox* aGroupButtons = new QGroupBox (this);
+ aMainLayout->addWidget(aGroupButtons);
+
+ QSizePolicy aSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed );
+ QHBoxLayout* aButtonsLayout = new QHBoxLayout(aGroupButtons);
+ aButtonsLayout->setSpacing(6);
+ aButtonsLayout->setMargin(11);
+
+ QPushButton* aBtnOk = new QPushButton(tr("BUT_OK"), aGroupButtons);
+ aButtonsLayout->addWidget(aBtnOk);
+
+ QPushButton* aBtnApply = new QPushButton(tr("BUT_APPLY"), aGroupButtons);
+ aButtonsLayout->addWidget(aBtnApply);
+
+ aButtonsLayout->addStretch();
+
+ QPushButton* aBtnClose = new QPushButton(tr("BUT_CLOSE"), aGroupButtons);
+ aButtonsLayout->addWidget(aBtnClose);
+
+ QPushButton* aBtnHelp = new QPushButton(tr("BUT_HELP"), aGroupButtons);
+ aButtonsLayout->addWidget(aBtnHelp);
+}
+
+
+//****************************************************************
+QWidget* VisuGUI_ClippingPlaneMgr::createVectorTab()
+{
+ QWidget* aVectorTab = new QWidget(myMethodTab);
+ QVBoxLayout* aVectorTabLayout = new QVBoxLayout(aVectorTab);
+
+ QGroupBox* aOriginGroup = new QGroupBox( tr( "ORIGIN_TITLE" ), aVectorTab );
+ aVectorTabLayout->addWidget(aOriginGroup);
+ QHBoxLayout* aOriginLayout = new QHBoxLayout(aOriginGroup);
+
+ aOriginLayout->addWidget( new QLabel("X", aOriginGroup) );
+ myXOrigin = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aOriginGroup );
+ myXOrigin->setValue( 0.0 );
+ aOriginLayout->addWidget( myXOrigin );
+
+ aOriginLayout->addWidget( new QLabel("Y", aOriginGroup) );
+ myYOrigin = new QtxDoubleSpinBox( -1000.0, 1000, 0.1, aOriginGroup );
+ myYOrigin->setValue( 0.0 );
+ aOriginLayout->addWidget( myYOrigin );
+
+ aOriginLayout->addWidget( new QLabel("Z", aOriginGroup) );
+ myZOrigin = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aOriginGroup );
+ myZOrigin->setValue( 0.0 );
+ aOriginLayout->addWidget( myZOrigin );
+
+ QGroupBox* aDirGroup = new QGroupBox( tr( "DIRECTION_TITLE" ), aVectorTab );
+ aVectorTabLayout->addWidget(aDirGroup);
+ QHBoxLayout* aDirLayout = new QHBoxLayout(aDirGroup);
+
+ aDirLayout->addWidget( new QLabel("dX", aDirGroup) );
+ myXDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup );
+ myXDir->setValue( 0.0 );
+ aDirLayout->addWidget( myXDir );
+
+ aDirLayout->addWidget( new QLabel("dY", aDirGroup) );
+ myYDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup );
+ myYDir->setValue( 0.0 );
+ aDirLayout->addWidget( myYDir );
+
+ aDirLayout->addWidget( new QLabel("dZ", aDirGroup) );
+ myZDir = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, aDirGroup );
+ myZDir->setValue( 0.0 );
+ aDirLayout->addWidget( myZDir );
+
+
+ return aVectorTab;
+}
+
+
+//****************************************************************
+QWidget* VisuGUI_ClippingPlaneMgr::createPlanesTab()
+{
+ QWidget* aPlanesTab = new QWidget(myMethodTab);
+ QGridLayout* aVectorTabLayout = new QGridLayout(aPlanesTab);
+
+ aVectorTabLayout->addWidget(new QLabel(tr("LBL_ORIENTATION"), aPlanesTab), 0, 0);
+ aVectorTabLayout->addWidget(new QLabel(tr("LBL_DISTANCE"), aPlanesTab), 1, 0);
+
+ myPlaneCombo = new QComboBox(aPlanesTab);
+ myPlaneCombo->addItem("|| X-Y");
+ myPlaneCombo->addItem("|| Y-Z");
+ myPlaneCombo->addItem("|| X-Z");
+ aVectorTabLayout->addWidget(myPlaneCombo, 0, 1);
+
+ myDistance = new QtxDoubleSpinBox( -1000, 1000, 1, aPlanesTab );
+ myDistance->setValue( 0.0 );
+ aVectorTabLayout->addWidget( myDistance, 1, 1 );
+
+ myRotationXLbl = new QLabel(tr("LBL_ROTATION").arg("X"), aPlanesTab);
+ aVectorTabLayout->addWidget(myRotationXLbl, 0, 2);
+
+ myRotX = new QtxDoubleSpinBox( -180.0, 180.0, 1, aPlanesTab );
+ myRotX->setValue( 0.0 );
+ aVectorTabLayout->addWidget( myRotX, 0, 3 );
+
+ myRotationYLbl = new QLabel(tr("LBL_ROTATION").arg("Y"), aPlanesTab);
+ aVectorTabLayout->addWidget(myRotationYLbl, 1, 2);
+
+ myRotY = new QtxDoubleSpinBox( -180.0, 180.0, 1, aPlanesTab );
+ myRotY->setValue( 0.0 );
+ aVectorTabLayout->addWidget( myRotY, 1, 3 );
+
+
+ return aPlanesTab;
+}
+
+
+//****************************************************************
+VisuGUI_ClippingPlaneMgr::~VisuGUI_ClippingPlaneMgr()
+{
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef DIALOGBOX_CLIPPINGPLANEMGR_H
+#define DIALOGBOX_CLIPPINGPLANEMGR_H
+
+#include <QDialog>
+
+class VisuGUI;
+class QListView;
+class QLineEdit;
+class QtxDoubleSpinBox;
+class QTabWidget;
+class QLabel;
+class QComboBox;
+class QCheckBox;
+
+class VisuGUI_ClippingPlaneMgr : public QDialog
+{
+ Q_OBJECT
+public:
+
+ VisuGUI_ClippingPlaneMgr(VisuGUI* theModule);
+ ~VisuGUI_ClippingPlaneMgr();
+
+ private:
+ QWidget* createVectorTab();
+ QWidget* createPlanesTab();
+
+ QListView* myPlanesList;
+ QLineEdit* myNameEdt;
+ VisuGUI* myModule;
+ QTabWidget* myMethodTab;
+
+ QtxDoubleSpinBox* myXOrigin;
+ QtxDoubleSpinBox* myYOrigin;
+ QtxDoubleSpinBox* myZOrigin;
+
+ QtxDoubleSpinBox* myXDir;
+ QtxDoubleSpinBox* myYDir;
+ QtxDoubleSpinBox* myZDir;
+
+ QLabel* myRotationXLbl;
+ QLabel* myRotationYLbl;
+
+ QComboBox* myPlaneCombo;
+ QtxDoubleSpinBox* myDistance;
+ QtxDoubleSpinBox* myRotX;
+ QtxDoubleSpinBox* myRotY;
+
+ QCheckBox* myAutoApply;
+ QCheckBox* myShowPreview;
+};
+
+#endif
// $Header$
#include "VisuGUI_Module.h"
+#include "VisuGUI_ViewExtender.h"
#include "QtxPopupMgr.h"
VisuGUI_Module() :
VisuGUI()
{
+ myExtender = new VisuGUI_ViewExtender(this);
}
#include "VisuGUI.h"
#include "STD_Application.h"
#include "SALOMEDSClient_SObject.hxx"
+#include <CAM_ViewExtender.h>
+#include "VisuGUI_ViewExtender.h"
class SUIT_ViewManager;
class SVTK_ViewManager;
void
restoreVisualParameters(int savePoint);
+ //! Returns Module dedicated extension for Viewer. Returns 0 if module has no extension
+ virtual CAM_ViewExtender* getViewExtender() { return myExtender; }
+
public slots:
//! Reimplemented method of the module deactivation.
virtual
void setProperty( SVTK_ViewWindow*, const QString& ); // set a property (speed_increment, etc ) for SVTK ViewWindow
void setProperty( SVTK_ViewManager*, const QString& ); // set a property for SVTK ViewWindow // set only 1 property for all ViewWindows of given view manager
+
+
+ VisuGUI_ViewExtender* myExtender;
};
#endif
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_ViewExtender.cxx
+// Author : Vitaly Smetannikov
+// Module : VISU
+
+
+
+#include "VisuGUI_ViewExtender.h"
+
+// #include <SUIT_Application.h>
+#include "VisuGUI_ClippingPlaneMgr.h"
+#include "VisuGUI.h"
+
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <QtxAction.h>
+#include <QtxActionToolMgr.h>
+#include <QDialog>
+
+//using namespace std;
+
+VisuGUI_ViewExtender::VisuGUI_ViewExtender(VisuGUI* theModule):
+ myModule(theModule),
+ myNonModalDlg(0)
+{
+ QtxAction* aAction;
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ aAction = new QtxAction(tr("MNU_CLIPPING_PLANE_MGR"),
+ aResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH")),
+ tr( "DSK_CLIPPING_PLANE_MGR" ),
+ 0,
+ this,
+ false);
+ connect(aAction, SIGNAL( activated() ), this, SLOT( onPlanesMgr() ));
+ myActionsMap[ClippingPlaneMgrId] = aAction;
+}
+
+VisuGUI_ViewExtender::~VisuGUI_ViewExtender()
+{
+}
+
+int VisuGUI_ViewExtender::createToolbar(QtxActionToolMgr* theMgr)
+{
+ int aToolBar = theMgr->createToolBar( QObject::tr("VISU_VIEW_TOOLBAR"));
+ theMgr->append( myActionsMap[ClippingPlaneMgrId], aToolBar );
+ return aToolBar;
+}
+
+void VisuGUI_ViewExtender::contextMenuPopup(QMenu* theMenu)
+{
+ printf("#### contextMenuPopup\n");
+}
+
+void VisuGUI_ViewExtender::onPlanesMgr()
+{
+ myNonModalDlg = new VisuGUI_ClippingPlaneMgr(myModule);
+ connect(myNonModalDlg, SIGNAL( destroyed(QObject*) ), this, SLOT( onDialogDestroy() ));
+ myNonModalDlg->show();
+}
+
+void VisuGUI_ViewExtender::activate()
+{
+}
+
+void VisuGUI_ViewExtender::deactivate()
+{
+ if (myNonModalDlg) {
+ myNonModalDlg->close();
+ myNonModalDlg = 0;
+ }
+}
+
+void VisuGUI_ViewExtender::onDialogDestroy()
+{
+ disconnect(myNonModalDlg, SIGNAL( destroyed(QObject*) ), this, SLOT( onDialogDestroy() ));
+ myNonModalDlg = 0;
+}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_ViewExtender.h
+// Author : Vitaly Smetannikov
+// Module : VISU
+
+
+#ifndef VisuGUI_ViewExtender_HeaderFile
+#define VisuGUI_ViewExtender_HeaderFile
+
+#include <CAM_ViewExtender.h>
+#include <QObject>
+#include <QMap>
+
+class VisuGUI;
+class QtxAction;
+class QDialog;
+
+class VisuGUI_ViewExtender: public QObject, public CAM_ViewExtender
+{
+ Q_OBJECT
+
+ public:
+ VisuGUI_ViewExtender(VisuGUI* theModule);
+
+ virtual ~VisuGUI_ViewExtender();
+
+ virtual int createToolbar(QtxActionToolMgr* theMgr);
+ virtual void contextMenuPopup(QMenu* theMenu);
+
+ virtual void activate();
+ virtual void deactivate();
+
+private slots:
+ void onPlanesMgr();
+ void onDialogDestroy();
+
+ private:
+ enum { ClippingPlaneMgrId };
+
+ QMap<int, QtxAction*> myActionsMap;
+ VisuGUI* myModule;
+
+ QDialog* myNonModalDlg;
+};
+
+
+#endif