]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to VTK 6.
authorouv <ouv@opencascade.com>
Wed, 23 Jan 2013 15:34:10 +0000 (15:34 +0000)
committerouv <ouv@opencascade.com>
Wed, 23 Jan 2013 15:34:10 +0000 (15:34 +0000)
First compilable version of KERNEL and GUI modules.

20 files changed:
src/SALOME_PY/Makefile.am
src/SVTK/Makefile.am
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_CubeAxesActor2D.cxx
src/SVTK/SVTK_CubeAxesActor2D.h
src/SVTK/SVTK_DeviceActor.cxx
src/SVTK/SVTK_ImageWriter.cxx
src/SVTK/SVTK_Recorder.cxx
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_ArcBuilder.cxx
src/VTKViewer/VTKViewer_ConvexTool.cxx
src/VTKViewer/VTKViewer_DataSetMapper.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h
src/VTKViewer/VTKViewer_FramedTextActor.cxx
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_MarkerUtils.cxx
src/VTKViewer/VTKViewer_Trihedron.cxx

index a9292e6b3012d04d428fc4a2a7927d17e4092b11..2e036236d69136927c29b61b0a11e21045a7e668 100755 (executable)
@@ -40,4 +40,4 @@ libSalomePy_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \
 
 libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \
        ../LightApp/libLightApp.la \
-       -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD -lvtkPythonCore
+       -lvtkWrappingPython26
index ad697f4fae752ab2b2447610f49eafd69dc57286..6fc34fed2bc6978e0f71ac9162a5ce803dde8727 100755 (executable)
@@ -88,11 +88,12 @@ dist_libSVTK_la_SOURCES= \
        SVTK_RecorderDlg.cxx \
        SVTK_ImageWriter.cxx \
        SVTK_ImageWriterMgr.cxx \
-       SVTK_Utils.cxx \
-       vtkPVAxesActor.h \
-       vtkPVAxesActor.cxx \
-       vtkPVAxesWidget.h \
-       vtkPVAxesWidget.cxx
+       SVTK_Utils.cxx
+# OUV_PORTING_VTK6: to do
+#      vtkPVAxesActor.h \
+#      vtkPVAxesActor.cxx \
+#      vtkPVAxesWidget.h \
+#      vtkPVAxesWidget.cxx
 
 
 # internal headers
@@ -148,7 +149,8 @@ libSVTK_la_CPPFLAGS =               \
        -I$(srcdir)/../OBJECT   \
        -I$(srcdir)/../Prs      \
        -I$(srcdir)/../VTKViewer \
-       -I$(srcdir)/../OpenGLUtils
+       -I$(srcdir)/../OpenGLUtils \
+       -DvtkRenderingCore_AUTOINIT="2(vtkInteractionStyle,vtkRenderingOpenGL)"
 
 libSVTK_la_LDFLAGS =                   \
        $(VTK_LIBS) $(OGL_LIBS)         \
index 74c57f9e9ee5f8d95d026c9323a8681c1e3ee134..705025e50be4c3412591d37589513d3cbcf83d93 100644 (file)
@@ -185,7 +185,7 @@ SALOME_Actor
   myOutline->Delete();
 
   vtkPolyDataMapper* anOutlineMapper = vtkPolyDataMapper::New();
-  anOutlineMapper->SetInput(myOutline->GetOutput());
+  anOutlineMapper->SetInputConnection(myOutline->GetOutputPort());
 
   myOutlineActor->Delete();
   myOutlineActor->SetMapper( anOutlineMapper );
index 0364c257affd4ddb7e89bb834fc4e1bba2735f56..2606eafb356a46d4f38cf7ba4023b8844c706bd0 100644 (file)
@@ -61,9 +61,9 @@ SVTK_CubeAxesActor2D::SVTK_CubeAxesActor2D()
   this->rgridMapperYZ = vtkPolyDataMapper::New();
   this->rgridMapperXZ = vtkPolyDataMapper::New();
 
-  this->rgridMapperXY->SetInput(this->planeXY->GetOutput());
-  this->rgridMapperYZ->SetInput(this->planeYZ->GetOutput());
-  this->rgridMapperXZ->SetInput(this->planeXZ->GetOutput());
+  this->rgridMapperXY->SetInputConnection(this->planeXY->GetOutputPort());
+  this->rgridMapperYZ->SetInputConnection(this->planeYZ->GetOutputPort());
+  this->rgridMapperXZ->SetInputConnection(this->planeXZ->GetOutputPort());
 
   this->wireActorXY->SetMapper(rgridMapperXY);
   this->wireActorYZ->SetMapper(rgridMapperYZ);
