]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Porting to VTK-5.0.0
authorenk <enk@opencascade.com>
Thu, 15 Mar 2007 15:08:47 +0000 (15:08 +0000)
committerenk <enk@opencascade.com>
Thu, 15 Mar 2007 15:08:47 +0000 (15:08 +0000)
33 files changed:
src/CONVERTOR/VISU_ConvertorUtils.cxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_ExtractUnstructuredGrid.cxx
src/CONVERTOR/VISU_ExtractUnstructuredGrid.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.h
src/OBJECT/VISU_VectorsAct.cxx
src/PIPELINE/Makefile.in
src/PIPELINE/SALOME_ExtractGeometry.cxx
src/PIPELINE/SALOME_ExtractGeometry.h
src/PIPELINE/VISUPipeLine.cxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_DeformedShapePL.cxx
src/PIPELINE/VISU_Extractor.cxx
src/PIPELINE/VISU_Extractor.hxx
src/PIPELINE/VISU_FieldTransform.cxx
src/PIPELINE/VISU_FieldTransform.hxx
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_GaussPointsPL.hxx
src/PIPELINE/VISU_IsoSurfacesPL.cxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx
src/PIPELINE/VISU_PipeLine.cxx
src/PIPELINE/VISU_PrsMergerPL.cxx
src/PIPELINE/VISU_ScalarBarCtrl.cxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx
src/PIPELINE/VISU_StreamLinesPL.cxx
src/VISUGUI/VisuGUI_ClippingDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_StreamLines_i.cc

index f406e5578ea86dca11bd867e90f3102b05d4742c..1d7782c67aab0b359069c4849aafd7af55b56ab4 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <vtkUnstructuredGridWriter.h>
 #include <vtkTimerLog.h>
+#include <vtkUnstructuredGrid.h>
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
index 6cbea3fbf472ba857283758c4dac1bb6cdec0223..89cd54786df532436d07d18e48fb31726361b28e 100644 (file)
@@ -27,8 +27,8 @@
 #include "VISU_Convertor_impl.hxx"
 #include "VISU_ConvertorUtils.hxx"
 #include "VTKViewer_AppendFilter.h"
-#include "VISU_MergeFilter.hxx"
 #include "VTKViewer_CellLocationsArray.h"
+#include "VISU_MergeFilter.hxx"
 
 #include <vtkPoints.h>
 #include <vtkUnstructuredGrid.h>
@@ -42,7 +42,6 @@
 #include <vtkCellData.h>
 #include <vtkCellLinks.h>
 
-
 #include <qstring.h>
 #include <qfileinfo.h>
 
@@ -57,7 +56,7 @@ static vtkFloatingPointType ERR_SIZE_CALC = 1.00;
 static int MYVTKDEBUG = 0;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 static int MYDEBUGWITHFILES = 0;
 //#define _DEXCEPT_
 #else
@@ -405,7 +404,6 @@ namespace VISU
       const TVTKSource& aSource = mySource.GetSource();
       TDataSet* aDataSet = aSource.GetPointer();
       aDataSet->ShallowCopy(aGeometry);
-      
       const TVTKMergeFilter& aFilter = GetFilter();
       aFilter->SetGeometry(aGeometry);
       aFilter->SetScalars(aDataSet);
@@ -1322,26 +1320,15 @@ namespace
     int aNbTuples = theField->myDataSize/theField->myNbComp;
     std::string aFieldName = GenerateFieldName(theField,theValForTime);
     
-    vtkDataSetAttributes* aDataSetAttributes;
-    switch(theEntity){
-    case VISU::NODE_ENTITY : 
-      aDataSetAttributes = theSource->GetPointData();
-      break;
-    default: 
-      aDataSetAttributes = theSource->GetCellData();
-    }
-
     int aNbComp = theField->myNbComp;
-    vtkFloatArray *aFloatArray = vtkFloatArray::New();
 
-    switch(aNbComp) {
+    vtkFloatArray *aFloatArray = vtkFloatArray::New();
+    switch(aNbComp){
     case 1:
       aFloatArray->SetNumberOfComponents(1);
-      aDataSetAttributes->SetScalars(aFloatArray);
       break;
     default:
       aFloatArray->SetNumberOfComponents(3);
-      aDataSetAttributes->SetVectors(aFloatArray);
     }
     aFloatArray->SetNumberOfTuples(aNbTuples);
     aFloatArray->SetName(aFieldName.c_str());
@@ -1350,7 +1337,6 @@ namespace
     aDataArray->SetNumberOfComponents(aNbComp);
     aDataArray->SetNumberOfTuples(aNbTuples);
     aDataArray->SetName("VISU_FIELD");
-    aDataSetAttributes->AddArray(aDataArray);
 
     INITMSG(MYDEBUG,"GetTimeStampOnProfile "<<
            "- theEntity = "<<theEntity<<
@@ -1359,7 +1345,7 @@ namespace
            endl);
     
     int aSize = max(3,aNbComp);
-    TVector<float> aDataValues(aSize,0.0);
+    TVector<vtkFloatingPointType> aDataValues(aSize,0.0);
 
     TGeom2Value& aGeom2Value = theValForTime->myGeom2Value;
     TGeom2Value::const_iterator anIter = aGeom2Value.begin();
@@ -1389,8 +1375,29 @@ namespace
        aDataArray->SetTuple(aTupleId,&aDataValues[0]);
       }
     }
