]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to VTK-5.0.0
authorenk <enk@opencascade.com>
Thu, 15 Mar 2007 15:03:48 +0000 (15:03 +0000)
committerenk <enk@opencascade.com>
Thu, 15 Mar 2007 15:03:48 +0000 (15:03 +0000)
29 files changed:
adm_local/unix/config_files/check_vtk.m4
build_configure
src/OCCViewer/Makefile.am
src/SALOME_PY/Makefile.am
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_DeviceActor.cxx
src/SVTK/SVTK_DeviceActor.h
src/SVTK/SVTK_Renderer.cxx
src/VTKViewer/Makefile.am
src/VTKViewer/VTKViewer.cxx
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h
src/VTKViewer/VTKViewer_AppendFilter.cxx
src/VTKViewer/VTKViewer_AppendFilter.h
src/VTKViewer/VTKViewer_CellLocationsArray.h
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_GeometryFilter.h
src/VTKViewer/VTKViewer_PassThroughFilter.cxx
src/VTKViewer/VTKViewer_PassThroughFilter.h
src/VTKViewer/VTKViewer_ShrinkFilter.cxx
src/VTKViewer/VTKViewer_ShrinkFilter.h
src/VTKViewer/VTKViewer_TransformFilter.cxx
src/VTKViewer/VTKViewer_TransformFilter.h
src/VTKViewer/VTKViewer_Trihedron.cxx
src/VTKViewer/VTKViewer_Trihedron.h
src/VTKViewer/VTKViewer_VectorText.h
src/VTKViewer/VTKViewer_ViewWindow.cxx

index a0733ebc35f45fbb17b929c86fd4bd588085e2bc..96ec3b948dd0a26c70957e605c26b926208bb094 100644 (file)
@@ -70,7 +70,7 @@ then
 fi
 
 LOCAL_INCLUDES="$OGL_INCLUDES"
-LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid $OGL_LIBS $LXLIB -lX11 -lXt"
+LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets $OGL_LIBS $LXLIB -lX11 -lXt"
 TRY_LINK_LIBS="-lvtkCommon $OGL_LIBS $LXLIB -lX11 -lXt"
 
 if test -z $VTKHOME
index ae51779c03ca0275aefb17477c80f9f564401c04..38c83ea1c710adcf3071b8dab36f6acaf8828b88 100755 (executable)
@@ -36,6 +36,12 @@ do
   rm  salome_adm/unix/config_files/${deprecated}
 done
 
+# remove KERNEL CVS directories in subdirectory salome_adm
+for deprecated in CVS unix/CVS unix/config_files/CVS
+do
+  rm -rf salome_adm/${deprecated}
+done
+
 cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
 
 # ____________________________________________________________________
index 2cde3fb57ea7cd0ab11c79cb045085c9eb5507e4..eb5b86205fc7c6ef19ba2046b3744ff7ed43e8cf 100755 (executable)
@@ -34,8 +34,9 @@ salomeinclude_HEADERS= \
        OCCViewer_ViewWindow.h \
        OCCViewer_VService.h \
        OCCViewer_CreateRestoreViewDlg.h \
-       OCCViewer_SetRotationPointDlg.h \
-       OCCViewer.h
+       OCCViewer.h \
+       OCCViewer_ClippingDlg.h \
+       OCCViewer_SetRotationPointDlg.h
 
 dist_libOCCViewer_la_SOURCES= \
        OCCViewer_AISSelector.cxx \
