From 94fcbdb75272b55d5b0f792da708def653dede1e Mon Sep 17 00:00:00 2001 From: san Date: Tue, 16 Dec 2008 13:22:41 +0000 Subject: [PATCH] V2008a - invoking cmake from configure and remaining plugins --- configure.ac | 30 ++++++++ src/Makefile.am | 7 +- src/Plugins/CMakeLists.txt | 3 +- src/Plugins/Filter/CMakeLists.txt | 2 +- src/Plugins/ToolBar/CMakeLists.txt | 18 +++++ src/Plugins/ToolBar/MyToolBarActions.cxx | 26 +++++++ src/Plugins/ToolBar/MyToolBarActions.h | 15 ++++ src/Plugins/View/CMakeLists.txt | 45 +++++++++++ src/Plugins/View/MyDisplay.cxx | 18 +++++ src/Plugins/View/MyDisplay.h | 20 +++++ src/Plugins/View/MyView.cxx | 98 ++++++++++++++++++++++++ src/Plugins/View/MyView.h | 53 +++++++++++++ src/Plugins/View/MyViewActiveOptions.cxx | 98 ++++++++++++++++++++++++ src/Plugins/View/MyViewActiveOptions.h | 67 ++++++++++++++++ src/Plugins/View/MyViewOptions.cxx | 92 ++++++++++++++++++++++ src/Plugins/View/MyViewOptions.h | 73 ++++++++++++++++++ src/Plugins/View/MyViewSM.xml | 38 +++++++++ 17 files changed, 699 insertions(+), 4 deletions(-) create mode 100755 src/Plugins/ToolBar/CMakeLists.txt create mode 100755 src/Plugins/ToolBar/MyToolBarActions.cxx create mode 100755 src/Plugins/ToolBar/MyToolBarActions.h create mode 100755 src/Plugins/View/CMakeLists.txt create mode 100755 src/Plugins/View/MyDisplay.cxx create mode 100755 src/Plugins/View/MyDisplay.h create mode 100755 src/Plugins/View/MyView.cxx create mode 100755 src/Plugins/View/MyView.h create mode 100755 src/Plugins/View/MyViewActiveOptions.cxx create mode 100755 src/Plugins/View/MyViewActiveOptions.h create mode 100755 src/Plugins/View/MyViewOptions.cxx create mode 100755 src/Plugins/View/MyViewOptions.h create mode 100755 src/Plugins/View/MyViewSM.xml diff --git a/configure.ac b/configure.ac index 70ff7606..d4981bdd 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,18 @@ case "$INSTALL" in ;; esac +echo +echo --------------------------------------------- +echo Testing CMake +echo --------------------------------------------- +echo + +AC_CHECK_PROG(HAS_CMAKE,cmake,"yes") +AM_CONDITIONAL(BUILD_PLUGINS, test "$HAS_CMAKE" = "yes") +if test "$HAS_CMAKE" != "yes"; then + AC_MSG_WARN(CMake not found so ParaView plugins will not be built) +fi + echo echo --------------------------------------------- echo testing C/C++ @@ -280,6 +292,23 @@ do eval echo \$$var done +# Generating makefiles for ParaView plugins using CMake +# cmake executable must be available in PATH +if test "$HAS_CMAKE" = "yes"; then + + echo + echo --------------------------------------------- + echo Invoking CMake to generate Makefiles for ParaView plugins + echo --------------------------------------------- + echo + + curdir=`pwd` + cd ./src/Plugins + cmake -D ParaView_DIR=${PVINSTALLHOME} -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=${PARAVIS_ROOT_DIR}/lib/salome ${ROOT_SRCDIR}/src/Plugins + cd $curdir +fi + + dnl We don t need to say when we re entering directories if we re using dnl GNU make becuase make does it for us. if test "X$GMAKE" = "Xyes"; then @@ -318,3 +347,4 @@ AC_OUTPUT([ \ ./PARAVIS_version.h \ Makefile \ ]) + diff --git a/src/Makefile.am b/src/Makefile.am index 3b8741f7..c9e363eb 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,4 +25,9 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am -SUBDIRS = PVGUI +if BUILD_PLUGINS + SUBDIRS = PVGUI Plugins +else + SUBDIRS = PVGUI +endif + diff --git a/src/Plugins/CMakeLists.txt b/src/Plugins/CMakeLists.txt index a9aad206..fa4a18a7 100755 --- a/src/Plugins/CMakeLists.txt +++ b/src/Plugins/CMakeLists.txt @@ -7,5 +7,4 @@ ENDIF(COMMAND CMAKE_POLICY) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) -SUBDIRS(Filter) - +SUBDIRS(Filter ToolBar View) diff --git a/src/Plugins/Filter/CMakeLists.txt b/src/Plugins/Filter/CMakeLists.txt index 16298101..3fbab882 100755 --- a/src/Plugins/Filter/CMakeLists.txt +++ b/src/Plugins/Filter/CMakeLists.txt @@ -9,5 +9,5 @@ ADD_PARAVIEW_PLUGIN(SMSampleFilter "1.0" INSTALL( TARGETS SMSampleFilter - DESTINATION lib/salome + DESTINATION . ) diff --git a/src/Plugins/ToolBar/CMakeLists.txt b/src/Plugins/ToolBar/CMakeLists.txt new file mode 100755 index 00000000..ca0d2cb0 --- /dev/null +++ b/src/Plugins/ToolBar/CMakeLists.txt @@ -0,0 +1,18 @@ + +# create a plugin that implements a sample toolbar action + +QT4_WRAP_CPP(MOC_SRCS MyToolBarActions.h) + +# we implement a pqConePanel.h for the ConeSource +ADD_PARAVIEW_ACTION_GROUP(IFACES IFACE_SRCS CLASS_NAME MyToolBarActions + GROUP_NAME "ToolBar/MyActions") + +# create a plugin for this panel +ADD_PARAVIEW_PLUGIN(GUISampleToolBar "1.0" + GUI_INTERFACES ${IFACES} + SOURCES MyToolBarActions.cxx ${MOC_SRCS} ${IFACE_SRCS}) + +INSTALL( + TARGETS GUISampleToolBar + DESTINATION . +) diff --git a/src/Plugins/ToolBar/MyToolBarActions.cxx b/src/Plugins/ToolBar/MyToolBarActions.cxx new file mode 100755 index 00000000..c5077d8c --- /dev/null +++ b/src/Plugins/ToolBar/MyToolBarActions.cxx @@ -0,0 +1,26 @@ + + +#include "MyToolBarActions.h" + +#include +#include +#include + +MyToolBarActions::MyToolBarActions(QObject* p) + : QActionGroup(p) +{ + QIcon icon = qApp->style()->standardIcon(QStyle::SP_MessageBoxCritical); + + QAction* a = this->addAction(new QAction(icon, "MyAction", this)); + QObject::connect(a, SIGNAL(triggered(bool)), this, SLOT(onAction())); +} + +MyToolBarActions::~MyToolBarActions() +{ +} + +void MyToolBarActions::onAction() +{ + QMessageBox::information(NULL, "MyAction", "MyAction was invoked\n"); +} + diff --git a/src/Plugins/ToolBar/MyToolBarActions.h b/src/Plugins/ToolBar/MyToolBarActions.h new file mode 100755 index 00000000..97ad0aa4 --- /dev/null +++ b/src/Plugins/ToolBar/MyToolBarActions.h @@ -0,0 +1,15 @@ + +#include + +class MyToolBarActions : public QActionGroup +{ + Q_OBJECT +public: + MyToolBarActions(QObject* p); + ~MyToolBarActions(); + +public slots: + void onAction(); + +}; + diff --git a/src/Plugins/View/CMakeLists.txt b/src/Plugins/View/CMakeLists.txt new file mode 100755 index 00000000..880ebd41 --- /dev/null +++ b/src/Plugins/View/CMakeLists.txt @@ -0,0 +1,45 @@ + +# create a plugin with a custom view that shows up in ParaView's multi-view +# manager. this plugin also contains a custom display panel + +# moc the Qt based .h files +QT4_WRAP_CPP(MOC_SRCS MyView.h MyDisplay.h MyViewActiveOptions.h MyViewOptions.h) + +# invoke macro to create sources for our custom view and display panel +ADD_PARAVIEW_VIEW_MODULE( + # returns the interfaces defined (pass in + # GUI_INTERFACES parameter) + IFACES + # returns a list of source files for this interface + IFACE_SRCS + # give the view type + # With MyView.h implementing a + # pqGenericViewModule and MyView being the XML name + # for the view on the server side + VIEW_TYPE MyView + # the XML group of the view in the server manager xml + VIEW_XML_GROUP views + # the XML name of the display for this view + DISPLAY_XML MyDisplay + # the name of the display panel for this display + # With MyDisplay.h implementing pqDisplayPanel + DISPLAY_PANEL MyDisplay) + + +ADD_PARAVIEW_VIEW_OPTIONS(OPTIONS_IFACE OPTIONS_IFACE_SRCS + VIEW_TYPE MyView ACTIVE_VIEW_OPTIONS MyViewActiveOptions) + +# create a GUI side plugin with the GUI side code +ADD_PARAVIEW_PLUGIN(GUISampleView "1.0" GUI_INTERFACES ${IFACES} ${OPTIONS_IFACE} + GUI_SOURCES MyView.cxx MyDisplay.cxx MyViewActiveOptions.cxx MyViewOptions.cxx + ${MOC_SRCS} ${IFACE_SRCS} ${OPTIONS_IFACE_SRCS}) + +# create a server side plugin with the server side code +ADD_PARAVIEW_PLUGIN(SMSampleView "1.0" SERVER_MANAGER_XML MyViewSM.xml) + +# one could combine the two plugins into one if desired + +INSTALL( + TARGETS GUISampleView SMSampleView + DESTINATION . +) diff --git a/src/Plugins/View/MyDisplay.cxx b/src/Plugins/View/MyDisplay.cxx new file mode 100755 index 00000000..cded766a --- /dev/null +++ b/src/Plugins/View/MyDisplay.cxx @@ -0,0 +1,18 @@ + +#include "MyDisplay.h" + +#include +#include + +MyDisplay::MyDisplay(pqRepresentation* d, QWidget* p) + : pqDisplayPanel(d,p) +{ + // just make a label that shows we made it in the GUI + QVBoxLayout* l = new QVBoxLayout(this); + l->addWidget(new QLabel("From Plugin", this)); +} + +MyDisplay::~MyDisplay() +{ +} + diff --git a/src/Plugins/View/MyDisplay.h b/src/Plugins/View/MyDisplay.h new file mode 100755 index 00000000..309c674a --- /dev/null +++ b/src/Plugins/View/MyDisplay.h @@ -0,0 +1,20 @@ + +#ifndef MyDisplay_h +#define MyDisplay_h + +#include "pqDisplayPanel.h" + +/// a simple display panel widget +class MyDisplay : public pqDisplayPanel +{ + Q_OBJECT +public: + + /// constructor + MyDisplay(pqRepresentation* display, QWidget* p = NULL); + ~MyDisplay(); + +}; + +#endif // MyDisplay_h + diff --git a/src/Plugins/View/MyView.cxx b/src/Plugins/View/MyView.cxx new file mode 100755 index 00000000..5f284ad8 --- /dev/null +++ b/src/Plugins/View/MyView.cxx @@ -0,0 +1,98 @@ + +#include "MyView.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +MyView::MyView(const QString& viewmoduletype, + const QString& group, + const QString& name, + vtkSMViewProxy* viewmodule, + pqServer* server, + QObject* p) + : pqView(viewmoduletype, group, name, viewmodule, server, p) +{ + // our view is just a simple QWidget + this->MyWidget = new QWidget; + this->MyWidget->setAutoFillBackground(true); + new QVBoxLayout(this->MyWidget); + + // connect to display creation so we can show them in our view + this->connect(this, SIGNAL(representationAdded(pqRepresentation*)), + SLOT(onRepresentationAdded(pqRepresentation*))); + this->connect(this, SIGNAL(representationRemoved(pqRepresentation*)), + SLOT(onRepresentationRemoved(pqRepresentation*))); +} + +MyView::~MyView() +{ + delete this->MyWidget; +} + + +QWidget* MyView::getWidget() +{ + return this->MyWidget; +} + +void MyView::onRepresentationAdded(pqRepresentation* d) +{ + // add a label with the display id + QLabel* l = new QLabel( + QString("Display (%1)").arg(d->getProxy()->GetSelfIDAsString()), + this->MyWidget); + this->MyWidget->layout()->addWidget(l); + this->Labels.insert(d, l); +} + +void MyView::onRepresentationRemoved(pqRepresentation* d) +{ + // remove the label + QLabel* l = this->Labels.take(d); + if(l) + { + this->MyWidget->layout()->removeWidget(l); + delete l; + } +} + +void MyView::setBackground(const QColor& c) +{ + QPalette p = this->MyWidget->palette(); + p.setColor(QPalette::Window, c); + this->MyWidget->setPalette(p); +} + +QColor MyView::background() const +{ + return this->MyWidget->palette().color(QPalette::Window); +} + +bool MyView::canDisplay(pqOutputPort* opPort) const +{ + pqPipelineSource* source = opPort? opPort->getSource() : 0; + // check valid source and server connections + if(!source || + this->getServer()->GetConnectionID() != + source->getServer()->GetConnectionID()) + { + return false; + } + + // we can show MyExtractEdges as defined in the server manager xml + if(QString("MyExtractEdges") == source->getProxy()->GetXMLName()) + { + return true; + } + + return false; +} + + diff --git a/src/Plugins/View/MyView.h b/src/Plugins/View/MyView.h new file mode 100755 index 00000000..c9a8865c --- /dev/null +++ b/src/Plugins/View/MyView.h @@ -0,0 +1,53 @@ + +#ifndef _MyView_h +#define _MyView_h + +#include "pqView.h" +#include +#include +class QLabel; + +/// a simple view that shows a QLabel with the display's name in the view +class MyView : public pqView +{ + Q_OBJECT +public: + /// constructor takes a bunch of init stuff and must have this signature to + /// satisfy pqView + MyView(const QString& viewtypemodule, + const QString& group, + const QString& name, + vtkSMViewProxy* viewmodule, + pqServer* server, + QObject* p); + ~MyView(); + + /// don't support save images + bool saveImage(int, int, const QString& ) { return false; } + vtkImageData* captureImage(int) { return NULL; } + vtkImageData* captureImage(const QSize&) { return NULL; } + + /// return the QWidget to give to ParaView's view manager + QWidget* getWidget(); + + /// returns whether this view can display the given source + bool canDisplay(pqOutputPort* opPort) const; + + /// set the background color of this view + void setBackground(const QColor& col); + QColor background() const; + +protected slots: + /// helper slots to create labels + void onRepresentationAdded(pqRepresentation*); + void onRepresentationRemoved(pqRepresentation*); + +protected: + + QWidget* MyWidget; + QMap Labels; + +}; + +#endif // _MyView_h + diff --git a/src/Plugins/View/MyViewActiveOptions.cxx b/src/Plugins/View/MyViewActiveOptions.cxx new file mode 100755 index 00000000..f882ea01 --- /dev/null +++ b/src/Plugins/View/MyViewActiveOptions.cxx @@ -0,0 +1,98 @@ +/*========================================================================= + + Program: ParaView + Module: $RCSfile$ + + Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. + All rights reserved. + + ParaView is a free software; you can redistribute it and/or modify it + under the terms of the ParaView license version 1.2. + + See License_v1.2.txt for the full ParaView license. + A copy of this license can be obtained by contacting + Kitware Inc. + 28 Corporate Drive + Clifton Park, NY 12065 + USA + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=========================================================================*/ + +#include "MyViewActiveOptions.h" + +#include "MyViewOptions.h" + +#include "pqOptionsDialog.h" + +MyViewActiveOptions::MyViewActiveOptions(QObject *parentObject) + : pqActiveViewOptions(parentObject) +{ +} + +MyViewActiveOptions::~MyViewActiveOptions() +{ +} + +void MyViewActiveOptions::showOptions(pqView *view, const QString &page, + QWidget *widgetParent) +{ + if(!this->Dialog) + { + this->Dialog = new pqOptionsDialog(widgetParent); + this->Dialog->setApplyNeeded(true); + this->Dialog->setObjectName("ActiveMyViewOptions"); + this->Dialog->setWindowTitle("My View Options"); + this->Options = new MyViewOptions; + this->Dialog->addOptions(this->Options); + if(page.isEmpty()) + { + QStringList pages = this->Options->getPageList(); + if(pages.size()) + { + this->Dialog->setCurrentPage(pages[0]); + } + } + else + { + this->Dialog->setCurrentPage(page); + } + + this->connect(this->Dialog, SIGNAL(finished(int)), + this, SLOT(finishDialog())); + } + + this->changeView(view); + this->Dialog->show(); +} + +void MyViewActiveOptions::changeView(pqView *view) +{ + this->Options->setView(view); +} + +void MyViewActiveOptions::closeOptions() +{ + if(this->Dialog) + { + this->Dialog->accept(); + } +} + +void MyViewActiveOptions::finishDialog() +{ + emit this->optionsClosed(this); +} + + diff --git a/src/Plugins/View/MyViewActiveOptions.h b/src/Plugins/View/MyViewActiveOptions.h new file mode 100755 index 00000000..f7b373b3 --- /dev/null +++ b/src/Plugins/View/MyViewActiveOptions.h @@ -0,0 +1,67 @@ +/*========================================================================= + + Program: ParaView + Module: $RCSfile$ + + Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. + All rights reserved. + + ParaView is a free software; you can redistribute it and/or modify it + under the terms of the ParaView license version 1.2. + + See License_v1.2.txt for the full ParaView license. + A copy of this license can be obtained by contacting + Kitware Inc. + 28 Corporate Drive + Clifton Park, NY 12065 + USA + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=========================================================================*/ + +#ifndef _MyViewActiveOptions_h +#define _MyViewActiveOptions_h + + +#include "pqActiveViewOptions.h" +#include +class pqOptionsDialog; +class MyViewOptions; + +class MyViewActiveOptions : public pqActiveViewOptions +{ + Q_OBJECT + +public: + /// Creates a MyView view options instance. + MyViewActiveOptions(QObject *parent=0); + virtual ~MyViewActiveOptions(); + + /// pqActiveViewOptions Methods + //@{ + virtual void showOptions(pqView *view, const QString &page, + QWidget *parent=0); + virtual void changeView(pqView *view); + virtual void closeOptions(); + //@} + +protected slots: + void finishDialog(); + +protected: + QPointer Dialog; + QPointer Options; +}; + +#endif diff --git a/src/Plugins/View/MyViewOptions.cxx b/src/Plugins/View/MyViewOptions.cxx new file mode 100755 index 00000000..8f4a35da --- /dev/null +++ b/src/Plugins/View/MyViewOptions.cxx @@ -0,0 +1,92 @@ +/*========================================================================= + + Program: ParaView + Module: $RCSfile$ + + Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. + All rights reserved. + + ParaView is a free software; you can redistribute it and/or modify it + under the terms of the ParaView license version 1.2. + + See License_v1.2.txt for the full ParaView license. + A copy of this license can be obtained by contacting + Kitware Inc. + 28 Corporate Drive + Clifton Park, NY 12065 + USA + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=========================================================================*/ + +#include "MyViewOptions.h" + +#include +#include "pqColorChooserButton.h" +#include "MyView.h" + +//---------------------------------------------------------------------------- +MyViewOptions::MyViewOptions(QWidget *widgetParent) + : pqOptionsContainer(widgetParent) +{ + QHBoxLayout* l = new QHBoxLayout(this); + this->ColorChooser = new pqColorChooserButton(this); + l->addWidget(this->ColorChooser); + QObject::connect(this->ColorChooser, SIGNAL(chosenColorChanged(QColor)), + this, SIGNAL(changesAvailable())); +} + +MyViewOptions::~MyViewOptions() +{ +} + +void MyViewOptions::setPage(const QString&) +{ +} + +QStringList MyViewOptions::getPageList() +{ + QStringList ret; + ret << "My View"; + return ret; +} + +void MyViewOptions::setView(pqView* view) +{ + this->View = qobject_cast(view); + if(this->View) + { + this->ColorChooser->setChosenColor(this->View->background()); + this->ColorChooser->setEnabled(true); + } + else + { + this->ColorChooser->setEnabled(false); + } +} + +void MyViewOptions::applyChanges() +{ + if(!this->View) + { + return; + } + + this->View->setBackground(this->ColorChooser->chosenColor()); +} + +void MyViewOptions::resetChanges() +{ +} + diff --git a/src/Plugins/View/MyViewOptions.h b/src/Plugins/View/MyViewOptions.h new file mode 100755 index 00000000..32ff6762 --- /dev/null +++ b/src/Plugins/View/MyViewOptions.h @@ -0,0 +1,73 @@ +/*========================================================================= + + Program: ParaView + Module: $RCSfile$ + + Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc. + All rights reserved. + + ParaView is a free software; you can redistribute it and/or modify it + under the terms of the ParaView license version 1.2. + + See License_v1.2.txt for the full ParaView license. + A copy of this license can be obtained by contacting + Kitware Inc. + 28 Corporate Drive + Clifton Park, NY 12065 + USA + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=========================================================================*/ + +#ifndef _MyViewOptions_h +#define _MyViewOptions_h + +#include "pqOptionsContainer.h" +#include + +class MyView; +class pqView; +class pqColorChooserButton; + +/// options container for pages of my view options +class MyViewOptions : public pqOptionsContainer +{ + Q_OBJECT + +public: + MyViewOptions(QWidget *parent=0); + virtual ~MyViewOptions(); + + // set the view to show options for + void setView(pqView* view); + + // set the current page + virtual void setPage(const QString &page); + // return a list of strings for pages we have + virtual QStringList getPageList(); + + // apply the changes + virtual void applyChanges(); + // reset the changes + virtual void resetChanges(); + + // tell pqOptionsDialog that we want an apply button + virtual bool isApplyUsed() const { return true; } + +protected: + QPointer View; + pqColorChooserButton* ColorChooser; +}; + +#endif diff --git a/src/Plugins/View/MyViewSM.xml b/src/Plugins/View/MyViewSM.xml new file mode 100755 index 00000000..0ac91be5 --- /dev/null +++ b/src/Plugins/View/MyViewSM.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.2