Salome HOME
V2008a - invoking cmake from configure and remaining plugins V2008a
authorsan <san@opencascade.com>
Tue, 16 Dec 2008 13:22:41 +0000 (13:22 +0000)
committersan <san@opencascade.com>
Tue, 16 Dec 2008 13:22:41 +0000 (13:22 +0000)
17 files changed:
configure.ac
src/Makefile.am
src/Plugins/CMakeLists.txt
src/Plugins/Filter/CMakeLists.txt
src/Plugins/ToolBar/CMakeLists.txt [new file with mode: 0755]
src/Plugins/ToolBar/MyToolBarActions.cxx [new file with mode: 0755]
src/Plugins/ToolBar/MyToolBarActions.h [new file with mode: 0755]
src/Plugins/View/CMakeLists.txt [new file with mode: 0755]
src/Plugins/View/MyDisplay.cxx [new file with mode: 0755]
src/Plugins/View/MyDisplay.h [new file with mode: 0755]
src/Plugins/View/MyView.cxx [new file with mode: 0755]
src/Plugins/View/MyView.h [new file with mode: 0755]
src/Plugins/View/MyViewActiveOptions.cxx [new file with mode: 0755]
src/Plugins/View/MyViewActiveOptions.h [new file with mode: 0755]
src/Plugins/View/MyViewOptions.cxx [new file with mode: 0755]
src/Plugins/View/MyViewOptions.h [new file with mode: 0755]
src/Plugins/View/MyViewSM.xml [new file with mode: 0755]

index 70ff760602a930cfec0c9d1a18fff0cec0eee3e3..d4981bdd17a73c8c07e595ef4d4664dc6c48672e 100644 (file)
@@ -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 \
 ])
+
index 3b8741f7d1e3ba52b907b7fb30328437cde0bb15..c9e363ebe2042fa2db70d90ff047a38f0976a24e 100755 (executable)
@@ -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
+
index a9aad20626fe246313d9f2c64f95bf78bc461531..fa4a18a75c5d17f5881f799404daff050b2d9d05 100755 (executable)
@@ -7,5 +7,4 @@ ENDIF(COMMAND CMAKE_POLICY)
 FIND_PACKAGE(ParaView REQUIRED)
 INCLUDE(${PARAVIEW_USE_FILE})
 
-SUBDIRS(Filter)
-
+SUBDIRS(Filter ToolBar View)
index 162981012b86761e17f545bcdd2427bd1de87010..3fbab882285545aaff89c724247b1876c73e038e 100755 (executable)
@@ -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 (executable)
index 0000000..ca0d2cb
--- /dev/null
@@ -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 (executable)
index 0000000..c5077d8
--- /dev/null
@@ -0,0 +1,26 @@
+
+
+#include "MyToolBarActions.h"
+
+#include <QApplication>
+#include <QStyle>
+#include <QMessageBox>
+
+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 (executable)
index 0000000..97ad0aa
--- /dev/null
@@ -0,0 +1,15 @@
+
+#include <QActionGroup>
+
+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 (executable)
index 0000000..880ebd4
--- /dev/null
@@ -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 (executable)
index 0000000..cded766
--- /dev/null
@@ -0,0 +1,18 @@
+
+#include "MyDisplay.h"
+
+#include <QVBoxLayout>
+#include <QLabel>
+
+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 (executable)
index 0000000..309c674
--- /dev/null
@@ -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 (executable)
index 0000000..5f284ad
--- /dev/null
@@ -0,0 +1,98 @@
+
+#include "MyView.h"
+
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QWidget>
+#include <vtkSMProxy.h>
+
+#include <pqOutputPort.h>
+#include <pqPipelineSource.h>
+#include <pqRepresentation.h>
+#include <pqServer.h>
+
+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 (executable)
index 0000000..c9a8865
--- /dev/null
@@ -0,0 +1,53 @@
+
+#ifndef _MyView_h
+#define _MyView_h
+
+#include "pqView.h"
+#include <QMap>
+#include <QColor>
+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<pqRepresentation*, QLabel*> Labels;
+
+};
+
+#endif // _MyView_h
+
diff --git a/src/Plugins/View/MyViewActiveOptions.cxx b/src/Plugins/View/MyViewActiveOptions.cxx
new file mode 100755 (executable)
index 0000000..f882ea0
--- /dev/null
@@ -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 (executable)
index 0000000..f7b373b
--- /dev/null
@@ -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 <QPointer>
+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<pqOptionsDialog> Dialog;
+  QPointer<MyViewOptions> Options;
+};
+
+#endif
diff --git a/src/Plugins/View/MyViewOptions.cxx b/src/Plugins/View/MyViewOptions.cxx
new file mode 100755 (executable)
index 0000000..8f4a35d
--- /dev/null
@@ -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 <QHBoxLayout>
+#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<MyView*>(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 (executable)
index 0000000..32ff676
--- /dev/null
@@ -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 <QPointer>
+
+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<MyView> View;
+  pqColorChooserButton* ColorChooser;
+};
+
+#endif
diff --git a/src/Plugins/View/MyViewSM.xml b/src/Plugins/View/MyViewSM.xml
new file mode 100755 (executable)
index 0000000..0ac91be
--- /dev/null
@@ -0,0 +1,38 @@
+<ServerManagerConfiguration>
+ <ProxyGroup name="representations">
+   <ClientDeliveryRepresentationProxy name="MyDisplay"
+     base_proxygroup="representations" base_proxyname="ClientDeliveryRepresentationBase">
+      <InputProperty name="Input"
+          command="SetInput-not-used"
+          update_self="1">
+      </InputProperty>
+   </ClientDeliveryRepresentationProxy>
+ </ProxyGroup>
+
+ <ProxyGroup name="views">
+   <ViewProxy name="MyView"
+     base_proxygroup="views" base_proxyname="ViewBase"
+     representation_name="MyDisplay">
+   </ViewProxy>
+ </ProxyGroup>
+
+ <ProxyGroup name="filters">
+   <SourceProxy name="MyExtractEdges" class="vtkExtractEdges"
+     label="My Extract Edges">
+     <InputProperty
+       name="Input"
+       command="SetInputConnection">
+         <ProxyGroupDomain name="groups">
+           <Group name="sources"/>
+           <Group name="filters"/>
+         </ProxyGroupDomain>
+         <DataTypeDomain name="input_type">
+           <DataType value="vtkDataSet"/>
+         </DataTypeDomain>
+     </InputProperty>
+     <Hints>
+       <View type="MyView"/>
+     </Hints>
+   </SourceProxy>
+ </ProxyGroup>
+</ServerManagerConfiguration>