Porting to OCCT development version: Standard_PI -> M_PI

This commit is contained in:
jfa 2011-12-23 14:23:54 +00:00
parent 1192c0b6c1
commit 21f352b21b
29 changed files with 892 additions and 957 deletions

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: BlockFix_PeriodicSurfaceModifier.cxx // File: BlockFix_PeriodicSurfaceModifier.cxx
// Created: 15.12.04 10:08:50 // Created: 15.12.04 10:08:50
// Author: Sergey KUUL // Author: Sergey KUUL
//
#include <BlockFix_PeriodicSurfaceModifier.ixx> #include <BlockFix_PeriodicSurfaceModifier.ixx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
@ -74,7 +73,7 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
Handle(Geom_CylindricalSurface)::DownCast(S); Handle(Geom_CylindricalSurface)::DownCast(S);
Standard_Real Umin, Umax, Vmin, Vmax; Standard_Real Umin, Umax, Vmin, Vmax;
BRepTools::UVBounds(aFace, Umin, Umax, Vmin, Vmax); BRepTools::UVBounds(aFace, Umin, Umax, Vmin, Vmax);
if( Umin<-Precision::PConfusion() || Umax>2*PI+Precision::PConfusion() ) { if (Umin < -Precision::PConfusion() || Umax > 2*M_PI + Precision::PConfusion()) {
gp_Ax3 ax3 = aCyl->Position(); gp_Ax3 ax3 = aCyl->Position();
gp_Ax1 NDir = ax3.Axis(); gp_Ax1 NDir = ax3.Axis();
gp_Ax3 newax3 = ax3.Rotated(NDir,Umin-Precision::PConfusion()); gp_Ax3 newax3 = ax3.Rotated(NDir,Umin-Precision::PConfusion());
@ -89,7 +88,7 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S); Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S);
Standard_Real Umin, Umax, Vmin, Vmax; Standard_Real Umin, Umax, Vmin, Vmax;
BRepTools::UVBounds(aFace, Umin, Umax, Vmin, Vmax); BRepTools::UVBounds(aFace, Umin, Umax, Vmin, Vmax);
if( Umin<-Precision::PConfusion() || Umax>2*PI+Precision::PConfusion() ) { if (Umin < -Precision::PConfusion() || Umax > 2*M_PI + Precision::PConfusion()) {
gp_Ax3 ax3 = aSphere->Position(); gp_Ax3 ax3 = aSphere->Position();
gp_Ax1 NDir = ax3.Axis(); gp_Ax1 NDir = ax3.Axis();
gp_Ax3 newax3 = ax3.Rotated(NDir,Umin-Precision::PConfusion()); gp_Ax3 newax3 = ax3.Rotated(NDir,Umin-Precision::PConfusion());

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: BlockFix.cxx // File: BlockFix.cxx
// Created: Tue Dec 7 11:59:05 2004 // Created: Tue Dec 7 11:59:05 2004
// Author: Pavel DURANDIN // Author: Pavel DURANDIN
//
#include <BlockFix_SphereSpaceModifier.ixx> #include <BlockFix_SphereSpaceModifier.ixx>
#include <TopLoc_Location.hxx> #include <TopLoc_Location.hxx>
@ -84,7 +83,7 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
if(S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) { if(S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
Standard_Real Umin, Umax, Vmin, Vmax; Standard_Real Umin, Umax, Vmin, Vmax;
ShapeAnalysis::GetFaceUVBounds(aFace,Umin, Umax, Vmin, Vmax); ShapeAnalysis::GetFaceUVBounds(aFace,Umin, Umax, Vmin, Vmax);
Standard_Real PI2 = PI/2.; Standard_Real PI2 = M_PI/2.;
if(Vmax > PI2 - Precision::PConfusion() || Vmin < -PI2+::Precision::PConfusion()) { if(Vmax > PI2 - Precision::PConfusion() || Vmin < -PI2+::Precision::PConfusion()) {
Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S); Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S);
gp_Sphere sp = aSphere->Sphere(); gp_Sphere sp = aSphere->Sphere();

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: BlockFix_UnionEdges.cxx // File: BlockFix_UnionEdges.cxx
// Created: 07.12.04 15:27:30 // Created: 07.12.04 15:27:30
// Author: Sergey KUUL // Author: Sergey KUUL
//
#include <BlockFix_UnionEdges.ixx> #include <BlockFix_UnionEdges.ixx>
#include <Approx_Curve3d.hxx> #include <Approx_Curve3d.hxx>
@ -214,7 +213,7 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
lpar = -lpar; lpar = -lpar;
} }
} }
if(lpar<fpar) lpar += 2*PI; if (lpar < fpar) lpar += 2*M_PI;
Handle(Geom_TrimmedCurve) tc = new Geom_TrimmedCurve(C,fpar,lpar); Handle(Geom_TrimmedCurve) tc = new Geom_TrimmedCurve(C,fpar,lpar);
B.MakeEdge (E,tc,Precision::Confusion()); B.MakeEdge (E,tc,Precision::Confusion());
B.Add(E,V1); B.Add(E,V1);

View File