@@ -467,9 +467,9 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
   rgrid->SetYCoordinates(YCoords);
   rgrid->SetZCoordinates(ZCoords);
 
-  this->planeXY->SetInput(rgrid);
-  this->planeYZ->SetInput(rgrid);
-  this->planeXZ->SetInput(rgrid);
+  this->planeXY->SetInputData(rgrid);
+  this->planeYZ->SetInputData(rgrid);
+  this->planeXZ->SetInputData(rgrid);
 
   rgrid->Delete();
 
index 51b315903c23802ae14a358997e811bc945b1396..5f86853e7590141c25569cc5bd6cf7a76e73be53 100644 (file)
@@ -47,7 +47,7 @@ class VTKViewer_Transform;
 #endif
 
 #ifndef WIN32
-class VTK_HYBRID_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D
+class VTKRENDERINGANNOTATION_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D
 #else
 class SVTK_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D
 #endif
index 4a803ccc54a1b94372a651f5135cb578e0595b38..fc9d065922793df4e6219e541cf4631f8d4ef8ab 100644 (file)
@@ -120,28 +120,29 @@ SVTK_DeviceActor
 {
   if(theMapper){
     int anId = 0;
-    myPassFilter[ anId ]->SetInput( theMapper->GetInput() );
-    myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() );
+    myPassFilter[ anId ]->SetInputData( theMapper->GetInput() );
+    myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
     
     anId++; // 1
-    myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
+    myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
 
     anId++; // 2
-    myPassFilter[ anId ]->SetInput( myGeomFilter->GetOutput() ); 
-    myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+    myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() ); 
+    myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
 
     anId++; // 3
-    myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
+    myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
 
     anId++; // 4
-    myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() );
-    myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+    myPassFilter[ anId ]->SetInputConnection( myTransformFilter->GetOutputPort() );
+    myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
 
     anId++; // 5
+    // OUV_PORTING_VTK6: to check
     if(VTKViewer_DataSetMapper* aMapper = dynamic_cast<VTKViewer_DataSetMapper*>(theMapper)){
-      aMapper->SetInput(myPassFilter[anId]->GetOutput());
+      aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
     }else if(VTKViewer_PolyDataMapper* aMapper = dynamic_cast<VTKViewer_PolyDataMapper*>(theMapper)){
-      aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput());
+      aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
     }
   }
   Superclass::SetMapper(theMapper);
@@ -164,7 +165,7 @@ void
 SVTK_DeviceActor
 ::SetInput(vtkDataSet* theDataSet)
 {
-  myMapper->SetInput(theDataSet);
+  myMapper->SetInputData(theDataSet);
   InitPipeLine(myMapper);
 }
 
@@ -256,16 +257,19 @@ SVTK_DeviceActor
   if ( !myIsShrinkable ) 
     return;
   
-  if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() )
+  if ( vtkAlgorithmOutput* aDataSet = myPassFilter[ 0 ]->GetOutputPort() )
   {     
-    aDataSet->Update();
+    myPassFilter[ 0 ]->Update();
+    // OUV_PORTING_VTK6: to do
+    /*
     int numCells=aDataSet->GetNumberOfCells();
     int numPts = aDataSet->GetNumberOfPoints();
     //It's impossible to use to apply "shrink" for "empty" dataset
     if (numCells < 1 || numPts < 1)
             return;
-    myShrinkFilter->SetInput( aDataSet );
-    myPassFilter[ 1 ]->SetInput( myShrinkFilter->GetOutput() );
+    */
+    myShrinkFilter->SetInputConnection( aDataSet );
+    myPassFilter[ 1 ]->SetInputConnection( myShrinkFilter->GetOutputPort() );
     myIsShrunk = true;
   }
 }
@@ -278,9 +282,9 @@ SVTK_DeviceActor
 ::UnShrink() 
 {
   if ( !myIsShrunk ) return;
-  if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() )
+  if ( vtkAlgorithmOutput* aDataSet = myPassFilter[ 0 ]->GetOutputPort() )
   {    
-    myPassFilter[ 1 ]->SetInput( aDataSet );
+    myPassFilter[ 1 ]->SetInputConnection( aDataSet );
     myIsShrunk = false;
   }
 }
