// 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 "SMESH_ControlsDef.hxx"
aMin = Min(aMin,A0);
}
- return aMin * 180.0 / PI;
+ return aMin * 180.0 / M_PI;
}
double MinimumAngle::GetBadRate( double Value, int nbNodes ) const
gp_XYZ N = GI.Crossed( GJ );
if ( N.Modulus() < gp::Resolution() )
- return PI / 2;
+ return M_PI / 2;
N.Normalize();
double H = ( thePnt2 - theG ).Dot( N );
- return asin( fabs( H / L ) ) * 180. / PI;
+ return asin( fabs( H / L ) ) * 180. / M_PI;
}
double Warping::GetBadRate( double Value, int /*nbNodes*/ ) const
return 0.;
// Compute skew
- static double PI2 = PI / 2.;
+ static double PI2 = M_PI / 2.;
if ( P.size() == 3 )
{
double A0 = fabs( PI2 - skewAngle( P( 3 ), P( 1 ), P( 2 ) ) );
double A1 = fabs( PI2 - skewAngle( P( 1 ), P( 2 ), P( 3 ) ) );
double A2 = fabs( PI2 - skewAngle( P( 2 ), P( 3 ), P( 1 ) ) );
- return Max( A0, Max( A1, A2 ) ) * 180. / PI;
+ return Max( A0, Max( A1, A2 ) ) * 180. / M_PI;
}
else
{
if ( A < Precision::Angular() )
return 0.;
- return A * 180. / PI;
+ return A * 180. / M_PI;
}
}
if (!normOK)
return false;
- const double radianTol = myToler * PI180;
+ const double radianTol = myToler * M_PI / 180.;
typedef SMDS_StdIterator< const SMDS_MeshElement*, SMDS_ElemIteratorPtr > TFaceIt;
std::set<const SMDS_MeshElement*> checkedFaces, checkedNodes;
std::list<const SMDS_MeshElement*> faceQueue( 1, face );
const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2)
{
- double angle = 2*PI; // bad angle
+ double angle = 2. * M_PI; // bad angle
// get normals
SMESH::Controls::TSequenceOfXYZ P1, P2;
continue;
gp_Vec dirInF = gp_Vec( fNorm ) ^ n1n2;
double angle = dirInOF.AngleWithRef( dirInF, n1n2 );
- if ( angle < 0 ) angle += 2*PI;
+ if ( angle < 0 ) angle += 2. * M_PI;
angle2Face.insert( make_pair( angle, *face ));
}
if ( !angle2Face.empty() )
maxLen2 = Max( maxLen2, ( n[1]->myUV - n[2]->myUV ).SquareModulus() );
}
maxLen2 = Max( maxLen2, ( n[2]->myUV - node->myUV ).SquareModulus() );
- minDiag = sqrt( maxLen2 ) * PI / 60.; // ~ maxLen * Sin( 3 deg )
+ minDiag = sqrt( maxLen2 ) * M_PI / 60.; // ~ maxLen * Sin( 3 deg )
}
// check if newUV is behind 3 dirs: n[0]-n[1], n[1]-n[2] and n[0]-n[2]
double initAngle = initTgt1.Angle( initTgt2 );
double angle = node->myDir[0].Angle( node->myDir[1] );
if ( reversed ) angle = -angle;
- if ( initAngle > angle && initAngle - angle > PI / 2.1 ) {
+ if ( initAngle > angle && initAngle - angle > M_PI / 2.1 ) {
// find a close internal node
TIsoNode* nClose = 0;
list< TIsoNode* > testNodes;
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_ExtrusionAlongPathDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S.
// SMESH includes
-//
+
#include "SMESHGUI_ExtrusionAlongPathDlg.h"
#include "SMESHGUI.h"
int j = 0;
for (int i = 0; i < myAnglesList.count(); i++) {
double angle = myAnglesList[i];
- anAngles[ j++ ] = angle*PI/180;
+ anAngles[ j++ ] = angle*M_PI/180.;
}
anAngles->length(j);
}
// 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 : SMESHGUI_MultiEditDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
// SMESH includes
-//
+
#include "SMESHGUI_MultiEditDlg.h"
#include "SMESHGUI.h"
SMESH::SMESH_IDSource_ptr obj)
{
SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
- double aMaxAngle = myMaxAngleSpin->GetValue() * PI / 180.0;
+ double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0;
bool ok;
if ( CORBA::is_nil( obj ))
ok = theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_RevolutionDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
// SMESH includes
-//
+
#include "SMESHGUI_RevolutionDlg.h"
#include "SMESHGUI.h"
anAxis.vy = SpinBox_DY->GetValue();
anAxis.vz = SpinBox_DZ->GetValue();
- double anAngle = (SpinBox_Angle->GetValue())*PI/180;
+ double anAngle = (SpinBox_Angle->GetValue())*M_PI/180.;
long aNbSteps = (long)SpinBox_NbSteps->value();
double aTolerance = SpinBox_Tolerance->GetValue();
anAxis.vx = SpinBox_DX->GetValue();
anAxis.vy = SpinBox_DY->GetValue();
anAxis.vz = SpinBox_DZ->GetValue();
-
- double anAngle = (SpinBox_Angle->GetValue())*PI/180;
+
+ double anAngle = (SpinBox_Angle->GetValue())*M_PI/180.;
long aNbSteps = (long)SpinBox_NbSteps->value();
double aTolerance = SpinBox_Tolerance->GetValue();
anAxis.vy = SpinBox_DY->GetValue();
anAxis.vz = SpinBox_DZ->GetValue();
- double anAngle = (SpinBox_Angle->GetValue())*PI/180;
+ double anAngle = (SpinBox_Angle->GetValue())*M_PI/180.;
QStringList aParameters;
aParameters << SpinBox_X->text();
anAxis.vx = SpinBox_DX->GetValue();
anAxis.vy = SpinBox_DY->GetValue();
anAxis.vz = SpinBox_DZ->GetValue();
- double anAngle = (SpinBox_Angle->GetValue())*PI/180;
+ double anAngle = (SpinBox_Angle->GetValue())*M_PI/180.;
try {
SUIT_OverrideCursor aWaitCursor;
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_AutomaticLength.cxx
// Author : Edward AGAPOV, OCC
// Module : SMESH
-//
+
#include "StdMeshers_AutomaticLength.hxx"
#include "SMESH_Mesh.hxx"
*/
//================================================================================
- const double a14divPI = 14. / PI;
+ const double a14divPI = 14. / M_PI;
inline double segLength(double S0, double edgeLen, double minLen )
{
// return true;
}
-
-
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_CompositeHexa_3D.cxx
// Module : SMESH
// Created : Tue Nov 25 11:04:59 2008
// Author : Edward AGAPOV (eap)
-//
+
#include "StdMeshers_CompositeHexa_3D.hxx"
#include "SMDS_Mesh.hxx"
int iMyCommon;
if ( mySides.Contain( otherSide, &iMyCommon ) ) {
// check if normals of two faces are collinear at all vertices of a otherSide
- const double angleTol = PI / 180 / 2;
+ const double angleTol = M_PI / 180. / 2.;
int iV, nbV = otherSide.NbVertices(), nbCollinear = 0;
for ( iV = 0; iV < nbV; ++iV )
{
// 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 : StdMeshers_HexaFromSkin_3D.cxx
// Created : Wed Jan 27 12:28:07 2010
// Author : Edward AGAPOV (eap)
-//
+
#include "StdMeshers_HexaFromSkin_3D.hxx"
#include "SMDS_VolumeOfNodes.hxx"
// compute angle of (sideIDir projection to pln) and (X dir of pln)
gp_Vec2d sideIDirProj( sideIDir * pln.XDirection(), sideIDir * pln.YDirection());
double angle = sideIDirProj.Angle( gp::DX2d() );
- if ( angle < 0 ) angle += 2 * PI; // angle [0-2*PI]
+ if ( angle < 0 ) angle += 2. * M_PI; // angle [0-2*PI]
angleOfSide.insert( make_pair( angle, sideI ));
_DUMP_(" "<< sideI << " - side dir ("
<< sideIDir.X() << ", " << sideIDir.Y() << ", " << sideIDir.Z() << ")"
if ( nbLoadedSides == 1 )
{
double angF = angleOfSide.begin()->first, angL = angleOfSide.rbegin()->first;
- if ( angF > PI ) angF = 2*PI - angF;
- if ( angL > PI ) angL = 2*PI - angL;
+ if ( angF > M_PI ) angF = 2.*M_PI - angF;
+ if ( angL > M_PI ) angL = 2.*M_PI - angL;
foundSide = angF < angL ? angleOfSide.begin()->second : angleOfSide.rbegin()->second;
}
else
{
return error("Algorithm can't work with geometrical shapes");
}
-
// 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 : StdMeshers_QuadToTriaAdaptor.cxx
// Module : SMESH
// Created : Wen May 07 16:37:07 2008
// Author : Sergey KUUL (skl)
-//
+
#include "StdMeshers_QuadToTriaAdaptor.hxx"
#include "SMDS_SetIterator.hxx"
// Check angle between normals
double angle = nI.Angle( nJ );
- bool tooClose = ( angle < 15 * PI180 );
+ bool tooClose = ( angle < 15. * M_PI / 180. );
// Check if pyramids collide
if ( !tooClose && baI * baJ > 0 )
gp_Vec VI2(PCj,Pint);
double ang1 = fabs(VN1.Angle(VI1));
double ang2 = fabs(VN2.Angle(VI2));
- double coef1 = 0.5 - (( ang1<PI/3 ) ? cos(ang1)*0.25 : 0 );
- double coef2 = 0.5 - (( ang2<PI/3 ) ? cos(ang2)*0.25 : 0 ); // cos(ang2) ?
+ double coef1 = 0.5 - (( ang1 < M_PI/3. ) ? cos(ang1)*0.25 : 0 );
+ double coef2 = 0.5 - (( ang2 < M_PI/3. ) ? cos(ang2)*0.25 : 0 ); // cos(ang2) ?
// double coef2 = 0.5;
// if(ang2<PI/3)
// coef2 -= cos(ang1)*0.25;
return true;
}
-
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_RadialQuadrangle_1D2D.cxx
// Module : SMESH
// Created : Fri Oct 20 11:37:07 2006
// Author : Edward AGAPOV (eap)
-//
+
#include "StdMeshers_RadialQuadrangle_1D2D.hxx"
#include "StdMeshers_NumberOfLayers.hxx"
for(; itn != theNodes.end(); itn++ ) {
CNodes.push_back( (*itn).second );
double ang = (*itn).first - fang;
- if( ang>PI ) ang = ang - 2*PI;
- if( ang<-PI ) ang = ang + 2*PI;
+ if( ang>M_PI ) ang = ang - 2.*M_PI;
+ if( ang<-M_PI ) ang = ang + 2.*M_PI;
Angles.Append( ang );
}
}
// a segment of line
double fp, lp;
Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge, &fp, &lp ));
- if( fabs(fabs(lp-fp)-PI) > Precision::Confusion() ) {
+ if( fabs(fabs(lp-fp)-M_PI) > Precision::Confusion() ) {
// not half of circle
return error(COMPERR_BAD_SHAPE);
}
for(; itn != theNodes.end(); itn++ ) {
CNodes.push_back( (*itn).second );
double ang = (*itn).first - fang;
- if( ang>PI ) ang = ang - 2*PI;
- if( ang<-PI ) ang = ang + 2*PI;
+ if( ang>M_PI ) ang = ang - 2.*M_PI;
+ if( ang<-M_PI ) ang = ang + 2.*M_PI;
Angles.Append( ang );
}
const SMDS_MeshNode* NF = theNodes.begin()->second;
for(; itn != theNodes.end(); itn++ ) {
CNodes.push_back( (*itn).second );
double ang = (*itn).first - fang;
- if( ang>PI ) ang = ang - 2*PI;
- if( ang<-PI ) ang = ang + 2*PI;
+ if( ang>M_PI ) ang = ang - 2.*M_PI;
+ if( ang<-M_PI ) ang = ang + 2.*M_PI;
Angles.Append( ang );
}
P1 = gp_Pnt( NF->X(), NF->Y(), NF->Z() );
// a segment of line
double fp, lp;
Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge, &fp, &lp ));
- if( fabs(fabs(lp-fp)-PI) > Precision::Confusion() ) {
+ if( fabs(fabs(lp-fp)-M_PI) > Precision::Confusion() ) {
// not half of circle
return error(COMPERR_BAD_SHAPE);
}
return false;
}
-
// 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 : StdMeshers_ViscousLayers.cxx
// Created : Wed Dec 1 15:15:34 2010
gp_Vec2d vec1( center, uv1 );
double uLast = vec0.Angle( vec1 ); // -PI - +PI
double uMidl = vec0.Angle( vecM );
- if ( uLast < 0 ) uLast += 2*PI; // 0.0 - 2*PI
- if ( uMidl < 0 ) uMidl += 2*PI;
+ if ( uLast < 0 ) uLast += 2.*M_PI; // 0.0 - 2*PI
+ if ( uMidl < 0 ) uMidl += 2.*M_PI;
const bool sense = ( uMidl < uLast );
const double radius = 0.5 * ( vec0.Magnitude() + vec1.Magnitude() );