From 10ea34f55f8fb8a5364cc981087a55e0c3e1d9ec Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 7 Apr 2006 12:07:15 +0000 Subject: [PATCH] Porting on Mandriva 64 --- src/CONVERTOR/VISU_Convertor.hxx | 14 +- src/CONVERTOR/VISU_Convertor_impl.cxx | 124 +++---- src/CONVERTOR/VISU_Convertor_impl.hxx | 20 +- src/CONVERTOR/VISU_IDMapper.cxx | 2 +- src/CONVERTOR/VISU_IDMapper.hxx | 2 +- src/CONVERTOR/VISU_MedConvertor.cxx | 14 +- src/OBJECT/VISU_Actor.cxx | 28 +- src/OBJECT/VISU_Actor.h | 14 +- src/OBJECT/VISU_GaussPtsAct.cxx | 60 +-- src/OBJECT/VISU_GaussPtsAct.h | 16 +- src/OBJECT/VISU_GaussPtsDeviceActor.cxx | 54 +-- src/OBJECT/VISU_GaussPtsDeviceActor.h | 50 +-- src/OBJECT/VISU_GaussPtsSettings.h | 84 ++--- src/OBJECT/VISU_MeshAct.cxx | 10 +- src/OBJECT/VISU_MeshAct.h | 10 +- src/PIPELINE/SALOME_ExtractGeometry.cxx | 6 +- src/PIPELINE/VISU_CutLinesPL.cxx | 63 +++- src/PIPELINE/VISU_CutLinesPL.hxx | 77 +++- src/PIPELINE/VISU_CutPlanesPL.cxx | 196 +++++++--- src/PIPELINE/VISU_CutPlanesPL.hxx | 186 +++++++--- src/PIPELINE/VISU_DeformedShapePL.cxx | 59 ++- src/PIPELINE/VISU_DeformedShapePL.hxx | 51 ++- src/PIPELINE/VISU_Extractor.cxx | 6 +- src/PIPELINE/VISU_FieldTransform.cxx | 40 +- src/PIPELINE/VISU_FieldTransform.hxx | 10 +- src/PIPELINE/VISU_GaussPointsPL.cxx | 74 ++-- src/PIPELINE/VISU_GaussPointsPL.hxx | 72 ++-- src/PIPELINE/VISU_ImplicitFunctionWidget.cxx | 24 +- src/PIPELINE/VISU_ImplicitFunctionWidget.hxx | 6 +- src/PIPELINE/VISU_IsoSurfacesPL.cxx | 74 +++- src/PIPELINE/VISU_IsoSurfacesPL.hxx | 67 +++- src/PIPELINE/VISU_LookupTable.cxx | 96 +++-- src/PIPELINE/VISU_LookupTable.hxx | 12 +- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 8 +- src/PIPELINE/VISU_PipeLine.cxx | 76 ++-- src/PIPELINE/VISU_PipeLine.hxx | 18 +- src/PIPELINE/VISU_PipeLineUtils.cxx | 12 +- src/PIPELINE/VISU_PipeLineUtils.hxx | 14 +- src/PIPELINE/VISU_PlanesWidget.cxx | 151 ++++---- src/PIPELINE/VISU_PlanesWidget.hxx | 101 ++++-- src/PIPELINE/VISU_Plot3DPL.cxx | 61 ++-- src/PIPELINE/VISU_Plot3DPL.hxx | 31 +- src/PIPELINE/VISU_ScalarBarActor.cxx | 26 +- src/PIPELINE/VISU_ScalarBarActor.hxx | 2 +- src/PIPELINE/VISU_ScalarBarCtrl.cxx | 46 +-- src/PIPELINE/VISU_ScalarBarCtrl.hxx | 155 +++++--- .../VISU_ScalarMapOnDeformedShapePL.cxx | 83 +++-- .../VISU_ScalarMapOnDeformedShapePL.hxx | 10 +- src/PIPELINE/VISU_ScalarMapPL.cxx | 24 +- src/PIPELINE/VISU_ScalarMapPL.hxx | 14 +- src/PIPELINE/VISU_SphereWidget.cxx | 28 +- src/PIPELINE/VISU_SphereWidget.hxx | 24 +- src/PIPELINE/VISU_StreamLinesPL.cxx | 341 ++++++++++++------ src/PIPELINE/VISU_StreamLinesPL.hxx | 223 +++++++++--- src/PIPELINE/VISU_VectorsPL.cxx | 6 +- src/PIPELINE/VISU_VectorsPL.hxx | 85 ++++- src/PIPELINE/VISU_WidgetCtrl.cxx | 13 +- src/PIPELINE/VISU_WidgetCtrl.hxx | 18 +- src/VISUGUI/VisuGUI_ClippingDlg.cxx | 100 ++--- src/VISUGUI/VisuGUI_CutLinesDlg.cxx | 14 +- src/VISUGUI/VisuGUI_GaussPointsDlg.cxx | 2 +- src/VISUGUI/VisuGUI_Module.cxx | 34 +- src/VISUGUI/VisuGUI_OffsetDlg.cxx | 54 +-- src/VISUGUI/VisuGUI_OffsetDlg.h | 26 +- src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 14 +- src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 18 +- .../VisuGUI_ScalarMapOnDeformedShapeDlg.cxx | 2 +- src/VISUGUI/VisuGUI_Selection.cxx | 14 +- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 40 +- src/VISUGUI/VisuGUI_TimeAnimation.h | 5 +- src/VISUGUI/VisuGUI_Tools.cxx | 42 +-- src/VISU_I/VISU_ColoredPrs3d_i.cc | 22 +- src/VISU_I/VISU_ColoredPrs3d_i.hh | 22 +- src/VISU_I/VISU_CorbaMedConvertor.cxx | 1 - src/VISU_I/VISU_CutLines_i.cc | 32 +- src/VISU_I/VISU_GaussPoints_i.cc | 56 +-- src/VISU_I/VISU_GaussPoints_i.hh | 40 +- src/VISU_I/VISU_IsoSurfaces_i.cc | 5 +- src/VISU_I/VISU_Prs3d_i.cc | 22 +- src/VISU_I/VISU_Prs3d_i.hh | 20 +- src/VISU_I/VISU_Result_i.cc | 44 +-- src/VISU_I/VISU_Result_i.hh | 14 +- src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc | 18 +- src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh | 8 +- src/VISU_I/VISU_ScalarMap_i.cc | 6 +- src/VISU_I/VISU_TimeAnimation.h | 5 +- src/VISU_I/VISU_View_i.cc | 6 +- src/VVTK/VVTK_PickingDlg.cxx | 6 +- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 28 +- src/VVTK/VVTK_SizeBox.cxx | 2 - 90 files changed, 2421 insertions(+), 1492 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index 304f7de3..4dc7b49c 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -181,7 +181,7 @@ namespace VISU //--------------------------------------------------------------- typedef std::map TValField; - typedef std::pair TMinMax; + typedef std::pair TMinMax; //! Define a basic class for MED FIELD entity struct TField: virtual TIntId @@ -308,7 +308,7 @@ public: //! Get amount of memory to build VTK representations for all existing MED entities virtual - float + vtkFloatingPointType GetSize() = 0; //! Get mesh for corresponding MED ENTITY @@ -319,7 +319,7 @@ public: //! Get amount of memory to build mesh for corresponding MED ENTITY virtual - float + vtkFloatingPointType GetMeshOnEntitySize(const std::string& theMeshName, const VISU::TEntity& theEntity) = 0; @@ -332,7 +332,7 @@ public: //! Get amount of memory to build mesh for corresponding MED FAMILY virtual - float + vtkFloatingPointType GetFamilyOnEntitySize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFamilyName) = 0; @@ -345,7 +345,7 @@ public: //! Get amount of memory to build mesh for corresponding MED GROUP virtual - float + vtkFloatingPointType GetMeshOnGroupSize(const std::string& theMeshName, const std::string& theGroupName) = 0; @@ -367,7 +367,7 @@ public: //! Get amount of memory to build mesh for corresponding MED TIMESTAMP virtual - float + vtkFloatingPointType GetTimeStampSize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFieldName, @@ -375,7 +375,7 @@ public: //! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD virtual - float + vtkFloatingPointType GetFieldOnMeshSize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFieldName) = 0; diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 8d1fe336..a5ceb931 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -28,13 +28,13 @@ #include "VISU_ConvertorUtils.hxx" #include "VTKViewer_AppendFilter.h" #include "VISU_MergeFilter.hxx" +#include "VTKViewer_CellLocationsArray.h" #include #include #include #include -#include #include #include #include @@ -52,7 +52,7 @@ using namespace std; using namespace VISU; -static float ERR_SIZE_CALC = 1.00; +static vtkFloatingPointType ERR_SIZE_CALC = 1.00; static int MYVTKDEBUG = 0; @@ -308,7 +308,7 @@ namespace VISU return myNamedPointCoords->GetVTKID(theID); } - float* + vtkFloatingPointType* TProfileImpl ::GetNodeCoord(vtkIdType theObjID) { @@ -429,7 +429,7 @@ namespace VISU return myIDMapper.GetNodeVTKID(theID); } - float* + vtkFloatingPointType* TIDMapperFilter ::GetNodeCoord(vtkIdType theObjID) { @@ -1208,7 +1208,7 @@ namespace } vtkIdType *pts = 0, npts = 0; - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); aConnectivity->InitTraversal(); @@ -1282,7 +1282,7 @@ namespace } } vtkIdType *pts = 0, npts = 0; - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); aConnectivity->InitTraversal(); @@ -1445,7 +1445,7 @@ namespace } vtkIdType *pts = 0, npts = 0; - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); @@ -1581,7 +1581,7 @@ namespace endl); int aSize = max(3,aNbComp); - TVector aDataValues(aSize,0.0); + TVector aDataValues(aSize,0.0); const TGeom2Value& aGeom2Value = theValForTime->myGeom2Value; @@ -1674,7 +1674,7 @@ namespace for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){ TCCoordSlice aSlice = aCoords.GetCoordSlice(aPointId); - float aCoords[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0}; for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++) aCoords[aDimId] = aSlice[aDimId]; @@ -1686,7 +1686,7 @@ namespace } anIdList->Delete(); - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); @@ -1774,15 +1774,15 @@ namespace PrintMemorySize(vtkUnstructuredGrid* theDataSet) { theDataSet->Update(); - BEGMSG(1,"GetPoints() = "<GetPoints()->GetActualMemorySize()*1000)<myNbPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link)); aLinksSize = 0; vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize; MSG(MYDEBUG,"GetFamilyOnEntitySize "<< - "- aResult = "<myNbPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short)); aLinksSize = 0; vtkIdType aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize; if(MYDEBUG){ - MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aPointsSize = "<(aFindField); PFieldImpl aField = boost::get<3>(aFindField); - float aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); - float aFieldOnMeshSize = float(aField->myDataSize*sizeof(float)*aField->myValField.size()*ERR_SIZE_CALC); - float aResult = aMeshSize + aFieldOnMeshSize; + vtkFloatingPointType aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); + vtkFloatingPointType aFieldOnMeshSize = vtkFloatingPointType(aField->myDataSize*sizeof(vtkFloatingPointType)*aField->myValField.size()*ERR_SIZE_CALC); + vtkFloatingPointType aResult = aMeshSize + aFieldOnMeshSize; if(MYDEBUG) - MSG(MYVTKDEBUG,"GetFieldOnMeshSize - aFieldOnMeshSize = "<(aFindTimeStamp); PFieldImpl aField = boost::get<3>(aFindTimeStamp); - float aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); - float aTimeStampSize = float(aField->myDataSize*sizeof(float) * ERR_SIZE_CALC); - float aResult = aMeshSize + aTimeStampSize; + vtkFloatingPointType aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); + vtkFloatingPointType aTimeStampSize = vtkFloatingPointType(aField->myDataSize*sizeof(vtkFloatingPointType) * ERR_SIZE_CALC); + vtkFloatingPointType aResult = aMeshSize + aTimeStampSize; - MSG(MYDEBUG && MYVTKDEBUG,"GetTimeStampSize - aTimeStampSize = "<GetComponent(aVtkId,anId++); + vtkFloatingPointType aComp = aFloatArray->GetComponent(aVtkId,anId++); aStr<SetModePosition(myPickingSettings->GetInfoWindowPosition()); myTextActor->SetTransparency(myPickingSettings->GetInfoWindowTransparency()); - float aHeight = myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight(); - float aCursorSize = myPickingSettings->GetCursorSize(); + vtkFloatingPointType aHeight = myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight(); + vtkFloatingPointType aCursorSize = myPickingSettings->GetCursorSize(); myCursorPyramid->SetPreferences(aHeight,aCursorSize); myCursorPyramidSelected->SetPreferences(aHeight,aCursorSize); @@ -1200,7 +1200,7 @@ VISU_GaussPtsAct1 //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPtsAct1 ::GetRadius(vtkIdType theObjID, vtkIdType theVTKID, @@ -1218,7 +1218,7 @@ VISU_GaussPtsAct1 //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPtsAct1 ::GetMagnification(vtkIdType theObjID) { @@ -1234,7 +1234,7 @@ VISU_GaussPtsAct1 //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPtsAct1 ::GetClamp(vtkIdType theObjID) { @@ -1314,7 +1314,7 @@ VISU_GaussPtsAct1 SALOME_ExtractGeometry* anExtractGeometry = aPipeline->GetExtractGeometryFilter(); vtkImplicitFunction* anImplicitFunction = anExtractGeometry->GetImplicitFunction(); - float aMagnification = aPipeline->GetMagnification(); + vtkFloatingPointType aMagnification = aPipeline->GetMagnification(); aPipeline->ShallowCopy(GetGaussPointsPL()); diff --git a/src/OBJECT/VISU_GaussPtsAct.h b/src/OBJECT/VISU_GaussPtsAct.h index 4e7094b9..105db840 100644 --- a/src/OBJECT/VISU_GaussPtsAct.h +++ b/src/OBJECT/VISU_GaussPtsAct.h @@ -106,7 +106,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor //! Redefined method of getting an actor bounds. virtual - float* + vtkFloatingPointType* GetBounds(); //! Redefined method of getting an actor input. @@ -249,19 +249,19 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor //! To get current value of the radius of the Point Sprite virtual - float + vtkFloatingPointType GetRadius(vtkIdType theObjID, vtkIdType theVTKID, vtkDataArray *theScalarArray); //! To get current value of the magnification virtual - float + vtkFloatingPointType GetMagnification(vtkIdType theObjID); //! To get current value of the clamp virtual - float + vtkFloatingPointType GetClamp(vtkIdType theObjID); //---------------------------------------------------------------------------- @@ -280,7 +280,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor void OnInteractorEvent(unsigned long theEvent); - float myPriority; + vtkFloatingPointType myPriority; bool myChangeMagnification; VISU::TGaussPtsActorFactory* myGaussPtsActorFactory; boost::signal1 myUpdatePrs3dSignal; @@ -388,19 +388,19 @@ class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct //! To get current value of the radius of the Point Sprite virtual - float + vtkFloatingPointType GetRadius(vtkIdType theObjID, vtkIdType theVTKID, vtkDataArray *theScalarArray); //! To get current value of the magnification virtual - float + vtkFloatingPointType GetMagnification(vtkIdType theObjID); //! To get current value of the clamp virtual - float + vtkFloatingPointType GetClamp(vtkIdType theObjID); //---------------------------------------------------------------------------- diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index a59f4f20..cc600ca7 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -241,28 +241,28 @@ VISU_CursorPyramid } this->SetScale(1.0); - float aMRadius = myRadius*myMagnification; + vtkFloatingPointType aMRadius = myRadius*myMagnification; Init(myHeight,aMRadius*myCursorSize); if(myClamp > 0.0f){ - float aPoint1[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aPoint1[3] = {0.0, 0.0, 0.0}; ren->SetDisplayPoint(aPoint1); ren->DisplayToWorld(); ren->GetWorldPoint(aPoint1); - float aPoint2[3] = {0.0, myClamp, 0.0}; + vtkFloatingPointType aPoint2[3] = {0.0, myClamp, 0.0}; ren->SetDisplayPoint(aPoint2); ren->DisplayToWorld(); ren->GetWorldPoint(aPoint2); - float aWorldClamp = + vtkFloatingPointType aWorldClamp = (aPoint2[0] - aPoint1[0])*(aPoint2[0] - aPoint1[0]) + (aPoint2[1] - aPoint1[1])*(aPoint2[1] - aPoint1[1]) + (aPoint2[2] - aPoint1[2])*(aPoint2[2] - aPoint1[2]); aWorldClamp = sqrt(aWorldClamp); - float aMDiameter = 2.0 * aMRadius; - float aCoeff = aWorldClamp / aMDiameter; + vtkFloatingPointType aMDiameter = 2.0 * aMRadius; + vtkFloatingPointType aCoeff = aWorldClamp / aMDiameter; if(aCoeff < 1.0){ this->SetScale(aCoeff); @@ -323,8 +323,8 @@ VISU_CursorPyramid //---------------------------------------------------------------------------- void VISU_CursorPyramid -::SetPreferences(float theHeight, - float theCursorSize) +::SetPreferences(vtkFloatingPointType theHeight, + vtkFloatingPointType theCursorSize) { Init(theHeight, theCursorSize, myRadius, myMagnification, myClamp, GetPosition(), GetProperty()->GetColor()); } @@ -332,13 +332,13 @@ VISU_CursorPyramid //---------------------------------------------------------------------------- void VISU_CursorPyramid -::Init(float theHeight, - float theCursorSize, - float theRadius, - float theMagnification, - float theClamp, - float thePos[3], - float theColor[3]) +::Init(vtkFloatingPointType theHeight, + vtkFloatingPointType theCursorSize, + vtkFloatingPointType theRadius, + vtkFloatingPointType theMagnification, + vtkFloatingPointType theClamp, + vtkFloatingPointType thePos[3], + vtkFloatingPointType theColor[3]) { Init(theHeight,theRadius*theMagnification*theCursorSize); SetPosition(thePos[0],thePos[1],thePos[2]); @@ -357,8 +357,8 @@ VISU_CursorPyramid void VISU_CursorPyramid -::Init(float theHeight, - float theRadius) +::Init(vtkFloatingPointType theHeight, + vtkFloatingPointType theRadius) { for(int i = 0; i < myNbCones; ++i){ vtkConeSource* aSource = mySources[i].GetPointer(); @@ -368,7 +368,7 @@ VISU_CursorPyramid aSource->SetAngle(20.0); } - float aDisplacement = -0.5*theHeight - theRadius; + vtkFloatingPointType aDisplacement = -0.5*theHeight - theRadius; // X mySources[0]->SetDirection(1.0, 0.0, 0.0); @@ -507,7 +507,7 @@ int VISU_FramedTextActor::GetPickable() // function : SetTransparency // purpose : //================================================================== -void VISU_FramedTextActor::SetTransparency(const float theTransparency) +void VISU_FramedTextActor::SetTransparency(const vtkFloatingPointType theTransparency) { if (theTransparency>=0. && theTransparency<=1.){ myTransparency=theTransparency; @@ -519,7 +519,7 @@ void VISU_FramedTextActor::SetTransparency(const float theTransparency) // function : GetTransparency // purpose : //================================================================== -float VISU_FramedTextActor::GetTransparency()const +vtkFloatingPointType VISU_FramedTextActor::GetTransparency()const { return myTransparency; } @@ -561,7 +561,7 @@ int VISU_FramedTextActor::GetModePosition()const // function : SetWorldPoint // purpose : //================================================================== -void VISU_FramedTextActor::SetWorldPoint(const float theWorldPoint[4]) +void VISU_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]) { for(int i = 0; i<4; ++i) { myWorldPoint[i] = theWorldPoint[i]; @@ -572,7 +572,7 @@ void VISU_FramedTextActor::SetWorldPoint(const float theWorldPoint[4]) // function : GetWorldPoint // purpose : //================================================================== -const float* VISU_FramedTextActor::GetWorldPoint()const +const vtkFloatingPointType* VISU_FramedTextActor::GetWorldPoint()const { return myWorldPoint; } @@ -580,7 +580,7 @@ const float* VISU_FramedTextActor::GetWorldPoint()const // function : SetDistance // purpose : //================================================================== -void VISU_FramedTextActor::SetDistance(const float theDistance) +void VISU_FramedTextActor::SetDistance(const vtkFloatingPointType theDistance) { myDistance=theDistance; } @@ -588,7 +588,7 @@ void VISU_FramedTextActor::SetDistance(const float theDistance) // function : GetDistance // purpose : //================================================================== -float VISU_FramedTextActor::GetDistance()const +vtkFloatingPointType VISU_FramedTextActor::GetDistance()const { return myDistance; } @@ -649,10 +649,10 @@ VISU_FramedTextActor theViewport->SetWorldPoint(myWorldPoint); theViewport->WorldToDisplay(); - float aSelectionPoint[3]; + vtkFloatingPointType aSelectionPoint[3]; theViewport->GetDisplayPoint(aSelectionPoint); - float u = aSelectionPoint[0]; - float v = aSelectionPoint[1] - myDistance; + vtkFloatingPointType u = aSelectionPoint[0]; + vtkFloatingPointType v = aSelectionPoint[1] - myDistance; theViewport->ViewportToNormalizedViewport(u, v); PositionCoordinate->SetValue(u, v); // diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.h b/src/OBJECT/VISU_GaussPtsDeviceActor.h index e25e9256..096c91c1 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.h +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.h @@ -126,34 +126,34 @@ public: RemoveFromRender(vtkRenderer* theRenderer); void - Init(float theHeight, - float theCursorSize, - float theRadius, - float theMagnification, - float theClamp, - float thePos[3], - float theColor[3]); + Init(vtkFloatingPointType theHeight, + vtkFloatingPointType theCursorSize, + vtkFloatingPointType theRadius, + vtkFloatingPointType theMagnification, + vtkFloatingPointType theClamp, + vtkFloatingPointType thePos[3], + vtkFloatingPointType theColor[3]); - void SetPreferences(float theHeight, - float theCursorSize); + void SetPreferences(vtkFloatingPointType theHeight, + vtkFloatingPointType theCursorSize); protected: VISU_CursorPyramid(); void - Init(float theHeight, - float theRadius); + Init(vtkFloatingPointType theHeight, + vtkFloatingPointType theRadius); int myNbCones; vtkSmartPointer mySources[6]; vtkSmartPointer myAppendFilter; vtkSmartPointer myMapper; // - float myHeight; - float myCursorSize; - float myRadius; - float myMagnification; - float myClamp; + vtkFloatingPointType myHeight; + vtkFloatingPointType myCursorSize; + vtkFloatingPointType myRadius; + vtkFloatingPointType myMagnification; + vtkFloatingPointType myClamp; private: VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented @@ -199,14 +199,14 @@ public: void SetModePosition(const int theMode); int GetModePosition()const; // - void SetWorldPoint(const float theWorldPoint[4]); - const float* GetWorldPoint()const; + void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]); + const vtkFloatingPointType* GetWorldPoint()const; // - void SetDistance(const float theDistance); - float GetDistance()const; + void SetDistance(const vtkFloatingPointType theDistance); + vtkFloatingPointType GetDistance()const; // - void SetTransparency(const float theTransparency); - float GetTransparency()const; + void SetTransparency(const vtkFloatingPointType theTransparency); + vtkFloatingPointType GetTransparency()const; // protected: VISU_FramedTextActor(); @@ -224,9 +224,9 @@ protected: vtkTimeStamp myBuildTime; // int myModePosition; - float myWorldPoint[4]; - float myDistance; - float myTransparency; + vtkFloatingPointType myWorldPoint[4]; + vtkFloatingPointType myDistance; + vtkFloatingPointType myTransparency; private: VISU_FramedTextActor(const VISU_FramedTextActor&); // Not implemented. diff --git a/src/OBJECT/VISU_GaussPtsSettings.h b/src/OBJECT/VISU_GaussPtsSettings.h index 1778521d..4c0beb8c 100644 --- a/src/OBJECT/VISU_GaussPtsSettings.h +++ b/src/OBJECT/VISU_GaussPtsSettings.h @@ -64,34 +64,34 @@ class VISU_GaussPtsSettings : public vtkObject vtkSetMacro( PrimitiveType, int ); vtkGetMacro( PrimitiveType, int ); - vtkSetMacro( Clamp, float ); - vtkGetMacro( Clamp, float ); + vtkSetMacro( Clamp, vtkFloatingPointType ); + vtkGetMacro( Clamp, vtkFloatingPointType ); vtkSetMacro( Texture, vtkImageData* ); vtkGetMacro( Texture, vtkImageData* ); - vtkSetMacro( AlphaThreshold, float ); - vtkGetMacro( AlphaThreshold, float ); + vtkSetMacro( AlphaThreshold, vtkFloatingPointType ); + vtkGetMacro( AlphaThreshold, vtkFloatingPointType ); vtkSetMacro( Resolution, int ); vtkGetMacro( Resolution, int ); - vtkSetMacro( Magnification, float ); - vtkGetMacro( Magnification, float ); + vtkSetMacro( Magnification, vtkFloatingPointType ); + vtkGetMacro( Magnification, vtkFloatingPointType ); - vtkSetMacro( Increment, float ); - vtkGetMacro( Increment, float ); + vtkSetMacro( Increment, vtkFloatingPointType ); + vtkGetMacro( Increment, vtkFloatingPointType ); protected: bool Initial; int PrimitiveType; - float Clamp; + vtkFloatingPointType Clamp; vtkImageData* Texture; - float AlphaThreshold; + vtkFloatingPointType AlphaThreshold; int Resolution; - float Magnification; - float Increment; + vtkFloatingPointType Magnification; + vtkFloatingPointType Increment; }; @@ -113,15 +113,15 @@ class VISU_InsideCursorSettings : public VISU_GaussPtsSettings VISU_InsideCursorSettings* New(); - vtkSetMacro( MinSize, float ); - vtkGetMacro( MinSize, float ); + vtkSetMacro( MinSize, vtkFloatingPointType ); + vtkGetMacro( MinSize, vtkFloatingPointType ); - vtkSetMacro( MaxSize, float ); - vtkGetMacro( MaxSize, float ); + vtkSetMacro( MaxSize, vtkFloatingPointType ); + vtkGetMacro( MaxSize, vtkFloatingPointType ); protected: - float MinSize; - float MaxSize; + vtkFloatingPointType MinSize; + vtkFloatingPointType MaxSize; }; @@ -144,19 +144,19 @@ class VISU_OutsideCursorSettings : public VISU_GaussPtsSettings VISU_OutsideCursorSettings* New(); - vtkSetMacro( Size, float ); - vtkGetMacro( Size, float ); + vtkSetMacro( Size, vtkFloatingPointType ); + vtkGetMacro( Size, vtkFloatingPointType ); vtkSetMacro( Uniform, bool ); vtkGetMacro( Uniform, bool ); - vtkSetVector3Macro( Color, float ); - vtkGetVector3Macro( Color, float ); + vtkSetVector3Macro( Color, vtkFloatingPointType ); + vtkGetVector3Macro( Color, vtkFloatingPointType ); protected: - float Size; + vtkFloatingPointType Size; bool Uniform; - float Color[3]; + vtkFloatingPointType Color[3]; }; @@ -186,26 +186,26 @@ class VISU_PickingSettings : public vtkObject vtkSetMacro( Initial, bool ); vtkGetMacro( Initial, bool ); - vtkSetMacro( PyramidHeight, float ); - vtkGetMacro( PyramidHeight, float ); + vtkSetMacro( PyramidHeight, vtkFloatingPointType ); + vtkGetMacro( PyramidHeight, vtkFloatingPointType ); - vtkSetMacro( CursorSize, float ); - vtkGetMacro( CursorSize, float ); + vtkSetMacro( CursorSize, vtkFloatingPointType ); + vtkGetMacro( CursorSize, vtkFloatingPointType ); - vtkSetVector3Macro( Color, float ); - vtkGetVector3Macro( Color, float ); + vtkSetVector3Macro( Color, vtkFloatingPointType ); + vtkGetVector3Macro( Color, vtkFloatingPointType ); - vtkSetMacro( PointTolerance, float ); - vtkGetMacro( PointTolerance, float ); + vtkSetMacro( PointTolerance, vtkFloatingPointType ); + vtkGetMacro( PointTolerance, vtkFloatingPointType ); - vtkSetMacro( InfoWindowTransparency, float ); - vtkGetMacro( InfoWindowTransparency, float ); + vtkSetMacro( InfoWindowTransparency, vtkFloatingPointType ); + vtkGetMacro( InfoWindowTransparency, vtkFloatingPointType ); vtkSetMacro( InfoWindowPosition, int ); vtkGetMacro( InfoWindowPosition, int ); - vtkSetMacro( ZoomFactor, float ); - vtkGetMacro( ZoomFactor, float ); + vtkSetMacro( ZoomFactor, vtkFloatingPointType ); + vtkGetMacro( ZoomFactor, vtkFloatingPointType ); vtkSetMacro( StepNumber, int ); vtkGetMacro( StepNumber, int ); @@ -216,13 +216,13 @@ class VISU_PickingSettings : public vtkObject private: bool Initial; - float PyramidHeight; - float CursorSize; - float PointTolerance; - float Color[3]; - float InfoWindowTransparency; + vtkFloatingPointType PyramidHeight; + vtkFloatingPointType CursorSize; + vtkFloatingPointType PointTolerance; + vtkFloatingPointType Color[3]; + vtkFloatingPointType InfoWindowTransparency; int InfoWindowPosition; - float ZoomFactor; + vtkFloatingPointType ZoomFactor; int StepNumber; bool DisplayParentMesh; }; diff --git a/src/OBJECT/VISU_MeshAct.cxx b/src/OBJECT/VISU_MeshAct.cxx index b6b812d9..549e6a0b 100644 --- a/src/OBJECT/VISU_MeshAct.cxx +++ b/src/OBJECT/VISU_MeshAct.cxx @@ -115,7 +115,7 @@ VISU_MeshAct void VISU_MeshAct -::SetShrinkFactor(float theValue) +::SetShrinkFactor(vtkFloatingPointType theValue) { Superclass::SetShrinkFactor(theValue); @@ -149,12 +149,12 @@ VISU_MeshAct //---------------------------------------------------------------------------- void VISU_MeshAct -::SetOpacity(float theValue) +::SetOpacity(vtkFloatingPointType theValue) { GetSurfaceProperty()->SetOpacity(theValue); } -float +vtkFloatingPointType VISU_MeshAct ::GetOpacity() { @@ -164,12 +164,12 @@ VISU_MeshAct //---------------------------------------------------------------------------- void VISU_MeshAct -::SetLineWidth(float theLineWidth) +::SetLineWidth(vtkFloatingPointType theLineWidth) { GetEdgeProperty()->SetLineWidth(theLineWidth); } -float +vtkFloatingPointType VISU_MeshAct::GetLineWidth() { return GetEdgeProperty()->GetLineWidth(); diff --git a/src/OBJECT/VISU_MeshAct.h b/src/OBJECT/VISU_MeshAct.h index 9dafb348..80735f23 100644 --- a/src/OBJECT/VISU_MeshAct.h +++ b/src/OBJECT/VISU_MeshAct.h @@ -65,18 +65,18 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor virtual void - SetOpacity(float theValue); + SetOpacity(vtkFloatingPointType theValue); virtual - float + vtkFloatingPointType GetOpacity(); virtual void - SetLineWidth(float theLineWidth); + SetLineWidth(vtkFloatingPointType theLineWidth); virtual - float + vtkFloatingPointType GetLineWidth(); virtual @@ -89,7 +89,7 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor virtual void - SetShrinkFactor(float theFactor = 0.8); + SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); virtual void diff --git a/src/PIPELINE/SALOME_ExtractGeometry.cxx b/src/PIPELINE/SALOME_ExtractGeometry.cxx index 5a1762e8..e4c986c3 100755 --- a/src/PIPELINE/SALOME_ExtractGeometry.cxx +++ b/src/PIPELINE/SALOME_ExtractGeometry.cxx @@ -198,8 +198,8 @@ SALOME_ExtractGeometry vtkIdList *cellPts; vtkCell *cell; int numCellPts; - float *x; - float multiplier; + vtkFloatingPointType *x; + vtkFloatingPointType multiplier; vtkPoints *newPts; vtkIdList *newCellPts; vtkDataSet *input = this->GetInput(); @@ -271,7 +271,7 @@ SALOME_ExtractGeometry // To extract boundary cells, we have to create supplemental information if ( this->ExtractBoundaryCells ) { - float val; + vtkFloatingPointType val; newScalars = vtkFloatArray::New(); newScalars->SetNumberOfValues(numPts); diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index e2cfe567..df37e622 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -34,12 +34,17 @@ using namespace std; vtkStandardNewMacro(VISU_CutLinesPL); -VISU_CutLinesPL::VISU_CutLinesPL(){ +VISU_CutLinesPL +::VISU_CutLinesPL() +{ myCondition = 1; myPosition = 0; } -void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_CutLinesPL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ if(VISU_CutLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(1), aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1); @@ -50,7 +55,10 @@ void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ VISU_CutPlanesPL::ShallowCopy(thePipeLine); } -void VISU_CutLinesPL::Init(){ +void +VISU_CutLinesPL +::Init() +{ VISU_CutPlanesPL::Init(); myBasePlane[0] = XY; @@ -64,15 +72,21 @@ void VISU_CutLinesPL::Init(){ } -void VISU_CutLinesPL::SetPosition(float thePosition){ +void +VISU_CutLinesPL +::SetPosition(vtkFloatingPointType thePosition) +{ myPosition = thePosition; myCondition = 0; Modified(); } -float VISU_CutLinesPL::GetPosition(){ - float aPosition = myPosition; +vtkFloatingPointType +VISU_CutLinesPL +::GetPosition() +{ + vtkFloatingPointType aPosition = myPosition; if(myCondition){ - float aDir[3], aBounds[6], aBoundPrj[3]; + vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3]; GetInput2()->GetBounds(aBounds); GetDir(aDir,myAng[0],myBasePlane[0]); GetBoundProject(aBoundPrj,aBounds,aDir); @@ -81,21 +95,30 @@ float VISU_CutLinesPL::GetPosition(){ return aPosition; } -void VISU_CutLinesPL::SetDefault(){ +void +VISU_CutLinesPL +::SetDefault() +{ myCondition = 1; Modified(); } -int VISU_CutLinesPL::IsDefault(){ +int +VISU_CutLinesPL +::IsDefault() +{ return myCondition; } -void VISU_CutLinesPL::Update(){ +void +VISU_CutLinesPL +::Update() +{ ClearAppendPolyData(myAppendPolyData); SetPartPosition(1); vtkAppendPolyData *anAppendPolyData = vtkAppendPolyData::New(); //Build base plane - float aDir[2][3], aBaseBounds[6]; + vtkFloatingPointType aDir[2][3], aBaseBounds[6]; GetInput2()->GetBounds(aBaseBounds); GetDir(aDir[0],myAng[0],myBasePlane[0]); vtkUnstructuredGrid* anUnstructuredGrid = @@ -103,7 +126,7 @@ void VISU_CutLinesPL::Update(){ CutWithPlanes(anAppendPolyData,anUnstructuredGrid,1,aDir[0],aBaseBounds, myPosition,myCondition,myDisplacement[0]); //Build lines - float aBounds[6]; + vtkFloatingPointType aBounds[6]; vtkDataSet *aDataSet = anAppendPolyData->GetOutput(); aDataSet->Update(); if(aDataSet->GetNumberOfCells() == 0) @@ -125,12 +148,18 @@ void VISU_CutLinesPL::Update(){ } -void VISU_CutLinesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - float thePartPosition, int thePartCondition, - float theDisplacement) +void +VISU_CutLinesPL +::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + vtkFloatingPointType thePartPosition, + int thePartCondition, + vtkFloatingPointType theDisplacement) { - vector aPartPosition(1,thePartPosition); + vector aPartPosition(1,thePartPosition); vector aPartCondition(1,thePartCondition); VISU_CutPlanesPL::CutWithPlanes(theAppendPolyData,theDataSet,theNbPlanes,theDir,theBounds, aPartPosition,aPartCondition,theDisplacement); diff --git a/src/PIPELINE/VISU_CutLinesPL.hxx b/src/PIPELINE/VISU_CutLinesPL.hxx index cc316781..e41cdc65 100644 --- a/src/PIPELINE/VISU_CutLinesPL.hxx +++ b/src/PIPELINE/VISU_CutLinesPL.hxx @@ -37,31 +37,74 @@ protected: VISU_CutLinesPL(const VISU_CutLinesPL&); public: vtkTypeMacro(VISU_CutLinesPL,VISU_CutPlanesPL); - static VISU_CutLinesPL* New(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SetPosition(float thePosition); - virtual float GetPosition(); + static + VISU_CutLinesPL* + New(); - virtual void SetDefault(); - virtual int IsDefault(); + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + void + SetPosition(vtkFloatingPointType thePosition); + + virtual + vtkFloatingPointType + GetPosition(); + + virtual + void + SetDefault(); + + virtual + int + IsDefault(); public: - virtual void Init(); - virtual void Update(); + virtual + void + Init(); + + virtual + void + Update(); + + static + void + CutWithPlanes(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + vtkFloatingPointType thePlanePosition, + int thePlaneCondition, + vtkFloatingPointType theDisplacement); + + const vtkFloatingPointType* + GetDirLn() + { + return myDirLn; + } - static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - float thePlanePosition, int thePlaneCondition, - float theDisplacement); + const vtkFloatingPointType* + GetBoundPrjLn() + { + return myBoundPrjLn; + } - const float* GetDirLn(){ return myDirLn;} - const float* GetBoundPrjLn(){ return myBoundPrjLn;} - const float* GetBasePnt(){ return myBasePnt;} + const vtkFloatingPointType* + GetBasePnt() + { + return myBasePnt; + } protected: - float myDirLn[3], myBoundPrjLn[3], myBasePnt[3]; - float myPosition; + vtkFloatingPointType myDirLn[3]; + vtkFloatingPointType myBoundPrjLn[3]; + vtkFloatingPointType myBasePnt[3]; + vtkFloatingPointType myPosition; int myCondition; }; diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index 2a547971..8bd5837f 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -35,11 +35,13 @@ using namespace std; -static float EPS = 1.0E-3; +static vtkFloatingPointType EPS = 1.0E-3; vtkStandardNewMacro(VISU_CutPlanesPL); -VISU_CutPlanesPL::VISU_CutPlanesPL(){ +VISU_CutPlanesPL +::VISU_CutPlanesPL() +{ myAppendPolyData = vtkAppendPolyData::New(); myIsShrinkable = false; @@ -54,11 +56,16 @@ VISU_CutPlanesPL::VISU_CutPlanesPL(){ myAng[1][0] = myAng[1][1] = myAng[1][2] = 0.0; } -VISU_CutPlanesPL::~VISU_CutPlanesPL(){ +VISU_CutPlanesPL +::~VISU_CutPlanesPL() +{ myAppendPolyData->Delete(); } -void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_CutPlanesPL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ if(VISU_CutPlanesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(), aPipeLine->GetRotateX(),aPipeLine->GetRotateY()); @@ -70,7 +77,10 @@ void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ VISU_ScalarMapPL::ShallowCopy(thePipeLine); } -void VISU_CutPlanesPL::Init(){ +void +VISU_CutPlanesPL +::Init() +{ VISU_ScalarMapPL::Init(); SetNbParts(10); @@ -79,16 +89,22 @@ void VISU_CutPlanesPL::Init(){ myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0; } -VISU_ScalarMapPL::THook* VISU_CutPlanesPL::DoHook(){ +VISU_ScalarMapPL::THook* +VISU_CutPlanesPL +::DoHook() +{ return myAppendPolyData->GetOutput(); } -void VISU_CutPlanesPL::Update(){ +void +VISU_CutPlanesPL +::Update() +{ ClearAppendPolyData(myAppendPolyData); SetPartPosition(); - float aDir[3]; + vtkFloatingPointType aDir[3]; GetDir(aDir,myAng[0],myBasePlane[0]); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; GetInput2()->GetBounds(aBounds); vtkDataSet* aDataSet = myFieldTransform->GetUnstructuredGridOutput(); CutWithPlanes(myAppendPolyData,aDataSet,myNbParts,aDir,aBounds, @@ -97,18 +113,28 @@ void VISU_CutPlanesPL::Update(){ VISU_ScalarMapPL::Update(); } -void VISU_CutPlanesPL::SetPartPosition(int theNum){ +void +VISU_CutPlanesPL +::SetPartPosition(int theNum) +{ for(int i = 0; i < myNbParts; i++) myPartPosition[i] = GetPartPosition(i,theNum); } -void VISU_CutPlanesPL::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData){ +void +VISU_CutPlanesPL +::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData) +{ int iEnd = theAppendPolyData->GetNumberOfInputs(); for(int i = iEnd-1; i >= 0; i--) theAppendPolyData->RemoveInput(theAppendPolyData->GetInput(i)); } -float* VISU_CutPlanesPL::GetRx(float theRx[3][3], float thaAng){ +vtkFloatingPointType* +VISU_CutPlanesPL:: +GetRx(vtkFloatingPointType theRx[3][3], + vtkFloatingPointType thaAng) +{ theRx[0][0] = 1.0; theRx[0][1] = 0.0; theRx[0][2] = 0.0; theRx[1][0] = 0.0; theRx[1][1] = cos(thaAng); theRx[1][2] = -sin(thaAng); theRx[2][0] = 0.0; theRx[2][1] = sin(thaAng); theRx[2][2] = cos(thaAng); @@ -116,7 +142,11 @@ float* VISU_CutPlanesPL::GetRx(float theRx[3][3], float thaAng){ } -float* VISU_CutPlanesPL::GetRy(float theRy[3][3], float thaAng){ +vtkFloatingPointType* +VISU_CutPlanesPL +::GetRy(vtkFloatingPointType theRy[3][3], + vtkFloatingPointType thaAng) +{ theRy[0][0] = cos(thaAng); theRy[0][1] = 0.0; theRy[0][2] = sin(thaAng); theRy[1][0] = 0.0; theRy[1][1] = 1.0; theRy[1][2] = 0.0; theRy[2][0] = -sin(thaAng); theRy[2][1] = 0.0; theRy[2][2] = cos(thaAng); @@ -124,7 +154,11 @@ float* VISU_CutPlanesPL::GetRy(float theRy[3][3], float thaAng){ } -float* VISU_CutPlanesPL::GetRz(float theRz[3][3], float thaAng){ +vtkFloatingPointType* +VISU_CutPlanesPL +::GetRz(vtkFloatingPointType theRz[3][3], + vtkFloatingPointType thaAng) +{ theRz[0][0] = cos(thaAng); theRz[0][1] = -sin(thaAng); theRz[0][2] = 0.0; theRz[1][0] = sin(thaAng); theRz[1][1] = cos(thaAng); theRz[1][2] = 0.0; theRz[2][0] = 0.0; theRz[2][1] = 0.0; theRz[2][2] = 1.0; @@ -132,25 +166,34 @@ float* VISU_CutPlanesPL::GetRz(float theRz[3][3], float thaAng){ } -void VISU_CutPlanesPL::CorrectPnt(float thePnt[3], const float BoundPrj[6]){ +void +VISU_CutPlanesPL +::CorrectPnt(vtkFloatingPointType thePnt[3], + const vtkFloatingPointType BoundPrj[6]) +{ for(int i = 0, j = 0; i < 3; ++i, j=2*i){ if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j]; if(thePnt[i] > BoundPrj[j+1]) thePnt[i] = BoundPrj[j+1]; } } -void VISU_CutPlanesPL::GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]){ - float BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]}, - {BoundBox[1],BoundBox[2],BoundBox[4]}, - {BoundBox[0],BoundBox[3],BoundBox[4]}, - {BoundBox[1],BoundBox[3],BoundBox[4]}, - {BoundBox[0],BoundBox[2],BoundBox[5]}, - {BoundBox[1],BoundBox[2],BoundBox[5]}, - {BoundBox[0],BoundBox[3],BoundBox[5]}, - {BoundBox[1],BoundBox[3],BoundBox[5]}}; +void +VISU_CutPlanesPL +::GetBoundProject(vtkFloatingPointType BoundPrj[3], + const vtkFloatingPointType BoundBox[6], + const vtkFloatingPointType Dir[3]) +{ + vtkFloatingPointType BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]}, + {BoundBox[1],BoundBox[2],BoundBox[4]}, + {BoundBox[0],BoundBox[3],BoundBox[4]}, + {BoundBox[1],BoundBox[3],BoundBox[4]}, + {BoundBox[0],BoundBox[2],BoundBox[5]}, + {BoundBox[1],BoundBox[2],BoundBox[5]}, + {BoundBox[0],BoundBox[3],BoundBox[5]}, + {BoundBox[1],BoundBox[3],BoundBox[5]}}; BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0]; for(int i = 1; i < 8; i++){ - float tmp = vtkMath::Dot(Dir,BoundPoints[i]); + vtkFloatingPointType tmp = vtkMath::Dot(Dir,BoundPoints[i]); if(BoundPrj[1] < tmp) BoundPrj[1] = tmp; if(BoundPrj[0] > tmp) BoundPrj[0] = tmp; } @@ -161,8 +204,12 @@ void VISU_CutPlanesPL::GetBoundProject(float BoundPrj[3], const float BoundBox[6 } -void VISU_CutPlanesPL::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, - float theXAng, float theYAng, int theNum) +void +VISU_CutPlanesPL +::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, + vtkFloatingPointType theXAng, + vtkFloatingPointType theYAng, + int theNum) { myBasePlane[theNum] = theOrient; switch(myBasePlane[theNum]){ @@ -178,11 +225,17 @@ void VISU_CutPlanesPL::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& } -const VISU_CutPlanesPL::PlaneOrientation& VISU_CutPlanesPL::GetPlaneOrientation(int theNum){ +const VISU_CutPlanesPL::PlaneOrientation& +VISU_CutPlanesPL +::GetPlaneOrientation(int theNum) +{ return myBasePlane[theNum]; } -float VISU_CutPlanesPL::GetRotateX(int theNum){ +vtkFloatingPointType +VISU_CutPlanesPL +::GetRotateX(int theNum) +{ switch(myBasePlane[theNum]){ case XY: return myAng[theNum][0]; case YZ: return myAng[theNum][1]; @@ -191,7 +244,10 @@ float VISU_CutPlanesPL::GetRotateX(int theNum){ return 0; } -float VISU_CutPlanesPL::GetRotateY(int theNum){ +vtkFloatingPointType +VISU_CutPlanesPL +::GetRotateY(int theNum) +{ switch(myBasePlane[theNum]){ case XY: return myAng[theNum][1]; case YZ: return myAng[theNum][2]; @@ -201,7 +257,10 @@ float VISU_CutPlanesPL::GetRotateY(int theNum){ } -void VISU_CutPlanesPL::SetNbParts(int theNb) { +void +VISU_CutPlanesPL +::SetNbParts(int theNb) +{ myNbParts = theNb; myPartPosition.resize(myNbParts); myPartCondition.resize(myNbParts,1); @@ -209,24 +268,33 @@ void VISU_CutPlanesPL::SetNbParts(int theNb) { } -void VISU_CutPlanesPL::SetPartPosition(int thePartNumber, float thePartPosition){ +void +VISU_CutPlanesPL +::SetPartPosition(int thePartNumber, + vtkFloatingPointType thePartPosition) +{ if(thePartNumber >= myNbParts) return; myPartPosition[thePartNumber] = thePartPosition; myPartCondition[thePartNumber] = 0; Modified(); } -float VISU_CutPlanesPL::GetPartPosition(int thePartNumber, int theNum){ + +vtkFloatingPointType +VISU_CutPlanesPL +::GetPartPosition(int thePartNumber, + int theNum) +{ if(thePartNumber >= myNbParts) return 0; - float aPosition = myPartPosition[thePartNumber]; + vtkFloatingPointType aPosition = myPartPosition[thePartNumber]; if(myPartCondition[thePartNumber]){ - float aDir[3], aBounds[6], aBoundPrj[3]; + vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3]; GetInput2()->GetBounds(aBounds); GetDir(aDir,myAng[theNum],myBasePlane[theNum]); GetBoundProject(aBoundPrj,aBounds,aDir); if (myNbParts > 1){ - float aDBoundPrj = aBoundPrj[2]/(myNbParts - 1); - float aDisplacement = aDBoundPrj * myDisplacement[theNum]; - float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; + vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1); + vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum]; + vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; aPosition = aStartPosition + thePartNumber*aDBoundPrj; }else aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum]; @@ -235,24 +303,32 @@ float VISU_CutPlanesPL::GetPartPosition(int thePartNumber, int theNum){ } -void VISU_CutPlanesPL::SetPartDefault(int thePartNumber){ +void +VISU_CutPlanesPL +::SetPartDefault(int thePartNumber) +{ if(thePartNumber >= myNbParts) return; myPartPosition[thePartNumber] = GetPartPosition(thePartNumber); myPartCondition[thePartNumber] = 1; Modified(); } -int VISU_CutPlanesPL::IsPartDefault(int thePartNumber){ +int +VISU_CutPlanesPL +::IsPartDefault(int thePartNumber) +{ if(thePartNumber >= myNbParts) return 1; return myPartCondition[thePartNumber]; } -void VISU_CutPlanesPL::GetDir(float theDir[3], - const float theAng[3], - const PlaneOrientation& theBasePlane) +void +VISU_CutPlanesPL +::GetDir(vtkFloatingPointType theDir[3], + const vtkFloatingPointType theAng[3], + const PlaneOrientation& theBasePlane) { int iPlane = 0; - float aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3]; + vtkFloatingPointType aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3]; switch(theBasePlane){ case XY: if(fabs(theAng[0]) > EPS) GetRx(aRx,theAng[0]); else vtkMath::Identity3x3(aRx); @@ -278,9 +354,12 @@ void VISU_CutPlanesPL::GetDir(float theDir[3], } -void VISU_CutPlanesPL::CutWithPlane(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - float theDir[3], float theOrig[3]) +void +VISU_CutPlanesPL +::CutWithPlane(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theOrig[3]) { vtkCutter *aCutPlane = vtkCutter::New(); aCutPlane->SetInput(theDataSet); @@ -296,18 +375,23 @@ void VISU_CutPlanesPL::CutWithPlane(vtkAppendPolyData* theAppendPolyData, } -void VISU_CutPlanesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - const vector& thePlanePosition, - const vector& thePlaneCondition, - float theDisplacement) +void +VISU_CutPlanesPL +::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + const vector& thePlanePosition, + const vector& thePlaneCondition, + vtkFloatingPointType theDisplacement) { - float aBoundPrj[3], aOrig[3], aPosition; + vtkFloatingPointType aBoundPrj[3], aOrig[3], aPosition; GetBoundProject(aBoundPrj, theBounds, theDir); if(theNbPlanes > 1){ - float aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1); - float aDisplacement = aDBoundPrj*theDisplacement; - float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; + vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1); + vtkFloatingPointType aDisplacement = aDBoundPrj*theDisplacement; + vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; for (int i = 0; i < theNbPlanes; i++){ aPosition = aStartPosition + i*aDBoundPrj; if(thePlaneCondition[i]){ diff --git a/src/PIPELINE/VISU_CutPlanesPL.hxx b/src/PIPELINE/VISU_CutPlanesPL.hxx index b561f512..bd2c977a 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.hxx +++ b/src/PIPELINE/VISU_CutPlanesPL.hxx @@ -40,64 +40,162 @@ protected: public: vtkTypeMacro(VISU_CutPlanesPL,VISU_ScalarMapPL); static VISU_CutPlanesPL* New(); - virtual ~VISU_CutPlanesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - enum PlaneOrientation {XY, YZ, ZX}; - virtual void SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, - float theXAng, float theYAng, int theNum = 0); + virtual + ~VISU_CutPlanesPL(); - virtual const PlaneOrientation& GetPlaneOrientation(int theNum = 0); - virtual float GetRotateX(int theNum = 0); - virtual float GetRotateY(int theNum = 0); + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); - virtual float GetDisplacement(int theNum = 0) { return myDisplacement[theNum];} - virtual void SetDisplacement(float theDisp, int theNum = 0) { myDisplacement[theNum] = theDisp;} + enum PlaneOrientation {XY, YZ, ZX}; - virtual void SetPartPosition(int thePartNumber, float thePartPosition); - virtual float GetPartPosition(int thePartNumber, int theNum = 0); + virtual + void + SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, + vtkFloatingPointType theXAng, + vtkFloatingPointType theYAng, + int theNum = 0); + + virtual + const PlaneOrientation& + GetPlaneOrientation(int theNum = 0); + + virtual + vtkFloatingPointType + GetRotateX(int theNum = 0); + + virtual + vtkFloatingPointType + GetRotateY(int theNum = 0); + + virtual + vtkFloatingPointType + GetDisplacement(int theNum = 0) + { + return myDisplacement[theNum]; + } + + virtual + void + SetDisplacement(vtkFloatingPointType theDisp, + int theNum = 0) + { + myDisplacement[theNum] = theDisp; + } + + virtual + void + SetPartPosition(int thePartNumber, + vtkFloatingPointType thePartPosition); + + virtual + vtkFloatingPointType + GetPartPosition(int thePartNumber, + int theNum = 0); + + virtual + void + SetPartDefault(int thePartNumber); + + virtual + int + IsPartDefault(int thePartNumber); + + virtual + void + SetNbParts(int theNb); + + virtual + int + GetNbParts() + { + return myNbParts; + } - virtual void SetPartDefault(int thePartNumber); - virtual int IsPartDefault(int thePartNumber); +public: + virtual + void + Init(); - virtual void SetNbParts(int theNb); - virtual int GetNbParts(){ return myNbParts;} + virtual + void + Update(); -public: - virtual void Init(); - virtual void Update(); - virtual vtkAppendPolyData* GetAppendPolyData() { return myAppendPolyData; } + virtual + vtkAppendPolyData* + GetAppendPolyData() + { + return myAppendPolyData; + } public: - static float* GetRx(float theRx[3][3], float thaAng); - static float* GetRy(float theRy[3][3], float thaAng); - static float* GetRz(float theRz[3][3], float thaAng); - - static void CorrectPnt(float thePnt[3], const float BoundPrj[6]); - static void GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]); - - static void GetDir(float theDir[3], - const float theAng[3], - const PlaneOrientation& theBasePlane); - - static void ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData); - - static void CutWithPlane(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - float theDir[3], float theOrig[3]); - static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - const std::vector& thePlanePosition, - const std::vector& thePlaneCondition, - float theDisplacement); + static + vtkFloatingPointType* + GetRx(vtkFloatingPointType theRx[3][3], + vtkFloatingPointType thaAng); + + static + vtkFloatingPointType* + GetRy(vtkFloatingPointType theRy[3][3], + vtkFloatingPointType thaAng); + + static + vtkFloatingPointType* + GetRz(vtkFloatingPointType theRz[3][3], + vtkFloatingPointType thaAng); + + static + void + CorrectPnt(vtkFloatingPointType thePnt[3], + const vtkFloatingPointType BoundPrj[6]); + + static + void + GetBoundProject(vtkFloatingPointType BoundPrj[3], + const vtkFloatingPointType BoundBox[6], + const vtkFloatingPointType Dir[3]); + + static + void + GetDir(vtkFloatingPointType theDir[3], + const vtkFloatingPointType theAng[3], + const PlaneOrientation& theBasePlane); + + static + void + ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData); + + static + void + CutWithPlane(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theOrig[3]); + + static + void + CutWithPlanes(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + const std::vector& thePlanePosition, + const std::vector& thePlaneCondition, + vtkFloatingPointType theDisplacement); protected: - virtual THook* DoHook(); - void SetPartPosition(int theNum = 0); + virtual + THook* + DoHook(); + + void + SetPartPosition(int theNum = 0); int myNbParts; PlaneOrientation myBasePlane[2]; - float myAng[2][3], myDisplacement[2]; + vtkFloatingPointType myAng[2][3], myDisplacement[2]; vtkAppendPolyData *myAppendPolyData; - std::vector myPartPosition; + std::vector myPartPosition; std::vector myPartCondition; }; diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index 0b8e3462..c8b2133e 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -33,12 +33,16 @@ vtkStandardNewMacro(VISU_DeformedShapePL); -VISU_DeformedShapePL::VISU_DeformedShapePL(){ +VISU_DeformedShapePL +::VISU_DeformedShapePL() +{ myWarpVector = vtkWarpVector::New(); myCellDataToPointData = vtkCellDataToPointData::New(); } -VISU_DeformedShapePL::~VISU_DeformedShapePL(){ +VISU_DeformedShapePL +::~VISU_DeformedShapePL() +{ myWarpVector->UnRegisterAllOutputs(); myWarpVector->Delete(); @@ -46,21 +50,27 @@ VISU_DeformedShapePL::~VISU_DeformedShapePL(){ myCellDataToPointData->Delete(); } -void VISU_DeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_DeformedShapePL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ if(VISU_DeformedShapePL *aPipeLine = dynamic_cast(thePipeLine)){ SetScale(aPipeLine->GetScale()); } VISU_ScalarMapPL::ShallowCopy(thePipeLine); } -float VISU_DeformedShapePL::GetScaleFactor(vtkDataSet* theDataSet){ +vtkFloatingPointType +VISU_DeformedShapePL +::GetScaleFactor(vtkDataSet* theDataSet) +{ if(!theDataSet) return 0.0; theDataSet->Update(); int aNbCells = theDataSet->GetNumberOfCells(); int aNbPoints = theDataSet->GetNumberOfPoints(); int aNbElem = aNbCells? aNbCells: aNbPoints; - float* aBounds = theDataSet->GetBounds(); - float aVolume = 1, aVol, idim = 0; + vtkFloatingPointType* aBounds = theDataSet->GetBounds(); + vtkFloatingPointType aVolume = 1, aVol, idim = 0; for(int i = 0; i < 6; i += 2){ aVol = fabs(aBounds[i+1] - aBounds[i]); if(aVol > 0) { @@ -69,26 +79,36 @@ float VISU_DeformedShapePL::GetScaleFactor(vtkDataSet* theDataSet){ } } aVolume /= aNbElem; - return pow(aVolume,float(1.0/idim)); + return pow(aVolume,vtkFloatingPointType(1.0/idim)); } -void VISU_DeformedShapePL::SetScale(float theScale) { +void +VISU_DeformedShapePL +::SetScale(vtkFloatingPointType theScale) +{ myWarpVector->SetScaleFactor(theScale); myScaleFactor = theScale; Modified(); } -float VISU_DeformedShapePL::GetScale() { + +vtkFloatingPointType +VISU_DeformedShapePL +::GetScale() +{ return myScaleFactor; } -void VISU_DeformedShapePL::Init(){ +void +VISU_DeformedShapePL +::Init() +{ VISU_ScalarMapPL::Init(); - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); vtkDataSet* aDataSet = GetInput2(); - float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); + vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); static double EPS = 1.0 / VTK_LARGE_FLOAT; if(fabs(aScalarRange[1]) > EPS) @@ -97,16 +117,25 @@ void VISU_DeformedShapePL::Init(){ SetScale(0.0); } -VISU_ScalarMapPL::THook* VISU_DeformedShapePL::DoHook(){ +VISU_ScalarMapPL::THook* +VISU_DeformedShapePL +::DoHook() +{ VISU::CellDataToPoint(myWarpVector,myCellDataToPointData,GetInput2(),myFieldTransform); return myWarpVector->GetOutput(); } -void VISU_DeformedShapePL::Update(){ +void +VISU_DeformedShapePL +::Update() +{ VISU_ScalarMapPL::Update(); } -void VISU_DeformedShapePL::SetMapScale(float theMapScale){ +void +VISU_DeformedShapePL +::SetMapScale(vtkFloatingPointType theMapScale) +{ VISU_ScalarMapPL::SetMapScale(theMapScale); myWarpVector->SetScaleFactor(myScaleFactor*theMapScale); diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx index 9c2f95a7..fb8d7145 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ b/src/PIPELINE/VISU_DeformedShapePL.hxx @@ -33,30 +33,57 @@ class vtkCellDataToPointData; class SALOME_Transform; class vtkWarpVector; -class VISU_DeformedShapePL : public VISU_ScalarMapPL{ +class VISU_DeformedShapePL : public VISU_ScalarMapPL +{ protected: VISU_DeformedShapePL(); VISU_DeformedShapePL(const VISU_DeformedShapePL&); + + virtual + ~VISU_DeformedShapePL(); + public: vtkTypeMacro(VISU_DeformedShapePL,VISU_ScalarMapPL); - static VISU_DeformedShapePL* New(); - virtual ~VISU_DeformedShapePL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SetScale(float theScale); - virtual float GetScale(); + static + VISU_DeformedShapePL* + New(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + void + SetScale(vtkFloatingPointType theScale); + + virtual + vtkFloatingPointType + GetScale(); public: - virtual void Init(); - virtual void Update(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual + void + Init(); + + virtual + void + Update(); + + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); - static float GetScaleFactor(vtkDataSet* theDataSet); + static + vtkFloatingPointType + GetScaleFactor(vtkDataSet* theDataSet); protected: - virtual THook* DoHook(); + virtual + THook* + DoHook(); - float myScaleFactor; + vtkFloatingPointType myScaleFactor; vtkWarpVector *myWarpVector; vtkCellDataToPointData* myCellDataToPointData; }; diff --git a/src/PIPELINE/VISU_Extractor.cxx b/src/PIPELINE/VISU_Extractor.cxx index b6423a39..ead86acd 100644 --- a/src/PIPELINE/VISU_Extractor.cxx +++ b/src/PIPELINE/VISU_Extractor.cxx @@ -67,7 +67,7 @@ execute(int theNbElems, vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD"); if(vtkFloatArray *aFloatArray = dynamic_cast(aFieldArray)){ int aNbComp = aFloatArray->GetNumberOfComponents(); - std::vector anArray(aNbComp < 3? 3: aNbComp); + std::vector anArray(aNbComp < 3? 3: aNbComp); // vtkFloatArray *aScalars = vtkFloatArray::New(); aScalars->SetNumberOfTuples(theNbElems); @@ -76,8 +76,8 @@ execute(int theNbElems, if(!theScalarMode){ for(int anId = 0; anId < theNbElems; anId++){ aFloatArray->GetTuple(anId,&anArray[0]); - float aVector[3] = {anArray[0], anArray[1], anArray[2]}; - float aScalar = sqrt(aVector[0]*aVector[0] + aVector[1]*aVector[1] + aVector[2]*aVector[2]); + vtkFloatingPointType aVector[3] = {anArray[0], anArray[1], anArray[2]}; + vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] + aVector[1]*aVector[1] + aVector[2]*aVector[2]); aScalars->SetTuple1(anId,aScalar); } }else{ diff --git a/src/PIPELINE/VISU_FieldTransform.cxx b/src/PIPELINE/VISU_FieldTransform.cxx index 82081859..b29adb0b 100644 --- a/src/PIPELINE/VISU_FieldTransform.cxx +++ b/src/PIPELINE/VISU_FieldTransform.cxx @@ -15,7 +15,7 @@ #include #include -static float Tolerance = 1.0 / VTK_LARGE_FLOAT; +static vtkFloatingPointType Tolerance = 1.0 / VTK_LARGE_FLOAT; using namespace std; @@ -107,9 +107,9 @@ void VISU_FieldTransform::SetSpaceTransform(VTKViewer_Transform* theTransform){ void VISU_FieldTransform -::SetScalarRange(float theScalarRange[2]) +::SetScalarRange(vtkFloatingPointType theScalarRange[2]) { - float aDelta = + vtkFloatingPointType aDelta = fabs(myScalarRange[0] - theScalarRange[0]) + fabs(myScalarRange[1] - theScalarRange[1]); if(aDelta < Tolerance) @@ -123,17 +123,17 @@ VISU_FieldTransform void VISU_FieldTransform -::SetScalarMin(float theValue) +::SetScalarMin(vtkFloatingPointType theValue) { - float aScalarRange[2] = {theValue, GetScalarRange()[1]}; + vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]}; SetScalarRange(aScalarRange); } void VISU_FieldTransform -::SetScalarMax(float theValue) +::SetScalarMax(vtkFloatingPointType theValue) { - float aScalarRange[2] = {GetScalarRange()[0], theValue}; + vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue}; SetScalarRange(aScalarRange); } @@ -141,7 +141,7 @@ VISU_FieldTransform template void ExecVectors(VISU_FieldTransform::TTransformFun theFunction, VTKViewer_Transform* theTransform, - float theScalarRange[2], + vtkFloatingPointType theScalarRange[2], int theNbOfTuples, TypeData* theInputData, TypeData* theOutputData) @@ -152,10 +152,10 @@ ExecVectors(VISU_FieldTransform::TTransformFun theFunction, vtkFloatArray *aNewVectors = vtkFloatArray::New(); aNewVectors->SetNumberOfComponents(3); aNewVectors->SetNumberOfTuples(theNbOfTuples); - float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; - float aDelta = aScalarRange[1] - aScalarRange[0]; - float aScale[3] = {1.0, 1.0, 1.0}; - static float EPS = 1.0 / VTK_LARGE_FLOAT; + vtkFloatingPointType aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; + vtkFloatingPointType aDelta = aScalarRange[1] - aScalarRange[0]; + vtkFloatingPointType aScale[3] = {1.0, 1.0, 1.0}; + static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT; if(theTransform){ aScale[0] = theTransform->GetScale()[0]; aScale[1] = theTransform->GetScale()[1]; @@ -163,9 +163,9 @@ ExecVectors(VISU_FieldTransform::TTransformFun theFunction, } if(theFunction == &(VISU_FieldTransform::Ident)){ for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) { - float anInVec[3]; + vtkFloatingPointType anInVec[3]; anInVectors->GetTuple(aTupleId,anInVec); - float anNewVec[3]; + vtkFloatingPointType anNewVec[3]; anNewVec[0] = anInVec[0]*aScale[0]; anNewVec[1] = anInVec[1]*aScale[1]; anNewVec[2] = anInVec[2]*aScale[2]; @@ -173,14 +173,14 @@ ExecVectors(VISU_FieldTransform::TTransformFun theFunction, } }else{ for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) { - float anInVec[3]; + vtkFloatingPointType anInVec[3]; anInVectors->GetTuple(aTupleId,anInVec); - float aMagn = vtkMath::Norm(anInVec); + vtkFloatingPointType aMagn = vtkMath::Norm(anInVec); if(aMagn > EPS) aMagn = ((*theFunction)(aMagn) - aScalarRange[0]) / aDelta * theScalarRange[1] / aMagn; if(aMagn < 0.0) aMagn = 0.0; - float anNewVec[3]; + vtkFloatingPointType anNewVec[3]; anNewVec[0] = anInVec[0]*aMagn*aScale[0]; anNewVec[1] = anInVec[1]*aMagn*aScale[1]; anNewVec[2] = anInVec[2]*aMagn*aScale[2]; @@ -193,7 +193,7 @@ ExecVectors(VISU_FieldTransform::TTransformFun theFunction, template void ExecScalars(VISU_FieldTransform::TTransformFun theFunction, - float theScalarRange[2], + vtkFloatingPointType theScalarRange[2], int theNbOfTuples, TypeData* theInputData, TypeData* theOutputData) @@ -204,9 +204,9 @@ ExecScalars(VISU_FieldTransform::TTransformFun theFunction, vtkFloatArray *aNewScalars = vtkFloatArray::New(); aNewScalars->SetNumberOfComponents(1); aNewScalars->SetNumberOfTuples(theNbOfTuples); - float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; + vtkFloatingPointType aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) { - float aScalar = (*theFunction)(anInScalars->GetTuple1(aTupleId)); + vtkFloatingPointType aScalar = (*theFunction)(anInScalars->GetTuple1(aTupleId)); if(aScalar < aScalarRange[0]) aScalar = aScalarRange[0]; aNewScalars->SetTuple1(aTupleId,aScalar); diff --git a/src/PIPELINE/VISU_FieldTransform.hxx b/src/PIPELINE/VISU_FieldTransform.hxx index 1a22f59a..7050aed3 100644 --- a/src/PIPELINE/VISU_FieldTransform.hxx +++ b/src/PIPELINE/VISU_FieldTransform.hxx @@ -48,10 +48,10 @@ public: void SetSpaceTransform(VTKViewer_Transform* theTransform); VTKViewer_Transform* GetSpaceTransform() { return myTransform;} - float* GetScalarRange(){ return myScalarRange; } - void SetScalarRange(float theScalarRange[2]); - void SetScalarMin(float theValue); - void SetScalarMax(float theValue); + vtkFloatingPointType* GetScalarRange(){ return myScalarRange; } + void SetScalarRange(vtkFloatingPointType theScalarRange[2]); + void SetScalarMin(vtkFloatingPointType theValue); + void SetScalarMax(vtkFloatingPointType theValue); protected: VISU_FieldTransform(); @@ -62,7 +62,7 @@ protected: VTKViewer_Transform *myTransform; TTransformFun myFunction; - float myScalarRange[2]; + vtkFloatingPointType myScalarRange[2]; }; #endif diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 8d1d0dff..c8827e9f 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -196,9 +196,9 @@ VISU_GaussPointsPL Superclass::Init(); vtkDataSet* aDataSet = GetParentMesh(); - float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); + vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); - float* aScalarRange = GetScalarRange(); + vtkFloatingPointType* aScalarRange = GetScalarRange(); static double EPS = 1.0 / VTK_LARGE_FLOAT; if(fabs(aScalarRange[1]) > EPS) SetScale( aScaleFactor / aScalarRange[1] ); @@ -229,7 +229,7 @@ VISU_GaussPointsPL ::Update() { //cout << "VISU_GaussPointsPL::Update()" << endl; - float* aScalarRange = GetScalarRange(); + vtkFloatingPointType* aScalarRange = GetScalarRange(); mySourceScalarRange[0] = aScalarRange[0]; mySourceScalarRange[1] = aScalarRange[1]; myDeltaScalarRange = aScalarRange[1] - aScalarRange[0]; @@ -256,7 +256,7 @@ VISU_GaussPointsPL { //cout << "VISU_GaussPointsPL::UpdateGlyph()" << endl; - float* aScalarRange = GetScalarRange(); + vtkFloatingPointType* aScalarRange = GetScalarRange(); if( myPSMapper->GetPointSpriteMode() == 0 ) // Results { @@ -265,13 +265,13 @@ VISU_GaussPointsPL myGlyph->SetScaleModeToScaleByScalar(); myGlyph->SetColorModeToColorByScalar(); - float aRange = 0; - float aMinSize = GetMinSize(); - float aMaxSize = GetMaxSize(); + vtkFloatingPointType aRange = 0; + vtkFloatingPointType aMinSize = GetMinSize(); + vtkFloatingPointType aMaxSize = GetMaxSize(); if( fabs( aMaxSize - aMinSize ) > 0.0001 ) aRange = ( aScalarRange[1] - aScalarRange[0] ) / ( aMaxSize - aMinSize ); - float aMinRange = aScalarRange[0] - aMinSize * aRange; - float aMaxRange = aMinRange + aRange; + vtkFloatingPointType aMinRange = aScalarRange[0] - aMinSize * aRange; + vtkFloatingPointType aMaxRange = aMinRange + aRange; myGlyph->SetRange( aMinRange, aMaxRange ); myGlyph->SetScaleFactor( 1.0 ); @@ -306,7 +306,7 @@ VISU_GaussPointsPL return myGaussPtsIDMapper->GetObjID(theID); } -float* +vtkFloatingPointType* VISU_GaussPointsPL ::GetNodeCoord(int theObjID) { @@ -422,7 +422,7 @@ VISU_GaussPointsPL } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMaximumSupportedSize() { @@ -432,14 +432,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetClamp(float theClamp) +::SetClamp(vtkFloatingPointType theClamp) { myPSMapper->SetPointSpriteClamp( theClamp ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetClamp() { @@ -449,14 +449,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetSize(float theSize) +::SetSize(vtkFloatingPointType theSize) { myPSMapper->SetPointSpriteSize( theSize ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetSize() { @@ -466,14 +466,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetMinSize(float theMinSize) +::SetMinSize(vtkFloatingPointType theMinSize) { myPSMapper->SetPointSpriteMinSize( theMinSize ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMinSize() { @@ -483,14 +483,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetMaxSize(float theMaxSize) +::SetMaxSize(vtkFloatingPointType theMaxSize) { myPSMapper->SetPointSpriteMaxSize( theMaxSize ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMaxSize() { @@ -500,14 +500,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetMagnification(float theMagnification) +::SetMagnification(vtkFloatingPointType theMagnification) { myPSMapper->SetPointSpriteMagnification( theMagnification ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMagnification() { @@ -517,7 +517,7 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetMagnificationIncrement(float theIncrement) +::SetMagnificationIncrement(vtkFloatingPointType theIncrement) { myMagnificationIncrement = theIncrement; } @@ -525,14 +525,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetAlphaThreshold(float theAlphaThreshold) +::SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold) { myPSMapper->SetPointSpriteAlphaThreshold( theAlphaThreshold ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetAlphaThreshold() { @@ -554,25 +554,25 @@ void VISU_GaussPointsPL ::ChangeMagnification( bool up ) { - float anIncrement = up ? myMagnificationIncrement : 1.0 / myMagnificationIncrement; + vtkFloatingPointType anIncrement = up ? myMagnificationIncrement : 1.0 / myMagnificationIncrement; SetMagnification( GetMagnification() * anIncrement ); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray) { - float aMaxSize = GetAverageCellSize() * GetMaxSize(); - float aMinSize = GetAverageCellSize() * GetMinSize(); - float aDelta = aMaxSize - aMinSize; - float aVal = theScalarArray->GetTuple1(theID); + vtkFloatingPointType aMaxSize = GetAverageCellSize() * GetMaxSize(); + vtkFloatingPointType aMinSize = GetAverageCellSize() * GetMinSize(); + vtkFloatingPointType aDelta = aMaxSize - aMinSize; + vtkFloatingPointType aVal = theScalarArray->GetTuple1(theID); return aMinSize + aDelta*(aVal - mySourceScalarRange[0])/myDeltaScalarRange; } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMaxPointSize() { @@ -580,7 +580,7 @@ VISU_GaussPointsPL } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetPointSize(vtkIdType theID) { @@ -594,14 +594,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetAverageCellSize(float theAverageCellSize) +::SetAverageCellSize(vtkFloatingPointType theAverageCellSize) { myPSMapper->SetAverageCellSize( theAverageCellSize ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetAverageCellSize() { @@ -678,19 +678,19 @@ VISU_GaussPointsPL return aCompositeImageData; } -void VISU_GaussPointsPL::SetScale( float theScale ) +void VISU_GaussPointsPL::SetScale( vtkFloatingPointType theScale ) { myWarpVector->SetScaleFactor( theScale ); myScaleFactor = GetScale(); Modified(); } -float VISU_GaussPointsPL::GetScale() +vtkFloatingPointType VISU_GaussPointsPL::GetScale() { return myWarpVector->GetScaleFactor(); } -void VISU_GaussPointsPL::SetMapScale( float theMapScale ) +void VISU_GaussPointsPL::SetMapScale( vtkFloatingPointType theMapScale ) { VISU_ScalarMapPL::SetMapScale( theMapScale ); diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index b342ab56..e8b47fc4 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -107,7 +107,7 @@ public: GetObjID(vtkIdType theID) const; virtual - float* + vtkFloatingPointType* GetNodeCoord(vtkIdType theObjID); void @@ -150,63 +150,63 @@ public: GetPrimitiveType(); //! Get the maximum Point Sprite size, which is supported by hardware. - float + vtkFloatingPointType GetMaximumSupportedSize(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp. void - SetClamp(float theClamp); + SetClamp(vtkFloatingPointType theClamp); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, vtkFloatingPointType). + vtkFloatingPointType GetClamp(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteSize. void - SetSize(float theSize); + SetSize(vtkFloatingPointType theSize); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, vtkFloatingPointType). + vtkFloatingPointType GetSize(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize. void - SetMinSize(float theMinSize); + SetMinSize(vtkFloatingPointType theMinSize); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, vtkFloatingPointType). + vtkFloatingPointType GetMinSize(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize. void - SetMaxSize(float theMaxSize); + SetMaxSize(vtkFloatingPointType theMaxSize); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, vtkFloatingPointType). + vtkFloatingPointType GetMaxSize(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification. void - SetMagnification(float theMagnification); + SetMagnification(vtkFloatingPointType theMagnification); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, vtkFloatingPointType). + vtkFloatingPointType GetMagnification(); //! Set the increment of changing Magnification parameter. void - SetMagnificationIncrement(float theIncrement); + SetMagnificationIncrement(vtkFloatingPointType theIncrement); //! Get the increment of changing Magnification parameter. - float + vtkFloatingPointType GetMagnificationIncrement() { return myMagnificationIncrement; } //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold. void - SetAlphaThreshold(float theAlphaThreshold); + SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, vtkFloatingPointType). + vtkFloatingPointType GetAlphaThreshold(); //! Set resolution of the Geometrical Sphere. @@ -222,23 +222,23 @@ public: ChangeMagnification( bool up ); //! Get the maximum size of Point Sprites in the presentation. - float + vtkFloatingPointType GetMaxPointSize(); //! Get point size by element's Id. - float + vtkFloatingPointType GetPointSize(vtkIdType theID); //! Get point size by element's Id using the specified scalar array. - float + vtkFloatingPointType GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, float). + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, vtkFloatingPointType). void - SetAverageCellSize(float AverageCellSize); + SetAverageCellSize(vtkFloatingPointType AverageCellSize); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, vtkFloatingPointType). + vtkFloatingPointType GetAverageCellSize(); //! Set image data for the Point Sprite texture. @@ -259,13 +259,13 @@ public: virtual void SetIsDeformed( bool theIsDeformed ); virtual bool GetIsDeformed() const; - virtual void SetScale( float theScale ); - virtual float GetScale(); - virtual void SetMapScale( float theMapScale = 1.0 ); + virtual void SetScale( vtkFloatingPointType theScale ); + virtual vtkFloatingPointType GetScale(); + virtual void SetMapScale( vtkFloatingPointType theMapScale = 1.0 ); protected: bool myIsDeformed; - float myScaleFactor; + vtkFloatingPointType myScaleFactor; vtkWarpVector *myWarpVector; vtkCellDataToPointData* myCellDataToPointData; std::vector myPassFilter; @@ -281,11 +281,11 @@ protected: vtkGeometryFilter* myGeomFilter; vtkDataArray *myScalarArray; - float mySourceScalarRange[2]; - float myDeltaScalarRange; + vtkFloatingPointType mySourceScalarRange[2]; + vtkFloatingPointType myDeltaScalarRange; int myPrimitiveType; - float myMagnificationIncrement; + vtkFloatingPointType myMagnificationIncrement; }; #endif diff --git a/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx b/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx index 3a3c21a8..08a8dbba 100644 --- a/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx +++ b/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx @@ -54,7 +54,7 @@ VISU_UnScaledActor::VISU_UnScaledActor() // function: SetCenter // purpose: //==================================================================== -void VISU_UnScaledActor::SetCenter(float *pC) +void VISU_UnScaledActor::SetCenter(vtkFloatingPointType *pC) { for (int i=0; i<3; ++i){ myCenter[i]=pC[i]; @@ -64,7 +64,7 @@ void VISU_UnScaledActor::SetCenter(float *pC) // function:GetBounds // purpose: //==================================================================== -float* VISU_UnScaledActor::GetBounds() +vtkFloatingPointType* VISU_UnScaledActor::GetBounds() { Superclass::GetBounds(); // @@ -81,20 +81,20 @@ float* VISU_UnScaledActor::GetBounds() void VISU_UnScaledActor::Render(vtkRenderer *theRenderer) { if(theRenderer){ - float P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; + vtkFloatingPointType 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]); - float 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])); + vtkFloatingPointType 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(); - float aWinDiag = sqrt(float(aSize[0]*aSize[0]+aSize[1]*aSize[1])); + vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1])); vtkDataSet* aDataSet = GetMapper()->GetInput(); - float aLength = aDataSet->GetLength(); - float aPrecision = 1.e-3; - float anOldScale = GetScale()[0]; - float aScale = - mySize*aWorldDiag/aWinDiag/aLength*sqrt(float(aSize[0])/float(aSize[1])); + vtkFloatingPointType aLength = aDataSet->GetLength(); + vtkFloatingPointType aPrecision = 1.e-3; + vtkFloatingPointType anOldScale = GetScale()[0]; + vtkFloatingPointType aScale = + mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1])); SetOrigin(myCenter); // diff --git a/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx b/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx index 8f46e43b..3e278dc0 100644 --- a/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx +++ b/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx @@ -43,16 +43,16 @@ public: static VISU_UnScaledActor *New(); - void SetCenter(float *); + void SetCenter(vtkFloatingPointType *); virtual void SetSize(int theSize); virtual void Render(vtkRenderer *theRenderer); - virtual float *GetBounds(); + virtual vtkFloatingPointType *GetBounds(); protected: VISU_UnScaledActor(); ~VISU_UnScaledActor(){} - float myCenter[3]; + vtkFloatingPointType myCenter[3]; int mySize; }; diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index 8e14bca9..13941e70 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -33,13 +33,17 @@ vtkStandardNewMacro(VISU_IsoSurfacesPL); -VISU_IsoSurfacesPL::VISU_IsoSurfacesPL(){ +VISU_IsoSurfacesPL +::VISU_IsoSurfacesPL() +{ myContourFilter = vtkContourFilter::New(); myCellDataToPointData = vtkCellDataToPointData::New(); myIsShrinkable = false; } -VISU_IsoSurfacesPL::~VISU_IsoSurfacesPL(){ +VISU_IsoSurfacesPL +::~VISU_IsoSurfacesPL() +{ myContourFilter->UnRegisterAllOutputs(); myContourFilter->Delete(); @@ -47,71 +51,105 @@ VISU_IsoSurfacesPL::~VISU_IsoSurfacesPL(){ myCellDataToPointData->Delete(); } -void VISU_IsoSurfacesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_IsoSurfacesPL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ if(VISU_IsoSurfacesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetNbParts(aPipeLine->GetNbParts()); - float aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()}; + vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()}; SetRange(aRange); } VISU_ScalarMapPL::ShallowCopy(thePipeLine); } -int VISU_IsoSurfacesPL::GetNbParts() { +int +VISU_IsoSurfacesPL +::GetNbParts() +{ return myContourFilter->GetNumberOfContours(); } -void VISU_IsoSurfacesPL::SetNbParts(int theNb) { +void +VISU_IsoSurfacesPL +::SetNbParts(int theNb) +{ myContourFilter->SetNumberOfContours(theNb); Modified(); } -void VISU_IsoSurfacesPL::SetScaling(int theScaling) { +void +VISU_IsoSurfacesPL +::SetScaling(int theScaling) +{ VISU_ScalarMapPL::SetScaling(theScaling); SetRange(myRange); } -void VISU_IsoSurfacesPL::SetRange(float theRange[2]){ +void +VISU_IsoSurfacesPL +::SetRange(vtkFloatingPointType theRange[2]) +{ if(theRange[0] <= theRange[1]){ myRange[0] = theRange[0]; myRange[1] = theRange[1]; - float aRange[2] = {myRange[0], myRange[1]}; + vtkFloatingPointType aRange[2] = {myRange[0], myRange[1]}; if(GetScaling() == VTK_SCALE_LOG10) VISU_LookupTable::ComputeLogRange(theRange,aRange); myContourFilter->GenerateValues(GetNbParts(),aRange); Modified(); } } -float VISU_IsoSurfacesPL::GetMin() { + +vtkFloatingPointType +VISU_IsoSurfacesPL +::GetMin() +{ return myRange[0]; } -float VISU_IsoSurfacesPL::GetMax() { + +vtkFloatingPointType +VISU_IsoSurfacesPL +::GetMax() +{ return myRange[1]; } -void VISU_IsoSurfacesPL::Init(){ +void +VISU_IsoSurfacesPL +::Init() +{ VISU_ScalarMapPL::Init(); SetNbParts(10); - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); SetRange(aScalarRange); } -VISU_ScalarMapPL::THook* VISU_IsoSurfacesPL::DoHook(){ +VISU_ScalarMapPL::THook* +VISU_IsoSurfacesPL +::DoHook() +{ VISU::CellDataToPoint(myContourFilter,myCellDataToPointData,GetInput2(),myFieldTransform); return myContourFilter->GetOutput(); } -void VISU_IsoSurfacesPL::Update() +void +VISU_IsoSurfacesPL +::Update() { VISU_ScalarMapPL::Update(); } -void VISU_IsoSurfacesPL::SetMapScale(float theMapScale){ +void +VISU_IsoSurfacesPL +::SetMapScale(vtkFloatingPointType theMapScale) +{ VISU_ScalarMapPL::SetMapScale(theMapScale); - float aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()}; - float aNewRange[2] = {aRange[0], aRange[1]}; + vtkFloatingPointType aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()}; + vtkFloatingPointType aNewRange[2] = {aRange[0], aRange[1]}; if(GetScaling() == VTK_SCALE_LOG10) VISU_LookupTable::ComputeLogRange(aRange,aNewRange); myContourFilter->GenerateValues(GetNbParts(),aNewRange); diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx index 68732e37..2b62fb18 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.hxx @@ -32,33 +32,70 @@ class vtkContourFilter; class vtkCellDataToPointData; -class VISU_IsoSurfacesPL : public VISU_ScalarMapPL{ +class VISU_IsoSurfacesPL : public VISU_ScalarMapPL +{ protected: VISU_IsoSurfacesPL(); VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&); + + virtual + ~VISU_IsoSurfacesPL(); + public: vtkTypeMacro(VISU_IsoSurfacesPL,VISU_ScalarMapPL); - static VISU_IsoSurfacesPL* New(); - virtual ~VISU_IsoSurfacesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual int GetNbParts(); - virtual void SetNbParts(int theNb = 10); + static + VISU_IsoSurfacesPL* + New(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + int + GetNbParts(); + + virtual + void + SetNbParts(int theNb = 10); + + virtual + void + SetScaling(int theScaling = VTK_SCALE_LINEAR); - virtual void SetScaling(int theScaling = VTK_SCALE_LINEAR); - virtual void SetRange(float theRange[2]); - virtual float GetMin(); - virtual float GetMax(); + virtual + void + SetRange(vtkFloatingPointType theRange[2]); + + virtual + vtkFloatingPointType + GetMin(); + + virtual + vtkFloatingPointType + GetMax(); public: - virtual void Init(); - virtual void Update(); - virtual THook* DoHook(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual + void + Init(); + + virtual + void + Update(); + + virtual + THook* + DoHook(); + + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); protected: int myNbParts; - float myRange[2]; + vtkFloatingPointType myRange[2]; vtkCellDataToPointData* myCellDataToPointData; vtkContourFilter *myContourFilter; }; diff --git a/src/PIPELINE/VISU_LookupTable.cxx b/src/PIPELINE/VISU_LookupTable.cxx index c15fdd27..9d9b533b 100644 --- a/src/PIPELINE/VISU_LookupTable.cxx +++ b/src/PIPELINE/VISU_LookupTable.cxx @@ -32,17 +32,18 @@ using namespace std; -VISU_LookupTable *VISU_LookupTable::New() { - vtkObject* ret = vtkObjectFactory::CreateInstance("VISU_LookupTable"); - if(ret) - return (VISU_LookupTable*)ret; - return new VISU_LookupTable; -} +vtkStandardNewMacro(VISU_LookupTable); -VISU_LookupTable::VISU_LookupTable(int sze, int ext) - : vtkLookupTable(sze, ext), myScale(1.0), myBicolor(false) {} +VISU_LookupTable +::VISU_LookupTable(int sze, int ext): + vtkLookupTable(sze, ext), + myScale(1.0), + myBicolor(false) +{} -void VISU_LookupTable::SetMapScale(float theScale) +void +VISU_LookupTable +::SetMapScale(vtkFloatingPointType theScale) { if( myScale != theScale ) { @@ -61,7 +62,11 @@ void VISU_LookupTable::SetBicolor( bool theBicolor ) } -int VISU_LookupTable::ComputeLogRange(float inRange[2], float outRange[2]){ +int +VISU_LookupTable +::ComputeLogRange(vtkFloatingPointType inRange[2], + vtkFloatingPointType outRange[2]) +{ if(inRange[0] >= inRange[1]) return -1; if(0.0 <= inRange[0] && 0.0 < inRange[1]){ @@ -79,9 +84,12 @@ int VISU_LookupTable::ComputeLogRange(float inRange[2], float outRange[2]){ return -1; } -unsigned char* VISU_LookupTable::MapValue(float v) { +unsigned char* +VISU_LookupTable +::MapValue(vtkFloatingPointType v) +{ if(GetScale() == VTK_SCALE_LOG10) { - float aLowBound = log10(this->TableRange[0]); + vtkFloatingPointType aLowBound = log10(this->TableRange[0]); v = pow(10.0f,aLowBound + (v - aLowBound)*myScale); return vtkLookupTable::MapValue(v); } else if (!myBicolor) { @@ -95,8 +103,11 @@ unsigned char* VISU_LookupTable::MapValue(float v) { } // Apply log to value, with appropriate constraints. -inline float VISU_ApplyLogScale(float v, float range[2], - float logRange[2]) +inline +vtkFloatingPointType +VISU_ApplyLogScale(vtkFloatingPointType v, + vtkFloatingPointType range[2], + vtkFloatingPointType logRange[2]) { // is the range set for negative numbers? if (range[0] < 0) @@ -133,15 +144,18 @@ inline float VISU_ApplyLogScale(float v, float range[2], } // Apply shift/scale to the scalar value v and do table lookup. -inline unsigned char *VISU_LinearLookup(float v, - unsigned char *table, - float maxIndex, - float shift, float scale, - bool bicolor) +inline +unsigned char * +VISU_LinearLookup(vtkFloatingPointType v, + unsigned char *table, + vtkFloatingPointType maxIndex, + vtkFloatingPointType shift, + vtkFloatingPointType scale, + bool bicolor) { if( !bicolor ) { - float findx = (v + shift)*scale; + vtkFloatingPointType findx = (v + shift)*scale; if (findx < 0) findx = 0; if (findx > maxIndex) @@ -161,25 +175,30 @@ inline unsigned char *VISU_LinearLookup(float v, // accelerate the mapping by copying the data in 32-bit chunks instead // of 8-bit chunks template -void VISU_LookupTableMapData(vtkLookupTable *self, T *input, - unsigned char *output, int length, - int inIncr, int outFormat, - float theMapScale, bool bicolor) +void +VISU_LookupTableMapData(vtkLookupTable *self, + T *input, + unsigned char *output, + int length, + int inIncr, + int outFormat, + vtkFloatingPointType theMapScale, + bool bicolor) { int i = length; - float *range = self->GetTableRange(); - float maxIndex = self->GetNumberOfColors() - 1; - float shift, scale; + vtkFloatingPointType *range = self->GetTableRange(); + vtkFloatingPointType maxIndex = self->GetNumberOfColors() - 1; + vtkFloatingPointType shift, scale; unsigned char *table = self->GetPointer(0); unsigned char *cptr; - float alpha; + vtkFloatingPointType alpha; if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required { if (self->GetScale() == VTK_SCALE_LOG10) { - float val; - float logRange[2]; + vtkFloatingPointType val; + vtkFloatingPointType logRange[2]; VISU_LookupTable::ComputeLogRange(range, logRange); shift = -logRange[0]; if (logRange[1] <= logRange[0]) @@ -309,8 +328,8 @@ void VISU_LookupTableMapData(vtkLookupTable *self, T *input, { if (self->GetScale() == VTK_SCALE_LOG10) { - float val; - float logRange[2]; + vtkFloatingPointType val; + vtkFloatingPointType logRange[2]; VISU_LookupTable::ComputeLogRange(range, logRange); shift = -logRange[0]; if (logRange[1] <= logRange[0]) @@ -441,10 +460,15 @@ void VISU_LookupTableMapData(vtkLookupTable *self, T *input, // it is only done on the first render. Colors are cached // for subsequent renders. template -void VISU_LookupTableMapMag(vtkLookupTable *self, T *input, - unsigned char *output, int length, - int inIncr, int outFormat, - float theMapScale, bool bicolor) +void +VISU_LookupTableMapMag(vtkLookupTable *self, + T *input, + unsigned char *output, + int length, + int inIncr, + int outFormat, + vtkFloatingPointType theMapScale, + bool bicolor) { double tmp, sum; double *mag; diff --git a/src/PIPELINE/VISU_LookupTable.hxx b/src/PIPELINE/VISU_LookupTable.hxx index 20f7c23e..72af94a3 100644 --- a/src/PIPELINE/VISU_LookupTable.hxx +++ b/src/PIPELINE/VISU_LookupTable.hxx @@ -20,20 +20,20 @@ class VISU_LookupTable: public vtkLookupTable { int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement); - float GetMapScale() { return myScale; } - void SetMapScale(float theScale = 1.0); + vtkFloatingPointType GetMapScale() { return myScale; } + void SetMapScale(vtkFloatingPointType theScale = 1.0); - float GetBicolor() { return myBicolor; } + bool GetBicolor() { return myBicolor; } void SetBicolor( bool theBicolor ); - static int ComputeLogRange(float inRange[2], float outRange[2]); - unsigned char *MapValue(float v); + static int ComputeLogRange(vtkFloatingPointType inRange[2], vtkFloatingPointType outRange[2]); + unsigned char *MapValue(vtkFloatingPointType v); protected: VISU_LookupTable(int sze=256, int ext=256); ~VISU_LookupTable() {}; - float myScale; + vtkFloatingPointType myScale; bool myBicolor; }; diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index d8eb9e8a..9edaf2e9 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -406,7 +406,7 @@ bool VISU_OpenGLPointSpriteMapper::InitExtensions() //----------------------------------------------------------------------------- float ViewToDisplay( vtkRenderer* theRenderer ) { - float p1[3], p2[3]; + vtkFloatingPointType p1[3], p2[3]; theRenderer->SetViewPoint( 0.0, 0.0, 0.0 ); theRenderer->ViewToDisplay(); @@ -416,7 +416,7 @@ float ViewToDisplay( vtkRenderer* theRenderer ) theRenderer->ViewToDisplay(); theRenderer->GetDisplayPoint( p2 ); - float coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 ); + vtkFloatingPointType coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 ); //cout << p1[0] << " " << p1[1] << " " << p1[2] << endl; //cout << p2[0] << " " << p2[1] << " " << p2[2] << endl; //cout << "ZOOM : " << coefficient << endl; @@ -753,7 +753,7 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(vtkPoints *thePoints, TVertex* aVertexArr = new TVertex[ this->TotalCells ]; - float* aPropertyColor = theActor->GetProperty()->GetColor(); + vtkFloatingPointType* aPropertyColor = theActor->GetProperty()->GetColor(); float aColor[3] = {aPropertyColor[0], aPropertyColor[1], aPropertyColor[2]}; unsigned long i = 0; @@ -763,7 +763,7 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(vtkPoints *thePoints, { TVertex& aVertex = aVertexArr[i]; vtkIdType aPointId = pts[0]; - float* aCoords = thePoints->GetPoint( aPointId ); + vtkFloatingPointType* aCoords = thePoints->GetPoint( aPointId ); aVertex.vx = aCoords[0]; aVertex.vy = aCoords[1]; aVertex.vz = aCoords[2]; diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index 9fcd66fd..34ba2a61 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -181,7 +181,7 @@ VISU_PipeLine int VISU_PipeLine -::CheckAvailableMemory(const float& theSize) +::CheckAvailableMemory(const vtkFloatingPointType& theSize) { try{ if(theSize > ULONG_MAX) return 0; @@ -202,10 +202,10 @@ VISU_PipeLine return 0; } -float +vtkFloatingPointType VISU_PipeLine -::GetAvailableMemory(float theSize, - float theMinSize) +::GetAvailableMemory(vtkFloatingPointType theSize, + vtkFloatingPointType theMinSize) { while(!CheckAvailableMemory(theSize)) if(theSize > theMinSize) @@ -279,36 +279,36 @@ VISU_PipeLine static void ComputeBoundsParam (vtkDataSet* theDataSet, - float theDirection[3], - float theMinPnt[3], - float& theMaxBoundPrj, - float& theMinBoundPrj) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType theMinPnt[3], + vtkFloatingPointType& theMaxBoundPrj, + vtkFloatingPointType& theMinBoundPrj) { - float aBounds[6]; + vtkFloatingPointType aBounds[6]; theDataSet->GetBounds(aBounds); //Enlarge bounds in order to avoid conflicts of precision for(int i = 0; i < 6; i += 2){ static double EPS = 1.0E-3; - float aDelta = (aBounds[i+1] - aBounds[i])*EPS; + vtkFloatingPointType aDelta = (aBounds[i+1] - aBounds[i])*EPS; aBounds[i] -= aDelta; aBounds[i+1] += aDelta; } - float aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, - {aBounds[1],aBounds[2],aBounds[4]}, - {aBounds[0],aBounds[3],aBounds[4]}, - {aBounds[1],aBounds[3],aBounds[4]}, - {aBounds[0],aBounds[2],aBounds[5]}, - {aBounds[1],aBounds[2],aBounds[5]}, - {aBounds[0],aBounds[3],aBounds[5]}, - {aBounds[1],aBounds[3],aBounds[5]}}; + vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, + {aBounds[1],aBounds[2],aBounds[4]}, + {aBounds[0],aBounds[3],aBounds[4]}, + {aBounds[1],aBounds[3],aBounds[4]}, + {aBounds[0],aBounds[2],aBounds[5]}, + {aBounds[1],aBounds[2],aBounds[5]}, + {aBounds[0],aBounds[3],aBounds[5]}, + {aBounds[1],aBounds[3],aBounds[5]}}; int aMaxId = 0, aMinId = aMaxId; theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]); theMinBoundPrj = theMaxBoundPrj; for(int i = 1; i < 8; i++){ - float aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]); + vtkFloatingPointType aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]); if(theMaxBoundPrj < aTmp){ theMaxBoundPrj = aTmp; aMaxId = i; @@ -318,7 +318,7 @@ ComputeBoundsParam (vtkDataSet* theDataSet, aMinId = i; } } - float *aMinPnt = aBoundPoints[aMaxId]; + vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId]; theMinPnt[0] = aMinPnt[0]; theMinPnt[1] = aMinPnt[1]; theMinPnt[2] = aMinPnt[2]; @@ -327,13 +327,13 @@ ComputeBoundsParam (vtkDataSet* theDataSet, static void DistanceToPosition(vtkDataSet* theDataSet, - float theDirection[3], - float theDist, - float thePos[3]) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType theDist, + vtkFloatingPointType thePos[3]) { - float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; + vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj); - float aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist; + vtkFloatingPointType aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist; thePos[0] = aMinPnt[0]-theDirection[0]*aLength; thePos[1] = aMinPnt[1]-theDirection[1]*aLength; thePos[2] = aMinPnt[2]-theDirection[2]*aLength; @@ -342,37 +342,37 @@ DistanceToPosition(vtkDataSet* theDataSet, static void PositionToDistance (vtkDataSet* theDataSet, - float theDirection[3], - float thePos[3], - float& theDist) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType thePos[3], + vtkFloatingPointType& theDist) { - float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; + vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj); - float aPrj = vtkMath::Dot(theDirection,thePos); + vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos); theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj); } void VISU_PipeLine -::SetPlaneParam(float theDir[3], - float theDist, +::SetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType theDist, vtkPlane* thePlane) { thePlane->SetNormal(theDir); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; ::DistanceToPosition(GetInput(),theDir,theDist,anOrigin); thePlane->SetOrigin(anOrigin); } void VISU_PipeLine -::GetPlaneParam(float theDir[3], - float& theDist, +::GetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType& theDist, vtkPlane* thePlane) { thePlane->GetNormal(theDir); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; thePlane->GetOrigin(anOrigin); ::PositionToDistance(GetInput(),theDir,anOrigin,theDist); } @@ -385,7 +385,7 @@ bool VISU_PipeLine ::IsPlanarInput() const { - float aBounds[6]; + vtkFloatingPointType aBounds[6]; GetInput()->GetBounds( aBounds ); // xmin,xmax, ymin,ymax, zmin,zmax if (fabs( aBounds[0] - aBounds[1] ) <= FLT_MIN || fabs( aBounds[2] - aBounds[3] ) <= FLT_MIN || @@ -412,7 +412,7 @@ VISU_PipeLine return myExtractGeometry->GetNodeVTKId(anID); } -float* +vtkFloatingPointType* VISU_PipeLine ::GetNodeCoord(int theObjID) { diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index 5e2a1ed8..76d3d2bc 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -135,12 +135,12 @@ public: static int - CheckAvailableMemory(const float& theSize); + CheckAvailableMemory(const vtkFloatingPointType& theSize); static - float - GetAvailableMemory(float theSize = 16*1024*1024.0, - float theMinSize = 1024*1024.0); + vtkFloatingPointType + GetAvailableMemory(vtkFloatingPointType theSize = 16*1024*1024.0, + vtkFloatingPointType theMinSize = 1024*1024.0); // Clipping planes void @@ -156,13 +156,13 @@ public: GetClippingPlane(vtkIdType theID) const; void - SetPlaneParam(float theDir[3], - float theDist, + SetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType theDist, vtkPlane* thePlane); void - GetPlaneParam(float theDir[3], - float& theDist, + GetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType& theDist, vtkPlane* thePlane); bool @@ -177,7 +177,7 @@ public: GetNodeVTKID(vtkIdType theID); virtual - float* + vtkFloatingPointType* GetNodeCoord(vtkIdType theObjID); virtual diff --git a/src/PIPELINE/VISU_PipeLineUtils.cxx b/src/PIPELINE/VISU_PipeLineUtils.cxx index f60c2cca..404baf1e 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.cxx +++ b/src/PIPELINE/VISU_PipeLineUtils.cxx @@ -26,11 +26,19 @@ #include "VISU_PipeLineUtils.hxx" -void VISU::Mul(const float A[3], float b, float C[3]){ // A*b; +void +VISU::Mul(const vtkFloatingPointType A[3], + vtkFloatingPointType b, + vtkFloatingPointType C[3]) +{ // A*b; for(int i = 0; i < 3; i++) C[i] = A[i]*b; } -void VISU::Sub(const float A[3], const float B[3], float C[3]){ //A-B +void +VISU::Sub(const vtkFloatingPointType A[3], + const vtkFloatingPointType B[3], + vtkFloatingPointType C[3]) +{ //A-B for(int i = 0; i < 3; i++) C[i] = A[i] - B[i]; } diff --git a/src/PIPELINE/VISU_PipeLineUtils.hxx b/src/PIPELINE/VISU_PipeLineUtils.hxx index 7b252350..af67ea96 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.hxx +++ b/src/PIPELINE/VISU_PipeLineUtils.hxx @@ -55,9 +55,17 @@ #endif -namespace VISU{ - void Mul(const float A[3], float b, float C[3]); // C = A * b - void Sub(const float A[3], const float B[3], float C[3]); // C = A - B +namespace VISU +{ + void + Mul(const vtkFloatingPointType A[3], + vtkFloatingPointType b, + vtkFloatingPointType C[3]); // C = A * b + + void + Sub(const vtkFloatingPointType A[3], + const vtkFloatingPointType B[3], + vtkFloatingPointType C[3]); // C = A - B template void diff --git a/src/PIPELINE/VISU_PlanesWidget.cxx b/src/PIPELINE/VISU_PlanesWidget.cxx index 93efa07b..dff6b274 100644 --- a/src/PIPELINE/VISU_PlanesWidget.cxx +++ b/src/PIPELINE/VISU_PlanesWidget.cxx @@ -61,16 +61,19 @@ #include static - bool IsValidPlane2Position(vtkPlane *pPx, - vtkDataSet *pDataSet, - float aTol=0.003); +bool +IsValidPlane2Position(vtkPlane *pPx, + vtkDataSet *pDataSet, + vtkFloatingPointType aTol=0.003); static - void GetBndPoints(vtkDataSet *pDataSet, - float aPnts[24]); +void +GetBndPoints(vtkDataSet *pDataSet, + vtkFloatingPointType aPnts[24]); static - float DistanceToPlane(const float x[3], - const float n[3], - const float p0[3]); +vtkFloatingPointType +DistanceToPlane(const vtkFloatingPointType x[3], + const vtkFloatingPointType n[3], + const vtkFloatingPointType p0[3]); vtkCxxRevisionMacro(VISU_PlanesWidget, "$Revision$"); vtkStandardNewMacro(VISU_PlanesWidget); @@ -207,7 +210,7 @@ VISU_PlanesWidget::VISU_PlanesWidget() this->Transform = vtkTransform::New(); // Define the point coordinates - float bounds[6]; + vtkFloatingPointType bounds[6]; bounds[0] = -0.5; bounds[1] = 0.5; bounds[2] = -0.5; @@ -311,14 +314,16 @@ vtkImplicitFunction* VISU_PlanesWidget::ImplicitFunction() // function: SetDistance // purpose : //================================================================== -void VISU_PlanesWidget::SetDistance(const float theDistance) +void +VISU_PlanesWidget +::SetDistance(const vtkFloatingPointType theDistance) { if( theDistance <= 0.0 || theDistance == myDistance ) return; myDistance=theDistance; // - float *origin, *normal, oNew[3], aN2[3]; + vtkFloatingPointType *origin, *normal, oNew[3], aN2[3]; origin = myPlane1->GetOrigin(); normal = myPlane1->GetNormal(); vtkMath::Normalize(normal); @@ -335,7 +340,9 @@ void VISU_PlanesWidget::SetDistance(const float theDistance) // function: Distance // purpose : //================================================================== -float VISU_PlanesWidget::Distance()const +vtkFloatingPointType +VISU_PlanesWidget +::Distance() const { return myDistance; } @@ -853,13 +860,13 @@ void VISU_PlanesWidget::Push(double *p1, double *p2) { //Get the motion vector int i; - float v[3]; + vtkFloatingPointType v[3]; // for (i=0; i<3; ++i){ v[i] = p2[i] - p1[i]; } // - float aOr1[3], aNr1[3], aNr2[3], aD, z1; + vtkFloatingPointType aOr1[3], aNr1[3], aNr2[3], aD, z1; // myPlane1->GetOrigin(aOr1); myPlane1->GetNormal(aNr1); @@ -893,9 +900,9 @@ void VISU_PlanesWidget::TranslateOrigin(double *p1, double *p2) } // //Add to the current point, project back down onto plane - float *o = myPlane1->GetOrigin(); - float *n = myPlane1->GetNormal(); - float newOrigin[3]; + vtkFloatingPointType *o = myPlane1->GetOrigin(); + vtkFloatingPointType *n = myPlane1->GetNormal(); + vtkFloatingPointType newOrigin[3]; // for (i=0; i<3; ++i){ newOrigin[i]=o[i] + v[i]; @@ -908,9 +915,9 @@ void VISU_PlanesWidget::TranslateOrigin(double *p1, double *p2) // function: SetOriginInternal // purpose : Set the origin of the plane.(for Internal calls) //================================================================== -void VISU_PlanesWidget::SetOriginInternal(float x[3]) +void VISU_PlanesWidget::SetOriginInternal(vtkFloatingPointType x[3]) { - float *bounds = this->myOutline->GetOutput()->GetBounds(); + vtkFloatingPointType *bounds = this->myOutline->GetOutput()->GetBounds(); int i, j; for (i=0; i<3; ++i) { j=2*i; @@ -923,7 +930,7 @@ void VISU_PlanesWidget::SetOriginInternal(float x[3]) } // bool bFlag; - float aOr2[3], aNr2[3], aNr1[3]; + vtkFloatingPointType aOr2[3], aNr2[3], aNr1[3]; vtkPlane *pPx; // myPlane1->GetNormal(aNr1); @@ -959,8 +966,8 @@ void VISU_PlanesWidget::Rotate(int X, int Y, v[i] = p2[i] - p1[i]; } // - float *origin = myPlane1->GetOrigin(); - float *normal = myPlane1->GetNormal(); + vtkFloatingPointType *origin = myPlane1->GetOrigin(); + vtkFloatingPointType *normal = myPlane1->GetNormal(); // Create axis of rotation and angle of rotation vtkMath::Cross(vpn,v,axis); @@ -982,7 +989,7 @@ void VISU_PlanesWidget::Rotate(int X, int Y, this->Transform->Translate(-origin[0],-origin[1],-origin[2]); //Set the new normal - float nNew[3], aN2[3], oNew[3]; + vtkFloatingPointType nNew[3], aN2[3], oNew[3]; this->Transform->TransformNormal(normal,nNew); // for (i=0; i<3; ++i){ @@ -1013,7 +1020,7 @@ void VISU_PlanesWidget::Rotate(int X, int Y, void VISU_PlanesWidget::PushDistance(double *p1, double *p2) { int i; - float v[3], *anOrigin1, *aN1, *anOrigin2, *aN2, aD; + vtkFloatingPointType v[3], *anOrigin1, *aN1, *anOrigin2, *aN2, aD; //Get the motion vector for (i=0; i<3; ++i){ v[i] = p2[i] - p1[i]; @@ -1026,17 +1033,17 @@ void VISU_PlanesWidget::PushDistance(double *p1, double *p2) vtkMath::Normalize(aN1); - float origin[3]; + vtkFloatingPointType origin[3]; double distance = vtkMath::Dot( v, aN2 ); for(i=0; i<3; ++i) { origin[i] = anOrigin2[i] + distance * aN2[i]; } - float d = DistanceToPlane(origin, aN1, anOrigin1); + vtkFloatingPointType d = DistanceToPlane(origin, aN1, anOrigin1); if( d <= 0.0 ) return; // bool bFlag; - float aOr2[3], aNr2[3]; + vtkFloatingPointType aOr2[3], aNr2[3]; vtkPlane *pPx; // myPlane2->GetOrigin(aOr2); @@ -1073,8 +1080,8 @@ void VISU_PlanesWidget::TranslatePlane(double *p1, double *p2) v[2] = p2[2] - p1[2]; //Translate the plane - float oNew[3]; - float *origin = myPlane1->GetOrigin(); + vtkFloatingPointType oNew[3]; + vtkFloatingPointType *origin = myPlane1->GetOrigin(); oNew[0] = origin[0] + v[0]; oNew[1] = origin[1] + v[1]; oNew[2] = origin[2] + v[2]; @@ -1101,8 +1108,8 @@ void VISU_PlanesWidget::TranslateOutline(double *p1, double *p2) v[2] = p2[2] - p1[2]; //Translate the bounding box - float *origin = myBox->GetOrigin(); - float oNew[3]; + vtkFloatingPointType *origin = myBox->GetOrigin(); + vtkFloatingPointType oNew[3]; oNew[0] = origin[0] + v[0]; oNew[1] = origin[1] + v[1]; oNew[2] = origin[2] + v[2]; @@ -1138,10 +1145,10 @@ void VISU_PlanesWidget::Scale(double *p1, double *p2, v[2] = p2[2] - p1[2]; //int res = this->PlaneSource->GetXResolution(); - float *o = myPlane1->GetOrigin(); + vtkFloatingPointType *o = myPlane1->GetOrigin(); // Compute the scale factor - float sf = vtkMath::Norm(v) / this->myOutline->GetOutput()->GetLength(); + vtkFloatingPointType sf = vtkMath::Norm(v) / this->myOutline->GetOutput()->GetLength(); if ( Y > this->Interactor->GetLastEventPosition()[1] ) { sf = 1.0 + sf; } @@ -1154,9 +1161,9 @@ void VISU_PlanesWidget::Scale(double *p1, double *p2, this->Transform->Scale(sf,sf,sf); this->Transform->Translate(-o[0],-o[1],-o[2]); - float *origin = myBox->GetOrigin(); - float *spacing = myBox->GetSpacing(); - float oNew[3], p[3], pNew[3]; + vtkFloatingPointType *origin = myBox->GetOrigin(); + vtkFloatingPointType *spacing = myBox->GetSpacing(); + vtkFloatingPointType oNew[3], p[3], pNew[3]; p[0] = origin[0] + spacing[0]; p[1] = origin[1] + spacing[1]; p[2] = origin[2] + spacing[2]; @@ -1215,9 +1222,9 @@ void VISU_PlanesWidget::CreateDefaultProperties() // function: InitialPlaceWidget // purpose : //================================================================== -void VISU_PlanesWidget::InitialPlaceWidget(float bds[6]) +void VISU_PlanesWidget::InitialPlaceWidget(vtkFloatingPointType bds[6]) { - float bounds[6], origin[3]; + vtkFloatingPointType bounds[6], origin[3]; PlaceWidget(bds); // @@ -1226,7 +1233,7 @@ void VISU_PlanesWidget::InitialPlaceWidget(float bds[6]) (bounds[3]+bounds[2])/2.0, (bounds[5]+bounds[4])/2.0); - static float DIST_COEFF = 0.1; + static vtkFloatingPointType DIST_COEFF = 0.1; SetDistance(this->InitialLength*DIST_COEFF); // this->UpdateRepresentation(); @@ -1235,10 +1242,10 @@ void VISU_PlanesWidget::InitialPlaceWidget(float bds[6]) // function: PlaceWidget // purpose : //================================================================== -void VISU_PlanesWidget::PlaceWidget(float bds[6]) +void VISU_PlanesWidget::PlaceWidget(vtkFloatingPointType bds[6]) { int i; - float bounds[6], origin[3]; + vtkFloatingPointType bounds[6], origin[3]; this->AdjustBounds(bds, bounds, origin); @@ -1281,9 +1288,9 @@ void VISU_PlanesWidget::PlaceWidget(float bds[6]) // function: SetOrigin // purpose :Set the origin of the plane.(for external calls) //================================================================== -void VISU_PlanesWidget::SetOrigin(float x, float y, float z) +void VISU_PlanesWidget::SetOrigin(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z) { - float origin[3]; + vtkFloatingPointType origin[3]; origin[0] = x; origin[1] = y; origin[2] = z; @@ -1293,9 +1300,9 @@ void VISU_PlanesWidget::SetOrigin(float x, float y, float z) // function: SetOrigin // purpose : Set the origin of the plane.(for external calls) //================================================================== -void VISU_PlanesWidget::SetOrigin(float x[3]) +void VISU_PlanesWidget::SetOrigin(vtkFloatingPointType x[3]) { - float *bounds = this->myOutline->GetOutput()->GetBounds(); + vtkFloatingPointType *bounds = this->myOutline->GetOutput()->GetBounds(); for (int i=0; i<3; i++) { if ( x[i] < bounds[2*i] ) { x[i] = bounds[2*i]; @@ -1305,7 +1312,7 @@ void VISU_PlanesWidget::SetOrigin(float x[3]) } } myPlane1->SetOrigin(x); - float *origin, *normal, oNew[3]; + vtkFloatingPointType *origin, *normal, oNew[3]; origin = myPlane1->GetOrigin(); normal = myPlane1->GetNormal(); vtkMath::Normalize(normal); @@ -1319,12 +1326,12 @@ void VISU_PlanesWidget::SetOrigin(float x[3]) // function: GetOrigin // purpose :Get the origin of the plane. //================================================================== -float* VISU_PlanesWidget::GetOrigin() +vtkFloatingPointType* VISU_PlanesWidget::GetOrigin() { return myPlane1->GetOrigin(); } -void VISU_PlanesWidget::GetOrigin(float xyz[3]) +void VISU_PlanesWidget::GetOrigin(vtkFloatingPointType xyz[3]) { myPlane1->GetOrigin(xyz); } @@ -1332,9 +1339,9 @@ void VISU_PlanesWidget::GetOrigin(float xyz[3]) // function: SetNormal // purpose :Set the normal to the plane. //================================================================== -void VISU_PlanesWidget::SetNormal(float x, float y, float z) +void VISU_PlanesWidget::SetNormal(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z) { - float n[3]; + vtkFloatingPointType n[3]; n[0] = x; n[1] = y; n[2] = z; @@ -1352,7 +1359,7 @@ void VISU_PlanesWidget::SetNormal(float x, float y, float z) // function: SetNormal // purpose :Set the normal to the plane. //================================================================== -void VISU_PlanesWidget::SetNormal(float n[3]) +void VISU_PlanesWidget::SetNormal(vtkFloatingPointType n[3]) { this->SetNormal(n[0], n[1], n[2]); } @@ -1360,7 +1367,7 @@ void VISU_PlanesWidget::SetNormal(float n[3]) // function: GetNormal // purpose :Get the normal to the plane. //================================================================== -float* VISU_PlanesWidget::GetNormal() +vtkFloatingPointType* VISU_PlanesWidget::GetNormal() { return myPlane1->GetNormal(); } @@ -1368,7 +1375,7 @@ float* VISU_PlanesWidget::GetNormal() // function: GetNormal // purpose :Get the normal to the plane. //================================================================== -void VISU_PlanesWidget::GetNormal(float xyz[3]) +void VISU_PlanesWidget::GetNormal(vtkFloatingPointType xyz[3]) { myPlane1->GetNormal(xyz); } @@ -1492,12 +1499,12 @@ void VISU_PlanesWidget::UpdateRepresentation() return; } - float *origin = myPlane1->GetOrigin(); - float *normal = myPlane1->GetNormal(); - float p2[3]; + vtkFloatingPointType *origin = myPlane1->GetOrigin(); + vtkFloatingPointType *normal = myPlane1->GetNormal(); + vtkFloatingPointType p2[3]; // Setup the plane normal - float d = this->myOutline->GetOutput()->GetLength(); + vtkFloatingPointType d = this->myOutline->GetOutput()->GetLength(); p2[0] = origin[0] + 0.30 * d * normal[0]; p2[1] = origin[1] + 0.30 * d * normal[1]; @@ -1540,12 +1547,12 @@ void VISU_PlanesWidget::PrintSelf(ostream& os, vtkIndent indent) //================================================================== bool IsValidPlane2Position(vtkPlane *pPx, vtkDataSet *pDataSet, - float aTol) + vtkFloatingPointType aTol) { bool bRet; int i, iFound; - float aD, aDmax, aPnts[24], aDiagonal; - float aTol1, aOr[3], aN[3]; + vtkFloatingPointType aD, aDmax, aPnts[24], aDiagonal; + vtkFloatingPointType aTol1, aOr[3], aN[3]; // bRet=false; aDiagonal=pDataSet->GetLength(); @@ -1575,15 +1582,16 @@ bool IsValidPlane2Position(vtkPlane *pPx, // function: GetBndPoints // purpose : //================================================================== -void GetBndPoints(vtkDataSet *pDataSet, - float aPnts[24]) +void +GetBndPoints(vtkDataSet *pDataSet, + vtkFloatingPointType aPnts[24]) { - int aIndx[24]={ + int aIndx[24] = { 0,2,4,1,2,4,1,3,4,0,3,4, 0,2,5,1,2,5,1,3,5,0,3,5 }; int i; - float *pBounds=pDataSet->GetBounds(); + vtkFloatingPointType *pBounds=pDataSet->GetBounds(); // for (i=0; i<24; ++i){ aPnts[i]=pBounds[aIndx[i]]; @@ -1593,13 +1601,14 @@ void GetBndPoints(vtkDataSet *pDataSet, // function: DistanceToPlane // purpose : //================================================================== -float DistanceToPlane(const float x[3], - const float n[3], - const float p0[3]) +vtkFloatingPointType +DistanceToPlane(const vtkFloatingPointType x[3], + const vtkFloatingPointType n[3], + const vtkFloatingPointType p0[3]) { - return ((float) (n[0]*(x[0]-p0[0]) + - n[1]*(x[1]-p0[1]) + - n[2]*(x[2]-p0[2]))); + return ((n[0]*(x[0]-p0[0]) + + n[1]*(x[1]-p0[1]) + + n[2]*(x[2]-p0[2]))); } /* //================================================================== @@ -1608,7 +1617,7 @@ float DistanceToPlane(const float x[3], //================================================================== void VISU_PlanesWidget::SizeHandles() { - // float radius = + // vtkFloatingPointType radius = this->vtk3DWidget::SizeHandles(1.35); } */ diff --git a/src/PIPELINE/VISU_PlanesWidget.hxx b/src/PIPELINE/VISU_PlanesWidget.hxx index fdf45367..2b4370d0 100644 --- a/src/PIPELINE/VISU_PlanesWidget.hxx +++ b/src/PIPELINE/VISU_PlanesWidget.hxx @@ -59,31 +59,59 @@ public: vtkTypeRevisionMacro(VISU_PlanesWidget,VISU_ImplicitFunctionWidget); void PrintSelf(ostream& os, vtkIndent indent); - void SetDistance (const float theDistance); - float Distance()const; + void + SetDistance(const vtkFloatingPointType theDistance); - vtkGetMacro(InitialLength,float); + vtkFloatingPointType + Distance() const; - virtual vtkImplicitFunction* ImplicitFunction(); + vtkGetMacro(InitialLength,vtkFloatingPointType); + + virtual + vtkImplicitFunction* + ImplicitFunction(); // Description: // Methods that satisfy the superclass' API. - virtual void SetEnabled(int); - virtual void PlaceWidget(float bounds[6]); + virtual + void + SetEnabled(int); + + virtual + void + PlaceWidget(vtkFloatingPointType bounds[6]); // Description: // Get the origin of the plane. - void SetOrigin(float x, float y, float z); - void SetOrigin(float x[3]); - float* GetOrigin(); - void GetOrigin(float xyz[3]); + void + SetOrigin(vtkFloatingPointType x, + vtkFloatingPointType y, + vtkFloatingPointType z); + + void + SetOrigin(vtkFloatingPointType x[3]); + + vtkFloatingPointType* + GetOrigin(); + + void + GetOrigin(vtkFloatingPointType xyz[3]); // Description: // Get the normal to the plane. - void SetNormal(float x, float y, float z); - void SetNormal(float x[3]); - float* GetNormal(); - void GetNormal(float xyz[3]); + void + SetNormal(vtkFloatingPointType x, + vtkFloatingPointType y, + vtkFloatingPointType z); + + void + SetNormal(vtkFloatingPointType x[3]); + + vtkFloatingPointType* + GetNormal(); + + void + GetNormal(vtkFloatingPointType xyz[3]); // Description: // Force the plane widget to be aligned with one of the x-y-z axes. @@ -91,13 +119,20 @@ public: // Remember that when the state changes, a ModifiedEvent is invoked. // This can be used to snap the plane to the axes if it is orginally // not aligned. - void SetNormalToXAxis(int); + void + SetNormalToXAxis(int); + vtkGetMacro(NormalToXAxis,int); vtkBooleanMacro(NormalToXAxis,int); - void SetNormalToYAxis(int); + + void + SetNormalToYAxis(int); + vtkGetMacro(NormalToYAxis,int); vtkBooleanMacro(NormalToYAxis,int); - void SetNormalToZAxis(int); + + void + SetNormalToZAxis(int); vtkGetMacro(NormalToZAxis,int); vtkBooleanMacro(NormalToZAxis,int); @@ -113,8 +148,12 @@ public: // interferes with the object that it is operating on (i.e., the // plane interferes with the cut surface it produces producing // z-buffer artifacts.) - void SetDrawPlane(int plane); - int GetDrawPlane(){ + void + SetDrawPlane(int plane); + + int + GetDrawPlane() + { return myDrawPlane; } @@ -128,7 +167,8 @@ public: // Description: // Grab the polydata that defines the plane. The polydata contains a single // polygon that is clipped by the bounding box. - void GetPolyData(vtkPolyData *pd); + void + GetPolyData(vtkPolyData *pd); // Description: // Satisfies superclass API. This returns a pointer to the underlying @@ -140,12 +180,14 @@ public: // instance of the class vtkPlane. Note that vtkPlane is a subclass of // vtkImplicitFunction, meaning that it can be used by a variety of filters // to perform clipping, cutting, and selection of data. - void GetPlane(vtkPlane *plane); + void + GetPlane(vtkPlane *plane); // Description: // Satisfies the superclass API. This will change the state of the widget // to match changes that have been made to the underlying PolyDataSource - void UpdatePlacement(void); + void + UpdatePlacement(void); // Description: // Get the properties on the normal (line and cone). @@ -168,7 +210,8 @@ public: // applies to the edges when tubed.) vtkGetObjectMacro(EdgesProperty,vtkProperty); - void InitialPlaceWidget(float bds[6]); + void + InitialPlaceWidget(vtkFloatingPointType bds[6]); protected: VISU_PlanesWidget(); @@ -191,8 +234,10 @@ protected: //ETX //handles the events - static void ProcessEvents(vtkObject* object, unsigned long event, - void* clientdata, void* calldata); + static + void + ProcessEvents(vtkObject* object, unsigned long event, + void* clientdata, void* calldata); // ProcessEvents() dispatches to these methods. void OnLeftButtonDown(); @@ -204,7 +249,7 @@ protected: void OnMouseMove(); // // Methods to manipulate the plane - void ConstrainOrigin(float x[3]); + void ConstrainOrigin(vtkFloatingPointType x[3]); void Rotate(int X, int Y, double *p1, double *p2, double *vpn); void TranslatePlane(double *p1, double *p2); void TranslateOutline(double *p1, double *p2); @@ -221,7 +266,7 @@ protected: void HighlightNormal(int highlight); void HighlightOutline(int highlight); void UpdateRepresentation(); - void SetOriginInternal(float x[3]); + void SetOriginInternal(vtkFloatingPointType x[3]); // Controlling ivars int NormalToXAxis; @@ -238,7 +283,7 @@ protected: vtkPlane *myPlane1; vtkPlane *myPlane2; - float myDistance; + vtkFloatingPointType myDistance; vtkImplicitBoolean *myImplicitFunction; // The bounding box is represented by a single voxel image data diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index 164d9a7a..928accc0 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -86,9 +86,9 @@ GetOrientation(vtkDataSet* theDataSet) { theDataSet->Update(); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; theDataSet->GetBounds(aBounds); - float aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]}; + vtkFloatingPointType aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]}; if(aDelta[0] >= aDelta[1] && aDelta[0] >= aDelta[2]) if(aDelta[1] >= aDelta[2]) @@ -111,18 +111,18 @@ GetOrientation(vtkDataSet* theDataSet) return VISU_CutPlanesPL::XY; } -float +vtkFloatingPointType VISU_Plot3DPL:: GetScaleFactor(vtkDataSet* theDataSet) { theDataSet->Update(); - float aLength = theDataSet->GetLength(); // diagonal length + vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); - static float EPS = 0.3; - float aRange = aScalarRange[1]; + static vtkFloatingPointType EPS = 0.3; + vtkFloatingPointType aRange = aScalarRange[1]; if(aRange > 0.0) return aLength / aRange * EPS; @@ -150,8 +150,8 @@ void VISU_Plot3DPL:: Update() { - float aPlaneNormal[3]; - float anOrigin[3]; + vtkFloatingPointType aPlaneNormal[3]; + vtkFloatingPointType anOrigin[3]; GetBasePlane( anOrigin, aPlaneNormal ); vtkPolyData* aPolyData = 0; @@ -198,7 +198,7 @@ Update() }else myContourFilter->SetInput(aPolyData); - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); myContourFilter->GenerateValues(GetNumberOfContours(),aScalarRange); @@ -232,13 +232,13 @@ GetNumberOfContours() const void VISU_Plot3DPL:: -SetScaleFactor(float theScaleFactor) +SetScaleFactor(vtkFloatingPointType theScaleFactor) { myScaleFactor = theScaleFactor; myWarpScalar->SetScaleFactor(theScaleFactor); } -float +vtkFloatingPointType VISU_Plot3DPL:: GetScaleFactor() const { @@ -247,7 +247,7 @@ GetScaleFactor() const void VISU_Plot3DPL:: -SetPlanePosition(float thePosition, +SetPlanePosition(vtkFloatingPointType thePosition, bool theIsRelative) { myIsRelative = theIsRelative; @@ -269,7 +269,7 @@ GetPlaneOrientation() const } -float +vtkFloatingPointType VISU_Plot3DPL:: GetRotateX() { @@ -281,7 +281,7 @@ GetRotateX() return 0; } -float +vtkFloatingPointType VISU_Plot3DPL:: GetRotateY(){ switch(myOrientation){ @@ -295,8 +295,8 @@ GetRotateY(){ void VISU_Plot3DPL:: SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, - float theXAngle, - float theYAngle) + vtkFloatingPointType theXAngle, + vtkFloatingPointType theYAngle) { switch(theOrientation){ case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break; @@ -311,7 +311,7 @@ SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, myOrientation = theOrientation; } -float +vtkFloatingPointType VISU_Plot3DPL:: GetPlanePosition() const { @@ -323,14 +323,14 @@ GetPlanePosition() const //purpose : //======================================================================= -void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], - float theNormal[3], +void VISU_Plot3DPL::GetBasePlane(vtkFloatingPointType theOrigin[3], + vtkFloatingPointType theNormal[3], bool theCenterOrigine ) const { VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation); - float aPosition = myPosition; - float aBounds[6], aBoundPrj[3]; + vtkFloatingPointType aPosition = myPosition; + vtkFloatingPointType aBounds[6], aBoundPrj[3]; if ( myIsRelative ) { GetInput()->GetBounds(aBounds); @@ -342,7 +342,7 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], if ( theCenterOrigine ) { // move theOrigin to the center of aBounds projections to the plane GetInput2()->GetBounds(aBounds); - float boundPoints[8][3] = { + vtkFloatingPointType boundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, {aBounds[1],aBounds[2],aBounds[4]}, {aBounds[0],aBounds[3],aBounds[4]}, @@ -351,9 +351,9 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], {aBounds[1],aBounds[2],aBounds[5]}, {aBounds[0],aBounds[3],aBounds[5]}, {aBounds[1],aBounds[3],aBounds[5]}}; - float newOrigin[3] = { 0,0,0 }; + vtkFloatingPointType newOrigin[3] = { 0,0,0 }; for(int i = 0; i < 8; i++) { - float proj[3]; + vtkFloatingPointType proj[3]; vtkPlane::ProjectPoint( boundPoints[i], theOrigin, theNormal, proj ); newOrigin[0] += proj[0]; newOrigin[1] += proj[1]; @@ -370,9 +370,10 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], //purpose : return absolute position range //======================================================================= -void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const +void VISU_Plot3DPL::GetMinMaxPosition( vtkFloatingPointType& minPos, + vtkFloatingPointType& maxPos ) const { - float aBounds[6], aBoundPrj[3], aNormal[3]; + vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3]; VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation); GetInput()->GetBounds(aBounds); VISU_CutPlanesPL::GetBoundProject(aBoundPrj,aBounds,aNormal); @@ -385,14 +386,14 @@ void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const //purpose : //======================================================================= -void VISU_Plot3DPL::SetMapScale(float theMapScale) +void VISU_Plot3DPL::SetMapScale(vtkFloatingPointType theMapScale) { VISU_ScalarMapPL::SetMapScale(theMapScale); if ( myIsContour ) { - float aRange[2]; + vtkFloatingPointType aRange[2]; GetSourceRange(aRange); - float aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] }; + vtkFloatingPointType aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] }; myContourFilter->GenerateValues(GetNumberOfContours(),aNewRange); } myWarpScalar->SetScaleFactor(myScaleFactor*theMapScale); diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index 9df47b2d..4b60e226 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -52,31 +52,31 @@ public: VISU_CutPlanesPL::PlaneOrientation GetPlaneOrientation() const; - float + vtkFloatingPointType GetRotateX(); - float + vtkFloatingPointType GetRotateY(); void SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, - float theXAngle = 0.0, - float theYAngle = 0.0); + vtkFloatingPointType theXAngle = 0.0, + vtkFloatingPointType theYAngle = 0.0); - float + vtkFloatingPointType GetPlanePosition() const; bool IsPositionRelative() const; void - SetPlanePosition(float thePosition, + SetPlanePosition(vtkFloatingPointType thePosition, bool theIsRelative); void - SetScaleFactor(float theScaleFactor); + SetScaleFactor(vtkFloatingPointType theScaleFactor); - float + vtkFloatingPointType GetScaleFactor() const; void @@ -91,11 +91,12 @@ public: int GetNumberOfContours() const; - void GetBasePlane (float theOrigin[3], - float theNormal[3], + void GetBasePlane (vtkFloatingPointType theOrigin[3], + vtkFloatingPointType theNormal[3], bool theCenterOrigine = false ) const; - void GetMinMaxPosition( float& minPos, float& maxPos ) const; + void GetMinMaxPosition( vtkFloatingPointType& minPos, + vtkFloatingPointType& maxPos ) const; public: virtual void Init(); @@ -105,17 +106,17 @@ public: VISU_CutPlanesPL::PlaneOrientation GetOrientation(vtkDataSet* theDataSet); - float + vtkFloatingPointType GetScaleFactor(vtkDataSet* theDataSet); - void SetMapScale(float theMapScale); + void SetMapScale(vtkFloatingPointType theMapScale); protected: virtual THook* DoHook(); - float myAngle[3]; + vtkFloatingPointType myAngle[3]; bool myIsRelative, myIsContour; - float myPosition, myScaleFactor; + vtkFloatingPointType myPosition, myScaleFactor; VISU_CutPlanesPL::PlaneOrientation myOrientation; TVTKSmartPtr myCellDataToPointData; diff --git a/src/PIPELINE/VISU_ScalarBarActor.cxx b/src/PIPELINE/VISU_ScalarBarActor.cxx index afa44bd7..b6625853 100644 --- a/src/PIPELINE/VISU_ScalarBarActor.cxx +++ b/src/PIPELINE/VISU_ScalarBarActor.cxx @@ -258,7 +258,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) // we hard code how many steps to display int numColors = this->MaximumNumberOfColors; - float *range = lut->GetRange(); + vtkFloatingPointType *range = lut->GetRange(); int numPts = 2*(numColors + 1); vtkPoints *pts = vtkPoints::New(); @@ -315,13 +315,13 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) this->NumberOfLabelsBuilt = this->NumberOfLabels; // generate points - float x[3]; x[2] = 0.0; - float delta, val; + vtkFloatingPointType x[3]; x[2] = 0.0; + vtkFloatingPointType delta, val; if ( this->Orientation == VTK_ORIENT_VERTICAL ) { barWidth = size[0] - 4 - labelSize[0]; barHeight = (int)(0.86*size[1]); - delta=(float)barHeight/numColors; + delta=(vtkFloatingPointType)barHeight/numColors; for (i=0; iInsertNextCell(4,ptIds); if ( isLogTable ){ //SALOME specific - float rgbval = log10(range[0]) + + vtkFloatingPointType rgbval = log10(range[0]) + i*(log10(range[1])-log10(range[0]))/(numColors -1); rgba = lut->MapValue(rgbval); }else{ rgba = lut->MapValue(range[0] + (range[1] - range[0])* - ((float)i /(numColors-1.0))); + ((vtkFloatingPointType)i /(numColors-1.0))); } rgb = colors->GetPointer(3*i); //write into array directly @@ -383,7 +383,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) for (i=0; i < this->NumberOfLabels; i++) { - val = (float)i/(this->NumberOfLabels-1) *barHeight; + val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) *barHeight; this->TextMappers[i]->GetSize(viewport,sizeTextData); this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft(); this->TextActors[i]->SetPosition(barWidth+3, @@ -397,7 +397,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) for (i=0; i < this->NumberOfLabels; i++) { this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered(); - val = (float)i/(this->NumberOfLabels-1) * barWidth; + val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) * barWidth; this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]); } } @@ -503,7 +503,7 @@ void VISU_ScalarBarActor::ShallowCopy(vtkProp *prop) void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, vtkViewport *viewport, - float *range) + vtkFloatingPointType *range) { labelSize[0] = labelSize[1] = 0; @@ -512,7 +512,7 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, char string[512]; - float val; + vtkFloatingPointType val; int i; // TODO: this should be optimized, maybe by keeping a list of @@ -529,11 +529,11 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, this->TextMappers[i] = vtkTextMapper::New(); if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific - float lval = log10(range[0]) + (float)i/(this->NumberOfLabels-1) * + vtkFloatingPointType lval = log10(range[0]) + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (log10(range[1])-log10(range[0])); val = pow(10,lval); }else{ - val = range[0] + (float)i/(this->NumberOfLabels-1) * (range[1]-range[0]); + val = range[0] + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (range[1]-range[0]); } sprintf(string, this->LabelFormat, val); this->TextMappers[i]->SetInput(string); diff --git a/src/PIPELINE/VISU_ScalarBarActor.hxx b/src/PIPELINE/VISU_ScalarBarActor.hxx index be2f62ce..7db60d5a 100644 --- a/src/PIPELINE/VISU_ScalarBarActor.hxx +++ b/src/PIPELINE/VISU_ScalarBarActor.hxx @@ -138,7 +138,7 @@ protected: vtkTextMapper **TextMappers; virtual void AllocateAndSizeLabels(int *labelSize, int *size, - vtkViewport *viewport, float *range); + vtkViewport *viewport, vtkFloatingPointType *range); private: vtkTextMapper *TitleMapper; diff --git a/src/PIPELINE/VISU_ScalarBarCtrl.cxx b/src/PIPELINE/VISU_ScalarBarCtrl.cxx index 561b2432..8f24c298 100644 --- a/src/PIPELINE/VISU_ScalarBarCtrl.cxx +++ b/src/PIPELINE/VISU_ScalarBarCtrl.cxx @@ -45,7 +45,7 @@ namespace inline void MarkValueByColor(vtkLookupTable* theTable, - float theValue, + vtkFloatingPointType theValue, unsigned char* theColor) { vtkIdType anIndex = theTable->GetIndex(theValue); @@ -81,12 +81,12 @@ namespace unsigned char aRedPtr[3] = {255, 0, 0}; unsigned char aBluePtr[3] = {0, 0, 255}; - float aRange[2]; + vtkFloatingPointType aRange[2]; theTable->GetTableRange(aRange); vtkIdType aNbColors = theTable->GetNumberOfColors(); - float aDelta = (aRange[1]-aRange[0])/aNbColors; - float aValue = aRange[0]+0.5*aDelta; + vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors; + vtkFloatingPointType aValue = aRange[0]+0.5*aDelta; for(int i = 0; i < aNbColors; i++){ vtkIdType anIndex = theTable->GetIndex(aValue); unsigned char* aTablePtr = theTable->GetPointer(anIndex); @@ -206,15 +206,15 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetRangeLocal(float *theRange) +::SetRangeLocal(vtkFloatingPointType *theRange) { myLocalLookupTable->SetTableRange(theRange); } void VISU_ScalarBarCtrl -::SetRangeLocal(float theMin, - float theMax) +::SetRangeLocal(vtkFloatingPointType theMin, + vtkFloatingPointType theMax) { myLocalLookupTable->SetTableRange(theMin,theMax); } @@ -223,15 +223,15 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetRangeGlobal(float *theRange) +::SetRangeGlobal(vtkFloatingPointType *theRange) { myGlobalLookupTable->SetTableRange(theRange); } void VISU_ScalarBarCtrl -::SetRangeGlobal(float theMin, - float theMax) +::SetRangeGlobal(vtkFloatingPointType theMin, + vtkFloatingPointType theMax) { myGlobalLookupTable->SetTableRange(theMin,theMax); } @@ -298,13 +298,13 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetWidth(float theWidth) +::SetWidth(vtkFloatingPointType theWidth) { myGlobalScalarBar->SetWidth(theWidth); myLocalScalarBar->SetWidth(theWidth); } -float +vtkFloatingPointType VISU_ScalarBarCtrl ::GetWidth() const { @@ -315,14 +315,14 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetHeight(float theHeight) +::SetHeight(vtkFloatingPointType theHeight) { myGlobalScalarBar->SetHeight(theHeight); myLocalScalarBar->SetHeight(theHeight); } -float +vtkFloatingPointType VISU_ScalarBarCtrl ::GetHeight() const { @@ -333,13 +333,13 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetPosition(const float* thePosition) +::SetPosition(const vtkFloatingPointType* thePosition) { myPosition[0] = thePosition[0]; myPosition[1] = thePosition[1]; } -const float* +const vtkFloatingPointType* VISU_ScalarBarCtrl::GetPosition() const { return myPosition; @@ -349,12 +349,12 @@ VISU_ScalarBarCtrl::GetPosition() const //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetSpacing(const float theSpacing) +::SetSpacing(const vtkFloatingPointType theSpacing) { myDistance = theSpacing; } -float +vtkFloatingPointType VISU_ScalarBarCtrl ::GetSpacing() const { @@ -381,12 +381,12 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetMarkValue(const float theValue) +::SetMarkValue(const vtkFloatingPointType theValue) { myMarkedValue = theValue; } -float +vtkFloatingPointType VISU_ScalarBarCtrl ::GetMarkValue() const { @@ -441,7 +441,7 @@ VISU_ScalarBarCtrl } } if(myGlobalRangeIsDefined){ - float aLocalRange[2]; + vtkFloatingPointType aLocalRange[2]; myLocalLookupTable->GetTableRange(aLocalRange); MarkValueByColor(myGlobalLookupTable, aLocalRange[0], myBlack); MarkValueByColor(myGlobalLookupTable, aLocalRange[1], myBlack); @@ -459,10 +459,10 @@ VISU_ScalarBarCtrl vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate(); aCoordinate->SetCoordinateSystemToNormalizedViewport(); if(theScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL){ - float aWidth = theScalarBarActor->GetWidth(); + vtkFloatingPointType aWidth = theScalarBarActor->GetWidth(); aCoordinate->SetValue(myPosition[0]+theId*(aWidth+myDistance), myPosition[1]); }else{ - float aHeight = theScalarBarActor->GetHeight(); + vtkFloatingPointType aHeight = theScalarBarActor->GetHeight(); aCoordinate->SetValue(myPosition[0], myPosition[1]+theId*(aHeight+myDistance)); } // Initialize Lookup Tables and Scalar Bars diff --git a/src/PIPELINE/VISU_ScalarBarCtrl.hxx b/src/PIPELINE/VISU_ScalarBarCtrl.hxx index c1a2f958..db7bec43 100644 --- a/src/PIPELINE/VISU_ScalarBarCtrl.hxx +++ b/src/PIPELINE/VISU_ScalarBarCtrl.hxx @@ -37,88 +37,147 @@ class VISU_ScalarBarCtrl : public vtkObject { public: vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject); - static VISU_ScalarBarCtrl* New(); + static + VISU_ScalarBarCtrl* + New(); enum EMode {eSimple, eGlobal, eLocal}; // Mode - void SetMode(EMode theMode); - EMode GetMode() const; + void + SetMode(EMode theMode); + + EMode + GetMode() const; // Ranges - void SetRangeGlobal(float theMin, - float theMax); - void SetRangeGlobal(float *theRange); + void + SetRangeGlobal(vtkFloatingPointType theMin, + vtkFloatingPointType theMax); + void + SetRangeGlobal(vtkFloatingPointType *theRange); - void SetGlobalRangeIsDefined(bool theIsDefined); + void + SetGlobalRangeIsDefined(bool theIsDefined); - void SetRangeLocal(float theMin, - float theMax); - void SetRangeLocal(float *theRange); + void + SetRangeLocal(vtkFloatingPointType theMin, + vtkFloatingPointType theMax); + void + SetRangeLocal(vtkFloatingPointType *theRange); // Selectors - vtkScalarBarActor* GetLocalBar(); - vtkLookupTable* GetLocalTable(); + vtkScalarBarActor* + GetLocalBar(); + + vtkLookupTable* + GetLocalTable(); - vtkScalarBarActor* GetGlobalBar(); - vtkLookupTable* GetGlobalTable(); + vtkScalarBarActor* + GetGlobalBar(); + + vtkLookupTable* + GetGlobalTable(); // // Renderer - void AddToRender(vtkRenderer* theRenderer); - void RemoveFromRender(vtkRenderer* theRenderer); + void + AddToRender(vtkRenderer* theRenderer); + + void + RemoveFromRender(vtkRenderer* theRenderer); // // Visibility - void SetVisibility(int theFlag); - int GetVisibility() const; - // + void + SetVisibility(int theFlag); + + int + GetVisibility() const; + // Visibility - void SetCtrlVisibility(int theFlag); - int GetCtrlVisibility() const; - // + void + SetCtrlVisibility(int theFlag); + + int + GetCtrlVisibility() const; + // Build void Update(); - // + // Position - void SetWidth(const float theWidth); - float GetWidth()const; - void SetHeight(const float theHeight); - float GetHeight()const; - void SetPosition(const float* thePosition); - const float* GetPosition()const; + void + SetWidth(const vtkFloatingPointType theWidth); + + vtkFloatingPointType + GetWidth() const; + + void + SetHeight(const vtkFloatingPointType theHeight); + + vtkFloatingPointType + GetHeight() const; + + void + SetPosition(const vtkFloatingPointType* thePosition); + + const vtkFloatingPointType* + GetPosition() const; // // Spacing - void SetSpacing(const float theSpacing); - float GetSpacing()const; + void + SetSpacing(const vtkFloatingPointType theSpacing); + + vtkFloatingPointType + GetSpacing() const; // // Rainbow/bicolor - bool GetBicolor() const; - void SetBicolor(const bool theBicolor); + bool + GetBicolor() const; + + void + SetBicolor(const bool theBicolor); // // Misc - void SetMarkValue (const float theValue); - float GetMarkValue ()const; - void SetIsMarked(const bool theFlag); - bool GetIsMarked()const; + void + SetMarkValue(const vtkFloatingPointType theValue); + + vtkFloatingPointType + GetMarkValue() const; + + void + SetIsMarked(const bool theFlag); + + bool + GetIsMarked()const; // protected: VISU_ScalarBarCtrl(); - virtual ~VISU_ScalarBarCtrl(); + + virtual + ~VISU_ScalarBarCtrl(); - void UpdateForBicolor(); - void UpdateForColor(); - void UpdateMarkValue(); - void PrepareTables(); + void + UpdateForBicolor(); + + void + UpdateForColor(); + + void + UpdateMarkValue(); + + void + PrepareTables(); - void PrepareTables(vtkScalarBarActor* theScalarBarActor, - vtkLookupTable *theLookupTable, - vtkIdType theId); + void + PrepareTables(vtkScalarBarActor* theScalarBarActor, + vtkLookupTable *theLookupTable, + vtkIdType theId); protected: EMode myMode; bool myGlobalRangeIsDefined; - float myDistance; - float myPosition[2]; + vtkFloatingPointType myDistance; + vtkFloatingPointType myPosition[2]; bool myBicolor; int myCtrlVisibility; @@ -126,7 +185,7 @@ protected: unsigned char myGrey[3]; // bool myMarked; - float myMarkedValue; + vtkFloatingPointType myMarkedValue; // vtkScalarBarActor *myGlobalScalarBar; vtkLookupTable *myGlobalLookupTable; diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 0d0ccad5..d911cffc 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -48,7 +48,9 @@ vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL) * Merge filter which unify the deformation and scalars * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data */ -VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){ +VISU_ScalarMapOnDeformedShapePL +::VISU_ScalarMapOnDeformedShapePL() +{ myDeformVectors = vtkWarpVector::New(); myMergeFilter = vtkMergeFilter::New(); myExtractorScalars = VISU_Extractor::New(); @@ -59,7 +61,9 @@ VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){ * Destructor. * Delete all fields. */ -VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){ +VISU_ScalarMapOnDeformedShapePL +::~VISU_ScalarMapOnDeformedShapePL() +{ myDeformVectors->UnRegisterAllOutputs(); myDeformVectors->Delete(); @@ -76,13 +80,15 @@ VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){ /*! * Initial method */ -void VISU_ScalarMapOnDeformedShapePL::Init(){ - +void +VISU_ScalarMapOnDeformedShapePL +::Init() +{ if (GetScalars() == NULL) SetScalars(GetInput2()); Superclass::Init(); - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); static double EPS = 1.0 / VTK_LARGE_FLOAT; if(aScalarRange[1] > EPS) @@ -102,7 +108,9 @@ void VISU_ScalarMapOnDeformedShapePL::Init(){ * Build method * Building of deformation and puts result to merge filter. */ -void VISU_ScalarMapOnDeformedShapePL::Build() +void +VISU_ScalarMapOnDeformedShapePL +::Build() { // Set input for extractor myExtractor->SetInput(GetInput2()); @@ -119,12 +127,15 @@ void VISU_ScalarMapOnDeformedShapePL::Build() /*! * Update method */ -void VISU_ScalarMapOnDeformedShapePL::Update(){ +void +VISU_ScalarMapOnDeformedShapePL +::Update() +{ this->UpdateScalars(); - float aRange[2]; + vtkFloatingPointType aRange[2]; GetSourceRange(aRange); - float aScalarRange[2] = {aRange[0], aRange[1]}; + vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]}; if(myBarTable->GetScale() == VTK_SCALE_LOG10) VISU_LookupTable::ComputeLogRange(aRange,aScalarRange); @@ -143,7 +154,10 @@ void VISU_ScalarMapOnDeformedShapePL::Update(){ * Update scalars method. * Put scalars to merge filter. */ -void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){ +void +VISU_ScalarMapOnDeformedShapePL +::UpdateScalars() +{ if(myScalars->GetCellData()->GetVectors() != NULL || myScalars->GetPointData()->GetVectors() != NULL) myMergeFilter->SetScalars(myExtractorScalars->GetOutput()); @@ -155,12 +169,15 @@ void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){ * Copy information about pipline. * Copy scale and scalars. */ -void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_ScalarMapOnDeformedShapePL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast(thePipeLine); if(aPipeLine){ SetScale(aPipeLine->GetScale()); SetScalars(aPipeLine->GetScalars()); - float aRange[2]; + vtkFloatingPointType aRange[2]; aPipeLine->GetSourceRange(aRange); SetScalarRange(aRange); } @@ -171,7 +188,10 @@ void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){ * Set scalars. * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction. */ -void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){ +void +VISU_ScalarMapOnDeformedShapePL +::SetScalars(vtkDataSet *theScalars) +{ myScalars = theScalars; vtkUnstructuredGrid* aScalars = GetScalars(); myExtractorScalars->SetInput(aScalars); @@ -181,14 +201,20 @@ void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){ /*! * Get pointer to input scalars. */ -vtkUnstructuredGrid* VISU_ScalarMapOnDeformedShapePL::GetScalars(){ +vtkUnstructuredGrid* +VISU_ScalarMapOnDeformedShapePL +::GetScalars() +{ return myScalars.GetPointer(); } /*! * Sets scale for deformed shape */ -void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) { +void +VISU_ScalarMapOnDeformedShapePL +::SetScale(vtkFloatingPointType theScale) +{ if(myScaleFactor == theScale) return; myScaleFactor = theScale; myDeformVectors->SetScaleFactor(myScaleFactor); @@ -198,15 +224,21 @@ void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) { /*! * Gets scale of deformed shape. */ -float VISU_ScalarMapOnDeformedShapePL::GetScale() { - float aScale=myDeformVectors->GetScaleFactor(); +vtkFloatingPointType +VISU_ScalarMapOnDeformedShapePL +::GetScale() +{ + vtkFloatingPointType aScale=myDeformVectors->GetScaleFactor(); return aScale; } /*! * Set scale factor of deformation. */ -void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){ +void +VISU_ScalarMapOnDeformedShapePL +::SetMapScale(vtkFloatingPointType theMapScale) +{ myDeformVectors->SetScaleFactor(myScaleFactor*theMapScale); Modified(); } @@ -214,7 +246,10 @@ void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){ /*! * Gets scalar mode. */ -int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){ +int +VISU_ScalarMapOnDeformedShapePL +::GetScalarMode() +{ int aMode=myExtractorScalars->GetScalarMode(); return aMode; } @@ -222,7 +257,10 @@ int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){ /*! * Sets scalar mode. */ -void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){ +void +VISU_ScalarMapOnDeformedShapePL +::SetScalarMode(int theScalarMode) +{ myExtractorScalars->SetScalarMode(theScalarMode); Modified(); } @@ -233,7 +271,10 @@ void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){ * \li theRange[0] - minimum value * \li theRange[1] - maximum value */ -void VISU_ScalarMapOnDeformedShapePL::GetSourceRange(float theRange[2]){ +void +VISU_ScalarMapOnDeformedShapePL +::GetSourceRange(vtkFloatingPointType theRange[2]) +{ myExtractorScalars->Update(); myExtractorScalars->GetUnstructuredGridOutput()->GetScalarRange(theRange); } diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx index 6d1ccf9a..4105c413 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx @@ -50,13 +50,13 @@ public: virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SetScale(float theScale); - virtual float GetScale(); + virtual void SetScale(vtkFloatingPointType theScale); + virtual vtkFloatingPointType GetScale(); virtual int GetScalarMode(); virtual void SetScalarMode(int theScalarMode = 0); - virtual void GetSourceRange(float theRange[2]); + virtual void GetSourceRange(vtkFloatingPointType theRange[2]); virtual void SetScalars(vtkDataSet *theScalars); virtual vtkUnstructuredGrid* GetScalars(); @@ -81,10 +81,10 @@ public: void UpdateScalars(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual void SetMapScale(vtkFloatingPointType theMapScale = 1.0); protected: - float myScaleFactor; + vtkFloatingPointType myScaleFactor; vtkWarpVector *myDeformVectors; vtkMergeFilter *myMergeFilter; vtkSmartPointer myScalars; diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index daaa24e6..0d854a16 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -142,7 +142,7 @@ VISU_ScalarMapPL //---------------------------------------------------------------------------- -float* +vtkFloatingPointType* VISU_ScalarMapPL ::GetScalarRange() { @@ -151,7 +151,7 @@ VISU_ScalarMapPL void VISU_ScalarMapPL -::SetScalarRange(float theRange[2]) +::SetScalarRange(vtkFloatingPointType theRange[2]) { myFieldTransform->SetScalarRange(theRange); myBarTable->SetRange(theRange); @@ -160,17 +160,17 @@ VISU_ScalarMapPL void VISU_ScalarMapPL -::SetScalarMin(float theValue) +::SetScalarMin(vtkFloatingPointType theValue) { - float aScalarRange[2] = {theValue, GetScalarRange()[1]}; + vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]}; SetScalarRange(aScalarRange); } void VISU_ScalarMapPL -::SetScalarMax(float theValue) +::SetScalarMax(vtkFloatingPointType theValue) { - float aScalarRange[2] = {GetScalarRange()[0], theValue}; + vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue}; SetScalarRange(aScalarRange); } @@ -224,8 +224,8 @@ void VISU_ScalarMapPL ::Update() { - float *aRange = myFieldTransform->GetScalarRange(); - float aScalarRange[2] = {aRange[0], aRange[1]}; + vtkFloatingPointType *aRange = myFieldTransform->GetScalarRange(); + vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]}; if(myBarTable->GetScale() == VTK_SCALE_LOG10) VISU_LookupTable::ComputeLogRange(aRange,aScalarRange); myMapperTable->SetRange(aScalarRange); @@ -259,13 +259,13 @@ VISU_ScalarMapPL //---------------------------------------------------------------------------- void VISU_ScalarMapPL -::SetMapScale(float theMapScale) +::SetMapScale(vtkFloatingPointType theMapScale) { myMapperTable->SetMapScale(theMapScale); myMapperTable->Build(); } -float +vtkFloatingPointType VISU_ScalarMapPL::GetMapScale() { return myMapperTable->GetMapScale(); @@ -275,7 +275,7 @@ VISU_ScalarMapPL::GetMapScale() //---------------------------------------------------------------------------- void VISU_ScalarMapPL -::GetSourceRange(float theRange[2]) +::GetSourceRange(vtkFloatingPointType theRange[2]) { myExtractor->Update(); myExtractor->GetOutput()->GetScalarRange(theRange); @@ -285,7 +285,7 @@ void VISU_ScalarMapPL ::SetSourceRange() { - float aRange[2]; + vtkFloatingPointType aRange[2]; GetSourceRange(aRange); SetScalarRange(aRange); } diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index 1d810fb9..526b2dae 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -77,20 +77,20 @@ public: SetScaling(int theScaling = VTK_SCALE_LINEAR); virtual - float* + vtkFloatingPointType* GetScalarRange(); virtual void - SetScalarRange(float theRange[2]); + SetScalarRange(vtkFloatingPointType theRange[2]); virtual void - SetScalarMin(float theValue); + SetScalarMin(vtkFloatingPointType theValue); virtual void - SetScalarMax(float theValue); + SetScalarMax(vtkFloatingPointType theValue); virtual void @@ -124,15 +124,15 @@ public: virtual void - SetMapScale(float theMapScale = 1.0); + SetMapScale(vtkFloatingPointType theMapScale = 1.0); virtual - float + vtkFloatingPointType GetMapScale(); virtual void - GetSourceRange(float theRange[2]); + GetSourceRange(vtkFloatingPointType theRange[2]); virtual void diff --git a/src/PIPELINE/VISU_SphereWidget.cxx b/src/PIPELINE/VISU_SphereWidget.cxx index 2134aeb7..985283d6 100755 --- a/src/PIPELINE/VISU_SphereWidget.cxx +++ b/src/PIPELINE/VISU_SphereWidget.cxx @@ -43,7 +43,7 @@ VISU_SphereWidget::VISU_SphereWidget() mySphereActor->SetMapper(mySphereMapper); // // Define the point coordinates - float bounds[6]; + vtkFloatingPointType bounds[6]; for(int i = 0; i < 6; i += 2){ bounds[i]=-.5; bounds[i+1]=-bounds[i]; @@ -126,7 +126,7 @@ int VISU_SphereWidget::GetPhiResolution() // function: SetRadius // purpose : //==================================================================== -void VISU_SphereWidget::SetRadius(float theRadius) +void VISU_SphereWidget::SetRadius(vtkFloatingPointType theRadius) { if ( theRadius <= myRmin ) { theRadius = myRmin; @@ -138,7 +138,7 @@ void VISU_SphereWidget::SetRadius(float theRadius) // function: GetRadius // purpose : //==================================================================== -float VISU_SphereWidget::GetRadius() +vtkFloatingPointType VISU_SphereWidget::GetRadius() { return mySphereSource->GetRadius(); } @@ -146,7 +146,7 @@ float VISU_SphereWidget::GetRadius() // function: SetCenter // purpose : //==================================================================== -void VISU_SphereWidget::SetCenter(float theCenter[3]) +void VISU_SphereWidget::SetCenter(vtkFloatingPointType theCenter[3]) { mySphereSource->SetCenter(theCenter); mySphere->SetCenter(theCenter); @@ -155,9 +155,9 @@ void VISU_SphereWidget::SetCenter(float theCenter[3]) // function: SetCenter // purpose : //==================================================================== -void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ) +void VISU_SphereWidget::SetCenter(vtkFloatingPointType theX, vtkFloatingPointType theY, vtkFloatingPointType theZ) { - float aCenter[3] = {theX, theY, theZ}; + vtkFloatingPointType aCenter[3] = {theX, theY, theZ}; SetCenter(aCenter); } @@ -165,7 +165,7 @@ void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ) // function: GetCenter // purpose : //==================================================================== -float* VISU_SphereWidget::GetCenter() +vtkFloatingPointType* VISU_SphereWidget::GetCenter() { return mySphereSource->GetCenter(); } @@ -173,7 +173,7 @@ float* VISU_SphereWidget::GetCenter() // function: GetCenter // purpose : //==================================================================== -void VISU_SphereWidget::GetCenter(float theCenter[3]) +void VISU_SphereWidget::GetCenter(vtkFloatingPointType theCenter[3]) { mySphereSource->GetCenter(theCenter); } @@ -469,7 +469,7 @@ void VISU_SphereWidget::OnMiddleButtonUp() //==================================================================== void VISU_SphereWidget::Translate(double *p1, double *p2) { - float v[3], aC[3], aC1[3]; + vtkFloatingPointType v[3], aC[3], aC1[3]; // v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; @@ -495,7 +495,7 @@ void VISU_SphereWidget::Scale(double *p1, double *p2, v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; // - float aC[3], aR, sf, aR1; + vtkFloatingPointType aC[3], aR, sf, aR1; aR=mySphereSource->GetRadius(); mySphereSource->GetCenter(aC); sf=vtkMath::Norm(v)/aR; @@ -561,12 +561,12 @@ void VISU_SphereWidget::CreateDefaultProperties() // function:PlaceWidget // purpose: //==================================================================== -void VISU_SphereWidget::PlaceWidget(float bds[6]) +void VISU_SphereWidget::PlaceWidget(vtkFloatingPointType bds[6]) { - float bounds[6], center[3], radius; + vtkFloatingPointType bounds[6], center[3], radius; this->AdjustBounds(bds, bounds, center); - float dX, dY, dZ; + vtkFloatingPointType dX, dY, dZ; // dX=bounds[1]-bounds[0]; dY=bounds[3]-bounds[2]; @@ -591,7 +591,7 @@ void VISU_SphereWidget::PlaceWidget(float bds[6]) (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) + (bounds[5]-bounds[4])*(bounds[5]-bounds[4])); - static float EPS = 1.0E-1; + static vtkFloatingPointType EPS = 1.0E-1; myRmin = EPS*InitialLength; } diff --git a/src/PIPELINE/VISU_SphereWidget.hxx b/src/PIPELINE/VISU_SphereWidget.hxx index 040a4180..78be7f55 100755 --- a/src/PIPELINE/VISU_SphereWidget.hxx +++ b/src/PIPELINE/VISU_SphereWidget.hxx @@ -33,7 +33,7 @@ public: virtual void SetEnabled(int); // //PlaceWidget - virtual void PlaceWidget(float bounds[6]); + virtual void PlaceWidget(vtkFloatingPointType bounds[6]); // // Description: // Set/Get the resolution of the sphere in the Theta direction. @@ -46,22 +46,24 @@ public: // Description: // Set/Get the radius of sphere. Default is .5. - void SetRadius(float r); - float GetRadius(); + void SetRadius(vtkFloatingPointType r); + vtkFloatingPointType GetRadius(); // Description: // Set/Get the center of the sphere. - void SetCenter(float x, float y, float z); - void SetCenter(float x[3]); + void SetCenter(vtkFloatingPointType x, + vtkFloatingPointType y, + vtkFloatingPointType z); + void SetCenter(vtkFloatingPointType x[3]); - float* GetCenter(); - void GetCenter(float xyz[3]); + vtkFloatingPointType* GetCenter(); + void GetCenter(vtkFloatingPointType xyz[3]); // Description: // Set the ratio of the radius changing. - void SetRatio(float r) { myRatio = r; } - float GetRatio() { return myRatio; } + void SetRatio(vtkFloatingPointType r) { myRatio = r; } + vtkFloatingPointType GetRatio() { return myRatio; } void ChangeRadius(bool up); @@ -122,10 +124,10 @@ protected: // the manipulator in general. vtkProperty *mySphereProperty; vtkProperty *mySelectedSphereProperty; - float myRmin; + vtkFloatingPointType myRmin; vtkSphere *mySphere; vtkImplicitSum* myImplicitSum; - float myRatio; + vtkFloatingPointType myRatio; private: VISU_SphereWidget(const VISU_SphereWidget&); //Not implemented void operator=(const VISU_SphereWidget&); //Not implemented diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index 509074a9..834db9de 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -42,10 +42,10 @@ static int MYDEBUG = 0; static int MYDEBUG = 0; #endif -static float EPS = 1.0e-7; -static float aMinNbOfSteps = 1.0E+2; -//static float aMaxNbOfSteps = 1.0E+3; -static float aCoeffOfIntStep = 1.0E+1; +static vtkFloatingPointType EPS = 1.0e-7; +static vtkFloatingPointType aMinNbOfSteps = 1.0E+2; +//static vtkFloatingPointType aMaxNbOfSteps = 1.0E+3; +static vtkFloatingPointType aCoeffOfIntStep = 1.0E+1; vtkStandardNewMacro(VISU_StreamLinesPL); @@ -86,49 +86,57 @@ void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ } -float VISU_StreamLinesPL::GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, - float thePropogationTime, float thePercents) +vtkFloatingPointType +VISU_StreamLinesPL +::GetNecasseryMemorySize(vtkIdType theNbOfPoints, + vtkFloatingPointType theStepLength, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType thePercents) { - static float aStreamPointSize = sizeof(float)*15 + sizeof(vtkIdType)*2; - static float aStreamArraySize = aStreamPointSize*1024; // == 69632 + static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2; + static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632 - float aNbCells = thePercents*theNbOfPoints*2.0; - float aNbPointsPerCell = thePropogationTime/theStepLength; - float aCellsSize = aNbCells*(1+aNbPointsPerCell); - float aPointsSize = aCellsSize*3.0*sizeof(float); + vtkFloatingPointType aNbCells = thePercents*theNbOfPoints*2.0; + vtkFloatingPointType aNbPointsPerCell = thePropogationTime/theStepLength; + vtkFloatingPointType aCellsSize = aNbCells*(1+aNbPointsPerCell); + vtkFloatingPointType aPointsSize = aCellsSize*3.0*sizeof(vtkFloatingPointType); - float aConnectivitySize = aCellsSize*sizeof(vtkIdType); - float aTypesSize = aNbCells*sizeof(char); - float aLocationsSize = aNbCells*sizeof(int); - //float aNbCellsPerPoint = aCellsSize / aNbCells - 1; - float aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize; + vtkFloatingPointType aConnectivitySize = aCellsSize*sizeof(vtkIdType); + vtkFloatingPointType aTypesSize = aNbCells*sizeof(char); + vtkFloatingPointType aLocationsSize = aNbCells*sizeof(int); + //vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1; + vtkFloatingPointType aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize; - float anAssignedDataSize = aCellsSize*4.0*sizeof(float); - float anOutputDataSetSize = aMeshSize + anAssignedDataSize; + vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType); + vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize; - float aResult = aStreamArraySize*aNbCells + anOutputDataSetSize; + vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize; return aResult; } -int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, - float& thePropogationTime, float& thePercents) +int +VISU_StreamLinesPL +::FindPossibleParams(vtkPointSet* theDataSet, + vtkFloatingPointType& theStepLength, + vtkFloatingPointType& thePropogationTime, + vtkFloatingPointType& thePercents) { - static float aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0; + static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0; vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints(); - float aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents); + vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents); int isPoss = CheckAvailableMemory(aSize); if(!isPoss){ - float aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime); - float aMinStepLength = GetMinStepLength(theDataSet); - float aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease; + vtkFloatingPointType aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime); + vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet); + vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease; for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){ - float aStepLength = theStepLength + aDeltaStepLength; + vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength; if(aStepLength < aMaxStepLength) theStepLength = aStepLength; else if(aStepChanged){ aStepLength = aMaxStepLength; aStepChanged = 0; } - float aPercents = thePercents /= aPercentsDecrease; + vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease; if(aPercents*aNbOfPoints > 1) thePercents = aPercents; else if(aPerecentsChanged) { thePercents = 1.1 / aNbOfPoints; @@ -146,13 +154,15 @@ int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theSt } -int VISU_StreamLinesPL::SetParams(float theIntStep, - float thePropogationTime, - float theStepLength, - vtkPointSet* theSource, - float thePercents, - int theDirection, - int isOnlyTry) +int +VISU_StreamLinesPL +::SetParams(vtkFloatingPointType theIntStep, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType theStepLength, + vtkPointSet* theSource, + vtkFloatingPointType thePercents, + int theDirection, + int isOnlyTry) { vtkPointSet* aDataSet = theSource? theSource: myFieldTransform->GetUnstructuredGridOutput(); aDataSet->Update(); @@ -187,31 +197,50 @@ int VISU_StreamLinesPL::SetParams(float theIntStep, } -vtkPointSet* VISU_StreamLinesPL::GetSource() { +vtkPointSet* +VISU_StreamLinesPL +::GetSource() +{ return mySource; } -float VISU_StreamLinesPL::GetUsedPoints() { +vtkFloatingPointType +VISU_StreamLinesPL +::GetUsedPoints() +{ return myPercents; } -vtkDataSet* VISU_StreamLinesPL::GetStreamerSource(){ +vtkDataSet* +VISU_StreamLinesPL +::GetStreamerSource() +{ return myStream->GetSource(); } -float VISU_StreamLinesPL::GetVelocityCoeff(){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetVelocityCoeff() +{ return GetVelocityCoeff(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetVelocityCoeff(vtkPointSet* theDataSet){ - float* aScalarRange = theDataSet->GetScalarRange(); +vtkFloatingPointType +VISU_StreamLinesPL +::GetVelocityCoeff(vtkPointSet* theDataSet) +{ + vtkFloatingPointType* aScalarRange = theDataSet->GetScalarRange(); return (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0; } -int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){ - float aStepLength = GetBaseStepLength(theDataSet); - float aBasePropTime = GetBasePropagationTime(theDataSet); +int +VISU_StreamLinesPL +::IsPossible(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents) +{ + vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet); + vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet); VISU_UsedPointsFilter *aPointsFilter = VISU_UsedPointsFilter::New(); aPointsFilter->SetInput(theDataSet); vtkPointSet* aDataSet = aPointsFilter->GetOutput(); @@ -223,71 +252,105 @@ int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){ } -float VISU_StreamLinesPL::GetIntegrationStep(){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetIntegrationStep() +{ return myStream->GetIntegrationStepLength(); } -float VISU_StreamLinesPL::GetStepLength() { + +vtkFloatingPointType +VISU_StreamLinesPL +::GetStepLength() +{ return myStream->GetStepLength(); } -float VISU_StreamLinesPL::GetPropagationTime() { + +vtkFloatingPointType +VISU_StreamLinesPL +::GetPropagationTime() +{ return myStream->GetMaximumPropagationTime(); } -int VISU_StreamLinesPL::GetDirection(){ + +int +VISU_StreamLinesPL +::GetDirection() +{ return myStream->GetIntegrationDirection(); } -float VISU_StreamLinesPL::GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents) { +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinIntegrationStep(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents) +{ if(!theDataSet) return -1.0; - float aVolume = 1.0; + vtkFloatingPointType aVolume = 1.0; int degree = 0; theDataSet->Update(); - float* aBounds = theDataSet->GetBounds(); + vtkFloatingPointType* aBounds = theDataSet->GetBounds(); for(int i = 0, j = 0; i < 3; ++i, j = 2*i){ - float tmp = aBounds[j+1] - aBounds[j]; + vtkFloatingPointType tmp = aBounds[j+1] - aBounds[j]; if (tmp > EPS ) { aVolume *= tmp; degree += 1; } } if (degree < 1) return 0.0; // absolutely empty object - float anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep; - float aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet); + vtkFloatingPointType anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep; + vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet); thePercents = 1.0; vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints(); - float aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents); - float aRealSize = GetAvailableMemory(aSize); - float anAverageVolume = aVolume / aRealSize; - float aStep = pow(double(anAverageVolume), double(1.0/double(degree))); + vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents); + vtkFloatingPointType aRealSize = GetAvailableMemory(aSize); + vtkFloatingPointType anAverageVolume = aVolume / aRealSize; + vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree))); return aStep; } -float VISU_StreamLinesPL::GetMinIntegrationStep(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinIntegrationStep() +{ return GetMinIntegrationStep(myExtractor->GetOutput(),GetUsedPoints()); } -float VISU_StreamLinesPL::GetMaxIntegrationStep(vtkPointSet* theDataSet) { +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxIntegrationStep(vtkPointSet* theDataSet) +{ if(!theDataSet) return -1.0; theDataSet->Update(); - float aLength = theDataSet->GetLength(); - float* aBounds = theDataSet->GetBounds(); - float aMaxSizeY = (aBounds[3]-aBounds[2])/aLength; - float aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength; - float aMinMax = (aBounds[1] - aBounds[0])/aLength; + vtkFloatingPointType aLength = theDataSet->GetLength(); + vtkFloatingPointType* aBounds = theDataSet->GetBounds(); + vtkFloatingPointType aMaxSizeY = (aBounds[3]-aBounds[2])/aLength; + vtkFloatingPointType aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength; + vtkFloatingPointType aMinMax = (aBounds[1] - aBounds[0])/aLength; if (aMinMax < EPS || (aMaxSizeY < aMinMax && aMaxSizeY > EPS)) aMinMax = aMaxSizeY; if (aMinMax < EPS || (aMaxSizeZ < aMinMax && aMaxSizeZ > EPS)) aMinMax = aMaxSizeZ; return aMinMax*aLength/2.0; } -float VISU_StreamLinesPL::GetMaxIntegrationStep(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxIntegrationStep() +{ return GetMaxIntegrationStep(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetBaseIntegrationStep(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents) +{ theDataSet->Update(); - float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents); - float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); - float anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep; - float aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints(); + vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents); + vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); + vtkFloatingPointType anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep; + vtkFloatingPointType aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints(); if(aMinMax > anIntegrationStep) anIntegrationStep = (anIntegrationStep*aCoeffOfIntStep*0.9+aMinMax)/aCoeffOfIntStep; if(aMinIntegrationStep > anIntegrationStep) @@ -295,10 +358,15 @@ float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float return anIntegrationStep; } -float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents){ +vtkFloatingPointType +VISU_StreamLinesPL +::CorrectIntegrationStep(vtkFloatingPointType theStep, + vtkPointSet* theDataSet, + vtkFloatingPointType thePercents) +{ theDataSet->Update(); - float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents); - float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); + vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents); + vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); if(aMinIntegrationStep > theStep) theStep = aMinIntegrationStep; if(aMaxIntegrationStep < theStep) @@ -307,99 +375,156 @@ float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* the } -float VISU_StreamLinesPL::GetMinPropagationTime(vtkPointSet* theDataSet){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinPropagationTime(vtkPointSet* theDataSet) +{ if(!theDataSet) return -1.0; return GetMinStepLength(theDataSet); } -float VISU_StreamLinesPL::GetMinPropagationTime(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinPropagationTime() +{ return GetMinPropagationTime(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetMaxPropagationTime(vtkPointSet* theDataSet){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxPropagationTime(vtkPointSet* theDataSet) +{ if(!theDataSet) return -1.0; return GetBasePropagationTime(theDataSet)*aMinNbOfSteps; } -float VISU_StreamLinesPL::GetMaxPropagationTime(){ + +vtkFloatingPointType VISU_StreamLinesPL::GetMaxPropagationTime(){ return GetMaxPropagationTime(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet){ - float aMinPropagationTime = GetMinPropagationTime(theDataSet); - float aMaxPropagationTime = GetMaxPropagationTime(theDataSet); +vtkFloatingPointType +VISU_StreamLinesPL +::CorrectPropagationTime(vtkFloatingPointType thePropagationTime, + vtkPointSet* theDataSet) +{ + vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet); + vtkFloatingPointType aMaxPropagationTime = GetMaxPropagationTime(theDataSet); if(aMinPropagationTime > thePropagationTime) thePropagationTime = aMinPropagationTime; if(aMaxPropagationTime < thePropagationTime) thePropagationTime = aMaxPropagationTime; return thePropagationTime; } -float VISU_StreamLinesPL::GetBasePropagationTime(vtkPointSet* theDataSet){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetBasePropagationTime(vtkPointSet* theDataSet) +{ if(!theDataSet) return -1.0; theDataSet->Update(); - float aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet); + vtkFloatingPointType aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet); return aPropagationTime; } -float VISU_StreamLinesPL::GetBasePropagationTime(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetBasePropagationTime() +{ return GetBasePropagationTime(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetMinStepLength(vtkPointSet* theDataSet){ - static float aNbOfStepsOfIntStep = 1.0E+1; - float anIntStep = GetMinIntegrationStep(theDataSet); - float aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet); +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinStepLength(vtkPointSet* theDataSet) +{ + static vtkFloatingPointType aNbOfStepsOfIntStep = 1.0E+1; + vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet); + vtkFloatingPointType aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet); return aStepLength; } -float VISU_StreamLinesPL::GetMinStepLength(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinStepLength() +{ return GetMinStepLength(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetMaxStepLength(vtkPointSet* theDataSet){ - float aStepLength = GetBasePropagationTime(theDataSet); +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxStepLength(vtkPointSet* theDataSet) +{ + vtkFloatingPointType aStepLength = GetBasePropagationTime(theDataSet); return aStepLength; } -float VISU_StreamLinesPL::GetMaxStepLength(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxStepLength() +{ return GetMaxStepLength(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::CorrectStepLength(float theStep, vtkPointSet* theDataSet){ - float aMinStep = GetMinStepLength(theDataSet); +vtkFloatingPointType +VISU_StreamLinesPL +::CorrectStepLength(vtkFloatingPointType theStep, + vtkPointSet* theDataSet) +{ + vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet); if(theStep < aMinStep) theStep = aMinStep; - float aMaxStep = GetMaxStepLength(theDataSet); + vtkFloatingPointType aMaxStep = GetMaxStepLength(theDataSet); if(theStep > aMaxStep) theStep = aMaxStep; return theStep; } -float VISU_StreamLinesPL::GetBaseStepLength(vtkPointSet* theDataSet){ - static float anAvgNbOfSteps = 1.0E+2; - float aPropagationTime = GetBasePropagationTime(theDataSet); - float aStepLength = aPropagationTime/anAvgNbOfSteps; + +vtkFloatingPointType +VISU_StreamLinesPL +::GetBaseStepLength(vtkPointSet* theDataSet) +{ + static vtkFloatingPointType anAvgNbOfSteps = 1.0E+2; + vtkFloatingPointType aPropagationTime = GetBasePropagationTime(theDataSet); + vtkFloatingPointType aStepLength = aPropagationTime/anAvgNbOfSteps; aStepLength = CorrectStepLength(aStepLength,theDataSet); return aStepLength; } -void VISU_StreamLinesPL::Init(){ +void +VISU_StreamLinesPL +::Init() +{ VISU_ScalarMapPL::Init(); vtkPointSet* aDataSet = myExtractor->GetOutput(); - float anIntStep = GetBaseIntegrationStep(aDataSet); - float aPropagationTime = GetBasePropagationTime(aDataSet); - float aStepLength = GetBaseStepLength(aDataSet); + vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet); + vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet); + vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet); SetParams(anIntStep,aPropagationTime,aStepLength); } -VISU_ScalarMapPL::THook* VISU_StreamLinesPL::DoHook(){ +VISU_ScalarMapPL::THook* +VISU_StreamLinesPL +::DoHook() +{ GetInput2()->Update(); VISU::CellDataToPoint(myStream,myCellDataToPointData,GetInput2(),myFieldTransform); - float *aBounds = GetInput2()->GetBounds(); + vtkFloatingPointType *aBounds = GetInput2()->GetBounds(); myGeomFilter->SetExtent(aBounds); myGeomFilter->ExtentClippingOn(); myGeomFilter->SetInput(myStream->GetOutput()); return myGeomFilter->GetOutput(); } -void VISU_StreamLinesPL::Update(){ +void +VISU_StreamLinesPL +::Update() +{ VISU_ScalarMapPL::Update(); } -void VISU_StreamLinesPL::SetMapScale(float theMapScale){ +void +VISU_StreamLinesPL +::SetMapScale(vtkFloatingPointType theMapScale) +{ VISU_ScalarMapPL::SetMapScale(theMapScale); } diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index b360f974..448c63ca 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -37,82 +37,197 @@ class vtkCellCenters; class VTKViewer_GeometryFilter; class VISU_UsedPointsFilter; -class VISU_StreamLinesPL : public VISU_DeformedShapePL{ +class VISU_StreamLinesPL : public VISU_DeformedShapePL +{ protected: VISU_StreamLinesPL(); VISU_StreamLinesPL(const VISU_StreamLinesPL&); + + virtual + ~VISU_StreamLinesPL(); + public: vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL); - static VISU_StreamLinesPL* New(); - virtual ~VISU_StreamLinesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - - virtual int SetParams(float theIntStep, - float thePropogationTime, - float theStepLength, - vtkPointSet* theSource = NULL, - float thePercents = 0.3, - int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS, - int isOnlyTry = false); - virtual vtkPointSet* GetSource(); - virtual float GetUsedPoints(); - virtual float GetIntegrationStep(); - virtual float GetPropagationTime(); - virtual float GetStepLength(); - virtual int GetDirection(); - - virtual vtkDataSet* GetStreamerSource(); - virtual float GetVelocityCoeff(); - - virtual float GetMaxIntegrationStep(); - virtual float GetMinIntegrationStep(); - - virtual float GetMinStepLength(); - virtual float GetMaxStepLength(); - - virtual float GetMinPropagationTime(); - virtual float GetMaxPropagationTime(); - virtual float GetBasePropagationTime(); + + static + VISU_StreamLinesPL* + New(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + int + SetParams(vtkFloatingPointType theIntStep, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType theStepLength, + vtkPointSet* theSource = NULL, + vtkFloatingPointType thePercents = 0.3, + int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS, + int isOnlyTry = false); + + virtual + vtkPointSet* + GetSource(); + + virtual + vtkFloatingPointType + GetUsedPoints(); + + virtual + vtkFloatingPointType + GetIntegrationStep(); + + virtual + vtkFloatingPointType + GetPropagationTime(); + + virtual + vtkFloatingPointType + GetStepLength(); + + virtual + int + GetDirection(); + + virtual + vtkDataSet* + GetStreamerSource(); + + virtual + vtkFloatingPointType + GetVelocityCoeff(); + + virtual + vtkFloatingPointType + GetMaxIntegrationStep(); + + virtual + vtkFloatingPointType + GetMinIntegrationStep(); + + virtual + vtkFloatingPointType + GetMinStepLength(); + + virtual + vtkFloatingPointType + GetMaxStepLength(); + + virtual + vtkFloatingPointType + GetMinPropagationTime(); + + virtual + vtkFloatingPointType + GetMaxPropagationTime(); + + virtual + vtkFloatingPointType + GetBasePropagationTime(); public: - virtual THook* DoHook(); - virtual void Init(); - virtual void Update(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual + THook* + DoHook(); + + virtual + void + Init(); + + virtual + void + Update(); + + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); public: - static float GetMaxIntegrationStep(vtkPointSet* theDataSet); - static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3); - static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3); + static + vtkFloatingPointType + GetMaxIntegrationStep(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetMinIntegrationStep(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); + static + vtkFloatingPointType + GetBaseIntegrationStep(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); - static float GetMinPropagationTime(vtkPointSet* theDataSet); - static float GetMaxPropagationTime(vtkPointSet* theDataSet); - static float GetBasePropagationTime(vtkPointSet* theDataSet); + static + vtkFloatingPointType + GetMinPropagationTime(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetMaxPropagationTime(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetBasePropagationTime(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetMinStepLength(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetMaxStepLength(vtkPointSet* theDataSet); - static float GetMinStepLength(vtkPointSet* theDataSet); - static float GetMaxStepLength(vtkPointSet* theDataSet); - static float GetBaseStepLength(vtkPointSet* theDataSet); + static + vtkFloatingPointType + GetBaseStepLength(vtkPointSet* theDataSet); - static float GetVelocityCoeff(vtkPointSet* theDataSet); + static + vtkFloatingPointType + GetVelocityCoeff(vtkPointSet* theDataSet); - static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3); + static + int + IsPossible(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); protected: - static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, - float thePropogationTime, float thePercents = 0.3); - static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, - float& thePropogationTime, float& thePercents); + static + vtkFloatingPointType + GetNecasseryMemorySize(vtkIdType theNbOfPoints, + vtkFloatingPointType theStepLength, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType thePercents = 0.3); + + static + int + FindPossibleParams(vtkPointSet* theDataSet, + vtkFloatingPointType& theStepLength, + vtkFloatingPointType& thePropogationTime, + vtkFloatingPointType& thePercents); - static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3); - static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet); - static float CorrectStepLength(float theStep, vtkPointSet* theDataSet); + static + vtkFloatingPointType + CorrectIntegrationStep(vtkFloatingPointType theStep, + vtkPointSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); + + static + vtkFloatingPointType + CorrectPropagationTime(vtkFloatingPointType thePropagationTime, + vtkPointSet* theDataSet); + + static + vtkFloatingPointType + CorrectStepLength(vtkFloatingPointType theStep, + vtkPointSet* theDataSet); vtkStreamLine* myStream; vtkPointSet* mySource; vtkCellCenters* myCenters; VTKViewer_GeometryFilter *myGeomFilter; VISU_UsedPointsFilter *myPointsFilter; - float myPercents; + vtkFloatingPointType myPercents; }; diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index 92a5e575..d37324f6 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -101,7 +101,7 @@ VISU_VectorsPL void VISU_VectorsPL -::SetScale(float theScale) +::SetScale(vtkFloatingPointType theScale) { if(myScaleFactor == theScale) return; @@ -114,7 +114,7 @@ VISU_VectorsPL Modified(); } -float +vtkFloatingPointType VISU_VectorsPL ::GetScale() { @@ -219,7 +219,7 @@ VISU_VectorsPL void VISU_VectorsPL -::SetMapScale(float theMapScale) +::SetMapScale(vtkFloatingPointType theMapScale) { VISU_ScalarMapPL::SetMapScale(theMapScale); diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx index 312d56fc..9f3e6db4 100644 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ b/src/PIPELINE/VISU_VectorsPL.hxx @@ -39,41 +39,94 @@ class vtkLineSource; class vtkGlyph3D; -class VISU_VectorsPL : public VISU_DeformedShapePL{ +class VISU_VectorsPL : public VISU_DeformedShapePL +{ protected: VISU_VectorsPL(); VISU_VectorsPL(const VISU_VectorsPL&); + + virtual + ~VISU_VectorsPL(); + public: vtkTypeMacro(VISU_VectorsPL,VISU_DeformedShapePL); - static VISU_VectorsPL* New(); - virtual ~VISU_VectorsPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SetScale(float theScale); - virtual float GetScale(); + static + VISU_VectorsPL* + New(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + void + SetScale(vtkFloatingPointType theScale); + + virtual + vtkFloatingPointType + GetScale(); enum GlyphType{ ARROW, CONE2, CONE6, NONE}; - virtual void SetGlyphType(GlyphType theType) { myTypeGlyph = theType;} - virtual GlyphType GetGlyphType() { return myTypeGlyph;} + + virtual + void + SetGlyphType(GlyphType theType) + { + myTypeGlyph = theType; + } + + virtual + GlyphType + GetGlyphType() + { + return myTypeGlyph; + } enum GlyphPos{ CENTER, TAIL,HEAD}; - virtual void SetGlyphPos(GlyphPos thePos) { myPosGlyph = thePos;} - virtual GlyphPos GetGlyphPos() { return myPosGlyph;} + + virtual + void + SetGlyphPos(GlyphPos thePos) + { + myPosGlyph = thePos; + } + + virtual + GlyphPos + GetGlyphPos() + { + return myPosGlyph; + } public: - virtual void Init(); - virtual void Update(); + virtual + void + Init(); + + virtual + void + Update(); vtkDataSet* GetOutput(); - virtual void SetTransform(VTKViewer_Transform* theTransform); - virtual VTKViewer_Transform* GetTransform(); + virtual + void + SetTransform(VTKViewer_Transform* theTransform); + + virtual + VTKViewer_Transform* + GetTransform(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); protected: - virtual THook* DoHook(); + virtual + THook* + DoHook(); GlyphType myTypeGlyph; GlyphPos myPosGlyph; diff --git a/src/PIPELINE/VISU_WidgetCtrl.cxx b/src/PIPELINE/VISU_WidgetCtrl.cxx index bb62dc63..3e970a52 100644 --- a/src/PIPELINE/VISU_WidgetCtrl.cxx +++ b/src/PIPELINE/VISU_WidgetCtrl.cxx @@ -268,7 +268,7 @@ VISU_SphereWidget* VISU_WidgetCtrl::GetSphereWidget() // function: PlaceWidget // purpose : //================================================================== -void VISU_WidgetCtrl::PlaceWidget(float theBounds[6]) +void VISU_WidgetCtrl::PlaceWidget(vtkFloatingPointType theBounds[6]) { for (int i=0; iPlaceWidget(theBounds); @@ -298,7 +298,7 @@ vtkRenderWindowInteractor* VISU_WidgetCtrl::GetInteractor() // function: SetPlaceFactor // purpose : //================================================================== -void VISU_WidgetCtrl::SetPlaceFactor(float theFactor) +void VISU_WidgetCtrl::SetPlaceFactor(vtkFloatingPointType theFactor) { for (int i=0; iSetPlaceFactor(theFactor); @@ -310,7 +310,7 @@ void VISU_WidgetCtrl::SetPlaceFactor(float theFactor) // function: GetPlaceFactor // purpose : //================================================================== -float VISU_WidgetCtrl::GetPlaceFactor() +vtkFloatingPointType VISU_WidgetCtrl::GetPlaceFactor() { return myWidgets[0]->GetPlaceFactor(); } @@ -324,9 +324,9 @@ vtkImplicitFunction* VISU_WidgetCtrl::ImplicitFunction() } //================================================================== -float +vtkFloatingPointType VISU_WidgetCtrl -::EvaluateFunction(float theX[3]) +::EvaluateFunction(vtkFloatingPointType theX[3]) { if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){ if(vtkImplicitFunction* aFunction = aWidget->ImplicitFunction()) @@ -338,7 +338,8 @@ VISU_WidgetCtrl //================================================================== void VISU_WidgetCtrl -::EvaluateGradient(float theX[3], float theG[3]) +::EvaluateGradient(vtkFloatingPointType theX[3], + vtkFloatingPointType theG[3]) { theG[0] = theG[1] = theG[2] = 0.0; if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){ diff --git a/src/PIPELINE/VISU_WidgetCtrl.hxx b/src/PIPELINE/VISU_WidgetCtrl.hxx index 8737b5dc..78b80566 100644 --- a/src/PIPELINE/VISU_WidgetCtrl.hxx +++ b/src/PIPELINE/VISU_WidgetCtrl.hxx @@ -51,18 +51,19 @@ public: vtkImplicitFunction* ImplicitFunction(); virtual - float - EvaluateFunction(float theX[3]); + vtkFloatingPointType + EvaluateFunction(vtkFloatingPointType theX[3]); virtual void - EvaluateGradient(float theX[3], float theG[3]); + EvaluateGradient(vtkFloatingPointType theX[3], + vtkFloatingPointType theG[3]); virtual unsigned long GetMTime(); - void PlaceWidget(float theBounds[6]); + void PlaceWidget(vtkFloatingPointType theBounds[6]); void SetEnabled(int theFlag); int GetEnabled(); void On() {SetEnabled(1);} @@ -71,8 +72,11 @@ public: void SetInteractor(vtkRenderWindowInteractor* theRWI); vtkRenderWindowInteractor* GetInteractor(); // - void SetPlaceFactor(float theFactor); - float GetPlaceFactor(); + void + SetPlaceFactor(vtkFloatingPointType theFactor); + + vtkFloatingPointType + GetPlaceFactor(); // void SetActiveIndex(const int theFlag); int GetActiveIndex()const; @@ -105,7 +109,7 @@ protected: int myActiveIndex; int myCounter; int myDisableAll; - float myPriority; + vtkFloatingPointType myPriority; VISU_ImplicitFunctionWidget *myWidgets[2]; VISU_ImplicitFunctionWidget *myDummyWidget; VISU_PlanesWidget *myPlanesWidget; diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.cxx b/src/VISUGUI/VisuGUI_ClippingDlg.cxx index c2d918bd..656fb80f 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingDlg.cxx @@ -120,7 +120,7 @@ public: VISU::Orientation myOrientation; - float myDistance; + vtkFloatingPointType myDistance; double myAngle[2]; vtkPlaneSource* myPlaneSource; @@ -129,8 +129,14 @@ public: void SetOrientation(VISU::Orientation theOrientation) {myOrientation = theOrientation;} VISU::Orientation GetOrientation() {return myOrientation;} - void SetDistance(float theDistance) {myDistance = theDistance;} - float GetDistance() {return myDistance;} + void SetDistance(vtkFloatingPointType theDistance) + { + myDistance = theDistance; + } + vtkFloatingPointType GetDistance() + { + return myDistance; + } void ShallowCopy(OrientedPlane* theOrientedPlane){ SetNormal(theOrientedPlane->GetNormal()); @@ -182,7 +188,7 @@ protected: myActor->SetMapper(myMapper); vtkProperty* aProp = vtkProperty::New(); - float anRGB[3]; + vtkFloatingPointType anRGB[3]; SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); @@ -607,8 +613,8 @@ void VisuGUI_ClippingDlg::onSelectionChanged() std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false)); myPlanes.clear(); - float anOffset [3]; - myPrs3d->GetOffset(anOffset); + CORBA::Float anOffset[3]; + myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]); vtkIdType anId = 0, anEnd = myPrs3d->GetNumberOfClippingPlanes(); for (; anId < anEnd; anId++) { @@ -618,7 +624,7 @@ void VisuGUI_ClippingDlg::onSelectionChanged() VISU::TVTKPlane aTVTKPlane(anOrientedPlane); anOrientedPlane->Delete(); aTVTKPlane->ShallowCopy(aPlane); - aTVTKPlane->myActor->SetPosition(anOffset); + aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]); myPlanes.push_back(aTVTKPlane); } } @@ -690,9 +696,9 @@ void VisuGUI_ClippingDlg::ClickOnNew() VISU::TVTKPlane aTVTKPlane(aPlane); myPlanes.push_back(aTVTKPlane); - float anOffset [3]; - myPrs3d->GetOffset(anOffset); - aTVTKPlane->myActor->SetPosition(anOffset); + CORBA::Float anOffset[3]; + myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]); + aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]); if (PreviewCheckBox->isChecked()) aTVTKPlane->myActor->VisibilityOn(); @@ -817,18 +823,18 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam() OrientedPlane* aPlane = myPlanes[aCurPlaneIndex].GetPointer(); - float aNormal[3]; + vtkFloatingPointType aNormal[3]; VISU::Orientation anOrientation; - float aDir[3][3] = {{0, 0, 0}, {0, 0, 0}}; + vtkFloatingPointType aDir[3][3] = {{0, 0, 0}, {0, 0, 0}}; { static double aCoeff = vtkMath::Pi()/180.0; - float aRot[2] = {getRotation1(), getRotation2()}; + vtkFloatingPointType aRot[2] = {getRotation1(), getRotation2()}; aPlane->myAngle[0] = aRot[0]; aPlane->myAngle[1] = aRot[1]; - float anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])}; - float aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])}; + vtkFloatingPointType anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])}; + vtkFloatingPointType aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])}; aV[0] = aRot[0] > 0? aV[0]: -aV[0]; aV[1] = aRot[1] > 0? aV[1]: -aV[1]; @@ -876,37 +882,37 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam() myPrs3d->SetPlaneParam(aNormal, 1. - getDistance(), aPlane); vtkDataSet* aDataSet = myPrs3d->GetInput(); - float *aPnt = aDataSet->GetCenter(); + vtkFloatingPointType *aPnt = aDataSet->GetCenter(); - float* anOrigin = aPlane->GetOrigin(); - float aDel = aDataSet->GetLength()/2.0; + vtkFloatingPointType* anOrigin = aPlane->GetOrigin(); + vtkFloatingPointType aDel = aDataSet->GetLength()/2.0; - float aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel}, - {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; - float aParam, aPnt0[3], aPnt1[3], aPnt2[3]; + vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel}, + {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; + vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3]; - float aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0], - aPnt[1] - aDelta[0][1] - aDelta[1][1], - aPnt[2] - aDelta[0][2] - aDelta[1][2]}; - float aPnt02[3] = {aPnt01[0] + aNormal[0], - aPnt01[1] + aNormal[1], - aPnt01[2] + aNormal[2]}; + vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0], + aPnt[1] - aDelta[0][1] - aDelta[1][1], + aPnt[2] - aDelta[0][2] - aDelta[1][2]}; + vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0], + aPnt01[1] + aNormal[1], + aPnt01[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0); - float aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0], - aPnt[1] - aDelta[0][1] + aDelta[1][1], - aPnt[2] - aDelta[0][2] + aDelta[1][2]}; - float aPnt12[3] = {aPnt11[0] + aNormal[0], - aPnt11[1] + aNormal[1], - aPnt11[2] + aNormal[2]}; + vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0], + aPnt[1] - aDelta[0][1] + aDelta[1][1], + aPnt[2] - aDelta[0][2] + aDelta[1][2]}; + vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0], + aPnt11[1] + aNormal[1], + aPnt11[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1); - float aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0], - aPnt[1] + aDelta[0][1] - aDelta[1][1], - aPnt[2] + aDelta[0][2] - aDelta[1][2]}; - float aPnt22[3] = {aPnt21[0] + aNormal[0], - aPnt21[1] + aNormal[1], - aPnt21[2] + aNormal[2]}; + vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0], + aPnt[1] + aDelta[0][1] - aDelta[1][1], + aPnt[2] + aDelta[0][2] - aDelta[1][2]}; + vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0], + aPnt21[1] + aNormal[1], + aPnt21[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2); vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource; @@ -953,14 +959,14 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam() int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->selected()); VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axId; gp_Dir dir; - const vector * values = + const vector * values = result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir); if (!values) return; // find distance; int index = SpinBoxIJKIndex->value(); - float distance = 0; + vtkFloatingPointType distance = 0; if (index < values->size()) distance = (*values)[ index ]; @@ -977,14 +983,14 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam() } } // find rotation angles - float angle[2]; + vtkFloatingPointType angle[2]; int rotId[2] = { (axId == 0) ? 2 : axId - 1, (axId == 2) ? 0 : axId + 1 }; static double aCoeff = 180.0/vtkMath::Pi(); for (i = 0; i < 2; ++i) { - float cosin = cos[ rotId[ i ]]; + vtkFloatingPointType cosin = cos[ rotId[ i ]]; if (maxCos < 0) cosin = -cosin; angle[ i ] = asin(cosin) * aCoeff; @@ -1021,7 +1027,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured() int planeIndex = ComboBoxPlanes->currentItem(); OrientedPlane* plane = myPlanes[ planeIndex ].GetPointer(); vtkPlaneSource* planeSource = plane->myPlaneSource; - float * planeNormal = planeSource->GetNormal(); + vtkFloatingPointType * planeNormal = planeSource->GetNormal(); gp_Dir normal(planeNormal[0], planeNormal[1], planeNormal[2]); // find a grid axis most co-directed with plane normal @@ -1029,7 +1035,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured() int i, maxAx = 0, gridAxId = 0; gp_Dir dir, gridDir; double maxDot = 0; - const vector *curValues, *values = 0; + const vector *curValues, *values = 0; VISU::Result_i* result = myPrs3d->GetResult(); for (i = 0; i < 3; ++i) { VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i; @@ -1104,8 +1110,8 @@ void VisuGUI_ClippingDlg::onIJKAxisChanged(int axisId) if (result) { VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId; gp_Dir dir; - const vector * indices = result->GetAxisInfo(myPrs3d->GetMeshName(), - axis, dir); + const vector * indices = result->GetAxisInfo(myPrs3d->GetMeshName(), + axis, dir); if (indices) maxIndex = indices->size() - 1; } diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index bdfe873e..b24e48c2 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -461,7 +461,7 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate) //aView->Repaint(); } } - float aPos = myCutLines->GetBasePlanePosition(); + vtkFloatingPointType aPos = myCutLines->GetBasePlanePosition(); myBasePlanePos->setText( QString::number(aPos) ); myBasePlanePos->setEnabled(false); } else { @@ -536,15 +536,15 @@ void VisuGUI_CutLinesDlg::DrawTable() void VisuGUI_CutLinesDlg::updateGlyphs(bool update){ if (myPreviewActorGlyphs == 0 ) return; - const float *aDirLn = myCutLines->GetCutLinesPL()->GetDirLn(); - const float *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt(); - float aSecondPnt[3]; - float aBoundCenter[3]; + const vtkFloatingPointType *aDirLn = myCutLines->GetCutLinesPL()->GetDirLn(); + const vtkFloatingPointType *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt(); + vtkFloatingPointType aSecondPnt[3]; + vtkFloatingPointType aBoundCenter[3]; vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData(); vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New(); aPlaneMapper->SetInput(aPolyData->GetOutput()); - float bounds[6]; + vtkFloatingPointType bounds[6]; aPlaneMapper->GetBounds(bounds); for(int i=0; i<3; i++) aBoundCenter[i] = (bounds[i*2] + bounds[i*2+1])/2.0; @@ -555,7 +555,7 @@ void VisuGUI_CutLinesDlg::updateGlyphs(bool update){ aSecondPnt[i] = -aBasePnt[i] - aDirLn[i]; } - float max_bound = 0; + vtkFloatingPointType max_bound = 0; max_bound < bounds[1]-bounds[0] ? max_bound = bounds[1] - bounds[0] : max_bound = max_bound; max_bound < bounds[3]-bounds[2] ? max_bound = bounds[3] - bounds[2] : max_bound = max_bound; max_bound < bounds[5]-bounds[4] ? max_bound = bounds[5] - bounds[4] : max_bound = max_bound; diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index dfbe850f..c88b47e3 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -340,7 +340,7 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs) // "Title" myTextDlg->setTitleText(QString(thePrs->GetTitle())); - float R, G, B; + vtkFloatingPointType R, G, B; thePrs->GetTitleColor(&R, &G, &B); myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)), diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index b08bb8c9..e8c0645f 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -1017,7 +1017,7 @@ namespace const char* theSuffix, std::ostringstream& theStr) { - float aColor[3]; + vtkFloatingPointType aColor[3]; vtkRenderer* aRenderer = theViewWindow->getRenderer(); aRenderer->GetBackground(aColor); Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".R").c_str(),aColor[0]); @@ -1043,7 +1043,7 @@ namespace Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[1]").c_str(),aViewUp[1]); Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[2]").c_str(),aViewUp[2]); - float aParallelScale = aCamera->GetParallelScale(); + vtkFloatingPointType aParallelScale = aCamera->GetParallelScale(); Storable::DataToStream(theStr,(std::string("myParallelScale") + theSuffix).c_str(),aParallelScale); double aScaleFactor[3]; @@ -1059,7 +1059,7 @@ namespace const char* theSuffix, const Storable::TRestoringMap& theMap) { - float aColor[3]; + vtkFloatingPointType aColor[3]; aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble(); aColor[1] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".G").toDouble(); aColor[2] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".B").toDouble(); @@ -1085,7 +1085,7 @@ namespace aViewUp[2] = Storable::FindValue(theMap,std::string("myViewUp") + theSuffix + "[2]").toDouble(); aCamera->SetViewUp(aViewUp); - float aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble(); + vtkFloatingPointType aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble(); aCamera->SetParallelScale(aParallelScale); double aScaleFactor[3]; @@ -1107,31 +1107,31 @@ namespace std::string aSegmentationMode; if(aWidgetCtrl->IsPlanesActive()){ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget(); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; aPlanesWidget->GetOrigin(anOrigin); Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]); Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]); Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]); - float aNormal[3]; + vtkFloatingPointType aNormal[3]; aPlanesWidget->GetNormal(aNormal); Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]); Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]); Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]); - float aDepth = aPlanesWidget->Distance(); + vtkFloatingPointType aDepth = aPlanesWidget->Distance(); Storable::DataToStream(theStr,"myCursorDepth",aDepth); aSegmentationMode = "Planes"; }else if(aWidgetCtrl->IsSphereActive()){ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget(); - float aCenter[3]; + vtkFloatingPointType aCenter[3]; aSphereWidget->GetCenter(aCenter); Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]); Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]); Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]); - float aRadius = aSphereWidget->GetRadius(); + vtkFloatingPointType aRadius = aSphereWidget->GetRadius(); Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius); aSegmentationMode = "Sphere"; @@ -1499,31 +1499,31 @@ OnRestoreConfiguration() if(aSegmentationMode == "Planes"){ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget(); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble(); anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble(); anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble(); aPlanesWidget->SetOrigin(anOrigin); - float aNormal[3]; + vtkFloatingPointType aNormal[3]; aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble(); aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble(); aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble(); aPlanesWidget->SetNormal(aNormal); - float aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble(); + vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble(); aPlanesWidget->SetDistance(aDepth); aMainWindow->SetPlanesSegementation(true); }else if(aSegmentationMode == "Sphere"){ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget(); - float aCenter[3]; + vtkFloatingPointType aCenter[3]; aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble(); aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble(); aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble(); aSphereWidget->SetCenter(aCenter); - float aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble(); + vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble(); aSphereWidget->SetRadius(aRadius); aMainWindow->SetSphereSegementation(true); @@ -1679,7 +1679,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() ); param = vtkParam + "Opacity"; ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() ); - float r, g, b; + vtkFloatingPointType r, g, b; vActor->GetColor(r, g, b); QString colorStr = QString::number( r ); colorStr += gDigitsSep; colorStr += QString::number( g ); colorStr += gDigitsSep; @@ -1706,7 +1706,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) ip->setParameter( entry, param, "Off" ); for ( int p = 0; p < nPlanes; p++ ) { vtkPlane* plane = vPrs->GetClippingPlane( p ); - float normal[3], origin[3]; + vtkFloatingPointType normal[3], origin[3]; plane->GetNormal( normal ); plane->GetOrigin( origin ); std::string planeValue = QString::number( normal[0] ).latin1(); planeValue += gDigitsSep; @@ -1941,7 +1941,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) else { QStringList vals = QStringList::split( gDigitsSep, val ); if ( vals.count() == 6 ) { // format check: 6 float values - float normal[3], origin[3]; + vtkFloatingPointType normal[3], origin[3]; for (int x = 0; x < 3; x++ ) { normal[x] = vals[x].toFloat(); origin[x] = vals[x+3].toFloat(); diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.cxx b/src/VISUGUI/VisuGUI_OffsetDlg.cxx index ed732b9c..7a28b3dc 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.cxx +++ b/src/VISUGUI/VisuGUI_OffsetDlg.cxx @@ -67,25 +67,25 @@ myModule(theModule) TopLayout->setSpacing(6); TopLayout->setMargin(11); - QHBox* aOffsetsPane = new QHBox (this); - aOffsetsPane->setSpacing(6); + QHBox* anOffsetsPane = new QHBox (this); + anOffsetsPane->setSpacing(6); - new QLabel ("dX:", aOffsetsPane); - myDxEdt = new QtxDblSpinBox (aOffsetsPane, "myDxEdt"); + new QLabel ("dX:", anOffsetsPane); + myDxEdt = new QtxDblSpinBox (anOffsetsPane, "myDxEdt"); myDxEdt->setRange(-MAXVAL, MAXVAL); - new QLabel("dY:", aOffsetsPane); - myDyEdt = new QtxDblSpinBox (aOffsetsPane, "myDyEdt"); + new QLabel("dY:", anOffsetsPane); + myDyEdt = new QtxDblSpinBox (anOffsetsPane, "myDyEdt"); myDyEdt->setRange(-MAXVAL, MAXVAL); - new QLabel("dZ:", aOffsetsPane); - myDzEdt = new QtxDblSpinBox (aOffsetsPane, "myDzEdt"); + new QLabel("dZ:", anOffsetsPane); + myDzEdt = new QtxDblSpinBox (anOffsetsPane, "myDzEdt"); myDzEdt->setRange(-MAXVAL, MAXVAL); - QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), aOffsetsPane); + QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane); connect(aResetBtn, SIGNAL(clicked()), this, SLOT(onReset())); - TopLayout->addWidget(aOffsetsPane); + TopLayout->addWidget(anOffsetsPane); if (!VISU::GetCStudy(VISU::GetAppStudy(theModule))->GetProperties()->IsLocked()) { mySaveChk = new QCheckBox ("Save to presentation", this); @@ -136,26 +136,26 @@ myModule(theModule) void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs) { myPrsList.append(thePrs); - OffsetStruct aOffs; - thePrs->GetOffset(aOffs.myOffset); - myOldOffsets.append(aOffs); + CORBA::Float anOffset[3]; + thePrs->GetOffset(anOffset[0],anOffset[1],anOffset[2]); + OffsetStruct anOffs(anOffset[0],anOffset[1],anOffset[2]); + myOldOffsets.append(anOffs); if (myPrsList.count() == 1) { - setOffset(aOffs.myOffset); + setOffset(anOffs.myOffset); } else if (myPrsList.count() == 2) { - float aOffset[3]; - aOffset[0] = aOffset[1] = aOffset[2] = 0; - setOffset(aOffset); + OffsetStruct anOffs; + setOffset(anOffs.myOffset); } } -void VisuGUI_OffsetDlg::setOffset (const float* theOffset) +void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset) { myDxEdt->setValue(theOffset[0]); myDyEdt->setValue(theOffset[1]); myDzEdt->setValue(theOffset[2]); } -void VisuGUI_OffsetDlg::getOffset (float* theOffset) const +void VisuGUI_OffsetDlg::getOffset (vtkFloatingPointType* theOffset) const { theOffset[0] = myDxEdt->value(); theOffset[1] = myDyEdt->value(); @@ -177,11 +177,11 @@ bool VisuGUI_OffsetDlg::isToSave() const return false; } -void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset) +void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset) { if (myPrsList.count() == 0) return; - if (isToSave()) thePrs->SetOffset(theOffset); + if (isToSave()) thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]); ViewManagerList aViewManagerList; SalomeApp_Application* anApp = myModule->getApp(); @@ -213,10 +213,10 @@ void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset) void VisuGUI_OffsetDlg::accept() { - float aOffset[3]; - getOffset(aOffset); + vtkFloatingPointType anOffset[3]; + getOffset(anOffset); for (int i = 0; i < myPrsList.count(); i++) { - updateOffset(myPrsList.at(i), aOffset); + updateOffset(myPrsList.at(i), anOffset); } QDialog::accept(); } @@ -231,10 +231,10 @@ void VisuGUI_OffsetDlg::reject() void VisuGUI_OffsetDlg::onApply() { - float aOffset[3]; - getOffset(aOffset); + vtkFloatingPointType anOffset[3]; + getOffset(anOffset); for (int i = 0; i < myPrsList.count(); i++) { - updateOffset(myPrsList.at(i), aOffset); + updateOffset(myPrsList.at(i), anOffset); } } diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.h b/src/VISUGUI/VisuGUI_OffsetDlg.h index 98a0bdb0..81a86bbb 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.h +++ b/src/VISUGUI/VisuGUI_OffsetDlg.h @@ -21,6 +21,7 @@ #ifndef DIALOGBOX_OFFSET_H #define DIALOGBOX_OFFSET_H +#include "VTKViewer.h" #include "VISU_Prs3d_i.hh" // QT Includes @@ -31,8 +32,23 @@ class QCheckBox; class QtxDblSpinBox; class VisuGUI; -struct OffsetStruct { - float myOffset[3]; +struct OffsetStruct +{ + vtkFloatingPointType myOffset[3]; + + OffsetStruct() + { + myOffset[0] = myOffset[1] = myOffset[2] = 0; + } + + OffsetStruct(vtkFloatingPointType theX, + vtkFloatingPointType theY, + vtkFloatingPointType theZ) + { + myOffset[0] = theX; + myOffset[1] = theY; + myOffset[2] = theZ; + } }; class VisuGUI_OffsetDlg: public QDialog @@ -45,8 +61,8 @@ class VisuGUI_OffsetDlg: public QDialog void addPresentation (VISU::Prs3d_i* thePrs); int getPrsCount() const { return myPrsList.count(); } - void setOffset (const float* theOffset); - void getOffset (float* theOffset) const; + void setOffset (const vtkFloatingPointType* theOffset); + void getOffset (vtkFloatingPointType* theOffset) const; bool isToSave() const; public slots: @@ -59,7 +75,7 @@ class VisuGUI_OffsetDlg: public QDialog void onHelp(); private: - void updateOffset (VISU::Prs3d_i* thePrs, float* theOffset); + void updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset); VisuGUI * myModule; diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index ed955d7f..b80b5417 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -78,20 +78,20 @@ static void renderViewFrame (SVTK_ViewWindow* vw) //======================================================================= class TPlane : public SALOME_Actor { - float mySize; + vtkFloatingPointType mySize; vtkDataSetMapper* myMapper; vtkPlaneSource* myPlaneSource; public: // constructor - TPlane(float planeSize): mySize(planeSize) + TPlane(vtkFloatingPointType planeSize): mySize(planeSize) { Init(); } // set plane parameters - void Set(float origin[3], float normal[3]) + void Set(vtkFloatingPointType origin[3], vtkFloatingPointType normal[3]) { - float point2[3], point1[3]; + vtkFloatingPointType point2[3], point1[3]; vtkMath::Perpendiculars(normal, point1, point2, 0.); for (int i = 0; i < 3; ++i) { point1[ i ] = point1[ i ] * mySize + origin[ i ]; @@ -285,7 +285,7 @@ void VisuGUI_Plot3DPane::restorePrsParams() void VisuGUI_Plot3DPane::onPositionSpn() { if (myPrs && !RelativeChkB->isChecked()) { - float minPos, maxPos; + vtkFloatingPointType minPos, maxPos; storePrsParams(); myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos); restorePrsParams(); @@ -323,7 +323,7 @@ void VisuGUI_Plot3DPane::orientationChanged(int Id) //======================================================================= void VisuGUI_Plot3DPane::onRelativePos(bool isRelativePos) { - float minPos = 0., maxPos = 1., pos = PositionSpn->value(); + vtkFloatingPointType minPos = 0., maxPos = 1., pos = PositionSpn->value(); if (myPrs) { storePrsParams(); myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos); @@ -376,7 +376,7 @@ void VisuGUI_Plot3DPane::updatePreview() } // set plane parameters corresponding to control values storePrsParams(); - float normal[3], origin[3]; + vtkFloatingPointType normal[3], origin[3]; myPrs->GetPlot3DPL()->GetBasePlane(origin, normal, true); planePreview->Set(origin, normal); restorePrsParams(); diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index bf91604a..fbbfa650 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -561,7 +561,7 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { default: setLogarithmic(false); } - float aRange[2]; + vtkFloatingPointType aRange[2]; thePrs->GetScalarMapPL()->GetSourceRange(aRange); Rmin = aRange[0]; Rmax = aRange[1]; setRange( thePrs->GetMin(), thePrs->GetMax(), @@ -603,7 +603,7 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { // "Title" myTextDlg->setTitleText(QString(thePrs->GetTitle())); - float R, G, B; + vtkFloatingPointType R, G, B; thePrs->GetTitleColor(&R, &G, &B); myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)), @@ -710,9 +710,9 @@ void VisuGUI_ScalarBarPane::createScalarBar() isTitleBold,isTitleItalic,isTitleShadow); vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty(); aTitleProp->SetFontFamily(aTitleFontFamily); - aTitleProp->SetColor(float(aTitleColor.red())/255., - float(aTitleColor.green())/255., - float(aTitleColor.blue())/255.); + aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255., + vtkFloatingPointType(aTitleColor.green())/255., + vtkFloatingPointType(aTitleColor.blue())/255.); (isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff(); (isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff(); (isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff(); @@ -727,9 +727,9 @@ void VisuGUI_ScalarBarPane::createScalarBar() isLabelBold, isLabelItalic, isLabelShadow); vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty(); aLabelProp->SetFontFamily(aLabelFontFamily); - aLabelProp->SetColor(float(aLabelColor.red())/255., - float(aLabelColor.green())/255., - float(aLabelColor.blue())/255.); + aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255., + vtkFloatingPointType(aLabelColor.green())/255., + vtkFloatingPointType(aLabelColor.blue())/255.); (isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff(); (isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff(); (isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff(); @@ -907,7 +907,7 @@ void VisuGUI_ScalarBarPane::changeScalarMode( int theMode ) { if ( myScalarMap ) { if ( RBFrange->isChecked() ) { - float aRange[2]; + vtkFloatingPointType aRange[2]; myScalarMap->SetScalarMode(theMode); myScalarMap->GetScalarMapPL()->GetSourceRange(aRange); MinEdit->setText( QString::number( aRange[0] ) ); diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index d2358033..cc87ab69 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -444,7 +444,7 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::onTimeStampChanged(int){ void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){ myPrs->SetScale(getFactor()); - float aRange[2]; + vtkFloatingPointType aRange[2]; myPrs->GetScalarMapOnDeformedShapePL()->Build(); myPrs->GetScalarMapOnDeformedShapePL()->Update(); myPrs->GetScalarMapOnDeformedShapePL()->GetSourceRange(aRange); diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 7e5e658e..46549cc5 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -322,7 +322,7 @@ void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent) template QString getValue(TData* theData, int theId){ if (vtkDataArray *aScalar = theData->GetScalars()){ - float aVal = aScalar->GetTuple1(theId); + vtkFloatingPointType aVal = aScalar->GetTuple1(theId); return QString::number(aVal); } else { return QString("No data"); @@ -331,7 +331,7 @@ template QString getValue(TData* theData, int theId){ template QString getVector(TData* theData, int theId){ if (vtkDataArray *aVector = theData->GetVectors()) { - float *aVal = aVector->GetTuple3(theId); + vtkFloatingPointType *aVal = aVector->GetTuple3(theId); return QString("%1; %2; %3").arg(aVal[0]).arg(aVal[1]).arg(aVal[2]); } else { return QString("No data"); @@ -417,7 +417,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { VISU_Actor* anVISUActor = VISU::FindActor(aViewWindow, aSObject->GetID().c_str()); if (anVISUActor) { - float aCoord[6]; + vtkFloatingPointType aCoord[6]; anVISUActor->GetBounds(aCoord); myXPosLbl->setText(QString::number( aCoord[0] )); myYPosLbl->setText(QString::number( aCoord[2] )); @@ -428,7 +428,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) )); TColStd_IndexedMapOfInteger aMapIndex; - typedef map PointsMap; + typedef map PointsMap; PointsMap aPointsMap; aSelector->GetIndex(anIO, aMapIndex); @@ -442,7 +442,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { switch (aType) { case 0: { - float* aCoord = anVISUActor->GetNodeCoord(anID); + vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID); int aVTKID = anVISUActor->GetNodeVTKID(anID); myXValLbl->setText( QString::number( aCoord[0] ) ); myYValLbl->setText( QString::number( aCoord[1] ) ); @@ -466,7 +466,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { myCellScalarValLbl->setText(getValue(aCellData, aVTKID)); myCellVectorValLbl->setText(getVector(aCellData, aVTKID)); - float* aCoord; + vtkFloatingPointType* aCoord; vtkIdList *aPointList = aCell->GetPointIds(); for (int i = 0; i < aNbOfPoints; i++) { @@ -487,7 +487,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { myListPoints->verticalHeader()->setLabel(i, QString::number( i )); int id = It->first; myListPoints->setText(i, 0, QString::number( id )); - float* aCoord = It->second; + vtkFloatingPointType* aCoord = It->second; myListPoints->setText(i, 1, QString::number( aCoord[0] )); myListPoints->setText(i, 2, QString::number( aCoord[1] )); myListPoints->setText(i, 3, QString::number( aCoord[2] )); diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index c5e32dc8..3ac37f5f 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -290,9 +290,9 @@ void ArrangeDlg::acceptAnimation() FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem()); if (aData.myPrs.empty()) myAnimator->generatePresentations(myFieldLst->currentItem()); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; aData.myPrs[0]->GetBounds(aBounds); - float aDist = 0; + vtkFloatingPointType aDist = 0; int aAxis = getAxis(); switch (aAxis) { case XAxis: @@ -305,10 +305,10 @@ void ArrangeDlg::acceptAnimation() aDist = fabs(aBounds[5] - aBounds[4]); } - float dx = fabs(aBounds[1] - aBounds[0]); - float dy = fabs(aBounds[3] - aBounds[2]); - float dz = fabs(aBounds[5] - aBounds[4]); - float max = (dx > dy) ? dx : dy; + vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]); + vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]); + vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]); + vtkFloatingPointType max = (dx > dy) ? dx : dy; max = (dz > max) ? dz : max; max /= 100.0; @@ -351,13 +351,13 @@ void ArrangeDlg::acceptViewWindow() anActor->SetPosition(aOffs.myOffset); if (mySaveChk) if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffs.myOffset); + aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]); } } else { - float aDist = 0; - float aShift = 0; - float aPrevDist = 0; - float aPrevShift = 0; + vtkFloatingPointType aDist = 0; + vtkFloatingPointType aShift = 0; + vtkFloatingPointType aPrevDist = 0; + vtkFloatingPointType aPrevShift = 0; int i; QMap::Iterator it; for (it = myPrsMap.begin(), i = 0; it != myPrsMap.end(); ++it, i++) { @@ -365,12 +365,12 @@ void ArrangeDlg::acceptViewWindow() if (VISU_Actor* aActor = VISU::GetActor(aPrs, myViewWindow)) { int aAxis = getAxis(); - float aZeroOffset[3]; + vtkFloatingPointType aZeroOffset[3]; aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0; aActor->SetPosition(aZeroOffset); aActor->GetMapper()->Update(); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; aActor->GetBounds(aBounds); switch (aAxis) { case XAxis: @@ -382,18 +382,18 @@ void ArrangeDlg::acceptViewWindow() case ZAxis: aDist = fabs(aBounds[5] - aBounds[4]); } - float aOffset[3]; + vtkFloatingPointType aOffset[3]; aOffset[0] = aOffset[1] = aOffset[2] = 0; aOffset[aAxis] = (aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis]; if (i > 0) { - float aCCDist = (aDist + aPrevDist) / 2.0; + vtkFloatingPointType aCCDist = (aDist + aPrevDist) / 2.0; - float dx = fabs(aBounds[1] - aBounds[0]); - float dy = fabs(aBounds[3] - aBounds[2]); - float dz = fabs(aBounds[5] - aBounds[4]); - float max = (dx > dy) ? dx : dy; + vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]); + vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]); + vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]); + vtkFloatingPointType max = (dx > dy) ? dx : dy; max = (dz > max) ? dz : max; max /= 100.0; @@ -428,7 +428,7 @@ void ArrangeDlg::acceptViewWindow() aActor->SetPosition(aOffset); if (mySaveChk) if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffset); + aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]); aPrevDist = aDist; aPrevShift = aShift; diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h index af7df3f2..7c237eec 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -12,13 +12,14 @@ #define VISUGUI_TIMEANIMATION_H #include "QtxDblSpinBox.h" - #include "SALOMEDSClient_Study.hxx" #include #include #include +#include + #include #include @@ -64,7 +65,7 @@ class ArrangeDlg: public QDialog private: struct Offset { - float myOffset[3]; + vtkFloatingPointType myOffset[3]; }; diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 79b6607f..4427982a 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -617,7 +617,7 @@ namespace VISU QApplication::setOverrideCursor( Qt::waitCursor ); try { - if (aActor = thePrs->CreateActor()) + if ((aActor = thePrs->CreateActor())) theViewWindow->AddActor(aActor); } catch(std::exception& exc) { SUIT_MessageBox::warn1 @@ -706,15 +706,17 @@ namespace VISU QApplication::restoreOverrideCursor(); } - static bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow, - float allBounds[6], - const char* theActorClassName = "VISU_Actor") + static + bool + ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow, + vtkFloatingPointType allBounds[6], + const char* theActorClassName = "VISU_Actor") { vtkRenderer *aRen = theViewWindow->getRenderer(); vtkActorCollection *anActColl = aRen->GetActors(); vtkProp *prop; - float *bounds; - int somethingVisible = false; + vtkFloatingPointType *bounds; + int somethingVisible = false; allBounds[0] = allBounds[2] = allBounds[4] = VTK_LARGE_FLOAT; allBounds[1] = allBounds[3] = allBounds[5] = -VTK_LARGE_FLOAT; @@ -744,14 +746,14 @@ namespace VISU void SetFitAll(SVTK_ViewWindow* theViewWindow) { - static float PRECISION = 0.000001; - static float DEVIATION = 600; - float XYZ_Bnd[6]; + static vtkFloatingPointType PRECISION = 0.000001; + static vtkFloatingPointType DEVIATION = 600; + vtkFloatingPointType XYZ_Bnd[6]; if (!ComputeVisiblePropBounds(theViewWindow, XYZ_Bnd)) return; - float absX = XYZ_Bnd[1] - XYZ_Bnd[0]; - float absY = XYZ_Bnd[3] - XYZ_Bnd[2]; - float absZ = XYZ_Bnd[5] - XYZ_Bnd[4]; + vtkFloatingPointType absX = XYZ_Bnd[1] - XYZ_Bnd[0]; + vtkFloatingPointType absY = XYZ_Bnd[3] - XYZ_Bnd[2]; + vtkFloatingPointType absZ = XYZ_Bnd[5] - XYZ_Bnd[4]; enum CameraOrient {e3D, eFront, eLeft, eTop}; CameraOrient aCameraOrient = e3D; @@ -762,9 +764,9 @@ namespace VISU if (absZ <= PRECISION) aCameraOrient = eTop; else { // all the three dimensions exceeds precision - float dev_abs_XY = absX / absY; - float dev_abs_YZ = absY / absZ; - float dev_abs_XZ = absX / absZ; + vtkFloatingPointType dev_abs_XY = absX / absY; + vtkFloatingPointType dev_abs_YZ = absY / absZ; + vtkFloatingPointType dev_abs_XZ = absX / absZ; if (dev_abs_XY >= DEVIATION || 1./dev_abs_YZ >= DEVIATION) aCameraOrient = eLeft; else { @@ -953,14 +955,10 @@ namespace VISU if(aPlot){ QList clist; aPlot->getCurves( clist ); - SPlot2d_Curve* plotCurve = 0; - SPlot2d_Curve* tmpCurve; for (int i = 0; i < clist.count(); i++) { - tmpCurve = dynamic_cast(clist.at(i)); - if (tmpCurve && - tmpCurve->hasIO() && - (tmpCurve->getIO()->getEntry() == anEntry)) - aPlot->eraseCurve(clist.at(i)); + if(SPlot2d_Curve* plotCurve = dynamic_cast(clist.at(i))) + if(plotCurve->hasIO() && (plotCurve->getIO()->getEntry() == anEntry)) + aPlot->eraseCurve(clist.at(i)); } } } diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 5501a17a..22977d67 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -128,7 +128,7 @@ VISU::ColoredPrs3d_i SetItalicTitle(anOrigin->IsItalicTitle()); SetShadowTitle(anOrigin->IsShadowTitle()); SetTitFontType(anOrigin->GetTitFontType()); - float r,g,b; + vtkFloatingPointType r,g,b; anOrigin->GetTitleColor(&r,&g,&b); SetTitleColor(r,g,b); @@ -341,7 +341,9 @@ VISU::ColoredPrs3d_i void VISU::ColoredPrs3d_i -::GetTitleColor(float* theR, float* theG, float* theB) +::GetTitleColor(vtkFloatingPointType* theR, + vtkFloatingPointType* theG, + vtkFloatingPointType* theB) { *theR = myTitleColor[0]; *theG = myTitleColor[1]; @@ -350,7 +352,9 @@ VISU::ColoredPrs3d_i void VISU::ColoredPrs3d_i -::SetTitleColor(float theR, float theG, float theB) +::SetTitleColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB) { myTitleColor[0] = theR; myTitleColor[1] = theG; @@ -415,7 +419,9 @@ VISU::ColoredPrs3d_i void VISU::ColoredPrs3d_i -::GetLabelColor(float* theR, float* theG, float* theB) +::GetLabelColor(vtkFloatingPointType* theR, + vtkFloatingPointType* theG, + vtkFloatingPointType* theB) { *theR = myLabelColor[0]; *theG = myLabelColor[1]; @@ -424,7 +430,9 @@ VISU::ColoredPrs3d_i void VISU::ColoredPrs3d_i -::SetLabelColor(float theR, float theG, float theB) +::SetLabelColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB) { myLabelColor[0] = theR; myLabelColor[1] = theG; @@ -470,11 +478,11 @@ VISU::ColoredPrs3d_i // Scalar Bar origin QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" ); - float aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2; + vtkFloatingPointType aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2; aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin); myPosition[0] = aXorigin; - float aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012; + vtkFloatingPointType aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012; aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin); myPosition[1] = aYorigin; diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index 9e277a47..6e2a5fd9 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -135,7 +135,7 @@ namespace VISU VISU::ScalarMap::Orientation myOrientation; std::string myTitle; int myNumberOfLabels; - float myPosition[2], myWidth, myHeight; + vtkFloatingPointType myPosition[2], myWidth, myHeight; public: //---------------------------------------------------------------------------- @@ -218,11 +218,15 @@ namespace VISU virtual void - GetTitleColor(float* theR, float* theG, float* theB); + GetTitleColor(vtkFloatingPointType* theR, + vtkFloatingPointType* theG, + vtkFloatingPointType* theB); virtual void - SetTitleColor(float theR, float theG, float theB); + SetTitleColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB); virtual bool @@ -258,11 +262,15 @@ namespace VISU virtual void - GetLabelColor(float* theR, float* theG, float* theB); + GetLabelColor(vtkFloatingPointType* theR, + vtkFloatingPointType* theG, + vtkFloatingPointType* theB); virtual void - SetLabelColor(float theR, float theG, float theB); + SetLabelColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB); //---------------------------------------------------------------------------- protected: @@ -276,13 +284,13 @@ namespace VISU bool myIsItalicTitle; bool myIsShadowTitle; int myTitFontType; - float myTitleColor[3]; + vtkFloatingPointType myTitleColor[3]; bool myIsBoldLabel; bool myIsItalicLabel; bool myIsShadowLabel; int myLblFontType; - float myLabelColor[3]; + vtkFloatingPointType myLabelColor[3]; VISU_ScalarMapPL* myScalarMapPL; bool myIsFixedRange; diff --git a/src/VISU_I/VISU_CorbaMedConvertor.cxx b/src/VISU_I/VISU_CorbaMedConvertor.cxx index b1dc814b..e69db1a8 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.cxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.cxx @@ -1206,7 +1206,6 @@ VISU_MEDConvertor if(theFamily->myIsDone) return 0; - const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh; SALOME_MED::FAMILY_var aMedFamily = theFamily->myFamily; CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements(); if(!anIsOnAllElements){ diff --git a/src/VISU_I/VISU_CutLines_i.cc b/src/VISU_I/VISU_CutLines_i.cc index 879b0531..06595656 100644 --- a/src/VISU_I/VISU_CutLines_i.cc +++ b/src/VISU_I/VISU_CutLines_i.cc @@ -37,7 +37,7 @@ using namespace VISU; using namespace std; -static float EPS_machine = 1.0E-7; +static vtkFloatingPointType EPS_machine = 1.0E-7; #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -325,8 +325,8 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal"); SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); - typedef set TXCont; - typedef map TXYMap; + typedef set TXCont; + typedef map TXYMap; typedef map TXYMapCont; typedef map TLineIdCont; @@ -340,9 +340,9 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ TXCont aXCont; TXYMapCont aXYMapCont; TLineIdCont aLineIdCont; // Define internal numeration of lines - const float *aDirLn = myCutLinesPL->GetDirLn(); - const float *aBasePnt = myCutLinesPL->GetBasePnt(); - const float *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn(); + const vtkFloatingPointType *aDirLn = myCutLinesPL->GetDirLn(); + const vtkFloatingPointType *aBasePnt = myCutLinesPL->GetBasePnt(); + const vtkFloatingPointType *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn(); for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){ vtkDataSet *aDataSet = myCutLinesPL->GetAppendPolyData()->GetInput(iLine); aDataSet->Update(); @@ -364,7 +364,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<SetColumnTitle(i+1,aString.latin1()); @@ -467,7 +467,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist); // Can we find some value that belong to the line and have the same X coordinate? if(aXYMapIter == aXYMap.end()) continue; - float aVal = aXYMapIter->second; + vtkFloatingPointType aVal = aXYMapIter->second; aTableOfReal->PutValue(aVal,iLineId+2,i+1); } } diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index 93da92ac..cb73301b 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -154,16 +154,16 @@ VISU::GaussPoints_i int aBicolor = aResourceMgr->integerValue( "VISU", "scalar_bar_bicolor", GetBiColor() ); SetBiColor( aBicolor == 0 ); - float aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() ); + vtkFloatingPointType aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() ); SetSpacing( aSpacing ); - float aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() ); + vtkFloatingPointType aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() ); SetScaleFactor( aScaleFactor ); int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() ); SetPrimitiveType( aPrimitiveType ); - float aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() ); + vtkFloatingPointType aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() ); SetClamp( aClamp ); int aMinSize = aResourceMgr->integerValue( "VISU", "point_sprite_min_size", ( int )( GetMinSize() * 100.0 ) ); @@ -178,7 +178,7 @@ VISU::GaussPoints_i int aMagnification = aResourceMgr->integerValue( "VISU", "point_sprite_magnification", ( int )( GetMagnification() * 100.0 ) ); SetMagnification( aMagnification / 100.0 ); - float anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() ); + vtkFloatingPointType anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() ); SetMagnificationIncrement( anIncrement ); bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() ); @@ -187,7 +187,7 @@ VISU::GaussPoints_i QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetColor() ); SetColor( aColor ); - float anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() ); + vtkFloatingPointType anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() ); SetAlphaThreshold( anAlphaThreshold ); int aResolution = aResourceMgr->integerValue( "VISU", "geom_sphere_resolution", GetResolution() ); @@ -322,12 +322,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetScaleFactor( float theScaleFactor ) +::SetScaleFactor( vtkFloatingPointType theScaleFactor ) { myGaussPointsPL->SetScale( theScaleFactor ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetScaleFactor() { @@ -376,12 +376,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetAlphaThreshold( float theAlphaThreshold ) +::SetAlphaThreshold( vtkFloatingPointType theAlphaThreshold ) { myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetAlphaThreshold() { @@ -416,7 +416,7 @@ VISU::GaussPoints_i return myGaussPointsPL->GetPrimitiveType(); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMaximumSupportedSize() { @@ -425,12 +425,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetClamp(float theClamp) +::SetClamp(vtkFloatingPointType theClamp) { myGaussPointsPL->SetClamp( theClamp ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetClamp() { @@ -439,12 +439,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetGeomSize( float theGeomSize ) +::SetGeomSize( vtkFloatingPointType theGeomSize ) { myGaussPointsPL->SetSize( theGeomSize ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetGeomSize() { @@ -453,12 +453,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetMinSize( float theMinSize ) +::SetMinSize( vtkFloatingPointType theMinSize ) { myGaussPointsPL->SetMinSize( theMinSize ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMinSize() { @@ -467,12 +467,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetMaxSize( float theMaxSize ) +::SetMaxSize( vtkFloatingPointType theMaxSize ) { myGaussPointsPL->SetMaxSize( theMaxSize ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMaxSize() { @@ -481,12 +481,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetMagnification( float theMagnification ) +::SetMagnification( vtkFloatingPointType theMagnification ) { myGaussPointsPL->SetMagnification( theMagnification ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMagnification() { @@ -495,12 +495,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetMagnificationIncrement( float theIncrement ) +::SetMagnificationIncrement( vtkFloatingPointType theIncrement ) { myGaussPointsPL->SetMagnificationIncrement( theIncrement ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMagnificationIncrement() { @@ -639,14 +639,14 @@ VISU::GaussPoints_i vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty(); aTitleProp->SetFontFamily(myTitFontType); - aTitleProp->SetColor(myTitleColor); + aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]); (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff(); (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff(); (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff(); vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty(); aLabelProp->SetFontFamily(myLblFontType); - aLabelProp->SetColor(myLabelColor); + aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]); (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff(); (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff(); (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff(); @@ -666,7 +666,7 @@ VISU::GaussPoints_i anActor->SetBarVisibility(true); myPipeLine->GetMapper()->SetScalarVisibility(1); - float aRange[2]; + vtkFloatingPointType aRange[2]; myScalarMapPL->GetSourceRange(aRange); aScalarBarCtrl->SetRangeLocal(aRange); @@ -687,7 +687,7 @@ VISU::GaussPoints_i } if(aScalarBarMode == VISU_ScalarBarCtrl::eGlobal){ - float aRangeGlobal[2]; + vtkFloatingPointType aRangeGlobal[2]; // aRangeGlobal[0] = aTMinMax.first; aRangeGlobal[1] = aTMinMax.second; @@ -813,12 +813,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetSpacing(const float theSpacing) +::SetSpacing(const vtkFloatingPointType theSpacing) { mySpacing = theSpacing; } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetSpacing() const { diff --git a/src/VISU_I/VISU_GaussPoints_i.hh b/src/VISU_I/VISU_GaussPoints_i.hh index 5a0fe102..71c49c72 100644 --- a/src/VISU_I/VISU_GaussPoints_i.hh +++ b/src/VISU_I/VISU_GaussPoints_i.hh @@ -87,11 +87,11 @@ namespace VISU void SetIsDeformed( bool theIsDeformed ); - float + vtkFloatingPointType GetScaleFactor(); void - SetScaleFactor( float theScaleFactor ); + SetScaleFactor( vtkFloatingPointType theScaleFactor ); //! Get color for Geometry mode of the presentation. QColor @@ -133,10 +133,10 @@ namespace VISU //! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold. void - SetAlphaThreshold(float theAlphaThreshold); + SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold); //! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold. - float + vtkFloatingPointType GetAlphaThreshold(); //! Redirect the request to VISU_GaussPointsPL::SetResolution. @@ -154,55 +154,55 @@ namespace VISU GetPrimitiveType(); //! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize. - float + vtkFloatingPointType GetMaximumSupportedSize(); //! Redirect the request to VISU_GaussPointsPL::SetClamp. void - SetClamp(float theClamp); + SetClamp(vtkFloatingPointType theClamp); //! Redirect the request to VISU_GaussPointsPL::GetClamp. - float + vtkFloatingPointType GetClamp(); //! Redirect the request to VISU_GaussPointsPL::SetSize. void - SetGeomSize(float theGeomSize); + SetGeomSize(vtkFloatingPointType theGeomSize); //! Redirect the request to VISU_GaussPointsPL::GetSize. - float + vtkFloatingPointType GetGeomSize(); //! Redirect the request to VISU_GaussPointsPL::SetMinSize. void - SetMinSize(float theMinSize); + SetMinSize(vtkFloatingPointType theMinSize); //! Redirect the request to VISU_GaussPointsPL::GetMinSize. - float + vtkFloatingPointType GetMinSize(); //! Redirect the request to VISU_GaussPointsPL::SetMaxSize. void - SetMaxSize(float theMaxSize); + SetMaxSize(vtkFloatingPointType theMaxSize); //! Redirect the request to VISU_GaussPointsPL::GetMaxSize. - float + vtkFloatingPointType GetMaxSize(); //! Redirect the request to VISU_GaussPointsPL::SetMagnification. void - SetMagnification(float theMagnification); + SetMagnification(vtkFloatingPointType theMagnification); //! Redirect the request to VISU_GaussPointsPL::GetMagnification. - float + vtkFloatingPointType GetMagnification(); //! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement. void - SetMagnificationIncrement(float theIncrement); + SetMagnificationIncrement(vtkFloatingPointType theIncrement); //! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement. - float + vtkFloatingPointType GetMagnificationIncrement(); //! Set flag indicating which scalar bar is active. @@ -231,10 +231,10 @@ namespace VISU //! Set value of the distance between global and local scalar bars. void - SetSpacing(const float theSpacing); + SetSpacing(const vtkFloatingPointType theSpacing); //! Get value of the distance between global and local scalar bars. - float + vtkFloatingPointType GetSpacing() const; //! Let know is the global range is already calculated @@ -280,7 +280,7 @@ namespace VISU bool myIsDispGlobalScalarBar; bool myIsActiveLocalScalarBar; QColor myColor; - float mySpacing; + vtkFloatingPointType mySpacing; int myFaceLimit; QString myMainTexture; diff --git a/src/VISU_I/VISU_IsoSurfaces_i.cc b/src/VISU_I/VISU_IsoSurfaces_i.cc index 4198c8a6..eac046c3 100644 --- a/src/VISU_I/VISU_IsoSurfaces_i.cc +++ b/src/VISU_I/VISU_IsoSurfaces_i.cc @@ -115,8 +115,9 @@ CORBA::Long VISU::IsoSurfaces_i::GetNbSurfaces(){ } -void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax){ - float aRange[2] = {theMin, theMax}; +void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax) +{ + vtkFloatingPointType aRange[2] = {theMin, theMax}; myIsoSurfacesPL->SetRange(aRange); } CORBA::Double VISU::IsoSurfaces_i::GetSubMin(){ diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index 1bdd88b8..c0046384 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -252,7 +252,7 @@ VISU::Prs3d_i theActor->SetPrs3d(this); theActor->SetShrinkFactor(); - theActor->SetPosition(myOffset); + theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]); theActor->SetPipeLine(GetPipeLine()); theActor->SetFactory(this); @@ -295,7 +295,7 @@ VISU::Prs3d_i { if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<* Result_i::GetAxisInfo(const string& theMeshName, if ( nbPnt != 8 ) continue; vtkPoints * points = cell->GetPoints(); - float* coords[ 4 ]; + vtkFloatingPointType* coords[ 4 ]; coords[0] = points->GetPoint( 0 ); coords[1] = points->GetPoint( 1 ); coords[2] = points->GetPoint( 3 ); @@ -1629,10 +1631,10 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] ); for ( iAx = 0; iAx < nbAxes; ++iAx ) { - float* coo = coords[ iAx + 1 ]; + vtkFloatingPointType* coo = coords[ iAx + 1 ]; gp_Pnt p( coo[0], coo[1], coo[2] ); // min size - float size = p0.SquareDistance( p ); + vtkFloatingPointType size = p0.SquareDistance( p ); if ( size > FLT_MIN && size < minSize[ iAx ] ) minSize[ iAx ] = size; // axis direction @@ -1662,34 +1664,34 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, // get and sort intermediate component values - projections of nodes // on axis direction; define bnd box - set< float > comps[ 3 ]; + set< vtkFloatingPointType > comps[ 3 ]; Bnd_Box box; vtkPoints * points = aMesh->GetPoints(); vtkIdType iP, nbP = aMesh->GetNumberOfPoints(); for ( iP = 0; iP < nbP; ++iP ) { - float* coo = points->GetPoint( iP ); + vtkFloatingPointType* coo = points->GetPoint( iP ); gp_Pnt p( coo[0], coo[1], coo[2] ); box.Add( p ); for ( iAx = 0; iAx < nbAxes; ++iAx ) { const gp_Dir& dir = gInfo->myAxis[ iAx ]; - float dot = dir.XYZ() * p.XYZ(); + vtkFloatingPointType dot = dir.XYZ() * p.XYZ(); comps[ iAx ].insert( dot ); } } // find a range of projections of bnd box corners on each axis - float range[3], firstValue[3]; + vtkFloatingPointType range[3], firstValue[3]; double x[2],y[2],z[2]; box.Get(x[0],y[0],z[0],x[1],y[1],z[1]); for ( iAx = 0; iAx < nbAxes; ++iAx ) { - set< float > bndComps; + set< vtkFloatingPointType > bndComps; const gp_Dir& dir = gInfo->myAxis[ iAx ]; for ( int iX = 0; iX < 2; ++iX ) { for ( int iY = 0; iY < 2; ++iY ) { for ( int iZ = 0; iZ < 2; ++iZ ) { gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] ); - float dot = dir.XYZ() * p.XYZ(); + vtkFloatingPointType dot = dir.XYZ() * p.XYZ(); bndComps.insert( dot ); } } @@ -1701,14 +1703,14 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, // compute component values for ( iAx = 0; iAx < nbAxes; ++iAx ) { - list< float > values; + list< vtkFloatingPointType > values; int nbVals = 0; - set< float >& comp = comps[ iAx ]; - set< float >::iterator val = comp.begin(); - float bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ]; - float tol = 0.1 * sqrt( minSize[ iAx ]) / rng; + set< vtkFloatingPointType >& comp = comps[ iAx ]; + set< vtkFloatingPointType >::iterator val = comp.begin(); + vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ]; + vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng; for ( ; val != comp.end(); ++val ) { - float value = ( *val - first ) / rng; + vtkFloatingPointType value = ( *val - first ) / rng; if ( value > bnd ) { values.push_back( value ); bnd = value + tol; @@ -1716,9 +1718,9 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, } } // store values in gInfo - vector< float >& myComp = gInfo->myComponets[ iAx ]; + vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ]; myComp.resize( nbVals ); - list< float >::iterator v = values.begin(); + list< vtkFloatingPointType >::iterator v = values.begin(); for ( int i = 0; v != values.end(); ++v ) myComp[ i++ ] = *v; } diff --git a/src/VISU_I/VISU_Result_i.hh b/src/VISU_I/VISU_Result_i.hh index 27ec5e08..7afaf9b4 100644 --- a/src/VISU_I/VISU_Result_i.hh +++ b/src/VISU_I/VISU_Result_i.hh @@ -31,6 +31,7 @@ #include "VISU_BoostSignals.h" #include "SALOME_GenericObj_i.hh" +#include #include #include @@ -175,17 +176,18 @@ namespace VISU // Info on structured mesh contained in TInput public: typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis; - const std::vector< float >* GetAxisInfo(const std::string& theMeshName, - TAxis theAxis, - gp_Dir& thePlaneNormal); + typedef std::vector< vtkFloatingPointType > TAxisInfo; + const TAxisInfo* GetAxisInfo(const std::string& theMeshName, + TAxis theAxis, + gp_Dir& thePlaneNormal); // Return i,j or k values and cutting plane normal for theAxis. // In the case of any problems, return NULL pointer private: struct TGridInfo { - std::vector< float > myComponets[ 3 ]; - gp_Dir myAxis [ 3 ]; + TAxisInfo myComponets[ 3 ]; + gp_Dir myAxis [ 3 ]; }; - map< string, TGridInfo > myMeshName2GridInfoMap; + std::map< std::string, TGridInfo > myMeshName2GridInfoMap; }; Result_var FindResult(SALOMEDS::SObject_ptr theSObject); diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index c9ee0e66..2639b5b7 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -193,20 +193,20 @@ CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetScale(){ } void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){ - float aRange[2]; - aRange[0] = float(theMinRange); - aRange[1] = float(theMaxRange); + vtkFloatingPointType aRange[2]; + aRange[0] = vtkFloatingPointType(theMinRange); + aRange[1] = vtkFloatingPointType(theMaxRange); myScalarMapOnDeformedShapePL->SetScalarRange(aRange); } CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){ - float aRange[2]; + vtkFloatingPointType aRange[2]; myScalarMapOnDeformedShapePL->GetSourceRange(aRange); return aRange[0]; } CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){ - float aRange[2]; + vtkFloatingPointType aRange[2]; myScalarMapOnDeformedShapePL->GetSourceRange(aRange); return aRange[1]; } @@ -251,8 +251,8 @@ void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) { void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName, const char* theFieldName, - const int theIteration, - const VISU::TEntity theEntity) + int theIteration, + VISU::TEntity theEntity) { if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<GetBackground(backint); Storable::DataToStream(theStr,"myColor.R",backint[0]); Storable::DataToStream(theStr,"myColor.G",backint[1]); @@ -1847,7 +1847,7 @@ namespace VISU { SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow) { SALOMEDS::Color aColor; - float backint[3]; + vtkFloatingPointType backint[3]; GetRenderer(theViewWindow)->GetBackground(backint); aColor.R = backint[0]; aColor.G = backint[1]; aColor.B = backint[2]; return aColor; diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx index ba848025..ad1f525b 100644 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ b/src/VVTK/VVTK_PickingDlg.cxx @@ -55,8 +55,6 @@ VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name ) myEventCallbackCommand->SetClientData(this); myEventCallbackCommand->SetCallback(VVTK_PickingDlg::ProcessEvents); - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - setCaption( tr( "PICKING_DLG_TITLE" ) ); setSizeGripEnabled(TRUE); @@ -258,7 +256,7 @@ void VVTK_PickingDlg::Update() myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() ); myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() ); - float* aColor = myPickingSettings->GetColor(); + vtkFloatingPointType* aColor = myPickingSettings->GetColor(); mySelectionColorButton->setPaletteBackgroundColor( QColor( ( int )( aColor[0] * 255.0 ), ( int )( aColor[1] * 255.0 ), ( int )( aColor[2] * 255.0 ) ) ); @@ -357,7 +355,7 @@ void VVTK_PickingDlg::onClickApply() myPickingSettings->SetDisplayParentMesh( myDisplayParentMeshCheckBox->isChecked() ); QColor aButtonColor = mySelectionColorButton->paletteBackgroundColor(); - float aColor[3]; + vtkFloatingPointType aColor[3]; aColor[0] = aButtonColor.red() / 255.0; aColor[1] = aButtonColor.green() / 255.0; aColor[2] = aButtonColor.blue() / 255.0; diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index 6b49cc5c..8ea2c36e 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -142,8 +142,6 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c myEventCallbackCommand.GetPointer(), myPriority); - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - setCaption( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) ); setSizeGripEnabled(TRUE); @@ -469,13 +467,13 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation() myRadiusGroup->hide(); VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - float origin[3]; + vtkFloatingPointType origin[3]; pPlanesWidget->GetOrigin( origin ); myXOriginSpinBox->setValue( origin[0] ); myYOriginSpinBox->setValue( origin[1] ); myZOriginSpinBox->setValue( origin[2] ); - float normal[3]; + vtkFloatingPointType normal[3]; pPlanesWidget->GetNormal( normal ); myDXDirectionSpinBox->setValue( normal[0] ); myDYDirectionSpinBox->setValue( normal[1] ); @@ -490,7 +488,7 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation() myRadiusGroup->show(); VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget(); - float origin[3], aRadius; + vtkFloatingPointType origin[3], aRadius; pSphereWidget->GetCenter(origin); myXOriginSpinBox->setValue( origin[0] ); myYOriginSpinBox->setValue( origin[1] ); @@ -504,15 +502,15 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation() void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints() { int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite; - float aClamp = 200.0; + vtkFloatingPointType aClamp = 200.0; QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp"; QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp"; - float anAlphaThreshold = 0.1; + vtkFloatingPointType anAlphaThreshold = 0.1; int aResolution = 8; int aMinSize = 3; int aMaxSize = 33; int aMagnification = 100; - float anIncrement = 2.0; + vtkFloatingPointType anIncrement = 2.0; if( !myInsideCursorSettings->GetInitial() ) { @@ -571,11 +569,11 @@ void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints() void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints() { - float aClamp = 256.0; + vtkFloatingPointType aClamp = 256.0; int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite; QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp"; QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp"; - float anAlphaThreshold = 0.1; + vtkFloatingPointType anAlphaThreshold = 0.1; int aResolution = 8; int aSize = 25; bool aUniform = false; @@ -593,7 +591,7 @@ void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints() myOutsideSizeBox->setOutsideSize( myOutsideCursorSettings->GetSize() ); myOutsideSizeBox->setUniform( myOutsideCursorSettings->GetUniform() ); - float* aColor = myOutsideCursorSettings->GetColor(); + vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor(); myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ), ( int )( aColor[1] * 255.0 ), ( int )( aColor[2] * 255.0 ) ) ); @@ -702,13 +700,13 @@ void VVTK_SegmentationCursorDlg::ApplySegmentationCursor() if( myIsPlaneSegmentation ) { VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - float origin[3]; + vtkFloatingPointType origin[3]; origin[0] = myXOriginSpinBox->value(); origin[1] = myYOriginSpinBox->value(); origin[2] = myZOriginSpinBox->value(); pPlanesWidget->SetOrigin( origin ); - float normal[3]; + vtkFloatingPointType normal[3]; normal[0] = myDXDirectionSpinBox->value(); normal[1] = myDYDirectionSpinBox->value(); normal[2] = myDZDirectionSpinBox->value(); @@ -728,7 +726,7 @@ void VVTK_SegmentationCursorDlg::ApplySegmentationCursor() else { VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget(); - float origin[3], aRadius; + vtkFloatingPointType origin[3], aRadius; origin[0] = myXOriginSpinBox->value(); origin[1] = myYOriginSpinBox->value(); origin[2] = myZOriginSpinBox->value(); @@ -787,7 +785,7 @@ void VVTK_SegmentationCursorDlg::ApplyOutsideGaussPoints() myOutsideCursorSettings->SetUniform( myOutsideSizeBox->getUniform() ); QColor aButtonColor = myOutsideSizeBox->getColor(); - float aColor[3]; + vtkFloatingPointType aColor[3]; aColor[0] = aButtonColor.red() / 255.0; aColor[1] = aButtonColor.green() / 255.0; aColor[2] = aButtonColor.blue() / 255.0; diff --git a/src/VVTK/VVTK_SizeBox.cxx b/src/VVTK/VVTK_SizeBox.cxx index 654b69a7..5adfe3be 100644 --- a/src/VVTK/VVTK_SizeBox.cxx +++ b/src/VVTK/VVTK_SizeBox.cxx @@ -48,8 +48,6 @@ using namespace std; VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : QVBox( parent ) { - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - layout()->setSpacing( 0 ); layout()->setMargin( 0 ); -- 2.39.2