@@ -348,18 +352,18 @@ SVTK_DeviceActor
   if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled ) 
     return;
 
-  if ( vtkPolyData* aPolyData = myPassFilter[ 2 ]->GetPolyDataOutput() )
+  if ( vtkAlgorithmOutput* aPolyData = myPassFilter[ 2 ]->GetOutputPort() )
   {
     if( theIsFeatureEdgesEnabled )
     {
-      aPolyData->Update();
-      myFeatureEdges->SetInput( aPolyData );
-      myPassFilter[ 3 ]->SetInput( myFeatureEdges->GetOutput() );
+      myPassFilter[ 2 ]->Update();
+      myFeatureEdges->SetInputConnection( aPolyData );
+      myPassFilter[ 3 ]->SetInputConnection( myFeatureEdges->GetOutputPort() );
       myIsFeatureEdgesEnabled = true;
     }
     else
     {
-      myPassFilter[3]->SetInput( aPolyData );
+      myPassFilter[3]->SetInputConnection( aPolyData );
       myIsFeatureEdgesEnabled = false;
     }
     myIsFeatureEdgesEnabled = theIsFeatureEdgesEnabled;
index 581111ba6dfd65678fa688634b722e482d2efde5..35455be0db1e42fe2c20c365b9dc210605d14db6 100755 (executable)
@@ -62,13 +62,16 @@ SVTK_ImageWriter
 ::run()
 {
   vtkJPEGWriter *aWriter = vtkJPEGWriter::New();
-  vtkImageData *anImageData = myImageData;
+  vtkAlgorithmOutput *anImageData = 0;
   vtkSmartPointer<vtkImageClip> anImageClip;
   //
   if(myConstraint16Flag){ 
     int uExtent[6];
+    // OUV_PORTING_VTK6: to do
+    /*
     myImageData->UpdateInformation();
     myImageData->GetUpdateExtent(uExtent);
+    */
     unsigned int width = uExtent[1] - uExtent[0] + 1;
     unsigned int height = uExtent[3] - uExtent[2] + 1;
     width = (width / 16) * 16;
@@ -79,17 +82,20 @@ SVTK_ImageWriter
     anImageClip = vtkImageClip::New();
     anImageClip->Delete();
 
-    anImageClip->SetInput(myImageData);
+    anImageClip->SetInputData(myImageData);
     anImageClip->SetOutputWholeExtent(uExtent);
     anImageClip->ClipDataOn();
-    anImageData = anImageClip->GetOutput();
+    anImageData = anImageClip->GetOutputPort();
   }
   //
   aWriter->WriteToMemoryOff();
   aWriter->SetFileName(myName.c_str());
   aWriter->SetQuality(myQuality);
   aWriter->SetProgressive(myProgressive);
-  aWriter->SetInput(anImageData);
+  if(myConstraint16Flag)
+    aWriter->SetInputConnection(anImageData);
+  else
+    aWriter->SetInputData(myImageData);
   aWriter->Write();
 
   aWriter->Delete();
index 0be0147b3995793612310677d48c8f1289e9c000..6438a70fc3b9ba6e455cfac5855b450a607a71b4 100755 (executable)
@@ -396,12 +396,15 @@ SVTK_Recorder
     myErrorStatus = 20;
     return;
   }
+  // OUV_PORTING_VTK6: to do
+  /*
   anImageData->UpdateInformation();
   int *anExtent = anImageData->GetWholeExtent();
   anImageData->SetUpdateExtent(anExtent[0], anExtent[1],
                                anExtent[2], anExtent[3],
                                0,0);
   anImageData->UpdateData();
+  */
 }
 
 
index 271aa4c938e9e4809392a4ad2dbd9aeffce4b9f8..9aeea12b38690d8e0b6581fd1e759007abf2eb7e 100755 (executable)
@@ -91,8 +91,9 @@
 #include "SVTK_Recorder.h"
 #include "SVTK_RecorderDlg.h"
 
-#include "vtkPVAxesWidget.h"
-#include "vtkPVAxesActor.h"
+// OUV_PORTING_VTK6: to do
+//#include "vtkPVAxesWidget.h"
+//#include "vtkPVAxesActor.h"
 
 #include "SALOME_ListIteratorOfListIO.hxx"
 
