From: apo Date: Wed, 5 Apr 2006 14:47:41 +0000 (+0000) Subject: Porting on Mandriva 64 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=93f629fcca3b4153f0edf5a4f9403d823ff71d31;p=modules%2Fvisu.git Porting on Mandriva 64 --- 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 f1dd5652..a528cdde 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; @@ -1703,7 +1703,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) param = vtkParam + "ClippingPlane_"; for ( int p = 0, nPlanes = vPrs->GetNumberOfClippingPlanes(); 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; @@ -1933,7 +1933,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) { QStringList vals = QStringList::split( gDigitsSep, val ); if ( vals.count() == 6 && vActor->GetPrs3d() ) { - 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..2f15249a 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -11,8 +11,8 @@ #ifndef VISUGUI_TIMEANIMATION_H #define VISUGUI_TIMEANIMATION_H +#include "VTKViewer.h" #include "QtxDblSpinBox.h" - #include "SALOMEDSClient_Study.hxx" #include @@ -64,7 +64,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..35fac0fc 100644 --- a/src/VISU_I/VISU_Result_i.hh +++ b/src/VISU_I/VISU_Result_i.hh @@ -31,6 +31,8 @@ #include "VISU_BoostSignals.h" #include "SALOME_GenericObj_i.hh" +#include "VTKViewer.h" + #include #include @@ -175,17 +177,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;