index d2e43924a787ffe415d7fbc1a260d2103e859e12..6d94b90d4ebc1bfc272eb8a59d06445e632ce0e1 100755 (executable)
@@ -41,4 +41,4 @@ libSalomePy_la_CPPFLAGS=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \
        -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
 libSalomePy_la_LDFLAGS=$(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \
        ../SalomeApp/libSalomeApp.la \
-       -lvtkCommonPython -lvtkGraphicsPython -lvtkImagingPython
+       -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD
index 8bd1cbd4323660a6670287c8a5c99c28bb4dbf1f..b9597c30c1fb3fc0bc9ed43b6743e4ff320dff3c 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_TransformFilter.h"
-#include "VTKViewer_PassThroughFilter.h"
 #include "VTKViewer_GeometryFilter.h"
 #include "SVTK_RectPicker.h"
 
@@ -58,6 +57,7 @@
 
 #include <vtkInteractorStyle.h>
 #include <vtkRenderWindowInteractor.h>
+#include <vtkPassThroughFilter.h>
 
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
index e5ab58ff906637e76d6b9889a47e1dcca564921b..a3bb037730cf4a8d353b54196fd75b41c5ec9c0c 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_TransformFilter.h"
-#include "VTKViewer_PassThroughFilter.h"
 #include "VTKViewer_GeometryFilter.h"
 
 // VTK Includes
@@ -44,6 +43,8 @@
 #include <vtkPolyDataMapper.h>
 #include <vtkDataSetMapper.h>
 
+#include <vtkPassThroughFilter.h>
+
 using namespace std;
 
 vtkStandardNewMacro(SVTK_DeviceActor);
@@ -74,7 +75,7 @@ SVTK_DeviceActor
   myTransformFilter = VTKViewer_TransformFilter::New();
 
   for(int i = 0; i < 6; i++)
-    myPassFilter.push_back(VTKViewer_PassThroughFilter::New());
+    myPassFilter.push_back(vtkPassThroughFilter::New());
 }
 
 /*!
@@ -139,8 +140,7 @@ SVTK_DeviceActor
     }else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper)){
       aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput());
     }
-  }else
-    myPassFilter[ 0 ]->SetInput( NULL );
+  }
   Superclass::SetMapper(theMapper);
 }
 
index fe89fdd072d26755655be58318ffba5fc1249473..47fc3e12d1e7e1f847d719b6569a4fe7953cf0b0 100644 (file)
 
 class VTKViewer_Transform;
 class VTKViewer_TransformFilter;
-class VTKViewer_PassThroughFilter;
 class VTKViewer_GeometryFilter;
 
 class vtkCell;
 class vtkDataSet;
 class vtkShrinkFilter;
 class vtkDataSetMapper;
+class vtkPassThroughFilter;
 
 namespace SVTK
 {
@@ -188,7 +188,7 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
 
   VTKViewer_GeometryFilter *myGeomFilter;
   VTKViewer_TransformFilter *myTransformFilter;
-  std::vector<VTKViewer_PassThroughFilter*> myPassFilter;
+  std::vector<vtkPassThroughFilter*> myPassFilter;
   vtkShrinkFilter* myShrinkFilter;
   vtkDataSetMapper* myMapper;
 
index d3020f1c1a03657e55164e121ef585ca51c91b3b..9dd784fb10c1c74c68ee93032bb5168b51e21316 100644 (file)
@@ -112,7 +112,7 @@ SVTK_Renderer
   myEventCallbackCommand->Delete();
 
   myTrihedron->AddToRender(GetDevice());
-  GetDevice()->AddProp(GetCubeAxes());
+  GetDevice()->AddViewProp(GetCubeAxes());
 
   myBndBox[0] = myBndBox[2] = myBndBox[4] = 0;
   myBndBox[1] = myBndBox[3] = myBndBox[5] = myTrihedron->GetSize();
index f95942888d8e9cc66fce338563038782860681ae..1eeae3737713cb89d891d7860f347f9b22d5309e 100755 (executable)
@@ -36,7 +36,6 @@ salomeinclude_HEADERS= \
        VTKViewer_AppendFilter.h \
        VTKViewer_Algorithm.h \
        VTKViewer_InteractorStyle.h \
-       VTKViewer_PassThroughFilter.h \
        VTKViewer_RenderWindow.h \
        VTKViewer_RenderWindowInteractor.h \
        VTKViewer_ShrinkFilter.h \
@@ -44,7 +43,6 @@ salomeinclude_HEADERS= \
        VTKViewer_Transform.h \
        VTKViewer_Trihedron.h \
        VTKViewer_Utilities.h \
-       VTKViewer_VectorText.h \
        VTKViewer_ViewManager.h \
        VTKViewer_ViewModel.h \
        VTKViewer_ViewWindow.h \
@@ -58,7 +56,6 @@ dist_libVTKViewer_la_SOURCES= \
        VTKViewer_GeometryFilter.cxx \
        VTKViewer_AppendFilter.cxx \
        VTKViewer_InteractorStyle.cxx \
-       VTKViewer_PassThroughFilter.cxx \
        VTKViewer_RenderWindow.cxx \
        VTKViewer_RenderWindowInteractor.cxx \
        VTKViewer_ShrinkFilter.cxx \
@@ -66,7 +63,6 @@ dist_libVTKViewer_la_SOURCES= \
        VTKViewer_TransformFilter.cxx \
        VTKViewer_Trihedron.cxx \
        VTKViewer_Utilities.cxx \
-       VTKViewer_VectorText.cxx \
        VTKViewer_ViewManager.cxx \
        VTKViewer_ViewModel.cxx \
        VTKViewer_ConvexTool.cxx \
index 8a35f8bc192dd355c66579b9b61335cfb110d29a..a65c5c204eaf3ea75720b268cbd2bc4359ad3aa6 100644 (file)
@@ -34,7 +34,6 @@
 #include "VTKViewer_AppendFilter.h"
 #include "VTKViewer_Algorithm.h"
 #include "VTKViewer_InteractorStyle.h"
-#include "VTKViewer_PassThroughFilter.h"
 #include "VTKViewer_RenderWindow.h"
 #include "VTKViewer_RenderWindowInteractor.h"
 #include "VTKViewer_ShrinkFilter.h"
@@ -42,7 +41,6 @@
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_Trihedron.h"
 #include "VTKViewer_Utilities.h"
-#include "VTKViewer_VectorText.h"
 #include "VTKViewer_ViewManager.h"
 #include "VTKViewer_ViewModel.h"
 #include "VTKViewer_ViewWindow.h"
index 5f0e621e7368da910ca2396461ab54422c9b00fc..5c65df651e9af2a7568725a23f388ed2269345cb 100755 (executable)
@@ -36,7 +36,6 @@
 
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_TransformFilter.h"
-#include "VTKViewer_PassThroughFilter.h"
 #include "VTKViewer_GeometryFilter.h"
 
 // VTK Includes
@@ -47,6 +46,7 @@
 #include <vtkPolyDataMapper.h>
 #include <vtkProperty.h>
 #include <vtkRenderer.h>
+#include <vtkPassThroughFilter.h>
 
 using namespace std;
 
@@ -83,7 +83,7 @@ VTKViewer_Actor
                                                                 myPolygonOffsetUnits);
 
   for(int i = 0; i < 6; i++)
-    myPassFilter.push_back(VTKViewer_PassThroughFilter::New());
+    myPassFilter.push_back(vtkPassThroughFilter::New());
 }
 
 /*!
@@ -347,7 +347,7 @@ VTKViewer_Actor
   unsigned long mTime = this->Superclass::GetMTime();
   unsigned long time = myTransformFilter->GetMTime();
   mTime = ( time > mTime ? time : mTime );
-  if(vtkDataSet *aDataSet = myPassFilter[0]->GetInput()){
+  if(vtkDataSet *aDataSet = dynamic_cast<vtkDataSet*>(myPassFilter[0]->GetInput())){ // bad usage of GetInput
     time = aDataSet->GetMTime();
     mTime = ( time > mTime ? time : mTime );
   }
index 28d5af787d08832451394b89d352306ad9b682cf..72035b6aea01de18ff856f7c2696b1830f590793 100755 (executable)
@@ -43,11 +43,11 @@ class vtkDataSet;
 class vtkCamera;
 class vtkProperty;
 class vtkRenderer;
+class vtkPassThroughFilter;
 
 class VTKViewer_Transform;
 class VTKViewer_GeometryFilter;
 class VTKViewer_TransformFilter;
-class VTKViewer_PassThroughFilter;
 
 extern int VTKViewer_POINT_SIZE;
 extern int VTKViewer_LINE_WIDTH;
@@ -317,7 +317,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   bool myStoreMapping;
   VTKViewer_GeometryFilter *myGeomFilter;
   VTKViewer_TransformFilter *myTransformFilter;
-  std::vector<VTKViewer_PassThroughFilter*> myPassFilter;
+  std::vector<vtkPassThroughFilter*> myPassFilter;
 
   int myRepresentation;
   vtkProperty *myProperty;
index 4218c4f20347471bfc3ebf98dd662072d09831e0..19390bac1defa98b403037b4dba22d47101228e4 100644 (file)
@@ -35,6 +35,8 @@
 #include <vtkObjectFactory.h>
 #include <vtkPointData.h>
 #include <vtkUnstructuredGrid.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 
 #include <vtkPoints.h>
 
@@ -95,17 +97,23 @@ VTKViewer_AppendFilter
   return myPoints.GetPointer();
 }
 
-void
+int
 VTKViewer_AppendFilter
-::Execute()
+::RequestData(
+             vtkInformation *request,
+             vtkInformationVector **inputVector,
+             vtkInformationVector *outputVector)
 {
+  int aRet = 0;
   if(myPoints.GetPointer())
-    MakeOutput();
+    aRet = MakeOutput(request,inputVector,outputVector);
   else
-    Superclass::Execute();
+    aRet = Superclass::RequestData(request,inputVector,outputVector);
 
   if(myDoMappingFlag)
     DoMapping();
+  
+  return aRet;
 }
 
 
@@ -119,8 +127,8 @@ VTKViewer_AppendFilter
   vtkIdType aPntStartId = 0;
   vtkIdType aCellStartId = 0;
 
-  for(vtkIdType aDataSetId = 0; aDataSetId < this->NumberOfInputs; ++aDataSetId){
-    vtkDataSet* aDataSet = (vtkDataSet *)(this->Inputs[aDataSetId]);
+  for(vtkIdType aDataSetId = 0; aDataSetId < this->GetNumberOfInputPorts(); ++aDataSetId){
+    vtkDataSet* aDataSet = (vtkDataSet *)(this->GetInput(aDataSetId));
     // Do mapping of the nodes
     if(!myPoints.GetPointer()){
       vtkIdType aNbPnts = aDataSet->GetNumberOfPoints();
@@ -246,25 +254,41 @@ VTKViewer_AppendFilter
 }
 
 
-void 
+int
 VTKViewer_AppendFilter
-::MakeOutput()
+::MakeOutput(
+  vtkInformation *vtkNotUsed(request),
+  vtkInformationVector **inputVector,
+  vtkInformationVector *outputVector)
 {
   int idx;
   vtkIdType numPts, numCells, newCellId, cellId;
   vtkCellData *cd;
   vtkIdList *ptIds;
   vtkDataSet *ds;
-  vtkUnstructuredGrid *output = this->GetOutput();
+  int numInputs = this->GetNumberOfInputConnections(0);
+  
+  // get the output info object
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the ouptut
+  vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
   //
   numPts = myPoints->GetNumberOfPoints();
   if (numPts < 1) {
-    return;
+    return 0;
   }
   //
   numCells = 0;
-  for (idx = 0; idx < this->NumberOfInputs; ++idx) {
-    ds = (vtkDataSet *)(this->Inputs[idx]);
+  vtkInformation *inInfo = 0;
+  for (idx = 0; idx < numInputs;++idx) {
+    inInfo = inputVector[0]->GetInformationObject(idx);
+    ds = 0;
+    if (inInfo)
+      {
+      ds = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
+      }
     if (ds != NULL)  {
       if ( ds->GetNumberOfPoints() <= 0 && ds->GetNumberOfCells() <= 0 )  {
         continue; //no input, just skip
@@ -273,7 +297,7 @@ VTKViewer_AppendFilter
     }//if non-empty dataset
   }//for all inputs
   if (numCells < 1) {
-    return;
+    return 0;
   }
   //
   // Now can allocate memory
@@ -286,9 +310,15 @@ VTKViewer_AppendFilter
   // 1.points
   output->SetPoints(myPoints.GetPointer());
   // 2.cells
-  for (idx = 0; idx < this->NumberOfInputs; ++idx) {
-    ds = (vtkDataSet *)(this->Inputs[idx]);
+  for (idx = 0; idx < numInputs; ++idx) {
+    inInfo = inputVector[0]->GetInformationObject(idx);
+    ds = 0;
+    if (inInfo)
+      {
+      ds = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
+      }
     if (ds != NULL) {
+      
       numCells = ds->GetNumberOfCells(); 
       cd = ds->GetCellData();
       // copy cell and cell data
@@ -300,5 +330,12 @@ VTKViewer_AppendFilter
   }
   //
   ptIds->Delete();
+  return 1;
 }
 
+int VTKViewer_AppendFilter::FillInputPortInformation(int, vtkInformation *info)
+{
+  info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");
+  info->Set(vtkAlgorithm::INPUT_IS_REPEATABLE(), 1);
+  return 1;
+}
index f7b1a171d6176ff46d5fd209c5d27590377d847c..3ff6175411d16861a0ac29daf3badb355ed19efa 100644 (file)
@@ -88,16 +88,17 @@ protected:
    * \brief Destructor.
    */
   ~VTKViewer_AppendFilter();