@@ -200,6 +201,8 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   
   setCentralWidget(myInteractor);
   
+  // OUV_PORTING_VTK6: to do
+  /*
   myAxesWidget = vtkPVAxesWidget::New();
   myAxesWidget->SetParentRenderer(aRenderer->GetDevice());
   myAxesWidget->SetViewport(0, 0, 0.25, 0.25);
@@ -217,6 +220,7 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   anAxesActor->GetZAxisTipProperty()->SetColor(   0.0, 0.0, 1.0 );
   anAxesActor->GetZAxisShaftProperty()->SetColor( 0.0, 0.0, 1.0 );
   anAxesActor->GetZAxisLabelProperty()->SetColor( 0.0, 0.0, 1.0 );
+  */
 
   myView = new SVTK_View(this);
   Initialize(myView,theModel);
@@ -270,7 +274,8 @@ void SVTK_ViewWindow::Initialize(SVTK_View* theView,
 SVTK_ViewWindow::~SVTK_ViewWindow()
 {
   myRecorder->Delete();
-  myAxesWidget->Delete();
+  // OUV_PORTING_VTK6: to do
+  //myAxesWidget->Delete();
 }
 
 
@@ -1244,7 +1249,9 @@ void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes,
 */
 bool SVTK_ViewWindow::IsStaticTrihedronVisible() const
 {
-  return (bool)myAxesWidget->GetEnabled();
+  // OUV_PORTING_VTK6: to do
+  //return (bool)myAxesWidget->GetEnabled();
+  return false;
 }
 
 /*!
@@ -1252,7 +1259,8 @@ bool SVTK_ViewWindow::IsStaticTrihedronVisible() const
 */
 void SVTK_ViewWindow::SetStaticTrihedronVisible( const bool theIsVisible )
 {
-  myAxesWidget->SetEnabled( (int)theIsVisible );
+  // OUV_PORTING_VTK6: to do
+  //myAxesWidget->SetEnabled( (int)theIsVisible );
 }
 
 /*!
index abb6c0968d7dc2ce5a170405c97a2f9ec3fd9dc8..abca4207a41304b2d2a41de2547e337ed2a1899d 100755 (executable)
@@ -66,7 +66,8 @@ class SVTK_KeyFreeInteractorStyle;
 class SVTK_ViewParameterDlg;
 class SVTK_Recorder;
 
-class vtkPVAxesWidget;
+// OUV_PORTING_VTK6: to do
+//class vtkPVAxesWidget;
 
 class vtkObject;
 class QtxAction;
@@ -446,7 +447,8 @@ protected:
   int myToolBar;
   int myRecordingToolBar;
 
-  vtkPVAxesWidget* myAxesWidget;
+  // OUV_PORTING_VTK6: to do
+  //vtkPVAxesWidget* myAxesWidget;
   Qtx::BackgroundData myBackground;
 
 private:
index fc8eda9a24e9b969a88d985043190dbd70f2bb7b..d206110c94e34646b1b7b147635d9fc640e9c393 100755 (executable)
@@ -180,29 +180,30 @@ VTKViewer_Actor
 {
   if(theMapper){
     int anId = 0;
-    myPassFilter[ anId ]->SetInput( theMapper->GetInput() );
-    myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() );
+    myPassFilter[ anId ]->SetInputData( theMapper->GetInput() );
+    myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
     
     anId++; // 1
     myGeomFilter->SetStoreMapping( myStoreMapping );
-    myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
+    myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
 
     anId++; // 2
-    myPassFilter[ anId ]->SetInput( myGeomFilter->GetOutput() ); 
-    myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+    myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() ); 
+    myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
 
     anId++; // 3
-    myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
+    myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
 
     anId++; // 4
-    myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() );
-    myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+    myPassFilter[ anId ]->SetInputConnection( myTransformFilter->GetOutputPort() );
+    myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
 
     anId++; // 5
+    // OUV_PORTING_VTK6: to check
     if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper)){
-      aMapper->SetInput(myPassFilter[anId]->GetOutput());
+      aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
     }else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper)){
-      aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput());
+      aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
     }
   }
   Superclass::SetMapper(theMapper);
index 26df8dbdc29e9e3b8494bb48d9ea5a60967156f8..8fec33a8d374936552122c1e5f31e0120ce4f472 100644 (file)
@@ -292,7 +292,7 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1,
       vtkUnstructuredGrid* aTransformedGrid;
       if(needRotation) {
         aTransformedGrid = TransformGrid(aGrid,aAxis,anAngle);    
-        aTransformedGrid->Update();
+        //aTransformedGrid->Update(); // OUV_PORTING_VTK6: seems to be useless
 #ifdef _MY_DEBUG_
         cout<<"Need Rotation!!!"<<endl;
 #endif
@@ -316,7 +316,7 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1,
       vtkUnstructuredGrid* anTransArc;
       if(needRotation) {
         anTransArc = TransformGrid(anArc,aAxis,-anAngle);
-        anTransArc->Update();
+        //anTransArc->Update(); // OUV_PORTING_VTK6: seems to be useless
       }
       else
         anTransArc = anArc;
@@ -335,7 +335,7 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1,
     aList.push_back(thePnt2);
     aList.push_back(thePnt3);
     vtkUnstructuredGrid* aGrid = BuildGrid(aList);
-    aGrid->Update();
+    //aGrid->Update(); // OUV_PORTING_VTK6: seems to be useless
     myPoints = aGrid->GetPoints();
 
     myScalarValues.clear();
@@ -397,7 +397,7 @@ VTKViewer_ArcBuilder::TransformGrid(vtkUnstructuredGrid* theGrid,
   aTransform->RotateWXYZ(angle, theAxis.GetXYZ().X(), theAxis.GetXYZ().Y(), theAxis.GetXYZ().Z());
   vtkTransformFilter* aTransformFilter  = vtkTransformFilter::New();
   aTransformFilter->SetTransform(aTransform);
-  aTransformFilter->SetInput(theGrid);
+  aTransformFilter->SetInputData(theGrid);
   aTransform->Delete();
   return aTransformFilter->GetUnstructuredGridOutput();
 }
@@ -472,8 +472,8 @@ vtkUnstructuredGrid* VTKViewer_ArcBuilder::BuildArc(std::vector<double>& theScal
   
   /*  double aTotalAngle =  fabs(angle3 - angle1);
   
-  if (aTotalAngle > vtkMath::DoublePi())
-    aTotalAngle = 2*vtkMath::DoublePi()-aTotalAngle;
+  if (aTotalAngle > vtkMath::Pi())
+    aTotalAngle = 2*vtkMath::Pi()-aTotalAngle;
   */
   
   double aTotalAngle = 0;
@@ -541,8 +541,8 @@ GetPointAngleOnCircle(const double theXCenter, const double theYCenter,
                       const double theXPoint, const double theYPoint){
   double result = atan2(theYCenter - theYPoint, theXPoint - theXCenter);
   if(result < 0 )
-    result = result+vtkMath::DoublePi()*2;
-  return vtkMath::DoublePi()*2-result;
+    result = result+vtkMath::Pi()*2;
+  return vtkMath::Pi()*2-result;
   return result;
 }
 
@@ -562,11 +562,11 @@ VTKViewer_ArcBuilder::IncOrder VTKViewer_ArcBuilder::GetArcAngle( const double&
     aResult = VTKViewer_ArcBuilder::PLUS;
   }
   else if((P1 < P3 && P3 < P2) || (P2 < P1 && P1 < P3)){
-    *Ang = 2*vtkMath::DoublePi() - P3 + P1;
+    *Ang = 2*vtkMath::Pi() - P3 + P1;
     aResult = VTKViewer_ArcBuilder::MINUS;
   }
   else if((P2 < P3 && P3 < P1) || (P3 < P1 && P1 < P2)){
-    *Ang = 2*vtkMath::DoublePi() - P1 + P3;
+    *Ang = 2*vtkMath::Pi() - P1 + P3;
     aResult = VTKViewer_ArcBuilder::PLUS;
   }
   else if(P3 < P2 && P2 < P1){
index 3cd96908ab0383d3ae678e06f02e081da56f862b..519227de9778cbf9e29f79192b6faf6ee917220c 100644 (file)
@@ -697,8 +697,8 @@ VTKViewer_DelaunayTriangulator
   myUnstructuredGrid->Allocate();
   myUnstructuredGrid->SetPoints(myPoints);
 
-  myDelaunay3D->SetInput(myUnstructuredGrid);
-  myGeometryFilter->SetInput(myDelaunay3D->GetOutput());
+  myDelaunay3D->SetInputData(myUnstructuredGrid);
+  myGeometryFilter->SetInputConnection(myDelaunay3D->GetOutputPort());
   myPolyData = myGeometryFilter->GetOutput();
 }
 
index fad3d91795f5b916357da2b7fefac1cd65c19897..8394ed9f7a4a4aef4ee1bed4d98023c1bb94ca67 100644 (file)
@@ -48,7 +48,7 @@ void VTKViewer_DataSetMapper::Render(vtkRenderer *ren, vtkActor *act)
   {
     vtkDataSetSurfaceFilter *gf = vtkDataSetSurfaceFilter::New();
     VTKViewer_PolyDataMapper *pm = VTKViewer_PolyDataMapper::New();
-    pm->SetInput(gf->GetOutput());
+    pm->SetInputConnection(gf->GetOutputPort());
 
     pm->SetMarkerEnabled( this->MarkerEnabled );
     if( this->MarkerType != VTK::MT_USER )
index 25ca840fbd9c749570e77d77842b7c321f72c6b4..076f1bc3cba2328fed14e8a9d196fe89bcd91b0b 100755 (executable)
@@ -178,15 +178,10 @@ inline void InsertPointCell(vtkCellArray *theConnectivity,
 }
 
 
-// int VTKViewer_ExtractUnstructuredGrid::RequestData(
-//   vtkInformation *vtkNotUsed(request),
-//   vtkInformationVector **inputVector,
-//   vtkInformationVector *outputVector)
-void VTKViewer_ExtractUnstructuredGrid::Execute()
+int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(request),
+                                                   vtkInformationVector **inputVector,
+                                                   vtkInformationVector *outputVector)
 {
-  /*
-  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);
@@ -196,9 +191,9 @@ void VTKViewer_ExtractUnstructuredGrid::Execute()
     inInfo->Get(vtkDataObject::DATA_OBJECT()));
   vtkUnstructuredGrid *anOutput = vtkUnstructuredGrid::SafeDownCast(
     outInfo->Get(vtkDataObject::DATA_OBJECT()));
-  */
-  vtkUnstructuredGrid *anInput = this->GetInput();
-  vtkUnstructuredGrid *anOutput = this->GetOutput();
+
+  //vtkUnstructuredGrid *anInput = this->GetInput();
+  //vtkUnstructuredGrid *anOutput = this->GetOutput();
   
   myOut2InId.clear();  myIn2OutId.clear();
 
@@ -414,5 +409,5 @@ void VTKViewer_ExtractUnstructuredGrid::Execute()
       MESSAGE("Execute - myIn2OutId.size() = "<<myIn2OutId.size());
     }
   }*/
