From 7913d238ead6773bc2bfcbfe692738346626e4b7 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 1 Mar 2013 13:05:59 +0000 Subject: [PATCH] Merge from BR_PORTING_VTK6 01/03/2013 --- .../cmake_files/deprecated/FindVTK.cmake | 52 +--------- configure.ac | 2 +- src/SALOME_PY/Makefile.am | 5 +- src/SVTK/Makefile.am | 3 +- src/SVTK/SALOME_Actor.cxx | 55 +++++------ src/SVTK/SALOME_Actor.h | 8 +- src/SVTK/SVTK_Actor.cxx | 2 +- src/SVTK/SVTK_CubeAxesActor2D.cxx | 65 +++++++------ src/SVTK/SVTK_CubeAxesActor2D.h | 4 +- src/SVTK/SVTK_CubeAxesDlg.cxx | 4 +- src/SVTK/SVTK_DeviceActor.cxx | 87 +++++++++-------- src/SVTK/SVTK_DeviceActor.h | 30 +++--- src/SVTK/SVTK_ImageWriter.cxx | 18 ++-- src/SVTK/SVTK_ImageWriter.h | 3 + src/SVTK/SVTK_ImageWriterMgr.cxx | 5 +- src/SVTK/SVTK_ImageWriterMgr.h | 4 +- src/SVTK/SVTK_InteractorStyle.cxx | 18 ++-- src/SVTK/SVTK_InteractorStyle.h | 2 +- src/SVTK/SVTK_Recorder.cxx | 12 +-- src/SVTK/SVTK_Recorder.h | 2 +- src/SVTK/SVTK_RectPicker.cxx | 70 +++++++------- src/SVTK/SVTK_RectPicker.h | 32 +++---- src/SVTK/SVTK_Renderer.cxx | 14 +-- src/SVTK/SVTK_Renderer.h | 10 +- src/SVTK/SVTK_SetRotationPointDlg.cxx | 4 +- src/SVTK/SVTK_SetRotationPointDlg.h | 2 +- src/SVTK/SVTK_UpdateRateDlg.cxx | 18 ++-- src/SVTK/SVTK_UpdateRateDlg.h | 2 +- src/SVTK/SVTK_View.cxx | 10 +- src/SVTK/SVTK_ViewModel.cxx | 4 +- src/SVTK/SVTK_ViewModel.h | 6 +- src/SVTK/SVTK_ViewParameterDlg.cxx | 4 +- src/SVTK/SVTK_ViewParameterDlg.h | 2 +- src/SVTK/SVTK_ViewWindow.cxx | 10 +- src/SVTK/SVTK_ViewWindow.h | 4 +- src/SVTK/vtkPVAxesActor.cxx | 27 +++--- src/SVTK/vtkPVAxesActor.h | 6 +- src/SVTK/vtkPVAxesWidget.cxx | 3 +- src/SVTK/vtkPVAxesWidget.h | 2 +- src/VTKViewer/Makefile.am | 3 +- src/VTKViewer/VTKViewer.h | 7 -- src/VTKViewer/VTKViewer_Actor.cxx | 74 +++++++-------- src/VTKViewer/VTKViewer_Actor.h | 46 ++++----- src/VTKViewer/VTKViewer_AppendFilter.cxx | 1 - src/VTKViewer/VTKViewer_AppendFilter.h | 4 +- src/VTKViewer/VTKViewer_ArcBuilder.cxx | 24 ++--- src/VTKViewer/VTKViewer_ArcBuilder.h | 4 +- src/VTKViewer/VTKViewer_CellCenters.cxx | 1 - src/VTKViewer/VTKViewer_CellCenters.h | 2 +- src/VTKViewer/VTKViewer_CellLocationsArray.h | 2 + src/VTKViewer/VTKViewer_ConvexTool.cxx | 94 +++++++++---------- src/VTKViewer/VTKViewer_ConvexTool.h | 2 +- src/VTKViewer/VTKViewer_DataSetMapper.cxx | 3 +- src/VTKViewer/VTKViewer_DataSetMapper.h | 2 +- .../VTKViewer_ExtractUnstructuredGrid.cxx | 19 ++-- .../VTKViewer_ExtractUnstructuredGrid.h | 16 ++-- src/VTKViewer/VTKViewer_FramedTextActor.cxx | 65 +++++++------ src/VTKViewer/VTKViewer_FramedTextActor.h | 44 ++++----- src/VTKViewer/VTKViewer_GeometryFilter.cxx | 9 +- src/VTKViewer/VTKViewer_GeometryFilter.h | 10 +- src/VTKViewer/VTKViewer_InteractorStyle.cxx | 28 +++--- src/VTKViewer/VTKViewer_InteractorStyle.h | 6 +- src/VTKViewer/VTKViewer_MarkerUtils.cxx | 5 +- src/VTKViewer/VTKViewer_PolyDataMapper.cxx | 5 +- src/VTKViewer/VTKViewer_PolyDataMapper.h | 2 +- src/VTKViewer/VTKViewer_RenderWindow.cxx | 2 +- .../VTKViewer_RenderWindowInteractor.cxx | 2 +- src/VTKViewer/VTKViewer_ShrinkFilter.cxx | 5 +- src/VTKViewer/VTKViewer_ShrinkFilter.h | 2 +- src/VTKViewer/VTKViewer_Trihedron.cxx | 44 ++++----- src/VTKViewer/VTKViewer_Trihedron.h | 17 ++-- src/VTKViewer/VTKViewer_Utilities.cxx | 82 ++++++++-------- src/VTKViewer/VTKViewer_Utilities.h | 10 +- src/VTKViewer/VTKViewer_ViewWindow.cxx | 14 +-- tools/vtkEDFOverloads/vtkEDFCutter.cxx | 1 - tools/vtkEDFOverloads/vtkEDFCutter.h | 2 +- 76 files changed, 601 insertions(+), 669 deletions(-) diff --git a/adm_local/cmake_files/deprecated/FindVTK.cmake b/adm_local/cmake_files/deprecated/FindVTK.cmake index 4e0871c89..ee3b3b99d 100644 --- a/adm_local/cmake_files/deprecated/FindVTK.cmake +++ b/adm_local/cmake_files/deprecated/FindVTK.cmake @@ -17,52 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(FindVTK) - -SET(VTK_INCLUDES) -FOREACH(dir ${VTK_INCLUDE_DIRS}) - SET(VTK_INCLUDES ${VTK_INCLUDES} -I${dir}) -ENDFOREACH(dir ${VTK_INCLUDE_DIRS}) - -SET(VTK_LIBS) -FIND_LIBRARY(VTK_COMMON vtkCommon PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_COMMON}) -FIND_LIBRARY(VTK_GRAPHICS vtkGraphics PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_GRAPHICS}) -FIND_LIBRARY(VTK_IMAGING vtkImaging PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_IMAGING}) -FIND_LIBRARY(VTK_FILTERING vtkFiltering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_FILTERING}) -FIND_LIBRARY(VTK_IO vtkIO PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_IO}) -FIND_LIBRARY(VTK_RENDERING vtkRendering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_RENDERING}) -FIND_LIBRARY(VTK_HYBRID vtkHybrid PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_HYBRID}) -FIND_LIBRARY(VTK_PARALLEL vtkParallel PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_PARALLEL}) -FIND_LIBRARY(VTK_WIDGETS vtkWidgets PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_WIDGETS}) -FIND_LIBRARY(VTK_GENERIC_FILTERING vtkGenericFiltering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_GENERIC_FILTERING}) -FIND_LIBRARY(VTK_INFOVIS vtkInfovis PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_INFOVIS}) -FIND_LIBRARY(VTK_VOLUME_RENDERING vtkVolumeRendering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -SET(VTK_LIBS ${VTK_LIBS} ${VTK_VOLUME_RENDERING}) - -FIND_LIBRARY(vtkCommonPythonD vtkCommonPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -FIND_LIBRARY(vtkGraphicsPythonD vtkGraphicsPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -FIND_LIBRARY(vtkImagingPythonD vtkImagingPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) -FIND_LIBRARY(vtkPythonCore vtkPythonCore PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH) - - -#IF(NOT WINDOWS) -# IF(VTK_MAJOR_VERSION STREQUAL 5) -# IF(VTK_MINOR_VERSION STREQUAL 0) -# SET(VTK_INCLUDES ${VTK_INCLUDES} -Wno-deprecated) -# ENDIF(VTK_MINOR_VERSION STREQUAL 0) -# ENDIF(VTK_MAJOR_VERSION STREQUAL 5) -#ENDIF(NOT WINDOWS) - -SET(VTK_INCLUDES ${VTK_INCLUDES} -DVTK_EXCLUDE_STRSTREAM_HEADERS) -SET(VTK_DEFINITIONS -DVTK_EXCLUDE_STRSTREAM_HEADERS) \ No newline at end of file +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR) +FIND_PACKAGE(VTK 6.0 REQUIRED NO_MODULE) +INCLUDE(${VTK_USE_FILE}) diff --git a/configure.ac b/configure.ac index 2f2b435a3..49ace52fb 100644 --- a/configure.ac +++ b/configure.ac @@ -323,7 +323,7 @@ echo testing VTK echo --------------------------------------------- echo -CHECK_VTK +CHECK_PYVTK echo echo --------------------------------------------- diff --git a/src/SALOME_PY/Makefile.am b/src/SALOME_PY/Makefile.am index a9292e6b3..222d06650 100755 --- a/src/SALOME_PY/Makefile.am +++ b/src/SALOME_PY/Makefile.am @@ -38,6 +38,5 @@ libSalomePy_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \ -I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../OBJECT \ @CAS_CPPFLAGS@ -libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \ - ../LightApp/libLightApp.la \ - -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD -lvtkPythonCore +libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) ${VTK_PYLIBS} $(OGL_LIBS) \ + ../LightApp/libLightApp.la diff --git a/src/SVTK/Makefile.am b/src/SVTK/Makefile.am index ad697f4fa..e11dfa66c 100755 --- a/src/SVTK/Makefile.am +++ b/src/SVTK/Makefile.am @@ -148,7 +148,8 @@ libSVTK_la_CPPFLAGS = \ -I$(srcdir)/../OBJECT \ -I$(srcdir)/../Prs \ -I$(srcdir)/../VTKViewer \ - -I$(srcdir)/../OpenGLUtils + -I$(srcdir)/../OpenGLUtils \ + -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingOpenGL,vtkRenderingFreeTypeOpenGL)" libSVTK_la_LDFLAGS = \ $(VTK_LIBS) $(OGL_LIBS) \ diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 74c57f9e9..e6a89d098 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -84,13 +84,13 @@ namespace { int anEdgeId = 0; if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) { - vtkFloatingPointType aPickPosition[3]; + double aPickPosition[3]; thePicker->GetPickPosition(aPickPosition); - vtkFloatingPointType aMinDist = 1000000.0, aDist = 0; + double aMinDist = 1000000.0, aDist = 0; for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){ if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){ int subId; - vtkFloatingPointType pcoords[3], closestPoint[3], weights[3]; + double pcoords[3], closestPoint[3], weights[3]; aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights); if (aDist < aMinDist) { aMinDist = aDist; @@ -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 ); @@ -212,7 +212,7 @@ SALOME_Actor aForegroundColor.greenF(), aForegroundColor.blueF()); - vtkFloatingPointType aGroupNamesTransparency = 0.5; + double aGroupNamesTransparency = 0.5; aGroupNamesTransparency = aResourceMgr->doubleValue( "VTKViewer", "group_names_transparency", aGroupNamesTransparency ); myNameActor->SetTransparency(aGroupNamesTransparency); } @@ -357,9 +357,9 @@ SALOME_Actor */ void SALOME_Actor -::SetPosition(vtkFloatingPointType _arg1, - vtkFloatingPointType _arg2, - vtkFloatingPointType _arg3) +::SetPosition(double _arg1, + double _arg2, + double _arg3) { Superclass::SetPosition(_arg1,_arg2,_arg3); @@ -373,7 +373,7 @@ SALOME_Actor */ void SALOME_Actor -::SetPosition(vtkFloatingPointType _arg[3]) +::SetPosition(double _arg[3]) { SetPosition(_arg[0],_arg[1],_arg[2]); } @@ -471,10 +471,11 @@ void SALOME_Actor ::highlight(bool theIsHighlight) { - vtkFloatingPointType aBounds[6]; + double aBounds[6]; vtkDataSet * aDataSet = GetHighlightedDataSet(); aDataSet->GetBounds(aBounds); myOutline->SetBounds(aBounds); + myOutline->Update(); myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight ); Superclass::highlight(theIsHighlight); @@ -504,9 +505,9 @@ SALOME_Actor myPreHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection ); - vtkFloatingPointType x = theSelectionEvent->myX; - vtkFloatingPointType y = theSelectionEvent->myY; - vtkFloatingPointType z = 0.0; + double x = theSelectionEvent->myX; + double y = theSelectionEvent->myY; + double z = 0.0; if( !theIsHighlight ) { if ( hasIO() ) { @@ -664,9 +665,9 @@ SALOME_Actor myHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection ); - vtkFloatingPointType x = theSelectionEvent->myX; - vtkFloatingPointType y = theSelectionEvent->myY; - vtkFloatingPointType z = 0.0; + double x = theSelectionEvent->myX; + double y = theSelectionEvent->myY; + double z = 0.0; if( !theSelectionEvent->myIsRectangle ) { switch(aSelectionMode){ @@ -740,16 +741,16 @@ SALOME_Actor break; } }else{ - vtkFloatingPointType xLast = theSelectionEvent->myLastX; - vtkFloatingPointType yLast = theSelectionEvent->myLastY; - vtkFloatingPointType zLast = 0.0; + double xLast = theSelectionEvent->myLastX; + double yLast = theSelectionEvent->myLastY; + double zLast = 0.0; - vtkFloatingPointType x1 = x < xLast ? x : xLast; - vtkFloatingPointType y1 = y < yLast ? y : yLast; - vtkFloatingPointType z1 = z < zLast ? z : zLast; - vtkFloatingPointType x2 = x > xLast ? x : xLast; - vtkFloatingPointType y2 = y > yLast ? y : yLast; - vtkFloatingPointType z2 = z > zLast ? z : zLast; + double x1 = x < xLast ? x : xLast; + double y1 = y < yLast ? y : yLast; + double z1 = z < zLast ? z : zLast; + double x2 = x > xLast ? x : xLast; + double y2 = y > yLast ? y : yLast; + double z2 = z > zLast ? z : zLast; switch(aSelectionMode){ case NodeSelection: { @@ -785,8 +786,8 @@ SALOME_Actor } case ActorSelection : { - vtkFloatingPointType aPnt[3]; - vtkFloatingPointType* aBounds = GetBounds(); + double aPnt[3]; + double* aBounds = GetBounds(); bool anIsPicked = true; for( int i = 0; i <= 1; i++ ) { diff --git a/src/SVTK/SALOME_Actor.h b/src/SVTK/SALOME_Actor.h index bb86575c7..84a48c4b4 100644 --- a/src/SVTK/SALOME_Actor.h +++ b/src/SVTK/SALOME_Actor.h @@ -106,14 +106,14 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor //! Apply additional position virtual void - SetPosition(vtkFloatingPointType _arg1, - vtkFloatingPointType _arg2, - vtkFloatingPointType _arg3); + SetPosition(double _arg1, + double _arg2, + double _arg3); //! Apply additional position virtual void - SetPosition(vtkFloatingPointType _arg[3]); + SetPosition(double _arg[3]); //---------------------------------------------------------------------------- //! Visibility management diff --git a/src/SVTK/SVTK_Actor.cxx b/src/SVTK/SVTK_Actor.cxx index 0155b629a..3180a5c60 100644 --- a/src/SVTK/SVTK_Actor.cxx +++ b/src/SVTK/SVTK_Actor.cxx @@ -157,7 +157,7 @@ SVTK_Actor aPoints->SetNumberOfPoints(aNbOfParts); for(vtkIdType i = 0; i < aNbOfParts; i++){ int aPartId = theMapIndex( i+1 ); - if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){ + if(double* aCoord = theMapActor->GetNodeCoord(aPartId)){ aPoints->SetPoint(i,aCoord); // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON diff --git a/src/SVTK/SVTK_CubeAxesActor2D.cxx b/src/SVTK/SVTK_CubeAxesActor2D.cxx index 0364c257a..8c2f75d7c 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.cxx +++ b/src/SVTK/SVTK_CubeAxesActor2D.cxx @@ -43,7 +43,6 @@ #include #include -vtkCxxRevisionMacro(SVTK_CubeAxesActor2D, "$Revision$"); vtkStandardNewMacro(SVTK_CubeAxesActor2D); // Instantiate this object. @@ -61,9 +60,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); @@ -192,13 +191,13 @@ int SVTK_CubeAxesActor2D::RenderOverlay(vtkViewport *viewport) return renderedSomething; } -static void ChangeValues(vtkFloatingPointType* aArray1, - vtkFloatingPointType* aArray2, - vtkFloatingPointType *aRange1, - vtkFloatingPointType* aRange2, +static void ChangeValues(double* aArray1, + double* aArray2, + double *aRange1, + double* aRange2, bool theY) { - vtkFloatingPointType tmp=-1000; + double tmp=-1000; if (!theY){ for (int i=0; i<4; i++){ tmp = aArray1[i]; aArray1[i] = aArray2[i]; aArray2[i] = tmp; @@ -218,12 +217,12 @@ static void ChangeValues(vtkFloatingPointType* aArray1, } } -static void ChangeArrays(vtkFloatingPointType* xCoords, - vtkFloatingPointType* yCoords, - vtkFloatingPointType* zCoords, - vtkFloatingPointType* xRange, - vtkFloatingPointType* yRange, - vtkFloatingPointType* zRange, +static void ChangeArrays(double* xCoords, + double* yCoords, + double* zCoords, + double* xRange, + double* yRange, + double* zRange, const int xAxes, const int yAxes, const int zAxes) @@ -249,8 +248,8 @@ static void ChangeArrays(vtkFloatingPointType* xCoords, // with the boundary of the viewport (minus borders). int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) { - vtkFloatingPointType bounds[6], slope = 0.0, minSlope, num, den; - vtkFloatingPointType pts[8][3], d2, d2Min, min; + double bounds[6], slope = 0.0, minSlope, num, den; + double pts[8][3], d2, d2Min, min; int i, idx = 0; int xIdx, yIdx = 0, zIdx = 0, zIdx2, renderedSomething=0; int xAxes = 0, yAxes, zAxes; @@ -308,7 +307,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) } else { - vtkFloatingPointType e1[2], e2[2], e3[2]; + double e1[2], e2[2], e3[2]; // Find distance to origin d2Min = VTK_LARGE_FLOAT; @@ -401,7 +400,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) } // Setup the axes for plotting - vtkFloatingPointType xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2]; + double xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2]; this->AdjustAxes(pts, bounds, idx, xIdx, yIdx, zIdx, zIdx2, xAxes, yAxes, zAxes, xCoords, yCoords, zCoords, xRange, yRange, zRange); @@ -445,19 +444,19 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) // XCoords coordinates for X grid vtkFloatArray *XCoords = vtkFloatArray::New(); for(int i=0;iInsertNextValue(val); } // YCoords coordinates for Y grid vtkFloatArray *YCoords = vtkFloatArray::New(); for(int i=0;iInsertNextValue(val); } // ZCoords coordinates for Z grid vtkFloatArray *ZCoords = vtkFloatArray::New(); for(int i=0;iInsertNextValue(val); } @@ -467,14 +466,14 @@ 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(); - vtkFloatingPointType aCPosition[3]; - vtkFloatingPointType aCDirection[3]; + double aCPosition[3]; + double aCDirection[3]; this->Camera->GetPosition(aCPosition); this->Camera->GetDirectionOfProjection(aCDirection); @@ -482,12 +481,12 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) bool replaceXY=false; bool replaceYZ=false; bool replaceXZ=false; - vtkFloatingPointType p[6][3]; // centers of planes - vtkFloatingPointType vecs[6][3]; // 6 vectors from camera position to centers + double p[6][3]; // centers of planes + double vecs[6][3]; // 6 vectors from camera position to centers - vtkFloatingPointType aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2; - vtkFloatingPointType aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2; - vtkFloatingPointType aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2; + double aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2; + double aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2; + double aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2; // plane XY p[0][0] = aMiddleX; // plane X=0.5 Y=0.5 Z=0 @@ -539,7 +538,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) YCoords->Delete(); ZCoords->Delete(); - vtkFloatingPointType color[3]; + double color[3]; this->GetProperty()->GetColor(color); this->wireActorXY->GetProperty()->SetColor(color); diff --git a/src/SVTK/SVTK_CubeAxesActor2D.h b/src/SVTK/SVTK_CubeAxesActor2D.h index 51b315903..aa8d021e8 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.h +++ b/src/SVTK/SVTK_CubeAxesActor2D.h @@ -47,13 +47,13 @@ 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 { public: - vtkTypeRevisionMacro(SVTK_CubeAxesActor2D,vtkCubeAxesActor2D); + vtkTypeMacro(SVTK_CubeAxesActor2D,vtkCubeAxesActor2D); // Description: // Instantiate object with bold, italic, and shadow enabled; font family diff --git a/src/SVTK/SVTK_CubeAxesDlg.cxx b/src/SVTK/SVTK_CubeAxesDlg.cxx index 74788d878..250d21fa7 100644 --- a/src/SVTK/SVTK_CubeAxesDlg.cxx +++ b/src/SVTK/SVTK_CubeAxesDlg.cxx @@ -89,7 +89,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) vtkTextProperty* aTitleProp = theActor->GetTitleTextProperty(); if (aTitleProp !=0) { - vtkFloatingPointType c[ 3 ]; + double c[ 3 ]; aTitleProp->GetColor(c); aTitleColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255)); aTitleFontFamily = aTitleProp->GetFontFamily(); @@ -117,7 +117,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) vtkTextProperty* aLabelsProp = theActor->GetLabelTextProperty(); if (aLabelsProp !=0) { - vtkFloatingPointType c[ 3 ]; + double c[ 3 ]; aLabelsProp->GetColor(c); aLabelsColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255)); aLabelsFontFamily = aLabelsProp->GetFontFamily(); diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index 4a803ccc5..9b15c76f5 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -120,29 +120,25 @@ 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 - if(VTKViewer_DataSetMapper* aMapper = dynamic_cast(theMapper)){ - aMapper->SetInput(myPassFilter[anId]->GetOutput()); - }else if(VTKViewer_PolyDataMapper* aMapper = dynamic_cast(theMapper)){ - aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput()); - } + theMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort()); } Superclass::SetMapper(theMapper); } @@ -164,7 +160,7 @@ void SVTK_DeviceActor ::SetInput(vtkDataSet* theDataSet) { - myMapper->SetInput(theDataSet); + myMapper->SetInputData(theDataSet); InitPipeLine(myMapper); } @@ -256,16 +252,19 @@ SVTK_DeviceActor if ( !myIsShrinkable ) return; - if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() ) + if ( vtkAlgorithmOutput* anOutput = myPassFilter[ 0 ]->GetOutputPort() ) { - aDataSet->Update(); - 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() ); + myPassFilter[ 0 ]->Update(); + if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() ) + { + 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->SetInputConnection( anOutput ); + myPassFilter[ 1 ]->SetInputConnection( myShrinkFilter->GetOutputPort() ); myIsShrunk = true; } } @@ -278,9 +277,9 @@ SVTK_DeviceActor ::UnShrink() { if ( !myIsShrunk ) return; - if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() ) + if ( vtkAlgorithmOutput* anOutput = myPassFilter[ 0 ]->GetOutputPort() ) { - myPassFilter[ 1 ]->SetInput( aDataSet ); + myPassFilter[ 1 ]->SetInputConnection( anOutput ); myIsShrunk = false; } } @@ -288,7 +287,7 @@ SVTK_DeviceActor /*! \return shrink factor */ -vtkFloatingPointType +double SVTK_DeviceActor ::GetShrinkFactor() { @@ -301,7 +300,7 @@ SVTK_DeviceActor */ void SVTK_DeviceActor -::SetShrinkFactor(vtkFloatingPointType theValue) +::SetShrinkFactor(double theValue) { myShrinkFilter->SetShrinkFactor(theValue); } @@ -348,18 +347,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; @@ -369,7 +368,7 @@ SVTK_DeviceActor /*! \return angle of feature edges' filter */ -vtkFloatingPointType +double SVTK_DeviceActor ::GetFeatureEdgesAngle() { @@ -382,7 +381,7 @@ SVTK_DeviceActor */ void SVTK_DeviceActor -::SetFeatureEdgesAngle(vtkFloatingPointType theAngle) +::SetFeatureEdgesAngle(double theAngle) { myFeatureEdges->SetFeatureAngle(theAngle); } @@ -525,7 +524,7 @@ SVTK_DeviceActor /*! \return default point size */ -vtkFloatingPointType +double SVTK_DeviceActor ::GetDefaultPointSize() { @@ -535,7 +534,7 @@ SVTK_DeviceActor /*! \return default line width */ -vtkFloatingPointType +double SVTK_DeviceActor ::GetDefaultLineWidth() { @@ -576,7 +575,7 @@ SVTK_DeviceActor /*! Get coordinates of a node for given object index */ -vtkFloatingPointType* +double* SVTK_DeviceActor ::GetNodeCoord(int theObjID) { @@ -613,7 +612,7 @@ SVTK_DeviceActor { if(myIsResolveCoincidentTopology){ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); - vtkFloatingPointType aFactor, aUnit; + double aFactor, aUnit; vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); @@ -634,8 +633,8 @@ SVTK_DeviceActor */ void SVTK_DeviceActor -::SetPolygonOffsetParameters(vtkFloatingPointType factor, - vtkFloatingPointType units) +::SetPolygonOffsetParameters(double factor, + double units) { myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; @@ -647,8 +646,8 @@ SVTK_DeviceActor */ void SVTK_DeviceActor -::GetPolygonOffsetParameters(vtkFloatingPointType& factor, - vtkFloatingPointType& units) +::GetPolygonOffsetParameters(double& factor, + double& units) { factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; @@ -675,14 +674,14 @@ bool SVTK_DeviceActor::GetQuadraticArcMode(){ /*! * Set Max angle for representation 2D quadratic element as arked polygon */ -void SVTK_DeviceActor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){ +void SVTK_DeviceActor::SetQuadraticArcAngle(double theMaxAngle){ myGeomFilter->SetQuadraticArcAngle(theMaxAngle); } /*! * Return Max angle of the representation 2D quadratic element as arked polygon */ -vtkFloatingPointType SVTK_DeviceActor::GetQuadraticArcAngle(){ +double SVTK_DeviceActor::GetQuadraticArcAngle(){ return myGeomFilter->GetQuadraticArcAngle(); } diff --git a/src/SVTK/SVTK_DeviceActor.h b/src/SVTK/SVTK_DeviceActor.h index 681f25263..366ed9ae4 100644 --- a/src/SVTK/SVTK_DeviceActor.h +++ b/src/SVTK/SVTK_DeviceActor.h @@ -88,7 +88,7 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor GetNodeObjId(int theVtkID); virtual - vtkFloatingPointType* + double* GetNodeCoord(int theObjID); virtual @@ -111,12 +111,12 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor /** @name For shrink mamnagement purpose */ //@{ - vtkFloatingPointType + double GetShrinkFactor(); virtual void - SetShrinkFactor(vtkFloatingPointType value); + SetShrinkFactor(double value); virtual void @@ -156,12 +156,12 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled); virtual - vtkFloatingPointType + double GetFeatureEdgesAngle(); virtual void - SetFeatureEdgesAngle(vtkFloatingPointType theAngle); + SetFeatureEdgesAngle(double theAngle); virtual void @@ -194,11 +194,11 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor GetRepresentation(); virtual - vtkFloatingPointType + double GetDefaultPointSize(); virtual - vtkFloatingPointType + double GetDefaultLineWidth(); bool @@ -239,8 +239,8 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor virtual void SetQuadraticArcMode(bool theFlag); virtual bool GetQuadraticArcMode(); - virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle); - virtual vtkFloatingPointType GetQuadraticArcAngle(); + virtual void SetQuadraticArcAngle(double theMaxAngle); + virtual double GetQuadraticArcAngle(); virtual void @@ -278,13 +278,13 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor bool myIsFeatureEdgesEnabled; bool myIsResolveCoincidentTopology; - vtkFloatingPointType myPolygonOffsetFactor; - vtkFloatingPointType myPolygonOffsetUnits; + double myPolygonOffsetFactor; + double myPolygonOffsetUnits; - void SetPolygonOffsetParameters(vtkFloatingPointType factor, - vtkFloatingPointType units); - void GetPolygonOffsetParameters(vtkFloatingPointType& factor, - vtkFloatingPointType& units); + void SetPolygonOffsetParameters(double factor, + double units); + void GetPolygonOffsetParameters(double& factor, + double& units); SVTK_DeviceActor(); ~SVTK_DeviceActor(); diff --git a/src/SVTK/SVTK_ImageWriter.cxx b/src/SVTK/SVTK_ImageWriter.cxx index 581111ba6..87b9680cd 100755 --- a/src/SVTK/SVTK_ImageWriter.cxx +++ b/src/SVTK/SVTK_ImageWriter.cxx @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -36,11 +37,13 @@ static int MYDEBUG = 0; //---------------------------------------------------------------------------- SVTK_ImageWriter ::SVTK_ImageWriter(QSemaphore* theSemaphore, + vtkAlgorithm* theAlgorithm, vtkImageData* theImageData, const std::string& theName, int theProgressive, int theQuality): mySemaphore(theSemaphore), + myAlgorithm(theAlgorithm), myImageData(theImageData), myName(theName), myProgressive(theProgressive), @@ -62,13 +65,13 @@ SVTK_ImageWriter ::run() { vtkJPEGWriter *aWriter = vtkJPEGWriter::New(); - vtkImageData *anImageData = myImageData; + vtkAlgorithmOutput *anImageData = 0; vtkSmartPointer anImageClip; // if(myConstraint16Flag){ int uExtent[6]; - myImageData->UpdateInformation(); - myImageData->GetUpdateExtent(uExtent); + myAlgorithm->UpdateInformation(); + myAlgorithm->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(); diff --git a/src/SVTK/SVTK_ImageWriter.h b/src/SVTK/SVTK_ImageWriter.h index 5973b9f44..2ca2f9ca0 100755 --- a/src/SVTK/SVTK_ImageWriter.h +++ b/src/SVTK/SVTK_ImageWriter.h @@ -23,6 +23,7 @@ #include #include +class vtkAlgorithm; class vtkImageData; class QSemaphore; @@ -30,6 +31,7 @@ class SVTK_ImageWriter : public QThread { public: SVTK_ImageWriter(QSemaphore* theSemaphore, + vtkAlgorithm* theAlgorithm, vtkImageData* theImageData, const std::string& theName, int theProgressive, @@ -44,6 +46,7 @@ public: protected: QSemaphore* mySemaphore; + vtkAlgorithm *myAlgorithm; vtkImageData *myImageData; std::string myName; int myProgressive; diff --git a/src/SVTK/SVTK_ImageWriterMgr.cxx b/src/SVTK/SVTK_ImageWriterMgr.cxx index 22e7b97ba..97e0717e2 100755 --- a/src/SVTK/SVTK_ImageWriterMgr.cxx +++ b/src/SVTK/SVTK_ImageWriterMgr.cxx @@ -20,6 +20,7 @@ #include "SVTK_ImageWriterMgr.h" #include "SVTK_ImageWriter.h" +#include #include #include @@ -58,13 +59,15 @@ SVTK_ImageWriterMgr //---------------------------------------------------------------------------- void SVTK_ImageWriterMgr -::StartImageWriter(vtkImageData *theImageData, +::StartImageWriter(vtkAlgorithm *theAlgorithm, + vtkImageData *theImageData, const std::string& theName, const int theProgressive, const int theQuality) { SVTK_ImageWriter *anImageWriter = new SVTK_ImageWriter(mySemaphore, + theAlgorithm, theImageData, theName, theProgressive, diff --git a/src/SVTK/SVTK_ImageWriterMgr.h b/src/SVTK/SVTK_ImageWriterMgr.h index 86a445946..09a909bd2 100755 --- a/src/SVTK/SVTK_ImageWriterMgr.h +++ b/src/SVTK/SVTK_ImageWriterMgr.h @@ -24,6 +24,7 @@ #include class QString; +class vtkAlgorithm; class vtkImageData; class SVTK_ImageWriter; class QSemaphore; @@ -35,7 +36,8 @@ class SVTK_ImageWriterMgr ~SVTK_ImageWriterMgr(); void - StartImageWriter(vtkImageData *theImageData, + StartImageWriter(vtkAlgorithm *theAlgorithm, + vtkImageData *theImageData, const std::string& theName, const int theProgressive, const int theQuality); diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index 40b784cf9..db068bbbe 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -224,7 +224,7 @@ void SVTK_InteractorStyle::RotateXY(int dx, int dy) if ( myCurrRotationPointType == SVTK::SetRotateGravity ) { - vtkFloatingPointType aCenter[3]; + double aCenter[3]; if ( ComputeBBCenter(GetCurrentRenderer(),aCenter) ) { myRotationPointX = aCenter[0]; @@ -511,7 +511,7 @@ void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, if ( aVtkId >= 0 ) { int anObjId = anActor->GetNodeObjId( aVtkId ); - vtkFloatingPointType* aCoords = anActor->GetNodeCoord(anObjId); + double* aCoords = anActor->GetNodeCoord(anObjId); if (myCurrRotationPointType == SVTK::StartPointSelection) { myCurrRotationPointType = SVTK::SetRotateSelected; @@ -810,7 +810,7 @@ void SVTK_InteractorStyle::startPointSelection() if(GetCurrentRenderer() != NULL) { GetCurrentRenderer()->AddActor( myHighlightSelectionPointActor.GetPointer() ); - vtkFloatingPointType aColor[3]; + double aColor[3]; GetCurrentRenderer()->GetBackground( aColor ); myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0], 1. - aColor[1], @@ -829,7 +829,7 @@ void SVTK_InteractorStyle::startFocalPointSelection() if(GetCurrentRenderer() != NULL) { GetCurrentRenderer()->AddActor( myHighlightSelectionPointActor.GetPointer() ); - vtkFloatingPointType aColor[3]; + double aColor[3]; GetCurrentRenderer()->GetBackground( aColor ); myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0], 1. - aColor[1], @@ -1313,7 +1313,7 @@ void SVTK_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY) vtkCamera *cam = GetCurrentRenderer()->GetActiveCamera(); double viewFocus[4], focalDepth, viewPoint[3]; - vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3]; + double newPickPoint[4], oldPickPoint[4], motionVector[3]; cam->GetFocalPoint(viewFocus); this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1], @@ -1414,7 +1414,7 @@ void SVTK_InteractorStyle::OnTimer() // check if bounding box was changed if ( GetCurrentRenderer() ) { - vtkFloatingPointType aCurrBBCenter[3]; + double aCurrBBCenter[3]; if ( ComputeBBCenter(GetCurrentRenderer(),aCurrBBCenter) ) { if ( !myBBFirstCheck ) @@ -1516,8 +1516,8 @@ void SVTK_InteractorStyle::ProcessEvents( vtkObject* object, vtkObject* anObject = reinterpret_cast( clientData ); SVTK_InteractorStyle* self = dynamic_cast( anObject ); int aSpeedIncrement=self->ControllerIncrement()->Current(); - vtkFloatingPointType aCenter[3]; - vtkFloatingPointType* aSelectedPoint; + double aCenter[3]; + double* aSelectedPoint; if ( self ) { switch ( event ) { case SVTK::SpaceMouseMoveEvent : @@ -1620,7 +1620,7 @@ void SVTK_InteractorStyle::ProcessEvents( vtkObject* object, } self->myPrevRotationPointType = self->myCurrRotationPointType; self->myCurrRotationPointType = SVTK::SetRotateSelected; - aSelectedPoint = (vtkFloatingPointType*)callData; + aSelectedPoint = (double*)callData; self->myRotationPointX = aSelectedPoint[0]; self->myRotationPointY = aSelectedPoint[1]; self->myRotationPointZ = aSelectedPoint[2]; diff --git a/src/SVTK/SVTK_InteractorStyle.h b/src/SVTK/SVTK_InteractorStyle.h index 38c7278a7..e862ee9b2 100644 --- a/src/SVTK/SVTK_InteractorStyle.h +++ b/src/SVTK/SVTK_InteractorStyle.h @@ -354,7 +354,7 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle vtkSmartPointer myHighlightSelectionPointActor; vtkSmartPointer myPointPicker; - vtkFloatingPointType myBBCenter[3]; + double myBBCenter[3]; bool myBBFirstCheck; QRubberBand* myRectBand; //!< selection rectangle rubber band diff --git a/src/SVTK/SVTK_Recorder.cxx b/src/SVTK/SVTK_Recorder.cxx index 0be0147b3..666c4b6e6 100755 --- a/src/SVTK/SVTK_Recorder.cxx +++ b/src/SVTK/SVTK_Recorder.cxx @@ -68,7 +68,6 @@ namespace } //---------------------------------------------------------------------------- -vtkCxxRevisionMacro(SVTK_Recorder,"$Revision$"); vtkStandardNewMacro(SVTK_Recorder); @@ -376,7 +375,7 @@ SVTK_Recorder vtkImageData *anImageData = vtkImageData::New(); anImageData->DeepCopy(myFilter->GetOutput()); - myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality); + myWriterMgr->StartImageWriter(myFilter,anImageData,aName,myProgressiveMode,myQuality); myNbWrittenFrames++; myRenderWindow->AddObserver(vtkCommand::EndEvent, @@ -396,12 +395,9 @@ SVTK_Recorder myErrorStatus = 20; return; } - anImageData->UpdateInformation(); - int *anExtent = anImageData->GetWholeExtent(); - anImageData->SetUpdateExtent(anExtent[0], anExtent[1], - anExtent[2], anExtent[3], - 0,0); - anImageData->UpdateData(); + myFilter->UpdateInformation(); + myFilter->SetUpdateExtentToWholeExtent(); + myFilter->Update(); } diff --git a/src/SVTK/SVTK_Recorder.h b/src/SVTK/SVTK_Recorder.h index bfc2aaced..1bf266442 100755 --- a/src/SVTK/SVTK_Recorder.h +++ b/src/SVTK/SVTK_Recorder.h @@ -42,7 +42,7 @@ class SVTK_Recorder : public vtkObject public: static SVTK_Recorder *New(); - vtkTypeRevisionMacro(SVTK_Recorder,vtkObject); + vtkTypeMacro(SVTK_Recorder,vtkObject); void SetRenderWindow(vtkRenderWindow* theRenderWindow); diff --git a/src/SVTK/SVTK_RectPicker.cxx b/src/SVTK/SVTK_RectPicker.cxx index 77640da9d..820ed717f 100644 --- a/src/SVTK/SVTK_RectPicker.cxx +++ b/src/SVTK/SVTK_RectPicker.cxx @@ -51,7 +51,7 @@ namespace { //---------------------------------------------------------------------------- inline - vtkFloatingPointType + double GetZ(float* theZPtr, int theSelection[4], int theDX, @@ -66,13 +66,13 @@ namespace int Check(float* theZPtr, int theSelection[4], - vtkFloatingPointType theTolerance, - vtkFloatingPointType theDZ, + double theTolerance, + double theDZ, int theDX, int theDY) { int aRet = 0; - vtkFloatingPointType aZ = -1.0; + double aZ = -1.0; if(theDX >= theSelection[0] && theDX <= theSelection[2] && theDY >= theSelection[1] && theDY <= theSelection[3]) { @@ -97,7 +97,7 @@ namespace vtkDataSet *theInput, SVTK_RectPicker::TVectorIds& theVisibleIds, SVTK_RectPicker::TVectorIds& theInVisibleIds, - vtkFloatingPointType theTolerance) + double theTolerance) { theVisibleIds.clear(); theInVisibleIds.clear(); @@ -140,10 +140,10 @@ namespace for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){ // perform conversion - vtkFloatingPointType aX[4] = {1.0, 1.0, 1.0, 1.0}; + double aX[4] = {1.0, 1.0, 1.0, 1.0}; theInput->GetPoint(aPntId,aX); - vtkFloatingPointType aView[4]; + double aView[4]; aMatrix->MultiplyPoint(aX,aView); if(aView[3] == 0.0) continue; @@ -152,7 +152,7 @@ namespace aView[2]/aView[3]); theRenderer->ViewToDisplay(); - vtkFloatingPointType aDX[3]; + double aDX[3]; theRenderer->GetDisplayPoint(aDX); // check whether visible and in selection window @@ -218,8 +218,8 @@ namespace //---------------------------------------------------------------------------- inline void - GetCenter(const vtkFloatingPointType theBounds[6], - vtkFloatingPointType theCenter[3]) + GetCenter(const double theBounds[6], + double theCenter[3]) { theCenter[0] = (theBounds[1] + theBounds[0]) / 2.0; theCenter[1] = (theBounds[3] + theBounds[2]) / 2.0; @@ -231,7 +231,7 @@ namespace vtkRenderer *theRenderer, vtkDataSet *theInput, SVTK_RectPicker::TVectorIds& theVectorIds, - vtkFloatingPointType theTolerance) + double theTolerance) { theVectorIds.clear(); @@ -266,14 +266,14 @@ namespace for(vtkIdType aCellId = 0; aCellId < aNumCells; aCellId++){ vtkCell* aCell = theInput->GetCell(aCellId); - vtkFloatingPointType aBounds[6]; + double aBounds[6]; aCell->GetBounds(aBounds); - vtkFloatingPointType aCenter[3]; + double aCenter[3]; GetCenter(aBounds,aCenter); - vtkFloatingPointType aView[4]; - vtkFloatingPointType aX[4] = {aCenter[0], aCenter[1], aCenter[2], 1.0}; + double aView[4]; + double aX[4] = {aCenter[0], aCenter[1], aCenter[2], 1.0}; aMatrix->MultiplyPoint(aX,aView); if(aView[3] == 0.0) @@ -284,7 +284,7 @@ namespace aView[2]/aView[3]); theRenderer->ViewToDisplay(); - vtkFloatingPointType aDX[3]; + double aDX[3]; theRenderer->GetDisplayPoint(aDX); // check whether visible and in selection window @@ -312,16 +312,16 @@ namespace //---------------------------------------------------------------------------- void CalculatePickPosition(vtkRenderer *theRenderer, - vtkFloatingPointType theSelectionX, - vtkFloatingPointType theSelectionY, - vtkFloatingPointType theSelectionZ, - vtkFloatingPointType thePickPosition[3]) + double theSelectionX, + double theSelectionY, + double theSelectionZ, + double thePickPosition[3]) { // Convert the selection point into world coordinates. // theRenderer->SetDisplayPoint(theSelectionX, theSelectionY, theSelectionZ); theRenderer->DisplayToWorld(); - vtkFloatingPointType* aWorldCoords = theRenderer->GetWorldPoint(); + double* aWorldCoords = theRenderer->GetWorldPoint(); if ( aWorldCoords[3] != 0.0 ) { for (int i=0; i < 3; i++) { thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3]; @@ -345,9 +345,9 @@ SVTK_RectPicker int SVTK_RectPicker -::Pick(vtkFloatingPointType, - vtkFloatingPointType, - vtkFloatingPointType, +::Pick(double, + double, + double, vtkRenderer*) { return 0; @@ -355,8 +355,8 @@ SVTK_RectPicker int SVTK_RectPicker -::Pick(vtkFloatingPointType theSelection[3], - vtkFloatingPointType theSelection2[3], +::Pick(double theSelection[3], + double theSelection2[3], vtkRenderer *theRenderer) { return Pick(theSelection[0], theSelection[1], theSelection[2], @@ -366,12 +366,12 @@ SVTK_RectPicker int SVTK_RectPicker -::Pick(vtkFloatingPointType theSelectionX, - vtkFloatingPointType theSelectionY, - vtkFloatingPointType theSelectionZ, - vtkFloatingPointType theSelectionX2, - vtkFloatingPointType theSelectionY2, - vtkFloatingPointType theSelectionZ2, +::Pick(double theSelectionX, + double theSelectionY, + double theSelectionZ, + double theSelectionX2, + double theSelectionY2, + double theSelectionZ2, vtkRenderer *theRenderer) { // Initialize picking process @@ -385,14 +385,14 @@ SVTK_RectPicker // vtkCamera* aCamera = theRenderer->GetActiveCamera(); - vtkFloatingPointType aCameraFP[4]; + double aCameraFP[4]; aCamera->GetFocalPoint(aCameraFP); aCameraFP[3] = 1.0; theRenderer->SetWorldPoint(aCameraFP); theRenderer->WorldToDisplay(); - vtkFloatingPointType* aDisplayCoords = theRenderer->GetDisplayPoint(); - vtkFloatingPointType aSelectionZ = aDisplayCoords[2]; + double* aDisplayCoords = theRenderer->GetDisplayPoint(); + double aSelectionZ = aDisplayCoords[2]; this->SelectionPoint[0] = theSelectionX; this->SelectionPoint[1] = theSelectionY; diff --git a/src/SVTK/SVTK_RectPicker.h b/src/SVTK/SVTK_RectPicker.h index 1e9975e94..7cede5321 100644 --- a/src/SVTK/SVTK_RectPicker.h +++ b/src/SVTK/SVTK_RectPicker.h @@ -61,8 +61,8 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker as fraction of rendering window size. (Rendering window size is measured across diagonal.) */ - vtkSetMacro(Tolerance,vtkFloatingPointType); - vtkGetMacro(Tolerance,vtkFloatingPointType); + vtkSetMacro(Tolerance,double); + vtkGetMacro(Tolerance,double); //! Use these methods to pick points or points and cells vtkSetMacro(PickPoints,int); @@ -71,17 +71,17 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker virtual int - Pick(vtkFloatingPointType theSelectionX, - vtkFloatingPointType theSelectionY, - vtkFloatingPointType theSelectionZ, - vtkFloatingPointType theSelectionX2, - vtkFloatingPointType theSelectionY2, - vtkFloatingPointType theSelectionZ2, + Pick(double theSelectionX, + double theSelectionY, + double theSelectionZ, + double theSelectionX2, + double theSelectionY2, + double theSelectionZ2, vtkRenderer *theRenderer); int - Pick(vtkFloatingPointType theSelection[3], - vtkFloatingPointType theSelection2[3], + Pick(double theSelection[3], + double theSelection2[3], vtkRenderer *theRenderer); typedef std::vector TVectorIds; @@ -98,16 +98,16 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker ~SVTK_RectPicker(); //! tolerance for computation (% of window) - vtkFloatingPointType Tolerance; + double Tolerance; //! use the following to control picking mode int PickPoints; //! second rectangle selection point in window (pixel) coordinates - vtkFloatingPointType SelectionPoint2[3]; + double SelectionPoint2[3]; //! second rectangle selection point in world coordinates - vtkFloatingPointType PickPosition2[3]; + double PickPosition2[3]; TVectorIdsMap myPointIdsMap; TVectorIdsMap myCellIdsMap; @@ -115,9 +115,9 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker private: virtual int - Pick(vtkFloatingPointType, - vtkFloatingPointType, - vtkFloatingPointType, + Pick(double, + double, + double, vtkRenderer*); }; diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 6584727de..d0417b2d1 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -382,7 +382,7 @@ SVTK_Renderer inline bool -CheckBndBox(const vtkFloatingPointType theBounds[6]) +CheckBndBox(const double theBounds[6]) { if(theBounds[0] > -VTK_LARGE_FLOAT && theBounds[1] < VTK_LARGE_FLOAT && theBounds[2] > -VTK_LARGE_FLOAT && theBounds[3] < VTK_LARGE_FLOAT && @@ -401,7 +401,7 @@ SVTK_Renderer bool aTDisplayed = IsTrihedronDisplayed(); bool aCDisplayed = IsCubeAxesDisplayed(); - vtkFloatingPointType aNewBndBox[6]; + double aNewBndBox[6]; aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT; aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT; @@ -414,7 +414,7 @@ SVTK_Renderer myCubeAxes->VisibilityOff(); // if the new trihedron size have sufficient difference, then apply the value - vtkFloatingPointType aSize = myTrihedron->GetSize(); + double aSize = myTrihedron->GetSize(); if ( IsTrihedronRelative() ) { ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize); @@ -432,7 +432,7 @@ SVTK_Renderer if(anActor->IsResizable()) anActor->SetSize(0.5*aSize); if(anActor->GetVisibility() && !anActor->IsInfinitive()){ - vtkFloatingPointType *aBounds = anActor->GetBounds(); + double *aBounds = anActor->GetBounds(); if(CheckBndBox(aBounds)) for(int i = 0; i < 5; i = i + 2){ if(aBounds[i] < aNewBndBox[i]) @@ -485,7 +485,7 @@ SVTK_Renderer */ void SVTK_Renderer -::SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative) +::SetTrihedronSize(double theSize, const bool theRelative) { if(myTrihedronSize != theSize || myIsTrihedronRelative != theRelative){ myTrihedronSize = theSize; @@ -497,7 +497,7 @@ SVTK_Renderer /*! \return size of the trihedron in percents from bounding box of the scene */ -vtkFloatingPointType +double SVTK_Renderer ::GetTrihedronSize() const { @@ -629,7 +629,7 @@ SVTK_Renderer else myCubeAxes->VisibilityOff(); - static vtkFloatingPointType aCoeff = 3.0; + static double aCoeff = 3.0; aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale()); } diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index edf79ada1..b5725ddcd 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -130,10 +130,10 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject //! Set size of the trihedron in percents from bounding box of the scene void - SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative = true); + SetTrihedronSize(double theSize, const bool theRelative = true); //! Get size of the trihedron in percents from bounding box of the scene - vtkFloatingPointType + double GetTrihedronSize() const; //! Shows if the size of the trihedron is relative @@ -218,7 +218,7 @@ protected: //---------------------------------------------------------------------------- // Priority at which events are processed - vtkFloatingPointType myPriority; + double myPriority; // Used to process events vtkSmartPointer myEventCallbackCommand; @@ -251,9 +251,9 @@ protected: //---------------------------------------------------------------------------- vtkSmartPointer myCubeAxes; vtkSmartPointer myTrihedron; - vtkFloatingPointType myTrihedronSize; + double myTrihedronSize; bool myIsTrihedronRelative; - vtkFloatingPointType myBndBox[6]; + double myBndBox[6]; }; #ifdef WIN32 diff --git a/src/SVTK/SVTK_SetRotationPointDlg.cxx b/src/SVTK/SVTK_SetRotationPointDlg.cxx index 174a6bae0..1fa5817e1 100755 --- a/src/SVTK/SVTK_SetRotationPointDlg.cxx +++ b/src/SVTK/SVTK_SetRotationPointDlg.cxx @@ -211,7 +211,7 @@ SVTK_SetRotationPointDlg void* theCallData) { SVTK_SetRotationPointDlg* self = reinterpret_cast(theClientData); - vtkFloatingPointType* aCoord = (vtkFloatingPointType*)theCallData; + double* aCoord = (double*)theCallData; switch ( theEvent ) { case SVTK::BBCenterChanged: @@ -310,7 +310,7 @@ SVTK_SetRotationPointDlg && ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) ) mySelectPoint->toggle(); - vtkFloatingPointType aCenter[3] = {myX->text().toDouble(), + double aCenter[3] = {myX->text().toDouble(), myY->text().toDouble(), myZ->text().toDouble()}; myMainWindow->activateSetRotationSelected((void*)aCenter); diff --git a/src/SVTK/SVTK_SetRotationPointDlg.h b/src/SVTK/SVTK_SetRotationPointDlg.h index ab49b055a..99ad41c75 100755 --- a/src/SVTK/SVTK_SetRotationPointDlg.h +++ b/src/SVTK/SVTK_SetRotationPointDlg.h @@ -80,7 +80,7 @@ protected: //---------------------------------------------------------------------------- // Priority at which events are processed - vtkFloatingPointType myPriority; + double myPriority; // Used to process events vtkSmartPointer myEventCallbackCommand; diff --git a/src/SVTK/SVTK_UpdateRateDlg.cxx b/src/SVTK/SVTK_UpdateRateDlg.cxx index 48e580fa2..db86100bf 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.cxx +++ b/src/SVTK/SVTK_UpdateRateDlg.cxx @@ -49,8 +49,8 @@ #include #include -static vtkFloatingPointType OFF_UPDATE_RATE = 0.00001; -static vtkFloatingPointType FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT; +static double OFF_UPDATE_RATE = 0.00001; +static double FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT; namespace { @@ -60,10 +60,10 @@ namespace GetUpdateRate(SVTK_RenderWindowInteractor* theRWInteractor) { if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){ - vtkFloatingPointType aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds(); + double aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds(); if(aLastRenderTimeInSeconds > FLOAT_TOLERANCE){ std::ostringstream aStr; - vtkFloatingPointType aFPS = 1.0 / aLastRenderTimeInSeconds; + double aFPS = 1.0 / aLastRenderTimeInSeconds; aStr<getRenderer()){ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); @@ -332,7 +332,7 @@ SVTK_UpdateRateDlg { vtkRenderWindowInteractor* aRWI = myRWInteractor->GetDevice(); - vtkFloatingPointType anUpdateRate; + double anUpdateRate; if(myIsEnableUpdateRateGroupBox->isChecked()){ anUpdateRate = AdjustUpdateRate(myRWInteractor,myDesiredUpdateRateSblSpinBox->value()); aRWI->SetDesiredUpdateRate(anUpdateRate); diff --git a/src/SVTK/SVTK_UpdateRateDlg.h b/src/SVTK/SVTK_UpdateRateDlg.h index 385a3874f..c698b3b8c 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.h +++ b/src/SVTK/SVTK_UpdateRateDlg.h @@ -70,7 +70,7 @@ protected: //---------------------------------------------------------------------------- // Priority at which events are processed - vtkFloatingPointType myPriority; + double myPriority; // Used to process events vtkSmartPointer myEventCallbackCommand; diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 5f52ea604..23b2bcf85 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -691,12 +691,12 @@ SVTK_View ::SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject, float theTrans) { - vtkFloatingPointType anOpacity = 1.0 - theTrans; + double anOpacity = 1.0 - theTrans; using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEachIf(aCopy.GetActors(), TIsSameIObject(theIObject), - TSetFunction + TSetFunction (&SALOME_Actor::SetOpacity,anOpacity)); } @@ -710,13 +710,13 @@ SVTK_View ::SetColor(const Handle(SALOME_InteractiveObject)& theIObject, const QColor& theColor) { - vtkFloatingPointType aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.}; + double aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.}; using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEachIf(aCopy.GetActors(), TIsSameIObject(theIObject), - TSetFunction + TSetFunction (&SALOME_Actor::SetColor,aColor)); } @@ -735,7 +735,7 @@ SVTK_View Find(aCopy.GetActors(), TIsSameIObject(theIObject)); if(anActor){ - vtkFloatingPointType r,g,b; + double r,g,b; anActor->GetColor(r,g,b); return QColor(int(r*255),int(g*255),int(b*255)); } diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index e8ab93171..ce7699715 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -193,7 +193,7 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop ) /*! \return trihedron size */ -vtkFloatingPointType SVTK_Viewer::trihedronSize() const +double SVTK_Viewer::trihedronSize() const { return myTrihedronSize; } @@ -211,7 +211,7 @@ bool SVTK_Viewer::trihedronRelative() const \param theSize - new size \param theRelative - new relativeness */ -void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bool theRelative ) +void SVTK_Viewer::setTrihedronSize( const double theSize, const bool theRelative ) { myTrihedronSize = theSize; myTrihedronRelative = theRelative; diff --git a/src/SVTK/SVTK_ViewModel.h b/src/SVTK/SVTK_ViewModel.h index b06714265..cea0ee1ab 100644 --- a/src/SVTK/SVTK_ViewModel.h +++ b/src/SVTK/SVTK_ViewModel.h @@ -93,13 +93,13 @@ public: void setBackground( const Qtx::BackgroundData& ); //! Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize) - vtkFloatingPointType trihedronSize() const; + double trihedronSize() const; //! Shows if the size of trihedron relative (see #SVTK_Renderer::SetTrihedronSize) bool trihedronRelative() const; //! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize) - void setTrihedronSize( const vtkFloatingPointType, const bool = true ); + void setTrihedronSize( const double, const bool = true ); //! Get visibility status of the static trihedron bool isStaticTrihedronVisible() const; @@ -197,7 +197,7 @@ private: void updateToolBars(); Qtx::BackgroundData myDefaultBackground; - vtkFloatingPointType myTrihedronSize; + double myTrihedronSize; bool myTrihedronRelative; bool myIsStaticTrihedronVisible; bool mySelectionEnabled; diff --git a/src/SVTK/SVTK_ViewParameterDlg.cxx b/src/SVTK/SVTK_ViewParameterDlg.cxx index c0a7091b4..f004e6208 100755 --- a/src/SVTK/SVTK_ViewParameterDlg.cxx +++ b/src/SVTK/SVTK_ViewParameterDlg.cxx @@ -414,12 +414,12 @@ void SVTK_ViewParameterDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject), void* theCallData) { SVTK_ViewParameterDlg* self = reinterpret_cast(theClientData); - vtkFloatingPointType* aCoord; + double* aCoord; switch ( theEvent ) { case SVTK::FocalPointChanged: if ( theCallData ) { - aCoord = (vtkFloatingPointType*)theCallData; + aCoord = (double*)theCallData; self->myBusy = true; self->myFocalX->setText( QString::number(aCoord[0]) ); self->myFocalY->setText( QString::number(aCoord[1]) ); diff --git a/src/SVTK/SVTK_ViewParameterDlg.h b/src/SVTK/SVTK_ViewParameterDlg.h index a4ef4fe28..3e20f87b7 100755 --- a/src/SVTK/SVTK_ViewParameterDlg.h +++ b/src/SVTK/SVTK_ViewParameterDlg.h @@ -110,7 +110,7 @@ protected: //---------------------------------------------------------------------------- // Priority at which events are processed - vtkFloatingPointType myPriority; + double myPriority; // Used to process events vtkSmartPointer myEventCallbackCommand; diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 271aa4c93..b93407e68 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -825,7 +825,7 @@ SVTK_CubeAxesActor2D* SVTK_ViewWindow::GetCubeAxes() /*! \return trihedron size */ -vtkFloatingPointType SVTK_ViewWindow::GetTrihedronSize() const +double SVTK_ViewWindow::GetTrihedronSize() const { return GetRenderer()->GetTrihedronSize(); } @@ -992,7 +992,7 @@ void SVTK_ViewWindow::SetSpacemouseButtons(const int theBtn1, \param theSize - new trihedron size \param theRelative - trihedron relativeness */ -void SVTK_ViewWindow::SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative) +void SVTK_ViewWindow::SetTrihedronSize(const double theSize, const bool theRelative) { GetRenderer()->SetTrihedronSize(theSize, theRelative); Repaint(); @@ -1297,7 +1297,7 @@ void getGradAxisVisualParams( QXmlStreamWriter& writer, vtkAxisActor2D* actor, Q // Name bool isVisible = actor->GetTitleVisibility(); QString title ( actor->GetTitle() ); - vtkFloatingPointType color[ 3 ]; + double color[ 3 ]; int font = VTK_ARIAL; int bold = 0; int italic = 0; @@ -1411,7 +1411,7 @@ void setGradAxisVisualParams(QXmlStreamReader& reader, vtkAxisActor2D* actor) // Read title color aAttr = reader.attributes(); - vtkFloatingPointType color[3]; + double color[3]; color[0] = aAttr.value("R").toString().toDouble(); color[1] = aAttr.value("G").toString().toDouble(); color[2] = aAttr.value("B").toString().toDouble(); @@ -1493,7 +1493,7 @@ void setGradAxisVisualParams( vtkAxisActor2D* actor, const QString& params ) // retrieve and set name parameters bool isVisible = paramsLst[2].toUShort(); QString title = paramsLst[3]; - vtkFloatingPointType color[3]; + double color[3]; color[0] = paramsLst[4].toDouble(); color[1] = paramsLst[5].toDouble(); color[2] = paramsLst[6].toDouble(); diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index abb6c0968..cd94e94bd 100755 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -216,10 +216,10 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow SVTK_CubeAxesActor2D* GetCubeAxes(); //! Redirect the request to #SVTK_Renderer::GetTrihedronSize - vtkFloatingPointType GetTrihedronSize() const; + double GetTrihedronSize() const; //! Redirect the request to #SVTK_Renderer::SetTrihedronSize - virtual void SetTrihedronSize( const vtkFloatingPointType, const bool = true ); + virtual void SetTrihedronSize( const double, const bool = true ); //! Set incremental speed virtual void SetIncrementalSpeed( const int, const int = 0 ); diff --git a/src/SVTK/vtkPVAxesActor.cxx b/src/SVTK/vtkPVAxesActor.cxx index 25f471f24..4431e3ea6 100644 --- a/src/SVTK/vtkPVAxesActor.cxx +++ b/src/SVTK/vtkPVAxesActor.cxx @@ -50,7 +50,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -vtkCxxRevisionMacro(vtkPVAxesActor, "$Revision$"); vtkStandardNewMacro(vtkPVAxesActor); vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData ); @@ -153,9 +152,9 @@ vtkPVAxesActor::vtkPVAxesActor() vtkPolyDataMapper *ymapper = vtkPolyDataMapper::New(); vtkPolyDataMapper *zmapper = vtkPolyDataMapper::New(); - xmapper->SetInput( this->XAxisVectorText->GetOutput() ); - ymapper->SetInput( this->YAxisVectorText->GetOutput() ); - zmapper->SetInput( this->ZAxisVectorText->GetOutput() ); + xmapper->SetInputConnection( this->XAxisVectorText->GetOutputPort() ); + ymapper->SetInputConnection( this->YAxisVectorText->GetOutputPort() ); + zmapper->SetInputConnection( this->ZAxisVectorText->GetOutputPort() ); this->XAxisLabel->SetMapper( xmapper ); this->YAxisLabel->SetMapper( ymapper ); @@ -257,7 +256,7 @@ int vtkPVAxesActor::RenderOpaqueGeometry(vtkViewport *vp) } //----------------------------------------------------------------------------- -#if (VTK_MINOR_VERSION>=2) +#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2) // porting to VTK 5.0.x int vtkPVAxesActor::RenderTranslucentPolygonalGeometry(vtkViewport *vp) { @@ -586,36 +585,34 @@ void vtkPVAxesActor::UpdateProps() { case vtkPVAxesActor::CYLINDER_SHAFT: (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))-> - SetInput( this->CylinderSource->GetOutput() ); + SetInputConnection( this->CylinderSource->GetOutputPort() ); break; case vtkPVAxesActor::LINE_SHAFT: (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))-> - SetInput( this->LineSource->GetOutput() ); + SetInputConnection( this->LineSource->GetOutputPort() ); break; case vtkPVAxesActor::USER_DEFINED_SHAFT: (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))-> - SetInput( this->UserDefinedShaft ); + SetInputData( this->UserDefinedShaft ); } switch ( this->TipType ) { case vtkPVAxesActor::CONE_TIP: (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))-> - SetInput( this->ConeSource->GetOutput() ); + SetInputConnection( this->ConeSource->GetOutputPort() ); break; case vtkPVAxesActor::SPHERE_TIP: (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))-> - SetInput( this->SphereSource->GetOutput() ); + SetInputConnection( this->SphereSource->GetOutputPort() ); break; case vtkPVAxesActor::USER_DEFINED_TIP: (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))-> - SetInput( this->UserDefinedTip ); + SetInputData( this->UserDefinedTip ); } - (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))-> - GetInput()->Update(); - (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))-> - GetInput()->Update(); + (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->Update(); + (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->Update(); diff --git a/src/SVTK/vtkPVAxesActor.h b/src/SVTK/vtkPVAxesActor.h index 8b9d329cc..b76f59f93 100644 --- a/src/SVTK/vtkPVAxesActor.h +++ b/src/SVTK/vtkPVAxesActor.h @@ -43,6 +43,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "SVTK.h" #include "vtkProp3D.h" +#include + class vtkRenderer; class vtkPropCollection; class vtkMapper; @@ -60,7 +62,7 @@ class SVTK_EXPORT vtkPVAxesActor : public vtkProp3D { public: static vtkPVAxesActor *New(); - vtkTypeRevisionMacro(vtkPVAxesActor,vtkProp3D); + vtkTypeMacro(vtkPVAxesActor,vtkProp3D); void PrintSelf(ostream& os, vtkIndent indent); @@ -73,7 +75,7 @@ public: // Description: // Support the standard render methods. virtual int RenderOpaqueGeometry(vtkViewport *viewport); -#if (VTK_MINOR_VERSION>=2) +#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2) virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); // porting to VTK 5.0.x virtual int HasTranslucentPolygonalGeometry(); // porting to VTK 5.0.x #else diff --git a/src/SVTK/vtkPVAxesWidget.cxx b/src/SVTK/vtkPVAxesWidget.cxx index 42d80002b..b83b1dea3 100644 --- a/src/SVTK/vtkPVAxesWidget.cxx +++ b/src/SVTK/vtkPVAxesWidget.cxx @@ -47,7 +47,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "vtkRenderWindowInteractor.h" vtkStandardNewMacro(vtkPVAxesWidget); -vtkCxxRevisionMacro(vtkPVAxesWidget, "$Revision$"); vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor); vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer); @@ -115,7 +114,7 @@ vtkPVAxesWidget::vtkPVAxesWidget() vtkCoordinate *tcoord = vtkCoordinate::New(); tcoord->SetCoordinateSystemToDisplay(); vtkPolyDataMapper2D *mapper = vtkPolyDataMapper2D::New(); - mapper->SetInput(this->Outline); + mapper->SetInputData(this->Outline); mapper->SetTransformCoordinate(tcoord); this->OutlineActor = vtkActor2D::New(); this->OutlineActor->SetMapper(mapper); diff --git a/src/SVTK/vtkPVAxesWidget.h b/src/SVTK/vtkPVAxesWidget.h index 35c152a94..cc2bba8e1 100644 --- a/src/SVTK/vtkPVAxesWidget.h +++ b/src/SVTK/vtkPVAxesWidget.h @@ -52,7 +52,7 @@ class SVTK_EXPORT vtkPVAxesWidget : public vtkInteractorObserver { public: static vtkPVAxesWidget* New(); - vtkTypeRevisionMacro(vtkPVAxesWidget, vtkInteractorObserver); + vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver); void PrintSelf(ostream& os, vtkIndent indent); // Description: diff --git a/src/VTKViewer/Makefile.am b/src/VTKViewer/Makefile.am index 58fecd67e..dde868def 100755 --- a/src/VTKViewer/Makefile.am +++ b/src/VTKViewer/Makefile.am @@ -143,7 +143,8 @@ nodist_salomeres_DATA = \ VTKViewer_msg_fr.qm libVTKViewer_la_CPPFLAGS = $(QT_INCLUDES) $(VTK_INCLUDES) $(CAS_CPPFLAGS) \ - -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT + -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT \ + -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingOpenGL,vtkRenderingFreeTypeOpenGL)" libVTKViewer_la_LDFLAGS = $(KERNEL_LDFLAGS) $(VTK_LIBS) $(QT_MT_LIBS) \ $(CAS_KERNEL) $(OGL_LIBS) ../Qtx/libqtx.la ../SUIT/libsuit.la diff --git a/src/VTKViewer/VTKViewer.h b/src/VTKViewer/VTKViewer.h index c7f5efc5f..37af4e225 100755 --- a/src/VTKViewer/VTKViewer.h +++ b/src/VTKViewer/VTKViewer.h @@ -33,11 +33,4 @@ # define VTKVIEWER_EXPORT #endif -#include - -#if !defined(vtkFloatingPointType) -# define vtkFloatingPointType vtkFloatingPointType - typedef float vtkFloatingPointType; -#endif - #endif diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index fc8eda9a2..eecfbc211 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -180,30 +180,26 @@ 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 - if(vtkDataSetMapper* aMapper = dynamic_cast(theMapper)){ - aMapper->SetInput(myPassFilter[anId]->GetOutput()); - }else if(vtkPolyDataMapper* aMapper = dynamic_cast(theMapper)){ - aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput()); - } + theMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort()); } Superclass::SetMapper(theMapper); } @@ -216,7 +212,7 @@ VTKViewer_Actor ::Render(vtkRenderer *ren, vtkMapper* m) { if(vtkDataSet* aDataSet = GetInput()){ - static vtkFloatingPointType PERCENTS_OF_DETAILS = 0.50; + static double PERCENTS_OF_DETAILS = 0.50; vtkIdType aNbOfPoints = vtkIdType(aDataSet->GetNumberOfPoints()*PERCENTS_OF_DETAILS); if(aNbOfPoints > 0) SetNumberOfCloudPoints(aNbOfPoints); @@ -224,7 +220,7 @@ VTKViewer_Actor if(myIsResolveCoincidentTopology){ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); - vtkFloatingPointType aFactor, aUnit; + double aFactor, aUnit; vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); @@ -256,8 +252,8 @@ VTKViewer_Actor */ void VTKViewer_Actor -::SetPolygonOffsetParameters(vtkFloatingPointType factor, - vtkFloatingPointType units) +::SetPolygonOffsetParameters(double factor, + double units) { myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; @@ -269,8 +265,8 @@ VTKViewer_Actor */ void VTKViewer_Actor -::GetPolygonOffsetParameters(vtkFloatingPointType& factor, - vtkFloatingPointType& units) +::GetPolygonOffsetParameters(double& factor, + double& units) { factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; @@ -279,7 +275,7 @@ VTKViewer_Actor /*! \return shrink factor */ -vtkFloatingPointType +double VTKViewer_Actor ::GetShrinkFactor() { @@ -433,7 +429,7 @@ VTKViewer_Actor /*! Get coordinates of a node for given object index */ -vtkFloatingPointType* +double* VTKViewer_Actor ::GetNodeCoord(int theObjID) { @@ -494,14 +490,14 @@ VTKViewer_Actor if(myIsInfinite) return true; - static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; - vtkFloatingPointType aBounds[6]; + static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; + double aBounds[6]; GetBounds(aBounds); for(int i = 0; i < 6; i++) if(fabs(aBounds[i]) > MAX_DISTANCE) return true; - static vtkFloatingPointType MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT; if(GetLength() < MIN_DISTANCE) return true; @@ -511,7 +507,7 @@ VTKViewer_Actor /*! \return current bounding box */ -vtkFloatingPointType* +double* VTKViewer_Actor ::GetBounds() { @@ -524,7 +520,7 @@ VTKViewer_Actor */ void VTKViewer_Actor -::GetBounds(vtkFloatingPointType theBounds[6]) +::GetBounds(double theBounds[6]) { Superclass::GetBounds(theBounds); } @@ -546,7 +542,7 @@ VTKViewer_Actor void VTKViewer_Actor -::SetSize( const vtkFloatingPointType ) +::SetSize( const double ) {} @@ -558,13 +554,13 @@ VTKViewer_Actor void VTKViewer_Actor -::SetOpacity(vtkFloatingPointType theOpacity) +::SetOpacity(double theOpacity) { myOpacity = theOpacity; GetProperty()->SetOpacity(theOpacity); } -vtkFloatingPointType +double VTKViewer_Actor ::GetOpacity() { @@ -577,9 +573,9 @@ VTKViewer_Actor */ void VTKViewer_Actor -::SetColor(vtkFloatingPointType r, - vtkFloatingPointType g, - vtkFloatingPointType b) +::SetColor(double r, + double g, + double b) { GetProperty()->SetColor(r,g,b); } @@ -589,7 +585,7 @@ VTKViewer_Actor */ void VTKViewer_Actor -::SetColor(const vtkFloatingPointType theRGB[3]) +::SetColor(const double theRGB[3]) { SetColor(theRGB[0],theRGB[1],theRGB[2]); } @@ -599,11 +595,11 @@ VTKViewer_Actor */ void VTKViewer_Actor -::GetColor(vtkFloatingPointType& r, - vtkFloatingPointType& g, - vtkFloatingPointType& b) +::GetColor(double& r, + double& g, + double& b) { - vtkFloatingPointType aColor[3]; + double aColor[3]; GetProperty()->GetColor(aColor); r = aColor[0]; g = aColor[1]; @@ -728,14 +724,14 @@ bool VTKViewer_Actor::GetQuadraticArcMode() const{ /*! * Set Max angle for representation 2D quadratic element as arked polygon */ -void VTKViewer_Actor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){ +void VTKViewer_Actor::SetQuadraticArcAngle(double theMaxAngle){ myGeomFilter->SetQuadraticArcAngle(theMaxAngle); } /*! * Return Max angle of the representation 2D quadratic element as arked polygon */ -vtkFloatingPointType VTKViewer_Actor::GetQuadraticArcAngle() const{ +double VTKViewer_Actor::GetQuadraticArcAngle() const{ return myGeomFilter->GetQuadraticArcAngle(); } diff --git a/src/VTKViewer/VTKViewer_Actor.h b/src/VTKViewer/VTKViewer_Actor.h index 5225cd6b4..996d89478 100755 --- a/src/VTKViewer/VTKViewer_Actor.h +++ b/src/VTKViewer/VTKViewer_Actor.h @@ -93,31 +93,31 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Change opacity virtual void - SetOpacity(vtkFloatingPointType theOpacity); + SetOpacity(double theOpacity); //! Get current opacity virtual - vtkFloatingPointType + double GetOpacity(); //! Change color virtual void - SetColor(vtkFloatingPointType r, - vtkFloatingPointType g, - vtkFloatingPointType b); + SetColor(double r, + double g, + double b); //! Get current color virtual void - GetColor(vtkFloatingPointType& r, - vtkFloatingPointType& g, - vtkFloatingPointType& b); + GetColor(double& r, + double& g, + double& b); //! Change color virtual void - SetColor(const vtkFloatingPointType theRGB[3]); + SetColor(const double theRGB[3]); //! Change material virtual @@ -143,7 +143,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Get coordinates of a node for given object index virtual - vtkFloatingPointType* + double* GetNodeCoord(int theObjID); //! Maps VTK index of a cell to corresponding object index @@ -219,12 +219,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! To calcualte current bounding box virtual - vtkFloatingPointType* + double* GetBounds(); //! To calcualte current bounding box void - GetBounds(vtkFloatingPointType bounds[6]); + GetBounds(double bounds[6]); //---------------------------------------------------------------------------- virtual @@ -237,7 +237,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor virtual void - SetSize( const vtkFloatingPointType ); + SetSize( const double ); virtual void @@ -250,13 +250,13 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Set ResolveCoincidentTopology parameters void - SetPolygonOffsetParameters(vtkFloatingPointType factor, - vtkFloatingPointType units); + SetPolygonOffsetParameters(double factor, + double units); //! Get current ResolveCoincidentTopology parameters void - GetPolygonOffsetParameters(vtkFloatingPointType& factor, - vtkFloatingPointType& units); + GetPolygonOffsetParameters(double& factor, + double& units); virtual void @@ -265,7 +265,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //---------------------------------------------------------------------------- //! Get current shrink factor virtual - vtkFloatingPointType + double GetShrinkFactor(); //! Is the actor is shrunkable @@ -339,8 +339,8 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor virtual void SetQuadraticArcMode(bool theFlag); virtual bool GetQuadraticArcMode() const; - virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle); - virtual vtkFloatingPointType GetQuadraticArcAngle() const; + virtual void SetQuadraticArcAngle(double theMaxAngle); + virtual double GetQuadraticArcAngle() const; //---------------------------------------------------------------------------- //! Return pointer to the dataset, which used to calculation of the bounding box of the actor @@ -349,12 +349,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor protected: //---------------------------------------------------------------------------- bool myIsResolveCoincidentTopology; - vtkFloatingPointType myPolygonOffsetFactor; - vtkFloatingPointType myPolygonOffsetUnits; + double myPolygonOffsetFactor; + double myPolygonOffsetUnits; std::string myName; - vtkFloatingPointType myOpacity; + double myOpacity; int myDisplayMode; bool myIsInfinite; diff --git a/src/VTKViewer/VTKViewer_AppendFilter.cxx b/src/VTKViewer/VTKViewer_AppendFilter.cxx index cc08f7bad..986edd57d 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.cxx +++ b/src/VTKViewer/VTKViewer_AppendFilter.cxx @@ -44,7 +44,6 @@ #endif #endif -vtkCxxRevisionMacro(VTKViewer_AppendFilter, "$Revision$"); vtkStandardNewMacro(VTKViewer_AppendFilter); VTKViewer_AppendFilter diff --git a/src/VTKViewer/VTKViewer_AppendFilter.h b/src/VTKViewer/VTKViewer_AppendFilter.h index 3a0e27a4f..35c691d63 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.h +++ b/src/VTKViewer/VTKViewer_AppendFilter.h @@ -46,10 +46,10 @@ public: */ static VTKViewer_AppendFilter *New(); - /*! \fn vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter) + /*! \fn vtkTypeMacro(VTKViewer_AppendFilter, vtkAppendFilter) * \brief VTK type revision macros. */ - vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter); + vtkTypeMacro(VTKViewer_AppendFilter, vtkAppendFilter); void SetDoMappingFlag(const bool theFlag); diff --git a/src/VTKViewer/VTKViewer_ArcBuilder.cxx b/src/VTKViewer/VTKViewer_ArcBuilder.cxx index 26df8dbdc..9057c9893 100644 --- a/src/VTKViewer/VTKViewer_ArcBuilder.cxx +++ b/src/VTKViewer/VTKViewer_ArcBuilder.cxx @@ -292,7 +292,6 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1, vtkUnstructuredGrid* aTransformedGrid; if(needRotation) { aTransformedGrid = TransformGrid(aGrid,aAxis,anAngle); - aTransformedGrid->Update(); #ifdef _MY_DEBUG_ cout<<"Need Rotation!!!"< aScalarValues; vtkUnstructuredGrid* anArc = BuildArc(aScalarValues); vtkUnstructuredGrid* anTransArc; - if(needRotation) { + if(needRotation) anTransArc = TransformGrid(anArc,aAxis,-anAngle); - anTransArc->Update(); - } else anTransArc = anArc; @@ -335,7 +332,6 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1, aList.push_back(thePnt2); aList.push_back(thePnt3); vtkUnstructuredGrid* aGrid = BuildGrid(aList); - aGrid->Update(); myPoints = aGrid->GetPoints(); myScalarValues.clear(); @@ -397,7 +393,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 +468,8 @@ vtkUnstructuredGrid* VTKViewer_ArcBuilder::BuildArc(std::vector& 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 +537,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 +558,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){ @@ -579,7 +575,7 @@ VTKViewer_ArcBuilder::IncOrder VTKViewer_ArcBuilder::GetArcAngle( const double& //------------------------------------------------------------------------ Pnt CreatePnt(vtkCell* cell, vtkDataArray* scalars, vtkIdType index) { - vtkFloatingPointType coord[3]; + double coord[3]; cell->GetPoints()->GetPoint(index, coord); vtkIdType pointId = cell->GetPointId(index); double scalarValue = scalars ? scalars->GetTuple1(pointId) : 0; @@ -590,7 +586,7 @@ Pnt CreatePnt(vtkCell* cell, vtkDataArray* scalars, vtkIdType index) //------------------------------------------------------------------------ vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input, vtkPolyData *output,vtkIdType *pts, - vtkFloatingPointType myMaxArcAngle){ + double myMaxArcAngle){ vtkIdType aResult = -1; vtkIdType *aNewPoints; diff --git a/src/VTKViewer/VTKViewer_ArcBuilder.h b/src/VTKViewer/VTKViewer_ArcBuilder.h index c5f47a2c4..0f27af523 100644 --- a/src/VTKViewer/VTKViewer_ArcBuilder.h +++ b/src/VTKViewer/VTKViewer_ArcBuilder.h @@ -25,6 +25,8 @@ #include #include +#include + class vtkCell; class vtkDataArray; class vtkPoints; @@ -45,7 +47,7 @@ vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input, vtkPolyData *output, vtkIdType *pts, - vtkFloatingPointType myMaxArcAngle); + double myMaxArcAngle); Pnt CreatePnt(vtkCell* cell, vtkDataArray* scalars, diff --git a/src/VTKViewer/VTKViewer_CellCenters.cxx b/src/VTKViewer/VTKViewer_CellCenters.cxx index 0aa717bd2..abaf1a08d 100644 --- a/src/VTKViewer/VTKViewer_CellCenters.cxx +++ b/src/VTKViewer/VTKViewer_CellCenters.cxx @@ -33,7 +33,6 @@ #include #include -vtkCxxRevisionMacro(VTKViewer_CellCenters, "$Revision$"); vtkStandardNewMacro(VTKViewer_CellCenters); /*! diff --git a/src/VTKViewer/VTKViewer_CellCenters.h b/src/VTKViewer/VTKViewer_CellCenters.h index 6a37f1585..c33141aae 100644 --- a/src/VTKViewer/VTKViewer_CellCenters.h +++ b/src/VTKViewer/VTKViewer_CellCenters.h @@ -39,7 +39,7 @@ class VTKVIEWER_EXPORT VTKViewer_CellCenters : public vtkCellCenters { public: - vtkTypeRevisionMacro(VTKViewer_CellCenters,vtkCellCenters); + vtkTypeMacro(VTKViewer_CellCenters,vtkCellCenters); static VTKViewer_CellCenters *New(); diff --git a/src/VTKViewer/VTKViewer_CellLocationsArray.h b/src/VTKViewer/VTKViewer_CellLocationsArray.h index 7cfb3e88c..2d3d7bff1 100644 --- a/src/VTKViewer/VTKViewer_CellLocationsArray.h +++ b/src/VTKViewer/VTKViewer_CellLocationsArray.h @@ -25,6 +25,8 @@ #include "VTKViewer.h" +#include + #if ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)) || (VTK_MAJOR_VERSION > 4) # include # define TCellLocationsArray vtkIdTypeArray diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index 3cd96908a..1c22204a2 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -55,11 +55,11 @@ namespace struct TPolygon { TConnectivities myConnectivities; - vtkFloatingPointType myOrigin[3]; - vtkFloatingPointType myNormal[3]; + double myOrigin[3]; + double myNormal[3]; TPolygon(const TConnectivities& theConnectivities, - vtkFloatingPointType theOrigin[3], - vtkFloatingPointType theNormal[3]): + double theOrigin[3], + double theNormal[3]): myConnectivities(theConnectivities) { myOrigin[0] = theOrigin[0]; @@ -108,7 +108,7 @@ VTKViewer_Triangulator vtkIdType aNumPts; theInput->GetCellPoints(theCellId, aNumPts, myPointIds); if ( aNumPts > 0 ) { - vtkFloatingPointType anAbsoluteCoord[3]; + double anAbsoluteCoord[3]; myPoints->SetNumberOfPoints(aNumPts); vtkPoints *anInputPoints = theInput->GetPoints(); for (int aPntId = 0; aPntId < aNumPts; aPntId++) { @@ -140,14 +140,14 @@ VTKViewer_Triangulator //---------------------------------------------------------------------------- -vtkFloatingPointType +double VTKViewer_Triangulator ::GetCellLength() { - vtkFloatingPointType aBounds[6]; + double aBounds[6]; myPoints->GetBounds(aBounds); - vtkFloatingPointType aCoordDiff[3]; + double aCoordDiff[3]; aCoordDiff[0] = (aBounds[1] - aBounds[0]); aCoordDiff[1] = (aBounds[3] - aBounds[2]); aCoordDiff[2] = (aBounds[5] - aBounds[4]); @@ -210,9 +210,9 @@ VTKViewer_Triangulator return true; // To calculate the bary center of the cell - vtkFloatingPointType aCellCenter[3] = {0.0, 0.0, 0.0}; + double aCellCenter[3] = {0.0, 0.0, 0.0}; { - vtkFloatingPointType aPntCoord[3]; + double aPntCoord[3]; for (int aPntId = 0; aPntId < aNumPts; aPntId++) { aPoints->GetPoint(GetPointId(aPntId),aPntCoord); if(DEBUG_TRIA_EXECUTE) cout<<"\taPntId = "<GetPoint(aNewPts[0],aCoord[0]); aPoints->GetPoint(aNewPts[1],aCoord[1]); aPoints->GetPoint(aNewPts[2],aCoord[2]); @@ -307,11 +307,11 @@ VTKViewer_Triangulator */ - vtkFloatingPointType aVector01[3] = { aCoord[1][0] - aCoord[0][0], + double aVector01[3] = { aCoord[1][0] - aCoord[0][0], aCoord[1][1] - aCoord[0][1], aCoord[1][2] - aCoord[0][2] }; - vtkFloatingPointType aVector02[3] = { aCoord[2][0] - aCoord[0][0], + double aVector02[3] = { aCoord[2][0] - aCoord[0][0], aCoord[2][1] - aCoord[0][1], aCoord[2][2] - aCoord[0][2] }; @@ -319,34 +319,34 @@ VTKViewer_Triangulator vtkMath::Normalize(aVector02); // To calculate the normal for the triangle - vtkFloatingPointType aNormal[3]; + double aNormal[3]; vtkMath::Cross(aVector02,aVector01,aNormal); vtkMath::Normalize(aNormal); // To calculate what points belong to the plane // To calculate bounds of the point set - vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0}; + double aCenter[3] = {0.0, 0.0, 0.0}; { TPointIds::const_iterator anIter = anInitialPointIds.begin(); TPointIds::const_iterator anEndIter = anInitialPointIds.end(); for(; anIter != anEndIter; anIter++){ - vtkFloatingPointType aPntCoord[3]; + double aPntCoord[3]; vtkIdType aPntId = *anIter; aPoints->GetPoint(aPntId,aPntCoord); - vtkFloatingPointType aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0], + double aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0], aPntCoord[1] - aCoord[0][1], aPntCoord[2] - aCoord[0][2] }; vtkMath::Normalize(aVector0Pnt); - vtkFloatingPointType aNormalPnt[3]; + double aNormalPnt[3]; // calculate aNormalPnt { - vtkFloatingPointType aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01); - vtkFloatingPointType aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02); + double aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01); + double aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02); if(aCosPnt01<-1) aCosPnt01 = -1; if(aCosPnt01>1) @@ -356,9 +356,9 @@ VTKViewer_Triangulator if(aCosPnt02>1) aCosPnt02 = 1; - vtkFloatingPointType aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle) - vtkFloatingPointType aAngPnt01 = fabs(acos(aCosPnt01)); - vtkFloatingPointType aAngPnt02 = fabs(acos(aCosPnt02)); + double aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle) + double aAngPnt01 = fabs(acos(aCosPnt01)); + double aAngPnt02 = fabs(acos(aCosPnt02)); /* check that triangle similar to equilateral triangle AOC or COB ? @@ -390,7 +390,7 @@ VTKViewer_Triangulator if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "< TSortedPointIds; + typedef std::map TSortedPointIds; TSortedPointIds aSortedPointIds; TPointIds::const_iterator anIter = aPointIds.begin(); TPointIds::const_iterator anEndIter = aPointIds.end(); for(; anIter != anEndIter; anIter++){ - vtkFloatingPointType aPntCoord[3]; + double aPntCoord[3]; vtkIdType aPntId = *anIter; aPoints->GetPoint(aPntId,aPntCoord); - vtkFloatingPointType aVector[3] = { aPntCoord[0] - aCenter[0], + double aVector[3] = { aPntCoord[0] - aCenter[0], aPntCoord[1] - aCenter[1], aPntCoord[2] - aCenter[2] }; vtkMath::Normalize(aVector); - vtkFloatingPointType aCross[3]; + double aCross[3]; vtkMath::Cross(aVector,aVector0,aCross); - vtkFloatingPointType aCr = vtkMath::Dot(aCross,aNormal); + double aCr = vtkMath::Dot(aCross,aNormal); bool aGreaterThanPi = aCr < 0; - vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0); - vtkFloatingPointType anAngle = 0.0; + double aCosinus = vtkMath::Dot(aVector,aVector0); + double anAngle = 0.0; if(aCosinus >= 1.0){ aCosinus = 1.0; } else if (aCosinus <= -1.0){ @@ -544,18 +544,18 @@ VTKViewer_Triangulator int aNbPolygons = aPolygons.size(); for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) { ::TPolygon& aPolygon = aPolygons[aPolygonId]; - vtkFloatingPointType* aNormal = aPolygon.myNormal; - vtkFloatingPointType* anOrigin = aPolygon.myOrigin; + double* aNormal = aPolygon.myNormal; + double* anOrigin = aPolygon.myOrigin; if(DEBUG_TRIA_EXECUTE) { cout<<"\taPolygonId = "<GetPoint(anId,aPntCoord); - vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord); + double aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord); if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "< 0 ) { myTriangulator->InitTriangulation(0.0, 1.0, 0.0, 1.0, 0.0, 1.0, aNumPts); - vtkFloatingPointType aBounds[6]; + double aBounds[6]; myPoints->GetBounds(aBounds); - vtkFloatingPointType xSize, ySize, zSize; + double xSize, ySize, zSize; xSize = aBounds[1] - aBounds[0]; ySize = aBounds[3] - aBounds[2]; zSize = aBounds[5] - aBounds[4]; - vtkFloatingPointType anAbsoluteCoord[3]; - vtkFloatingPointType aParamentrucCoord[3]; + double anAbsoluteCoord[3]; + double aParamentrucCoord[3]; for (int aPntId = 0; aPntId < aNumPts; aPntId++) { myPoints->GetPoint(aPntId, anAbsoluteCoord); aParamentrucCoord[0] = xSize==0. ? 0. : ((anAbsoluteCoord[0] - aBounds[0]) / xSize); @@ -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(); } diff --git a/src/VTKViewer/VTKViewer_ConvexTool.h b/src/VTKViewer/VTKViewer_ConvexTool.h index 017a0a700..11d45b99b 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.h +++ b/src/VTKViewer/VTKViewer_ConvexTool.h @@ -94,7 +94,7 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator vtkIdType GetPointId(vtkIdType thePointId); - vtkFloatingPointType + double GetCellLength(); void diff --git a/src/VTKViewer/VTKViewer_DataSetMapper.cxx b/src/VTKViewer/VTKViewer_DataSetMapper.cxx index fad3d9179..711a04ad0 100644 --- a/src/VTKViewer/VTKViewer_DataSetMapper.cxx +++ b/src/VTKViewer/VTKViewer_DataSetMapper.cxx @@ -23,7 +23,6 @@ #include #include -vtkCxxRevisionMacro(VTKViewer_DataSetMapper, "Revision$"); vtkStandardNewMacro(VTKViewer_DataSetMapper); //---------------------------------------------------------------------------- @@ -48,7 +47,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 ) diff --git a/src/VTKViewer/VTKViewer_DataSetMapper.h b/src/VTKViewer/VTKViewer_DataSetMapper.h index cbdfbbbff..76ae91f7b 100644 --- a/src/VTKViewer/VTKViewer_DataSetMapper.h +++ b/src/VTKViewer/VTKViewer_DataSetMapper.h @@ -29,7 +29,7 @@ class VTKVIEWER_EXPORT VTKViewer_DataSetMapper : public vtkDataSetMapper { public: static VTKViewer_DataSetMapper *New(); - vtkTypeRevisionMacro(VTKViewer_DataSetMapper,vtkDataSetMapper); + vtkTypeMacro(VTKViewer_DataSetMapper,vtkDataSetMapper); //! Set point marker enabled void SetMarkerEnabled( bool ); diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx index 25ca840fb..076f1bc3c 100755 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx @@ -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() = "< +#include #include #include @@ -35,17 +35,17 @@ #pragma warning ( disable:4251 ) #endif -/*! \class vtkUnstructuredGridToUnstructuredGridFilter +/*! \class vtkUnstructuredGridAlgorithm * \brief For more information see VTK documentation */ -/*! \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; diff --git a/src/VTKViewer/VTKViewer_FramedTextActor.cxx b/src/VTKViewer/VTKViewer_FramedTextActor.cxx index 328d7fd07..406482997 100644 --- a/src/VTKViewer/VTKViewer_FramedTextActor.cxx +++ b/src/VTKViewer/VTKViewer_FramedTextActor.cxx @@ -39,7 +39,6 @@ #define OFFSET_SPACING 2 //================================================================== -vtkCxxRevisionMacro(VTKViewer_FramedTextActor, "$Revision$"); vtkStandardNewMacro(VTKViewer_FramedTextActor); //================================================================== @@ -53,7 +52,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); @@ -160,9 +159,9 @@ void VTKViewer_FramedTextActor::GetSize(vtkRenderer* theRenderer, int theSize[2] // function : SetForegroundColor // purpose : //================================================================== -void VTKViewer_FramedTextActor::SetForegroundColor(const vtkFloatingPointType r, - const vtkFloatingPointType g, - const vtkFloatingPointType b) +void VTKViewer_FramedTextActor::SetForegroundColor(const double r, + const double g, + const double b) { myTextProperty->SetColor(r, g, b); myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty); @@ -173,11 +172,11 @@ void VTKViewer_FramedTextActor::SetForegroundColor(const vtkFloatingPointType r, // function : GetForegroundColor // purpose : //================================================================== -void VTKViewer_FramedTextActor::GetForegroundColor(vtkFloatingPointType& r, - vtkFloatingPointType& g, - vtkFloatingPointType& b) +void VTKViewer_FramedTextActor::GetForegroundColor(double& r, + double& g, + double& b) { - vtkFloatingPointType aColor[3]; + double aColor[3]; myTextProperty->GetColor(aColor); r = aColor[0]; g = aColor[1]; @@ -188,9 +187,9 @@ void VTKViewer_FramedTextActor::GetForegroundColor(vtkFloatingPointType& r, // function : SetBackgroundColor // purpose : //================================================================== -void VTKViewer_FramedTextActor::SetBackgroundColor(const vtkFloatingPointType r, - const vtkFloatingPointType g, - const vtkFloatingPointType b) +void VTKViewer_FramedTextActor::SetBackgroundColor(const double r, + const double g, + const double b) { myBarActor->GetProperty()->SetColor(r, g, b); Modified(); @@ -200,11 +199,11 @@ void VTKViewer_FramedTextActor::SetBackgroundColor(const vtkFloatingPointType r, // function : GetBackgroundColor // purpose : //================================================================== -void VTKViewer_FramedTextActor::GetBackgroundColor(vtkFloatingPointType& r, - vtkFloatingPointType& g, - vtkFloatingPointType& b) +void VTKViewer_FramedTextActor::GetBackgroundColor(double& r, + double& g, + double& b) { - vtkFloatingPointType aColor[3]; + double aColor[3]; myBarActor->GetProperty()->GetColor(aColor); r = aColor[0]; g = aColor[1]; @@ -215,7 +214,7 @@ void VTKViewer_FramedTextActor::GetBackgroundColor(vtkFloatingPointType& r, // function : SetTransparency // purpose : //================================================================== -void VTKViewer_FramedTextActor::SetTransparency(const vtkFloatingPointType theTransparency) +void VTKViewer_FramedTextActor::SetTransparency(const double theTransparency) { if (theTransparency>=0. && theTransparency<=1.){ myTransparency=theTransparency; @@ -228,7 +227,7 @@ void VTKViewer_FramedTextActor::SetTransparency(const vtkFloatingPointType theTr // function : GetTransparency // purpose : //================================================================== -vtkFloatingPointType VTKViewer_FramedTextActor::GetTransparency()const +double VTKViewer_FramedTextActor::GetTransparency()const { return myTransparency; } @@ -336,7 +335,7 @@ int VTKViewer_FramedTextActor::GetLayoutType() const // function : SetWorldPoint // purpose : //================================================================== -void VTKViewer_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]) +void VTKViewer_FramedTextActor::SetWorldPoint(const double theWorldPoint[4]) { for(int i = 0; i<4; ++i) { myWorldPoint[i] = theWorldPoint[i]; @@ -348,7 +347,7 @@ void VTKViewer_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorl // function : GetWorldPoint // purpose : //================================================================== -const vtkFloatingPointType* VTKViewer_FramedTextActor::GetWorldPoint()const +const double* VTKViewer_FramedTextActor::GetWorldPoint()const { return myWorldPoint; } @@ -357,7 +356,7 @@ const vtkFloatingPointType* VTKViewer_FramedTextActor::GetWorldPoint()const // function : SetDistance // purpose : //================================================================== -void VTKViewer_FramedTextActor::SetDistance(const vtkFloatingPointType theDistance) +void VTKViewer_FramedTextActor::SetDistance(const double theDistance) { myDistance=theDistance; } @@ -366,7 +365,7 @@ void VTKViewer_FramedTextActor::SetDistance(const vtkFloatingPointType theDistan // function : GetDistance // purpose : //================================================================== -vtkFloatingPointType VTKViewer_FramedTextActor::GetDistance()const +double VTKViewer_FramedTextActor::GetDistance()const { return myDistance; } @@ -457,10 +456,10 @@ VTKViewer_FramedTextActor int aTextMargin = GetTextMargin(); - vtkFloatingPointType xMin = 0.0; - vtkFloatingPointType xMax = 0.0; - vtkFloatingPointType yMin = -aBarHeight/2 - aTextMargin; - vtkFloatingPointType yMax = aBarHeight/2 + aTextMargin; + double xMin = 0.0; + double xMax = 0.0; + double yMin = -aBarHeight/2 - aTextMargin; + double yMax = aBarHeight/2 + aTextMargin; int aHorizontalOffset = GetLayoutType() == Horizontal ? myHorizontalOffset : 0; int aVerticalOffset = GetLayoutType() == Vertical ? myVerticalOffset : 0; @@ -470,10 +469,10 @@ VTKViewer_FramedTextActor theViewport->SetWorldPoint(myWorldPoint); theViewport->WorldToDisplay(); - vtkFloatingPointType aSelectionPoint[3]; + double aSelectionPoint[3]; theViewport->GetDisplayPoint(aSelectionPoint); - vtkFloatingPointType u = aSelectionPoint[0]; - vtkFloatingPointType v = aSelectionPoint[1] - myDistance; + double u = aSelectionPoint[0]; + double v = aSelectionPoint[1] - myDistance; if(myMoveFrameFlag) v -= aBarHeight/2.; theViewport->ViewportToNormalizedViewport(u, v); @@ -486,8 +485,8 @@ VTKViewer_FramedTextActor } else // except BelowPoint, only TopLeft and TopRight modes are supported at this moment { - vtkFloatingPointType x = 0, xOffset = aHorizontalOffset + aTextMargin + OFFSET_SPACING; - vtkFloatingPointType y = 0, yOffset = aVerticalOffset + aTextMargin + OFFSET_SPACING; + double x = 0, xOffset = aHorizontalOffset + aTextMargin + OFFSET_SPACING; + double y = 0, yOffset = aVerticalOffset + aTextMargin + OFFSET_SPACING; if( myModePosition == TopLeft ) { @@ -508,8 +507,8 @@ VTKViewer_FramedTextActor xMax = aTextMargin; } - PositionCoordinate->SetValue(x / (vtkFloatingPointType)aViewPortWidth, - y / (vtkFloatingPointType)aViewPortHeight); + PositionCoordinate->SetValue(x / (double)aViewPortWidth, + y / (double)aViewPortHeight); } aPoints->SetPoint(0, xMin, yMax, 0.0); diff --git a/src/VTKViewer/VTKViewer_FramedTextActor.h b/src/VTKViewer/VTKViewer_FramedTextActor.h index 0a3e95be3..5f2de984e 100644 --- a/src/VTKViewer/VTKViewer_FramedTextActor.h +++ b/src/VTKViewer/VTKViewer_FramedTextActor.h @@ -40,7 +40,7 @@ public: enum LayoutType { Vertical = 0, Horizontal }; public: - vtkTypeRevisionMacro(VTKViewer_FramedTextActor,vtkActor2D); + vtkTypeMacro(VTKViewer_FramedTextActor,vtkActor2D); static VTKViewer_FramedTextActor *New(); virtual int RenderOpaqueGeometry(vtkViewport*); @@ -64,31 +64,31 @@ public: void SetLayoutType(const int theType); int GetLayoutType() const; - void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]); - const vtkFloatingPointType* GetWorldPoint() const; + void SetWorldPoint(const double theWorldPoint[4]); + const double* GetWorldPoint() const; - void SetDistance(const vtkFloatingPointType theDistance); - vtkFloatingPointType GetDistance() const; + void SetDistance(const double theDistance); + double GetDistance() const; void SetMoveFrameFlag(const int flag); int GetMoveFrameFlag() const; - void SetForegroundColor(const vtkFloatingPointType r, - const vtkFloatingPointType g, - const vtkFloatingPointType b); - void GetForegroundColor(vtkFloatingPointType& r, - vtkFloatingPointType& g, - vtkFloatingPointType& b); + void SetForegroundColor(const double r, + const double g, + const double b); + void GetForegroundColor(double& r, + double& g, + double& b); - void SetBackgroundColor(const vtkFloatingPointType r, - const vtkFloatingPointType g, - const vtkFloatingPointType b); - void GetBackgroundColor(vtkFloatingPointType& r, - vtkFloatingPointType& g, - vtkFloatingPointType& b); + void SetBackgroundColor(const double r, + const double g, + const double b); + void GetBackgroundColor(double& r, + double& g, + double& b); - void SetTransparency(const vtkFloatingPointType theTransparency); - vtkFloatingPointType GetTransparency() const; + void SetTransparency(const double theTransparency); + double GetTransparency() const; void SetTextMargin(const int theMargin); int GetTextMargin() const; @@ -114,9 +114,9 @@ protected: int myLayoutType; int myMoveFrameFlag; - vtkFloatingPointType myWorldPoint[4]; - vtkFloatingPointType myDistance; - vtkFloatingPointType myTransparency; + double myWorldPoint[4]; + double myDistance; + double myTransparency; int myTextMargin; diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index 7d139de07..e64645224 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -90,7 +90,6 @@ #endif /////////////////////////////////////////////////////////////////////////////////////////////// -vtkCxxRevisionMacro(VTKViewer_GeometryFilter, "$Revision$"); vtkStandardNewMacro(VTKViewer_GeometryFilter); VTKViewer_GeometryFilter @@ -184,13 +183,13 @@ VTKViewer_GeometryFilter char *cellVis; vtkIdType newCellId; int faceId, *faceVerts, numFacePts; - vtkFloatingPointType *x; + double *x; vtkIdType PixelConvert[4]; // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK // 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; @@ -1525,7 +1524,7 @@ bool VTKViewer_GeometryFilter::GetQuadraticArcMode() const return myIsBuildArc; } -void VTKViewer_GeometryFilter::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle) +void VTKViewer_GeometryFilter::SetQuadraticArcAngle(double theMaxAngle) { if(myMaxArcAngle != theMaxAngle) { myMaxArcAngle = theMaxAngle; @@ -1533,7 +1532,7 @@ void VTKViewer_GeometryFilter::SetQuadraticArcAngle(vtkFloatingPointType theMaxA } } -vtkFloatingPointType VTKViewer_GeometryFilter:: GetQuadraticArcAngle() const +double VTKViewer_GeometryFilter:: GetQuadraticArcAngle() const { return myMaxArcAngle; } diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.h b/src/VTKViewer/VTKViewer_GeometryFilter.h index 53a36f4e8..e4ecab87d 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.h +++ b/src/VTKViewer/VTKViewer_GeometryFilter.h @@ -45,10 +45,10 @@ public: */ static VTKViewer_GeometryFilter *New(); - /*! \fn vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter) + /*! \fn vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter) * \brief VTK type revision macros. */ - vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter); + vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter); /*! \fn void SetInside(int theShowInside) * \brief Sets \a myShowInside flag. \a myShowInside is changed, call this->Modified(). * \param theShowInside - used for changing value of \a myShowInside variable. @@ -106,8 +106,8 @@ public: virtual void SetQuadraticArcMode(bool theFlag); virtual bool GetQuadraticArcMode() const; - virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle); - virtual vtkFloatingPointType GetQuadraticArcAngle() const; + virtual void SetQuadraticArcAngle(double theMaxAngle); + virtual double GetQuadraticArcAngle() const; typedef std::vector TVectorId; typedef std::map TMapOfVectorId; @@ -150,7 +150,7 @@ private: int myIsWireframeMode; int myAppendCoincident3D; - vtkFloatingPointType myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees + double myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees bool myIsBuildArc; // flag for representation 2D quadratic element as arked polygon }; diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.cxx b/src/VTKViewer/VTKViewer_InteractorStyle.cxx index bc5e342cf..b07eaf3ba 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.cxx +++ b/src/VTKViewer/VTKViewer_InteractorStyle.cxx @@ -1347,17 +1347,17 @@ void VTKViewer_InteractorStyle::Place(const int theX, const int theY) void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY) { vtkCamera *cam = this->CurrentRenderer->GetActiveCamera(); - vtkFloatingPointType viewFocus[4], focalDepth, viewPoint[3]; - vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3]; + double viewFocus[4], focalDepth, viewPoint[3]; + double newPickPoint[4], oldPickPoint[4], motionVector[3]; cam->GetFocalPoint(viewFocus); this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1], viewFocus[2], viewFocus); focalDepth = viewFocus[2]; - this->ComputeDisplayToWorld(vtkFloatingPointType(toX), vtkFloatingPointType(toY), + this->ComputeDisplayToWorld(double(toX), double(toY), focalDepth, newPickPoint); - this->ComputeDisplayToWorld(vtkFloatingPointType(fromX),vtkFloatingPointType(fromY), + this->ComputeDisplayToWorld(double(fromX),double(fromY), focalDepth, oldPickPoint); // camera motion is reversed @@ -1381,17 +1381,17 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor, const int left, const int top, const int right, const int bottom) { - vtkFloatingPointType* aBounds = theActor->GetBounds(); - vtkFloatingPointType aMin[3], aMax[3]; + double* aBounds = theActor->GetBounds(); + double aMin[3], aMax[3]; ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin); ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax); if (aMin[0] > aMax[0]) { - vtkFloatingPointType aBuf = aMin[0]; + double aBuf = aMin[0]; aMin[0] = aMax[0]; aMax[0] = aBuf; } if (aMin[1] > aMax[1]) { - vtkFloatingPointType aBuf = aMin[1]; + double aBuf = aMin[1]; aMin[1] = aMax[1]; aMax[1] = aBuf; } @@ -1405,17 +1405,17 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, const int left, const int top, const int right, const int bottom) { - vtkFloatingPointType* aBounds = theCell->GetBounds(); - vtkFloatingPointType aMin[3], aMax[3]; + double* aBounds = theCell->GetBounds(); + double aMin[3], aMax[3]; ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin); ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax); if (aMin[0] > aMax[0]) { - vtkFloatingPointType aBuf = aMin[0]; + double aBuf = aMin[0]; aMin[0] = aMax[0]; aMax[0] = aBuf; } if (aMin[1] > aMax[1]) { - vtkFloatingPointType aBuf = aMin[1]; + double aBuf = aMin[1]; aMin[1] = aMax[1]; aMax[1] = aBuf; } @@ -1424,11 +1424,11 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, } /*!Checks: is given point \a thePoint in rectangle*/ -bool VTKViewer_InteractorStyle::IsInRect(vtkFloatingPointType* thePoint, +bool VTKViewer_InteractorStyle::IsInRect(double* thePoint, const int left, const int top, const int right, const int bottom) { - vtkFloatingPointType aPnt[3]; + double aPnt[3]; ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt); return ((aPnt[0]>left) && (aPnt[0]bottom) && (aPnt[1]Delete(); anImageData->SetExtent( 0, aWidth-1, 0, aHeight-1, 0, 0 ); - anImageData->SetScalarTypeToUnsignedChar(); - anImageData->SetNumberOfScalarComponents( 4 ); - anImageData->AllocateScalars(); + anImageData->AllocateScalars( VTK_UNSIGNED_CHAR, 4 ); unsigned char* aDataPtr = (unsigned char*)anImageData->GetScalarPointer(); @@ -109,7 +107,6 @@ namespace VTK aDataPtr[ anId++ ] = aValue * aCoef; aDataPtr[ anId++ ] = aValue; } - anImageData->Update(); return anImageData; } diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx index 019350a17..afd07fa9e 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx @@ -46,7 +46,6 @@ #endif #ifndef VTK_IMPLEMENT_MESA_CXX -vtkCxxRevisionMacro(VTKViewer_PolyDataMapper, "Revision$"); vtkStandardNewMacro(VTKViewer_PolyDataMapper); #endif @@ -316,7 +315,7 @@ namespace VTK //----------------------------------------------------------------------------- struct TColorFunctorBase { - vtkFloatingPointType myAlpha; + double myAlpha; TColorFunctorBase( vtkProperty* theProperty ) { @@ -331,7 +330,7 @@ namespace VTK //----------------------------------------------------------------------------- struct TPropertyColor : TColorFunctorBase { - vtkFloatingPointType myColor[3]; + double myColor[3]; TPropertyColor( vtkProperty* theProperty ): TColorFunctorBase( theProperty ) diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.h b/src/VTKViewer/VTKViewer_PolyDataMapper.h index 80d04a783..350c10902 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.h +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.h @@ -60,7 +60,7 @@ public: public: static VTKViewer_PolyDataMapper* New(); - vtkTypeRevisionMacro( VTKViewer_PolyDataMapper, MAPPER_SUPERCLASS ); + vtkTypeMacro( VTKViewer_PolyDataMapper, MAPPER_SUPERCLASS ); //! Set point marker enabled void SetMarkerEnabled( bool ); diff --git a/src/VTKViewer/VTKViewer_RenderWindow.cxx b/src/VTKViewer/VTKViewer_RenderWindow.cxx index ee6c9f2c8..ba212288c 100755 --- a/src/VTKViewer/VTKViewer_RenderWindow.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindow.cxx @@ -144,7 +144,7 @@ void VTKViewer_RenderWindow::wheelEvent(QWheelEvent* event) void VTKViewer_RenderWindow::onChangeBackgroundColor() { //float red, green, blue; - vtkFloatingPointType backint[3]; + double backint[3]; vtkRendererCollection * theRenderers = myRW->GetRenderers(); theRenderers->InitTraversal(); diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx index a47647fda..10382acb4 100755 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx @@ -708,7 +708,7 @@ void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfIn TUpdateActor theFun) { (*theFun)(theMapIndex,theMapActor,theActor); - vtkFloatingPointType aPos[3]; + double aPos[3]; theMapActor->GetPosition(aPos); theActor->SetPosition(aPos); } diff --git a/src/VTKViewer/VTKViewer_ShrinkFilter.cxx b/src/VTKViewer/VTKViewer_ShrinkFilter.cxx index 7e551972d..38019350f 100755 --- a/src/VTKViewer/VTKViewer_ShrinkFilter.cxx +++ b/src/VTKViewer/VTKViewer_ShrinkFilter.cxx @@ -35,7 +35,6 @@ #include #include -vtkCxxRevisionMacro(VTKViewer_ShrinkFilter, "$Revision$"); vtkStandardNewMacro(VTKViewer_ShrinkFilter); /*!Constructor. Sets store mapping to zero.*/ @@ -68,11 +67,11 @@ int VTKViewer_ShrinkFilter::RequestData( int i, j, numIds, abort=0; vtkIdType cellId, numCells, numPts; vtkIdType oldId, newId; - vtkFloatingPointType center[3], *p, pt[3]; + double center[3], *p, pt[3]; vtkPointData *pd, *outPD;; vtkIdList *ptIds, *newPtIds; vtkIdType tenth; - vtkFloatingPointType decimal; + double decimal; vtkDebugMacro(<<"Shrinking cells"); diff --git a/src/VTKViewer/VTKViewer_ShrinkFilter.h b/src/VTKViewer/VTKViewer_ShrinkFilter.h index a628778c4..6bbfa7618 100755 --- a/src/VTKViewer/VTKViewer_ShrinkFilter.h +++ b/src/VTKViewer/VTKViewer_ShrinkFilter.h @@ -41,7 +41,7 @@ class VTKVIEWER_EXPORT VTKViewer_ShrinkFilter : public vtkShrinkFilter public: /*!Create new instance of VTKViewer_ShrinkFilter.*/ static VTKViewer_ShrinkFilter *New(); - vtkTypeRevisionMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter); + vtkTypeMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter); void SetStoreMapping(int theStoreMapping); /*!Gets store mapping flag.*/ diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index 9f279af67..3818e59a2 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -59,7 +59,7 @@ VTKViewer_UnScaledActor::VTKViewer_UnScaledActor() /*! \return bounding box */ -vtkFloatingPointType* +double* VTKViewer_UnScaledActor ::GetBounds() { @@ -80,24 +80,24 @@ void VTKViewer_UnScaledActor::SetSize(int theSize) void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer) { if(theRenderer){ - vtkFloatingPointType P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; + double P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]); theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]); - vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+ + double aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+ (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+ (P[1][2]-P[0][2])*(P[1][2]-P[0][2])); int* aSize = theRenderer->GetRenderWindow()->GetSize(); - vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1])); + double aWinDiag = sqrt(double(aSize[0]*aSize[0]+aSize[1]*aSize[1])); vtkDataSet* aDataSet = GetMapper()->GetInput(); - aDataSet->Update(); - vtkFloatingPointType aLength = aDataSet->GetLength(); - vtkFloatingPointType aPrecision = 1.0E-3; - vtkFloatingPointType aZeroTol = 1.0E-12; - vtkFloatingPointType anOldScale = GetScale()[0]; - vtkFloatingPointType aScale = anOldScale; - vtkFloatingPointType aMaxSize = (vtkFloatingPointType)qMax(aSize[1],aSize[0]); + GetMapper()->Update(); + double aLength = aDataSet->GetLength(); + double aPrecision = 1.0E-3; + double aZeroTol = 1.0E-12; + double anOldScale = GetScale()[0]; + double aScale = anOldScale; + double aMaxSize = (double)qMax(aSize[1],aSize[0]); if (qAbs(aWinDiag) > aZeroTol && qAbs(aLength) > aZeroTol && qAbs(aMaxSize) > aZeroTol) - aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(qMin(aSize[1],aSize[0]))/aMaxSize); + aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(double(qMin(aSize[1],aSize[0]))/aMaxSize); if(qAbs(aScale) > aZeroTol && qAbs(aScale - anOldScale)/aScale > aPrecision){ SetScale(aScale); } @@ -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]); @@ -169,7 +169,7 @@ VTKViewer_Axis::VTKViewer_Axis() myLabelActor = vtkTextActor::New(); myLabelActor->SetMapper(myTextMapper); - myLabelActor->ScaledTextOff(); + myLabelActor->SetTextScaleModeToNone(); myLabelActor->PickableOff(); vtkCoordinate* aCoord = vtkCoordinate::New(); @@ -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]); @@ -308,12 +308,12 @@ void VTKViewer_Axis::SetColor(double theRed, double theGreen, double theBlue) /*! Set size of VTKViewer_Axis */ -void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize) +void VTKViewer_Axis::SetSize(double theSize) { - vtkFloatingPointType aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize}; + double aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize}; - vtkFloatingPointType aCoef = 0.99; - vtkFloatingPointType aLinePosition[3] = {aPosition[0]*aCoef, aPosition[1]*aCoef, aPosition[2]*aCoef}; + double aCoef = 0.99; + double aLinePosition[3] = {aPosition[0]*aCoef, aPosition[1]*aCoef, aPosition[2]*aCoef}; myLineSource->SetPoint2(aLinePosition); myArrowActor->SetPosition(0.0,0.0,0.0); @@ -438,7 +438,7 @@ VTKViewer_Trihedron::VTKViewer_Trihedron() myAxis[0] = VTKViewer_XAxis::New(); myAxis[1] = VTKViewer_YAxis::New(); myAxis[2] = VTKViewer_ZAxis::New(); - static vtkFloatingPointType aSize = 100; + static double aSize = 100; SetSize(aSize); } @@ -455,7 +455,7 @@ VTKViewer_Trihedron::~VTKViewer_Trihedron() /*! Set size of axes */ -void VTKViewer_Trihedron::SetSize(vtkFloatingPointType theSize) +void VTKViewer_Trihedron::SetSize(double theSize) { mySize = theSize; for(int i = 0; i < 3; i++) diff --git a/src/VTKViewer/VTKViewer_Trihedron.h b/src/VTKViewer/VTKViewer_Trihedron.h index c07aa4df9..9f3d6136f 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.h +++ b/src/VTKViewer/VTKViewer_Trihedron.h @@ -27,6 +27,7 @@ #include #include +#include class vtkRenderer; class vtkActorCollection; @@ -69,7 +70,7 @@ public: /*!Create new instance of VTKViewer_UnScaledActor.*/ static VTKViewer_UnScaledActor *New(); - virtual vtkFloatingPointType* GetBounds(); + virtual double* GetBounds(); virtual void SetSize(int theSize); virtual void Render(vtkRenderer *theRenderer); @@ -160,14 +161,14 @@ public: static VTKViewer_Trihedron *New(); /*!Sets size of trihedron. - * \param theSize - vtkFloatingPointType value + * \param theSize - double value */ - virtual void SetSize(vtkFloatingPointType theSize); + virtual void SetSize(double theSize); /*! Get size of trihedron. - * \retval mySize - vtkFloatingPointType value + * \retval mySize - double value */ - virtual vtkFloatingPointType GetSize() { return mySize;} + virtual double GetSize() { return mySize;} enum TVisibility{eOff, eOn, eOnlyLineOn}; @@ -215,7 +216,7 @@ protected: VTKViewer_Axis* myAxis[3]; /*! Common size for trihedron, for each axis.*/ - vtkFloatingPointType mySize; + double mySize; }; /*!The base class for concreate Axis. @@ -260,7 +261,7 @@ public: /*! Set size of VTKViewer_Axis */ - virtual void SetSize(vtkFloatingPointType theSize); + virtual void SetSize(double theSize); /*! Get label actor. * \retval Return myLabelActor. @@ -293,7 +294,7 @@ protected: /*! \var myRot[3] * Orientation vector */ - vtkFloatingPointType myDir[3], myRot[3]; + double myDir[3], myRot[3]; /*! VTKViewer_LineActor actor pointer */ diff --git a/src/VTKViewer/VTKViewer_Utilities.cxx b/src/VTKViewer/VTKViewer_Utilities.cxx index d8d7e0945..816684554 100755 --- a/src/VTKViewer/VTKViewer_Utilities.cxx +++ b/src/VTKViewer/VTKViewer_Utilities.cxx @@ -32,7 +32,7 @@ #include #include -/*!@see vtkRenderer::ResetCamera(vtkFloatingPointType bounds[6]) method*/ +/*!@see vtkRenderer::ResetCamera(double bounds[6]) method*/ void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) @@ -44,20 +44,20 @@ ResetCamera(vtkRenderer* theRenderer, if(!aCamera) return; - vtkFloatingPointType aBounds[6]; + double aBounds[6]; int aCount = ComputeVisiblePropBounds(theRenderer,aBounds); if(theUsingZeroFocalPoint || aCount){ - static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; - vtkFloatingPointType aLength = aBounds[1]-aBounds[0]; + double aLength = aBounds[1]-aBounds[0]; aLength = std::max((aBounds[3]-aBounds[2]),aLength); aLength = std::max((aBounds[5]-aBounds[4]),aLength); if(aLength < MIN_DISTANCE) return; - vtkFloatingPointType aWidth = + double aWidth = sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) + (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) + (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4])); @@ -65,10 +65,10 @@ ResetCamera(vtkRenderer* theRenderer, if(aWidth < MIN_DISTANCE) return; - vtkFloatingPointType aViewPlaneNormal[3]; + double aViewPlaneNormal[3]; aCamera->GetViewPlaneNormal(aViewPlaneNormal); - vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0}; + double aCenter[3] = {0.0, 0.0, 0.0}; if(!theUsingZeroFocalPoint){ aCenter[0] = (aBounds[0] + aBounds[1])/2.0; aCenter[1] = (aBounds[2] + aBounds[3])/2.0; @@ -76,11 +76,11 @@ ResetCamera(vtkRenderer* theRenderer, } aCamera->SetFocalPoint(aCenter[0],aCenter[1],aCenter[2]); - vtkFloatingPointType aViewAngle = aCamera->GetViewAngle(); - vtkFloatingPointType aDistance = 2.0*aWidth/tan(aViewAngle*vtkMath::Pi()/360.0); + double aViewAngle = aCamera->GetViewAngle(); + double aDistance = 2.0*aWidth/tan(aViewAngle*vtkMath::Pi()/360.0); // check view-up vector against view plane normal - vtkFloatingPointType aViewUp[3]; + double aViewUp[3]; aCamera->GetViewUp(aViewUp); if(fabs(vtkMath::Dot(aViewUp,aViewPlaneNormal)) > 0.999) aCamera->SetViewUp(-aViewUp[2], aViewUp[0], aViewUp[1]); @@ -93,7 +93,7 @@ ResetCamera(vtkRenderer* theRenderer, // find size of the window int* aWinSize = theRenderer->GetSize(); if(aWinSize[0] < aWinSize[1]) - aWidth *= vtkFloatingPointType(aWinSize[1])/vtkFloatingPointType(aWinSize[0]); + aWidth *= double(aWinSize[1])/double(aWinSize[0]); if(theUsingZeroFocalPoint) aWidth *= sqrt(2.0); @@ -107,7 +107,7 @@ ResetCamera(vtkRenderer* theRenderer, /*! Compute the bounds of the visible props*/ int ComputeVisiblePropBounds(vtkRenderer* theRenderer, - vtkFloatingPointType theBounds[6]) + double theBounds[6]) { int aCount = 0; @@ -124,9 +124,9 @@ ComputeVisiblePropBounds(vtkRenderer* theRenderer, if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(aProp)) if(anActor->IsInfinitive()) continue; - vtkFloatingPointType *aBounds = aProp->GetBounds(); - static vtkFloatingPointType MIN_DISTANCE = 1./VTK_LARGE_FLOAT; - static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; + double *aBounds = aProp->GetBounds(); + static double MIN_DISTANCE = 1./VTK_LARGE_FLOAT; + static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; if(abs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) { aBounds[0]-=0.001; @@ -165,7 +165,7 @@ ComputeVisiblePropBounds(vtkRenderer* theRenderer, return aCount; } -/*!@see vtkRenderer::ResetCameraClippingRange(vtkFloatingPointType bounds[6]) method*/ +/*!@see vtkRenderer::ResetCameraClippingRange(double bounds[6]) method*/ void ResetCameraClippingRange(vtkRenderer* theRenderer) { @@ -177,29 +177,29 @@ ResetCameraClippingRange(vtkRenderer* theRenderer) } // Find the plane equation for the camera view plane - vtkFloatingPointType vn[3]; + double vn[3]; anActiveCamera->GetViewPlaneNormal(vn); - vtkFloatingPointType position[3]; + double position[3]; anActiveCamera->GetPosition(position); - vtkFloatingPointType bounds[6]; + double bounds[6]; //theRenderer->ComputeVisiblePropBounds(bounds); ComputeVisiblePropBounds(theRenderer, bounds); - vtkFloatingPointType center[3]; + double center[3]; center[0] = (bounds[0] + bounds[1])/2.0; center[1] = (bounds[2] + bounds[3])/2.0; center[2] = (bounds[4] + bounds[5])/2.0; - vtkFloatingPointType width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) + + double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) + (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) + (bounds[5]-bounds[4])*(bounds[5]-bounds[4])); - vtkFloatingPointType distance = sqrt((position[0]-center[0])*(position[0]-center[0]) + + double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) + (position[1]-center[1])*(position[1]-center[1]) + (position[2]-center[2])*(position[2]-center[2])); - vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0}; + double range[2] = {distance - width/2.0, distance + width/2.0}; // Do not let the range behind the camera throw off the calculation. if (range[0] < 0.0) range[0] = 0.0; @@ -210,24 +210,24 @@ ResetCameraClippingRange(vtkRenderer* theRenderer) /*!Compute trihedron size.*/ bool ComputeTrihedronSize( vtkRenderer* theRenderer, - vtkFloatingPointType& theNewSize, - const vtkFloatingPointType theSize, - const vtkFloatingPointType theSizeInPercents ) + double& theNewSize, + const double theSize, + const double theSizeInPercents ) { // calculating diagonal of visible props of the renderer - vtkFloatingPointType bnd[ 6 ]; + double bnd[ 6 ]; if ( ComputeVisiblePropBounds( theRenderer, bnd ) == 0 ) { bnd[ 1 ] = bnd[ 3 ] = bnd[ 5 ] = 100; bnd[ 0 ] = bnd[ 2 ] = bnd[ 4 ] = 0; } - vtkFloatingPointType aLength = 0; + double aLength = 0; aLength = bnd[ 1 ]-bnd[ 0 ]; aLength = std::max( ( bnd[ 3 ] - bnd[ 2 ] ),aLength ); aLength = std::max( ( bnd[ 5 ] - bnd[ 4 ] ),aLength ); - static vtkFloatingPointType EPS_SIZE = 5.0E-3; + static double EPS_SIZE = 5.0E-3; theNewSize = aLength * theSizeInPercents / 100.0; // if the new trihedron size have sufficient difference, then apply the value @@ -240,7 +240,7 @@ bool IsBBEmpty(vtkRenderer* theRenderer) if(!theRenderer) return false; - vtkFloatingPointType aNewBndBox[6]; + double aNewBndBox[6]; aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT; aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT; @@ -254,7 +254,7 @@ bool IsBBEmpty(vtkRenderer* theRenderer) if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(anAct)) if(anActor->GetVisibility() && !anActor->IsInfinitive()) { - vtkFloatingPointType *aBounds = anActor->GetBounds(); + double *aBounds = anActor->GetBounds(); if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT && aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT && aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT) @@ -264,14 +264,14 @@ bool IsBBEmpty(vtkRenderer* theRenderer) return !isAny; } -bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]) +bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3]) { theCenter[0] = theCenter[1] = theCenter[2] = 0.0; if(!theRenderer) return false; - vtkFloatingPointType aNewBndBox[6]; + double aNewBndBox[6]; aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT; aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT; @@ -287,7 +287,7 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3] { if(anActor->GetVisibility() && !anActor->IsInfinitive()) { - vtkFloatingPointType *aBounds = anActor->GetBounds(); + double *aBounds = anActor->GetBounds(); if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT && aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT && aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT) @@ -314,16 +314,16 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3] aNewBndBox[2] > -VTK_LARGE_FLOAT && aNewBndBox[3] < VTK_LARGE_FLOAT && aNewBndBox[4] > -VTK_LARGE_FLOAT && aNewBndBox[5] < VTK_LARGE_FLOAT) { - static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; - vtkFloatingPointType aLength = aNewBndBox[1]-aNewBndBox[0]; + double aLength = aNewBndBox[1]-aNewBndBox[0]; aLength = std::max((aNewBndBox[3]-aNewBndBox[2]),aLength); aLength = std::max((aNewBndBox[5]-aNewBndBox[4]),aLength); if(aLength < MIN_DISTANCE) return false; - vtkFloatingPointType aWidth = + double aWidth = sqrt((aNewBndBox[1]-aNewBndBox[0])*(aNewBndBox[1]-aNewBndBox[0]) + (aNewBndBox[3]-aNewBndBox[2])*(aNewBndBox[3]-aNewBndBox[2]) + (aNewBndBox[5]-aNewBndBox[4])*(aNewBndBox[5]-aNewBndBox[4])); @@ -340,23 +340,23 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3] return false; /* - vtkFloatingPointType aBounds[6]; + double aBounds[6]; int aCount = ComputeVisiblePropBounds(theRenderer,aBounds); printf("aNewBndBox[0] = %f, aNewBndBox[1] = %f,\naNewBndBox[2] = %f, aNewBndBox[3] = %f,\naNewBndBox[4] = %f, aNewBndBox[5] = %f\n", aBounds[0],aBounds[1],aBounds[2],aBounds[3],aBounds[4],aBounds[5]); printf("aCount = %d\n",aCount); if(aCount){ - static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; - vtkFloatingPointType aLength = aBounds[1]-aBounds[0]; + double aLength = aBounds[1]-aBounds[0]; aLength = max((aBounds[3]-aBounds[2]),aLength); aLength = max((aBounds[5]-aBounds[4]),aLength); if(aLength < MIN_DISTANCE) return false; - vtkFloatingPointType aWidth = + double aWidth = sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) + (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) + (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4])); diff --git a/src/VTKViewer/VTKViewer_Utilities.h b/src/VTKViewer/VTKViewer_Utilities.h index 1ddf940bf..87db690d5 100755 --- a/src/VTKViewer/VTKViewer_Utilities.h +++ b/src/VTKViewer/VTKViewer_Utilities.h @@ -37,7 +37,7 @@ VTKVIEWER_EXPORT extern int ComputeVisiblePropBounds(vtkRenderer* theRenderer, - vtkFloatingPointType theBounds[6]); + double theBounds[6]); VTKVIEWER_EXPORT extern @@ -47,9 +47,9 @@ VTKVIEWER_EXPORT extern bool ComputeTrihedronSize(vtkRenderer* theRenderer, - vtkFloatingPointType& theNewSize, - const vtkFloatingPointType theSize, - const vtkFloatingPointType theSizeInPercents); + double& theNewSize, + const double theSize, + const double theSizeInPercents); VTKVIEWER_EXPORT extern @@ -57,5 +57,5 @@ bool IsBBEmpty(vtkRenderer* theRenderer); VTKVIEWER_EXPORT extern bool ComputeBBCenter(vtkRenderer* theRenderer, - vtkFloatingPointType theCenter[3]); + double theCenter[3]); #endif diff --git a/src/VTKViewer/VTKViewer_ViewWindow.cxx b/src/VTKViewer/VTKViewer_ViewWindow.cxx index fcafdae31..d72b4643d 100755 --- a/src/VTKViewer/VTKViewer_ViewWindow.cxx +++ b/src/VTKViewer/VTKViewer_ViewWindow.cxx @@ -434,7 +434,7 @@ void VTKViewer_ViewWindow::onResetView() ::ResetCamera(myRenderer,true); if(aTriedronIsVisible) myTrihedron->VisibilityOn(); else myTrihedron->VisibilityOff(); - static vtkFloatingPointType aCoeff = 3.0; + static double aCoeff = 3.0; aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale()); Repaint(); } @@ -634,11 +634,11 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){ int aVisibleNum = myTrihedron->GetVisibleActorCount(myRenderer); if(aVisibleNum){ // calculating diagonal of visible props of the renderer - vtkFloatingPointType bnd[6]; + double bnd[6]; myTrihedron->VisibilityOff(); ::ComputeVisiblePropBounds(myRenderer,bnd); myTrihedron->VisibilityOn(); - vtkFloatingPointType aLength = 0; + double aLength = 0; static bool CalcByDiag = false; if(CalcByDiag){ aLength = sqrt((bnd[1]-bnd[0])*(bnd[1]-bnd[0])+ @@ -650,13 +650,13 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){ aLength = qMax((bnd[5]-bnd[4]),aLength); } - static vtkFloatingPointType aSizeInPercents = 105; + static double aSizeInPercents = 105; QString aSetting;// = SUIT_CONFIG->getSetting("Viewer:TrihedronSize"); if(!aSetting.isEmpty()) aSizeInPercents = aSetting.toFloat(); - static vtkFloatingPointType EPS_SIZE = 5.0E-3; - vtkFloatingPointType aSize = myTrihedron->GetSize(); - vtkFloatingPointType aNewSize = aLength*aSizeInPercents/100.0; + static double EPS_SIZE = 5.0E-3; + double aSize = myTrihedron->GetSize(); + double aNewSize = aLength*aSizeInPercents/100.0; // if the new trihedron size have sufficient difference, then apply the value if(fabs(aNewSize-aSize) > aSize*EPS_SIZE || fabs(aNewSize-aSize) > aNewSize*EPS_SIZE){ myTrihedron->SetSize(aNewSize); diff --git a/tools/vtkEDFOverloads/vtkEDFCutter.cxx b/tools/vtkEDFOverloads/vtkEDFCutter.cxx index 3de2a04f8..cafe013e9 100755 --- a/tools/vtkEDFOverloads/vtkEDFCutter.cxx +++ b/tools/vtkEDFOverloads/vtkEDFCutter.cxx @@ -88,7 +88,6 @@ bool operator < (const vtkEDFEdge& e0, const vtkEDFEdge& e1) } vtkStandardNewMacro(vtkEDFCutter); -vtkCxxRevisionMacro(vtkEDFCutter, "0.0"); vtkEDFCutter::vtkEDFCutter() { diff --git a/tools/vtkEDFOverloads/vtkEDFCutter.h b/tools/vtkEDFOverloads/vtkEDFCutter.h index 66cc6a9b6..559354e1b 100755 --- a/tools/vtkEDFOverloads/vtkEDFCutter.h +++ b/tools/vtkEDFOverloads/vtkEDFCutter.h @@ -27,7 +27,7 @@ class VTKTOOLS_EXPORT vtkEDFCutter : public vtkCutter { public : static vtkEDFCutter* New(); - vtkTypeRevisionMacro(vtkEDFCutter, vtkCutter); + vtkTypeMacro(vtkEDFCutter, vtkCutter); void PrintSelf(ostream& os, vtkIndent indent); // Description: -- 2.30.2