+    
+    vtkDataSetAttributes* aDataSetAttributes;
+    switch(theEntity){
+    case VISU::NODE_ENTITY : 
+      aDataSetAttributes = theSource->GetPointData();
+      break;
+    default: 
+      aDataSetAttributes = theSource->GetCellData();
+    }
+
+    switch(aNbComp) {
+    case 1:
+      aDataSetAttributes->SetScalars(aFloatArray);
+      break;
+    default:
+      aDataSetAttributes->SetVectors(aFloatArray);
+    }
+
+    aDataSetAttributes->AddArray(aDataArray);
+
     aFloatArray->Delete();
     aDataArray->Delete();
+    
   }
 
 
index b3f59e6392d9b99b8be76048e1ece8edf2e3b1e0..ba36c3fdb0e224ae596cfe35bb0681c9e342886e 100644 (file)
@@ -32,6 +32,8 @@
 #include <vtkObjectFactory.h>
 #include <vtkIdList.h>
 #include <vtkCell.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 
 using namespace std;
 
@@ -71,8 +73,22 @@ namespace{
   }
 }
 
-void VISU_ExtractUnstructuredGrid::Execute(){
-  vtkUnstructuredGrid *anInput = this->GetInput(), *anOutput = this->GetOutput();
+int VISU_ExtractUnstructuredGrid::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
+  vtkUnstructuredGrid *anInput = vtkUnstructuredGrid::SafeDownCast(
+    inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkUnstructuredGrid *anOutput = vtkUnstructuredGrid::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+  
+
   vtkIdType aNbCells = anInput->GetNumberOfCells();
   anOutput->Allocate(aNbCells);
   MSG(MYDEBUG,"Execute - anInput->GetNumberOfCells() = "<<anInput->GetNumberOfCells());
@@ -97,4 +113,6 @@ void VISU_ExtractUnstructuredGrid::Execute(){
   aCellIds->Delete();
   anOutput->SetPoints(anInput->GetPoints());
   MSG(MYDEBUG,"Execute - anOutput->GetNumberOfCells() = "<<anOutput->GetNumberOfCells());
+  
+  return 1;
 }
index 6541f25901baa1530a10e7c6d38de5e30b031793..37567954f335dfb791b9cdac6fd8a81b6816e33b 100644 (file)
@@ -55,7 +55,7 @@ protected:
   VISU_ExtractUnstructuredGrid();
   ~VISU_ExtractUnstructuredGrid();
 
-  void Execute();
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
   
   std::set<vtkIdType> myRemovedCellIds;
   std::set<vtkIdType> myRemovedCellTypes;
index 5ef4aa562bc904eb04b3e812a202a72258f4f68f..d614e5234c06a6fa19e130509c44c5abb849de6e 100644 (file)
@@ -56,10 +56,10 @@ using MED::TFloat;
 using MED::EBooleen;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
-static int MYVALUEDEBUG = 1;
-static int MY_FAMILY_DEBUG = 1;
-static int MY_GROUP_DEBUG = 1;
+static int MYDEBUG = 0;
+static int MYVALUEDEBUG = 0;
+static int MY_FAMILY_DEBUG = 0;
+static int MY_GROUP_DEBUG = 0;
 //#define _DEXCEPT_
 #else
 static int MYDEBUG = 0;
index e2e9be3293767f9e8d1fee0fb75ed26787a4b91e..8e4da0d0f2dcd23ad0d6ec02dfe6cdbc76b33095 100644 (file)
@@ -30,7 +30,6 @@
 #include "VISU_PipeLine.hxx"
 #include "VTKViewer_ShrinkFilter.h"
 #include "VTKViewer_GeometryFilter.h"
-#include "VTKViewer_PassThroughFilter.h"
  
 #include <stdexcept>
 #include <sstream>
@@ -50,6 +49,7 @@
 #include <vtkDataSet.h>
 #include <vtkPolyData.h>
 #include <vtkUnstructuredGrid.h>
+#include <vtkPassThroughFilter.h>
 
 #include <vtkShrinkFilter.h>
 #include <vtkShrinkPolyData.h>
index 68efe38fe013e13a759f2b0bc3771a4c48020bd2..db41fee1f44b2b842776afe857d5fb790af79a0a 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_TransformFilter.h"
-#include "VTKViewer_PassThroughFilter.h"
 
 #include <vtkObjectFactory.h>
 #include <vtkPolyData.h>
@@ -42,6 +41,7 @@
 #include <vtkTextProperty.h>
 #include <vtkProperty.h>
 #include <vtkTexture.h>
+#include <vtkPassThroughFilter.h>
 
 #include "utilities.h"
 
@@ -69,7 +69,7 @@ VISU_GaussPtsDeviceActor
   myTransformFilter->Delete();
 
   for(int i = 0; i < 3; i++){
-    PPassThroughFilter aFilter(VTKViewer_PassThroughFilter::New());
+    PPassThroughFilter aFilter(vtkPassThroughFilter::New());
     myPassFilter.push_back(aFilter);
     aFilter->Delete();
   }
index 24dcb7b225b90fb1b9e26010e6e46f4d6a25364d..afc402617aef93722be013f9ac56a9c725a46aaf 100644 (file)
 
 class VTKViewer_Transform;
 class VTKViewer_TransformFilter;
-class VTKViewer_PassThroughFilter;
 
 class VISU_OpenGLPointSpriteMapper;
 class VISU_GaussPointsPL;
 
+class vtkPassThroughFilter;
 
 //============================================================================
 class VISU_GaussPtsDeviceActor: public vtkLODActor
@@ -90,7 +90,7 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor
   vtkSmartPointer<VTKViewer_GeometryFilter> myGeomFilter;
   vtkSmartPointer<VTKViewer_TransformFilter> myTransformFilter;
 
-  typedef vtkSmartPointer<VTKViewer_PassThroughFilter> PPassThroughFilter;
+  typedef vtkSmartPointer<vtkPassThroughFilter> PPassThroughFilter;
   std::vector<PPassThroughFilter> myPassFilter;
 
   VISU_GaussPtsDeviceActor();
index 6fc38567287e87d8a716892c115d4ea94a70844b..0043541f76e52b1a9c29a2ce880a168d3878a07e 100644 (file)
 
 #include "VISU_VectorsAct.h"
 #include "VISU_VectorsPL.hxx"
-#include "VTKViewer_PassThroughFilter.h"
  
 // VTK Includes
 #include <vtkObjectFactory.h>
 #include <vtkDataSetMapper.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkPolyData.h>
-
+#include <vtkPassThroughFilter.h>
 
 //----------------------------------------------------------------------------
 vtkStandardNewMacro(VISU_VectorsAct);
index 853f337d677b8e6696976886f3b6607891b91f41..ea6f20562edd81a8ce2ca2704f5891a2794de1cc 100644 (file)
@@ -110,6 +110,6 @@ LDFLAGS+= \
        $(GUI_LDFLAGS) \
        $(MED_LDFLAGS)
 
-LDFLAGSFORBIN=$(LDFLAGS) -lOpUtil -lMEDWrapper -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lmed_V2_1 -lsuit -lqtx -lSALOMEBasics
+LDFLAGSFORBIN=$(LDFLAGS) -lOpUtil -lMEDWrapper -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lmed_V2_1 -lsuit -lqtx -lSALOMEBasics -lvtkWidgets
 
 @CONCLUDE@
index 03cf524cb6eac36bec31a1eb56b99213ff7ebffa..801436b145fb51089e066d210f7681ca76261045 100755 (executable)
@@ -28,6 +28,8 @@
 #include <vtkObjectFactory.h>
 #include <vtkPointData.h>
 #include <vtkUnstructuredGrid.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 
 #include <vtkImplicitBoolean.h>
 #include <vtkImplicitFunctionCollection.h>
@@ -166,10 +168,25 @@ SALOME_ExtractGeometry
 
 
 //----------------------------------------------------------------------------
-void
+int
 SALOME_ExtractGeometry
-::Execute()
+::RequestData(
+  vtkInformation *vtkNotUsed(request),
+  vtkInformationVector **inputVector,
+  vtkInformationVector *outputVector)
 {
+  vtkInformation* aRequest;
+
+  // 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()));
+  //cout << "SALOME_ExtractGeometry::input"<<endl;input->Print(cout);
   myElemVTK2ObjIds.clear();
   myNodeVTK2ObjIds.clear();
   //
@@ -182,18 +199,32 @@ SALOME_ExtractGeometry
   }
 
   if(myIsDoneShallowCopy){
-    GetOutput()->ShallowCopy(GetInput());
+    output->ShallowCopy(input);
     Modified();
-    return;
+    return 1;
   }
 
-  Execute2();
+  return RequestData2(aRequest,inputVector,outputVector);
 }
 
-void
+int
 SALOME_ExtractGeometry
-::Execute2()
+::RequestData2(
+  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()));
+
   vtkIdType ptId, numPts, numCells, i, cellId, newCellId, newId, *pointMap;
   vtkIdList *cellPts;
   vtkCell *cell;