-//  return 1;
+  return 1;
 }
index 4b4330c7670b89988ec9a1746e8b7e05725be79f..bcb701462797d319c85e6ab1eca12424017c5763 100755 (executable)
@@ -25,7 +25,7 @@
 
 #include "VTKViewer.h"
 
-#include <vtkUnstructuredGridToUnstructuredGridFilter.h>
+#include <vtkUnstructuredGridAlgorithm.h>
 
 #include <set>
 #include <map>
 #pragma warning ( disable:4251 )
 #endif
 
-/*! \class vtkUnstructuredGridToUnstructuredGridFilter
+/*! \class vtkUnstructuredGridAlgorithm
  * \brief For more information see <a href="http://www.vtk.org/">VTK documentation</a>
  */
-/*! \class vtkUnstructuredGridToUnstructuredGridFilter
+/*! \class vtkUnstructuredGridAlgorithm
  * \brief For more information see VTK documentation.
  */
-class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructuredGridToUnstructuredGridFilter
+class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructuredGridAlgorithm
 {
 public:
   //! VTK type macros.
-  vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridToUnstructuredGridFilter );
+  vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridAlgorithm );
 
   //! \brief Construct with all types of clipping turned off.
   static VTKViewer_ExtractUnstructuredGrid *New();
