From aad2d12a7c1331ac104cc57a450bb0dfade9af77 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 30 Jan 2013 12:30:57 +0000 Subject: [PATCH] Porting to VTK 6. Compilation with ParaView built without option "-DVTK_LEGACY_REMOVE:BOOL=OFF". --- src/GEOMGUI/GEOM_Displayer.cxx | 2 +- src/OBJECT/GEOM_Actor.cxx | 18 ++++++------- src/OBJECT/GEOM_Actor.h | 14 +++++----- src/OBJECT/GEOM_VTKTrihedron.cxx | 26 +++++++++---------- src/OBJECT/GEOM_VTKTrihedron.hxx | 20 +++++++------- src/OperationGUI/OperationGUI_ClippingDlg.cxx | 10 +++---- 6 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 873c61f7c..dd716f4d6 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -1192,7 +1192,7 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs ) aProps.push_back( material.getMaterialVTKProperty( false) ); aGeomGActor->SetMaterial(aProps); - vtkFloatingPointType aColor[3] = {1.,0.,0.}; + double aColor[3] = {1.,0.,0.}; if ( useObjCol ) { //Get Color from geom object Handle( SALOME_InteractiveObject ) anIO = aGeomGActor->getIO(); if ( !anIO.IsNull() ) { diff --git a/src/OBJECT/GEOM_Actor.cxx b/src/OBJECT/GEOM_Actor.cxx index 6c92ed63d..4797f8092 100644 --- a/src/OBJECT/GEOM_Actor.cxx +++ b/src/OBJECT/GEOM_Actor.cxx @@ -578,10 +578,10 @@ void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *theMapper) /* if(myShape.ShapeType() == TopAbs_VERTEX) { if(ren){ //The parameter determine size of vertex actor relate to diagonal of RendererWindow - static vtkFloatingPointType delta = 0.01; - vtkFloatingPointType X1 = -1, Y1 = -1, Z1 = 0; + static double delta = 0.01; + double X1 = -1, Y1 = -1, Z1 = 0; ren->ViewToWorld(X1,Y1,Z1); - vtkFloatingPointType X2 = +1, Y2 = +1, Z2 = 0; + double X2 = +1, Y2 = +1, Z2 = 0; ren->ViewToWorld(X2,Y2,Z2); Z2 = sqrt((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1) + (Z2-Z1)*(Z2-Z1)); this->SetScale(Z2*delta); @@ -673,7 +673,7 @@ void GEOM_Actor::highlight(bool highlight) SALOME_Actor::highlight(highlight); } -void GEOM_Actor::SetOpacity(vtkFloatingPointType opa) +void GEOM_Actor::SetOpacity(double opa) { // enk:tested OK myShadingFaceProp->SetOpacity(opa); @@ -683,13 +683,13 @@ void GEOM_Actor::SetOpacity(vtkFloatingPointType opa) myVertexActor->GetProperty()->SetOpacity(opa); } -vtkFloatingPointType GEOM_Actor::GetOpacity() +double GEOM_Actor::GetOpacity() { // enk:tested OK return myShadingFaceProp->GetOpacity(); } -void GEOM_Actor::SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) +void GEOM_Actor::SetColor(double r,double g,double b) { // enk:tested OK myShadingFaceProp->SetColor(r,g,b); // shading color (Shading) @@ -704,10 +704,10 @@ void GEOM_Actor::SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloat StoreBoundaryColors(); } -void GEOM_Actor::GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) +void GEOM_Actor::GetColor(double& r,double& g,double& b) { // enk:tested OK - vtkFloatingPointType aRGB[3]; + double aRGB[3]; myShadingFaceProp->GetColor(aRGB); r = aRGB[0]; g = aRGB[1]; @@ -995,7 +995,7 @@ void GEOM_Actor::GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result) this->Transform->Pop(); } -void GEOM_Actor::SetEdgesInShadingColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) +void GEOM_Actor::SetEdgesInShadingColor(double r,double g,double b) { myEdgesInShadingColor[0] = r; myEdgesInShadingColor[1] = g; diff --git a/src/OBJECT/GEOM_Actor.h b/src/OBJECT/GEOM_Actor.h index f3acde303..8f30e8588 100644 --- a/src/OBJECT/GEOM_Actor.h +++ b/src/OBJECT/GEOM_Actor.h @@ -117,12 +117,12 @@ public: void ShallowCopy(vtkProp *prop); // Opacity - void SetOpacity(vtkFloatingPointType opa); - vtkFloatingPointType GetOpacity(); + void SetOpacity(double opa); + double GetOpacity(); // Color - void SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b); - void GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b); + void SetColor(double r,double g,double b); + void GetColor(double& r,double& g,double& b); // Material void SetMaterial(std::vector theProps); @@ -186,7 +186,7 @@ public: GetVectorMode(); //! Edges in shading color management - void SetEdgesInShadingColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b); + void SetEdgesInShadingColor(double r,double g,double b); void StoreIsoNumbers(); @@ -252,8 +252,8 @@ private: GEOM_Actor(const GEOM_Actor&); void operator=(const GEOM_Actor&); - vtkFloatingPointType myEdgesInWireframeColor[3]; - vtkFloatingPointType myEdgesInShadingColor[3]; + double myEdgesInWireframeColor[3]; + double myEdgesInShadingColor[3]; }; #endif //GEOM_ACTOR_H diff --git a/src/OBJECT/GEOM_VTKTrihedron.cxx b/src/OBJECT/GEOM_VTKTrihedron.cxx index e984c7d54..74bf48e0c 100644 --- a/src/OBJECT/GEOM_VTKTrihedron.cxx +++ b/src/OBJECT/GEOM_VTKTrihedron.cxx @@ -66,15 +66,15 @@ public: vtkTypeMacro( GEOM_VTKTrihedronAxis, VTKViewer_Axis ); static GEOM_VTKTrihedronAxis* New(); - void SetAxis( const gp_Ax1& theAxis, const int theRot, vtkFloatingPointType theColor[ 3 ] ); + void SetAxis( const gp_Ax1& theAxis, const int theRot, double theColor[ 3 ] ); virtual void Render( vtkRenderer* theRenderer ); - virtual void SetSize( vtkFloatingPointType theSize ); + virtual void SetSize( double theSize ); gp_Pnt GetOri() const; - void SetColor( const vtkFloatingPointType theColor[ 3 ] ); + void SetColor( const double theColor[ 3 ] ); private: - vtkFloatingPointType myOri[ 3 ]; + double myOri[ 3 ]; vtkMatrix4x4* myMatrix; vtkTransform* myTrsf; }; @@ -94,9 +94,9 @@ GEOM_VTKTrihedronAxis::~GEOM_VTKTrihedronAxis() myTrsf->Delete(); } -void GEOM_VTKTrihedronAxis::SetSize( vtkFloatingPointType theSize ) +void GEOM_VTKTrihedronAxis::SetSize( double theSize ) { - vtkFloatingPointType aPosition[ 3 ] = { myOri[ 0 ] + myDir[ 0 ] * theSize, + double aPosition[ 3 ] = { myOri[ 0 ] + myDir[ 0 ] * theSize, myOri[ 1 ] + myDir[ 1 ] * theSize, myOri[ 2 ] + myDir[ 2 ] * theSize }; @@ -154,7 +154,7 @@ gp_Pnt GEOM_VTKTrihedronAxis::GetOri() const void GEOM_VTKTrihedronAxis::SetAxis( const gp_Ax1& theAxis, const int theRot, - vtkFloatingPointType theColor[ 3 ] ) + double theColor[ 3 ] ) { gp_Pnt aLoc = theAxis.Location(); gp_Dir aDir = theAxis.Direction(); @@ -167,7 +167,7 @@ void GEOM_VTKTrihedronAxis::SetAxis( const gp_Ax1& theAxis, myDir[ 1 ] = aDir.Y(); myDir[ 2 ] = aDir.Z(); - vtkFloatingPointType aColor[ 3 ] = { 0, 0, 0 }; + double aColor[ 3 ] = { 0, 0, 0 }; aColor[ theRot ] = 1; if ( theColor[ 0 ] == -1 ) VTKViewer_Axis::SetColor( aColor[ 0 ], aColor[ 1 ], aColor[ 2 ] ); @@ -185,7 +185,7 @@ void GEOM_VTKTrihedronAxis::SetAxis( const gp_Ax1& theAxis, #endif } -void GEOM_VTKTrihedronAxis::SetColor( const vtkFloatingPointType theColor[ 3 ] ) +void GEOM_VTKTrihedronAxis::SetColor( const double theColor[ 3 ] ) { VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] ); } @@ -227,7 +227,7 @@ GEOM_VTKTrihedron::~GEOM_VTKTrihedron() myMapper->Delete(); } -void GEOM_VTKTrihedron::SetSize( vtkFloatingPointType theSize ) +void GEOM_VTKTrihedron::SetSize( double theSize ) { mySize = theSize; for ( int i = 0; i < 3; i++ ) @@ -362,7 +362,7 @@ void GEOM_VTKTrihedron::Render(vtkRenderer* r, vtkMapper *) ( (GEOM_VTKTrihedronAxis*)myAxis[ 2 ] )->Render( r ); } -void GEOM_VTKTrihedron::SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b ) +void GEOM_VTKTrihedron::SetColor( double r, double g, double b ) { myColor[ 0 ] = r; myColor[ 1 ] = g; @@ -373,7 +373,7 @@ void GEOM_VTKTrihedron::SetColor( vtkFloatingPointType r, vtkFloatingPointType g if ( myAxis[ 2 ] ) ( (GEOM_VTKTrihedronAxis*)myAxis[ 2 ] )->SetColor( myColor ); } -void GEOM_VTKTrihedron::GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b ) +void GEOM_VTKTrihedron::GetColor( double& r, double& g, double& b ) { r = myColor[ 0 ]; g = myColor[ 1 ]; @@ -426,7 +426,7 @@ void GEOM_VTKTrihedron::ResetAxesColors() SetAxesColors( myDefaultColor, true ); } -void GEOM_VTKTrihedron::SetAxesColors( vtkFloatingPointType theColor[3], bool theIsDiffuse ) +void GEOM_VTKTrihedron::SetAxesColors( double theColor[3], bool theIsDiffuse ) { myAxis[ 0 ]->SetColor( theColor[0], theIsDiffuse ? 0.0 : theColor[1], theIsDiffuse ? 0.0 : theColor[2] ); myAxis[ 1 ]->SetColor( theIsDiffuse ? 0.0 : theColor[0], theColor[1], theIsDiffuse ? 0.0 : theColor[2] ); diff --git a/src/OBJECT/GEOM_VTKTrihedron.hxx b/src/OBJECT/GEOM_VTKTrihedron.hxx index 897312ae0..34b97d17c 100644 --- a/src/OBJECT/GEOM_VTKTrihedron.hxx +++ b/src/OBJECT/GEOM_VTKTrihedron.hxx @@ -55,7 +55,7 @@ public: vtkTypeMacro( GEOM_VTKTrihedron, SALOME_Actor ); static GEOM_VTKTrihedron* New(); - virtual vtkFloatingPointType GetSize() { return mySize;} + virtual double GetSize() { return mySize;} virtual void SetVisibility( int theVisibility ); virtual void SetVisibility( VTKViewer_Trihedron::TVisibility theVis ); @@ -74,11 +74,11 @@ public: virtual void Render(vtkRenderer *, vtkMapper *); virtual bool IsSetCamera() const; virtual bool IsResizable() const; - virtual void SetSize( vtkFloatingPointType ); + virtual void SetSize( double ); virtual void SetCamera( vtkCamera* ); - void SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b ); - void GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b ); + void SetColor( double r, double g, double b ); + void GetColor( double& r, double& g, double& b ); virtual bool hasHighlight() { return true; } @@ -89,18 +89,18 @@ public: protected: virtual void ResetAxesColors(); - virtual void SetAxesColors( vtkFloatingPointType theColor[3], bool theIsDiffuse = false ); + virtual void SetAxesColors( double theColor[3], bool theIsDiffuse = false ); protected: VTKViewer_Axis* myAxis[3]; vtkPolyDataMapper* myMapper; - vtkFloatingPointType mySize; + double mySize; gp_Pnt myLocation; gp_Dir myDirX, myDirY, myDirZ; - vtkFloatingPointType myColor[ 3 ]; - vtkFloatingPointType myDefaultColor[ 3 ]; - vtkFloatingPointType myPreHighlightColor[ 3 ]; - vtkFloatingPointType myHighlightColor[ 3 ]; + double myColor[ 3 ]; + double myDefaultColor[ 3 ]; + double myPreHighlightColor[ 3 ]; + double myHighlightColor[ 3 ]; }; #endif diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.cxx b/src/OperationGUI/OperationGUI_ClippingDlg.cxx index 9e93a9cdb..47f8b5b04 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.cxx +++ b/src/OperationGUI/OperationGUI_ClippingDlg.cxx @@ -154,7 +154,7 @@ void OperationGUI_ClippingDlg::Init() double position[3]; anActiveCamera->GetPosition( position ); - vtkFloatingPointType bounds[6]; + double bounds[6]; aRenderer->ComputeVisiblePropBounds( bounds ); double center[3]; @@ -170,7 +170,7 @@ void OperationGUI_ClippingDlg::Init() ( 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 }; SpinBox_Near->setValue( range[0] ); SpinBox_Far->setValue( range[1] ); @@ -220,7 +220,7 @@ bool OperationGUI_ClippingDlg::ClickOnApply() return false; } - vtkFloatingPointType range[2] = { SpinBox_Near->value(), SpinBox_Far->value() }; + double range[2] = { SpinBox_Near->value(), SpinBox_Far->value() }; if ( range[0] < 0.0 ) range[0] = 0.0; anActiveCamera->SetClippingRange( range ); @@ -302,7 +302,7 @@ void OperationGUI_ClippingDlg::onReset() double position[3]; anActiveCamera->GetPosition( position ); - vtkFloatingPointType bounds[6]; + double bounds[6]; aRenderer->ComputeVisiblePropBounds( bounds ); double center[3]; @@ -318,7 +318,7 @@ void OperationGUI_ClippingDlg::onReset() ( 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 }; SpinBox_Near->setValue( range[0] ); SpinBox_Far->setValue( range[1] ); -- 2.39.2