@@ -202,10 +233,8 @@ SALOME_ExtractGeometry
   vtkFloatingPointType multiplier;
   vtkPoints *newPts;
   vtkIdList *newCellPts;
-  vtkDataSet *input = this->GetInput();
   vtkPointData *pd = input->GetPointData();
   vtkCellData *cd = input->GetCellData();
-  vtkUnstructuredGrid *output = this->GetOutput();
   vtkPointData *outputPD = output->GetPointData();
   vtkCellData *outputCD = output->GetCellData();
   int npts;
@@ -215,7 +244,7 @@ SALOME_ExtractGeometry
   if ( ! this->ImplicitFunction )
     {
     vtkErrorMacro(<<"No implicit function specified");
-    return;
+    return 0;
     }
 
   newCellPts = vtkIdList::New();
@@ -369,4 +398,6 @@ SALOME_ExtractGeometry
     }
 
   output->Squeeze();
+
+  return 1;
 }
index 6fcb07b6ea57900dcf49ff9c7892f67d646fffd3..f99d1ba2ec480fb9d8b84b9bf60da30ad10cc9f9 100755 (executable)
@@ -72,8 +72,9 @@ protected:
   SALOME_ExtractGeometry();
   ~SALOME_ExtractGeometry();
 
-  virtual void Execute();
-  void Execute2();
+  // Usual data generation method
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+  virtual int RequestData2(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
 
 private:
   bool myStoreMapping;
index 6bf730094209bae038311ab6cbf9c13ee622000a..8d61b4e125d5a2bd63d3e9b97aa69c00e7b08766 100644 (file)
@@ -27,6 +27,7 @@
 #include "VISU_Convertor.hxx"
 #include "VISU_MeshPL.hxx"
 #include "VISU_ScalarMapPL.hxx"
+#include "VISU_PrsMergerPL.hxx"
 #include "VISU_IsoSurfacesPL.hxx"
 #include "VISU_CutPlanesPL.hxx"
 #include "VISU_CutLinesPL.hxx"
@@ -36,7 +37,7 @@
 #include "VISU_GaussPointsPL.hxx"
 #include "VISU_Plot3DPL.hxx"
 
-typedef VISU_GaussPointsPL TPresent;
+typedef VISU_ScalarMapPL TPresent;
 
 #include <vtkUnstructuredGrid.h>
 #include <vtkDataSetMapper.h>
@@ -47,6 +48,7 @@ typedef VISU_GaussPointsPL TPresent;
 #include <vtkRenderer.h>
 #include <vtkCamera.h>
 #include <vtkActor.h>
+#include <vtk3DWidget.h>
 
 #include <vtkProperty.h>
 
@@ -56,11 +58,9 @@ using namespace std;
 
 static int isOnlyMesh = false;
 
-int main(int argc, char** argv)
-{
-  try {
-    if(argc > 1)
-    {
+int main(int argc, char** argv){
+  try{
+    if(argc > 1){
       vtkRenderWindow *renWin = vtkRenderWindow::New();
       vtkRenderer *ren = vtkRenderer::New();
       renWin->AddRenderer(ren);
@@ -78,43 +78,46 @@ int main(int argc, char** argv)
       const VISU::PMesh aMesh = aMeshMapIter->second;
       const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
       VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
-      if(isOnlyMesh)
-      {
-             const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
-             aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
+      if(isOnlyMesh){
+       const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
+       aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
 
-             VISU::PIDMapper anIDMapper = 
-               aConvertor->GetMeshOnEntity(aMeshName,anEntity);
-             VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
+       VISU::PIDMapper anIDMapper = 
+         aConvertor->GetMeshOnEntity(aMeshName,anEntity);
+       VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
 
-             VISU_MeshPL* aPresent = VISU_MeshPL::New();
-             aPresent->SetInput(aDataSet);
-             aPresent->Build();
+       VISU_MeshPL* aPresent = VISU_MeshPL::New();
+       aPresent->SetInput(aDataSet);
+       aPresent->Build();
 
-             vtkActor* aActor = vtkActor::New();
-             aActor->SetMapper(aPresent->GetMapper());
-             aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
-             //ren->ResetCameraClippingRange();
+       vtkActor* aActor = vtkActor::New();
+       aActor->SetMapper(aPresent->GetMapper());
+       aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
+       //ren->ResetCameraClippingRange();
 
-             ren->AddActor(aActor);
+       ren->AddActor(aActor);
 
-             renWin->Render();
-             iren->Start();
-             return 0;
+       renWin->Render();
+       iren->Start();
+       return 0;
       }
       //Import fields
       aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+      cout << "Input iteration:";
+      int aIter;
+      cin >> aIter;
+      int aCount = 0;
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) {
        const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
        const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
        const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
        VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
-       for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
+       for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++,aCount++){
          const VISU::PField aField = aFieldMapIter->second;
-         /*
-         if(aField->myNbComp == 1) 
+         if(aCount != aIter)
            continue;
-         */
+//       if(aField->myNbComp == 1) 
+//         continue;
          const string& aFieldName = aFieldMapIter->first;
          const VISU::TValField& aValField = aField->myValField;
          VISU::TValField::const_iterator aValFieldIter = aValField.begin();
@@ -122,15 +125,8 @@ int main(int argc, char** argv)
          int aTimeStamp = aValFieldIter->first;
 
          TPresent* aPresent = TPresent::New();
-         VISU::PIDMapper anIDMapper;
-         if(anEntity != VISU::NODE_ENTITY){
-           VISU::PGaussPtsIDMapper aGaussPtsIDMapper = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
-           aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper);
-         }else{
-           continue;
-           VISU::PIDMapper anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
-           aPresent->SetIDMapper(anIDMapper);
-         }
+         VISU::PIDMapper anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+         aPresent->SetIDMapper(anIDMapper);
 
          aPresent->Build();
          aPresent->Init();
@@ -145,11 +141,8 @@ int main(int argc, char** argv)
          strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" );
          //cout << anAlphaTexture << endl;
 
-         vtkSmartPointer<vtkImageData> aTextureValue = VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
-         aPresent->SetImageData( aTextureValue.GetPointer() );
-
          aPresent->Update();
-
+         
          vtkActor* anActor = vtkActor::New();
          anActor->SetMapper(aPresent->GetMapper());
 
@@ -167,11 +160,9 @@ int main(int argc, char** argv)
        }
       }
     }
-  }
-  catch(std::exception& exc){
+  }catch(std::exception& exc){
     MESSAGE("Follow exception was occured :\n"<<exc.what());
-  }
-  catch(...){
+  }catch(...){
     MESSAGE("Unknown exception was occured in VISU_Convertor_impl");
   }
   return 1;
index 91a2f6492ad2b70716c57bf7f68adcbdddeadb8f..a6629c7c6c2cfd89102cd46811172857dfd04c3f 100644 (file)
@@ -125,9 +125,7 @@ void
 VISU_CutPlanesPL
 ::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData)
 {
-  int iEnd = theAppendPolyData->GetNumberOfInputs();
-  for(int i = iEnd-1; i >= 0; i--)
-    theAppendPolyData->RemoveInput(theAppendPolyData->GetInput(i));
+  theAppendPolyData->RemoveAllInputs();
 }
 
 vtkFloatingPointType* 
index 0a69dc9b838cd412785c0c357076da0e4f44d89a..b430876eadd2acdcd97cec66165bcb985cb268ee 100644 (file)
@@ -43,10 +43,12 @@ VISU_DeformedShapePL
 VISU_DeformedShapePL
 ::~VISU_DeformedShapePL()
 {
-  myWarpVector->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  // myWarpVector->UnRegisterAllOutputs();
   myWarpVector->Delete();
 
-  myCellDataToPointData->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myCellDataToPointData->UnRegisterAllOutputs();
   myCellDataToPointData->Delete();
 }
 
index c33d071a614944277d1bba6625e3dfe06ce802ac..03a20ae8c7ea9529f3271f33c5fc6adf9a779317 100644 (file)
@@ -34,6 +34,9 @@
 #include <vtkPointData.h>
 #include <vtkCellData.h>
 #include <vector>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+
 
 using namespace std;
 
@@ -56,15 +59,20 @@ void VISU_Extractor::SetScalarMode(int theScalarMode)
   }
 }
 