@@ -107,11 +107,7 @@ protected:
   VTKViewer_ExtractUnstructuredGrid();
   ~VTKViewer_ExtractUnstructuredGrid();
 
-  //! Main method, which calculate output
-  // 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();
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
 
   EExtraction myExtractionMode;
   
index 328d7fd07de183f12c8aa971adc202bfb2fe23a9..cf863eac762211ae019e85832d643c4368050c8e 100644 (file)
@@ -53,7 +53,7 @@ VTKViewer_FramedTextActor::VTKViewer_FramedTextActor()
   myTransparency=0.;
   myBar = vtkPolyData::New();
   myBarMapper = vtkPolyDataMapper2D::New();
-  myBarMapper->SetInput(myBar);
+  myBarMapper->SetInputData(myBar);
   myBarActor = vtkActor2D::New();
   myBarActor->SetMapper(myBarMapper);
   myBarActor->GetProperty()->SetOpacity(1.-myTransparency);  
index 7d139de0727e0000a820b41267b38454aae04a6b..2501ee83deceb78b1ee3e3283510160f37fae463 100755 (executable)
@@ -190,7 +190,7 @@ VTKViewer_GeometryFilter
   // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
   vtkIdType aNewPts[VTK_CELL_SIZE];
   // ghost cell stuff
