gp_Lin LengthLine( myPosition, DirOfArrow1 );
Standard_Real Par1 = ElCLib::Parameter( LengthLine, EndOfArrow1 );
Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
- if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
+ if ((Par1 > 0.0 && Par2 > 0.0) || (Par1 < 0.0 && Par2 < 0.0))
{
FirstPoint = myPosition;
LastPoint = (Abs( Par1 ) > Abs( Par2 ))? EndOfArrow1 : EndOfArrow2;
j1cibl = Sqrt(myCriterium[0] / (NbrPnt - NbrConstraint));
vseuil = Sqrt(vocri[1]) + (erold - myMaxError) * 4;
-// if(CNew->NbElements() == TheCurve->NbElements())
- lrejet = myMaxError > WQuality && myMaxError > erold * 1.01
- || Sqrt(myCriterium[1]) > vseuil * 1.05;
-// else
-// lrejet = myMaxError > WQuality && myMaxError > erold * 1.05
-// || Sqrt(myCriterium[1]) > vseuil * 1.01;
+ lrejet = ((myMaxError > WQuality) && (myMaxError > erold * 1.01)) || (Sqrt(myCriterium[1]) > vseuil * 1.05);
if (lrejet) {
myCriterium[0] = vocri[0];
/* (7) Test de convergence */
- if (iter >= mxiter && myMaxSegment == CNew->NbElements() || myMaxError < WQuality) {
+ if (((iter >= mxiter) && (myMaxSegment == CNew->NbElements())) || myMaxError < WQuality) {
loptim = Standard_False;
}
const BOPDS_InterfEF& aEF = aEFs(i);
nE = aEF.Index1();
nFOpposite = aEF.Index2();
- if(aMIF1.Contains(nE) && aMIF2.Contains(nFOpposite) ||
- aMIF1.Contains(nFOpposite) && aMIF2.Contains(nE)) {
+ if((aMIF1.Contains(nE) && aMIF2.Contains(nFOpposite)) ||
+ (aMIF1.Contains(nFOpposite) && aMIF2.Contains(nE))) {
//
IntTools_CommonPrt aCP = aEF.CommonPart();
if(aCP.Type() == TopAbs_VERTEX) {
const BOPDS_InterfVV& aVV = aVVs(i);
nV1 = aVV.Index1();
nV2 = aVV.Index2();
- if(aMIF1.Contains(nV1) && aMIF2.Contains(nV2) ||
- aMIF1.Contains(nV2) && aMIF2.Contains(nV1)) {
+ if((aMIF1.Contains(nV1) && aMIF2.Contains(nV2)) ||
+ (aMIF1.Contains(nV2) && aMIF2.Contains(nV1))) {
if (aVV.HasIndexNew()) {
nVNew = aVV.IndexNew();
aMVStick.Add(nVNew);
const BOPDS_InterfVE& aVE = aVEs(i);
nV = aVE.Index1();
nE = aVE.Index2();
- if(aMIF1.Contains(nV) && aMIF2.Contains(nE) ||
- aMIF1.Contains(nE) && aMIF2.Contains(nV)) {
+ if((aMIF1.Contains(nV) && aMIF2.Contains(nE)) ||
+ (aMIF1.Contains(nE) && aMIF2.Contains(nV))) {
aMVStick.Add(nV);
}
}
const BOPDS_InterfEE& aEE = aEEs(i);
nE1 = aEE.Index1();
nE2 = aEE.Index2();
- if(aMIF1.Contains(nE1) && aMIF2.Contains(nE2) ||
- aMIF1.Contains(nE2) && aMIF2.Contains(nE1)) {
+ if((aMIF1.Contains(nE1) && aMIF2.Contains(nE2)) ||
+ (aMIF1.Contains(nE2) && aMIF2.Contains(nE1))) {
IntTools_CommonPrt aCP = aEE.CommonPart();
if(aCP.Type() == TopAbs_VERTEX) {
nVNew = aEE.IndexNew();
const BOPDS_InterfVF& aVF = aVFs(i);
nV = aVF.Index1();
nF = aVF.Index2();
- if(aMIF1.Contains(nV) && aMIF2.Contains(nF) ||
- aMIF1.Contains(nF) && aMIF2.Contains(nV)) {
+ if((aMIF1.Contains(nV) && aMIF2.Contains(nF)) ||
+ (aMIF1.Contains(nF) && aMIF2.Contains(nV))) {
aMVStick.Add(nV);
}
}
const BOPDS_InterfEF& aEF = aEFs(i);
nE = aEF.Index1();
nF = aEF.Index2();
- if(aMIF1.Contains(nE) && aMIF2.Contains(nF) ||
- aMIF1.Contains(nF) && aMIF2.Contains(nE)) {
+ if((aMIF1.Contains(nE) && aMIF2.Contains(nF)) ||
+ (aMIF1.Contains(nF) && aMIF2.Contains(nE))) {
IntTools_CommonPrt aCP = aEF.CommonPart();
if(aCP.Type() == TopAbs_VERTEX) {
nVNew = aEF.IndexNew();
Standard_Real TolInit= 1.e-9;
Standard_Integer nn = 7;
- if(AC1.GetType() != GeomAbs_Circle &&
- AC1.GetType() != GeomAbs_Line ||
- AC2.GetType() != GeomAbs_Circle &&
- AC2.GetType() != GeomAbs_Line ) {
+ if((AC1.GetType() != GeomAbs_Circle && AC1.GetType() != GeomAbs_Line) ||
+ (AC2.GetType() != GeomAbs_Circle && AC2.GetType() != GeomAbs_Line)) {
TolInit = 1.e-8;
nn = 6;
//static Standard_Real weakness = 5.0;
Standard_Real weakness = 5.0;
//XXf
- if(dfDist <= myTolerance || dfDist < myTolerance*weakness && Tol<0) {
+ if(dfDist <= myTolerance || (dfDist < myTolerance*weakness && Tol<0)) {
//XXf
//myTolReached = dfDist;
//XXt
TopExp::Vertices( E1, V11, V12 );
TopExp::Vertices( E2, V21, V22 );
- if (V11.IsSame(V21) && V12.IsSame(V22) ||
- V11.IsSame(V22) && V12.IsSame(V21))
+ if ((V11.IsSame(V21) && V12.IsSame(V22)) ||
+ (V11.IsSame(V22) && V12.IsSame(V21)))
return Standard_True;
return Standard_False;
if (V1onBound && V2onBound)
{
- if (TangFirst.IsParallel(RefTangFirst,AngTol) && TangLast.IsParallel(RefTangLast,AngTol) ||
- TangFirst.IsParallel(RefTangLast,AngTol) && TangLast.IsParallel(RefTangFirst,AngTol))
- {
- TrueEdges.Add( Edges(i) );
- return Standard_True;
- }
+ if ((TangFirst.IsParallel(RefTangFirst,AngTol) && TangLast.IsParallel(RefTangLast,AngTol)) ||
+ (TangFirst.IsParallel(RefTangLast,AngTol) && TangLast.IsParallel(RefTangFirst,AngTol)))
+ {
+ TrueEdges.Add( Edges(i) );
+ return Standard_True;
+ }
else
- return Standard_False;
+ return Standard_False;
}
//StartEonF1 = (V1onBound)? VEmapF1( V1 ) : VEmapF1( V2 );
{
anEdge = TopoDS::Edge(itl.Value());
TopExp::Vertices(anEdge, V1, V2);
- if ((V1.IsSame(PrevVertex) && V2.IsSame(CurVertex) ||
- V1.IsSame(CurVertex) && V2.IsSame(PrevVertex)) &&
+ if (((V1.IsSame(PrevVertex) && V2.IsSame(CurVertex)) ||
+ (V1.IsSame(CurVertex) && V2.IsSame(PrevVertex))) &&
!anEdge.IsSame(E1))
{
ProperEdge = anEdge;
}
gp_Dir aDir1 = gp_Vec(aCirc.Location(), Pnt1);
gp_Dir aDir2 = gp_Vec(aCirc.Location(), Pnt2);
- if (!(aDir1.IsEqual(theDir1, AngTol) && aDir2.IsEqual(theDir2, AngTol) ||
- aDir1.IsEqual(theDir2, AngTol) && aDir2.IsEqual(theDir1, AngTol)))
+ if (!((aDir1.IsEqual(theDir1, AngTol) && aDir2.IsEqual(theDir2, AngTol)) ||
+ (aDir1.IsEqual(theDir2, AngTol) && aDir2.IsEqual(theDir1, AngTol))))
{
SimilarArcs = Standard_False;
break;
Standard_Boolean onlyClosed = Standard_False;
Standard_Real eps = 1.0;
Standard_Boolean witheps = Standard_False;
- if(n > 2 && *a[2]=='c' || n > 3 && *a[3]=='c') onlyClosed = Standard_True;
+ if((n > 2 && *a[2]=='c') || (n > 3 && *a[3]=='c')) onlyClosed = Standard_True;
if(n > 2 && *a[2]!='c' && n != 5) {eps = Draw::Atof (a[2]); witheps = Standard_True;}
if (witheps){
Status = aClassifier.State();
}
- if (!RecadreOnPeriodic || !IsUPer && !IsVPer)
+ if (!RecadreOnPeriodic || (!IsUPer && !IsVPer))
return Status;
if (Status == TopAbs_IN || Status == TopAbs_ON)
return Status;
Status = aClassifier.State();
}
- if (!RecadreOnPeriodic || !IsUPer && !IsVPer)
+ if (!RecadreOnPeriodic || (!IsUPer && !IsVPer))
return Status;
if (Status == TopAbs_IN || Status == TopAbs_ON)
return Status;
if (sens < 0.) {
Ext1 = line->StartPointOnFirst();
Ext2 = line->StartPointOnSecond();
- if (OnS1 && Ext1.NbPointOnRst() == 0 ||
- !OnS1 && Ext2.NbPointOnRst() == 0) {
+ if ((OnS1 && Ext1.NbPointOnRst() == 0) ||
+ (!OnS1 && Ext2.NbPointOnRst() == 0)) {
return Standard_False;
}
previousP = line->Point(1);
else {
Ext1 = line->EndPointOnFirst();
Ext2 = line->EndPointOnSecond();
- if (OnS1 && Ext1.NbPointOnRst() == 0 ||
- !OnS1 && Ext2.NbPointOnRst() == 0) {
+ if ((OnS1 && Ext1.NbPointOnRst() == 0) ||
+ (!OnS1 && Ext2.NbPointOnRst() == 0)) {
return Standard_False;
}
previousP = line->Point(line->NbPoints());
Standard_Integer newlength = line->NbPoints();
if (sens <0.) {
- if (OnS1 && line->StartPointOnSecond().NbPointOnRst() == 0 ||
- !OnS1 && line->StartPointOnFirst().NbPointOnRst() == 0) {
+ if ((OnS1 && line->StartPointOnSecond().NbPointOnRst() == 0) ||
+ (!OnS1 && line->StartPointOnFirst().NbPointOnRst() == 0)) {
line->Remove(1,newlength-length);
line->SetStartPoints(Ext1,Ext2);
return Standard_False;
}
}
else {
- if (OnS1 && line->EndPointOnSecond().NbPointOnRst() == 0 ||
- !OnS1 && line->EndPointOnFirst().NbPointOnRst() == 0) {
+ if ((OnS1 && line->EndPointOnSecond().NbPointOnRst() == 0) ||
+ (!OnS1 && line->EndPointOnFirst().NbPointOnRst() == 0)) {
line->Remove(length,newlength);
line->SetEndPoints(Ext1,Ext2);
return Standard_False;
//=======================================================================
-//function : IsOut
+//function : IsSegmentOut
//purpose :
//=======================================================================
Standard_Real ysmax = Max (ys1, ys2);
if (ysmax-ysmin < eps && (y1-ys1 < eps && ys1-y2 < eps) &&
- (xsmin-x1 < eps && x1-xsmax < eps || xsmin-x2 < eps && x2-xsmax < eps ||
- x1-xs1 < eps && xs1-x2 < eps))
+ ((xsmin-x1 < eps && x1-xsmax < eps) ||
+ (xsmin-x2 < eps && x2-xsmax < eps) ||
+ (x1-xs1 < eps && xs1-x2 < eps)))
return Standard_False;
if (xsmax-xsmin < eps && (x1-xs1 < eps && xs1-x2 < eps) &&
- (ysmin-y1 < eps && y1-ysmax < eps || ysmin-y2 < eps && y2-ysmax < eps ||
- y1-ys1 < eps && ys1-y2 < eps))
+ ((ysmin-y1 < eps && y1-ysmax < eps) ||
+ (ysmin-y2 < eps && y2-ysmax < eps) ||
+ (y1-ys1 < eps && ys1-y2 < eps)))
return Standard_False;
if ((xs1 < x1 && xs2 < x1) || (xs1 > x2 && xs2 > x2) ||
if (U1 > Vv1 && U1 > 2.*M_PI) {
ElCLib::AdjustPeriodic(0.,2.*M_PI,Precision::Confusion(),U1,Vv1);
} // if (U1 ...
- if (O1 == TopAbs_FORWARD && OE1 == TopAbs_FORWARD ||
- O1 == TopAbs_REVERSED && OE1 == TopAbs_REVERSED ) {
+ if ( (O1 == TopAbs_FORWARD && OE1 == TopAbs_FORWARD) ||
+ (O1 == TopAbs_REVERSED && OE1 == TopAbs_REVERSED) ) {
filletEdge = BRepLib_MakeEdge(circle, refSurf,
NewExtr1, NewExtr2, U1, Vv1);
} // if (O1 == ...
} // else ...
if (!Sense) {
TopAbs_Orientation S1 = filletEdge.Orientation();
- if (O1 == TopAbs_FORWARD && OE1 == TopAbs_FORWARD ||
- O1 == TopAbs_REVERSED && OE1 == TopAbs_REVERSED ) {
+ if ((O1 == TopAbs_FORWARD && OE1 == TopAbs_FORWARD) ||
+ (O1 == TopAbs_REVERSED && OE1 == TopAbs_REVERSED) ) {
filletEdge = BRepLib_MakeEdge(circle, refSurf,
NewExtr2, NewExtr1, Vv1, U1);
}
TopoDS_Face F2 = BS2->ChangeSurface().Face();
const ChFiDS_CommonPoint& cp1 = SD->Vertex(isfirst,1);
const ChFiDS_CommonPoint& cp2 = SD->Vertex(isfirst,2);
- if(!(cp1.IsOnArc() && SearchFace(Spine,cp1,F1,FBID) ||
- cp2.IsOnArc() && SearchFace(Spine,cp2,F2,FBID))) {
- tron = ChFi3d_KParticular(Spine,ivois,BS1->ChangeSurface(),BS2->ChangeSurface());
+ if(!((cp1.IsOnArc() && SearchFace(Spine,cp1,F1,FBID)) ||
+ (cp2.IsOnArc() && SearchFace(Spine,cp2,F2,FBID)))) {
+ tron = ChFi3d_KParticular(Spine,ivois,BS1->ChangeSurface(),BS2->ChangeSurface());
}
}
}
rad = parandrad(i).Y();
Standard_Real nextpar = parandrad(i+1).X();
if (Abs( Uf-par ) <= gp::Resolution() ||
- par < Uf && Uf < nextpar && nextpar-Uf > gp::Resolution())
- {
- StartRad = rad;
- break;
- }
+ (par < Uf && Uf < nextpar && nextpar-Uf > gp::Resolution()))
+ {
+ StartRad = rad;
+ break;
+ }
}
for (i++; i <= parandrad.Length(); i++)
{
rad = parandrad(i).Y();
Standard_Real nextpar = parandrad(i+1).X();
if (Abs( Uf-par ) <= gp::Resolution() ||
- par < Uf && Uf < nextpar && nextpar-Uf > gp::Resolution())
- {
- StartRad = rad;
- break;
- }
+ (par < Uf && Uf < nextpar && nextpar-Uf > gp::Resolution()))
+ {
+ StartRad = rad;
+ break;
+ }
}
for (i++; i <= parandrad.Length(); i++)
{
LocTrans = TopAbs_EXTERNAL; // et pourquoi pas INTERNAL
}
else {
- if ((test > 0.)&& arcorien == TopAbs_FORWARD ||
- (test < 0.)&& arcorien == TopAbs_REVERSED){
+ if ((test > 0. && arcorien == TopAbs_FORWARD) ||
+ (test < 0. && arcorien == TopAbs_REVERSED)){
LocTrans = TopAbs_FORWARD;
}
else {
LocTrans = TopAbs_EXTERNAL; // et pourquoi pas INTERNAL
}
else {
- if ((test > 0.)&& arcorien == TopAbs_FORWARD ||
- (test < 0.)&& arcorien == TopAbs_REVERSED){
+ if ((test > 0. && arcorien == TopAbs_FORWARD) ||
+ (test < 0. && arcorien == TopAbs_REVERSED)){
LocTrans = TopAbs_FORWARD;
}
else {
Standard_Real Par1 = ElCLib::Parameter( LengthLine, EndOfArrow1 );
Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
gp_Pnt FirstPoint, LastPoint;
- if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
+ if ((Par1 > 0.0 && Par2 > 0.0) || (Par1 < 0.0 && Par2 < 0.0))
{
FirstPoint = OffsetPoint;
LastPoint = (Abs( Par1 ) > Abs( Par2 ))? EndOfArrow1 : EndOfArrow2;
Standard_Real Par1 = ElCLib::Parameter( LengthLine, AttachmentPoint1 );
Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
gp_Pnt FirstPoint, LastPoint;
- if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
+ if ((Par1 > 0.0 && Par2 > 0.0) || (Par1 < 0.0 && Par2 < 0.0))
{
FirstPoint = OffsetPoint;
LastPoint = (Abs( Par1 ) > Abs( Par2 ))? AttachmentPoint1 : EndOfArrow2;
pt = lProps.Value();
dir = lProps.Normal();
}
- if ((shape.Orientation() == TopAbs_FORWARD) && (mode == 1) ||
- (shape.Orientation() == TopAbs_REVERSED) && (mode == 0)) {
+ if (((shape.Orientation() == TopAbs_FORWARD) && (mode == 1)) ||
+ ((shape.Orientation() == TopAbs_REVERSED) && (mode == 0))) {
dir.Reverse();
}
return Standard_True;
CSLib_NormalStatus NStatus;
CSLib::Normal (D1U, D1V, MagTol, NStatus, Normal);
- if ((NStatus == CSLib_Defined)) // akm - only in singularities && !AlongU && !AlongV)
+ if (NStatus == CSLib_Defined) // akm - only in singularities && !AlongU && !AlongV)
{
P.SetXYZ(P.XYZ() + offsetValue * Normal.XYZ());
}
// trim the curve if necassary.
if (! C2D.IsNull() &&
- (HC.FirstParameter() != C2D->FirstParameter()) ||
- (HC.LastParameter() != C2D->LastParameter())) {
+ ((HC.FirstParameter() != C2D->FirstParameter()) ||
+ (HC.LastParameter() != C2D->LastParameter()))) {
C2D = new Geom2d_TrimmedCurve
(C2D,HC.FirstParameter(),HC.LastParameter());
}
// trim the curve if necassary.
- if (! C.IsNull() &&
- (HC.FirstParameter() != C->FirstParameter()) ||
+ if ((! C.IsNull() &&
+ (HC.FirstParameter() != C->FirstParameter())) ||
(HC.LastParameter() != C->LastParameter())) {
C = new Geom_TrimmedCurve(C,HC.FirstParameter(),HC.LastParameter());
(stdvar->Value(5) == '3' && stdvar->Value(6) > '1'))&&(stdvar->Length() == 13)) ach->SendFail(Msg57);
else if ((stdvar->Value(7) != '.' || stdvar->Value(10) > '5' || stdvar->Value(12) > '5')&&(stdvar->Length() == 13))
ach->SendFail(Msg57);
- else if ((stdvar->Value(8) > '2' ||
- stdvar->Value(8) == '2' && stdvar->Value(9) > '3')&&(stdvar->Length() == 13)) ach->SendFail(Msg57);
+ else if ((stdvar->Value(8) > '2' || (stdvar->Value(8) == '2' && stdvar->Value(9) > '3')) &&
+ (stdvar->Length() == 13)) ach->SendFail(Msg57);
//smh#13 For long year date
else if ( (stdvar->Value(5) > '1' ||
(stdvar->Value(5) == '1' && stdvar->Value(6) > '2'))&&(stdvar->Length() == 15)) ach->SendFail(Msg57);
else if ((stdvar->Value(9) != '.' || stdvar->Value(12) > '5' || stdvar->Value(14) > '5')&&(stdvar->Length() == 15))
ach->SendFail(Msg57);
else if ((stdvar->Value(10) > '2' ||
- stdvar->Value(10) == '2' && stdvar->Value(11) > '3')&&(stdvar->Length() == 15)) ach->SendFail(Msg57);
+ (stdvar->Value(10) == '2' && stdvar->Value(11) > '3'))&&(stdvar->Length() == 15)) ach->SendFail(Msg57);
}
Standard_Integer typnum = ent->TypeNumber();
Standard_Integer fornum = ent->FormNumber();
if (IGESToBRep::IsCurveAndSurface(ent) ||
- (typnum == 402 && (fornum == 1 || fornum == 7 ||
- fornum == 14 || fornum == 15) ||
- (typnum == 408 ) || (typnum == 308)))
+ ((typnum == 402 && (fornum == 1 || fornum == 7 ||
+ fornum == 14 || fornum == 15)) ||
+ (typnum == 408 ) || (typnum == 308)))
return Standard_True;
// Cas restants : non reconnus
LocTrans = TopAbs_EXTERNAL; // et pourquoi pas INTERNAL
}
else {
- if ((test > 0.)&& arcorien == TopAbs_FORWARD ||
- (test < 0.)&& arcorien == TopAbs_REVERSED){
+ if (((test > 0.)&& arcorien == TopAbs_FORWARD) ||
+ ((test < 0.)&& arcorien == TopAbs_REVERSED)){
LocTrans = TopAbs_FORWARD;
}
else {
LocTrans = TopAbs_EXTERNAL; // et pourquoi pas INTERNAL
}
else {
- if ((test > 0.)&& arcorien == TopAbs_FORWARD ||
- (test < 0.)&& arcorien == TopAbs_REVERSED){
+ if (((test > 0.)&& arcorien == TopAbs_FORWARD) ||
+ ((test < 0.)&& arcorien == TopAbs_REVERSED)){
LocTrans = TopAbs_FORWARD;
}
else {
if(slinref.Value(i)->ArcType()==IntPatch_Restriction) {
Handle(IntPatch_RLine)& rlin = *((Handle(IntPatch_RLine) *)&(slinref(i)));
for (Standard_Integer is=0; is<2; is++) {
- Standard_Boolean onFirst = is==0;
- if(onFirst && rlin->IsArcOnS1() || !onFirst && rlin->IsArcOnS2()) {
- Handle(Adaptor2d_HCurve2d) arc;
- Standard_Real u,v,u1,v1;
- if (onFirst) {
- arc = rlin->ArcOnS1();
- POn2S.ParametersOnS1(u,v);
- POn2S1.ParametersOnS1(u1,v1);
- }
- else {
- arc = rlin->ArcOnS2();
- POn2S.ParametersOnS2(u,v);
- POn2S1.ParametersOnS2(u1,v1);
- }
- if (indicepnt == 1) {
- u = (u+u1)*0.5;
- v = (v+v1)*0.5;
- }
- const Adaptor2d_Curve2d& C2d=arc->Curve2d();
- gp_Pnt2d PObt,P2d(u,v);
- Standard_Real par= Geom2dInt_TheProjPCurOfGInter::FindParameter(C2d,P2d,1e-7);
- PObt=C2d.Value(par);
- if(PObt.Distance(P2d) < tol2d) {
- return Standard_True;
- }
- }
+ Standard_Boolean onFirst = is==0;
+ if((onFirst && rlin->IsArcOnS1()) || (!onFirst && rlin->IsArcOnS2())) {
+ Handle(Adaptor2d_HCurve2d) arc;
+ Standard_Real u,v,u1,v1;
+ if (onFirst) {
+ arc = rlin->ArcOnS1();
+ POn2S.ParametersOnS1(u,v);
+ POn2S1.ParametersOnS1(u1,v1);
+ }
+ else {
+ arc = rlin->ArcOnS2();
+ POn2S.ParametersOnS2(u,v);
+ POn2S1.ParametersOnS2(u1,v1);
+ }
+ if (indicepnt == 1) {
+ u = (u+u1)*0.5;
+ v = (v+v1)*0.5;
+ }
+ const Adaptor2d_Curve2d& C2d=arc->Curve2d();
+ gp_Pnt2d PObt,P2d(u,v);
+ Standard_Real par= Geom2dInt_TheProjPCurOfGInter::FindParameter(C2d,P2d,1e-7);
+ PObt=C2d.Value(par);
+ if(PObt.Distance(P2d) < tol2d) {
+ return Standard_True;
+ }
+ }
}
}
}
Standard_Integer is;
for (is=0; is<2; is++) {
Standard_Boolean onFirst = is==0;
- if( onFirst && WLine->HasArcOnS1() ||
- !onFirst && WLine->HasArcOnS2()) {
+ if(( onFirst && WLine->HasArcOnS1()) ||
+ (!onFirst && WLine->HasArcOnS2())) {
PiParOnS piParOnS;
PQuery pIsOnDomS;
PArcOnS pArcOnS;
tolU = Max(tolULast,tolU); tolV = Max(tolVLast,tolV);
}
Standard_Real nptCh = UMaxCh-UMinCh;
- Standard_Boolean isNptLow = nptCh < 10. && nptCh < Nbptlin/100. ||
- !Domain->Has3d() && Standard_Integer(nptCh)+1 < Nbptlin;
+ Standard_Boolean isNptLow = (nptCh < 10. && nptCh < Nbptlin/100.) ||
+ (!Domain->Has3d() && Standard_Integer(nptCh)+1 < Nbptlin);
if (!isNptLow && !IsSegment2dSmall(Brise,UMinAr,UMaxAr,tolU,tolV)) {
// treat both ends
Standard_Real UMinChP,UMaxChP,UMinArP,UMaxArP;
if (ptsommet.Distance(locpt(j)) <= edgeTol) {
if (possiblyClosed) {
locpt2(j).Coord(U,V);
- if (OSurfaceIsUClosed && Abs(U-U2) > tolOUClosed ||
- OSurfaceIsVClosed && Abs(V-V2) > tolOVClosed)
+ if ((OSurfaceIsUClosed && Abs(U-U2) > tolOUClosed) ||
+ (OSurfaceIsVClosed && Abs(V-V2) > tolOVClosed))
continue;
}
duplicate = Standard_True;
// check in 2d
if (SurfaceIsUClosed || SurfaceIsVClosed) {
GetLinePoint2d (L, paramline, OnFirst, U,V);
- if (SurfaceIsUClosed && Abs(U-U1) > tolUClosed ||
- SurfaceIsVClosed && Abs(V-V1) > tolVClosed)
+ if ((SurfaceIsUClosed && Abs(U-U1) > tolUClosed) ||
+ (SurfaceIsVClosed && Abs(V-V1) > tolVClosed))
found = Standard_False;
}
if (found && (OSurfaceIsUClosed || OSurfaceIsVClosed)) {
GetLinePoint2d (L, paramline, !OnFirst, U,V);
- if (OSurfaceIsUClosed && Abs(U-U2) > tolOUClosed ||
- OSurfaceIsVClosed && Abs(V-V2) > tolOVClosed)
+ if ((OSurfaceIsUClosed && Abs(U-U2) > tolOUClosed) ||
+ (OSurfaceIsVClosed && Abs(V-V2) > tolOVClosed))
found = Standard_False;
}
}
? wlin->Vertex(j)
: rlin->Vertex(j));
Standard_Boolean APointOnRstStillExist =
- (OnFirst && Rptline.IsOnDomS1() && Rptline.ArcOnS1() == arc ||
- !OnFirst && Rptline.IsOnDomS2() && Rptline.ArcOnS2() == arc);
+ ((OnFirst && Rptline.IsOnDomS1() && Rptline.ArcOnS1() == arc) ||
+ (!OnFirst && Rptline.IsOnDomS2() && Rptline.ArcOnS2() == arc));
if(!APointOnRstStillExist) {
if (possiblyClosed) {
if (SurfaceIsUClosed || SurfaceIsVClosed) {
if (OnFirst) Rptline.ParametersOnS1(U,V);
else Rptline.ParametersOnS2(U,V);
- if (SurfaceIsUClosed && Abs(U-U1) > tolUClosed ||
- SurfaceIsVClosed && Abs(V-V1) > tolVClosed)
+ if ((SurfaceIsUClosed && Abs(U-U1) > tolUClosed) ||
+ (SurfaceIsVClosed && Abs(V-V1) > tolVClosed))
continue;
}
if (OSurfaceIsUClosed || OSurfaceIsVClosed) {
if (OnFirst) Rptline.ParametersOnS2(U,V);
else Rptline.ParametersOnS1(U,V);
- if (OSurfaceIsUClosed && Abs(U-U2) > tolOUClosed ||
- OSurfaceIsVClosed && Abs(V-V2) > tolOVClosed)
+ if ((OSurfaceIsUClosed && Abs(U-U2) > tolOUClosed) ||
+ (OSurfaceIsVClosed && Abs(V-V2) > tolOVClosed))
continue;
}
}
// on doit avoir VtxOnArc = True. On duplique le point sur S1
// en changeant ArcOnS2.
Standard_Boolean OnDifferentRst =
- (OnFirst && ptline.IsOnDomS1() && ptline.ArcOnS1() != arc ||
- !OnFirst && ptline.IsOnDomS2() && ptline.ArcOnS2() != arc);
+ ((OnFirst && ptline.IsOnDomS1() && ptline.ArcOnS1() != arc) ||
+ (!OnFirst && ptline.IsOnDomS2() && ptline.ArcOnS2() != arc));
ptline.SetTolerance(vtxTol);
if ( (!ptline.IsVertexOnS1() && OnFirst)
|| (!ptline.IsVertexOnS2() && !OnFirst)
//=======================================================================
#define epsilon 0.000000000001
-Standard_Boolean IntPoly_ShapeSection::IsEqual(const gp_Pnt& Pt1,
- const gp_Pnt& Pt2)
+Standard_Boolean IntPoly_ShapeSection::IsEqual(const gp_Pnt& Pt1, const gp_Pnt& Pt2)
{
- return ((Pt1.X() <= Pt2.X() && Pt2.X() < Pt1.X()+epsilon ||
- Pt2.X() <= Pt1.X() && Pt1.X() < Pt2.X()+epsilon) &&
- (Pt1.Y() <= Pt2.Y() && Pt2.Y() < Pt1.Y()+epsilon ||
- Pt2.Y() <= Pt1.Y() && Pt1.Y() < Pt2.Y()+epsilon) &&
- (Pt1.Z() <= Pt2.Z() && Pt2.Z() < Pt1.Z()+epsilon ||
- Pt2.Z() <= Pt1.Z() && Pt1.Z() < Pt2.Z()+epsilon));
+ return (((Pt1.X() <= Pt2.X() && Pt2.X() < Pt1.X()+epsilon) ||
+ (Pt2.X() <= Pt1.X() && Pt1.X() < Pt2.X()+epsilon)) &&
+ ((Pt1.Y() <= Pt2.Y() && Pt2.Y() < Pt1.Y()+epsilon) ||
+ (Pt2.Y() <= Pt1.Y() && Pt1.Y() < Pt2.Y()+epsilon)) &&
+ ((Pt1.Z() <= Pt2.Z() && Pt2.Z() < Pt1.Z()+epsilon) ||
+ (Pt2.Z() <= Pt1.Z() && Pt1.Z() < Pt2.Z()+epsilon)));
}
&&(Abs(SP1.V1()-SP2.V1())<MyConfusionPrecision) ) NbPoints=1;
if (NbPoints>=2) return(NbPoints);
//= remove
- else if ( ( (pp3>ppe1)&&(pp1<=ppe1)&&(pp2<=ppe1) ) || ( (pp3<ppe1)&&(pp1>=ppe1)&&(pp2>=ppe1) )
+ else if ( (( (pp3>ppe1)&&(pp1<=ppe1)&&(pp2<=ppe1) ) || ( (pp3<ppe1)&&(pp1>=ppe1)&&(pp2>=ppe1) ))
&& (NbPoints<2) ) {
//there are two sides (common top PT3) that can cut the edge
&&(Abs(SP1.V1()-SP2.V1())<MyConfusionPrecision) ) NbPoints=1;
if (NbPoints>=2) return(NbPoints);
- else if ( ( (pp3>=ppe1)&&(pp1<=ppe1)&&(pp2<=ppe1) ) || ( (pp3<=ppe1)&&(pp1>=ppe1)&&(pp2>=ppe1) )
- && (NbPoints<2) ) {
+ else if ( (( (pp3>=ppe1)&&(pp1<=ppe1)&&(pp2<=ppe1) ) || ( (pp3<=ppe1)&&(pp1>=ppe1)&&(pp2>=ppe1) ))
+ && (NbPoints<2) ) {
//there are two sides (common top PT3) that can cut the edge
//first side
Status = aClassifier.State();
}
- if (!RecadreOnPeriodic || !IsUPer && !IsVPer)
+ if (!RecadreOnPeriodic || (!IsUPer && !IsVPer))
return Status;
if (Status == TopAbs_IN || Status == TopAbs_ON)
Status = aClassifier.State();
}
- if (!RecadreOnPeriodic || !IsUPer && !IsVPer)
+ if (!RecadreOnPeriodic || (!IsUPer && !IsVPer))
return Status;
if (Status == TopAbs_IN || Status == TopAbs_ON)
return Status;
{
Standard_Integer anIndex = 0;
- if(UseLower && (theValue < myRangeSetStorer(1)) ||
+ if((UseLower && (theValue < myRangeSetStorer(1))) ||
(!UseLower && (theValue <= myRangeSetStorer(1))))
anIndex = 0;
else {
Other.ParamOnFirst(c1, d1);
Other.ParamOnSecond(c2, d2);
- if ((c1<=a1 && a1<=d1 || c1<=b1 && b1<=d1 || a1<=c1 && c1<=b1) &&
- (c2<=a2 && a2<=d2 || c2<=b2 && b2<=d2 || a2<=c2 && c2<=b2))
+ if (((c1<=a1 && a1<=d1) || (c1<=b1 && b1<=d1) || (a1<=c1 && c1<=b1)) &&
+ ((c2<=a2 && a2<=d2) || (c2<=b2 && b2<=d2) || (a2<=c2 && c2<=b2)))
return Standard_True;
return Standard_False;
}
}
Plref = Handle(Geom_Plane)::DownCast(P)->Pln();
gp_Dir Dirref(Plref.Axis().Direction());
- if (Plref.Direct() && orref == TopAbs_REVERSED ||
- !Plref.Direct() && orref == TopAbs_FORWARD) {
+ if ((Plref.Direct() && orref == TopAbs_REVERSED) ||
+ (!Plref.Direct() && orref == TopAbs_FORWARD)) {
Dirref.Reverse();
}
}
gp_Pln Pl = Handle(Geom_Plane)::DownCast(OtherP)->Pln();
gp_Dir Dirpl(Pl.Axis().Direction());
- if (Pl.Direct() && orrelat == TopAbs_REVERSED ||
- !Plref.Direct() && orrelat == TopAbs_FORWARD) {
+ if ((Pl.Direct() && orrelat == TopAbs_REVERSED) ||
+ (!Plref.Direct() && orrelat == TopAbs_FORWARD)) {
Dirpl.Reverse();
}
if (Dirpl.Dot(Dirref) > 0) {
if (!Modify) {
Newpl = Plorig;
NormalF = Newpl.Axis();
- if (Newpl.Direct() && F.Orientation() == TopAbs_REVERSED ||
- !Newpl.Direct() && F.Orientation() == TopAbs_FORWARD) {
+ if ((Newpl.Direct() && F.Orientation() == TopAbs_REVERSED) ||
+ (!Newpl.Direct() && F.Orientation() == TopAbs_FORWARD)) {
NormalF.Reverse();
}
return Standard_True;
if ( !( DisplayMode & GetFlags() ) || !IsElement )
return;
- if ( myUseTexture && ( !myTextureCoords.Extent() || !myTextureColorMap.Length() ) ||
- !myUseTexture && !myNodeColorMap.Extent() )
+ if ( (myUseTexture && ( !myTextureCoords.Extent() || !myTextureColorMap.Length() )) ||
+ (!myUseTexture && !myNodeColorMap.Extent()) )
return;
// subtract the hidden elements and ids to exclude (to minimise allocated memory)
}
}
}
- while (ErrU > ErrV && ErrV <= EpmsCut || ErrV >= ErrU && ErrU <= EpmsCut);
+ while ((ErrU > ErrV && ErrV <= EpmsCut) || (ErrV >= ErrU && ErrU <= EpmsCut));
//-------------------------- Recuperation des degres -------------------
void PLib_JacobiPolynomial::Points(const Standard_Integer NbGaussPoints,
TColStd_Array1OfReal& TabPoints) const
{
- if (NbGaussPoints != NDEG8 && NbGaussPoints != NDEG10 &&
+ if ((NbGaussPoints != NDEG8 && NbGaussPoints != NDEG10 &&
NbGaussPoints != NDEG15 && NbGaussPoints != NDEG20 &&
NbGaussPoints != NDEG25 && NbGaussPoints != NDEG30 &&
NbGaussPoints != NDEG40 && NbGaussPoints != NDEG50 &&
- NbGaussPoints != NDEG61 ||
+ NbGaussPoints != NDEG61) ||
NbGaussPoints <= myDegree)
Standard_ConstructionError::Raise("Invalid NbGaussPoints");
Standard_Integer aInd = myMapLink.FindIndex(aL);
if (aInd == 0 || aInd == aIndex)
continue;
- if (isOut && aNode1 == aL.node1 ||
- !isOut && aNode1 == aL.node2)
+ if ((isOut && aNode1 == aL.node1) ||
+ (!isOut && aNode1 == aL.node2))
aInd = -aInd;
if (canLinkBeTaken(aInd))
nEdges++;
Standard_Integer aInd = myMapLink.FindIndex(aL);
if (aInd == 0 || aInd == aIndex)
continue;
- if (isOut && aNode1 == aL.node2 ||
- !isOut && aNode1 == aL.node1)
+ if ((isOut && aNode1 == aL.node2) ||
+ (!isOut && aNode1 == aL.node1))
aInd = -aInd;
if (canLinkBeTaken(aInd))
{
inline Standard_Boolean IsEqual(const Poly_MakeLoops::Link& theKey1,
const Poly_MakeLoops::Link& theKey2)
{
- return (theKey1.node1 == theKey2.node1 &&
- theKey1.node2 == theKey2.node2 ||
- theKey1.node1 == theKey2.node2 &&
- theKey1.node2 == theKey2.node1);
+ return ((theKey1.node1 == theKey2.node1 && theKey1.node2 == theKey2.node2) ||
+ (theKey1.node1 == theKey2.node2 && theKey1.node2 == theKey2.node1));
}
/**
TUdisc.Append(mySequence->Value(i)->Value(j).X());
else if(Abs(Ur - CutPntsU(k)) <= myTolU)
TUdisc.Append(mySequence->Value(i)->Value(j + 1).X());
- else if(Ul < CutPntsU(k) && CutPntsU(k) < Ur ||
- Ur < CutPntsU(k) && CutPntsU(k) < Ul)
+ else if((Ul < CutPntsU(k) && CutPntsU(k) < Ur) ||
+ (Ur < CutPntsU(k) && CutPntsU(k) < Ul))
{
Standard_Real V;
V = (mySequence->Value(i)->Value(j).Z()
TVdisc.Append(mySequence->Value(i)->Value(j).X());
else if (Abs(Vr - CutPntsV(k)) <= myTolV)
TVdisc.Append(mySequence->Value(i)->Value(j + 1).X());
- else if(Vl < CutPntsV(k) && CutPntsV(k) < Vr ||
- Vr < CutPntsV(k) && CutPntsV(k) < Vl)
+ else if((Vl < CutPntsV(k) && CutPntsV(k) < Vr) ||
+ (Vr < CutPntsV(k) && CutPntsV(k) < Vl))
{
Standard_Real U;
U = (mySequence->Value(i)->Value(j).Y()
number = (Standard_Integer) (Floor((newV-v)/(F.myV2-F.myV1)));
dv -= number*(F.myV2-F.myV1);
}
- if (F.UCouture || F.VCouture && SType == GeomAbs_Sphere)
+ if (F.UCouture || (F.VCouture && SType == GeomAbs_Sphere))
{
gp_Pnt2d P2d = F.Value( UFirst );
number = (Standard_Integer) (Floor((P2d.X()-u)/M_PI + Epsilon(M_PI)));
inline Standard_Boolean Quantity_Date::IsLeap (const Standard_Integer yy){
-return ( ( yy % 4 == 0 && yy % 100 != 0 || yy % 400 == 0)
- ? Standard_True : Standard_False );
+return (((yy % 4 == 0) && (yy % 100 != 0)) || (yy % 400) == 0)
+ ? Standard_True : Standard_False;
}
}
}
if (aCurve->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve)) ||
- aCurve->IsKind(STANDARD_TYPE(Geom2d_BezierCurve)) ||
- (aCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve))) && !IsOf ) {
+ aCurve->IsKind(STANDARD_TYPE(Geom2d_BezierCurve)) ||
+ ((aCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve))) && !IsOf )) {
Standard_Integer Deg=1;
if (aCurve->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve))) {
// xpu110398 cto 009 L2 : e6ou en v11
// xpu140898 USA60111 : e9ou (!=0) + e7ou(=0)
Standard_Boolean INTEXT = (oriI == TopAbs_INTERNAL) && (TB == TopAbs_IN);
- INTEXT = INTEXT || (oriI == TopAbs_EXTERNAL) && (TB == TopAbs_OUT);
+ INTEXT = INTEXT || ((oriI == TopAbs_EXTERNAL) && (TB == TopAbs_OUT));
kpbound = lesmemes && Eclosed && INTEXT;
if ( kpbound ) {
kpbound = vclo.IsSame(VIG);
Standard_Real tolE = BRep_Tool::Tolerance(aE);
if (tolE > maxDist) maxDist = tolE;
if (aE.IsEqual(anEdge) ||
- aE.Orientation() != TopAbs_FORWARD && aE.Orientation() != TopAbs_REVERSED &&
- aE.IsSame(anEdge))
+ (aE.Orientation() != TopAbs_FORWARD &&
+ aE.Orientation() != TopAbs_REVERSED &&
+ aE.IsSame(anEdge)))
continue; // the same pcurve
Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(aE,aBaseFace,pf,pl);
if (PC.IsNull()) {
Standard_Integer nLESDspon = LESDspon.Extent();
if ( nLEspon != 0 && nLESDspon != 0 ) {
- Standard_Boolean takeE = (rE == 1 && iESD != iRef || iE == iRef);
- pE1 = takeE ? &E : &ESD;
- pE2 = !takeE ? &E : &ESD;
- plos1 = takeE ? &LEspon : &LESDspon;
- plos2 = !takeE ? &LEspon : &LESDspon;
+ Standard_Boolean takeE = ((rE == 1 && iESD != iRef) || iE == iRef);
+ pE1 = takeE ? &E : &ESD;
+ pE2 = !takeE ? &E : &ESD;
+ plos1 = takeE ? &LEspon : &LESDspon;
+ plos2 = !takeE ? &LEspon : &LESDspon;
}
else if ( nLEspon != 0 ) {
- pE1 = &E;
- pE2 = &ESD;
- plos1 = &LEspon;
- plos2 = &LESDspon;
+ pE1 = &E;
+ pE2 = &ESD;
+ plos1 = &LEspon;
+ plos2 = &LESDspon;
}
else if ( nLESDspon != 0 ) {
- pE1 = &ESD;
- pE2 = &E;
- plos1 = &LESDspon;
- plos2 = &LEspon;
+ pE1 = &ESD;
+ pE2 = &E;
+ plos1 = &LESDspon;
+ plos2 = &LEspon;
}
if (pE1 == NULL || pE2 == NULL) continue;
Standard_Real dot = tgi.Dot(xxri);
if (Abs(dot) < FUN_tola())
{
- if (!onfi && !onli || closedi)
- { mkT = MKI12; return Standard_True; }
- else
- dot = tgi.Dot(tgin1di);
+ if ((!onfi && !onli) || closedi)
+ { mkT = MKI12; return Standard_True; }
+ else
+ dot = tgi.Dot(tgin1di);
}
Standard_Boolean keepang = (dot > 0);
if (keepang) mkT = outin ? MKI1 : MKI2;
#if defined(_WIN32) || (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
Aspect_Handle GetWindowHandle(const Handle(Aspect_Window)& theWindow)
{
- Aspect_Handle aWindowHandle = NULL;
+ Aspect_Handle aWindowHandle = (Aspect_Handle)NULL;
#if defined(_WIN32)
const Handle (WNT_Window) aWindow = Handle(WNT_Window)::DownCast (theWindow);
if (!aWindow.IsNull())
for ( Standard_Integer iL = 1; iL <= LayNames->Length(); iL++) {
if ( !LTool->IsVisible( LTool->FindLayer(LayNames->Value(iL)) ) ) InVisCount++;
}
- if ( InVisCount >0 && InVisCount == LayNames->Length() ||
+ if ( (InVisCount >0 && InVisCount == LayNames->Length()) ||
!CTool->IsVisible(lab) ) {
style.SetVisibility(Standard_False);
}