-template<typename TypeData> void
+template<typename TypeData> int
 execute(int theNbElems, 
        int theScalarMode, 
        TypeData* theInputData, 
        TypeData* theOutputData)
 {
   if(theNbElems < 1 )
-    return;
-  vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD");
+    return 0;
+  
+  if(theInputData->GetNumberOfArrays() < 1)
+    return 1; // no fields output
+
+  string aFieldName = "VISU_FIELD";
+  vtkDataArray* aFieldArray = theInputData->GetArray(aFieldName.c_str());
   if(vtkFloatArray *aFloatArray = dynamic_cast<vtkFloatArray*>(aFieldArray)){
     int aNbComp = aFloatArray->GetNumberOfComponents();
     std::vector<vtkFloatingPointType> anArray(aNbComp < 3? 3: aNbComp);
@@ -89,10 +97,29 @@ execute(int theNbElems,
     theOutputData->SetScalars(aScalars);
     aScalars->Delete();
   }
+  return 1;
 }
 
-void VISU_Extractor::Execute(){
-  vtkDataSet *input = this->GetInput(), *output = this->GetOutput();
+// waiting for porting vtkSource to the new executive-based pipeline architecture.
+// int VISU_Extractor::RequestData(
+//   vtkInformation *vtkNotUsed(request),
+//   vtkInformationVector **inputVector,
+//   vtkInformationVector *outputVector)
+void VISU_Extractor::Execute()
+{
+  int aRet = 1;
+// waiting for porting vtkSource 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
+//   vtkDataSet *input = vtkDataSet::SafeDownCast(
+//     inInfo->Get(vtkDataObject::DATA_OBJECT()));
+//   vtkDataSet *output = vtkDataSet::SafeDownCast(
+//     outInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkDataSet *input = this->GetInput();
+  vtkDataSet *output = this->GetOutput();
   output->CopyStructure(input);
   output->GetPointData()->CopyAllOff();
   output->GetCellData()->CopyAllOff();
@@ -101,7 +128,7 @@ void VISU_Extractor::Execute(){
     int aNbElems = input->GetNumberOfPoints();
     vtkPointData *inData = input->GetPointData(), *outData = output->GetPointData();
     if(!inData->GetAttribute(vtkDataSetAttributes::SCALARS))
-      execute(aNbElems,myScalarMode,inData,outData);
+      aRet = execute(aNbElems,myScalarMode,inData,outData);
     else
       output->GetPointData()->CopyScalarsOn();
     outData->PassData(inData);
@@ -111,10 +138,12 @@ void VISU_Extractor::Execute(){
     int aNbElems = input->GetNumberOfCells();
     vtkCellData *inData = input->GetCellData(), *outData = output->GetCellData();
     if(inData->GetAttribute(vtkDataSetAttributes::VECTORS))
-      execute(aNbElems,myScalarMode,inData,outData);
+      aRet = execute(aNbElems,myScalarMode,inData,outData);
     else
       output->GetCellData()->CopyScalarsOn();
     outData->PassData(inData);
     outData->AddArray(inData->GetArray("VISU_FIELD"));
   }
+  
+  //  return aRet;
 }
index 797f9af1c1478c5cc4b6243d2d23e37b15424592..2ddc57abd59b23cf5b33c3e5d054898a77834450 100644 (file)
@@ -42,6 +42,8 @@ protected:
   VISU_Extractor(const VISU_Extractor&);
   ~VISU_Extractor();
 
+  // waiting for porting vtkSource to the new executive-based pipeline architecture.
+  //virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
   virtual void Execute();
 
   int myScalarMode;
index 598a36e229be4add9444a28dad63335e11206291..e0f1516c36aecbc2d2422bcbe2a9964e3d3d6935 100644 (file)
@@ -29,6 +29,8 @@
 #include <vtkCellData.h>
 #include <vtkDataSet.h>
 #include <vtkMath.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 
 static vtkFloatingPointType Tolerance = 1.0 / VTK_LARGE_FLOAT;
 
@@ -71,13 +73,6 @@ VISU_FieldTransform
 }
 
 
-void
-VISU_FieldTransform
-::Update()
-{
-  vtkSource::Update();
-}
-
 unsigned long 
 VISU_FieldTransform
 ::GetMTime()
@@ -230,11 +225,27 @@ ExecScalars(VISU_FieldTransform::TTransformFun theFunction,
   aNewScalars->Delete();
 }
 
-void
+// waiting for porting vtkSource to the new executive-based pipeline architecture.
+int
 VISU_FieldTransform
-::Execute()
+::RequestData(
+  vtkInformation *vtkNotUsed(request),
+  vtkInformationVector **inputVector,
+  vtkInformationVector *outputVector)
+// void VISU_FieldTransform::Execute()
 {
-  vtkDataSet *input = this->GetInput(), *output = 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()));
+//   vtkDataSet *input = this->GetInput();
+//   vtkDataSet *output = this->GetOutput();
+
   output->CopyStructure(input);
   if(myFunction != &Ident || (myTransform && !myTransform->IsIdentity())){
     output->GetPointData()->CopyAllOff();
@@ -252,4 +263,6 @@ VISU_FieldTransform
     output->GetPointData()->PassData(input->GetPointData());
     output->GetCellData()->PassData(input->GetCellData());
   }
+  
+  return 1;
 }
