From 81c0f652dd1628059f023baa9f8192bea9a7d91a Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 5 Apr 2006 14:33:28 +0000 Subject: [PATCH] Porting on Mandriva 64 (to use vtkFloatingPointType instead of bare "float") --- 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/VVTK/VVTK_PickingDlg.cxx | 6 +- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 28 ++++----- src/VVTK/VVTK_SizeBox.cxx | 2 - 12 files changed, 178 insertions(+), 184 deletions(-) diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index 42591ab3..02eaeb3f 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -309,13 +309,13 @@ VISU_Actor void VISU_Actor -::SetShrinkFactor(float theValue) +::SetShrinkFactor(vtkFloatingPointType theValue) { myShrinkFilter->SetShrinkFactor(theValue); Modified(); } -float +vtkFloatingPointType VISU_Actor ::GetShrinkFactor() { @@ -326,12 +326,12 @@ VISU_Actor //---------------------------------------------------------------------------- void VISU_Actor -::SetOpacity(float theValue) +::SetOpacity(vtkFloatingPointType theValue) { GetProperty()->SetOpacity(theValue); } -float +vtkFloatingPointType VISU_Actor ::GetOpacity() { @@ -340,12 +340,12 @@ VISU_Actor void VISU_Actor -::SetLineWidth(float theLineWidth) +::SetLineWidth(vtkFloatingPointType theLineWidth) { GetProperty()->SetLineWidth(theLineWidth); } -float +vtkFloatingPointType VISU_Actor ::GetLineWidth() { @@ -429,7 +429,7 @@ VISU_Actor return GetCurrentPL()->GetNodeVTKID(theID); } -float* +vtkFloatingPointType* VISU_Actor ::GetNodeCoord(int theObjID) { @@ -510,18 +510,18 @@ VISU_Actor if(vtkCell* aCell = GetElemCell(anObjId)){ vtkPoints* aPts = aCell->GetPoints(); if(int aNbPts = aCell->GetNumberOfPoints()){ - float aCoord[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0}; for(int i = 0; i < aNbPts; i++){ - float *aPntCoord = aPts->GetPoint(i); + vtkFloatingPointType *aPntCoord = aPts->GetPoint(i); aCoord[0] += aPntCoord[0]; aCoord[1] += aPntCoord[1]; aCoord[2] += aPntCoord[2]; } // Display coordinates - float aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0}; + vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0}; aRenderer->SetWorldPoint(aWorldCoord); aRenderer->WorldToDisplay(); - float aSelectionPoint[3]; + vtkFloatingPointType aSelectionPoint[3]; aRenderer->GetDisplayPoint(aSelectionPoint); myAnnotationActor->SetPosition(aSelectionPoint); // @@ -551,12 +551,12 @@ VISU_Actor vtkIdType aVtkId = myPointPicker->GetPointId(); if(aVtkId >= 0 && mySelector->IsValid(this,aVtkId,true) && hasIO()){ vtkIdType anObjId = GetNodeObjId( aVtkId ); - if(float* aCoord = GetNodeCoord(anObjId)){ + if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){ // Display coordinates - float aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0}; + vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0}; aRenderer->SetWorldPoint(aWorldCoord); aRenderer->WorldToDisplay(); - float aSelectionPoint[3]; + vtkFloatingPointType aSelectionPoint[3]; aRenderer->GetDisplayPoint(aSelectionPoint); myAnnotationActor->SetPosition(aSelectionPoint); // diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index 09d4d4bb..947624cf 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -142,27 +142,27 @@ class VTKOCC_EXPORT VISU_Actor : virtual void - SetShrinkFactor(float theFactor = 0.8); + SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); virtual - float + vtkFloatingPointType GetShrinkFactor(); //---------------------------------------------------------------------------- virtual void - SetOpacity(float theValue); + SetOpacity(vtkFloatingPointType theValue); virtual - float + vtkFloatingPointType GetOpacity(); virtual void - SetLineWidth(float theLineWidth); + SetLineWidth(vtkFloatingPointType theLineWidth); virtual - float + vtkFloatingPointType GetLineWidth(); //---------------------------------------------------------------------------- @@ -203,7 +203,7 @@ class VTKOCC_EXPORT VISU_Actor : GetNodeVTKID(vtkIdType theID); virtual - float* + vtkFloatingPointType* GetNodeCoord(vtkIdType theObjID); virtual diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 8c06e2fc..64acea7b 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -207,7 +207,7 @@ VISU_GaussPtsAct return Superclass::GetMapper(); } -float* +vtkFloatingPointType* VISU_GaussPtsAct ::GetBounds() { @@ -335,9 +335,9 @@ VISU_GaussPtsAct { myEventCallbackCommand->SetAbortFlag(1); - float aMagnification = myInsideCursorSettings->GetMagnification(); - float anIncrement = myInsideCursorSettings->GetIncrement(); - float coefficient = up ? anIncrement : 1 / anIncrement; + vtkFloatingPointType aMagnification = myInsideCursorSettings->GetMagnification(); + vtkFloatingPointType anIncrement = myInsideCursorSettings->GetIncrement(); + vtkFloatingPointType coefficient = up ? anIncrement : 1 / anIncrement; myInsideCursorSettings->SetMagnification( aMagnification * coefficient ); myInsideCursorSettings->InvokeEvent(VISU::UpdateFromSettingsEvent,NULL); @@ -377,16 +377,16 @@ VISU_GaussPtsAct namespace { inline - float + vtkFloatingPointType GetRadius(vtkIdType theVTKID, vtkDataArray *theScalarArray, VISU_GaussPointsPL* theGaussPointsPL) { - float aRadius = 0.5; + vtkFloatingPointType aRadius = 0.5; if(theGaussPointsPL->GetPSMapper()->GetPointSpriteMode() == 1) // Geometry mode aRadius *= theGaussPointsPL->GetSize() * theGaussPointsPL->GetAverageCellSize(); else if(theGaussPointsPL->GetBicolor()){ - float aVal = theScalarArray->GetTuple1(theVTKID); + vtkFloatingPointType aVal = theScalarArray->GetTuple1(theVTKID); if(aVal > 0.0) aRadius *= theGaussPointsPL->GetMaxSize(); else @@ -399,7 +399,7 @@ namespace } } -float +vtkFloatingPointType VISU_GaussPtsAct ::GetRadius(vtkIdType theObjID, vtkIdType theVTKID, @@ -409,7 +409,7 @@ VISU_GaussPtsAct } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPtsAct ::GetMagnification(vtkIdType theObjID) { @@ -421,17 +421,17 @@ VISU_GaussPtsAct namespace { inline - float + vtkFloatingPointType GetClamp(VISU_GaussPointsPL* theGaussPointsPL) { - float aClamp = theGaussPointsPL->GetClamp(); + vtkFloatingPointType aClamp = theGaussPointsPL->GetClamp(); if(theGaussPointsPL->GetPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere) return -aClamp; return aClamp; } } -float +vtkFloatingPointType VISU_GaussPtsAct ::GetClamp(vtkIdType theObjID) { @@ -659,14 +659,14 @@ VISU_GaussPtsAct if(myIsPreselected){ anIsChanged = (myLastObjPointID != anObjId); if(anIsChanged){ - float* aNodeCoord = GetNodeCoord(anObjId); + vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId); vtkDataSet* aDataSet = GetInput(); vtkCellData* aCellData = aDataSet->GetCellData(); if(vtkDataArray *aScalarArray = aCellData->GetScalars()){ - float aPyramidHeight = myPickingSettings->GetPyramidHeight(); + vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight(); aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); - //float aColor[3] = myPreHighlightActor->GetProperty()->GetColor(); - float aColor[3]; + //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor(); + vtkFloatingPointType aColor[3]; theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor ); aColor[0] = 1. - aColor[0]; aColor[1] = 1. - aColor[1]; @@ -708,7 +708,7 @@ ChangeZoom(VISU_PickingSettings *thePickingSettings, if(theInitialHasIndex + aCurrentHasIndex == 1){ vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer(); vtkCamera *aCamera = aRenderer->GetActiveCamera(); - float aZoomFactor = thePickingSettings->GetZoomFactor(); + vtkFloatingPointType aZoomFactor = thePickingSettings->GetZoomFactor(); double aScale = aCamera->GetParallelScale(); if (!theInitialHasIndex && aCurrentHasIndex) { aCamera->SetParallelScale(aScale/aZoomFactor); @@ -790,11 +790,11 @@ VISU_GaussPtsAct mySelector->AddIObject(this); } // - float* aNodeCoord = GetNodeCoord(anObjId); + vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId); // // FlyTo vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor(); - float aDollyWas = anInteractor->GetDolly(); + vtkFloatingPointType aDollyWas = anInteractor->GetDolly(); int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames(); anInteractor->SetDolly(0.); @@ -870,20 +870,20 @@ VISU_GaussPtsAct // vtkIdType aVtkId = GetNodeVTKID(anObjId); if(aVtkId >= 0){ - float *aNodeCoord = GetNodeCoord(anObjId); - float aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.}; + vtkFloatingPointType *aNodeCoord = GetNodeCoord(anObjId); + vtkFloatingPointType aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.}; // vtkDataSet* aDataSet = GetInput(); vtkCellData* aDataSetAttributes = aDataSet->GetCellData(); // if(vtkDataArray* aScalarArray = aDataSetAttributes->GetScalars()){ - float aVal = aScalarArray->GetTuple1(aVtkId); + vtkFloatingPointType aVal = aScalarArray->GetTuple1(aVtkId); // GetScalarBarCtrl()->SetIsMarked(true); GetScalarBarCtrl()->SetMarkValue(aVal); GetScalarBarCtrl()->Update(); // - float aPyramidHeight = myPickingSettings->GetPyramidHeight(); + vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight(); aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); myCursorPyramidSelected->Init(aPyramidHeight, myPickingSettings->GetCursorSize(), @@ -916,7 +916,7 @@ VISU_GaussPtsAct aStr<<"\nData: {"; int anId = 0; while(anId < aNbComp){ - float aComp = aFloatArray->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/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