-  /*! \fn void Execute();
-   * \brief Filter culculation method.
-   */
-  virtual void Execute();
-  //
+
+  // Usual data generation method
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+  virtual int FillInputPortInformation(int port, vtkInformation *info);
+  
   void DoMapping();
 
   void Reset();
 
-  void MakeOutput();
+  int MakeOutput(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
 
   bool myDoMappingFlag;
   TVectorIds myNodeRanges;
index 8cbd4d89b1fe234e8c156ce2e6b7eb17e3df24d1..4d965a8e12ba47dc72971fc4f15e45d9e39743d0 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "VTKViewer.h"
 
-#if (VTK_MAJOR_VERSION >= 4) &&  (VTK_MINOR_VERSION >= 4)
+#if ((VTK_MAJOR_VERSION == 4) &&  (VTK_MINOR_VERSION >= 4)) || (VTK_MAJOR_VERSION > 4)
 #  include <vtkIdTypeArray.h>
 #  define TCellLocationsArray vtkIdTypeArray
 #else
index 5cb422e118b841dab3d87fa1942f502682e8a9d3..ea3abb5ff2dc9ab82e2ad8b742d902284a167c1c 100755 (executable)
@@ -34,6 +34,8 @@
 #include <vtkCellArray.h>
 #include <vtkIdList.h>
 #include <vtkCell.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 
 using namespace std;
 
@@ -146,9 +148,29 @@ inline void InsertPointCell(vtkCellArray *theConnectivity,
   }
 }
 