index f84e0b4d6d977b281c121d1cb85920aa2b2f186a..c8959a3c1da93e5babc2306996471485f01863ed 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
-//  File   : VISU_Extractor.hxx
+//  File   : VISU_FieldTransform.hxx
 //  Author : Alexey PETROV
 //  Module : VISU
 
 #ifndef VISU_FieldTransform_HeaderFile
 #define VISU_FieldTransform_HeaderFile
 
-#include <vtkDataSetToDataSetFilter.h>
+#include <vtkDataSetAlgorithm.h>
 
 #include "VTKViewer.h"
 
 class VTKViewer_Transform;
 
-class VTK_EXPORT VISU_FieldTransform : public vtkDataSetToDataSetFilter
+class VTK_EXPORT VISU_FieldTransform : public vtkDataSetAlgorithm
 {
 public:
-  vtkTypeMacro(VISU_FieldTransform,vtkDataSetToDataSetFilter);
+  vtkTypeMacro(VISU_FieldTransform,vtkDataSetAlgorithm);
   static VISU_FieldTransform *New();
 
-  virtual void Update();
   virtual unsigned long GetMTime();
   
   static double Ident(double theArg);
@@ -59,9 +58,14 @@ public:
 protected:
   VISU_FieldTransform();
   virtual ~VISU_FieldTransform();
+
+  // waiting for porting vtkSource to the new executive-based pipeline architecture.
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+  //  virtual void Execute();
+
   VISU_FieldTransform(const VISU_FieldTransform&) {};
   void operator=(const VISU_FieldTransform&) {};
-  void Execute();
+
 
   VTKViewer_Transform *myTransform;
   TTransformFun myFunction;
index 3ffc756480d8959e83d6a04f045c343d064e6cec..0c29c689911196d9e1d4052e2b02d90a51785d3a 100644 (file)
@@ -32,7 +32,6 @@
 #include "SALOME_ExtractGeometry.h"
 #include "VISU_DeformedShapePL.hxx"
 #include "VISU_OpenGLPointSpriteMapper.hxx"
-#include "VTKViewer_PassThroughFilter.h"
 
 #include <vtkPointSource.h>
 #include <vtkElevationFilter.h>
@@ -43,6 +42,7 @@
 #include <vtkWarpVector.h>
 #include <vtkGlyph3D.h>
 #include <vtkSphereSource.h>
+#include <vtkPassThroughFilter.h>
 
 //----------------------------------------------------------------------------
 vtkStandardNewMacro(VISU_GaussPointsPL);
@@ -81,7 +81,7 @@ VISU_GaussPointsPL
   myGlyph->SetSource( mySphereSource->GetOutput() );
 
   for(int i = 0; i < 2; i++)
-    myPassFilter.push_back(VTKViewer_PassThroughFilter::New());
+    myPassFilter.push_back(vtkPassThroughFilter::New());
 }
 
 