@ -18,13 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_Tools.cxx // File: GEOMAlgo_Tools.cxx
// Created: Mon Dec 6 11:35:29 2004 // Created: Mon Dec 6 11:35:29 2004
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <GEOMAlgo_Tools.ixx> #include <GEOMAlgo_Tools.ixx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
@ -432,14 +430,12 @@ void GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
const Standard_Real aUMin, const Standard_Real aUMin,
const Standard_Real aUMax) const Standard_Real aUMax)
{ {
Standard_Real aT1, aT2, aTx, aUx, aTol, aTwoPI; Standard_Real aT1, aT2, aTx, aUx, aTol;
gp_Pnt2d aP2D; gp_Pnt2d aP2D;
Handle(Geom_Surface) aS; Handle(Geom_Surface) aS;
Handle(Geom2d_Curve) aC2D; Handle(Geom2d_Curve) aC2D;
BRep_Builder aBB; BRep_Builder aBB;
// //
aTwoPI=PI+PI;
//
aC2D=BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2); aC2D=BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2);
if (!aC2D.IsNull()) { if (!aC2D.IsNull()) {
if (BRep_Tool::IsClosed(aE, aF)) { if (BRep_Tool::IsClosed(aE, aF)) {

View File

@ -278,7 +278,7 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1, theContext); GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1, theContext);
GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2, theContext); GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2, theContext);
// //
aTwoPI=2.*PI; aTwoPI = 2.*M_PI;
gp_Vec aVBF (aPx, aPF ); gp_Vec aVBF (aPx, aPF );
gp_Vec aVBF1(aPx, aPF1); gp_Vec aVBF1(aPx, aPF1);
gp_Vec aVBF2(aPx, aPF2); gp_Vec aVBF2(aPx, aPF2);
@ -321,7 +321,7 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
NMTTools_ListIteratorOfListOfCoupleOfShape aIt; NMTTools_ListIteratorOfListOfCoupleOfShape aIt;
// //
aAngleMin=100.; aAngleMin=100.;
aTwoPI=PI+PI; aTwoPI = M_PI+M_PI;
BRep_Tool::Range(theE1, aT1, aT2); BRep_Tool::Range(theE1, aT1, aT2);
aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2); aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
// Ref // Ref
@ -338,7 +338,7 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
const TopoDS_Face& aF2=TopoDS::Face(aCS.Shape2()); const TopoDS_Face& aF2=TopoDS::Face(aCS.Shape2());
// //
if (aF2==theF1) { if (aF2==theF1) {
aAngle=PI; aAngle=M_PI;
} }
else if (aF2.IsSame(theF1)) { else if (aF2.IsSame(theF1)) {
aAngle=aTwoPI; aAngle=aTwoPI;
@ -1055,7 +1055,7 @@ Standard_Real AngleWithRef(const gp_Dir& theD1,
Standard_Real aCosinus, aSinus, aBeta, aHalfPI, aScPr; Standard_Real aCosinus, aSinus, aBeta, aHalfPI, aScPr;
gp_XYZ aXYZ; gp_XYZ aXYZ;
// //
aHalfPI=0.5*PI; aHalfPI=0.5*M_PI;
// //
const gp_XYZ& aXYZ1=theD1.XYZ(); const gp_XYZ& aXYZ1=theD1.XYZ();
const gp_XYZ& aXYZ2=theD2.XYZ(); const gp_XYZ& aXYZ2=theD2.XYZ();
@ -1068,7 +1068,7 @@ Standard_Real AngleWithRef(const gp_Dir& theD1,
aBeta=aHalfPI*(1.-aCosinus); aBeta=aHalfPI*(1.-aCosinus);
} }
else { else {
aBeta=2.*PI-aHalfPI*(3.+aCosinus); aBeta=2.*M_PI-aHalfPI*(3.+aCosinus);
} }
// //
aScPr=aXYZ.Dot(theDRef.XYZ()); aScPr=aXYZ.Dot(theDRef.XYZ());

View File

@ -18,13 +18,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: GEOMAlgo_WireSplitter.cxx // File: GEOMAlgo_WireSplitter.cxx
// Created:
// Author: Peter KURNEV // Author: Peter KURNEV
// <pkv@irinox>
//
#include <GEOMAlgo_WireSplitter.ixx> #include <GEOMAlgo_WireSplitter.ixx>
#include <TColStd_SequenceOfReal.hxx> #include <TColStd_SequenceOfReal.hxx>
@ -728,7 +725,7 @@ static
Standard_Real ClockWiseAngle(const Standard_Real aAngleIn, Standard_Real ClockWiseAngle(const Standard_Real aAngleIn,
const Standard_Real aAngleOut) const Standard_Real aAngleOut)
{ {
Standard_Real aTwoPi=Standard_PI+Standard_PI; Standard_Real aTwoPi = M_PI+M_PI;
Standard_Real dA, A1, A2, AIn, AOut ; Standard_Real dA, A1, A2, AIn, AOut ;
AIn=aAngleIn; AIn=aAngleIn;
@ -741,7 +738,7 @@ static
AOut=AOut-aTwoPi; AOut=AOut-aTwoPi;
} }
A1=AIn+Standard_PI; A1 = AIn + M_PI;
if (A1 >= aTwoPi) { if (A1 >= aTwoPi) {
A1=A1-aTwoPi; A1=A1-aTwoPi;
@ -850,7 +847,7 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
Standard_Real anAngle = aRefDir.Angle(aDir2D); Standard_Real anAngle = aRefDir.Angle(aDir2D);
if (anAngle < 0.) if (anAngle < 0.)
anAngle += Standard_PI + Standard_PI; anAngle += M_PI + M_PI;
return anAngle; return anAngle;
} }

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
@ -173,7 +172,7 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
{ {
double aD = aCI.GetD(); double aD = aCI.GetD();
double anAngle = aCI.GetAngle(); double anAngle = aCI.GetAngle();
if ( (anAngle > 0) && (anAngle < (Standard_PI/2)) ) if ( (anAngle > 0) && (anAngle < (M_PI/2.)) )
fill.AddDA(aD, anAngle, E, F); fill.AddDA(aD, anAngle, E, F);
} }
} }
@ -215,7 +214,7 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
{ {
double aD = aCI.GetD(); double aD = aCI.GetD();
double anAngle = aCI.GetAngle(); double anAngle = aCI.GetAngle();
if ( (anAngle > 0) && (anAngle < (Standard_PI/2)) ) if ( (anAngle > 0) && (anAngle < (M_PI/2.)) )
fill.AddDA(aD, anAngle, E, F); fill.AddDA(aD, anAngle, E, F);
} }
} }
@ -251,7 +250,7 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
{ {
double aD = aCI.GetD(); double aD = aCI.GetD();
double anAngle = aCI.GetAngle(); double anAngle = aCI.GetAngle();
if ( (anAngle > 0) && (anAngle < (Standard_PI/2)) ) if ( (anAngle > 0) && (anAngle < (M_PI/2.)) )
fill.AddDA(aD, anAngle, E, F); fill.AddDA(aD, anAngle, E, F);
} }
} }
@ -293,7 +292,6 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
//======================================================================= //=======================================================================
Standard_EXPORT Handle_Standard_Type& GEOMImpl_ChamferDriver_Type_() Standard_EXPORT Handle_Standard_Type& GEOMImpl_ChamferDriver_Type_()
{ {
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
@ -301,7 +299,6 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_ChamferDriver_Type_()
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ChamferDriver", static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ChamferDriver",
sizeof(GEOMImpl_ChamferDriver), sizeof(GEOMImpl_ChamferDriver),

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
@ -92,7 +91,7 @@ static TopoDS_Vertex anotherVertex( const TopoDS_Edge& theE,
} }
return aV; return aV;
} }
//======================================================================= //=======================================================================
//function : takePlane //function : takePlane
//purpose : local function returns plane of given edges //purpose : local function returns plane of given edges
@ -116,8 +115,8 @@ static Standard_Boolean takePlane( const TopoDS_Edge& theE1,
gp_Dir aDir1( aXYZ - aXYZ1 ); gp_Dir aDir1( aXYZ - aXYZ1 );
gp_Dir aDir2( aXYZ2 - aXYZ ); gp_Dir aDir2( aXYZ2 - aXYZ );
Standard_Real anAngle = aDir1.Angle(aDir2); Standard_Real anAngle = aDir1.Angle(aDir2);
if ( fabs(anAngle) <= gp::Resolution() || if ( fabs(anAngle) <= gp::Resolution() ||
fabs(anAngle - PI) <= gp::Resolution() ) fabs(anAngle - M_PI) <= gp::Resolution() )
return false; return false;
thePlane = gp_Pln( gp_Pnt(aXYZ), aDir1^ aDir2); thePlane = gp_Pln( gp_Pnt(aXYZ), aDir1^ aDir2);
} }
@ -214,25 +213,25 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const
if ( anEdgeToEdgeMap.IsBound( anEdge2 ) ) anEdge2 = TopoDS::Edge(anEdgeToEdgeMap.Find( anEdge2 )); if ( anEdgeToEdgeMap.IsBound( anEdge2 ) ) anEdge2 = TopoDS::Edge(anEdgeToEdgeMap.Find( anEdge2 ));
if ( anEdge1.IsNull() || anEdge2.IsNull() || anEdge1.IsSame( anEdge2 ) ) if ( anEdge1.IsNull() || anEdge2.IsNull() || anEdge1.IsSame( anEdge2 ) )
continue; //no input data to make fillet continue; //no input data to make fillet
// create plane on 2 edges // create plane on 2 edges
gp_Pln aPlane; gp_Pln aPlane;
if ( !takePlane(anEdge1, anEdge2, aV, aPlane) ) if ( !takePlane(anEdge1, anEdge2, aV, aPlane) )
continue; // seems edges does not belong to same plane or parallel (fillet can not be build) continue; // seems edges does not belong to same plane or parallel (fillet can not be build)
GEOMImpl_Fillet1d aFilletAlgo(anEdge1, anEdge2, aPlane); GEOMImpl_Fillet1d aFilletAlgo(anEdge1, anEdge2, aPlane);
if ( !aFilletAlgo.Perform(rad) ) if ( !aFilletAlgo.Perform(rad) )
continue; // can not create fillet with given radius continue; // can not create fillet with given radius
// take fillet result in given vertex // take fillet result in given vertex
TopoDS_Edge aModifE1, aModifE2; TopoDS_Edge aModifE1, aModifE2;
TopoDS_Edge aNewE = aFilletAlgo.Result(BRep_Tool::Pnt(aV), aModifE1, aModifE2); TopoDS_Edge aNewE = aFilletAlgo.Result(BRep_Tool::Pnt(aV), aModifE1, aModifE2);
if (aNewE.IsNull()) if (aNewE.IsNull())
continue; // no result found continue; // no result found
// add new created edges and take modified edges // add new created edges and take modified edges
aListOfNewEdge.Append( aNewE ); aListOfNewEdge.Append( aNewE );
// check if face edges modified, // check if face edges modified,
// if yes, than map to original edges (from vertex-edges list), because edges can be modified before // if yes, than map to original edges (from vertex-edges list), because edges can be modified before
if (aModifE1.IsNull() || !anEdge1.IsSame( aModifE1 )) if (aModifE1.IsNull() || !anEdge1.IsSame( aModifE1 ))
@ -245,10 +244,10 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const
StdFail_NotDone::Raise("1D Fillet can't be computed on the given shape with the given radius"); StdFail_NotDone::Raise("1D Fillet can't be computed on the given shape with the given radius");
return 0; return 0;
} }
// create new wire instead of original // create new wire instead of original
for ( TopExp_Explorer anExp( aWire, TopAbs_EDGE ); anExp.More(); anExp.Next() ) { for ( TopExp_Explorer anExp( aWire, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
TopoDS_Shape anEdge = anExp.Current(); TopoDS_Shape anEdge = anExp.Current();
if ( !anEdgeToEdgeMap.IsBound( anEdge ) ) if ( !anEdgeToEdgeMap.IsBound( anEdge ) )
aListOfNewEdge.Append( anEdge ); aListOfNewEdge.Append( anEdge );
else if (!anEdgeToEdgeMap.Find( anEdge ).IsNull()) else if (!anEdgeToEdgeMap.Find( anEdge ).IsNull())
@ -266,7 +265,7 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const
aWire = aWireTool.Wire(); aWire = aWireTool.Wire();
aFunction->SetValue(aWire); aFunction->SetValue(aWire);
log.SetTouched(Label()); log.SetTouched(Label());
return 1; return 1;
} }
@ -277,7 +276,6 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const
//======================================================================= //=======================================================================
Standard_EXPORT Handle_Standard_Type& GEOMImpl_Fillet1dDriver_Type_() Standard_EXPORT Handle_Standard_Type& GEOMImpl_Fillet1dDriver_Type_()
{ {
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
@ -285,7 +283,6 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_Fillet1dDriver_Type_()
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Fillet1dDriver", static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Fillet1dDriver",
sizeof(GEOMImpl_Fillet1dDriver), sizeof(GEOMImpl_Fillet1dDriver),
@ -310,5 +307,5 @@ const Handle(GEOMImpl_Fillet1dDriver) Handle(GEOMImpl_Fillet1dDriver)::DownCast(
} }
} }
return _anOtherObject ; return _anOtherObject;
} }

