From 13b32488756cfcef8245e01783cefbe94c17ad3d Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 26 Dec 2011 14:00:51 +0000 Subject: [PATCH] Porting to OCCT development version: Standard_PI -> M_PI --- src/VISUGUI/VisuGUI_CutLinesDlg.cxx | 27 +++++++++++++-------------- src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 12 +++++------- src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 14 ++++++-------- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index e8b4d4ef..561151f5 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -18,12 +18,11 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File : VisuGUI_CutLinesDlg.cxx // Author : VSV // Module : VISU -// + #include "VisuGUI_CutLinesDlg.h" #include "VISU_ColoredPrs3dFactory.hh" @@ -363,14 +362,14 @@ void VisuGUI_CutLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs, VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit); - myRotXSpn->setValue(myPrsCopy->GetRotateX()*180./PI); - myRotYSpn->setValue(myPrsCopy->GetRotateY()*180./PI); + myRotXSpn->setValue(myPrsCopy->GetRotateX()*180./M_PI); + myRotYSpn->setValue(myPrsCopy->GetRotateY()*180./M_PI); myPosSpn->setValue(myPrsCopy->GetDisplacement()); setOrientation(myPrsCopy->GetOrientationType()); myNbSpn->setValue( (int)myPrsCopy->GetNbLines() ); - myRotXSpn2->setValue(myPrsCopy->GetRotateX2()*180./PI); - myRotYSpn2->setValue(myPrsCopy->GetRotateY2()*180./PI); + myRotXSpn2->setValue(myPrsCopy->GetRotateX2()*180./M_PI); + myRotYSpn2->setValue(myPrsCopy->GetRotateY2()*180./M_PI); myPosSpn2->setValue(myPrsCopy->GetDisplacement2()); setOrientation2(myPrsCopy->GetOrientationType2()); @@ -405,14 +404,14 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs) anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy ); myPrsCopy->SetOrientation(getOrientaion(), - myRotXSpn->value()*PI/180., - myRotYSpn->value()*PI/180.); + myRotXSpn->value()*M_PI/180., + myRotYSpn->value()*M_PI/180.); myPrsCopy->SetDisplacement(myPosSpn->value()); myPrsCopy->SetNbLines((int)myNbSpn->value()); myPrsCopy->SetOrientation2(getOrientaion(false), - myRotXSpn2->value()*PI/180., - myRotYSpn2->value()*PI/180.); + myRotXSpn2->value()*M_PI/180., + myRotYSpn2->value()*M_PI/180.); myPrsCopy->SetDisplacement2(myPosSpn2->value()); if (!myCBSetDef->isChecked()) @@ -588,14 +587,14 @@ void VisuGUI_CutLinesDlg::DrawTable() return; myCutLines->SetOrientation(getOrientaion(), - myRotXSpn->value()*PI/180., - myRotYSpn->value()*PI/180.); + myRotXSpn->value()*M_PI/180., + myRotYSpn->value()*M_PI/180.); myCutLines->SetNbLines(aNbPlanes); myCutLines->SetDisplacement2(myPosSpn2->value()); myCutLines->SetOrientation2(getOrientaion(false), - myRotXSpn2->value()*PI/180., - myRotYSpn2->value()*PI/180.); + myRotXSpn2->value()*M_PI/180., + myRotYSpn2->value()*M_PI/180.); if (aNbRows>0) for (int i = 0; i < aNbRows; ++i) diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index 20cf4beb..09a7266f 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -18,14 +18,12 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // VISU VISUGUI : GUI of VISU component // File : VisuGUI_CutPlanesDlg.cxx // Author : Laurent CORNABE & Hubert ROLLAND // Module : VISU -// $Header$ -// + #include "VisuGUI_CutPlanesDlg.h" #include "VISU_ColoredPrs3dFactory.hh" @@ -241,7 +239,7 @@ VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane() void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs) { setNbPlanes(thePrs->GetNbPlanes()); - setRotation(thePrs->GetRotateX()*180./PI, thePrs->GetRotateY()*180./PI); + setRotation(thePrs->GetRotateX()*180./M_PI, thePrs->GetRotateY()*180./M_PI); setPlanePos(thePrs->GetOrientationType()); myPosSpn->setValue(thePrs->GetDisplacement()); InitEntity2VectorialFieldsMap(thePrs); @@ -357,7 +355,7 @@ void VisuGUI_CutPlanesPane::createPlanes() int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs) { - thePrs->SetOrientation(getOrientaion(), getRotation1()*PI/180., getRotation2()*PI/180.); + thePrs->SetOrientation(getOrientaion(), getRotation1()*M_PI/180., getRotation2()*M_PI/180.); thePrs->SetNbPlanes(getNbPlanes()); thePrs->SetDisplacement(myPosSpn->value()); for (int i = 0; i < getNbPlanes(); ++i) { @@ -512,7 +510,7 @@ void VisuGUI_CutPlanesPane::DrawTable() int aNbRows = myPosTable->rowCount(); int aNbPlanes = getNbPlanes(); - myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.); + myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*M_PI/180.,getRotation2()*M_PI/180.); myCutPlanes->SetNbPlanes(aNbPlanes); myCutPlanes->SetDisplacement(myPosSpn->value()); myCutPlanes->SetScale(getScaleFactor()); @@ -733,7 +731,7 @@ void VisuGUI_CutPlanesPane::onRotation (double theValue) if (!(bool)myCutPlanes) return; if (myPreviewCheck->isChecked()) { if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { - myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.); + myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*M_PI/180.,getRotation2()*M_PI/180.); myCutPlanes->GetPipeLine()->Update(); deletePlanes(); createPlanes(); diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index 5b0b86c6..f7cbb6c1 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -18,14 +18,12 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // VISU VISUGUI : GUI of VISU component // File : VisuGUI_Plot3DDlg.cxx // Author : Laurent CORNABE & Hubert ROLLAND // Module : VISU -// $Header$ -// + #include "VisuGUI_Plot3DDlg.h" #include "VisuGUI.h" @@ -455,8 +453,8 @@ void VisuGUI_Plot3DPane::initFromPrsObject(VISU::Plot3D_i* thePrs) GBOrientation->button(id)->click(); // rotation - Rot1->setValue(thePrs->GetRotateX() * 180./PI); - Rot2->setValue(thePrs->GetRotateY() * 180./PI); + Rot1->setValue(thePrs->GetRotateX() * 180./M_PI); + Rot2->setValue(thePrs->GetRotateY() * 180./M_PI); // position RelativeChkB->setChecked(thePrs->IsPositionRelative()); @@ -507,7 +505,7 @@ int VisuGUI_Plot3DPane::storeToPrsObject(VISU::Plot3D_i* thePrs) default: ori = VISU::Plot3D::ZX; } // rotation - thePrs->SetOrientation(ori, Rot1->value()*PI/180., Rot2->value()*PI/180.); + thePrs->SetOrientation(ori, Rot1->value()*M_PI/180., Rot2->value()*M_PI/180.); // position thePrs->SetPlanePosition(PositionSpn->value(), RelativeChkB->isChecked()); @@ -559,9 +557,9 @@ void VisuGUI_Plot3DPane::setPlane(int theOrientation, double theXRotation, doubl // Set rotation - Rot1->setValue(theXRotation * 180./PI); + Rot1->setValue(theXRotation * 180./M_PI); Rot1->setEnabled(false); - Rot2->setValue(theYRotation * 180./PI); + Rot2->setValue(theYRotation * 180./M_PI); Rot2->setEnabled(false); // Set position -- 2.39.2