@@ -311,7 +311,7 @@ VISU_GaussPointsPL
 ::GetNodeCoord(int theObjID)
 {
   vtkIdType anID = GetNodeVTKID(theObjID);
-  vtkDataSet* aDataSet = myGeomFilter->GetInput();
+  vtkDataSet* aDataSet = myGeomFilter->GetPolyDataInput(0);
   return aDataSet->GetPoint(anID);
 }
 
index f0698f4fff1a05d7cd881e22227966bc13b61442..f0e984a9d11be76f3166ee8f6b971a4417788be7 100644 (file)
@@ -34,7 +34,6 @@
 
 #include <vector>
 
-class VTKViewer_PassThroughFilter;
 class VISU_OpenGLPointSpriteMapper;
 
 class vtkGeometryFilter;
@@ -43,6 +42,7 @@ class vtkSphereSource;
 class vtkDataArray;
 class vtkImageData;
 class vtkPointSet;
+class vtkPassThroughFilter;
 
 class vtkCellDataToPointData;
 class vtkWarpVector;
@@ -269,7 +269,7 @@ protected:
   vtkFloatingPointType myScaleFactor;
   vtkWarpVector *myWarpVector;
   vtkCellDataToPointData* myCellDataToPointData;
-  std::vector<VTKViewer_PassThroughFilter*> myPassFilter;
+  std::vector<vtkPassThroughFilter*> myPassFilter;
   
   vtkGlyph3D* myGlyph;
   vtkSphereSource* mySphereSource;