-void VTKViewer_ExtractUnstructuredGrid::Execute(){
+
+// int VTKViewer_ExtractUnstructuredGrid::RequestData(
+//   vtkInformation *vtkNotUsed(request),
+//   vtkInformationVector **inputVector,
+//   vtkInformationVector *outputVector)
+void VTKViewer_ExtractUnstructuredGrid::Execute()
+{
+  /*
+  not ported yet to the new executive-based pipeline architecture.
+
+  // get the info objects
+  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the input and ouptut
+  vtkUnstructuredGrid *anInput = vtkUnstructuredGrid::SafeDownCast(
+    inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkUnstructuredGrid *anOutput = vtkUnstructuredGrid::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+  */
   vtkUnstructuredGrid *anInput = this->GetInput();
   vtkUnstructuredGrid *anOutput = this->GetOutput();
+  
   myOut2InId.clear();  myIn2OutId.clear();
 
 /*  if(MYDEBUG){
@@ -348,4 +370,5 @@ void VTKViewer_ExtractUnstructuredGrid::Execute(){
       MESSAGE("Execute - myIn2OutId.size() = "<<myIn2OutId.size());
     }
   }*/
+//  return 1;
 }
index 7a3783a01782ebee305a785685cfc29df9095323..71f3274d8cb7f82e8fa2cfae05c1d5ae6bee7e41 100755 (executable)
@@ -104,7 +104,10 @@ protected:
   ~VTKViewer_ExtractUnstructuredGrid();
 
   //! Main method, which calculate output
-  void Execute();
+  // not ported yet to the new executive-based pipeline architecture.
+  // see http://www.vtk.org/cgi-bin/viewcvs.cgi/Filtering/vtkUnstructuredGridToUnstructuredGridFilter.h?rev=1.19&view=log
+  // virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+  virtual void Execute();
 
   EExtraction myExtractionMode;
   
index 420c1a1d32cd56c2580dd209980a708c140377ef..50cade3f124768c3c37afaf018742f4c93401cc2 100755 (executable)
@@ -45,6 +45,8 @@
 #include <vtkUnstructuredGrid.h>
 #include <vtkVoxel.h>
 #include <vtkWedge.h>
+#include <vtkInformationVector.h>
+#include <vtkInformation.h>
 
 #include <algorithm>
 #include <iterator>
@@ -76,37 +78,54 @@ VTKViewer_GeometryFilter
 {}
 
 
-void
+int
 VTKViewer_GeometryFilter
-::Execute()
+::RequestData(
+  vtkInformation *request,
+  vtkInformationVector **inputVector,
+  vtkInformationVector *outputVector)
 {
-  vtkDataSet *input= this->GetInput();
+  // get the info objects
+  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the input and ouptut
+  vtkDataSet *input = vtkDataSet::SafeDownCast(
+    inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkPolyData *output = vtkPolyData::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
   vtkIdType numCells=input->GetNumberOfCells();
 
   if (numCells == 0)
     {
-      return;
+      return 0;
     }
   
   if (input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID){
-    this->UnstructuredGridExecute();
-    return;
+    return this->UnstructuredGridExecute(input, output, outInfo);
   }else
-    vtkGeometryFilter::Execute();
+    return Superclass::RequestData(request,inputVector,outputVector);
+
+  return 1;
 }
 
 
-void
+int
 VTKViewer_GeometryFilter
-::UnstructuredGridExecute()
+::UnstructuredGridExecute(
+                         vtkDataSet *dataSetInput,
+                         vtkPolyData *output,
+                         vtkInformation *outInfo)
 {
-  vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)this->GetInput();
+  
+  vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput;
   vtkCellArray *Connectivity = input->GetCells();
   // Check input
   if ( Connectivity == NULL )
     {
     vtkDebugMacro(<<"Nothing to extract");
-    return;
+    return 0;
     }
 
   vtkIdType cellId;
@@ -118,7 +137,6 @@ VTKViewer_GeometryFilter
   vtkIdType numCells=input->GetNumberOfCells();
   vtkPointData *pd = input->GetPointData();
   vtkCellData *cd = input->GetCellData();
-  vtkPolyData *output = this->GetOutput();
   vtkPointData *outputPD = output->GetPointData();
   
   VTKViewer_OrderedTriangulator anOrderedTriangulator;
index 9c7425aa3ce4dc82b9bfb77b3913c00ee73c2f4d..300c5a948d516c5e4dbd5451f42a2e92ded3af35 100755 (executable)
@@ -92,14 +92,15 @@ protected:
    * \brief Destructor.
    */
   ~VTKViewer_GeometryFilter();
-  /*! \fn void Execute();
-   * \brief Filter culculation method.
-   */
-  void Execute();
+
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+  //special cases for performance
+  
   /*! \fn void UnstructuredGridExecute();
    * \brief Filter culculation method for data object type is VTK_UNSTRUCTURED_GRID.
    */
-  void UnstructuredGridExecute();
+  int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
     
 private:
   typedef std::vector<vtkIdType> TVectorId;
index 172976d7ea06d5b2f29ea951dc278e851a8188ff..f052b072c0be224b1971b0aeb5aafadfcce40067 100755 (executable)
@@ -32,6 +32,8 @@
 #include <vtkDataSet.h>
 #include <vtkObjectFactory.h>
 #include <vtkPointData.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 
 vtkCxxRevisionMacro(VTKViewer_PassThroughFilter, "$Revision$");
 vtkStandardNewMacro(VTKViewer_PassThroughFilter);
@@ -43,10 +45,20 @@ vtkStandardNewMacro(VTKViewer_PassThroughFilter);
  */
 
 /*!Execute method.Output calculation.*/
-void VTKViewer_PassThroughFilter::Execute()
+int VTKViewer_PassThroughFilter::RequestData(
+  vtkInformation *,
+  vtkInformationVector **inputVector,
+  vtkInformationVector *outputVector)
 {
-  vtkDataSet *input = static_cast<vtkDataSet*>(this->GetInput());
-  vtkDataSet *output = static_cast<vtkDataSet*>(this->GetOutput());
+  // get the info objects
+  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the input and ouptut
+  vtkDataSet *input = vtkDataSet::SafeDownCast(
+    inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkDataSet *output = vtkDataSet::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
 
   // This has to be here because it initialized all field datas.
   output->CopyStructure( input );
@@ -56,6 +68,7 @@ void VTKViewer_PassThroughFilter::Execute()
   output->GetPointData()->PassData( input->GetPointData() );
   output->GetCellData()->PassData( input->GetCellData() );
 
+  return 1;
 }
 
 /*!Methods invoked by print to print information about the object including superclasses.\n
index 3e683348f77f35997a195f26b5ea5a732a4b527d..99b81ef520d5ed8a13358c869284afe9879e04e4 100755 (executable)
@@ -36,7 +36,8 @@ protected:
   VTKViewer_PassThroughFilter() {};//!< Null body.
   virtual ~VTKViewer_PassThroughFilter() {};//!< Null body.
 
-  void Execute();
+  virtual int RequestData(vtkInformation *, vtkInformationVector **,
+                          vtkInformationVector *); //generate output data
 
 private:
   VTKViewer_PassThroughFilter( const VTKViewer_PassThroughFilter& );  //!< Not implemented.
index b4a7fb6a27f338ccd6e8be17b62c1314299aafdd..3391c08c7cad9eae79e8ad96d46edcdf39466f8a 100755 (executable)
@@ -34,6 +34,8 @@
 #include <vtkObjectFactory.h>
 #include <vtkPointData.h>
 #include <vtkUnstructuredGrid.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 
 vtkCxxRevisionMacro(VTKViewer_ShrinkFilter, "$Revision$");
 vtkStandardNewMacro(VTKViewer_ShrinkFilter);
@@ -49,8 +51,21 @@ VTKViewer_ShrinkFilter::~VTKViewer_ShrinkFilter()
 
 
 /*!Execute method. Calculate output.*/
-void VTKViewer_ShrinkFilter::Execute()
+int VTKViewer_ShrinkFilter::RequestData(
+  vtkInformation *vtkNotUsed(request),
+  vtkInformationVector **inputVector,
+  vtkInformationVector *outputVector)
 {
+  // get the info objects
+  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the input and ouptut
+  vtkDataSet *input = vtkDataSet::SafeDownCast(
+    inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
   vtkPoints *newPts;
   int i, j, numIds, abort=0;
   vtkIdType cellId, numCells, numPts;
@@ -58,8 +73,6 @@ void VTKViewer_ShrinkFilter::Execute()
   vtkFloatingPointType center[3], *p, pt[3];
   vtkPointData *pd, *outPD;;
   vtkIdList *ptIds, *newPtIds;
-  vtkDataSet *input= this->GetInput();
-  vtkUnstructuredGrid *output = this->GetOutput();
   vtkIdType tenth;
   vtkFloatingPointType decimal;
 
@@ -70,7 +83,7 @@ void VTKViewer_ShrinkFilter::Execute()
   if (numCells < 1 || numPts < 1)
     {
     vtkErrorMacro(<<"No data to shrink!");
-    return;
+    return 0;
     }
 
   ptIds = vtkIdList::New();
@@ -154,6 +167,8 @@ void VTKViewer_ShrinkFilter::Execute()
   ptIds->Delete();
   newPtIds->Delete();
   newPts->Delete();
+  
+  return 1;
 }
 
 /*!Sets store mapping.*/
index 336d306362ac3c7fcda29f3ac103bd9cdf241948..ab46c251484ec360e7c886180648f71572b00b9f 100755 (executable)
@@ -51,7 +51,7 @@ protected:
   VTKViewer_ShrinkFilter();
   ~VTKViewer_ShrinkFilter();
   
-  void Execute();
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
   /*!Not implemented.*/
   void UnstructuredGridExecute();
     
index cdfc14a1fc449efd36e38d2c1984790c1c26e86d..1c1121044562eafe0d8fe72d3bbd71328a564c58 100755 (executable)
 #include <vtkPointData.h>
 #include <vtkCellData.h>
 #include <vtkPoints.h>
-
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 
 vtkStandardNewMacro(VTKViewer_TransformFilter);
 
 /*!Execution method. Calculate output.*/
-void VTKViewer_TransformFilter::Execute(){
+int VTKViewer_TransformFilter::RequestData(
+  vtkInformation *vtkNotUsed(request),
+  vtkInformationVector **inputVector,
+  vtkInformationVector *outputVector)
+{
+  // get the info objects
+  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the input and ouptut
+  vtkPointSet *input = vtkPointSet::SafeDownCast(
+    inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkPointSet *output = vtkPointSet::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
   vtkPoints *inPts;
   vtkPoints *newPts;
   int numPts, numCells;
-  vtkPointSet *input = this->GetInput();
-  vtkPointSet *output = this->GetOutput();
   vtkPointData *pd=input->GetPointData(), *outPD=output->GetPointData();
   vtkCellData *cd=input->GetCellData(), *outCD=output->GetCellData();
   output->CopyStructure( input );
@@ -67,4 +80,6 @@ void VTKViewer_TransformFilter::Execute(){
   }
   outPD->PassData(pd);
   outCD->PassData(cd);
+  
+  return 1;
 }
index 3087a03e9196aa8a7750384b0ab28012dc4a700b..69a286b0666f599b7cb91621c5d3676f56cac4af 100755 (executable)
@@ -42,7 +42,8 @@ protected:
   VTKViewer_TransformFilter(const VTKViewer_TransformFilter&) {/*!Do nothing*/}
   /*!Operator = */
   void operator=(const VTKViewer_TransformFilter&) {/*!Do nothing*/}
-  void Execute();
+
+  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
 };
 
 #endif
index 9caa0606ad2dca02b16bc2f4692a038b17fe6cd4..f50d67b30b862bc967e3ef2efcb92107dde0b9a8 100755 (executable)
@@ -32,8 +32,7 @@
 #include <vtkLineSource.h>
 #include <vtkConeSource.h>
 #include <vtkPolyDataMapper.h>
-
-#include "VTKViewer_VectorText.h"
+#include <vtkVectorText.h>
 
 vtkStandardNewMacro(VTKViewer_UnScaledActor);
 
@@ -141,7 +140,7 @@ VTKViewer_Axis::VTKViewer_Axis()
   myLineActor->SetArrowActor(myArrowActor);
   
   /*! \li Initialize the Label pipe-line representation */
-  myVectorText = VTKViewer_VectorText::New();
+  myVectorText = vtkVectorText::New();
   
   myMapper[2] = vtkPolyDataMapper::New();
   myMapper[2]->SetInput(myVectorText->GetOutput());
index 01be4f77a3f2f18ec0432230a9006c1353cdcac7..0d3b34561f5ee7ce5d987e26d7f314fd272b245d 100755 (executable)
@@ -31,9 +31,9 @@ class vtkProperty;
 class vtkPolyDataMapper;
 class vtkLineSource;
 class vtkConeSource;
+class vtkVectorText;
 
 class VTKViewer_Axis;
-class VTKViewer_VectorText;
 
 /*! \class vtkFollower
  * See <a href="http://www.vtk.org/">vtk documentation</a>
@@ -288,7 +288,7 @@ protected:
 
   /*! VTKViewer_VectorText pointer (Label)
    */
-  VTKViewer_VectorText* myVectorText;
+  vtkVectorText* myVectorText;
 };
 
 #endif
index ac328ecec5ccb1316ea38d4a70acb47b9860e77b..347757082034652370fc8be7d65a3b934f23e94c 100755 (executable)
@@ -75,7 +75,9 @@ protected:
   VTKViewer_VectorText();
   ~VTKViewer_VectorText();
 
-  void Execute();
+  //! Main method, which calculate output
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
   char *Text;
   char *Letters[127];
 
index aba392028637f0304e817fda6a49477d1e0690dd..0e1ab38bb3dda6309508810d634f09086bd31211 100755 (executable)
@@ -131,7 +131,7 @@ VTKViewer_ViewWindow::~VTKViewer_ViewWindow()
   myRWInteractor->Delete();
   
   //m_RW->Delete() ;
-  myRenderer->RemoveAllProps();
+  myRenderer->RemoveAllViewProps();
   //m_Renderer->Delete() ;
   myTrihedron->Delete();
 }