mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-22 15:00:33 +05:00
Porting to OCCT development version: Standard_PI -> M_PI
This commit is contained in:
parent
1192c0b6c1
commit
21f352b21b
@ -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: BlockFix_PeriodicSurfaceModifier.cxx
|
||||
// Created: 15.12.04 10:08:50
|
||||
// Author: Sergey KUUL
|
||||
//
|
||||
|
||||
#include <BlockFix_PeriodicSurfaceModifier.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
@ -74,7 +73,7 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
|
||||
Handle(Geom_CylindricalSurface)::DownCast(S);
|
||||
Standard_Real 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_Ax1 NDir = ax3.Axis();
|
||||
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);
|
||||
Standard_Real 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_Ax1 NDir = ax3.Axis();
|
||||
gp_Ax3 newax3 = ax3.Rotated(NDir,Umin-Precision::PConfusion());
|
||||
|
@ -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: BlockFix.cxx
|
||||
// Created: Tue Dec 7 11:59:05 2004
|
||||
// Author: Pavel DURANDIN
|
||||
//
|
||||
|
||||
#include <BlockFix_SphereSpaceModifier.ixx>
|
||||
|
||||
#include <TopLoc_Location.hxx>
|
||||
@ -84,7 +83,7 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
|
||||
if(S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
|
||||
Standard_Real 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()) {
|
||||
Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S);
|
||||
gp_Sphere sp = aSphere->Sphere();
|
||||
|
@ -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: BlockFix_UnionEdges.cxx
|
||||
// Created: 07.12.04 15:27:30
|
||||
// Author: Sergey KUUL
|
||||
//
|
||||
|
||||
#include <BlockFix_UnionEdges.ixx>
|
||||
|
||||
#include <Approx_Curve3d.hxx>
|
||||
@ -214,7 +213,7 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
|
||||
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);
|
||||
B.MakeEdge (E,tc,Precision::Confusion());
|
||||
B.Add(E,V1);
|
||||
|
@ -18,13 +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: GEOMAlgo_Tools.cxx
|
||||
// Created: Mon Dec 6 11:35:29 2004
|
||||
// Author: Peter KURNEV
|
||||
// <pkv@irinox>
|
||||
//
|
||||
|
||||
#include <GEOMAlgo_Tools.ixx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
@ -432,14 +430,12 @@ void GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
|
||||
const Standard_Real aUMin,
|
||||
const Standard_Real aUMax)
|
||||
{
|
||||
Standard_Real aT1, aT2, aTx, aUx, aTol, aTwoPI;
|
||||
Standard_Real aT1, aT2, aTx, aUx, aTol;
|
||||
gp_Pnt2d aP2D;
|
||||
Handle(Geom_Surface) aS;
|
||||
Handle(Geom2d_Curve) aC2D;
|
||||
BRep_Builder aBB;
|
||||
//
|
||||
aTwoPI=PI+PI;
|
||||
//
|
||||
aC2D=BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2);
|
||||
if (!aC2D.IsNull()) {
|
||||
if (BRep_Tool::IsClosed(aE, aF)) {
|
||||
|
@ -278,7 +278,7 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
|
||||
GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1, theContext);
|
||||
GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2, theContext);
|
||||
//
|
||||
aTwoPI=2.*PI;
|
||||
aTwoPI = 2.*M_PI;
|
||||
gp_Vec aVBF (aPx, aPF );
|
||||
gp_Vec aVBF1(aPx, aPF1);
|
||||
gp_Vec aVBF2(aPx, aPF2);
|
||||
@ -321,7 +321,7 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
|
||||
NMTTools_ListIteratorOfListOfCoupleOfShape aIt;
|
||||
//
|
||||
aAngleMin=100.;
|
||||
aTwoPI=PI+PI;
|
||||
aTwoPI = M_PI+M_PI;
|
||||
BRep_Tool::Range(theE1, aT1, aT2);
|
||||
aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
|
||||
// Ref
|
||||
@ -338,7 +338,7 @@ Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
|
||||
const TopoDS_Face& aF2=TopoDS::Face(aCS.Shape2());
|
||||
//
|
||||
if (aF2==theF1) {
|
||||
aAngle=PI;
|
||||
aAngle=M_PI;
|
||||
}
|
||||
else if (aF2.IsSame(theF1)) {
|
||||
aAngle=aTwoPI;
|
||||
@ -1055,7 +1055,7 @@ Standard_Real AngleWithRef(const gp_Dir& theD1,
|
||||
Standard_Real aCosinus, aSinus, aBeta, aHalfPI, aScPr;
|
||||
gp_XYZ aXYZ;
|
||||
//
|
||||
aHalfPI=0.5*PI;
|
||||
aHalfPI=0.5*M_PI;
|
||||
//
|
||||
const gp_XYZ& aXYZ1=theD1.XYZ();
|
||||
const gp_XYZ& aXYZ2=theD2.XYZ();
|
||||
@ -1068,7 +1068,7 @@ Standard_Real AngleWithRef(const gp_Dir& theD1,
|
||||
aBeta=aHalfPI*(1.-aCosinus);
|
||||
}
|
||||
else {
|
||||
aBeta=2.*PI-aHalfPI*(3.+aCosinus);
|
||||
aBeta=2.*M_PI-aHalfPI*(3.+aCosinus);
|
||||
}
|
||||
//
|
||||
aScPr=aXYZ.Dot(theDRef.XYZ());
|
||||
|
@ -18,13 +18,10 @@
|
||||
// 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: GEOMAlgo_WireSplitter.cxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
// <pkv@irinox>
|
||||
//
|
||||
|
||||
#include <GEOMAlgo_WireSplitter.ixx>
|
||||
|
||||
#include <TColStd_SequenceOfReal.hxx>
|
||||
@ -728,7 +725,7 @@ static
|
||||
Standard_Real ClockWiseAngle(const Standard_Real aAngleIn,
|
||||
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 ;
|
||||
|
||||
AIn=aAngleIn;
|
||||
@ -741,7 +738,7 @@ static
|
||||
AOut=AOut-aTwoPi;
|
||||
}
|
||||
|
||||
A1=AIn+Standard_PI;
|
||||
A1 = AIn + M_PI;
|
||||
|
||||
if (A1 >= aTwoPi) {
|
||||
A1=A1-aTwoPi;
|
||||
@ -850,7 +847,7 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
|
||||
Standard_Real anAngle = aRefDir.Angle(aDir2D);
|
||||
|
||||
if (anAngle < 0.)
|
||||
anAngle += Standard_PI + Standard_PI;
|
||||
anAngle += M_PI + M_PI;
|
||||
|
||||
return anAngle;
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
@ -173,7 +172,7 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
|
||||
{
|
||||
double aD = aCI.GetD();
|
||||
double anAngle = aCI.GetAngle();
|
||||
if ( (anAngle > 0) && (anAngle < (Standard_PI/2)) )
|
||||
if ( (anAngle > 0) && (anAngle < (M_PI/2.)) )
|
||||
fill.AddDA(aD, anAngle, E, F);
|
||||
}
|
||||
}
|
||||
@ -215,7 +214,7 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
|
||||
{
|
||||
double aD = aCI.GetD();
|
||||
double anAngle = aCI.GetAngle();
|
||||
if ( (anAngle > 0) && (anAngle < (Standard_PI/2)) )
|
||||
if ( (anAngle > 0) && (anAngle < (M_PI/2.)) )
|
||||
fill.AddDA(aD, anAngle, E, F);
|
||||
}
|
||||
}
|
||||
@ -251,7 +250,7 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
|
||||
{
|
||||
double aD = aCI.GetD();
|
||||
double anAngle = aCI.GetAngle();
|
||||
if ( (anAngle > 0) && (anAngle < (Standard_PI/2)) )
|
||||
if ( (anAngle > 0) && (anAngle < (M_PI/2.)) )
|
||||
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_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
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);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ChamferDriver",
|
||||
sizeof(GEOMImpl_ChamferDriver),
|
||||
|
@ -15,11 +15,10 @@
|
||||
// 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 : GEOMImpl_Fillet1d.cxx
|
||||
// Module : GEOMImpl
|
||||
//
|
||||
|
||||
#include "GEOMImpl_Fillet1d.hxx"
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
@ -41,7 +40,6 @@
|
||||
* class GEOMImpl_Fillet1d
|
||||
*/
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
@ -516,7 +514,7 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint,
|
||||
|
||||
gp_Vec aCircleDir;
|
||||
aCircle->D1(aParam1, aPoint1, aCircleDir);
|
||||
if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ aIsOut)
|
||||
if ((aCircleDir.Angle(aDir) > M_PI / 2.0) ^ aIsOut)
|
||||
aStart = aNearest->GetParam();
|
||||
else
|
||||
anEnd = aNearest->GetParam();
|
||||
@ -535,7 +533,7 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint,
|
||||
aCurve->D1(aNearest->GetParam2(), aPoint2, aDir);
|
||||
|
||||
aCircle->D1(aParam2, aPoint2, aCircleDir);
|
||||
if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ (!aIsOut))
|
||||
if ((aCircleDir.Angle(aDir) > M_PI / 2.0) ^ (!aIsOut))
|
||||
aStart = aNearest->GetParam2();
|
||||
else
|
||||
anEnd = aNearest->GetParam2();
|
||||
|
@ -15,7 +15,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
@ -117,7 +116,7 @@ static Standard_Boolean takePlane( const TopoDS_Edge& theE1,
|
||||
gp_Dir aDir2( aXYZ2 - aXYZ );
|
||||
Standard_Real anAngle = aDir1.Angle(aDir2);
|
||||
if ( fabs(anAngle) <= gp::Resolution() ||
|
||||
fabs(anAngle - PI) <= gp::Resolution() )
|
||||
fabs(anAngle - M_PI) <= gp::Resolution() )
|
||||
return false;
|
||||
thePlane = gp_Pln( gp_Pnt(aXYZ), aDir1^ aDir2);
|
||||
}
|
||||
@ -277,7 +276,6 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const
|
||||
//=======================================================================
|
||||
Standard_EXPORT Handle_Standard_Type& GEOMImpl_Fillet1dDriver_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
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);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Fillet1dDriver",
|
||||
sizeof(GEOMImpl_Fillet1dDriver),
|
||||
|
@ -159,7 +159,7 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
else if( C->IsKind(STANDARD_TYPE(Geom_Circle)) ||
|
||||
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)) ) {
|
||||
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_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
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);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_FillingDriver",
|
||||
sizeof(GEOMImpl_FillingDriver),
|
||||
@ -407,8 +405,8 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_FillingDriver_Type_()
|
||||
//function : DownCast
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(GEOMImpl_FillingDriver) Handle(GEOMImpl_FillingDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
const Handle(GEOMImpl_FillingDriver) Handle(GEOMImpl_FillingDriver)::DownCast
|
||||
(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOMImpl_FillingDriver) _anOtherObject;
|
||||
|
||||
|
@ -1404,7 +1404,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle(
|
||||
|
||||
//Make a Python command
|
||||
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);
|
||||
return aRevolution;
|
||||
@ -1462,7 +1462,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways
|
||||
|
||||
//Make a Python command
|
||||
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);
|
||||
return aRevolution;
|
||||
|
@ -2069,7 +2069,7 @@ Standard_Real GEOMImpl_IMeasureOperations::GetAngle (Handle(GEOM_Object) theLine
|
||||
gp_Lin aLin2 = L2->Lin();
|
||||
|
||||
anAngle = aLin1.Angle(aLin2);
|
||||
anAngle /= PI180; // convert radians into degrees
|
||||
anAngle *= 180. / M_PI; // convert radians into degrees
|
||||
|
||||
if (anAngle > 90.0) {
|
||||
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)) ;
|
||||
|
||||
anAngle = aV1.Angle(aV2);
|
||||
anAngle /= PI180; // convert radians into degrees
|
||||
anAngle *= 180. / M_PI; // convert radians into degrees
|
||||
|
||||
SetErrorCode(OK);
|
||||
}
|
||||
|
@ -4122,7 +4122,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld (Handle(GEOM_Objec
|
||||
if ( isFound && iType == TopAbs_FACE )
|
||||
{
|
||||
// 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 normToWhere = GetNormal( TopoDS::Face(Exp_aWhere.Current()), aWhereDistance);
|
||||
if ( normToWhat * normToWhere < 0 )
|
||||
|
@ -1666,7 +1666,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate (Handle(GEOM_Object) t
|
||||
|
||||
//Make a Python command
|
||||
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);
|
||||
return theObject;
|
||||
@ -1719,7 +1719,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec
|
||||
|
||||
//Make a Python command
|
||||
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);
|
||||
return aCopy;
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
@ -600,7 +599,7 @@ static void FindFirstPairFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
|
||||
|
||||
gp_Vec aDir(P1,P2);
|
||||
int i=1;
|
||||
double MinAng = PI;
|
||||
double MinAng = M_PI;
|
||||
int numface = 0;
|
||||
for (; i<=Fs.Length(); i++) {
|
||||
gp_Vec tmpDir(PM1,Ps(i));
|
||||
@ -833,7 +832,7 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
||||
C->D1(lp,P2,Vec2);
|
||||
double ang = fabs(Vec1.Angle(Vec2));
|
||||
SumAng += ang;
|
||||
if (SumAng>4*PI) {
|
||||
if (SumAng>4*M_PI) {
|
||||
SumAng = ang;
|
||||
SplitEdgeNums.Append(i-1);
|
||||
int j;
|
||||
@ -1543,7 +1542,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
// main direction for comparing
|
||||
gp_Vec VM(PLocs.Value(i),PLocs.Value(i+1));
|
||||
// find corresponding edge from next section
|
||||
double minang = PI;
|
||||
double minang = M_PI;
|
||||
gp_Pnt P11 = BRep_Tool::Pnt(V11);
|
||||
gp_Pnt P21 = BRep_Tool::Pnt(V21);
|
||||
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 P2 = BRep_Tool::Pnt(TopoDS::Vertex(SecVs(i+1)));
|
||||
gp_Vec aDir(P1,P2);
|
||||
if (fabs(aDir.Angle(aDir1))>PI/2.)
|
||||
if (fabs(aDir.Angle(aDir1)) > M_PI/2.)
|
||||
aDir1.Reverse();
|
||||
if (fabs(aDir.Angle(aDir2))>PI/2.)
|
||||
if (fabs(aDir.Angle(aDir2)) > M_PI/2.)
|
||||
aDir2.Reverse();
|
||||
|
||||
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_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#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_Ax1 anAx1(aP1, aDir);
|
||||
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);
|
||||
|
||||
//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_Ax1 anAx1 (aCP, aDir);
|
||||
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);
|
||||
//NPAL18620: performance problem: multiple locations are accumulated
|
||||
// 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);
|
||||
}
|
||||
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
|
||||
gp_Trsf aTrsfNew (aTrsfOrig);
|
||||
aTrsfNew.PreMultiply(aTrsf);
|
||||
@ -274,7 +273,7 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
|
||||
B.Add(aCompound, anOriginal.Located(aLocRes));
|
||||
}
|
||||
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
|
||||
gp_Trsf aTrsfNew (aTrsfOrig);
|
||||
aTrsfNew.PreMultiply(aTrsf1);
|
||||
|
@ -608,14 +608,14 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
|
||||
NewFpar = ElCLib::Parameter(PrevCircle, P1);
|
||||
NewLpar = ElCLib::Parameter(PrevCircle, P2);
|
||||
if (NewLpar < NewFpar)
|
||||
NewLpar += 2.*PI;
|
||||
NewLpar += 2.*M_PI;
|
||||
//Standard_Real MemNewFpar = NewFpar, MemNewLpar = NewLpar;
|
||||
if (ConnectByOrigin == TopAbs_FORWARD)
|
||||
ElCLib::AdjustPeriodic(FparSeq.Last(),
|
||||
FparSeq.Last() + 2.*PI,
|
||||
FparSeq.Last() + 2.*M_PI,
|
||||
Precision::PConfusion(), NewFpar, NewLpar);
|
||||
else
|
||||
ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*PI,
|
||||
ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*M_PI,
|
||||
FparSeq.Last(),
|
||||
Precision::PConfusion(), NewFpar, NewLpar);
|
||||
Done = Standard_True;
|
||||
@ -644,13 +644,13 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
|
||||
NewFpar = ElCLib::Parameter(PrevEllipse, P1);
|
||||
NewLpar = ElCLib::Parameter(PrevEllipse, P2);
|
||||
if (NewLpar < NewFpar)
|
||||
NewLpar += 2.*PI;
|
||||
NewLpar += 2.*M_PI;
|
||||
if (ConnectByOrigin == TopAbs_FORWARD)
|
||||
ElCLib::AdjustPeriodic(FparSeq.Last(),
|
||||
FparSeq.Last() + 2.*PI,
|
||||
FparSeq.Last() + 2.*M_PI,
|
||||
Precision::PConfusion(), NewFpar, NewLpar);
|
||||
else
|
||||
ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*PI,
|
||||
ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*M_PI,
|
||||
FparSeq.Last(),
|
||||
Precision::PConfusion(), NewFpar, NewLpar);
|
||||
Done = Standard_True;
|
||||
|
@ -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
|
||||
//
|
||||
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
// File : GenerationGUI_RevolDlg.cxx
|
||||
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||
//
|
||||
|
||||
#include "GenerationGUI_RevolDlg.h"
|
||||
|
||||
#include <DlgRef.h>
|
||||
@ -319,9 +318,11 @@ bool GenerationGUI_RevolDlg::execute (ObjectList& objects)
|
||||
|
||||
for (int i = 0; i < myBaseObjects.count(); i++) {
|
||||
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
|
||||
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 (!IsPreview()) {
|
||||
|
@ -349,7 +349,7 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
|
||||
aLabel.sprintf("%.1f", anAngle);
|
||||
|
||||
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()));
|
||||
Handle(Geom_Line) geom_lin1,geom_lin2;
|
||||
gp_Pnt ptat11,ptat12,ptat21,ptat22;
|
||||
|
@ -18,11 +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
|
||||
//
|
||||
|
||||
#ifndef _NMTDS_CArray1OfIndexRange_HeaderFile
|
||||
#define _NMTDS_CArray1OfIndexRange_HeaderFile
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#ifndef _Standard_Address_HeaderFile
|
||||
#include <Standard_Address.hxx>
|
||||
#endif
|
||||
@ -32,11 +33,11 @@
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_OutOfRange;
|
||||
class Standard_OutOfMemory;
|
||||
class NMTDS_IndexRange;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
@ -108,33 +109,25 @@ Standard_EXPORT NMTDS_IndexRange& ChangeValue(const Standard_Integer Index) ;
|
||||
return ChangeValue(Index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void SetBlockLength(const Standard_Integer aBL) ;
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer BlockLength() const;
|
||||
|
||||
|
||||
|
||||
|
||||
#if OCC_VERSION_LARGE > 0x06050200
|
||||
Standard_EXPORT void Purge();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
Standard_EXPORT NMTDS_CArray1OfIndexRange(const NMTDS_CArray1OfIndexRange& AnArray);
|
||||
|
||||
|
||||
@ -144,11 +137,8 @@ Standard_EXPORT NMTDS_CArray1OfIndexRange& Assign(const NMTDS_CArray1OfIndexRa
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const;
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_Address myStart;
|
||||
@ -156,16 +146,9 @@ Standard_Integer myLength;
|
||||
Standard_Integer myFactLength;
|
||||
Standard_Integer myBlockLength;
|
||||
Standard_Boolean myIsAllocated;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -18,11 +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
|
||||
//
|
||||
|
||||
#ifndef _NMTTools_CommonBlockPool_HeaderFile
|
||||
#define _NMTTools_CommonBlockPool_HeaderFile
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#ifndef _Standard_Address_HeaderFile
|
||||
#include <Standard_Address.hxx>
|
||||
#endif
|
||||
@ -32,11 +33,11 @@
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_OutOfRange;
|
||||
class Standard_OutOfMemory;
|
||||
class NMTTools_ListOfCommonBlock;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
@ -108,47 +109,35 @@ Standard_EXPORT NMTTools_ListOfCommonBlock& ChangeValue(const Standard_Integer
|
||||
return ChangeValue(Index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void SetBlockLength(const Standard_Integer aBL) ;
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer BlockLength() const;
|
||||
|
||||
|
||||
|
||||
|
||||
#if OCC_VERSION_LARGE > 0x06050200
|
||||
Standard_EXPORT void Purge();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
Standard_EXPORT NMTTools_CommonBlockPool(const NMTTools_CommonBlockPool& AnArray);
|
||||
|
||||
|
||||
Standard_EXPORT NMTTools_CommonBlockPool& Assign(const NMTTools_CommonBlockPool& Other) ;
|
||||
NMTTools_CommonBlockPool& operator =(const NMTTools_CommonBlockPool& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const;
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_Address myStart;
|
||||
@ -160,12 +149,7 @@ Standard_Boolean myIsAllocated;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1511,8 +1511,8 @@ void NMTTools_PaveFiller::CorrectTolR3D(const BOPTools_SSInterference& aFF,
|
||||
//
|
||||
aA=aDN[0].Angle(aDN[1]);
|
||||
aA=fabs(aA);
|
||||
if (aA>0.5*PI) {
|
||||
aA=PI-aA;
|
||||
if (aA > 0.5*M_PI) {
|
||||
aA = M_PI - aA;
|
||||
}
|
||||
//
|
||||
if (aA<aAmin || aA>aAmax) {
|
||||
|
@ -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
|
||||
//
|
||||
|
||||
// GEOM OBJECT : interactive object for Geometry entities visualization
|
||||
// File : GEOM_AISShape.cxx
|
||||
// Author : Nicolas REJNERI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
//
|
||||
|
||||
/*!
|
||||
\class GEOM_AISShape GEOM_AISShape.hxx
|
||||
\brief ....
|
||||
@ -254,7 +252,7 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
|
||||
else
|
||||
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.);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
//
|
||||
|
||||
// GEOM OBJECT : interactive object for Geometry entities visualization
|
||||
// File : GEOM_OCCReader.h
|
||||
// Author : Christophe ATTANASIO
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
//
|
||||
|
||||
#include "GEOM_OCCReader.h"
|
||||
|
||||
// VTK Includes
|
||||
@ -810,7 +808,7 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
|
||||
if (aDist < gp::Resolution()) return;
|
||||
gp_Dir aDirection (aDirVec);
|
||||
|
||||
Standard_Real anAngle = PI/180.*5.;
|
||||
Standard_Real anAngle = M_PI/180. * 5.;
|
||||
Standard_Real aLength = aDist/10.;
|
||||
|
||||
Standard_Real dx,dy,dz;
|
||||
@ -848,8 +846,8 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
|
||||
int NbPoints = 15;
|
||||
for (int i = 1; i <= NbPoints; i++, ptPrev = ptCur)
|
||||
{
|
||||
cosinus = cos(2. * PI / NbPoints * (i-1));
|
||||
sinus = sin(2. * PI / NbPoints * (i-1));
|
||||
cosinus = cos(2. * M_PI / NbPoints * (i-1));
|
||||
sinus = sin(2. * M_PI / NbPoints * (i-1));
|
||||
|
||||
gp_XYZ aP = aPc + (aDirI.XYZ() * cosinus + aDirJ.XYZ() * sinus) * aLength * Tg;
|
||||
coord[0] = aP.X();
|
||||
@ -1069,5 +1067,3 @@ const TopoDS_Shape& GEOM_OCCReader::getTopo() {
|
||||
int GEOM_OCCReader::getDisplayMode() {
|
||||
return amode;
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include "GEOM_EdgeSource.h"
|
||||
|
||||
@ -194,7 +193,7 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
|
||||
else
|
||||
aDirection = -aDirVec;
|
||||
|
||||
Standard_Real anAngle = PI/180.*5.;
|
||||
Standard_Real anAngle = M_PI/180.*5.;
|
||||
Standard_Real aLength = aDist/10.;
|
||||
|
||||
Standard_Real dx,dy,dz;
|
||||
@ -231,8 +230,8 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
|
||||
int NbPoints = 15;
|
||||
for (int i = 1; i <= NbPoints; i++, ptPrev = ptCur)
|
||||
{
|
||||
cosinus = cos(2. * PI / NbPoints * (i-1));
|
||||
sinus = sin(2. * PI / NbPoints * (i-1));
|
||||
cosinus = cos(2. * M_PI / NbPoints * (i-1));
|
||||
sinus = sin(2. * M_PI / NbPoints * (i-1));
|
||||
|
||||
gp_XYZ aP = aPc + (aDirI.XYZ() * cosinus + aDirJ.XYZ() * sinus) * aLength * Tg;
|
||||
coord[0] = aP.X();
|
||||
|
@ -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
|
||||
//
|
||||
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
// File : OperationGUI_ChamferDlg.cxx
|
||||
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
||||
//
|
||||
|
||||
#include "OperationGUI_ChamferDlg.h"
|
||||
#include <SalomeApp_DoubleSpinBox.h>
|
||||
|
||||
@ -839,7 +838,7 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
|
||||
else {
|
||||
anObj = anOper->MakeChamferEdgeAD(myShape,
|
||||
mySpinBox[ SpinBox23 ]->value(),
|
||||
mySpinBox[ SpinBox24 ]->value() * PI180,
|
||||
mySpinBox[ SpinBox24 ]->value() * M_PI / 180.,
|
||||
myFace[ Face1 ],
|
||||
myFace[ Face2 ]);
|
||||
if (!anObj->_is_nil())
|
||||
@ -871,7 +870,7 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
|
||||
else {
|
||||
anObj = anOper->MakeChamferFacesAD(myShape,
|
||||
mySpinBox[ SpinBox33 ]->value(),
|
||||
mySpinBox[ SpinBox34 ]->value() * PI180,
|
||||
mySpinBox[ SpinBox34 ]->value() * M_PI / 180.,
|
||||
anArray);
|
||||
if (!anObj->_is_nil())
|
||||
{
|
||||
@ -899,7 +898,7 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects)
|
||||
else {
|
||||
anObj = anOper->MakeChamferEdgesAD(myShape,
|
||||
mySpinBox[ SpinBox43 ]->value(),
|
||||
mySpinBox[ SpinBox44 ]->value() * PI180,
|
||||
mySpinBox[ SpinBox44 ]->value() * M_PI / 180.,
|
||||
anArray);
|
||||
if (!anObj->_is_nil())
|
||||
{
|
||||
|
@ -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
|
||||
//
|
||||
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
// File : RepairGUI_ShapeProcessDlg.cxx
|
||||
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||
//
|
||||
|
||||
#include "RepairGUI_ShapeProcessDlg.h"
|
||||
|
||||
#include <DlgRef.h>
|
||||
@ -450,7 +449,7 @@ void RepairGUI_ShapeProcessDlg::reset()
|
||||
const char* get_convert( const char* theParam, const QString& theValue )
|
||||
{
|
||||
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( 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 )
|
||||
{
|
||||
if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
|
||||
double doubleValue = atof( theValue ) * 180 / PI;
|
||||
double doubleValue = atof( theValue ) * 180. / M_PI;
|
||||
TCollection_AsciiString str( doubleValue );
|
||||
return CORBA::string_dup( str.ToCString() );
|
||||
}
|
||||
|
@ -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
|
||||
//
|
||||
|
||||
// GEOM SKETCHER : basic sketcher
|
||||
// File : Sketcher_Profile.cxx
|
||||
// Author : Damien COQUERET
|
||||
// Module : GEOM
|
||||
// $Header:
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <Sketcher_Profile.hxx>
|
||||
@ -209,7 +207,7 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
|
||||
case 'R':
|
||||
{
|
||||
if (n1 != 2) goto badargs;
|
||||
angle = a(1).RealValue() * PI180;
|
||||
angle = a(1).RealValue() * M_PI / 180.;
|
||||
if (a(0) == "RR") {
|
||||
dx = Cos(angle);
|
||||
dy = Sin(angle);
|
||||
@ -242,7 +240,7 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
|
||||
if (n1 != 3) goto badargs;
|
||||
radius = a(1).RealValue();
|
||||
if (Abs(radius) > Precision::Confusion()) {
|
||||
angle = a(2).RealValue() * PI180;
|
||||
angle = a(2).RealValue() * M_PI / 180.;
|
||||
move = circle;
|
||||
}
|
||||
else
|
||||
@ -260,10 +258,11 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
|
||||
}
|
||||
Standard_Real det = dx * vy - dy * vx;
|
||||
if ( Abs(det) > Precision::Confusion()) {
|
||||
Standard_Real c = (dx * vx + dy * vy)
|
||||
/ Sqrt((dx * dx + dy * dy) * (vx * vx + vy * vy)); // Cosine of alpha = arc of angle / 2 , alpha in [0,Pi]
|
||||
radius = (vx * vx + vy * vy)* Sqrt(dx * dx + dy * dy) // radius = distance between start and end point / 2 * sin(alpha)
|
||||
/ (2.0 * det); // radius is > 0 or < 0
|
||||
// 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 = distance between start and end point / 2 * sin(alpha)
|
||||
// radius is > 0 or < 0
|
||||
radius = (vx * vx + vy * vy)* Sqrt(dx * dx + dy * dy) / (2.0 * det);
|
||||
if (Abs(radius) > Precision::Confusion()) {
|
||||
angle = 2.0 * acos(c); // angle in [0,2Pi]
|
||||
move = circle;
|
||||
@ -289,10 +288,11 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
|
||||
}
|
||||
Standard_Real length = Sqrt(vx * vx + vy * vy);
|
||||
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]
|
||||
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 )
|
||||
angle = angle - 2 * PI;
|
||||
angle = angle - 2 * M_PI;
|
||||
dx = 0.5 * ( vy * 1.0/radius
|
||||
+ vx * Sqrt(4.0 / (vx * vx + vy * vy) - 1.0 / (radius * radius)));
|
||||
dy = - 0.5 * ( vx * 1.0/radius
|
||||
@ -339,7 +339,7 @@ Sketcher_Profile::Sketcher_Profile(const char* aCmd)
|
||||
/ ( radius * Sqrt((vx-vxc) * (vx-vxc) + (vy-vyc) * (vy-vyc)) ) ; // Cosine of arc angle
|
||||
angle = acos(c); // angle in [0,Pi]
|
||||
if ( reversed == 2 )
|
||||
angle = angle - 2 * PI;
|
||||
angle = angle - 2 * M_PI;
|
||||
if (det < 0)
|
||||
angle = -angle;
|
||||
dx = vyc / radius;
|
||||
|
@ -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
|
||||
//
|
||||
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
// File : TransformationGUI_RotationDlg.cxx
|
||||
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||
//
|
||||
|
||||
#include "TransformationGUI_RotationDlg.h"
|
||||
|
||||
#include <DlgRef.h>
|
||||
@ -494,7 +493,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
|
||||
if (toCreateCopy) {
|
||||
for (int i = 0; i < myObjects.count(); 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(!IsPreview()) {
|
||||
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||
@ -506,7 +505,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
|
||||
else {
|
||||
for (int i = 0; i < myObjects.count(); 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(!IsPreview()) {
|
||||
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||
|
Loading…
Reference in New Issue
Block a user