index c8b9eaeaf1b1717356cd0e55d21d7ddc06b29cfa..eeb0093f14b6ced5ad295f0ac3adff5723d5a4ce 100644 (file)
@@ -44,10 +44,12 @@ VISU_IsoSurfacesPL
 VISU_IsoSurfacesPL
 ::~VISU_IsoSurfacesPL()
 {
-  myContourFilter->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myContourFilter->UnRegisterAllOutputs();
   myContourFilter->Delete();
 
-  myCellDataToPointData->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myCellDataToPointData->UnRegisterAllOutputs();
   myCellDataToPointData->Delete();
 }
 
index 6f0edac826102bf4b4369d54fbd6ce026cb967ab..c530046879897b46c7d1322c22824b575de00aa4 100755 (executable)
@@ -27,7 +27,7 @@
 
 #include "VISU_OpenGLPointSpriteMapper.hxx"
 
-#include <SVTK_Extension.h>
+#include "SVTK_Extension.h"
 
 #include <vtkCamera.h>
 #include <vtkCellArray.h>
index 9c553cf952993b30a872adff4e6a88dc07f13231..8ea35b9a373e4734018cd40660e21da1752b3e21 100644 (file)
@@ -152,7 +152,6 @@ VISU_PipeLine
 {
   if(theInput)
     theInput->Update();
-
   myExtractGeometry->SetInput(theInput);
   myInput = theInput;
 
index 9b46c9fb7e6e4845ac60a198fec6e71652099eda..8701c47f0ec8aea47cdf74444ec5d2c1b1d08b9d 100644 (file)
@@ -27,7 +27,6 @@
 #include "VISU_PrsMergerPL.hxx"
 #include "VISU_MeshPL.hxx"
 #include "VISU_ScalarMapPL.hxx"
-#include "VISU_MergeFilter.hxx"
 #include "VISU_IDMapper.hxx"
 #include "VTKViewer_AppendFilter.h"
 
@@ -65,7 +64,6 @@ VISU_PrsMergerPL
 {
   myScalars = NULL;
   
-  //myMergeFilter->Delete();
   myMeshGeometryList.clear();
 }
 
index 624159f5a83a2e46e70caa1851fb322031f410ab..6f7fbebbe60356b7831d6210df6773d69f36d659 100644 (file)
@@ -34,7 +34,7 @@
 #include <vtkLookupTable.h>
 #include <vtkTextProperty.h>
 #include <vtkScalarBarActor.h>
-#include <vtkIdType.h>
+#include <vtkType.h>
 
 #include <string.h>
 
index 60c3bf5b598830cbe110fcd18c9792b35b01e1b5..a2aa2938304ddfd7ff7b47ec5015f12744614dc5 100644 (file)
 #include "VISU_PipeLineUtils.hxx"
 #include "VTKViewer_TransformFilter.h"
 #include "VTKViewer_Transform.h"
+#include "VISU_MergeFilter.hxx"
 
 #include <vtkWarpVector.h>
-#include <vtkMergeFilter.h>
+
 #include <vtkUnstructuredGrid.h>
 #include <vtkCellDataToPointData.h>
 #include <vtkPointDataToCellData.h>
@@ -52,7 +53,7 @@ VISU_ScalarMapOnDeformedShapePL
 ::VISU_ScalarMapOnDeformedShapePL()
 {
   myDeformVectors = vtkWarpVector::New();
-  myMergeFilter   = vtkMergeFilter::New();
+  myMergeFilter   = VISU_MergeFilter::New();
   myExtractorScalars = VISU_Extractor::New();
   myCellDataToPointData = vtkCellDataToPointData::New();
 }
@@ -64,16 +65,20 @@ VISU_ScalarMapOnDeformedShapePL
 VISU_ScalarMapOnDeformedShapePL
 ::~VISU_ScalarMapOnDeformedShapePL()
 {
-  myDeformVectors->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myDeformVectors->UnRegisterAllOutputs();
   myDeformVectors->Delete();
 
-  myMergeFilter->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myMergeFilter->UnRegisterAllOutputs();
   myMergeFilter->Delete();
   
-  myExtractorScalars->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myExtractorScalars->UnRegisterAllOutputs();
   myExtractorScalars->Delete();
 
-  myCellDataToPointData->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myCellDataToPointData->UnRegisterAllOutputs();
   myCellDataToPointData->Delete();
 }
 
index 6ac481aff2b2e8d38889d330a573cf32f68580e6..ae76df9cabcc5aeffe0e84752fd23b8663c1134b 100644 (file)
@@ -30,7 +30,7 @@
 #include "VISUPipeline.hxx"
 #include "VISU_PrsMergerPL.hxx"
 
-class vtkMergeFilter;
+class VISU_MergeFilter;
 class vtkWarpVector;
 class vtkUnstructuredGrid;
 class vtkCellDataToPointData;
@@ -90,7 +90,7 @@ public:
 protected:
   vtkFloatingPointType myScaleFactor;
   vtkWarpVector  *myDeformVectors;
-  vtkMergeFilter *myMergeFilter;
+  VISU_MergeFilter *myMergeFilter;
   vtkSmartPointer<vtkUnstructuredGrid> myScalars;
   VISU_Extractor* myExtractorScalars;
   vtkCellDataToPointData* myCellDataToPointData;
index 22d3f8b736b3e8cb3fceb9576f116b3fe749beb3..e64f40f9300b21a7091addf0d2477cdb960767d1 100644 (file)
@@ -60,16 +60,20 @@ VISU_StreamLinesPL::VISU_StreamLinesPL(){
 }
 
 VISU_StreamLinesPL::~VISU_StreamLinesPL(){
-  myPointsFilter->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myPointsFilter->UnRegisterAllOutputs();
   myPointsFilter->Delete();
 
-  myCenters->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myCenters->UnRegisterAllOutputs();
   myCenters->Delete();
 
-  myGeomFilter->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myGeomFilter->UnRegisterAllOutputs();
   myGeomFilter->Delete();
 
-  myStream->UnRegisterAllOutputs();
+  // commented: porting to vtk5.0
+  //  myStream->UnRegisterAllOutputs();
   myStream->Delete();
 }
 
index cef3b80db25b360b826af7935b58c0a7455f541a..498d6e901d6a0cdf3bd197876faf8ea6bff932ca 100644 (file)
@@ -218,7 +218,8 @@ OrientedPlane::~OrientedPlane()
   myMapper->RemoveAllInputs();
   myMapper->Delete();
   
-  myPlaneSource->UnRegisterAllOutputs();
+  // commented: porting to vtk 5.0
+  //myPlaneSource->UnRegisterAllOutputs();
   myPlaneSource->Delete();
 }
 