View File

@ -159,7 +159,7 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const
} }
else if( C->IsKind(STANDARD_TYPE(Geom_Circle)) || else if( C->IsKind(STANDARD_TYPE(Geom_Circle)) ||
C->IsKind(STANDARD_TYPE(Geom_Ellipse)) ) { C->IsKind(STANDARD_TYPE(Geom_Ellipse)) ) {
nbp = (int)25*fabs(Last-First)/(2*PI); nbp = (int)25*fabs(Last-First)/(2.*M_PI);
} }
else if( C->IsKind(STANDARD_TYPE(Geom_BezierCurve)) ) { else if( C->IsKind(STANDARD_TYPE(Geom_BezierCurve)) ) {
Handle(Geom_BezierCurve) C3d = Handle(Geom_BezierCurve)::DownCast(C); Handle(Geom_BezierCurve) C3d = Handle(Geom_BezierCurve)::DownCast(C);
@ -384,7 +384,6 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const
//======================================================================= //=======================================================================
Standard_EXPORT Handle_Standard_Type& GEOMImpl_FillingDriver_Type_() Standard_EXPORT Handle_Standard_Type& GEOMImpl_FillingDriver_Type_()
{ {
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
@ -392,7 +391,6 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_FillingDriver_Type_()
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_FillingDriver", static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_FillingDriver",
sizeof(GEOMImpl_FillingDriver), sizeof(GEOMImpl_FillingDriver),
@ -407,8 +405,8 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_FillingDriver_Type_()
//function : DownCast //function : DownCast
//purpose : //purpose :
//======================================================================= //=======================================================================
const Handle(GEOMImpl_FillingDriver) Handle(GEOMImpl_FillingDriver)::DownCast
const Handle(GEOMImpl_FillingDriver) Handle(GEOMImpl_FillingDriver)::DownCast(const Handle(Standard_Transient)& AnObject) (const Handle(Standard_Transient)& AnObject)
{ {
Handle(GEOMImpl_FillingDriver) _anOtherObject; Handle(GEOMImpl_FillingDriver) _anOtherObject;

View File

@ -1404,7 +1404,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(
//Make a Python command //Make a Python command
GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution(" GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution("
<< theBase << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)"; << theBase << ", " << theAxis << ", " << theAngle * 180.0 / M_PI << "*math.pi/180.0)";
SetErrorCode(OK); SetErrorCode(OK);
return aRevolution; return aRevolution;
@ -1462,7 +1462,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways
//Make a Python command //Make a Python command
GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution2Ways(" GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution2Ways("
<< theBase << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)"; << theBase << ", " << theAxis << ", " << theAngle * 180.0 / M_PI << "*math.pi/180.0)";
SetErrorCode(OK); SetErrorCode(OK);
return aRevolution; return aRevolution;

View File

@ -2069,7 +2069,7 @@ Standard_Real GEOMImpl_IMeasureOperations::GetAngle (Handle(GEOM_Object) theLine
gp_Lin aLin2 = L2->Lin(); gp_Lin aLin2 = L2->Lin();
anAngle = aLin1.Angle(aLin2); anAngle = aLin1.Angle(aLin2);
anAngle /= PI180; // convert radians into degrees anAngle *= 180. / M_PI; // convert radians into degrees
if (anAngle > 90.0) { if (anAngle > 90.0) {
anAngle = 180.0 - anAngle; anAngle = 180.0 - anAngle;
@ -2135,7 +2135,7 @@ Standard_Real GEOMImpl_IMeasureOperations::GetAngleBtwVectors (Handle(GEOM_Objec
gp_Vec aV2 (BRep_Tool::Pnt(aP21), BRep_Tool::Pnt(aP22)) ; gp_Vec aV2 (BRep_Tool::Pnt(aP21), BRep_Tool::Pnt(aP22)) ;
anAngle = aV1.Angle(aV2); anAngle = aV1.Angle(aV2);
anAngle /= PI180; // convert radians into degrees anAngle *= 180. / M_PI; // convert radians into degrees
SetErrorCode(OK); SetErrorCode(OK);
} }

View File

@ -4122,7 +4122,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld (Handle(GEOM_Objec
if ( isFound && iType == TopAbs_FACE ) if ( isFound && iType == TopAbs_FACE )
{ {
// check normals at pOnWhat and pOnWhere // check normals at pOnWhat and pOnWhere
const double angleTol = PI/180.; const double angleTol = M_PI/180.;
gp_Vec normToWhat = GetNormal( TopoDS::Face(Exp_aWhat.Current()), aWhatDistance); gp_Vec normToWhat = GetNormal( TopoDS::Face(Exp_aWhat.Current()), aWhatDistance);
gp_Vec normToWhere = GetNormal( TopoDS::Face(Exp_aWhere.Current()), aWhereDistance); gp_Vec normToWhere = GetNormal( TopoDS::Face(Exp_aWhere.Current()), aWhereDistance);
if ( normToWhat * normToWhere < 0 ) if ( normToWhat * normToWhere < 0 )

View File

@ -1666,7 +1666,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate (Handle(GEOM_Object) t
//Make a Python command //Make a Python command
GEOM::TPythonDump(aFunction) << "geompy.Rotate(" << theObject GEOM::TPythonDump(aFunction) << "geompy.Rotate(" << theObject
<< ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)"; << ", " << theAxis << ", " << theAngle * 180.0 / M_PI << "*math.pi/180.0)";
SetErrorCode(OK); SetErrorCode(OK);
return theObject; return theObject;
@ -1719,7 +1719,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec
//Make a Python command //Make a Python command
GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeRotation(" << theObject GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeRotation(" << theObject
<< ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)"; << ", " << theAxis << ", " << theAngle * 180.0 / M_PI << "*math.pi/180.0)";
SetErrorCode(OK); SetErrorCode(OK);
return aCopy; return aCopy;

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
@ -600,7 +599,7 @@ static void FindFirstPairFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
gp_Vec aDir(P1,P2); gp_Vec aDir(P1,P2);
int i=1; int i=1;
double MinAng = PI; double MinAng = M_PI;
int numface = 0; int numface = 0;
for (; i<=Fs.Length(); i++) { for (; i<=Fs.Length(); i++) {
gp_Vec tmpDir(PM1,Ps(i)); gp_Vec tmpDir(PM1,Ps(i));
@ -833,7 +832,7 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
C->D1(lp,P2,Vec2); C->D1(lp,P2,Vec2);
double ang = fabs(Vec1.Angle(Vec2)); double ang = fabs(Vec1.Angle(Vec2));
SumAng += ang; SumAng += ang;
if (SumAng>4*PI) { if (SumAng>4*M_PI) {
SumAng = ang; SumAng = ang;
SplitEdgeNums.Append(i-1); SplitEdgeNums.Append(i-1);
int j; int j;
@ -1543,7 +1542,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
// main direction for comparing // main direction for comparing
gp_Vec VM(PLocs.Value(i),PLocs.Value(i+1)); gp_Vec VM(PLocs.Value(i),PLocs.Value(i+1));
// find corresponding edge from next section // find corresponding edge from next section
double minang = PI; double minang = M_PI;
gp_Pnt P11 = BRep_Tool::Pnt(V11); gp_Pnt P11 = BRep_Tool::Pnt(V11);
gp_Pnt P21 = BRep_Tool::Pnt(V21); gp_Pnt P21 = BRep_Tool::Pnt(V21);
TopoDS_Shape E2; TopoDS_Shape E2;
@ -1892,9 +1891,9 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(SecVs(i))); gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(SecVs(i)));
gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(SecVs(i+1))); gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(SecVs(i+1)));
gp_Vec aDir(P1,P2); gp_Vec aDir(P1,P2);
if (fabs(aDir.Angle(aDir1))>PI/2.) if (fabs(aDir.Angle(aDir1)) > M_PI/2.)
aDir1.Reverse(); aDir1.Reverse();
if (fabs(aDir.Angle(aDir2))>PI/2.) if (fabs(aDir.Angle(aDir2)) > M_PI/2.)
aDir2.Reverse(); aDir2.Reverse();
TopExp_Explorer anExpE(F1,TopAbs_EDGE); TopExp_Explorer anExpE(F1,TopAbs_EDGE);
@ -2457,7 +2456,6 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
//======================================================================= //=======================================================================
Standard_EXPORT Handle_Standard_Type& GEOMImpl_PipeDriver_Type_() Standard_EXPORT Handle_Standard_Type& GEOMImpl_PipeDriver_Type_()
{ {
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
@ -100,7 +99,7 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
gp_Dir aDir(gp_Vec(aP1, aP2)); gp_Dir aDir(gp_Vec(aP1, aP2));
gp_Ax1 anAx1(aP1, aDir); gp_Ax1 anAx1(aP1, aDir);
Standard_Real anAngle = RI.GetAngle(); Standard_Real anAngle = RI.GetAngle();
if (fabs(anAngle) < Precision::Angular()) anAngle += 2*PI; // NPAL19665,19769 if (fabs(anAngle) < Precision::Angular()) anAngle += 2.*M_PI; // NPAL19665,19769
aTrsf.SetRotation(anAx1, anAngle); aTrsf.SetRotation(anAx1, anAngle);
//NPAL18620: performance problem: multiple locations are accumulated //NPAL18620: performance problem: multiple locations are accumulated
@ -135,7 +134,7 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
gp_Dir aDir (aVec1 ^ aVec2); gp_Dir aDir (aVec1 ^ aVec2);
gp_Ax1 anAx1 (aCP, aDir); gp_Ax1 anAx1 (aCP, aDir);
Standard_Real anAngle = aVec1.Angle(aVec2); Standard_Real anAngle = aVec1.Angle(aVec2);
if (fabs(anAngle) < Precision::Angular()) anAngle += 2*PI; // NPAL19665 if (fabs(anAngle) < Precision::Angular()) anAngle += 2.*M_PI; // NPAL19665
aTrsf.SetRotation(anAx1, anAngle); aTrsf.SetRotation(anAx1, anAngle);
//NPAL18620: performance problem: multiple locations are accumulated //NPAL18620: performance problem: multiple locations are accumulated
// in shape and need a great time to process // in shape and need a great time to process
@ -177,7 +176,7 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
B.Add(aCompound, anOriginal); B.Add(aCompound, anOriginal);
} }
else { else {
aTrsf.SetRotation(AX1, i*angle*PI180); aTrsf.SetRotation(AX1, i*angle*M_PI/180.);
//TopLoc_Location aLocRes (aTrsf * aTrsfOrig); // gp_Trsf::Multiply() has a bug //TopLoc_Location aLocRes (aTrsf * aTrsfOrig); // gp_Trsf::Multiply() has a bug
gp_Trsf aTrsfNew (aTrsfOrig); gp_Trsf aTrsfNew (aTrsfOrig);
aTrsfNew.PreMultiply(aTrsf); aTrsfNew.PreMultiply(aTrsf);
@ -274,7 +273,7 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
B.Add(aCompound, anOriginal.Located(aLocRes)); B.Add(aCompound, anOriginal.Located(aLocRes));
} }
else { else {
aTrsf2.SetRotation(AX1, j*ang*PI180); aTrsf2.SetRotation(AX1, j*ang*M_PI/180.);
//TopLoc_Location aLocRes (aTrsf2 * aTrsf1 * aTrsfOrig); // gp_Trsf::Multiply() has a bug //TopLoc_Location aLocRes (aTrsf2 * aTrsf1 * aTrsfOrig); // gp_Trsf::Multiply() has a bug
gp_Trsf aTrsfNew (aTrsfOrig); gp_Trsf aTrsfNew (aTrsfOrig);
aTrsfNew.PreMultiply(aTrsf1); aTrsfNew.PreMultiply(aTrsf1);

View File

@ -608,14 +608,14 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
NewFpar = ElCLib::Parameter(PrevCircle, P1); NewFpar = ElCLib::Parameter(PrevCircle, P1);
NewLpar = ElCLib::Parameter(PrevCircle, P2); NewLpar = ElCLib::Parameter(PrevCircle, P2);
if (NewLpar < NewFpar) if (NewLpar < NewFpar)
NewLpar += 2.*PI; NewLpar += 2.*M_PI;
//Standard_Real MemNewFpar = NewFpar, MemNewLpar = NewLpar; //Standard_Real MemNewFpar = NewFpar, MemNewLpar = NewLpar;
if (ConnectByOrigin == TopAbs_FORWARD) if (ConnectByOrigin == TopAbs_FORWARD)
ElCLib::AdjustPeriodic(FparSeq.Last(), ElCLib::AdjustPeriodic(FparSeq.Last(),
FparSeq.Last() + 2.*PI, FparSeq.Last() + 2.*M_PI,
Precision::PConfusion(), NewFpar, NewLpar); Precision::PConfusion(), NewFpar, NewLpar);
else else
ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*PI, ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*M_PI,
FparSeq.Last(), FparSeq.Last(),
Precision::PConfusion(), NewFpar, NewLpar); Precision::PConfusion(), NewFpar, NewLpar);
Done = Standard_True; Done = Standard_True;
@ -644,13 +644,13 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
NewFpar = ElCLib::Parameter(PrevEllipse, P1); NewFpar = ElCLib::Parameter(PrevEllipse, P1);
NewLpar = ElCLib::Parameter(PrevEllipse, P2); NewLpar = ElCLib::Parameter(PrevEllipse, P2);
if (NewLpar < NewFpar) if (NewLpar < NewFpar)
NewLpar += 2.*PI; NewLpar += 2.*M_PI;
if (ConnectByOrigin == TopAbs_FORWARD) if (ConnectByOrigin == TopAbs_FORWARD)
ElCLib::AdjustPeriodic(FparSeq.Last(), ElCLib::AdjustPeriodic(FparSeq.Last(),
FparSeq.Last() + 2.*PI, FparSeq.Last() + 2.*M_PI,
Precision::PConfusion(), NewFpar, NewLpar); Precision::PConfusion(), NewFpar, NewLpar);
else else
ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*PI, ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*M_PI,
FparSeq.Last(), FparSeq.Last(),
Precision::PConfusion(), NewFpar, NewLpar); Precision::PConfusion(), NewFpar, NewLpar);
Done = Standard_True; Done = Standard_True;

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// File : GenerationGUI_RevolDlg.cxx // File : GenerationGUI_RevolDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S. // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "GenerationGUI_RevolDlg.h" #include "GenerationGUI_RevolDlg.h"
#include <DlgRef.h> #include <DlgRef.h>
@ -319,9 +318,11 @@ bool GenerationGUI_RevolDlg::execute (ObjectList& objects)
for (int i = 0; i < myBaseObjects.count(); i++) { for (int i = 0; i < myBaseObjects.count(); i++) {
if (!GroupPoints->CheckButton1->isChecked()) if (!GroupPoints->CheckButton1->isChecked())
anObj = anOper->MakeRevolutionAxisAngle(myBaseObjects[i].get(), myAxis.get(), getAngle() * PI180); anObj = anOper->MakeRevolutionAxisAngle(myBaseObjects[i].get(), myAxis.get(),
getAngle() * M_PI / 180.);
else else
anObj = anOper->MakeRevolutionAxisAngle2Ways(myBaseObjects[i].get(), myAxis.get(), getAngle() * PI180); anObj = anOper->MakeRevolutionAxisAngle2Ways(myBaseObjects[i].get(), myAxis.get(),
getAngle() * M_PI / 180.);
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if (!IsPreview()) { if (!IsPreview()) {

View File

@ -349,8 +349,8 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
aLabel.sprintf("%.1f", anAngle); aLabel.sprintf("%.1f", anAngle);
Handle(AIS_AngleDimension) anIO = new AIS_AngleDimension Handle(AIS_AngleDimension) anIO = new AIS_AngleDimension
(anEdge1, anEdge2, aPlane, anAngle * PI180, (anEdge1, anEdge2, aPlane, anAngle * M_PI / 180.,
TCollection_ExtendedString((Standard_CString)aLabel.toLatin1().data())); TCollection_ExtendedString((Standard_CString)aLabel.toLatin1().data()));
Handle(Geom_Line) geom_lin1,geom_lin2; Handle(Geom_Line) geom_lin1,geom_lin2;
gp_Pnt ptat11,ptat12,ptat21,ptat22; gp_Pnt ptat11,ptat12,ptat21,ptat22;
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;

View File

@ -18,11 +18,12 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _NMTDS_CArray1OfIndexRange_HeaderFile #ifndef _NMTDS_CArray1OfIndexRange_HeaderFile
#define _NMTDS_CArray1OfIndexRange_HeaderFile #define _NMTDS_CArray1OfIndexRange_HeaderFile
#include <Basics_OCCTVersion.hxx>
#ifndef _Standard_Address_HeaderFile #ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx> #include <Standard_Address.hxx>
#endif #endif
@ -32,11 +33,11 @@
#ifndef _Standard_Boolean_HeaderFile #ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#endif #endif
class Standard_OutOfRange; class Standard_OutOfRange;
class Standard_OutOfMemory; class Standard_OutOfMemory;
class NMTDS_IndexRange; class NMTDS_IndexRange;
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
#include <Standard.hxx> #include <Standard.hxx>
#endif #endif
@ -108,33 +109,25 @@ Standard_EXPORT NMTDS_IndexRange& ChangeValue(const Standard_Integer Index) ;
return ChangeValue(Index); return ChangeValue(Index);
} }
Standard_EXPORT void SetBlockLength(const Standard_Integer aBL) ; Standard_EXPORT void SetBlockLength(const Standard_Integer aBL) ;
Standard_EXPORT Standard_Integer BlockLength() const; Standard_EXPORT Standard_Integer BlockLength() const;
#if OCC_VERSION_LARGE > 0x06050200
Standard_EXPORT void Purge();
#endif
protected: protected:
// Methods PROTECTED // Methods PROTECTED
// //
// Fields PROTECTED // Fields PROTECTED
// //
private: private:
// Methods PRIVATE // Methods PRIVATE
// //
Standard_EXPORT NMTDS_CArray1OfIndexRange(const NMTDS_CArray1OfIndexRange& AnArray); Standard_EXPORT NMTDS_CArray1OfIndexRange(const NMTDS_CArray1OfIndexRange& AnArray);
@ -144,11 +137,8 @@ Standard_EXPORT NMTDS_CArray1OfIndexRange& Assign(const NMTDS_CArray1OfIndexRa
return Assign(Other); return Assign(Other);
} }
Standard_EXPORT Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const; Standard_EXPORT Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const;
// Fields PRIVATE // Fields PRIVATE
// //
Standard_Address myStart; Standard_Address myStart;
@ -156,16 +146,9 @@ Standard_Integer myLength;
Standard_Integer myFactLength; Standard_Integer myFactLength;
Standard_Integer myBlockLength; Standard_Integer myBlockLength;
Standard_Boolean myIsAllocated; Standard_Boolean myIsAllocated;
}; };
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)
// //
#endif #endif

View File

@ -18,11 +18,12 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _NMTTools_CommonBlockPool_HeaderFile #ifndef _NMTTools_CommonBlockPool_HeaderFile
#define _NMTTools_CommonBlockPool_HeaderFile #define _NMTTools_CommonBlockPool_HeaderFile
#include <Basics_OCCTVersion.hxx>
#ifndef _Standard_Address_HeaderFile #ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx> #include <Standard_Address.hxx>
#endif #endif
@ -32,11 +33,11 @@
#ifndef _Standard_Boolean_HeaderFile #ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
#endif #endif
class Standard_OutOfRange; class Standard_OutOfRange;
class Standard_OutOfMemory; class Standard_OutOfMemory;
class NMTTools_ListOfCommonBlock; class NMTTools_ListOfCommonBlock;
#ifndef _Standard_HeaderFile #ifndef _Standard_HeaderFile
#include <Standard.hxx> #include <Standard.hxx>
#endif #endif
@ -108,47 +109,35 @@ Standard_EXPORT NMTTools_ListOfCommonBlock& ChangeValue(const Standard_Integer
return ChangeValue(Index); return ChangeValue(Index);
} }
Standard_EXPORT void SetBlockLength(const Standard_Integer aBL) ; Standard_EXPORT void SetBlockLength(const Standard_Integer aBL) ;
Standard_EXPORT Standard_Integer BlockLength() const; Standard_EXPORT Standard_Integer BlockLength() const;
#if OCC_VERSION_LARGE > 0x06050200
Standard_EXPORT void Purge();
#endif
protected: protected:
// Methods PROTECTED // Methods PROTECTED
// //
// Fields PROTECTED // Fields PROTECTED
// //
private: private:
// Methods PRIVATE // Methods PRIVATE
// //
Standard_EXPORT NMTTools_CommonBlockPool(const NMTTools_CommonBlockPool& AnArray); Standard_EXPORT NMTTools_CommonBlockPool(const NMTTools_CommonBlockPool& AnArray);
Standard_EXPORT NMTTools_CommonBlockPool& Assign(const NMTTools_CommonBlockPool& Other) ; Standard_EXPORT NMTTools_CommonBlockPool& Assign(const NMTTools_CommonBlockPool& Other) ;
NMTTools_CommonBlockPool& operator =(const NMTTools_CommonBlockPool& Other) NMTTools_CommonBlockPool& operator =(const NMTTools_CommonBlockPool& Other)
{ {
return Assign(Other); return Assign(Other);
} }
Standard_EXPORT Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const; Standard_EXPORT Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const;
// Fields PRIVATE // Fields PRIVATE
// //
Standard_Address myStart; Standard_Address myStart;
@ -160,12 +149,7 @@ Standard_Boolean myIsAllocated;
}; };
// other Inline functions and methods (like "C++: function call" methods) // other Inline functions and methods (like "C++: function call" methods)
// //
#endif #endif

View File

@ -1511,8 +1511,8 @@ void NMTTools_PaveFiller::CorrectTolR3D(const BOPTools_SSInterference& aFF,
// //
aA=aDN[0].Angle(aDN[1]); aA=aDN[0].Angle(aDN[1]);
aA=fabs(aA); aA=fabs(aA);
if (aA>0.5*PI) { if (aA > 0.5*M_PI) {
aA=PI-aA; aA = M_PI - aA;
} }
// //
if (aA<aAmin || aA>aAmax) { if (aA<aAmin || aA>aAmax) {

View File

@ -18,14 +18,12 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM OBJECT : interactive object for Geometry entities visualization // GEOM OBJECT : interactive object for Geometry entities visualization
// File : GEOM_AISShape.cxx // File : GEOM_AISShape.cxx
// Author : Nicolas REJNERI // Author : Nicolas REJNERI
// Module : GEOM // Module : GEOM
// $Header$
//
/*! /*!
\class GEOM_AISShape GEOM_AISShape.hxx \class GEOM_AISShape GEOM_AISShape.hxx
\brief .... \brief ....
@ -254,7 +252,7 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
else else
aDir = -aDirVec; aDir = -aDirVec;
Prs3d_Arrow::Draw(aPrs, aP2, aDir, PI/180.*5., aDist/10.); Prs3d_Arrow::Draw(aPrs, aP2, aDir, M_PI/180.*5., aDist/10.);
} }
} }
} }

View File

@ -18,14 +18,12 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM OBJECT : interactive object for Geometry entities visualization // GEOM OBJECT : interactive object for Geometry entities visualization
// File : GEOM_OCCReader.h // File : GEOM_OCCReader.h
// Author : Christophe ATTANASIO // Author : Christophe ATTANASIO
// Module : GEOM // Module : GEOM
// $Header$
//
#include "GEOM_OCCReader.h" #include "GEOM_OCCReader.h"
// VTK Includes // VTK Includes
@ -810,7 +808,7 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
if (aDist < gp::Resolution()) return; if (aDist < gp::Resolution()) return;
gp_Dir aDirection (aDirVec); gp_Dir aDirection (aDirVec);
Standard_Real anAngle = PI/180.*5.; Standard_Real anAngle = M_PI/180. * 5.;
Standard_Real aLength = aDist/10.; Standard_Real aLength = aDist/10.;
Standard_Real dx,dy,dz; Standard_Real dx,dy,dz;
@ -848,8 +846,8 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
int NbPoints = 15; int NbPoints = 15;
for (int i = 1; i <= NbPoints; i++, ptPrev = ptCur) for (int i = 1; i <= NbPoints; i++, ptPrev = ptCur)
{ {
cosinus = cos(2. * PI / NbPoints * (i-1)); cosinus = cos(2. * M_PI / NbPoints * (i-1));
sinus = sin(2. * PI / NbPoints * (i-1)); sinus = sin(2. * M_PI / NbPoints * (i-1));
gp_XYZ aP = aPc + (aDirI.XYZ() * cosinus + aDirJ.XYZ() * sinus) * aLength * Tg; gp_XYZ aP = aPc + (aDirI.XYZ() * cosinus + aDirJ.XYZ() * sinus) * aLength * Tg;
coord[0] = aP.X(); coord[0] = aP.X();
@ -1069,5 +1067,3 @@ const TopoDS_Shape& GEOM_OCCReader::getTopo() {
int GEOM_OCCReader::getDisplayMode() { int GEOM_OCCReader::getDisplayMode() {
return amode; return amode;
} }

View File

@ -15,7 +15,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "GEOM_EdgeSource.h" #include "GEOM_EdgeSource.h"
@ -194,7 +193,7 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
else else
aDirection = -aDirVec; aDirection = -aDirVec;
Standard_Real anAngle = PI/180.*5.; Standard_Real anAngle = M_PI/180.*5.;
Standard_Real aLength = aDist/10.; Standard_Real aLength = aDist/10.;
Standard_Real dx,dy,dz; Standard_Real dx,dy,dz;
@ -231,8 +230,8 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
int NbPoints = 15; int NbPoints = 15;
for (int i = 1; i <= NbPoints; i++, ptPrev = ptCur) for (int i = 1; i <= NbPoints; i++, ptPrev = ptCur)
{ {
cosinus = cos(2. * PI / NbPoints * (i-1)); cosinus = cos(2. * M_PI / NbPoints * (i-1));
sinus = sin(2. * PI / NbPoints * (i-1)); sinus = sin(2. * M_PI / NbPoints * (i-1));
gp_XYZ aP = aPc + (aDirI.XYZ() * cosinus + aDirJ.XYZ() * sinus) * aLength * Tg; gp_XYZ aP = aPc + (aDirI.XYZ() * cosinus + aDirJ.XYZ() * sinus) * aLength * Tg;
coord[0] = aP.X(); coord[0] = aP.X();

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// File : OperationGUI_ChamferDlg.cxx // File : OperationGUI_ChamferDlg.cxx
// Author : Damien COQUERET, Open CASCADE S.A.S. // Author : Damien COQUERET, Open CASCADE S.A.S.
//
#include "OperationGUI_ChamferDlg.h" #include "OperationGUI_ChamferDlg.h"
#include <SalomeApp_DoubleSpinBox.h> #include <SalomeApp_DoubleSpinBox.h>
@ -839,7 +838,7 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
else { else {
anObj = anOper->MakeChamferEdgeAD(myShape, anObj = anOper->MakeChamferEdgeAD(myShape,
mySpinBox[ SpinBox23 ]->value(), mySpinBox[ SpinBox23 ]->value(),
mySpinBox[ SpinBox24 ]->value() * PI180, mySpinBox[ SpinBox24 ]->value() * M_PI / 180.,
myFace[ Face1 ], myFace[ Face1 ],
myFace[ Face2 ]); myFace[ Face2 ]);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
@ -871,7 +870,7 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
else { else {
anObj = anOper->MakeChamferFacesAD(myShape, anObj = anOper->MakeChamferFacesAD(myShape,
mySpinBox[ SpinBox33 ]->value(), mySpinBox[ SpinBox33 ]->value(),
mySpinBox[ SpinBox34 ]->value() * PI180, mySpinBox[ SpinBox34 ]->value() * M_PI / 180.,
anArray); anArray);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
{ {
@ -899,7 +898,7 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
else { else {
anObj = anOper->MakeChamferEdgesAD(myShape, anObj = anOper->MakeChamferEdgesAD(myShape,
mySpinBox[ SpinBox43 ]->value(), mySpinBox[ SpinBox43 ]->value(),
mySpinBox[ SpinBox44 ]->value() * PI180, mySpinBox[ SpinBox44 ]->value() * M_PI / 180.,
anArray); anArray);
if (!anObj->_is_nil()) if (!anObj->_is_nil())
{ {

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// File : RepairGUI_ShapeProcessDlg.cxx // File : RepairGUI_ShapeProcessDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S. // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "RepairGUI_ShapeProcessDlg.h" #include "RepairGUI_ShapeProcessDlg.h"
#include <DlgRef.h> #include <DlgRef.h>
@ -450,7 +449,7 @@ void RepairGUI_ShapeProcessDlg::reset()
const char* get_convert( const char* theParam, const QString& theValue ) const char* get_convert( const char* theParam, const QString& theValue )
{ {
if ( !strcmp( theParam, "SplitAngle.Angle" ) ) { if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
double doubleValue = theValue.toDouble() * PI / 180; double doubleValue = theValue.toDouble() * M_PI / 180.;
return CORBA::string_dup( QString::number( doubleValue ).toLatin1().constData() ); return CORBA::string_dup( QString::number( doubleValue ).toLatin1().constData() );
} }
return CORBA::string_dup( theValue.toLatin1().constData() ); return CORBA::string_dup( theValue.toLatin1().constData() );
@ -463,7 +462,7 @@ const char* get_convert( const char* theParam, const QString& theValue )
const char* set_convert( const char* theParam, const char* theValue ) const char* set_convert( const char* theParam, const char* theValue )
{ {
if ( !strcmp( theParam, "SplitAngle.Angle" ) ) { if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
double doubleValue = atof( theValue ) * 180 / PI; double doubleValue = atof( theValue ) * 180. / M_PI;
TCollection_AsciiString str( doubleValue ); TCollection_AsciiString str( doubleValue );
return CORBA::string_dup( str.ToCString() ); return CORBA::string_dup( str.ToCString() );
} }

View File

@ -18,14 +18,12 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM SKETCHER : basic sketcher // GEOM SKETCHER : basic sketcher
// File : Sketcher_Profile.cxx // File : Sketcher_Profile.cxx
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header:
//
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include <Sketcher_Profile.hxx> #include <Sketcher_Profile.hxx>
@ -189,7 +187,7 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
} }
case 'T': case 'T':
{ {
if (n1 != 3) goto badargs; if (n1 != 3) goto badargs;
Standard_Real vx = a(1).RealValue(); Standard_Real vx = a(1).RealValue();
Standard_Real vy = a(2).RealValue(); Standard_Real vy = a(2).RealValue();
if (a(0) == "TT") { if (a(0) == "TT") {
@ -209,7 +207,7 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
case 'R': case 'R':
{ {
if (n1 != 2) goto badargs; if (n1 != 2) goto badargs;
angle = a(1).RealValue() * PI180; angle = a(1).RealValue() * M_PI / 180.;
if (a(0) == "RR") { if (a(0) == "RR") {
dx = Cos(angle); dx = Cos(angle);
dy = Sin(angle); dy = Sin(angle);
@ -242,42 +240,43 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
if (n1 != 3) goto badargs; if (n1 != 3) goto badargs;
radius = a(1).RealValue(); radius = a(1).RealValue();
if (Abs(radius) > Precision::Confusion()) { if (Abs(radius) > Precision::Confusion()) {
angle = a(2).RealValue() * PI180; angle = a(2).RealValue() * M_PI / 180.;
move = circle; move = circle;
} }
else else
move = none; move = none;
break; break;
} }
case 'A': // TAngential arc by end point case 'A': // TAngential arc by end point
{ {
if (n1 != 3) goto badargs; if (n1 != 3) goto badargs;
Standard_Real vx = a(1).RealValue(); Standard_Real vx = a(1).RealValue();
Standard_Real vy = a(2).RealValue(); Standard_Real vy = a(2).RealValue();
if (a(0) == "AA") { if (a(0) == "AA") {
vx -= x; vx -= x;
vy -= y; vy -= y;
} }
Standard_Real det = dx * vy - dy * vx; Standard_Real det = dx * vy - dy * vx;
if ( Abs(det) > Precision::Confusion()) { if ( Abs(det) > Precision::Confusion()) {
Standard_Real c = (dx * vx + dy * vy) // Cosine of alpha = arc of angle / 2 , alpha in [0,Pi]
/ Sqrt((dx * dx + dy * dy) * (vx * vx + vy * vy)); // Cosine of alpha = arc of angle / 2 , alpha in [0,Pi] Standard_Real c = (dx * vx + dy * vy) / Sqrt((dx * dx + dy * dy) * (vx * vx + vy * vy));
radius = (vx * vx + vy * vy)* Sqrt(dx * dx + dy * dy) // radius = distance between start and end point / 2 * sin(alpha) // radius = distance between start and end point / 2 * sin(alpha)
/ (2.0 * det); // radius is > 0 or < 0 // radius is > 0 or < 0
radius = (vx * vx + vy * vy)* Sqrt(dx * dx + dy * dy) / (2.0 * det);
if (Abs(radius) > Precision::Confusion()) { if (Abs(radius) > Precision::Confusion()) {
angle = 2.0 * acos(c); // angle in [0,2Pi] angle = 2.0 * acos(c); // angle in [0,2Pi]
move = circle; move = circle;
} }
else else
move = none; move = none;
break; break;
} }
else else
move = none; move = none;
break; break;
} }
case 'U': // Arc by end point and radiUs case 'U': // Arc by end point and radiUs
{ {
if (n1 != 5) goto badargs; if (n1 != 5) goto badargs;
Standard_Real vx = a(1).RealValue(); Standard_Real vx = a(1).RealValue();
Standard_Real vy = a(2).RealValue(); Standard_Real vy = a(2).RealValue();
@ -289,23 +288,24 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
} }
Standard_Real length = Sqrt(vx * vx + vy * vy); Standard_Real length = Sqrt(vx * vx + vy * vy);
if ( (4.0 - (vx * vx + vy * vy) / (radius * radius) >= 0.0 ) && (length > Precision::Confusion()) ) { if ( (4.0 - (vx * vx + vy * vy) / (radius * radius) >= 0.0 ) && (length > Precision::Confusion()) ) {
Standard_Real c = 0.5 * Sqrt(4.0 - (vx * vx + vy * vy) / (radius * radius)); // Cosine of alpha = arc angle / 2 , alpha in [0,Pi/2] // Cosine of alpha = arc angle / 2 , alpha in [0,Pi/2]
angle = 2.0 * acos(c); // angle in [0,Pi] Standard_Real c = 0.5 * Sqrt(4.0 - (vx * vx + vy * vy) / (radius * radius));
angle = 2.0 * acos(c); // angle in [0,Pi]
if ( reversed == 2 ) if ( reversed == 2 )
angle = angle - 2 * PI; angle = angle - 2 * M_PI;
dx = 0.5 * ( vy * 1.0/radius dx = 0.5 * ( vy * 1.0/radius
+ vx * Sqrt(4.0 / (vx * vx + vy * vy) - 1.0 / (radius * radius))); + vx * Sqrt(4.0 / (vx * vx + vy * vy) - 1.0 / (radius * radius)));
dy = - 0.5 * ( vx * 1.0/radius dy = - 0.5 * ( vx * 1.0/radius
- vy * Sqrt(4.0 / (vx * vx + vy * vy) - 1.0 / (radius * radius))); - vy * Sqrt(4.0 / (vx * vx + vy * vy) - 1.0 / (radius * radius)));
move = circle; move = circle;
} }
else{ else{
move = none; move = none;
} }
break; break;
} }
case 'E': // Arc by end point and cEnter case 'E': // Arc by end point and cEnter
{ {
if (n1 != 7) goto badargs; if (n1 != 7) goto badargs;
Standard_Real vx = a(1).RealValue(); Standard_Real vx = a(1).RealValue();
Standard_Real vy = a(2).RealValue(); Standard_Real vy = a(2).RealValue();
@ -318,7 +318,7 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
vx -= x; vx -= x;
vy -= y; vy -= y;
vxc -= x; vxc -= x;
vyc -= y; vyc -= y;
} }
radius = Sqrt( vxc * vxc + vyc * vyc ); radius = Sqrt( vxc * vxc + vyc * vyc );
Standard_Real det = vx * vyc - vy * vxc; Standard_Real det = vx * vyc - vy * vxc;
@ -330,27 +330,27 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
if ( error > Precision::Confusion() ){ if ( error > Precision::Confusion() ){
MESSAGE("Warning : The specified end point is not on the Arc, distance = "<<error); MESSAGE("Warning : The specified end point is not on the Arc, distance = "<<error);
} }
if ( error > Precision::Confusion() && control_Tolerance == 1) // Don't create the arc if the end point if ( error > Precision::Confusion() && control_Tolerance == 1) // Don't create the arc if the end point
move = none; // is too far from it move = none; // is too far from it
else if ( (length > Precision::Confusion()) && else if ( (length > Precision::Confusion()) &&
(length2 > Precision::Confusion()) && (length2 > Precision::Confusion()) &&
(length3 > Precision::Confusion()) ) { (length3 > Precision::Confusion()) ) {
Standard_Real c = ( radius * radius - (vx * vxc + vy * vyc) ) Standard_Real c = ( radius * radius - (vx * vxc + vy * vyc) )
/ ( radius * Sqrt((vx-vxc) * (vx-vxc) + (vy-vyc) * (vy-vyc)) ) ; // Cosine of arc angle / ( radius * Sqrt((vx-vxc) * (vx-vxc) + (vy-vyc) * (vy-vyc)) ) ; // Cosine of arc angle
angle = acos(c); // angle in [0,Pi] angle = acos(c); // angle in [0,Pi]
if ( reversed == 2 ) if ( reversed == 2 )
angle = angle - 2 * PI; angle = angle - 2 * M_PI;
if (det < 0) if (det < 0)
angle = -angle; angle = -angle;
dx = vyc / radius; dx = vyc / radius;
dy = -vxc / radius; dy = -vxc / radius;
move = circle; move = circle;
} }
else { else {
move = none; move = none;
} }
break; break;
} }
case 'I': case 'I':
{ {
if (n1 != 2) goto badargs; if (n1 != 2) goto badargs;

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// File : TransformationGUI_RotationDlg.cxx // File : TransformationGUI_RotationDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S. // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "TransformationGUI_RotationDlg.h" #include "TransformationGUI_RotationDlg.h"
#include <DlgRef.h> #include <DlgRef.h>
@ -494,7 +493,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
if (toCreateCopy) { if (toCreateCopy) {
for (int i = 0; i < myObjects.count(); i++) { for (int i = 0; i < myObjects.count(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = anOper->RotateCopy(myObjects[i].get(), myAxis.get(), GetAngle() * PI180); anObj = anOper->RotateCopy(myObjects[i].get(), myAxis.get(), GetAngle() * M_PI / 180.);
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) { if(!IsPreview()) {
anObj->SetParameters(aParameters.join(":").toLatin1().constData()); anObj->SetParameters(aParameters.join(":").toLatin1().constData());
@ -506,7 +505,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
else { else {
for (int i = 0; i < myObjects.count(); i++) { for (int i = 0; i < myObjects.count(); i++) {
myCurrObject = myObjects[i]; myCurrObject = myObjects[i];
anObj = anOper->Rotate(myObjects[i].get(), myAxis.get(), GetAngle() * PI180); anObj = anOper->Rotate(myObjects[i].get(), myAxis.get(), GetAngle() * M_PI / 180.);
if (!anObj->_is_nil()) { if (!anObj->_is_nil()) {
if(!IsPreview()) { if(!IsPreview()) {
anObj->SetParameters(aParameters.join(":").toLatin1().constData()); anObj->SetParameters(aParameters.join(":").toLatin1().constData());