From eafb234bf120f005d1a52abc75384d33d2de1721 Mon Sep 17 00:00:00 2001 From: omy Date: Thu, 12 Sep 2013 11:30:34 +0400 Subject: [PATCH 1/1] 0024171: Eliminate CLang compiler warning -Wreorder Got rid of -Wreorder warning (wrong fields' initialization order); some warnings -Wdangling-else are also fixed --- src/AIS/AIS_InteractiveContext_1.cxx | 7 +- src/AIS/AIS_LocalContext.cxx | 3 +- src/AIS/AIS_Selection.cxx | 11 +- src/Adaptor3d/Adaptor3d_TopolTool.cxx | 2 +- src/Aspect/Aspect_ColorScale.cxx | 6 +- src/BOPDS/BOPDS_DS.cxx | 4 +- src/BOPTools/BOPTools_ConnexityBlock.hxx | 2 +- .../BRepExtrema_DistShapeShape.cxx | 3 +- src/BRepFill/BRepFill_PipeShell.cxx | 6 +- src/BRepFill/BRepFill_Sweep.cxx | 41 +-- src/BRepMesh/BRepMesh_Triangle.hxx | 4 +- .../BRepTools_NurbsConvertModification.cxx | 6 +- src/BinTools/BinTools_ShapeSet.cxx | 2 +- src/BlendFunc/BlendFunc_CSCircular.cxx | 2 +- src/ChFi3d/ChFi3d_Builder_6.cxx | 12 +- src/GeomPlate/GeomPlate_BuildPlateSurface.cxx | 211 +++++++------- src/Hermit/Hermit.cxx | 264 ++++++++++-------- src/IGESControl/IGESControl_IGESBoundary.cxx | 4 +- src/IGESDefs/IGESDefs_ToolAttributeTable.cxx | 3 +- src/IGESToBRep/IGESToBRep_IGESBoundary.cxx | 4 +- src/IntPatch/IntPatch_RstInt.cxx | 20 +- src/IntPolyh/IntPolyh_MaillageAffinage.cxx | 21 +- src/IntSurf/IntSurf_Quadric.cdl | 2 +- src/MeshVS/MeshVS_Mesh.cxx | 3 +- src/MeshVS/MeshVS_MeshPrsBuilder.cxx | 3 +- src/NCollection/NCollection_BaseSequence.cxx | 3 +- src/NIS/NIS_InteractiveObject.cxx | 3 +- src/OpenGl/OpenGl_Context.cxx | 2 +- src/OpenGl/OpenGl_PrinterContext.cxx | 2 +- src/OpenGl/OpenGl_View.cxx | 2 +- .../ProjLib_ComputeApproxOnPolarSurface.cxx | 97 ++++--- .../QANewBRepNaming_Gluing.cxx | 54 ++-- src/QANewModTopOpe/QANewModTopOpe_Glue.cxx | 4 +- .../QANewModTopOpe_Limitation.cxx | 2 +- src/Resource/Resource_Manager.cxx | 3 +- src/STEPControl/STEPControl_ActorWrite.cxx | 3 +- src/SWDRAW/SWDRAW_ShapeFix.cxx | 9 +- src/SWDRAW/SWDRAW_ShapeUpgrade.cxx | 12 +- src/SelectMgr/SelectMgr_EntityOwner.cxx | 3 +- src/SelectMgr/SelectMgr_SelectableObject.cxx | 4 +- .../ShapeAnalysis_BoxBndTree.hxx | 3 +- .../ShapeAnalysis_CheckSmallFace.cxx | 11 +- .../ShapeAnalysis_TransferParametersProj.cxx | 9 +- .../ShapeCustom_ConvertToBSpline.cxx | 3 +- src/ShapeFix/ShapeFix_ComposeShell.cxx | 3 +- src/ShapeFix/ShapeFix_Face.cxx | 9 +- src/ShapeFix/ShapeFix_Wire.cxx | 3 +- .../ShapeProcess_ShapeContext.cxx | 2 + .../ShapeProcessAPI_ApplySequence.cxx | 6 +- src/TNaming/TNaming_NamedShape.cxx | 14 +- src/TopClass/TopClass_Classifier2d.gxx | 5 +- src/TopTrans/TopTrans_SurfaceTransition.cxx | 6 +- src/V3d/V3d_View.cdl | 8 +- src/ViewerTest/ViewerTest.cxx | 38 +-- src/ViewerTest/ViewerTest_EventManager.cxx | 4 +- src/ViewerTest/ViewerTest_ViewerCommands.cxx | 11 +- src/Voxel/Voxel_FastConverter.cxx | 6 +- src/VrmlData/VrmlData_Geometry.cxx | 6 +- src/VrmlData/VrmlData_IndexedFaceSet.cxx | 3 +- src/VrmlData/VrmlData_Node.cxx | 3 +- src/VrmlData/VrmlData_Scene.cxx | 44 ++- src/XCAFDoc/XCAFDoc_ColorTool.cxx | 6 +- src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx | 12 + 63 files changed, 608 insertions(+), 456 deletions(-) diff --git a/src/AIS/AIS_InteractiveContext_1.cxx b/src/AIS/AIS_InteractiveContext_1.cxx index b9341e143f..0130bbad35 100755 --- a/src/AIS/AIS_InteractiveContext_1.cxx +++ b/src/AIS/AIS_InteractiveContext_1.cxx @@ -207,13 +207,14 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo(const Standard_Integer XPix selector->Init(); if ( selector->More() ) { - if ( HasOpenedContext() ) + if ( HasOpenedContext() ) + { if ( !myFilters->IsOk( selector->OnePicked() ) ) - return AIS_SOD_AllBad; + return AIS_SOD_AllBad; else if ( !myLocalContexts( myCurLocalIndex )->Filter()->IsOk( selector->OnePicked() ) ) return AIS_SOD_AllBad; - + } // Does nothing if previously detected object is equal to the current one if ( selector->OnePicked()->Selectable() == myLastPicked ) diff --git a/src/AIS/AIS_LocalContext.cxx b/src/AIS/AIS_LocalContext.cxx index 4997c384e4..f3c54950da 100755 --- a/src/AIS/AIS_LocalContext.cxx +++ b/src/AIS/AIS_LocalContext.cxx @@ -538,7 +538,7 @@ Standard_Boolean AIS_LocalContext::Remove(const Handle(AIS_InteractiveObject)& a const Handle(V3d_Viewer)& aViewer = myCTX->CurrentViewer(); for(i = 1; i <= myMapOfOwner.Extent(); i++){ const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner(i) ; - if(!anOwner.IsNull()) + if(!anOwner.IsNull()) { if(anOwner->Selectable() != aSelectable) ownersToKeep.Add(anOwner); else @@ -549,6 +549,7 @@ Standard_Boolean AIS_LocalContext::Remove(const Handle(AIS_InteractiveObject)& a Unhilight(anOwner, aViewer->ActiveView()); } } + } } myMapOfOwner.Clear(); myMapOfOwner.Assign(ownersToKeep); diff --git a/src/AIS/AIS_Selection.cxx b/src/AIS/AIS_Selection.cxx index 69ccd6b8ce..91c72ae1f2 100755 --- a/src/AIS/AIS_Selection.cxx +++ b/src/AIS/AIS_Selection.cxx @@ -248,11 +248,12 @@ AIS_SelectStatus AIS_Selection::Select(const Handle(Standard_Transient)& anObjec if ( S->myResultMap.IsBound( anObject ) ){ AIS_NListTransient::Iterator aListIter = S->myResultMap.Find( anObject ); //skt----------------------------------------------------------------- - if( S->myIterator == aListIter ) - if( S->myIterator.More() ) - S->myIterator.Next(); - else - S->myIterator = AIS_NListTransient::Iterator(); + if( S->myIterator == aListIter ) { + if( S->myIterator.More() ) + S->myIterator.Next(); + else + S->myIterator = AIS_NListTransient::Iterator(); + } //-------------------------------------------------------------------- #ifdef BUC60953 // In the mode of advanced mesh selection only one owner is created diff --git a/src/Adaptor3d/Adaptor3d_TopolTool.cxx b/src/Adaptor3d/Adaptor3d_TopolTool.cxx index f852a0c162..8d23eed134 100755 --- a/src/Adaptor3d/Adaptor3d_TopolTool.cxx +++ b/src/Adaptor3d/Adaptor3d_TopolTool.cxx @@ -55,7 +55,7 @@ static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real& } -Adaptor3d_TopolTool::Adaptor3d_TopolTool () : nbRestr(0),idRestr(0),myNbSamplesU(-1) +Adaptor3d_TopolTool::Adaptor3d_TopolTool () : nbRestr(0),myNbSamplesU(-1),idRestr(0) { } diff --git a/src/Aspect/Aspect_ColorScale.cxx b/src/Aspect/Aspect_ColorScale.cxx index ff9d868f0f..128f545939 100755 --- a/src/Aspect/Aspect_ColorScale.cxx +++ b/src/Aspect/Aspect_ColorScale.cxx @@ -41,13 +41,13 @@ myMax( 1.0 ), myXPos( 0 ), myYPos( 0 ), myWidth( 0.2 ), -myHeight( 1 ), myTitle( "" ), -myInterval( 10 ), +myHeight( 1 ), myFormat( "%.4g" ), +myInterval( 10 ), myAtBorder( Standard_True ), -myReversed( Standard_False ), myColorType( Aspect_TOCSD_AUTO ), +myReversed( Standard_False ), myLabelType( Aspect_TOCSD_AUTO ), myLabelPos( Aspect_TOCSP_RIGHT ), myTitlePos( Aspect_TOCSP_CENTER ), diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index 9e4a91f77e..ab9c00be8c 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -82,8 +82,8 @@ BOPDS_DS::BOPDS_DS() myMapShapeIndex(100, myAllocator), myPaveBlocksPool(myAllocator), myFaceInfoPool(myAllocator), - myShapesSD(100, myAllocator), myMapPBCB(100, myAllocator), + myShapesSD(100, myAllocator), myInterfTB(100, myAllocator), myInterfVV(myAllocator), myInterfVE(myAllocator), @@ -108,8 +108,8 @@ BOPDS_DS::BOPDS_DS(const Handle(NCollection_BaseAllocator)& theAllocator) myMapShapeIndex(100, myAllocator), myPaveBlocksPool(myAllocator), myFaceInfoPool(myAllocator), - myShapesSD(100, myAllocator), myMapPBCB(100, myAllocator), + myShapesSD(100, myAllocator), myInterfTB(100, myAllocator), myInterfVV(myAllocator), myInterfVE(myAllocator), diff --git a/src/BOPTools/BOPTools_ConnexityBlock.hxx b/src/BOPTools/BOPTools_ConnexityBlock.hxx index 5be56d888c..890c0efca9 100644 --- a/src/BOPTools/BOPTools_ConnexityBlock.hxx +++ b/src/BOPTools/BOPTools_ConnexityBlock.hxx @@ -75,8 +75,8 @@ class BOPTools_ConnexityBlock { }; // protected: - Standard_Boolean myRegular; Handle(NCollection_BaseAllocator) myAllocator; + Standard_Boolean myRegular; BOPCol_ListOfShape myShapes; BOPCol_ListOfShape myLoops; }; diff --git a/src/BRepExtrema/BRepExtrema_DistShapeShape.cxx b/src/BRepExtrema/BRepExtrema_DistShapeShape.cxx index 80b05020a1..5382969b92 100755 --- a/src/BRepExtrema/BRepExtrema_DistShapeShape.cxx +++ b/src/BRepExtrema/BRepExtrema_DistShapeShape.cxx @@ -96,7 +96,7 @@ void BRepExtrema_DistShapeShape::DistanceMapMap(const TopTools_IndexedMapOfShape const TopoDS_Shape &S2 = Map2(j); BRepExtrema_DistanceSS dist(S1,S2,box1,box2,myDistRef,myEps); - if (dist.IsDone()) + if (dist.IsDone()) { if(dist.DistValue() < (myDistRef-myEps)) { mySolutionsShape1.Clear(); @@ -116,6 +116,7 @@ void BRepExtrema_DistShapeShape::DistanceMapMap(const TopTools_IndexedMapOfShape if (myDistRef > dist.DistValue()) myDistRef=dist.DistValue(); } + } } } } diff --git a/src/BRepFill/BRepFill_PipeShell.cxx b/src/BRepFill/BRepFill_PipeShell.cxx index e6aadaf7b7..81076790b9 100755 --- a/src/BRepFill/BRepFill_PipeShell.cxx +++ b/src/BRepFill/BRepFill_PipeShell.cxx @@ -210,10 +210,10 @@ static Standard_Boolean IsSameOriented(const TopoDS_Shape& aFace, //======================================================================= BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine) : mySpine(Spine), - myTrihedron(GeomFill_IsCorrectedFrenet), - myTransition(BRepFill_Modified), + myTrihedron(GeomFill_IsCorrectedFrenet), myForceApproxC1(Standard_False), - myStatus(GeomFill_PipeOk) + myTransition(BRepFill_Modified), + myStatus(GeomFill_PipeOk) { myLocation.Nullify(); mySection.Nullify(); diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx index dc8791b628..69260a7db5 100755 --- a/src/BRepFill/BRepFill_Sweep.cxx +++ b/src/BRepFill/BRepFill_Sweep.cxx @@ -2259,26 +2259,27 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section, } } - if (ipath == 1) - if (uclose && (isec == NbLaw)) { - Vertex(isec+1, 1) = Vertex(1, 1); - } - else if (Vertex(isec+1, 1).IsNull()) { - if (constSection) - myLoc->PerformVertex(IPath-1, - TopoDS::Vertex(SecVertex(isec+1)), - TabErr(isec,1)+VError(isec+1), - TopoDS::Vertex(Vertex(isec+1, 1)) ); - else - myLoc->PerformVertex(IPath-1, - mySec->Vertex(isec+1,Vi(1)), - TabErr(isec,1) + - mySec->VertexTol(isec,Vi(1)), - TopoDS::Vertex(Vertex(isec+1, 1)) ); - if (MergeVertex(Vertex(isec,1), Vertex(isec+1,1))) { - VEdge(isec, 1) = NullEdge(Vertex(isec, 1)); - } - } + if (ipath == 1) { + if (uclose && (isec == NbLaw)) { + Vertex(isec+1, 1) = Vertex(1, 1); + } + else if (Vertex(isec+1, 1).IsNull()) { + if (constSection) + myLoc->PerformVertex(IPath-1, + TopoDS::Vertex(SecVertex(isec+1)), + TabErr(isec,1)+VError(isec+1), + TopoDS::Vertex(Vertex(isec+1, 1)) ); + else + myLoc->PerformVertex(IPath-1, + mySec->Vertex(isec+1,Vi(1)), + TabErr(isec,1) + + mySec->VertexTol(isec,Vi(1)), + TopoDS::Vertex(Vertex(isec+1, 1)) ); + if (MergeVertex(Vertex(isec,1), Vertex(isec+1,1))) { + VEdge(isec, 1) = NullEdge(Vertex(isec, 1)); + } + } + } if (uclose && (isec == NbLaw)) { Vertex(isec+1, ipath+1) = Vertex(1, ipath+1); diff --git a/src/BRepMesh/BRepMesh_Triangle.hxx b/src/BRepMesh/BRepMesh_Triangle.hxx index d9ac741058..acd0815349 100644 --- a/src/BRepMesh/BRepMesh_Triangle.hxx +++ b/src/BRepMesh/BRepMesh_Triangle.hxx @@ -77,10 +77,10 @@ public: private: Standard_Integer myEdge1; - Standard_Boolean myOrientation1; Standard_Integer myEdge2; - Standard_Boolean myOrientation2; Standard_Integer myEdge3; + Standard_Boolean myOrientation1; + Standard_Boolean myOrientation2; Standard_Boolean myOrientation3; BRepMesh_DegreeOfFreedom myMovability; }; diff --git a/src/BRepTools/BRepTools_NurbsConvertModification.cxx b/src/BRepTools/BRepTools_NurbsConvertModification.cxx index 2074125f46..a9e0ff9506 100755 --- a/src/BRepTools/BRepTools_NurbsConvertModification.cxx +++ b/src/BRepTools/BRepTools_NurbsConvertModification.cxx @@ -544,19 +544,21 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d v = (Vsup - Vinf)*0.1; if(S->IsUPeriodic()) { Standard_Real uperiod = S->UPeriod(); - if(uperiod < (Usup+2*u-Uinf)) + if(uperiod < (Usup+2*u-Uinf)) { if(uperiod <= (Usup-Uinf)) u = 0; else u = (uperiod-(Usup-Uinf))*0.5; + } } if(S->IsVPeriodic()) { Standard_Real vperiod = S->VPeriod(); - if(vperiod < (Vsup+2*v-Vinf)) + if(vperiod < (Vsup+2*v-Vinf)) { if(vperiod <= (Vsup-Vinf)) v = 0; else v = (vperiod-(Vsup-Vinf))*0.5; + } } GeomAdaptor_Surface GAS(S, Uinf-u,Usup+u,Vinf-v,Vsup+v); Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(GAS); diff --git a/src/BinTools/BinTools_ShapeSet.cxx b/src/BinTools/BinTools_ShapeSet.cxx index 4eddfb20d2..86413b7b36 100755 --- a/src/BinTools/BinTools_ShapeSet.cxx +++ b/src/BinTools/BinTools_ShapeSet.cxx @@ -75,7 +75,7 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const gp_Pnt P) //======================================================================= BinTools_ShapeSet::BinTools_ShapeSet(const Standard_Boolean isWithTriangles) - :myWithTriangles(isWithTriangles), myFormatNb(3) + :myFormatNb(3), myWithTriangles(isWithTriangles) {} //======================================================================= diff --git a/src/BlendFunc/BlendFunc_CSCircular.cxx b/src/BlendFunc/BlendFunc_CSCircular.cxx index 2679676646..a9ee795613 100755 --- a/src/BlendFunc/BlendFunc_CSCircular.cxx +++ b/src/BlendFunc/BlendFunc_CSCircular.cxx @@ -46,7 +46,7 @@ BlendFunc_CSCircular::BlendFunc_CSCircular(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HCurve)& CGuide, const Handle(Law_Function)& L) : - surf(S),curv(C),guide(CGuide),istangent(Standard_True),law(L), + surf(S),curv(C),guide(CGuide),law(L),istangent(Standard_True), //prmc, dprmc, istangent, ray, choix, normtg, maxang(RealFirst()),minang(RealLast()),mySShape(BlendFunc_Rational) //myTConv diff --git a/src/ChFi3d/ChFi3d_Builder_6.cxx b/src/ChFi3d/ChFi3d_Builder_6.cxx index 1e79f9adbc..c1c7e3030f 100755 --- a/src/ChFi3d/ChFi3d_Builder_6.cxx +++ b/src/ChFi3d/ChFi3d_Builder_6.cxx @@ -1778,7 +1778,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData narc1 = Lin->StartPointOnFirst().NbPointOnRst(); narc2 = Lin->StartPointOnSecond().NbPointOnRst(); // modified by eap Fri Feb 8 11:43:48 2002 ___BEGIN___ - if(!debarc1) + if(!debarc1) { if (narc1 == 0) backwContinueFailed = Lin->StartPointOnFirst().ParameterOnGuide() > Target; else { @@ -1799,7 +1799,8 @@ Standard_Boolean ChFi3d_Builder::ComputeData // } } } - if(!debarc2) + } + if(!debarc2) { if (narc2 == 0) backwContinueFailed = Lin->StartPointOnSecond().ParameterOnGuide() > Target; else { @@ -1820,6 +1821,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData // } } } + } if (backwContinueFailed) { // if we leave backwContinueFailed as is, we will stop in this direction // but we are to continue if there are no more faces on the side with arc @@ -1879,7 +1881,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData narc1 = Lin->EndPointOnFirst().NbPointOnRst(); narc2 = Lin->EndPointOnSecond().NbPointOnRst(); // modified by eap Fri Feb 8 11:44:57 2002 ___BEGIN___ - if(!finarc1) + if(!finarc1) { if (narc1 == 0) forwContinueFailed = Lin->EndPointOnFirst().ParameterOnGuide() < Target; else { @@ -1895,7 +1897,8 @@ Standard_Boolean ChFi3d_Builder::ComputeData // } } } - if(!finarc2) + } + if(!finarc2) { if (narc2 == 0) forwContinueFailed = Lin->EndPointOnSecond().ParameterOnGuide() < Target; else { @@ -1911,6 +1914,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData // } } } + } if (forwContinueFailed) { // if we leave forwContinueFailed as is, we will stop in this direction // but we are to continue if there are no more faces on the side with arc diff --git a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx index a59c3a8199..0711bc2a35 100755 --- a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx +++ b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx @@ -2033,107 +2033,126 @@ Discretise(const Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, if (Affich > 1) { cout << "Courbe : " << i << endl; cout << " NbPnt, NbPtInter, NbPtG1G1 :" << NbPnt_i << ", " - << NbPtInter << ", " << NbPtG1G1 << endl; + << NbPtInter << ", " << NbPtG1G1 << endl; } #endif for (Standard_Integer j=1; j<=NbPnt_i; j++) - { // repartition des points en cosinus selon l'ACR 2d - // Afin d'eviter les points d'acumulation dans le 2d - //Inter=Uinit+(Uif)*((-cos(M_PI*((j-1)/(NbPnt_i-1)))+1)/2); - if (j==NbPnt_i) - Inter=Ufinal;//pour parer au bug sur sun - else if (ACR) { - CurLength = Length2d*(1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2; - Inter = acrlaw->Value(CurLength); - } - else { - Inter=Uinit+(Ufinal-Uinit)*((1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2); - } - myParCont->ChangeValue(i).Append(Inter);// on ajoute le point - if (NbPtInter!=0) - { for(Standard_Integer l=1;l<=NbPtInter;l+=2) - //on cherche si le point Inter est dans l'intervalle - //PntInter[i] PntInter[i+1] - //auquelle cas il ne faudrait pas le stocker (pb de doublons) - { if ((Inter>PntInter->Value(i).Value(l)) - &&(InterValue(i).Value(l+1))) - { l=NbPtInter+2; - // pour sortir de la boucle sans stocker le point - } - else - { if (l+1>=NbPtInter) - // on a parcouru tout le tableau : Le point - // n'appartient pas a un interval point commun - if (NbPtG1G1!=0) - // est qu'il existe un intervalle incompatible - for(Standard_Integer k=1;k<=NbPtG1G1;k+=2) - { if ((Inter>PntG1G1->Value(i).Value(k)) - &&(InterValue(i).Value(k+1))) - { k=NbPtG1G1+2; // pour sortir de la boucle - // Ajouter les points de contrainte G0 - gp_Pnt P3d,PP,Pdif; - gp_Pnt2d P2d; - - AC2d.D0(Inter, P2d); - LinCont->D0(Inter,P3d); - mySurfInit->D0(P2d.Coord(1),P2d.Coord(2),PP); - Pdif.SetCoord(-PP.Coord(1)+P3d.Coord(1), - -PP.Coord(2)+P3d.Coord(2), - -PP.Coord(3)+P3d.Coord(3)); - Plate_PinpointConstraint PC(P2d.XY(), - Pdif.XYZ(),0,0); - myPlate.Load(PC); - - } - else // le point n'appartient pas a un interval G1 - { if (k+1>=NbPtG1G1) - { myPlateCont->ChangeValue(i).Append(Inter); - // on ajoute le point - } - } - } - else - { myPlateCont->ChangeValue(i).Append(Inter); - // on ajoute le point - } - } - } - } - else - { if (NbPtG1G1!=0) // est qu'il existe un intervalle incompatible - for(Standard_Integer k=1;k<=NbPtG1G1;k+=2) - { if ((Inter>PntG1G1->Value(i).Value(k)) - &&(InterValue(i).Value(k+1))) - { k=NbPtG1G1+2; // pour sortir de la boucle - // Ajouter les points de contrainte G0 - gp_Pnt P3d,PP,Pdif; - gp_Pnt2d P2d; - - AC2d.D0(Inter, P2d); - LinCont->D0(Inter,P3d); - mySurfInit->D0(P2d.Coord(1),P2d.Coord(2),PP); - Pdif.SetCoord(-PP.Coord(1)+P3d.Coord(1), - -PP.Coord(2)+P3d.Coord(2), - -PP.Coord(3)+P3d.Coord(3)); - Plate_PinpointConstraint PC(P2d.XY(),Pdif.XYZ(),0,0); - myPlate.Load(PC); + { + // repartition des points en cosinus selon l'ACR 2d + // Afin d'eviter les points d'acumulation dans le 2d + //Inter=Uinit+(Uif)*((-cos(M_PI*((j-1)/(NbPnt_i-1)))+1)/2); + if (j==NbPnt_i) + Inter=Ufinal;//pour parer au bug sur sun + else if (ACR) { + CurLength = Length2d*(1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2; + Inter = acrlaw->Value(CurLength); + } + else { + Inter=Uinit+(Ufinal-Uinit)*((1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2); + } + myParCont->ChangeValue(i).Append(Inter);// on ajoute le point + if (NbPtInter!=0) + { + for(Standard_Integer l=1;l<=NbPtInter;l+=2) + { + //on cherche si le point Inter est dans l'intervalle + //PntInter[i] PntInter[i+1] + //auquelle cas il ne faudrait pas le stocker (pb de doublons) + if ((Inter>PntInter->Value(i).Value(l)) + &&(InterValue(i).Value(l+1))) + { + l=NbPtInter+2; + // pour sortir de la boucle sans stocker le point + } + else + { + if (l+1>=NbPtInter) { + // on a parcouru tout le tableau : Le point + // n'appartient pas a un interval point commun + if (NbPtG1G1!=0) + { + // est qu'il existe un intervalle incompatible + for(Standard_Integer k=1;k<=NbPtG1G1;k+=2) + { + if ((Inter>PntG1G1->Value(i).Value(k)) + &&(InterValue(i).Value(k+1))) + { + k=NbPtG1G1+2; // pour sortir de la boucle + // Ajouter les points de contrainte G0 + gp_Pnt P3d,PP,Pdif; + gp_Pnt2d P2d; + + AC2d.D0(Inter, P2d); + LinCont->D0(Inter,P3d); + mySurfInit->D0(P2d.Coord(1),P2d.Coord(2),PP); + Pdif.SetCoord(-PP.Coord(1)+P3d.Coord(1), + -PP.Coord(2)+P3d.Coord(2), + -PP.Coord(3)+P3d.Coord(3)); + Plate_PinpointConstraint PC(P2d.XY(),Pdif.XYZ(),0,0); + myPlate.Load(PC); + } + else // le point n'appartient pas a un interval G1 + { + if (k+1>=NbPtG1G1) + { + myPlateCont->ChangeValue(i).Append(Inter); + // on ajoute le point + } + } + } + } + else + { + myPlateCont->ChangeValue(i).Append(Inter); + // on ajoute le point + } + } + } + } + } + else + { + if (NbPtG1G1!=0) // est qu'il existe un intervalle incompatible + { + for(Standard_Integer k=1;k<=NbPtG1G1;k+=2) + { + if ((Inter>PntG1G1->Value(i).Value(k)) + &&(InterValue(i).Value(k+1))) + { + k=NbPtG1G1+2; // pour sortir de la boucle + // Ajouter les points de contrainte G0 + gp_Pnt P3d,PP,Pdif; + gp_Pnt2d P2d; + + AC2d.D0(Inter, P2d); + LinCont->D0(Inter,P3d); + mySurfInit->D0(P2d.Coord(1),P2d.Coord(2),PP); + Pdif.SetCoord(-PP.Coord(1)+P3d.Coord(1), + -PP.Coord(2)+P3d.Coord(2), + -PP.Coord(3)+P3d.Coord(3)); + Plate_PinpointConstraint PC(P2d.XY(),Pdif.XYZ(),0,0); + myPlate.Load(PC); - } - else // le point n'appartient pas a un intervalle G1 - { if (k+1>=NbPtG1G1) - { myPlateCont->ChangeValue(i).Append(Inter); - // on ajoute le point - } - } - } - else - { if ( ( (!mySurfInitIsGive) - &&(Geom2dAdaptor_Curve(LinCont->Curve2dOnSurf()).GetType()!=GeomAbs_Circle)) - || ( (j>1) &&(jChangeValue(i).Append(Inter);// on ajoute le point - } - } + } + else // le point n'appartient pas a un intervalle G1 + { + if (k+1>=NbPtG1G1) + { + myPlateCont->ChangeValue(i).Append(Inter); + // on ajoute le point + } + } + } + } + else + { + if ( ( (!mySurfInitIsGive) + &&(Geom2dAdaptor_Curve(LinCont->Curve2dOnSurf()).GetType()!=GeomAbs_Circle)) + || ( (j>1) &&(jChangeValue(i).Append(Inter);// on ajoute le point + } } + } } } //--------------------------------------------------------- diff --git a/src/Hermit/Hermit.cxx b/src/Hermit/Hermit.cxx index c4881e2a9e..4ff6c1c7ce 100755 --- a/src/Hermit/Hermit.cxx +++ b/src/Hermit/Hermit.cxx @@ -235,62 +235,77 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, Standard_Real Polemax=Polesinit(max).Y(); if (((Polemax)>=((1/TolPoles)*Polemin))||((Polemin==0.0)&&(Polemax>=(1/TolPoles)))){ if (Polesinit(0).Y()>=(1/TolPoles)*Polesinit(3).Y()||Polesinit(0).Y()<=TolPoles*Polesinit(3).Y()) - Standard_DimensionError::Raise("Hermit Impossible Tolerance"); - if ((max==0)||(max==3)) - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax)); - if ((max==1)||(max==2)) - if ((min==0)||(min==3)) - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-(1/TolPoles)*Polemin)); - else{ - if ((TolPoles*PolemaxPolesinit(0).Y())&&(1/TolPoles*Polemin>Polesinit(3).Y())&&(mark==0)){ - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-1/TolPoles*Polemin)); - mark=1; - } - if (mark==0){ - Standard_Real Pole0,Pole3; - Pole0=Polesinit(0).Y(); - Pole3=Polesinit(3).Y(); - if (Pole0<3){ - a=Log10(Pole3/Pole0); - if (boucle==2) - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0))))); - if (boucle==1){ - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles)))))); - dercas=1; - } - } - if (Pole0>Pole3){ - a=Log10(Pole0/Pole3); - if (boucle==2) - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0))))); - if (boucle==1){ - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles)))))); - dercas=1; - } - } - } - } + Standard_DimensionError::Raise("Hermit Impossible Tolerance"); + if ((max==0)||(max==3)) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax)); + } + else if ((max==1)||(max==2)) { + if ((min==0)||(min==3)) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-(1/TolPoles)*Polemin)); + } + else{ + if ((TolPoles*PolemaxPolesinit(0).Y())&&(1/TolPoles*Polemin>Polesinit(3).Y())&&(mark==0)){ + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-1/TolPoles*Polemin)); + mark=1; + } + if (mark==0){ + Standard_Real Pole0,Pole3; + Pole0=Polesinit(0).Y(); + Pole3=Polesinit(3).Y(); + if (Pole0<3){ + a=Log10(Pole3/Pole0); + if (boucle==2) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0))))); + } + if (boucle==1) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles)))))); + dercas=1; + } + } + if (Pole0>Pole3) + { + a=Log10(Pole0/Pole3); + if (boucle==2) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0))))); + } + if (boucle==1) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles)))))); + dercas=1; + } + } + } + } + } } - } //end of the loop + } // end of the loop - if (!SignDenom(Polesinit)) //invertion of the polynome sign + if (!SignDenom(Polesinit)) //invertion of the polynome sign + { for (index=0;index<=3;index++) Polesinit(index).SetCoord(0.0,-Polesinit(index).Y()); - - //loop of positivity - if ((Polesinit(1).Y()<0.0)&&(Polesinit(2).Y()>=0.0)){ + } + + // loop of positivity + if ((Polesinit(1).Y()<0.0)&&(Polesinit(2).Y()>=0.0)) + { Us1=Polesinit(0).Y()/(Polesinit(0).Y()-Polesinit(1).Y()); if (boucle==2) Us1=Us1*knots(2); @@ -304,7 +319,8 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, U4=knots(I1); } - if ((Polesinit(1).Y()>=0.0)&&(Polesinit(2).Y()<0.0)){ + if ((Polesinit(1).Y()>=0.0)&&(Polesinit(2).Y()<0.0)) + { Us2=Polesinit(2).Y()/(Polesinit(2).Y()-Polesinit(3).Y()); if (boucle==2) Us2=knots(knots.Length()-1)+Us2*(1-knots(knots.Length()-1)); @@ -397,6 +413,7 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, } if (I1==I2) //definition and filling of the + { if((I3==I4)||(I3==0)){ //array of knots Knots=new TColStd_HArray1OfReal(1,BS->NbKnots()); for (i=1;i<=BS->NbKnots();i++) @@ -408,7 +425,9 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, Knots->SetValue(i,BS->Knot(i)); Knots->SetValue(BS->NbKnots()+1,Uy); } - else{ + } + else + { if((I3==I4)||(I3==0)){ Knots=new TColStd_HArray1OfReal(1,BS->NbKnots()+1); for (i=1;i<=BS->NbKnots();i++) @@ -433,69 +452,93 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, Polesinit(2).SetCoord(0.0,Herm(3)-Herm(2)/3.0); Polesinit(3).SetCoord(0.0,Herm(3)); - //loop to check the tolerances on poles - if (TolPoles!=0.0){ + // loop to check the tolerances on poles + if (TolPoles!=0.0) + { Polemax(Polesinit,min,max); Standard_Real Polemin=Polesinit(min).Y(); Standard_Real Polemax=Polesinit(max).Y(); - if (((Polemax)>=((1/TolPoles)*Polemin))||((Polemin==0.0)&&(Polemax>=(1/TolPoles)))){ + if (((Polemax)>=((1/TolPoles)*Polemin))||((Polemin==0.0)&&(Polemax>=(1/TolPoles)))) + { if (Polesinit(0).Y()>=(1/TolPoles)*Polesinit(3).Y()||Polesinit(0).Y()<=TolPoles*Polesinit(3).Y()) - Standard_DimensionError::Raise("Hermit Impossible Tolerance"); - if ((max==0)||(max==3)) - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax)); - if ((max==1)||(max==2)) - if ((min==0)||(min==3)) - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-(1/TolPoles)*Polemin)); - else{ - if ((TolPoles*PolemaxPolesinit(0).Y())&&(1/TolPoles*Polemin>Polesinit(3).Y())&&(mark==0)){ - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-1/TolPoles*Polemin)); - mark=1; - } - if (mark==0){ - Standard_Real Pole0,Pole3; - Pole0=Polesinit(0).Y(); - Pole3=Polesinit(3).Y(); - if (Pole0<3){ - a=Log10(Pole3/Pole0); - if (boucle==2) - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0))))); - if (boucle==1){ - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles)))))); - dercas=1; - } - } - if (Pole0>Pole3){ - a=Log10(Pole0/Pole3); - if (boucle==2) - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0))))); - if (boucle==1){ - for (i=0;i<=3;i++) - Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles)))))); - dercas=1; - } - } - } - } + Standard_DimensionError::Raise("Hermit Impossible Tolerance"); + if ((max==0)||(max==3)) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax)); + } + else if ((max==1)||(max==2)) + { + if ((min==0)||(min==3)) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-(1/TolPoles)*Polemin)); + } + else + { + if ((TolPoles*PolemaxPolesinit(0).Y())&&(1/TolPoles*Polemin>Polesinit(3).Y())&&(mark==0)) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-1/TolPoles*Polemin)); + mark=1; + } + if (mark==0) + { + Standard_Real Pole0,Pole3; + Pole0=Polesinit(0).Y(); + Pole3=Polesinit(3).Y(); + if (Pole0<3) + { + a=Log10(Pole3/Pole0); + if (boucle==2) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0))))); + } + if (boucle==1) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles)))))); + dercas=1; + } + } + if (Pole0>Pole3) + { + a=Log10(Pole0/Pole3); + if (boucle==2) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0))))); + } + else if (boucle==1) + { + for (i=0;i<=3;i++) + Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles)))))); + dercas=1; + } + } + } + } + } } - } //end of the loop + } // end of the loop - if (!SignDenom(Polesinit)) //invertion of the polynome sign + if (!SignDenom(Polesinit)) // invertion of the polynome sign + { for (index=0;index<=3;index++) Polesinit(index).SetCoord(0.0,-Polesinit(index).Y()); - - //boucle de positivite - if ((Polesinit(1).Y()<0.0)&&(Polesinit(2).Y()>=0.0)){ + } + + // boucle de positivite + if ((Polesinit(1).Y()<0.0)&&(Polesinit(2).Y()>=0.0)) + { Us1=Polesinit(0).Y()/(Polesinit(0).Y()-Polesinit(1).Y()); if (boucle==2) Us1=Us1*knots(2); @@ -509,7 +552,8 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, U4=knots(I1); } - if ((Polesinit(1).Y()>=0.0)&&(Polesinit(2).Y()<0.0)){ + if ((Polesinit(1).Y()>=0.0)&&(Polesinit(2).Y()<0.0)) + { Us2=Polesinit(2).Y()/(Polesinit(2).Y()-Polesinit(3).Y()); if (boucle==2) Us2=knots(knots.Length()-1)+Us2*(1-knots(knots.Length()-1)); diff --git a/src/IGESControl/IGESControl_IGESBoundary.cxx b/src/IGESControl/IGESControl_IGESBoundary.cxx index ef2e2837e8..c6082df9ee 100755 --- a/src/IGESControl/IGESControl_IGESBoundary.cxx +++ b/src/IGESControl/IGESControl_IGESBoundary.cxx @@ -204,14 +204,14 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW, else if (( surfcurv == -3 && len3d > 0) || len2d == 0) GTranslate2d = Standard_False; - if (GTranslate3d && GTranslate2d) + if (GTranslate3d && GTranslate2d) { //Setting preference in the case of inconsitency between 3D and 2D if (surfcurv == 2) Preferred3d = Standard_False; else if (surfcurv == 3) Preferred2d = Standard_False; else if (myfilepreference == 2) Preferred3d = Standard_False; else if (myfilepreference == 3) Preferred2d = Standard_False; else Preferred3d = Standard_False; - + } if (GTranslate3d && GTranslate2d && len3d != len2d) { GTranslate3d = Preferred3d; GTranslate2d = Preferred2d; diff --git a/src/IGESDefs/IGESDefs_ToolAttributeTable.cxx b/src/IGESDefs/IGESDefs_ToolAttributeTable.cxx index d26d1ef270..b53c666112 100755 --- a/src/IGESDefs/IGESDefs_ToolAttributeTable.cxx +++ b/src/IGESDefs/IGESDefs_ToolAttributeTable.cxx @@ -281,10 +281,11 @@ void IGESDefs_ToolAttributeTable::OwnCheck (const Handle(IGESDefs_AttributeTable)& ent, const Interface_ShareTool& , Handle(Interface_Check)& ach) const { - if (ent->Definition().IsNull()) + if (ent->Definition().IsNull()) { if (ent->HasStructure()) ach->AddFail ("Structure in Directory Entry is not an Attribute Definition Table"); else ach->AddFail("No Attribute Definition defined"); + } if (ent->FormNumber() == 0 && ent->NbRows() != 1) ach->AddFail("Form 0 with several Rows"); if (ent->NbAttributes() != ent->Definition()->NbAttributes()) diff --git a/src/IGESToBRep/IGESToBRep_IGESBoundary.cxx b/src/IGESToBRep/IGESToBRep_IGESBoundary.cxx index c72a744945..2383ad7abc 100755 --- a/src/IGESToBRep/IGESToBRep_IGESBoundary.cxx +++ b/src/IGESToBRep/IGESToBRep_IGESBoundary.cxx @@ -168,12 +168,12 @@ IGESToBRep_IGESBoundary::IGESToBRep_IGESBoundary(const IGESToBRep_CurveAndSurfac else if (len2d == 0) GTranslate2d = Standard_False; - if (GTranslate3d && GTranslate2d) + if (GTranslate3d && GTranslate2d) { //Setting preference in the case of inconsitency between 3D and 2D if (myfilepreference == 2) Preferred3d = Standard_False; else if (myfilepreference == 3) Preferred2d = Standard_False; else Preferred3d = Standard_False; - + } if (GTranslate3d && GTranslate2d && len3d != len2d) { GTranslate3d = Preferred3d; GTranslate2d = Preferred2d; diff --git a/src/IntPatch/IntPatch_RstInt.cxx b/src/IntPatch/IntPatch_RstInt.cxx index ae33cf20b5..632927d494 100755 --- a/src/IntPatch/IntPatch_RstInt.cxx +++ b/src/IntPatch/IntPatch_RstInt.cxx @@ -807,16 +807,16 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L, } if (!duplicate) { - Standard_Integer ParamApproxOnLine = Standard_Integer(W1[ip])+1; - - arc->D1(paramarc,p2d,d2d); - U1 = p2d.X(); V1 = p2d.Y(); - if (typL == IntPatch_Walking && SurfaceIsPeriodic) - if (OnFirst) - Recadre(TypeS1,TypeS2,wlin,ParamApproxOnLine,U1,V1,U2,V2); - else - Recadre(TypeS1,TypeS2,wlin,ParamApproxOnLine,U2,V2,U1,V1); - + Standard_Integer ParamApproxOnLine = Standard_Integer(W1[ip])+1; + + arc->D1(paramarc,p2d,d2d); + U1 = p2d.X(); V1 = p2d.Y(); + if (typL == IntPatch_Walking && SurfaceIsPeriodic) { + if (OnFirst) + Recadre(TypeS1,TypeS2,wlin,ParamApproxOnLine,U1,V1,U2,V2); + else + Recadre(TypeS1,TypeS2,wlin,ParamApproxOnLine,U2,V2,U1,V1); + } locpt.Append(ptsommet); locpt2.Append(gp_Pnt2d(U2,V2)); diff --git a/src/IntPolyh/IntPolyh_MaillageAffinage.cxx b/src/IntPolyh/IntPolyh_MaillageAffinage.cxx index e51bac1040..b058c187e4 100755 --- a/src/IntPolyh/IntPolyh_MaillageAffinage.cxx +++ b/src/IntPolyh/IntPolyh_MaillageAffinage.cxx @@ -2936,16 +2936,17 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact2 else SP1.SetEdge1(-1); } else { - PI=PE1+Edge*lambda; - if(TriSurfID==1) - if(Tri2.GetEdgeOrientation(EdgeIndex)>0) - SP1.SetLambda2(lambda); - else SP1.SetLambda2(1.0-lambda); - if(TriSurfID==2) - if(Tri1.GetEdgeOrientation(EdgeIndex)>0) - SP1.SetLambda1(lambda); - else SP1.SetLambda1(1.0-lambda); - + PI=PE1+Edge*lambda; + if(TriSurfID==1) { + if(Tri2.GetEdgeOrientation(EdgeIndex)>0) + SP1.SetLambda2(lambda); + else SP1.SetLambda2(1.0-lambda); + } + if(TriSurfID==2) { + if(Tri1.GetEdgeOrientation(EdgeIndex)>0) + SP1.SetLambda1(lambda); + else SP1.SetLambda1(1.0-lambda); + } } Standard_Real Cote23X=Cote23.X(); diff --git a/src/IntSurf/IntSurf_Quadric.cdl b/src/IntSurf/IntSurf_Quadric.cdl index 1e81dc2818..81a324dfec 100755 --- a/src/IntSurf/IntSurf_Quadric.cdl +++ b/src/IntSurf/IntSurf_Quadric.cdl @@ -186,11 +186,11 @@ fields ax3 : Ax3 from gp; lin : Lin from gp; + typ : SurfaceType from GeomAbs; prm1 : Real from Standard; prm2 : Real from Standard; prm3 : Real from Standard; prm4 : Real from Standard; ax3direc : Boolean from Standard; - typ : SurfaceType from GeomAbs; end Quadric; diff --git a/src/MeshVS/MeshVS_Mesh.cxx b/src/MeshVS/MeshVS_Mesh.cxx index e44d2869b0..7f951a17bf 100755 --- a/src/MeshVS/MeshVS_Mesh.cxx +++ b/src/MeshVS/MeshVS_Mesh.cxx @@ -319,7 +319,7 @@ void MeshVS_Mesh::ComputeSelection ( const Handle(SelectMgr_Selection)& theSelec TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap ); for( ; anIterN.More(); anIterN.Next() ) - if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) ) + if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) ) { if( first ) { for( Standard_Integer i=1; i<=3; i++ ) @@ -334,6 +334,7 @@ void MeshVS_Mesh::ComputeSelection ( const Handle(SelectMgr_Selection)& theSelec if( aCoords( i )>max[i-1] ) max[i-1] = aCoords( i ); } + } Bnd_Box box; box.Add( gp_Pnt( min[0], min[1], min[2] ) ); box.Add( gp_Pnt( max[0], max[1], max[2] ) ); diff --git a/src/MeshVS/MeshVS_MeshPrsBuilder.cxx b/src/MeshVS/MeshVS_MeshPrsBuilder.cxx index 412544dded..505bfc66a6 100755 --- a/src/MeshVS/MeshVS_MeshPrsBuilder.cxx +++ b/src/MeshVS/MeshVS_MeshPrsBuilder.cxx @@ -854,7 +854,7 @@ void MeshVS_MeshPrsBuilder::HowManyPrimitives (const Handle(MeshVS_HArray1OfSequ Standard_Integer& Vertices, Standard_Integer& Bounds) { - if( !Topo.IsNull() ) + if( !Topo.IsNull() ) { if( AsPolygons || IsSelect ) { Standard_Integer B = Topo->Upper()-Topo->Lower()+1; @@ -874,6 +874,7 @@ void MeshVS_MeshPrsBuilder::HowManyPrimitives (const Handle(MeshVS_HArray1OfSequ Bounds += E; Vertices += 2*E; } + } } //================================================================ diff --git a/src/NCollection/NCollection_BaseSequence.cxx b/src/NCollection/NCollection_BaseSequence.cxx index 6fe6662023..d485fa354b 100755 --- a/src/NCollection/NCollection_BaseSequence.cxx +++ b/src/NCollection/NCollection_BaseSequence.cxx @@ -209,7 +209,7 @@ void NCollection_BaseSequence::PInsertAfter (const Standard_Integer theIndex, { if (theIndex < 0 || theIndex > mySize) Standard_OutOfRange::Raise(); - if (Other.mySize != 0) + if (Other.mySize != 0) { if (theIndex == 0) PPrepend (Other); else { @@ -226,6 +226,7 @@ void NCollection_BaseSequence::PInsertAfter (const Standard_Integer theIndex, myCurrentIndex += Other.mySize; Other.Nullify(); } + } } //======================================================================= diff --git a/src/NIS/NIS_InteractiveObject.cxx b/src/NIS/NIS_InteractiveObject.cxx index 793e1ae0a6..ee81b721fc 100755 --- a/src/NIS/NIS_InteractiveObject.cxx +++ b/src/NIS/NIS_InteractiveObject.cxx @@ -47,7 +47,7 @@ const Handle_NIS_Drawer& NIS_InteractiveObject::SetDrawer const Standard_Boolean setUpdated) { NIS_InteractiveContext * aCtx = theDrawer->GetContext(); - if (myDrawer.IsNull() == Standard_False) + if (myDrawer.IsNull() == Standard_False) { if (aCtx == 0L) { aCtx = myDrawer->GetContext(); @@ -59,6 +59,7 @@ const Handle_NIS_Drawer& NIS_InteractiveObject::SetDrawer (myDrawer->GetContext() != 0L && aCtx != myDrawer->GetContext(), "NIS_InteractiveObject::SetDrawer: different drawer context"); } + } Standard_NullValue_Raise_if (aCtx == 0L, "NIS_InteractiveObject::SetDrawer: NULL drawer context"); diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx index b9842105b5..09cd4a562a 100644 --- a/src/OpenGl/OpenGl_Context.cxx +++ b/src/OpenGl/OpenGl_Context.cxx @@ -93,8 +93,8 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps) myReleaseQueue (new OpenGl_ResourcesQueue()), myGlLibHandle (NULL), myGlCore20 (NULL), - myMaxTexDim (1024), myAnisoMax (1), + myMaxTexDim (1024), myGlVerMajor (0), myGlVerMinor (0), myIsFeedback (Standard_False), diff --git a/src/OpenGl/OpenGl_PrinterContext.cxx b/src/OpenGl/OpenGl_PrinterContext.cxx index 8c2d2be383..22ae43eaad 100644 --- a/src/OpenGl/OpenGl_PrinterContext.cxx +++ b/src/OpenGl/OpenGl_PrinterContext.cxx @@ -30,8 +30,8 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_PrinterContext, Standard_Transient) OpenGl_PrinterContext::OpenGl_PrinterContext() : myProjTransform (0, 3, 0, 3), myLayerViewportX (0), - myLayerViewportY (0), myScaleX (1.0f), + myLayerViewportY (0), myScaleY (1.0f) { // identity projection matrix diff --git a/src/OpenGl/OpenGl_View.cxx b/src/OpenGl/OpenGl_View.cxx index d7ccb54246..d181b751c9 100644 --- a/src/OpenGl/OpenGl_View.cxx +++ b/src/OpenGl/OpenGl_View.cxx @@ -101,8 +101,8 @@ OpenGl_View::OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext) myIntShadingMethod(TEL_SM_GOURAUD), myAntiAliasing(Standard_False), myTransPers(&myDefaultTransPers), - myIsTransPers(Standard_False), myTrihedron(NULL), + myIsTransPers(Standard_False), myGraduatedTrihedron(NULL) { // Initialize matrices diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index e9df2b509f..02179dc873 100755 --- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -199,34 +199,38 @@ static gp_Pnt2d Function_Value(const Standard_Real U, if(Surf->IsVPeriodic() || Surf->IsVClosed()) { vperiod = Surf->LastVParameter() - Surf->FirstVParameter(); } - if(U0 < Uinf) + if(U0 < Uinf) { if(!uperiod) U0 = Uinf; else { decalU = int((Uinf - U0)/uperiod)+1; U0 += decalU*uperiod; } - if(U0 > Usup) + } + if(U0 > Usup) { if(!uperiod) U0 = Usup; else { decalU = -(int((U0 - Usup)/uperiod)+1); U0 += decalU*uperiod; } - if(V0 < Vinf) + } + if(V0 < Vinf) { if(!vperiod) V0 = Vinf; else { decalV = int((Vinf - V0)/vperiod)+1; V0 += decalV*vperiod; } - if(V0 > Vsup) + } + if(V0 > Vsup) { if(!vperiod) V0 = Vsup; else { decalV = -int((V0 - Vsup)/vperiod)-1; V0 += decalV*vperiod; } + } // The surface around U0 is reduced Standard_Real uLittle = (Usup - Uinf)/10, vLittle = (Vsup - Vinf)/10; @@ -759,44 +763,46 @@ Handle(Adaptor2d_HCurve2d) case GeomAbs_Cylinder: { // Standard_Real Sloc, Tloc; - Standard_Real Sloc; - Standard_Integer usens = 0; - gp_Cylinder Cylinder = Surf->Cylinder(); - ElSLib::Parameters( Cylinder, Pts(1), S, T); - Pts2d(1).SetCoord(S,T); - for ( i = 2 ; i <= NbOfPnts ; i++) { - Sloc = S; - ElSLib::Parameters( Cylinder, Pts(i), S, T); - if(Abs(Sloc - S) > M_PI) - if(Sloc > S) - usens++; - else - usens--; - Pts2d(i).SetCoord(S+usens*2*M_PI,T); - } - myProjIsDone = Standard_True; - break; + Standard_Real Sloc; + Standard_Integer usens = 0; + gp_Cylinder Cylinder = Surf->Cylinder(); + ElSLib::Parameters( Cylinder, Pts(1), S, T); + Pts2d(1).SetCoord(S,T); + for ( i = 2 ; i <= NbOfPnts ; i++) { + Sloc = S; + ElSLib::Parameters( Cylinder, Pts(i), S, T); + if(Abs(Sloc - S) > M_PI) { + if(Sloc > S) + usens++; + else + usens--; + } + Pts2d(i).SetCoord(S+usens*2*M_PI,T); + } + myProjIsDone = Standard_True; + break; } case GeomAbs_Cone: { // Standard_Real Sloc, Tloc; - Standard_Real Sloc; - Standard_Integer usens = 0; - gp_Cone Cone = Surf->Cone(); - ElSLib::Parameters( Cone, Pts(1), S, T); - Pts2d(1).SetCoord(S,T); - for ( i = 2 ; i <= NbOfPnts ; i++) { - Sloc = S; - ElSLib::Parameters( Cone, Pts(i), S, T); - if(Abs(Sloc - S) > M_PI) - if(Sloc > S) - usens++; - else - usens--; - Pts2d(i).SetCoord(S+usens*2*M_PI,T); - } - myProjIsDone = Standard_True; - break; + Standard_Real Sloc; + Standard_Integer usens = 0; + gp_Cone Cone = Surf->Cone(); + ElSLib::Parameters( Cone, Pts(1), S, T); + Pts2d(1).SetCoord(S,T); + for ( i = 2 ; i <= NbOfPnts ; i++) { + Sloc = S; + ElSLib::Parameters( Cone, Pts(i), S, T); + if(Abs(Sloc - S) > M_PI) { + if(Sloc > S) + usens++; + else + usens--; + } + Pts2d(i).SetCoord(S+usens*2*M_PI,T); + } + myProjIsDone = Standard_True; + break; } case GeomAbs_Sphere: { @@ -809,11 +815,12 @@ Handle(Adaptor2d_HCurve2d) for ( i = 2 ; i <= NbOfPnts ; i++) { Sloc = S;Tloc = T; ElSLib::Parameters( Sphere, Pts(i), S, T); - if(1.6*M_PI < Abs(Sloc - S)) + if(1.6*M_PI < Abs(Sloc - S)) { if(Sloc > S) usens += 2; else usens -= 2; + } if(1.6*M_PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4*M_PI) { vparit = !vparit; if(Sloc > S) @@ -846,16 +853,18 @@ Handle(Adaptor2d_HCurve2d) for ( i = 2 ; i <= NbOfPnts ; i++) { Sloc = S; Tloc = T; ElSLib::Parameters( Torus, Pts(i), S, T); - if(Abs(Sloc - S) > M_PI) + if(Abs(Sloc - S) > M_PI) { if(Sloc > S) usens++; else usens--; - if(Abs(Tloc - T) > M_PI) + } + if(Abs(Tloc - T) > M_PI) { if(Tloc > T) vsens++; else vsens--; + } Pts2d(i).SetCoord(S+usens*2*M_PI,T+vsens*2*M_PI); } myProjIsDone = Standard_True; @@ -1159,7 +1168,7 @@ Handle(Adaptor2d_HCurve2d) if (Dist2Min < DistTol3d * DistTol3d) { //if (Dist2Min < Tol3d * Tol3d) { (ext.Point(GoodValue)).Parameter(u,v); - if(uperiod) + if(uperiod) { if((U0 - u) > (2*uperiod/3)) { usens++; } @@ -1167,7 +1176,8 @@ Handle(Adaptor2d_HCurve2d) if((u - U0) > (2*uperiod/3)) { usens--; } - if(vperiod) + } + if(vperiod) { if((V0 - v) > (vperiod/2)) { vsens++; } @@ -1175,6 +1185,7 @@ Handle(Adaptor2d_HCurve2d) if((v - V0) > (vperiod/2)) { vsens--; } + } U0 = u; V0 = v; U1 = U0 + usens*uperiod; V1 = V0 + vsens*vperiod; diff --git a/src/QANewBRepNaming/QANewBRepNaming_Gluing.cxx b/src/QANewBRepNaming/QANewBRepNaming_Gluing.cxx index 939ea1b2f5..14ecf9a011 100755 --- a/src/QANewBRepNaming/QANewBRepNaming_Gluing.cxx +++ b/src/QANewBRepNaming/QANewBRepNaming_Gluing.cxx @@ -309,33 +309,33 @@ void QANewBRepNaming_Gluing::RecomputeUnique(QANewModTopOpe_Glue& theMkGluing) { if (aNext == 0) anEdgesIterator.Initialize(theMkGluing.Generated(aFullEdge)); else anEdgesIterator.Initialize(theMkGluing.Modified(aFullEdge)); for (;anEdgesIterator.More();anEdgesIterator.Next()) - if (anEdgesIterator.Value().ShapeType() == TopAbs_EDGE) { - TopoDS_Edge aDivEdge = TopoDS::Edge(anEdgesIterator.Value()); - if (!TopExp::FirstVertex(aDivEdge).IsNull()) { // divided edge must have at least one vertex - if (TopExp::FirstVertex(aFullEdge).IsNull()) AddToTheUnique(aDivEdge,aFullEdge); - else if (!TopExp::LastVertex(aDivEdge).IsNull())//if full edge have at least one vertex, subedges must have two - if (TopExp::LastVertex(aFullEdge).IsNull()) { - if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)). - IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion())) - AddToTheUnique(aDivEdge,aFullEdge); - else if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)). - IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) - AddToTheUnique(aDivEdge,aFullEdge); - } else { - Standard_Integer aCounter = 0; - if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)). - IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()) || - BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)). - IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) aCounter++; - if (BRep_Tool::Pnt(TopExp::LastVertex(aFullEdge)). - IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()) || - BRep_Tool::Pnt(TopExp::LastVertex(aFullEdge)). - IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) aCounter++; - if (aCounter!=2) AddToTheUnique(aDivEdge,aFullEdge); - } - } - } - + if (anEdgesIterator.Value().ShapeType() == TopAbs_EDGE) { + TopoDS_Edge aDivEdge = TopoDS::Edge(anEdgesIterator.Value()); + if (!TopExp::FirstVertex(aDivEdge).IsNull()) { // divided edge must have at least one vertex + if (TopExp::FirstVertex(aFullEdge).IsNull()) AddToTheUnique(aDivEdge,aFullEdge); + else if (!TopExp::LastVertex(aDivEdge).IsNull()) {//if full edge have at least one vertex, subedges must have two + if (TopExp::LastVertex(aFullEdge).IsNull()) { + if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)). + IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion())) + AddToTheUnique(aDivEdge,aFullEdge); + else if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)). + IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) + AddToTheUnique(aDivEdge,aFullEdge); + } else { + Standard_Integer aCounter = 0; + if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)). + IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()) || + BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)). + IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) aCounter++; + if (BRep_Tool::Pnt(TopExp::LastVertex(aFullEdge)). + IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()) || + BRep_Tool::Pnt(TopExp::LastVertex(aFullEdge)). + IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) aCounter++; + if (aCounter!=2) AddToTheUnique(aDivEdge,aFullEdge); + } + } + } + } } } aNext = 2; diff --git a/src/QANewModTopOpe/QANewModTopOpe_Glue.cxx b/src/QANewModTopOpe/QANewModTopOpe_Glue.cxx index 5d30478850..5335c8f6ab 100755 --- a/src/QANewModTopOpe/QANewModTopOpe_Glue.cxx +++ b/src/QANewModTopOpe/QANewModTopOpe_Glue.cxx @@ -98,8 +98,8 @@ QANewModTopOpe_Glue::QANewModTopOpe_Glue(const TopoDS_Shape& theS1, const Standard_Boolean theAllowCutting, const Standard_Boolean thePerformNow) : BRepAlgoAPI_BooleanOperation (theS1,theS2, BOPAlgo_FUSE), - myAllowCutting (theAllowCutting), - myCompleted (Standard_False) + myCompleted (Standard_False), + myAllowCutting (theAllowCutting) { NotDone(); myGenerated.Clear(); diff --git a/src/QANewModTopOpe/QANewModTopOpe_Limitation.cxx b/src/QANewModTopOpe/QANewModTopOpe_Limitation.cxx index 4794e690e4..55ce31cca8 100755 --- a/src/QANewModTopOpe/QANewModTopOpe_Limitation.cxx +++ b/src/QANewModTopOpe/QANewModTopOpe_Limitation.cxx @@ -57,8 +57,8 @@ QANewModTopOpe_Limitation::QANewModTopOpe_Limitation(const TopoDS_Shape& theObje myObjectToCut(theObjectToCut), myFwdIsDone(Standard_False), myRevIsDone(Standard_False), - myMode(theMode), myCut(NULL), + myMode(theMode), myCommon(NULL) { diff --git a/src/Resource/Resource_Manager.cxx b/src/Resource/Resource_Manager.cxx index 34312052df..153a476867 100755 --- a/src/Resource/Resource_Manager.cxx +++ b/src/Resource/Resource_Manager.cxx @@ -222,9 +222,10 @@ static Standard_Integer GetLine(OSD_File& aFile,TCollection_AsciiString& aLine) do { aFile.ReadLine(Buffer,BufSize,Len); aLine += Buffer; - if (aFile.IsAtEnd()) + if (aFile.IsAtEnd()) { if (!aLine.Length()) return 0; else aLine += "\n"; + } } while (aLine.Value(aLine.Length()) != '\n'); return 1; diff --git a/src/STEPControl/STEPControl_ActorWrite.cxx b/src/STEPControl/STEPControl_ActorWrite.cxx index d713de5a07..728995a70e 100755 --- a/src/STEPControl/STEPControl_ActorWrite.cxx +++ b/src/STEPControl/STEPControl_ActorWrite.cxx @@ -1339,12 +1339,13 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound (const Handle(T while ( !bnd.IsNull() ) { Handle(Transfer_SimpleBinderOfTransient) bx = Handle(Transfer_SimpleBinderOfTransient)::DownCast(bnd); - if ( !bx.IsNull() ) + if ( !bx.IsNull() ) { // Single SDR is created for a non-manifold group (ssv: 12.11.2010) if (!isManifold && i > 1) break; else binder->AddResult( TransientResult( bx->Result() ) ); + } bnd = bnd->NextResult(); } } diff --git a/src/SWDRAW/SWDRAW_ShapeFix.cxx b/src/SWDRAW/SWDRAW_ShapeFix.cxx index a5051beedc..c690b36546 100755 --- a/src/SWDRAW/SWDRAW_ShapeFix.cxx +++ b/src/SWDRAW/SWDRAW_ShapeFix.cxx @@ -264,10 +264,11 @@ static Standard_Integer stwire (Draw_Interpretor& di, Standard_Integer argc, con if (BRep_Tool::Degenerated(E)) di<<" DGNR"; if (sbwd->IsSeam(i)) di<<" SEAM_WIRE"; if (Shape.ShapeType() == TopAbs_FACE && - sae.IsSeam(E,TopoDS::Face(Shape))) di<<" SEAM_FACE"; - if (Shape.ShapeType() == TopAbs_FACE ) - if (sae.HasPCurve(E,TopoDS::Face(Shape))) di<<" PCU"; - else di<<" NO_PCU"; + sae.IsSeam(E,TopoDS::Face(Shape))) di<<" SEAM_FACE"; + if (Shape.ShapeType() == TopAbs_FACE ) { + if (sae.HasPCurve(E,TopoDS::Face(Shape))) di<<" PCU"; + else di<<" NO_PCU"; + } if (sae.HasCurve3d(E)) di<<" C3D"; else di<<" NO_C3D"; if (sae.IsClosed3d(E)) di<<" CLOSED"; diff --git a/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx b/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx index 9e0334aec6..99b51542c2 100755 --- a/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx +++ b/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx @@ -1150,21 +1150,25 @@ static Standard_Integer splitface Standard_Real Umin, Umax, Vmin, Vmax; S->Bounds ( Umin, Umax, Vmin, Vmax ); if ( Uf < Umin && ! S->IsUPeriodic() ) Uf = Umin; - else if ( Uf > Umin ) + else if ( Uf > Umin ) { if ( Precision::IsInfinite(Umin) ) Uf -= 100; else Uf = Umin; + } if ( Vf < Vmin && ! S->IsVPeriodic() ) Vf = Vmin; - else if ( Vf > Vmin ) + else if ( Vf > Vmin ) { if ( Precision::IsInfinite(Vmin) ) Vf -= 100; else Vf = Vmin; + } if ( Ul > Umax && ! S->IsUPeriodic() ) Ul = Umax; - else if ( Ul < Umax ) + else if ( Ul < Umax ) { if ( Precision::IsInfinite(Umax) ) Ul += 100; else Ul = Umax; + } if ( Vl > Vmax && ! S->IsVPeriodic() ) Vl = Vmax; - else if ( Vl < Vmax ) + else if ( Vl < Vmax ) { if ( Precision::IsInfinite(Vmax) ) Vl += 100; else Vl = Vmax; + } TColStd_SequenceOfReal uval; TColStd_SequenceOfReal vval; diff --git a/src/SelectMgr/SelectMgr_EntityOwner.cxx b/src/SelectMgr/SelectMgr_EntityOwner.cxx index e4217ed655..7714b386bc 100755 --- a/src/SelectMgr/SelectMgr_EntityOwner.cxx +++ b/src/SelectMgr/SelectMgr_EntityOwner.cxx @@ -87,11 +87,12 @@ void SelectMgr_EntityOwner::HilightWithColor(const Handle(PrsMgr_PresentationMan const Quantity_NameOfColor aColor, const Standard_Integer aMode) { - if( HasSelectable() ) + if( HasSelectable() ) { if( IsAutoHilight() ) PM->Color(mySelectable,aColor,aMode); else mySelectable->HilightOwnerWithColor( PM, aColor, this ); + } } void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM, diff --git a/src/SelectMgr/SelectMgr_SelectableObject.cxx b/src/SelectMgr/SelectMgr_SelectableObject.cxx index 87d1b4b66d..540d8b7b8b 100755 --- a/src/SelectMgr/SelectMgr_SelectableObject.cxx +++ b/src/SelectMgr/SelectMgr_SelectableObject.cxx @@ -182,7 +182,7 @@ void SelectMgr_SelectableObject::ResetLocation() for(Sel->Init();Sel->More();Sel->Next()){ SE = *((Handle(Select3D_SensitiveEntity)*) &(Sel->Sensitive())); if(!SE.IsNull()){ - if(SE->HasLocation()) + if(SE->HasLocation()) { if( SE->Location()==myLocation){ SE->ResetLocation(); const Handle(SelectBasics_EntityOwner)& EO = SE->OwnerId(); @@ -192,7 +192,7 @@ void SelectMgr_SelectableObject::ResetLocation() SE->SetLocation(iniloc*myLocation.Inverted()); const Handle(SelectBasics_EntityOwner)& EO = SE->OwnerId(); (*((Handle(SelectMgr_EntityOwner)*)&EO))->SetLocation(SE->Location());} - + } } } Sel->UpdateStatus(SelectMgr_TOU_None); diff --git a/src/ShapeAnalysis/ShapeAnalysis_BoxBndTree.hxx b/src/ShapeAnalysis/ShapeAnalysis_BoxBndTree.hxx index 70e770fff8..8c3ea6594c 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_BoxBndTree.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_BoxBndTree.hxx @@ -100,7 +100,6 @@ class ShapeAnalysis_BoxBndTreeSelector Bnd_Box myLBox; Handle (TopTools_HArray1OfShape) mySeq; Standard_Boolean myShared; - Standard_Integer myStatus; Standard_Integer myNb; TopoDS_Vertex myFVertex; TopoDS_Vertex myLVertex; @@ -110,6 +109,8 @@ class ShapeAnalysis_BoxBndTreeSelector Standard_Real myTol; Standard_Real myMin3d; TColStd_Array1OfInteger myArrIndices; + Standard_Integer myStatus; + }; #endif diff --git a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx index 779d9bb2ad..e7fbcf899b 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx @@ -374,12 +374,13 @@ static Standard_Boolean MinMaxSmall else return Standard_False; } // Now, check these two edge to define a strip ! - if (!E1.IsNull()&&!E2.IsNull()) + if (!E1.IsNull()&&!E2.IsNull()) { if(!CheckStripEdges (E1,E2,tol,dmax)) return Standard_False; - else { - myStatusStrip = ShapeExtend::EncodeStatus (ShapeExtend_DONE3); - return Standard_True ; - } + else { + myStatusStrip = ShapeExtend::EncodeStatus (ShapeExtend_DONE3); + return Standard_True ; + } + } return Standard_False; } diff --git a/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx b/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx index aa3089560a..9988e672f2 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx @@ -147,12 +147,13 @@ Handle(TColStd_HSequenceOfReal) ShapeAnalysis_TransferParametersProj::Perform } //pdn correcting on periodic - if(myCurve->IsClosed()) + if(myCurve->IsClosed()) { for(j = len; j >=1; j--) - if(resKnots->Value(j) < maxPar) - resKnots->SetValue(j,(To2d ? myAC3d.LastParameter() : myCurve->LastParameter())-(len-j)*preci); + if(resKnots->Value(j) < maxPar) + resKnots->SetValue(j,(To2d ? myAC3d.LastParameter() : myCurve->LastParameter())-(len-j)*preci); else - break; + break; + } //pdn correction on range for ( j=1; j <= len; j++ ) { if ( resKnots->Value (j) < first ) resKnots->SetValue ( j, first ); diff --git a/src/ShapeCustom/ShapeCustom_ConvertToBSpline.cxx b/src/ShapeCustom/ShapeCustom_ConvertToBSpline.cxx index 5aef17e6a5..93d837e0d0 100755 --- a/src/ShapeCustom/ShapeCustom_ConvertToBSpline.cxx +++ b/src/ShapeCustom/ShapeCustom_ConvertToBSpline.cxx @@ -60,7 +60,7 @@ Standard_Boolean ShapeCustom_ConvertToBSpline::IsToConvert(const Handle(Geom_Sur Handle(Geom_RectangularTrimmedSurface)::DownCast ( S ); SS = RTS->BasisSurface(); } - if(SS->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) + if(SS->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) { if(myOffsetMode) return Standard_True; else { @@ -69,6 +69,7 @@ Standard_Boolean ShapeCustom_ConvertToBSpline::IsToConvert(const Handle(Geom_Sur Handle(Geom_Surface) tmp; return IsToConvert(basis,tmp); } + } if ( SS->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion)) ) return myExtrMode; if ( SS->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution)) ) diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index 435cf3524c..9386e96875 100755 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -666,9 +666,10 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode (const Handle(ShapeExtend_Wi } } if ( j < np ) { i = 0; break; } // not tangency - if ( i == endInd ) + if ( i == endInd ) { if ( special <=0 ) break; else special = -1; + } } if ( myClosedMode ) { if ( code != IOR_UNDEF && ! begin ) { diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx index 9043a1d887..6349c0177e 100755 --- a/src/ShapeFix/ShapeFix_Face.cxx +++ b/src/ShapeFix/ShapeFix_Face.cxx @@ -1399,16 +1399,18 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() if ( ::Precision::IsInfinite ( SUF ) || ::Precision::IsInfinite ( SUL ) ) { if ( ::Precision::IsInfinite ( SUF ) ) SUF = fU1; if ( ::Precision::IsInfinite ( SUL ) ) SUL = fU2; - if(Abs(SUL-SUF) < ::Precision::PConfusion()) + if(Abs(SUL-SUF) < ::Precision::PConfusion()) { if ( ::Precision::IsInfinite ( SUF ) ) SUF-=1000.; else SUL+=1000.; + } } if ( ::Precision::IsInfinite ( SVF ) || ::Precision::IsInfinite ( SVL ) ) { if ( ::Precision::IsInfinite ( SVF ) ) SVF = fV1; if ( ::Precision::IsInfinite ( SVL ) ) SVL = fV2; - if(Abs(SVL-SVF) < ::Precision::PConfusion()) + if(Abs(SVL-SVF) < ::Precision::PConfusion()) { if ( ::Precision::IsInfinite ( SVF ) ) SVF-=1000.; else SVL+=1000.; + } } URange = Abs ( SUL - SUF ); @@ -1629,9 +1631,10 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() vf = pos1.Y(); } } - if ( skipU && skipV ) + if ( skipU && skipV ) { if ( i1 <= nb1 ) continue; else break; + } // or yet better - if it is end of some edges on both wires for ( Standard_Integer i2 = 1; i1 <= nb1 && i2 <= nb2; i2++ ) { TopoDS_Edge edge2 = wd2->Edge ( i2 ); diff --git a/src/ShapeFix/ShapeFix_Wire.cxx b/src/ShapeFix/ShapeFix_Wire.cxx index 7903053f47..c108909074 100755 --- a/src/ShapeFix/ShapeFix_Wire.cxx +++ b/src/ShapeFix/ShapeFix_Wire.cxx @@ -1302,9 +1302,10 @@ Standard_Boolean ShapeFix_Wire::FixShifted() SVMid = 0.5*(SVF+SVL); if (uclosed) URange = Abs ( SUL - SUF ); else URange = RealLast(); - if (!IsVCrvClosed) + if (!IsVCrvClosed) { if (vclosed) VRange = Abs ( SVL - SVF ); else VRange = RealLast(); + } Standard_Real UTol = 0.2 * URange, VTol = 0.2 * VRange; Handle(ShapeExtend_WireData) sbwdOring = WireData(); diff --git a/src/ShapeProcess/ShapeProcess_ShapeContext.cxx b/src/ShapeProcess/ShapeProcess_ShapeContext.cxx index a63f063fd4..ff2f17f9de 100755 --- a/src/ShapeProcess/ShapeProcess_ShapeContext.cxx +++ b/src/ShapeProcess/ShapeProcess_ShapeContext.cxx @@ -414,9 +414,11 @@ void ShapeProcess_ShapeContext::PrintStatistics () const if (valueshape.IsNull()) SN++; else SS++; else if (keyshape.ShapeType() == TopAbs_FACE) + { if (valueshape.IsNull()) FN++; else if (valueshape.ShapeType() == TopAbs_SHELL) FS++; else FF++; + } } // mapping diff --git a/src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx b/src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx index c5ddb21f70..4d7c46b028 100755 --- a/src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx +++ b/src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx @@ -110,13 +110,15 @@ void ShapeProcessAPI_ApplySequence::PrintPreparationResult () const Standard_Integer SS = 0, SN = 0, FF = 0, FS = 0, FN = 0; for (TopTools_DataMapIteratorOfDataMapOfShapeShape It (myContext->Map()); It.More(); It.Next()) { TopoDS_Shape keyshape = It.Key(), valueshape = It.Value(); - if (keyshape.ShapeType() == TopAbs_SHELL) + if (keyshape.ShapeType() == TopAbs_SHELL) { if (valueshape.IsNull()) SN++; else SS++; - else if (keyshape.ShapeType() == TopAbs_FACE) + } + else if (keyshape.ShapeType() == TopAbs_FACE) { if (valueshape.IsNull()) FN++; else if (valueshape.ShapeType() == TopAbs_SHELL) FS++; else FF++; + } } Handle(Message_Messenger) aMessenger = myContext->Messenger(); diff --git a/src/TNaming/TNaming_NamedShape.cxx b/src/TNaming/TNaming_NamedShape.cxx index 460781a602..75471694aa 100755 --- a/src/TNaming/TNaming_NamedShape.cxx +++ b/src/TNaming/TNaming_NamedShape.cxx @@ -1017,16 +1017,18 @@ static void SelectSameShape (TNaming_Node*& myNode, else Valid = pdn->IsValidInTrans(Trans); if (Valid) + { if (Old) { - if( pdn->myOld == RS && pdn->myNew != 0L && pdn->myNew != RS) { - break; - } + if( pdn->myOld == RS && pdn->myNew != 0L && pdn->myNew != RS) { + break; + } } else { - if( pdn->myNew == RS && pdn->myOld != 0L && pdn->myOld != RS) { - break; - } + if( pdn->myNew == RS && pdn->myOld != 0L && pdn->myOld != RS) { + break; + } } + } pdn = pdn->NextSameShape(RS); } myNode = pdn; diff --git a/src/TopClass/TopClass_Classifier2d.gxx b/src/TopClass/TopClass_Classifier2d.gxx index 4f99de7ce1..8a37336e77 100755 --- a/src/TopClass/TopClass_Classifier2d.gxx +++ b/src/TopClass/TopClass_Classifier2d.gxx @@ -37,9 +37,8 @@ TopClass_Classifier2d::TopClass_Classifier2d() : myIsSet(Standard_False), myFirstCompare(Standard_True), - myIsHeadOrEnd(Standard_False), // skv OCC12627 - myState(TopAbs_UNKNOWN) // skv OCC12627 - + myState(TopAbs_UNKNOWN), // skv OCC12627 + myIsHeadOrEnd(Standard_False) // skv OCC12627 { } diff --git a/src/TopTrans/TopTrans_SurfaceTransition.cxx b/src/TopTrans/TopTrans_SurfaceTransition.cxx index 395169417a..b9603f791a 100755 --- a/src/TopTrans/TopTrans_SurfaceTransition.cxx +++ b/src/TopTrans/TopTrans_SurfaceTransition.cxx @@ -451,9 +451,10 @@ TopAbs_State TopTrans_SurfaceTransition::StateBefore() const // we take the state before of after orientations before = ::FUN_getstate(myAng,myOri,AFTER,BEFORE); // eap Mar 25 2002 - if (myTouchFlag) + if (myTouchFlag) { if (before == TopAbs_OUT) before = TopAbs_IN; else if (before == TopAbs_IN) before = TopAbs_OUT; + } } return before; } @@ -467,9 +468,10 @@ TopAbs_State TopTrans_SurfaceTransition::StateAfter() const // looking back in before for defined states after = ::FUN_getstate(myAng,myOri,BEFORE,AFTER); // eap Mar 25 2002 - if (myTouchFlag) + if (myTouchFlag) { if (after == TopAbs_OUT) after = TopAbs_IN; else if (after == TopAbs_IN) after = TopAbs_OUT; + } } return after; } diff --git a/src/V3d/V3d_View.cdl b/src/V3d/V3d_View.cdl index aa9cecaf50..9c8b61b695 100755 --- a/src/V3d/V3d_View.cdl +++ b/src/V3d/V3d_View.cdl @@ -1642,6 +1642,8 @@ fields --MyColorScale : ColorScale from V3d; MyLayerMgr : LayerMgr from V3d; + MyProjModel : TypeOfProjectionModel from V3d is protected; + -- the transformation between XoY and the grid plane MyTrsf : Array2OfReal from TColStd; @@ -1649,10 +1651,8 @@ fields MyGridEchoStructure : Structure from Graphic3d; MyGridEchoGroup : Group from Graphic3d; - MyProjModel : TypeOfProjectionModel from V3d is protected; - - MyTransparencyFlag : Boolean from Standard; - myImmediateUpdate: Boolean from Standard is protected; + MyTransparencyFlag : Boolean from Standard; + myImmediateUpdate: Boolean from Standard is protected; friends SetViewOn from class Viewer from V3d ( me : mutable ), diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index ae1675a820..a5537024bf 100755 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -439,13 +439,14 @@ Handle(AIS_Shape) GetAISShapeFromName(const char* name) const Handle(AIS_InteractiveObject) IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name)); if (!IO.IsNull()) { - if(IO->Type()==AIS_KOI_Shape) + if(IO->Type()==AIS_KOI_Shape) { if(IO->Signature()==0){ retsh = *((Handle(AIS_Shape)*)&IO); } else cout << "an Object which is not an AIS_Shape " "already has this name!!!"<SubIntensityOn(IO); else Ctx->SubIntensityOff(IO); - + } } else return 1; } @@ -1121,11 +1122,12 @@ static int VColor2 (Draw_Interpretor& di, Standard_Integer argc, const char** ar while ( it.More() ) { const Handle(AIS_InteractiveObject) ashape = Handle(AIS_InteractiveObject)::DownCast(it.Key1()); - if (!ashape.IsNull()) + if (!ashape.IsNull()) { if(HaveToSet) TheAISContext()->SetColor(ashape,ViewerTest::GetColorFromName(argv[1]),Standard_False); else TheAISContext()->UnsetColor(ashape,Standard_False); + } it.Next(); } TheAISContext()->UpdateCurrentViewer(); @@ -1218,11 +1220,12 @@ static int VTransparency (Draw_Interpretor& di, Standard_Integer argc, while ( it.More() ) { Handle(AIS_InteractiveObject) ashape = Handle(AIS_InteractiveObject)::DownCast(it.Key1()); - if (!ashape.IsNull()) + if (!ashape.IsNull()) { if(HaveToSet) TheAISContext()->SetTransparency(ashape,Draw::Atof(argv[1]),Standard_False); else TheAISContext()->UnsetTransparency(ashape,Standard_False); + } it.Next(); } TheAISContext()->UpdateCurrentViewer(); @@ -1274,11 +1277,12 @@ static int VMaterial (Draw_Interpretor& di, Standard_Integer argc, const char** if ( ThereIsName && IsBound ) { Handle(AIS_InteractiveObject) ashape = Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2(name)); - if (!ashape.IsNull()) + if (!ashape.IsNull()) { if (HaveToSet) TheAISContext()->SetMaterial(ashape,GetMaterialFromName(argv[2])); else TheAISContext()->UnsetMaterial(ashape); + } } //======================================================================= // Il n'y a pas de nom de shape @@ -1308,11 +1312,12 @@ static int VMaterial (Draw_Interpretor& di, Standard_Integer argc, const char** while ( it.More() ) { Handle(AIS_InteractiveObject) ashape = Handle(AIS_InteractiveObject)::DownCast (it.Key1()); - if (!ashape.IsNull()) + if (!ashape.IsNull()) { if (HaveToSet) TheAISContext()->SetMaterial(ashape,GetMaterialFromName(argv[1]),Standard_False); else TheAISContext()->UnsetMaterial(ashape,Standard_False); + } it.Next(); } TheAISContext()->UpdateCurrentViewer(); @@ -1399,15 +1404,16 @@ static int VWidth (Draw_Interpretor& di, Standard_Integer argc, const char** arg else if (!ThereIsCurrent && !ThereIsArgument){ ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName it(GetMapOfAIS()); - while ( it.More() ) { - Handle(AIS_InteractiveObject) ashape = - Handle(AIS_InteractiveObject)::DownCast (it.Key1()); - if (!ashape.IsNull()) - if (HaveToSet) - TheAISContext()->SetWidth(ashape,Draw::Atof(argv[1]),Standard_False); - else - TheAISContext()->UnsetWidth(ashape,Standard_False); - it.Next(); + while ( it.More() ) { + Handle(AIS_InteractiveObject) ashape = + Handle(AIS_InteractiveObject)::DownCast (it.Key1()); + if (!ashape.IsNull()) { + if (HaveToSet) + TheAISContext()->SetWidth(ashape,Draw::Atof(argv[1]),Standard_False); + else + TheAISContext()->UnsetWidth(ashape,Standard_False); + } + it.Next(); } TheAISContext()->UpdateCurrentViewer(); } diff --git a/src/ViewerTest/ViewerTest_EventManager.cxx b/src/ViewerTest/ViewerTest_EventManager.cxx index fd6c570011..8e6ad7d71f 100755 --- a/src/ViewerTest/ViewerTest_EventManager.cxx +++ b/src/ViewerTest/ViewerTest_EventManager.cxx @@ -32,8 +32,8 @@ ViewerTest_EventManager::ViewerTest_EventManager (const Handle(V3d_View)& aView, const Handle(AIS_InteractiveContext)& Ctx) - : myView (aView), - myCtx (Ctx), + : myCtx (Ctx), + myView (aView), myX (-1), myY (-1) {} diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index 60b58c7fec..78cabc8b0e 100755 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -3319,14 +3319,13 @@ private: Standard_Real myX1; Standard_Real myY1; - Standard_Real myHeight; TCollection_AsciiString myText; - TCollection_AsciiString myFontName; + Standard_Real myHeight; + Handle(Visual3d_Layer) myLayer; Quantity_Color myColor; Quantity_Color mySubtitleColor; Aspect_TypeOfDisplayText myType; - Handle(Visual3d_Layer) myLayer; - + TCollection_AsciiString myFontName; }; IMPLEMENT_STANDARD_HANDLE(V3d_TextItem, Visual3d_LayerItem) @@ -3391,10 +3390,10 @@ public: private: Standard_Real myX1, myY1, myX2, myY2; + V3d_LayerMgrPointer myLayerMgr; + Aspect_TypeOfLine myType; Standard_Real myWidth; Standard_Real myTransparency; - Aspect_TypeOfLine myType; - V3d_LayerMgrPointer myLayerMgr; }; IMPLEMENT_STANDARD_HANDLE(V3d_LineItem, Visual3d_LayerItem) diff --git a/src/Voxel/Voxel_FastConverter.cxx b/src/Voxel/Voxel_FastConverter.cxx index 1e07b203e9..47a37640b9 100755 --- a/src/Voxel/Voxel_FastConverter.cxx +++ b/src/Voxel/Voxel_FastConverter.cxx @@ -51,7 +51,7 @@ Voxel_FastConverter::Voxel_FastConverter(const TopoDS_Shape& shape, :myShape(shape),myVoxels(&voxels), myDeflection(deflection), myNbX(nbx),myNbY(nby),myNbZ(nbz), - myNbThreads(nbthreads),myIsBool(2), + myIsBool(2),myNbThreads(nbthreads), myNbTriangles(0), myUseExistingTriangulation(useExistingTriangulation) { @@ -69,7 +69,7 @@ Voxel_FastConverter::Voxel_FastConverter(const TopoDS_Shape& shape, :myShape(shape),myVoxels(&voxels), myDeflection(deflection), myNbX(nbx),myNbY(nby),myNbZ(nbz), - myNbThreads(nbthreads),myIsBool(1), + myIsBool(1),myNbThreads(nbthreads), myNbTriangles(0), myUseExistingTriangulation(useExistingTriangulation) { @@ -87,7 +87,7 @@ Voxel_FastConverter::Voxel_FastConverter(const TopoDS_Shape& shape, :myShape(shape),myVoxels(&voxels), myDeflection(deflection), myNbX(nbx),myNbY(nby),myNbZ(nbz), - myNbThreads(nbthreads),myIsBool(0), + myIsBool(0),myNbThreads(nbthreads), myNbTriangles(0), myUseExistingTriangulation(useExistingTriangulation) { diff --git a/src/VrmlData/VrmlData_Geometry.cxx b/src/VrmlData/VrmlData_Geometry.cxx index fb83e14897..0d638b69c4 100755 --- a/src/VrmlData/VrmlData_Geometry.cxx +++ b/src/VrmlData/VrmlData_Geometry.cxx @@ -563,7 +563,7 @@ VrmlData_ErrorStatus VrmlData_TextureCoordinate::Read // Match the name with the current word in the stream if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "point")) // Read the body of the data node (comma-separated list of duplets) - if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) + if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) { if (theBuffer.LinePtr[0] != '[') // opening bracket aStatus = VrmlData_VrmlFormatError; else { @@ -591,6 +591,7 @@ VrmlData_ErrorStatus VrmlData_TextureCoordinate::Read } } } + } if (OK(aStatus) && OK(aStatus, readBrace (theBuffer))) { myLength = vecValues.Length(); if (myLength > 0) { @@ -652,7 +653,7 @@ VrmlData_ErrorStatus VrmlData_ArrayVec3d::ReadArray theBuffer.LinePtr++; } // Read the body of the data node (list of triplets) - if (OK(aStatus) && OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) + if (OK(aStatus) && OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) { if (theBuffer.LinePtr[0] != '[') // opening bracket aStatus = VrmlData_VrmlFormatError; else { @@ -679,6 +680,7 @@ VrmlData_ErrorStatus VrmlData_ArrayVec3d::ReadArray } } } + } if (OK(aStatus) && OK(aStatus, readBrace (theBuffer))) { myLength = vecValues.Length(); if (myLength > 0) { diff --git a/src/VrmlData/VrmlData_IndexedFaceSet.cxx b/src/VrmlData/VrmlData_IndexedFaceSet.cxx index e172b532b0..b4d9dfa3a4 100755 --- a/src/VrmlData/VrmlData_IndexedFaceSet.cxx +++ b/src/VrmlData/VrmlData_IndexedFaceSet.cxx @@ -66,11 +66,12 @@ VrmlData_ErrorStatus VrmlData_Faceted::readData (VrmlData_InBuffer& theBuffer) } else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "creaseAngle")) { Standard_Real anAngle; if (OK(aStatus, Scene().ReadReal (theBuffer, anAngle, - Standard_False, Standard_False))) + Standard_False, Standard_False))) { if (anAngle < -Precision::Confusion()*0.001) aStatus = VrmlData_IrrelevantNumber; else myCreaseAngle = anAngle; + } } return aStatus; } diff --git a/src/VrmlData/VrmlData_Node.cxx b/src/VrmlData/VrmlData_Node.cxx index e4997eac06..b87f942932 100755 --- a/src/VrmlData/VrmlData_Node.cxx +++ b/src/VrmlData/VrmlData_Node.cxx @@ -181,11 +181,12 @@ VrmlData_ErrorStatus VrmlData_Node::WriteClosing () const VrmlData_ErrorStatus VrmlData_Node::readBrace (VrmlData_InBuffer& theBuffer) { VrmlData_ErrorStatus aStatus; - if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) + if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) { if (theBuffer.LinePtr[0] == '}') theBuffer.LinePtr++; else aStatus = VrmlData_VrmlFormatError; + } return aStatus; } diff --git a/src/VrmlData/VrmlData_Scene.cxx b/src/VrmlData/VrmlData_Scene.cxx index 6105142c44..851f30e6d1 100755 --- a/src/VrmlData/VrmlData_Scene.cxx +++ b/src/VrmlData/VrmlData_Scene.cxx @@ -208,13 +208,17 @@ VrmlData_ErrorStatus VrmlData_Scene::readLine (VrmlData_InBuffer& theBuffer) theBuffer.Input.getline (theBuffer.Line, sizeof(theBuffer.Line)); theBuffer.LineCount++; const int stat = theBuffer.Input.rdstate(); - if (stat & ios::badbit) + if (stat & ios::badbit) { aStatus = VrmlData_UnrecoverableError; - else if (stat & ios::failbit) - if (stat & ios::eofbit) + } + else if (stat & ios::failbit) { + if (stat & ios::eofbit) { aStatus = VrmlData_EndOfFile; - else + } + else { aStatus = VrmlData_GeneralError; + } + } theBuffer.LinePtr = &theBuffer.Line[0]; theBuffer.IsProcessed = Standard_False; } @@ -449,7 +453,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode TCollection_AsciiString aName; // Read the DEF token to assign the node name - if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) + if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) { if (VRMLDATA_LCOMPARE(theBuffer.LinePtr, "DEF")) { if (VrmlData_Node::OK(aStatus, ReadWord (theBuffer, aName))) aStatus = ReadLine(theBuffer); @@ -457,6 +461,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode theNode.Nullify(); return aStatus; } + } const char * strName = aName.ToCString(); if (aStatus == VrmlData_StatusOK) { @@ -517,7 +522,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode aStatus = ReadWord (theBuffer, aTitle); if (isProto) { aStatus = ReadLine(theBuffer); - if (aStatus == VrmlData_StatusOK) + if (aStatus == VrmlData_StatusOK) { if (theBuffer.LinePtr[0] != '[') aStatus = VrmlData_VrmlFormatError; else { @@ -541,6 +546,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode } } } + } } if (aStatus == VrmlData_StatusOK) aNode = new VrmlData_UnknownNode(* this, @@ -550,19 +556,21 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode } aStatus = ReadLine(theBuffer); if (aNode.IsNull() == Standard_False) { - if (aNode->Name()[0] != '\0') + if (aNode->Name()[0] != '\0') myNamedNodes.Add (aNode); if (theType.IsNull() == Standard_False) if (aNode->IsKind(theType) == Standard_False) aStatus = VrmlData_VrmlFormatError; } - if (aStatus == VrmlData_StatusOK) + if (aStatus == VrmlData_StatusOK) { if (theBuffer.LinePtr[0] == '{') { theBuffer.LinePtr++; theNode = aNode; myAllNodes.Append(aNode); - } else + } else { aStatus = VrmlData_VrmlFormatError; + } + } return aStatus; } @@ -718,13 +726,16 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXYZ theBuffer.LinePtr = endptr; } } - if (aStatus == VrmlData_StatusOK) - if (isScale) + if (aStatus == VrmlData_StatusOK) { + if (isScale) { theXYZ.SetCoord (aVal[0] * myLinearScale, aVal[1] * myLinearScale, aVal[2] * myLinearScale); - else + } + else { theXYZ.SetCoord (aVal[0], aVal[1], aVal[2]); + } + } return aStatus; } @@ -757,11 +768,12 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXY theBuffer.LinePtr = endptr; } } - if (aStatus == VrmlData_StatusOK) + if (aStatus == VrmlData_StatusOK) { if (isScale) theXY.SetCoord (aVal[0] * myLinearScale, aVal[1] * myLinearScale); else theXY.SetCoord (aVal[0], aVal[1]); + } return aStatus; } @@ -778,7 +790,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex { VrmlData_ErrorStatus aStatus; theNBlocks = 0; - if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) + if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) { if (theBuffer.LinePtr[0] != '[') // opening bracket aStatus = VrmlData_VrmlFormatError; else { @@ -845,6 +857,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex } } } + } return aStatus; } @@ -915,7 +928,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteXYZ const char * thePostfix) const { char buf[240]; - if (IsDummyWrite() == Standard_False) + if (IsDummyWrite() == Standard_False) { if (isApplyScale && myLinearScale > Precision::Confusion()) Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X() / myLinearScale, theXYZ.Y() / myLinearScale, theXYZ.Z() / myLinearScale, @@ -923,6 +936,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteXYZ else Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X(), theXYZ.Y(), theXYZ.Z(), thePostfix ? thePostfix : ""); + } return WriteLine (buf); } diff --git a/src/XCAFDoc/XCAFDoc_ColorTool.cxx b/src/XCAFDoc/XCAFDoc_ColorTool.cxx index 84c2a0998d..5a217c61a5 100755 --- a/src/XCAFDoc/XCAFDoc_ColorTool.cxx +++ b/src/XCAFDoc/XCAFDoc_ColorTool.cxx @@ -461,14 +461,16 @@ Standard_Boolean XCAFDoc_ColorTool::SetInstanceColor (const TopoDS_Shape& theSha return Standard_False; Handle(XCAFDoc_GraphNode) aSHUO; // set the SHUO structure for this component if it is not exist - if ( !ShapeTool()->FindSHUO( aLabels, aSHUO ) ) + if ( !ShapeTool()->FindSHUO( aLabels, aSHUO ) ) { if (aLabels.Length() == 1) { // set color directly for component as NAUO SetColor(aLabels.Value(1), color, type); return Standard_True; } - else if ( !IsCreateSHUO || !ShapeTool()->SetSHUO( aLabels, aSHUO ) ) + else if ( !IsCreateSHUO || !ShapeTool()->SetSHUO( aLabels, aSHUO ) ) { return Standard_False; + } + } TDF_Label aSHUOLabel = aSHUO->Label(); SetColor( aSHUOLabel, color, type ); return Standard_True; diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx index 1fc7e3e30a..984040471d 100755 --- a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx +++ b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx @@ -614,10 +614,16 @@ static Standard_Integer hidesel Handle( MeshVS_MeshEntityOwner ) anOwner = Handle( MeshVS_MeshEntityOwner )::DownCast( aContext->SelectedOwner() ); if( !anOwner.IsNull() ) + { if( anOwner->Type()==MeshVS_ET_Node ) + { aHiddenNodes->ChangeMap().Add( anOwner->ID() ); + } else + { aHiddenElements->ChangeMap().Add( anOwner->ID() ); + } + } } aContext->ClearSelected(); aMesh->SetHiddenNodes( aHiddenNodes ); @@ -659,10 +665,16 @@ static Standard_Integer showonly Handle( MeshVS_MeshEntityOwner ) anOwner = Handle( MeshVS_MeshEntityOwner )::DownCast( aContext->SelectedOwner() ); if( !anOwner.IsNull() ) + { if( anOwner->Type()==MeshVS_ET_Node ) + { aHiddenNodes->ChangeMap().Remove( anOwner->ID() ); + } else + { aHiddenElements->ChangeMap().Remove( anOwner->ID() ); + } + } } aMesh->SetHiddenNodes( aHiddenNodes ); aMesh->SetHiddenElems( aHiddenElements ); -- 2.20.1