index abbdd3f625c454c41593f20bb89412e9bb1a730e..f02b2e8a1aa82f890b47c397d1ec8efd81833d0c 100644 (file)
@@ -119,7 +119,8 @@ class TPlane : public SALOME_Actor
   ~TPlane() {
     myMapper->RemoveAllInputs();
     myMapper->Delete();
-    myPlaneSource->UnRegisterAllOutputs();
+    // commented: porting to vtk 5.0
+    //myPlaneSource->UnRegisterAllOutputs();
     myPlaneSource->Delete();
   };
   // Not implemented.
index 6d1ec82ecaed1c045eac944f733001c1b372076d..f5a6e243ff260b667c6097289fbf5a5b4d98fbea 100644 (file)
@@ -370,7 +370,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
     aTitle = aTitle.simplifyWhiteSpace();
     aTableOfReal->SetTitle(aTitle.latin1());
     
-    int iLineEnd = myCutLinesPL->GetAppendPolyData()->GetNumberOfInputs();
+    int iLineEnd = myCutLinesPL->GetAppendPolyData()->GetNumberOfInputConnections(0);
     if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLineEnd = "<<iLineEnd);
     TXCont aXCont;
     TXYMapCont aXYMapCont; 
@@ -424,7 +424,8 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
        aXYMap[aDist] = aScalars->GetTuple1(i);
       }
       if(aFilter){
-       aFilter->UnRegisterAllOutputs();
+       // commented: porting to vtk 5.0
+       //aFilter->UnRegisterAllOutputs();
        aFilter->Delete();
       }
     }
index ba959d3ae53c7480e6bc2a450afe214fdc7fdc11..4e622a539c58b5856ba894292cf3570d2c33067c 100644 (file)
@@ -161,7 +161,8 @@ void VISU::StreamLines_i::ToStream(std::ostringstream& theStr){
 
 VISU::StreamLines_i::~StreamLines_i(){
   if(MYDEBUG) MESSAGE("StreamLines_i::~StreamLines_i()");
-  myAppendFilter->UnRegisterAllOutputs();
+  // commented: porting to vtk 5.0
+  //myAppendFilter->UnRegisterAllOutputs();
   myAppendFilter->Delete();
 }
 
@@ -178,7 +179,7 @@ VISU::StreamLines_i::SetParams(CORBA::Double theIntStep,
   vtkPointSet* aSource = NULL;
   if(!thePrs3d->_is_nil())
     if((aPrs3di = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in()))){
-      for(int i = myAppendFilter->GetNumberOfInputs()-1; i >= 0; i--)
+      for(int i = myAppendFilter->GetNumberOfInputConnections(0)-1; i >= 0; i--)
        myAppendFilter->RemoveInput(myAppendFilter->GetInput(i));
       myAppendFilter->AddInput(aPrs3di->GetPL()->GetMapper()->GetInput());
       aSource = myAppendFilter->GetOutput();