-  unsigned char  updateLevel = (unsigned char)(output->GetUpdateGhostLevel());
+  unsigned char  updateLevel = (unsigned char)(GetUpdateGhostLevel());
   unsigned char  *cellGhostLevels = 0;
 
   PixelConvert[0] = 0;
index f21af7dc82d4213f99928284af232e0ecfb5ab28..64959af308815a928a7b1f4bc1e8a4cab2c03fe1 100755 (executable)
@@ -92,9 +92,10 @@ namespace VTK
     anImageData->Delete();
 
     anImageData->SetExtent( 0, aWidth-1, 0, aHeight-1, 0, 0 );
-    anImageData->SetScalarTypeToUnsignedChar();
-    anImageData->SetNumberOfScalarComponents( 4 );
-    anImageData->AllocateScalars();
+    // OUV_PORTING_VTK6: to do (see Scalars Manipulation Functions)
+    //anImageData->SetScalarTypeToUnsignedChar();
+    //anImageData->SetNumberOfScalarComponents( 4 );
+    //anImageData->AllocateScalars();
 
     unsigned char* aDataPtr = (unsigned char*)anImageData->GetScalarPointer();
 
@@ -109,7 +110,7 @@ namespace VTK
       aDataPtr[ anId++ ] = aValue * aCoef;
       aDataPtr[ anId++ ] = aValue;
     }
-    anImageData->Update();
+    //anImageData->Update(); // OUV_PORTING_VTK6: seems to be useless
 
     return anImageData;
   }
index 9f279af6740db2a54d8adb333dd995ee96b8b9a9..e5701d6f5fcc69691bfdbad0e922d8b28e48f414 100755 (executable)
@@ -89,7 +89,7 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
     int* aSize = theRenderer->GetRenderWindow()->GetSize();
     vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
     vtkDataSet* aDataSet = GetMapper()->GetInput();
-    aDataSet->Update();
+    GetMapper()->Update();
     vtkFloatingPointType aLength = aDataSet->GetLength();
     vtkFloatingPointType aPrecision = 1.0E-3;
     vtkFloatingPointType aZeroTol   = 1.0E-12;
@@ -140,7 +140,7 @@ VTKViewer_Axis::VTKViewer_Axis()
   myLineSource->SetPoint1(0.0,0.0,0.0);
   
   myMapper[0] = vtkPolyDataMapper::New();
-  myMapper[0]->SetInput(myLineSource->GetOutput());
+  myMapper[0]->SetInputConnection(myLineSource->GetOutputPort());
   
   myLineActor = VTKViewer_LineActor::New();
   myLineActor->SetMapper(myMapper[0]);
@@ -153,7 +153,7 @@ VTKViewer_Axis::VTKViewer_Axis()
   myConeSource->SetCenter(-0.5,0.0,0.0);
   
   myMapper[1] = vtkPolyDataMapper::New();
-  myMapper[1]->SetInput(myConeSource->GetOutput());
+  myMapper[1]->SetInputConnection(myConeSource->GetOutputPort());
   
   myArrowActor = vtkFollower::New();
   myArrowActor->SetMapper(myMapper[1]);
@@ -179,7 +179,7 @@ VTKViewer_Axis::VTKViewer_Axis()
   myVectorText = vtkVectorText::New();
   
   myMapper[2] = vtkPolyDataMapper::New();
-  myMapper[2]->SetInput(myVectorText->GetOutput());
+  myMapper[2]->SetInputConnection(myVectorText->GetOutputPort());
   
   myLabelActor = VTKViewer_UnScaledActor::New();
   myLabelActor->SetMapper(myMapper[2]);