From: dpasukhi Date: Sat, 6 May 2023 20:06:21 +0000 (+0000) Subject: 0033374: Coding - Static Analyzing checking X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR33374;p=occt.git 0033374: Coding - Static Analyzing checking // Not processed changes. Need to be cleared --- diff --git a/src/AIS/AIS_AttributeFilter.hxx b/src/AIS/AIS_AttributeFilter.hxx index 0d910bed46..1de1edbcb5 100644 --- a/src/AIS/AIS_AttributeFilter.hxx +++ b/src/AIS/AIS_AttributeFilter.hxx @@ -103,7 +103,7 @@ public: private: Quantity_NameOfColor myCol; - Standard_Real myWid; + Standard_Real myWid{}; Standard_Boolean hasC; Standard_Boolean hasW; diff --git a/src/AIS/AIS_Axis.cxx b/src/AIS/AIS_Axis.cxx index 9580e5c223..8341cb4664 100644 --- a/src/AIS/AIS_Axis.cxx +++ b/src/AIS/AIS_Axis.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -71,7 +73,7 @@ myTypeOfAxis(anAxisType), myIsXYZAxis(Standard_True) { Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect(); - Standard_Real aLength; + Standard_Real aLength = NAN; try { aLength = UnitsAPI::AnyToLS(100. ,"mm"); } catch (Standard_Failure const&) { @@ -112,11 +114,11 @@ AIS_Axis::AIS_Axis(const Handle(Geom_Axis1Placement)& anAxis) //======================================================================= AIS_Axis::AIS_Axis (const gp_Ax1& theAxis, const Standard_Real theLength) : myComponent (new Geom_Line (theAxis)), - myTypeOfAxis (AIS_TOAX_ZAxis), - myIsXYZAxis (Standard_True) + myPfirst(theAxis.Location()), myTypeOfAxis (AIS_TOAX_ZAxis), + myIsXYZAxis (Standard_True), myDir(theAxis.Direction()) { - myDir = theAxis.Direction(); - myPfirst = theAxis.Location(); + + if (theLength <= 0 && theLength != -1) { throw Standard_NumericError ("AIS_Axis::AIS_Axis : invalid value for theLength parameter"); @@ -274,7 +276,7 @@ void AIS_Axis::ComputeFields() const gp_Dir& oX = anAxis.XDirection(); const gp_Dir& oY = anAxis.YDirection(); const gp_Dir& oZ = anAxis.Direction(); - Standard_Real xo,yo,zo,x = 0.,y = 0.,z = 0.; + Standard_Real xo = NAN,yo = NAN,zo = NAN,x = 0.,y = 0.,z = 0.; Orig.Coord(xo,yo,zo); myPfirst.SetCoord(xo,yo,zo); diff --git a/src/AIS/AIS_Axis.hxx b/src/AIS/AIS_Axis.hxx index 23a928c2fc..574699c1d4 100644 --- a/src/AIS/AIS_Axis.hxx +++ b/src/AIS/AIS_Axis.hxx @@ -124,8 +124,8 @@ private: AIS_TypeOfAxis myTypeOfAxis; Standard_Boolean myIsXYZAxis; gp_Dir myDir; - Standard_Real myVal; - Standard_CString myText; + Standard_Real myVal{}; + Standard_CString myText{}; Handle(Prs3d_LineAspect) myLineAspect; }; diff --git a/src/AIS/AIS_BadEdgeFilter.cxx b/src/AIS/AIS_BadEdgeFilter.cxx index 1bdd5b27d8..b8dec68603 100644 --- a/src/AIS/AIS_BadEdgeFilter.cxx +++ b/src/AIS/AIS_BadEdgeFilter.cxx @@ -28,9 +28,9 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_BadEdgeFilter,SelectMgr_Filter) //function : AIS_BadEdgeFilter //purpose : //======================================================================= -AIS_BadEdgeFilter::AIS_BadEdgeFilter() +AIS_BadEdgeFilter::AIS_BadEdgeFilter() : myContour(0) { - myContour=0; + } //======================================================================= diff --git a/src/AIS/AIS_C0RegularityFilter.cxx b/src/AIS/AIS_C0RegularityFilter.cxx index 8becc91faa..ddb1f01821 100644 --- a/src/AIS/AIS_C0RegularityFilter.cxx +++ b/src/AIS/AIS_C0RegularityFilter.cxx @@ -37,7 +37,7 @@ AIS_C0RegularityFilter::AIS_C0RegularityFilter(const TopoDS_Shape& aShape) { TopTools_IndexedDataMapOfShapeListOfShape SubShapes; TopExp::MapShapesAndAncestors(aShape,TopAbs_EDGE,TopAbs_FACE,SubShapes); - Standard_Boolean Ok; + Standard_Boolean Ok = 0; for (Standard_Integer i = 1; i <= SubShapes.Extent(); i++) { Ok = Standard_False; TopTools_ListIteratorOfListOfShape it(SubShapes(i)); @@ -56,7 +56,7 @@ AIS_C0RegularityFilter::AIS_C0RegularityFilter(const TopoDS_Shape& aShape) } } if (Ok) { - TopoDS_Shape curEdge = SubShapes.FindKey( i ); + const TopoDS_Shape& curEdge = SubShapes.FindKey( i ); myMapOfEdges.Add(curEdge); } } diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx index 866259af85..47a43296c3 100644 --- a/src/AIS/AIS_InteractiveContext.cxx +++ b/src/AIS/AIS_InteractiveContext.cxx @@ -511,7 +511,7 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj, setContextToObject (theIObj); if (!myObjects.IsBound (theIObj)) { - Standard_Integer aDispMode, aHiMod, aSelModeDef; + Standard_Integer aDispMode = 0, aHiMod = 0, aSelModeDef = 0; GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef); setObjectStatus (theIObj, PrsMgr_DisplayStatus_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef); theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask @@ -945,7 +945,7 @@ void AIS_InteractiveContext::Redisplay (const AIS_KindOfInteractive theKOI, Standard_Boolean isRedisplayed = Standard_False; for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next()) { - Handle(AIS_InteractiveObject) anObj = anObjIter.Key(); + const Handle(AIS_InteractiveObject)& anObj = anObjIter.Key(); if (anObj->Type() != theKOI) { continue; @@ -1155,7 +1155,7 @@ void AIS_InteractiveContext::SetDisplayMode(const Standard_Integer theMode, continue; } - Handle(AIS_GlobalStatus) aStatus = anObjIter.Value(); + const Handle(AIS_GlobalStatus)& aStatus = anObjIter.Value(); aStatus->SetDisplayMode (theMode); if (anObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed) @@ -2251,7 +2251,7 @@ Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection (const Handle(V3d_View)& for (AIS_MapIteratorOfMapOfObjectOwners anIter (anObjectOwnerMap); anIter.More(); anIter.Next()) { - const Handle(SelectMgr_SelectableObject) anObject = anIter.Key(); + const Handle(SelectMgr_SelectableObject)& anObject = anIter.Key(); Bnd_Box aTmpBox = anObject->BndBoxOfSelected (anIter.ChangeValue()); aBndSelected.Add (aTmpBox); } diff --git a/src/AIS/AIS_InteractiveContext.hxx b/src/AIS/AIS_InteractiveContext.hxx index 64c30eb89d..054164438b 100644 --- a/src/AIS/AIS_InteractiveContext.hxx +++ b/src/AIS/AIS_InteractiveContext.hxx @@ -1453,7 +1453,7 @@ protected: //! @name internal fields Handle(SelectMgr_SelectionManager) mgrSelector; Handle(PrsMgr_PresentationManager) myMainPM; Handle(V3d_Viewer) myMainVwr; - V3d_View* myLastActiveView; + V3d_View* myLastActiveView{}; Handle(SelectMgr_EntityOwner) myLastPicked; Standard_Boolean myToHilightSelected; Handle(AIS_Selection) mySelection; diff --git a/src/AIS/AIS_LightSource.hxx b/src/AIS/AIS_LightSource.hxx index feb5570abe..7cb5abe850 100644 --- a/src/AIS/AIS_LightSource.hxx +++ b/src/AIS/AIS_LightSource.hxx @@ -256,7 +256,7 @@ protected: Handle(Graphic3d_AspectLine3d) myArrowLineAspectShadow; //!< arrow shadow style Handle(Graphic3d_MarkerImage) myMarkerImages[2]; //!< icon of disabled (0) and enabled (1) light Handle(Select3D_SensitiveSphere) mySensSphere; //!< sensitive sphere of directional light source - Aspect_TypeOfMarker myMarkerTypes[2]; //!< icon of disabled (0) and enabled (1) light + Aspect_TypeOfMarker myMarkerTypes[2]{}; //!< icon of disabled (0) and enabled (1) light Aspect_TypeOfMarker myCodirMarkerType; //!< icon of arrow co-directional to camera direction (look from) Aspect_TypeOfMarker myOpposMarkerType; //!< icon of arrow opposite to camera direction (look at) diff --git a/src/AIS/AIS_Manipulator.cxx b/src/AIS/AIS_Manipulator.cxx index 4cd43844b8..2a1eda4aa5 100644 --- a/src/AIS/AIS_Manipulator.cxx +++ b/src/AIS/AIS_Manipulator.cxx @@ -89,7 +89,7 @@ namespace ManipSensRotation (theCircle.Position().Direction()) {} //! Checks whether the circle overlaps current selecting volume - virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, + Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, SelectBasics_PickResult& thePickResult) Standard_OVERRIDE { return isValidRay (theMgr) @@ -108,7 +108,7 @@ namespace ManipSensRotation (thePlaneNormal) {} //! Checks whether the circle overlaps current selecting volume - virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, + Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, SelectBasics_PickResult& thePickResult) Standard_OVERRIDE { return isValidRay (theMgr) diff --git a/src/AIS/AIS_Plane.cxx b/src/AIS/AIS_Plane.cxx index b04a7a9cec..99db4d844a 100644 --- a/src/AIS/AIS_Plane.cxx +++ b/src/AIS/AIS_Plane.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -421,7 +423,7 @@ void AIS_Plane::SetMinimumSize (const Standard_Real theValue) UnsetMinimumSize(); return; } - Standard_Real aX, anY; + Standard_Real aX = NAN, anY = NAN; Size (aX, anY); SetTransformPersistence (new Graphic3d_TransformPersScaledAbove (Min (aX, anY) / theValue, myCenter)); } @@ -518,7 +520,7 @@ void AIS_Plane::ComputeFrame() { const Handle(Geom_Plane)& pl = myComponent; - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; if (myAutomaticPosition) { ElSLib::Parameters(pl->Pln(),myCenter,U,V); @@ -551,7 +553,7 @@ void AIS_Plane::ComputeFields() gp_Dir oY = myAx2->Ax2().YDirection(); gp_Dir oZ = myAx2->Ax2().Direction(); myCenter = Orig; - Standard_Real xo,yo,zo,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4=0,y4=0,z4=0; + Standard_Real xo = NAN,yo = NAN,zo = NAN,x1 = NAN,y1 = NAN,z1 = NAN,x2 = NAN,y2 = NAN,z2 = NAN,x3 = NAN,y3 = NAN,z3 = NAN,x4=0,y4=0,z4=0; Standard_Real x5=0,y5=0,z5=0; Orig.Coord(xo,yo,zo); oX.Coord(x1,y1,z1); diff --git a/src/AIS/AIS_Plane.hxx b/src/AIS/AIS_Plane.hxx index cf973058f9..c5adaa899c 100644 --- a/src/AIS/AIS_Plane.hxx +++ b/src/AIS/AIS_Plane.hxx @@ -169,7 +169,7 @@ private: Standard_Boolean myAutomaticPosition; AIS_TypeOfPlane myTypeOfPlane; Standard_Boolean myIsXYZPlane; - Standard_Boolean myHasOwnSize; + Standard_Boolean myHasOwnSize{}; Select3D_TypeOfSensitivity myTypeOfSensitivity; }; diff --git a/src/AIS/AIS_PlaneTrihedron.cxx b/src/AIS/AIS_PlaneTrihedron.cxx index 2a9bfb8bc6..5d5a5e3db3 100644 --- a/src/AIS/AIS_PlaneTrihedron.cxx +++ b/src/AIS/AIS_PlaneTrihedron.cxx @@ -18,6 +18,8 @@ // + (-1) selection mode token into account // (SAMTECH specific) +#include + #include #include #include @@ -153,7 +155,7 @@ void AIS_PlaneTrihedron::Compute (const Handle(PrsMgr_PresentationManager)& , gp_Dir xDir = myPlane->Position().Ax2().XDirection(); gp_Pnt orig = myPlane->Position().Ax2().Location(); - Standard_Real xo,yo,zo,x,y,z; + Standard_Real xo = NAN,yo = NAN,zo = NAN,x = NAN,y = NAN,z = NAN; orig.Coord( xo, yo, zo ); xDir.Coord( x, y, z ); first.SetCoord( xo, yo, zo ); @@ -188,7 +190,7 @@ void AIS_PlaneTrihedron::Compute (const Handle(PrsMgr_PresentationManager)& , void AIS_PlaneTrihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) { - Standard_Integer Prior; + Standard_Integer Prior = 0; Handle(SelectMgr_EntityOwner) eown; TColgp_Array1OfPnt PP(1,4),PO(1,4); // ExtremityPoints(PP); diff --git a/src/AIS/AIS_Shape.cxx b/src/AIS/AIS_Shape.cxx index eb9e7f68e7..fb2bf4f3ab 100644 --- a/src/AIS/AIS_Shape.cxx +++ b/src/AIS/AIS_Shape.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -856,7 +858,7 @@ void AIS_Shape::SetOwnDeviationAngle (const Standard_Real theAngle) void AIS_Shape::SetAngleAndDeviation ( const Standard_Real anAngle ) { - Standard_Real OutAngl,OutDefl; + Standard_Real OutAngl = NAN,OutDefl = NAN; HLRBRep::PolyHLRAngleAndDeflection(anAngle,OutAngl,OutDefl); SetOwnDeviationAngle(anAngle) ; SetOwnDeviationCoefficient(OutDefl) ; diff --git a/src/AIS/AIS_TextLabel.cxx b/src/AIS/AIS_TextLabel.cxx index 76fb8f1c33..aba7336479 100644 --- a/src/AIS/AIS_TextLabel.cxx +++ b/src/AIS/AIS_TextLabel.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -292,7 +294,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager)& , } gp_Pnt aCenterOfLabel; - Standard_Real aWidth, aHeight; + Standard_Real aWidth = NAN, aHeight = NAN; Standard_Boolean isInit = calculateLabelParams (aPosition, aCenterOfLabel, aWidth, aHeight); if (myHasOrientation3D) @@ -363,7 +365,7 @@ void AIS_TextLabel::ComputeSelection (const Handle(SelectMgr_Selection)& theSele } gp_Pnt aCenterOfLabel; - Standard_Real aWidth, aHeight; + Standard_Real aWidth = NAN, aHeight = NAN; if (!calculateLabelParams (aPosition, aCenterOfLabel, aWidth, aHeight)) { diff --git a/src/AIS/AIS_TexturedShape.cxx b/src/AIS/AIS_TexturedShape.cxx index 1cb792082f..44d40c49de 100644 --- a/src/AIS/AIS_TexturedShape.cxx +++ b/src/AIS/AIS_TexturedShape.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -266,8 +268,8 @@ void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& theP myAspect = new Graphic3d_AspectFillArea3d (*myDrawer->ShadingAspect()->Aspect()); if (HasPolygonOffsets()) { - Standard_Integer aMode; - Standard_ShortReal aFactor, aUnits; + Standard_Integer aMode = 0; + Standard_ShortReal aFactor = NAN, aUnits = NAN; PolygonOffsets (aMode, aFactor, aUnits); myAspect->SetPolygonOffsets (aMode, aFactor, aUnits); } diff --git a/src/AIS/AIS_Triangulation.cxx b/src/AIS/AIS_Triangulation.cxx index 734d092ef7..bb733e0a96 100644 --- a/src/AIS/AIS_Triangulation.cxx +++ b/src/AIS/AIS_Triangulation.cxx @@ -27,12 +27,12 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_Triangulation,AIS_InteractiveObject) -AIS_Triangulation::AIS_Triangulation(const Handle(Poly_Triangulation)& Triangulation) +AIS_Triangulation::AIS_Triangulation(const Handle(Poly_Triangulation)& Triangulation) : myTriangulation(Triangulation), myNbNodes(Triangulation->NbNodes()), myNbTriangles(Triangulation->NbTriangles()), myFlagColor(0) { - myTriangulation = Triangulation; - myNbNodes = Triangulation->NbNodes(); - myNbTriangles = Triangulation->NbTriangles(); - myFlagColor = 0; + + + + } //======================================================================= diff --git a/src/AIS/AIS_Trihedron.hxx b/src/AIS/AIS_Trihedron.hxx index 03cb6f1c29..80797dda04 100644 --- a/src/AIS/AIS_Trihedron.hxx +++ b/src/AIS/AIS_Trihedron.hxx @@ -241,7 +241,7 @@ protected: Standard_Boolean myHasOwnArrowColor; TCollection_ExtendedString myLabels[Prs3d_DatumParts_NB]; - Standard_Integer mySelectionPriority[Prs3d_DatumParts_NB]; + Standard_Integer mySelectionPriority[Prs3d_DatumParts_NB]{}; Handle(Graphic3d_Group) myPartToGroup[Prs3d_DatumParts_NB]; NCollection_List mySelectedParts; diff --git a/src/AIS/AIS_XRTrackedDevice.cxx b/src/AIS/AIS_XRTrackedDevice.cxx index 9835b152d0..8335efc01a 100644 --- a/src/AIS/AIS_XRTrackedDevice.cxx +++ b/src/AIS/AIS_XRTrackedDevice.cxx @@ -43,7 +43,7 @@ public: } //! Image reader. - virtual Handle(Image_PixMap) GetImage (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE + Handle(Image_PixMap) GetImage (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE { return myImageSource->ReadImage (theSupported); } diff --git a/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx b/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx index 9f90004ff9..4ac43817ab 100644 --- a/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx +++ b/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx @@ -36,9 +36,9 @@ static Handle(TCollection_HAsciiString) nulstr; static Handle(Interface_HArray1OfHAsciiString) nularr; APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader - (const Handle(StepData_StepModel)& model) + (const Handle(StepData_StepModel)& model) : done(Standard_True) { - done = Standard_True; + if (model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileName))) { fn = GetCasted(HeaderSection_FileName, model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileName))); @@ -384,7 +384,7 @@ void APIHeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_H Handle(Interface_HArray1OfHAsciiString) idents = fs->SchemaIdentifiers(); // check that requested subschema is already in the list - Standard_Integer i; + Standard_Integer i = 0; for ( i=1; ! idents.IsNull() && i <= idents->Length(); i++ ) { if ( aSchem->IsSameString ( idents->Value(i) ) ) return; } diff --git a/src/APIHeaderSection/APIHeaderSection_MakeHeader.hxx b/src/APIHeaderSection/APIHeaderSection_MakeHeader.hxx index 9415693b65..a1754c5a60 100644 --- a/src/APIHeaderSection/APIHeaderSection_MakeHeader.hxx +++ b/src/APIHeaderSection/APIHeaderSection_MakeHeader.hxx @@ -185,7 +185,7 @@ private: - Standard_Boolean done; + Standard_Boolean done{}; Handle(HeaderSection_FileName) fn; Handle(HeaderSection_FileSchema) fs; Handle(HeaderSection_FileDescription) fd; diff --git a/src/Adaptor2d/Adaptor2d_OffsetCurve.cxx b/src/Adaptor2d/Adaptor2d_OffsetCurve.cxx index 7f4d40c21c..2cfb615747 100644 --- a/src/Adaptor2d/Adaptor2d_OffsetCurve.cxx +++ b/src/Adaptor2d/Adaptor2d_OffsetCurve.cxx @@ -224,7 +224,7 @@ void Adaptor2d_OffsetCurve::Intervals(TColStd_Array1OfReal& TI, Standard_Integer last = nbInter+1; while (T(last) >= myLast) last--; - Standard_Integer i = TI.Lower(), j; + Standard_Integer i = TI.Lower(), j = 0; for (j = first-1; j <= last+1; j++) { TI(i) = T(j); i++; diff --git a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx index 9bf807c227..4d8830ee42 100644 --- a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx +++ b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx @@ -14,6 +14,8 @@ #define No_Standard_OutOfRange +#include + #include #include @@ -242,9 +244,9 @@ static void Locate1Coord(const Standard_Integer Index, const Handle(Geom_BSplineCurve)& BSplC, gp_Pnt2d& LeftBot, gp_Pnt2d& RightTop) { - Standard_Real Comp1=0, DComp1=0, cur, f = 0.0, l = 0.0; + Standard_Real Comp1=0, DComp1=0, cur = NAN, f = 0.0, l = 0.0; Standard_Real Tol = Precision::PConfusion()/10; - Standard_Integer i = 1, Bnd1, Bnd2; + Standard_Integer i = 1, Bnd1 = 0, Bnd2 = 0; Standard_Boolean DIsNull= Standard_False; TColStd_Array1OfReal Arr(1,BSplC->NbKnots()); BSplC->Knots(Arr); @@ -346,7 +348,7 @@ static void Locate1Coord(const Standard_Integer Index, { Standard_Real Comp1=0,DComp1=0; Standard_Real Tol = Precision::PConfusion()/10; - Standard_Integer i=1, Up=0, Up1, Up2, Down=0, Down1, Down2; + Standard_Integer i=1, Up=0, Up1 = 0, Up2 = 0, Down=0, Down1 = 0, Down2 = 0; Standard_Real cur = 0.; DIsNull= Standard_False; @@ -875,7 +877,7 @@ Standard_Integer Adaptor3d_CurveOnSurface::NbIntervals (const GeomAbs_Shape S) c if(S == myIntCont && !myIntervals.IsNull()) return myIntervals->Length()-1; - Standard_Integer nu,nv,nc; + Standard_Integer nu = 0,nv = 0,nc = 0; nu=mySurface->NbUIntervals(S); nv=mySurface->NbVIntervals(S); nc=myCurve->NbIntervals(S); @@ -887,7 +889,7 @@ Standard_Integer Adaptor3d_CurveOnSurface::NbIntervals (const GeomAbs_Shape S) c TColStd_Array1OfReal TabC(TabBuf(nu + nv + 3), 1, nc+1); Standard_Integer NbSample = 20; - Standard_Real U,V,Tdeb,Tfin; + Standard_Real U = NAN,V = NAN,Tdeb = NAN,Tfin = NAN; Tdeb=myCurve->FirstParameter(); Tfin=myCurve->LastParameter(); @@ -1234,7 +1236,7 @@ gp_Vec Adaptor3d_CurveOnSurface::DN Standard_Real Adaptor3d_CurveOnSurface::Resolution (const Standard_Real R3d) const { - Standard_Real ru,rv; + Standard_Real ru = NAN,rv = NAN; ru = mySurface->UResolution(R3d); rv = mySurface->VResolution(R3d); return myCurve->Resolution(Min(ru,rv)); @@ -1648,7 +1650,7 @@ void Adaptor3d_CurveOnSurface::EvalKPart() void Adaptor3d_CurveOnSurface::EvalFirstLastSurf() { - Standard_Real FirstPar,LastPar; + Standard_Real FirstPar = NAN,LastPar = NAN; gp_Pnt2d UV, LeftBot, RightTop; gp_Vec2d DUV; Standard_Real Tol= Precision::PConfusion()/10; @@ -1756,7 +1758,7 @@ Standard_Boolean Adaptor3d_CurveOnSurface::LocatePart_RevExt(const gp_Pnt2d& UV, Locate2Coord(1,UV,DUV,S->FirstUParameter(),S->LastUParameter(),LeftBot,RightTop); } - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; ReverseParam(LeftBot.X(),RightTop.X(),u1,u2); LeftBot.SetX(u1); RightTop.SetX(u2); diff --git a/src/Adaptor3d/Adaptor3d_HSurfaceTool.cxx b/src/Adaptor3d/Adaptor3d_HSurfaceTool.cxx index 9873386075..9108ed46f4 100644 --- a/src/Adaptor3d/Adaptor3d_HSurfaceTool.cxx +++ b/src/Adaptor3d/Adaptor3d_HSurfaceTool.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -102,7 +104,7 @@ Standard_Boolean Adaptor3d_HSurfaceTool::IsSurfG1(const Handle(Adaptor3d_Surface const Standard_Boolean theAlongU, const Standard_Real theAngTol) { - Standard_Real aUf, aUl, aVf, aVl; + Standard_Real aUf = NAN, aUl = NAN, aVf = NAN, aVl = NAN; aUf = theSurf->FirstUParameter(); aUl = theSurf->LastUParameter(); aVf = theSurf->FirstVParameter(); diff --git a/src/Adaptor3d/Adaptor3d_InterFunc.cxx b/src/Adaptor3d/Adaptor3d_InterFunc.cxx index fec695971e..6262ad3ed7 100644 --- a/src/Adaptor3d/Adaptor3d_InterFunc.cxx +++ b/src/Adaptor3d/Adaptor3d_InterFunc.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -40,7 +42,7 @@ Standard_Boolean Adaptor3d_InterFunc::Value(const Standard_Real X , Standard_Rea } Standard_Boolean Adaptor3d_InterFunc::Derivative(const Standard_Real X , Standard_Real& D) { - Standard_Real F; + Standard_Real F = NAN; return Values(X,F,D); } Standard_Boolean Adaptor3d_InterFunc::Values(const Standard_Real X , Standard_Real& F,Standard_Real& D) diff --git a/src/Adaptor3d/Adaptor3d_IsoCurve.cxx b/src/Adaptor3d/Adaptor3d_IsoCurve.cxx index 3859809d5b..2a989c4c62 100644 --- a/src/Adaptor3d/Adaptor3d_IsoCurve.cxx +++ b/src/Adaptor3d/Adaptor3d_IsoCurve.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -312,7 +314,7 @@ void Adaptor3d_IsoCurve::Intervals(TColStd_Array1OfReal& TI, Standard_Integer last = nbInter+1; while (T(last) >= myLast) last--; - Standard_Integer i = TI.Lower(), j; + Standard_Integer i = TI.Lower(), j = 0; for (j = first-1; j <= last+1; j++) { TI(i) = T(j); i++; @@ -675,7 +677,7 @@ static void computeHR(const gp_Ax3& axes, gp_Circ Adaptor3d_IsoCurve::Circle() const { gp_Ax3 axes; - Standard_Real radius,h = 0.; + Standard_Real radius = NAN,h = 0.; switch (mySurface->GetType()) { diff --git a/src/Adaptor3d/Adaptor3d_TopolTool.cxx b/src/Adaptor3d/Adaptor3d_TopolTool.cxx index 807291d755..cdeac49f9a 100644 --- a/src/Adaptor3d/Adaptor3d_TopolTool.cxx +++ b/src/Adaptor3d/Adaptor3d_TopolTool.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -58,7 +60,7 @@ void Adaptor3d_TopolTool::Initialize () void Adaptor3d_TopolTool::Initialize (const Handle(Adaptor3d_Surface)& S) { - Standard_Real pinf,psup,deltap; + Standard_Real pinf = NAN,psup = NAN,deltap = NAN; //Adaptor2d_Line2d * Line2dPtr ; myNbSamplesU=-1; @@ -216,7 +218,7 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor2d_Curve2d)& C) { nbVtx = 0; idVtx = 0; - Standard_Real theUinf,theUsup; + Standard_Real theUinf = NAN,theUsup = NAN; theUinf = C->FirstParameter(); theUsup = C->LastParameter(); // if (!Precision::IsNegativeInfinite(theUinf)) { @@ -280,7 +282,7 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P, return TopAbs_IN; } else { - Standard_Boolean dansu,dansv,surumin,surumax,survmin,survmax; + Standard_Boolean dansu = 0,dansv = 0,surumin = 0,surumax = 0,survmin = 0,survmax = 0; if (Precision::IsNegativeInfinite(Uinf) && Precision::IsPositiveInfinite(Usup)) { dansu = Standard_True; @@ -415,7 +417,7 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P, return(Standard_False); } else { - Standard_Boolean dansu,dansv,surumin,surumax,survmin,survmax; + Standard_Boolean dansu = 0,dansv = 0,surumin = 0,surumax = 0,survmin = 0,survmax = 0; if (Precision::IsNegativeInfinite(Uinf) && Precision::IsPositiveInfinite(Usup)) { dansu = Standard_True; @@ -569,7 +571,7 @@ static void Analyse(const TColgp_Array2OfPnt& array2, Standard_Integer& myNbSamplesU, Standard_Integer& myNbSamplesV) { gp_Vec Vi,Vip1; - Standard_Integer sh,nbch,i,j; + Standard_Integer sh = 0,nbch = 0,i = 0,j = 0; sh = 1; nbch = 0; @@ -638,7 +640,7 @@ void Adaptor3d_TopolTool::ComputeSamplePoints() { const Standard_Integer aMaxNbSample = 50; - Standard_Real uinf,usup,vinf,vsup; + Standard_Real uinf = NAN,usup = NAN,vinf = NAN,vsup = NAN; uinf = myS->FirstUParameter(); usup = myS->LastUParameter(); vinf = myS->FirstVParameter(); vsup = myS->LastVParameter(); if (usup < uinf) { Standard_Real temp=uinf; uinf=usup; usup=temp; } @@ -651,7 +653,7 @@ void Adaptor3d_TopolTool::ComputeSamplePoints() else if (vinf == RealFirst()) { vinf=vsup-2.e5; } else if (vsup == RealLast()) { vsup=vinf+2.e5; } - Standard_Integer nbsu,nbsv; + Standard_Integer nbsu = 0,nbsv = 0; GeomAbs_SurfaceType typS = myS->GetType(); switch(typS) { case GeomAbs_Plane: { nbsv=2; nbsu=2; } break; @@ -756,8 +758,8 @@ void Adaptor3d_TopolTool::SamplePoint(const Standard_Integer i, gp_Pnt2d& P2d, gp_Pnt& P3d) { - Standard_Integer iu, iv; - Standard_Real u, v; + Standard_Integer iu = 0, iv = 0; + Standard_Real u = NAN, v = NAN; if (myUPars.IsNull()) { Standard_Real myDU=(Usup-Uinf)/(myNbSamplesU+1); @@ -846,7 +848,7 @@ void Adaptor3d_TopolTool::SamplePnts(const Standard_Real theDefl, const Standard_Integer theNUmin, const Standard_Integer theNVmin) { - Standard_Real uinf,usup,vinf,vsup; + Standard_Real uinf = NAN,usup = NAN,vinf = NAN,vsup = NAN; uinf = myS->FirstUParameter(); usup = myS->LastUParameter(); vinf = myS->FirstVParameter(); vsup = myS->LastVParameter(); if (usup < uinf) { Standard_Real temp=uinf; uinf=usup; usup=temp; } @@ -906,8 +908,8 @@ void Adaptor3d_TopolTool::SamplePnts(const Standard_Real theDefl, myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU); myVPars = new TColStd_HArray1OfReal(1, myNbSamplesV); - Standard_Integer i; - Standard_Real t, dt = (usup - uinf)/(myNbSamplesU - 1); + Standard_Integer i = 0; + Standard_Real t = NAN, dt = (usup - uinf)/(myNbSamplesU - 1); myUPars->SetValue(1, uinf); myUPars->SetValue(myNbSamplesU, usup); for(i = 2, t = uinf+dt; i < myNbSamplesU; ++i, t += dt) { @@ -936,12 +938,12 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl, { const Standard_Integer aMaxPnts = 1001; const Handle(Geom_BSplineSurface)& aBS = myS->BSpline(); - Standard_Real uinf,usup,vinf,vsup; + Standard_Real uinf = NAN,usup = NAN,vinf = NAN,vsup = NAN; uinf = myS->FirstUParameter(); usup = myS->LastUParameter(); vinf = myS->FirstVParameter(); vsup = myS->LastVParameter(); - Standard_Integer i, k, j = 1; - Standard_Real t1, t2, dt; + Standard_Integer i = 0, k = 0, j = 1; + Standard_Real t1 = NAN, t2 = NAN, dt = NAN; Standard_Integer ui1 = aBS->FirstUKnotIndex(); Standard_Integer ui2 = aBS->LastUKnotIndex(); Standard_Integer vi1 = aBS->FirstVKnotIndex(); @@ -982,7 +984,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl, //modified by NIZHNY-EMV Mon Jun 10 14:19:04 2013 if (nbsu < theNUmin || nbsv < theNVmin) { - Standard_Integer aNb; + Standard_Integer aNb = 0; if (nbsu < nbsv) { aNb = (Standard_Integer)(nbsv * ((Standard_Real)theNUmin)/((Standard_Real)nbsu)); aNb = Min(aNb, 30); @@ -1096,7 +1098,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl, Standard_Real aDefl2 = Max(theDefl*theDefl, 1.e-9); Standard_Real tol = Max(0.01*aDefl2, 1.e-9); - Standard_Integer l; + Standard_Integer l = 0; anUFlg(1) = Standard_True; anUFlg(nbsu) = Standard_True; @@ -1270,7 +1272,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl, // //modified by NIZNHY-PKV Fri Dec 16 10:05:01 2011f // - Standard_Boolean bFlag; + Standard_Boolean bFlag = 0; // // U bFlag=(myNbSamplesU < theNUmin); diff --git a/src/Adaptor3d/Adaptor3d_TopolTool.hxx b/src/Adaptor3d/Adaptor3d_TopolTool.hxx index 439b16e129..07b1bfb07a 100644 --- a/src/Adaptor3d/Adaptor3d_TopolTool.hxx +++ b/src/Adaptor3d/Adaptor3d_TopolTool.hxx @@ -157,22 +157,22 @@ public: protected: Handle(Adaptor3d_Surface) myS; - Standard_Integer myNbSamplesU; - Standard_Integer myNbSamplesV; + Standard_Integer myNbSamplesU{}; + Standard_Integer myNbSamplesV{}; Handle(TColStd_HArray1OfReal) myUPars; Handle(TColStd_HArray1OfReal) myVPars; private: - Standard_Integer nbRestr; - Standard_Integer idRestr; - Standard_Real Uinf; - Standard_Real Usup; - Standard_Real Vinf; - Standard_Real Vsup; + Standard_Integer nbRestr{}; + Standard_Integer idRestr{}; + Standard_Real Uinf{}; + Standard_Real Usup{}; + Standard_Real Vinf{}; + Standard_Real Vsup{}; Handle(Adaptor2d_Line2d) myRestr[4]; - Standard_Integer nbVtx; - Standard_Integer idVtx; + Standard_Integer nbVtx{}; + Standard_Integer idVtx{}; Handle(Adaptor3d_HVertex) myVtx[2]; }; diff --git a/src/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx b/src/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx index f07a63a035..71c7cbf1c4 100644 --- a/src/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx +++ b/src/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -171,7 +173,7 @@ AdvApp2Var_ApproxAFunc2Var::AdvApp2Var_ApproxAFunc2Var( void AdvApp2Var_ApproxAFunc2Var::Init() { - Standard_Integer ifav,iu=0,iv=0,ndu,ndv; + Standard_Integer ifav = 0,iu=0,iv=0,ndu = 0,ndv = 0; switch (myFavoriteIso) { case GeomAbs_IsoU : ifav = 1; @@ -239,7 +241,7 @@ void AdvApp2Var_ApproxAFunc2Var::Init() void AdvApp2Var_ApproxAFunc2Var::InitGrid(const Standard_Integer NbInt) { - Standard_Integer iu=myConditions.UOrder(),iv=myConditions.VOrder(),iint; + Standard_Integer iu=myConditions.UOrder(),iv=myConditions.VOrder(),iint = 0; Handle(AdvApp2Var_Patch) M0 = new AdvApp2Var_Patch (myFirstParInU,myLastParInU,myFirstParInV,myLastParInV,iu,iv); @@ -346,10 +348,10 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice const AdvApprox_Cutting& VChoice, const AdvApp2Var_EvaluatorFunc2Var& Func) { - Standard_Real Udec, Vdec; - Standard_Boolean Umore, Vmore; - Standard_Integer NbPatch, NbU, NbV, NumDec; - Standard_Integer FirstNA; + Standard_Real Udec = NAN, Vdec = NAN; + Standard_Boolean Umore = 0, Vmore = 0; + Standard_Integer NbPatch = 0, NbU = 0, NbV = 0, NumDec = 0; + Standard_Integer FirstNA = 0; while (myResult.FirstNotApprox(FirstNA)) { @@ -437,10 +439,10 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice const AdvApp2Var_EvaluatorFunc2Var& Func, const AdvApp2Var_Criterion& Crit) { - Standard_Real Udec, Vdec, CritValue, m1=0.; - Standard_Boolean Umore, Vmore, CritAbs = (Crit.Type() == AdvApp2Var_Absolute); - Standard_Integer NbPatch, NbU, NbV, NbInt, NumDec; - Standard_Integer FirstNA, decision=0; + Standard_Real Udec = NAN, Vdec = NAN, CritValue = NAN, m1=0.; + Standard_Boolean Umore = 0, Vmore = 0, CritAbs = (Crit.Type() == AdvApp2Var_Absolute); + Standard_Integer NbPatch = 0, NbU = 0, NbV = 0, NbInt = 0, NumDec = 0; + Standard_Integer FirstNA = 0, decision=0; while (myResult.FirstNotApprox(FirstNA)) { @@ -551,9 +553,9 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh const AdvApprox_Cutting& VChoice, const AdvApp2Var_EvaluatorFunc2Var& Func) { - Standard_Real dec; - Standard_Boolean more; - Standard_Integer ind1, ind2, NbPatch, NbU, NbV; + Standard_Real dec = NAN; + Standard_Boolean more = 0; + Standard_Integer ind1 = 0, ind2 = 0, NbPatch = 0, NbU = 0, NbV = 0; Standard_Integer iu = myConditions.UOrder(), iv = myConditions.VOrder(); AdvApp2Var_Node N1(iu,iv), N2(iu,iv); @@ -638,10 +640,10 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh const AdvApp2Var_EvaluatorFunc2Var& Func, const AdvApp2Var_Criterion& Crit) { - Standard_Real dec; - Standard_Boolean more, CritRel = (Crit.Type() == AdvApp2Var_Relative); - Standard_Integer ind1, ind2, NbPatch, NbU, NbV; - Standard_Integer indN1, indN2; + Standard_Real dec = NAN; + Standard_Boolean more = 0, CritRel = (Crit.Type() == AdvApp2Var_Relative); + Standard_Integer ind1 = 0, ind2 = 0, NbPatch = 0, NbU = 0, NbV = 0; + Standard_Integer indN1 = 0, indN2 = 0; Standard_Integer iu = myConditions.UOrder(), iv = myConditions.VOrder(); AdvApp2Var_Node N1(iu,iv), N2(iu,iv); @@ -727,9 +729,9 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh void AdvApp2Var_ApproxAFunc2Var::Compute3DErrors() { - Standard_Integer iesp,ipat; - Standard_Real error_max,error_moy,error_U0,error_V0,error_U1,error_V1; - Standard_Real Tol,F1Tol,F2Tol,F3Tol,F4Tol; + Standard_Integer iesp = 0,ipat = 0; + Standard_Real error_max = NAN,error_moy = NAN,error_U0 = NAN,error_V0 = NAN,error_U1 = NAN,error_V1 = NAN; + Standard_Real Tol = NAN,F1Tol = NAN,F2Tol = NAN,F3Tol = NAN,F4Tol = NAN; if ( myNumSubSpaces[2] > 0 ) { my3DMaxError = new (TColStd_HArray1OfReal) (1,myNumSubSpaces[2]); my3DAverageError = new (TColStd_HArray1OfReal) (1,myNumSubSpaces[2]); @@ -778,8 +780,8 @@ void AdvApp2Var_ApproxAFunc2Var::Compute3DErrors() void AdvApp2Var_ApproxAFunc2Var::ComputeCritError() { - Standard_Integer iesp,ipat; - Standard_Real crit_max; + Standard_Integer iesp = 0,ipat = 0; + Standard_Real crit_max = NAN; if ( myNumSubSpaces[2] > 0 ) { for (iesp=1;iesp<=myNumSubSpaces[2];iesp++) { crit_max = 0.; @@ -808,7 +810,7 @@ void AdvApp2Var_ApproxAFunc2Var::ConvertBS() // Calculate resulting surfaces mySurfaces = new ( TColGeom_HArray1OfSurface) (1, myNumSubSpaces[2]); - Standard_Integer j; + Standard_Integer j = 0; TColStd_Array1OfReal UKnots (1, myResult.NbPatchInU()+1); for (j=1; j<=UKnots.Length(); j++) { UKnots.SetValue(j, myResult.UParameter(j)); } @@ -840,11 +842,11 @@ void AdvApp2Var_ApproxAFunc2Var::ConvertBS() Handle(TColStd_HArray1OfReal) Poly = new (TColStd_HArray1OfReal) (1, nmax * Size_eq); - Standard_Integer SSP, i; + Standard_Integer SSP = 0, i = 0; for (SSP=1; SSP <= myNumSubSpaces[2]; SSP++) { // Creation of the grid of polynoms - Standard_Integer n=0,icf=1,ieq; + Standard_Integer n=0,icf=1,ieq = 0; for (j=1; j<=myResult.NbPatchInV(); j++) { for (i=1; i<=myResult.NbPatchInU(); i++) { n++; @@ -1064,7 +1066,7 @@ Standard_Real void AdvApp2Var_ApproxAFunc2Var::Dump(Standard_OStream& o) const { - Standard_Integer iesp=1,NbKU,NbKV,ik; + Standard_Integer iesp=1,NbKU = 0,NbKV = 0,ik = 0; o< + #include #include #include @@ -275,15 +277,15 @@ int mma1cdi_(integer *ndimen, integer c__1 = 1; /* System generated locals */ - integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset, - somtab_dim1, somtab_offset, diftab_dim1, diftab_offset, - fpntab_dim1, fpntab_offset, hermit_dim1, hermit_offset, i__1, - i__2, i__3; + integer contr1_dim1 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_offset = 0, + somtab_dim1 = 0, somtab_offset = 0, diftab_dim1 = 0, diftab_offset = 0, + fpntab_dim1 = 0, fpntab_offset = 0, hermit_dim1 = 0, hermit_offset = 0, i__1 = 0, + i__2 = 0, i__3 = 0; /* Local variables */ - integer nroo2, ncfhe, nd, ii, kk; - integer ibb, kkm, kkp; - doublereal bid1, bid2, bid3 = 0.; + integer nroo2 = 0, ncfhe = 0, nd = 0, ii = 0, kk = 0; + integer ibb = 0, kkm = 0, kkp = 0; + doublereal bid1 = NAN, bid2 = NAN, bid3 = 0.; /* ********************************************************************** */ @@ -495,13 +497,13 @@ int mma1cnt_(integer *ndimen, doublereal *crvjac) { /* System generated locals */ - integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset, - hermit_dim1, hermit_offset, crvjac_dim1, crvjac_offset, i__1, - i__2, i__3; + integer contr1_dim1 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_offset = 0, + hermit_dim1 = 0, hermit_offset = 0, crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0, + i__2 = 0, i__3 = 0; /* Local variables */ - integer nd, ii, jj, ibb; - doublereal bid; + integer nd = 0, ii = 0, jj = 0, ibb = 0; + doublereal bid = NAN; /* *********************************************************************** @@ -632,16 +634,16 @@ int mma1fdi_(integer *ndimen, integer *iercod) { /* System generated locals */ - integer fpntab_dim1, somtab_dim1, somtab_offset, diftab_dim1, - diftab_offset, contr1_dim1, contr1_offset, contr2_dim1, - contr2_offset, i__1, i__2; - doublereal d__1; + integer fpntab_dim1 = 0, somtab_dim1 = 0, somtab_offset = 0, diftab_dim1 = 0, + diftab_offset = 0, contr1_dim1 = 0, contr1_offset = 0, contr2_dim1 = 0, + contr2_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer ideb, ifin, nroo2, ideru, iderv; - doublereal renor; - integer ii, nd, ibb, iim, nbp, iip; - doublereal bid1, bid2; + integer ideb = 0, ifin = 0, nroo2 = 0, ideru = 0, iderv = 0; + doublereal renor = NAN; + integer ii = 0, nd = 0, ibb = 0, iim = 0, nbp = 0, iip = 0; + doublereal bid1 = NAN, bid2 = NAN; /* ********************************************************************** */ @@ -962,11 +964,11 @@ int mma1fer_(integer *,//ndimen, integer *iercod) { /* System generated locals */ - integer crvjac_dim1, crvjac_offset, i__1, i__2; + integer crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier; - integer nbr0; + integer idim = 0, ncfja = 0, ncfnw = 0, ndses = 0, ii = 0, kk = 0, ibb = 0, ier = 0; + integer nbr0 = 0; /* *********************************************************************** @@ -1156,10 +1158,10 @@ int AdvApp2Var_ApproxF2var::mma1her_(const integer *iordre, integer *iercod) { /* System generated locals */ - integer hermit_dim1, hermit_offset; + integer hermit_dim1 = 0, hermit_offset = 0; /* Local variables */ - integer ibb; + integer ibb = 0; @@ -1323,11 +1325,11 @@ int mma1jak_(integer *ndimen, integer *iercod) { /* System generated locals */ - integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset, - crvjac_dim1, crvjac_offset; + integer somtab_dim1 = 0, somtab_offset = 0, diftab_dim1 = 0, diftab_offset = 0, + crvjac_dim1 = 0, crvjac_offset = 0; /* Local variables */ - integer ibb; + integer ibb = 0; /* ********************************************************************** */ @@ -1437,13 +1439,13 @@ int mma1noc_(doublereal *dfuvin, doublereal *cntout) { /* System generated locals */ - integer i__1; - doublereal d__1; + integer i__1 = 0; + doublereal d__1 = NAN; /* Local variables */ - doublereal rider, riord; - integer nd, ibb; - doublereal bid; + doublereal rider = NAN, riord = NAN; + integer nd = 0, ibb = 0; + doublereal bid = NAN; /* ********************************************************************** */ @@ -1571,11 +1573,11 @@ int mma1nop_(integer *nbroot, { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - doublereal alinu, blinu, alinv, blinv; - integer ii, ibb; + doublereal alinu = NAN, blinu = NAN, alinv = NAN, blinv = NAN; + integer ii = 0, ibb = 0; /* *********************************************************************** */ @@ -1686,18 +1688,18 @@ int AdvApp2Var_ApproxF2var::mma2ac1_(integer const *ndimen, { /* System generated locals */ - integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2, - contr2_offset, contr3_dim1, contr3_dim2, contr3_offset, - contr4_dim1, contr4_dim2, contr4_offset, uhermt_dim1, - uhermt_offset, vhermt_dim1, vhermt_offset, patjac_dim1, - patjac_dim2, patjac_offset, i__1, i__2, i__3, i__4, i__5; + integer contr1_dim1 = 0, contr1_dim2 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_dim2 = 0, + contr2_offset = 0, contr3_dim1 = 0, contr3_dim2 = 0, contr3_offset = 0, + contr4_dim1 = 0, contr4_dim2 = 0, contr4_offset = 0, uhermt_dim1 = 0, + uhermt_offset = 0, vhermt_dim1 = 0, vhermt_offset = 0, patjac_dim1 = 0, + patjac_dim2 = 0, patjac_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0, i__5 = 0; /* Local variables */ - logical ldbg; - integer ndgu, ndgv; - doublereal bidu1, bidu2, bidv1, bidv2; - integer ioru1, iorv1, ii, nd, jj, ku, kv; - doublereal cnt1, cnt2, cnt3, cnt4; + logical ldbg = 0; + integer ndgu = 0, ndgv = 0; + doublereal bidu1 = NAN, bidu2 = NAN, bidv1 = NAN, bidv2 = NAN; + integer ioru1 = 0, iorv1 = 0, ii = 0, nd = 0, jj = 0, ku = 0, kv = 0; + doublereal cnt1 = NAN, cnt2 = NAN, cnt3 = NAN, cnt4 = NAN; /* ********************************************************************** */ @@ -1853,14 +1855,14 @@ int AdvApp2Var_ApproxF2var::mma2ac2_(const integer *ndimen, { /* System generated locals */ - integer crbiv1_dim1, crbiv1_dim2, crbiv1_offset, crbiv2_dim1, crbiv2_dim2, - crbiv2_offset, patjac_dim1, patjac_dim2, patjac_offset, - vhermt_dim1, vhermt_offset, i__1, i__2, i__3, i__4; + integer crbiv1_dim1 = 0, crbiv1_dim2 = 0, crbiv1_offset = 0, crbiv2_dim1 = 0, crbiv2_dim2 = 0, + crbiv2_offset = 0, patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, + vhermt_dim1 = 0, vhermt_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0; /* Local variables */ - logical ldbg; - integer ndgv1, ndgv2, ii, jj, nd, kk; - doublereal bid1, bid2; + logical ldbg = 0; + integer ndgv1 = 0, ndgv2 = 0, ii = 0, jj = 0, nd = 0, kk = 0; + doublereal bid1 = NAN, bid2 = NAN; /* ********************************************************************** */ @@ -1999,14 +2001,14 @@ int AdvApp2Var_ApproxF2var::mma2ac3_(const integer *ndimen, { /* System generated locals */ - integer crbiu1_dim1, crbiu1_dim2, crbiu1_offset, crbiu2_dim1, crbiu2_dim2, - crbiu2_offset, patjac_dim1, patjac_dim2, patjac_offset, - uhermt_dim1, uhermt_offset, i__1, i__2, i__3, i__4; + integer crbiu1_dim1 = 0, crbiu1_dim2 = 0, crbiu1_offset = 0, crbiu2_dim1 = 0, crbiu2_dim2 = 0, + crbiu2_offset = 0, patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, + uhermt_dim1 = 0, uhermt_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0; /* Local variables */ - logical ldbg; - integer ndgu1, ndgu2, ii, jj, nd, kk; - doublereal bid1, bid2; + logical ldbg = 0; + integer ndgu1 = 0, ndgu2 = 0, ii = 0, jj = 0, nd = 0, kk = 0; + doublereal bid1 = NAN, bid2 = NAN; /* ********************************************************************** */ @@ -2146,12 +2148,12 @@ int AdvApp2Var_ApproxF2var::mma2can_(const integer *ncfmxu, { /* System generated locals */ - integer patjac_dim1, patjac_dim2, patjac_offset, patcan_dim1, patcan_dim2, - patcan_offset, i__1, i__2; + integer patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, patcan_dim1 = 0, patcan_dim2 = 0, + patcan_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; - integer ilon1, ilon2, ii, nd; + logical ldbg = 0; + integer ilon1 = 0, ilon2 = 0, ii = 0, nd = 0; /* ********************************************************************** */ @@ -2306,21 +2308,21 @@ int mma2cd1_(integer *ndimen, integer c__1 = 1; /* System generated locals */ - integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2, - contr2_offset, contr3_dim1, contr3_dim2, contr3_offset, - contr4_dim1, contr4_dim2, contr4_offset, uhermt_dim1, - uhermt_offset, vhermt_dim1, vhermt_offset, fpntbu_dim1, - fpntbu_offset, fpntbv_dim1, fpntbv_offset, sosotb_dim1, - sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2, - diditb_offset, soditb_dim1, soditb_dim2, soditb_offset, - disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4, - i__5; + integer contr1_dim1 = 0, contr1_dim2 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_dim2 = 0, + contr2_offset = 0, contr3_dim1 = 0, contr3_dim2 = 0, contr3_offset = 0, + contr4_dim1 = 0, contr4_dim2 = 0, contr4_offset = 0, uhermt_dim1 = 0, + uhermt_offset = 0, vhermt_dim1 = 0, vhermt_offset = 0, fpntbu_dim1 = 0, + fpntbu_offset = 0, fpntbv_dim1 = 0, fpntbv_offset = 0, sosotb_dim1 = 0, + sosotb_dim2 = 0, sosotb_offset = 0, diditb_dim1 = 0, diditb_dim2 = 0, + diditb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, + disotb_dim1 = 0, disotb_dim2 = 0, disotb_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0, + i__5 = 0; /* Local variables */ - integer ncfhu, ncfhv, nuroo, nvroo, nd, ii, jj, kk, ll, ibb, kkm, - llm, kkp, llp; - doublereal bid1, bid2, bid3, bid4; - doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2; + integer ncfhu = 0, ncfhv = 0, nuroo = 0, nvroo = 0, nd = 0, ii = 0, jj = 0, kk = 0, ll = 0, ibb = 0, kkm = 0, + llm = 0, kkp = 0, llp = 0; + doublereal bid1 = NAN, bid2 = NAN, bid3 = NAN, bid4 = NAN; + doublereal diu1 = NAN, diu2 = NAN, div1 = NAN, div2 = NAN, sou1 = NAN, sou2 = NAN, sov1 = NAN, sov2 = NAN; /* ********************************************************************** */ @@ -2665,17 +2667,17 @@ int mma2cd2_(integer *ndimen, { integer c__1 = 1; /* System generated locals */ - integer sotbv1_dim1, sotbv1_dim2, sotbv1_offset, sotbv2_dim1, sotbv2_dim2, - sotbv2_offset, ditbv1_dim1, ditbv1_dim2, ditbv1_offset, - ditbv2_dim1, ditbv2_dim2, ditbv2_offset, fpntab_dim1, - fpntab_offset, vhermt_dim1, vhermt_offset, sosotb_dim1, - sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2, - diditb_offset, soditb_dim1, soditb_dim2, soditb_offset, - disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4; + integer sotbv1_dim1 = 0, sotbv1_dim2 = 0, sotbv1_offset = 0, sotbv2_dim1 = 0, sotbv2_dim2 = 0, + sotbv2_offset = 0, ditbv1_dim1 = 0, ditbv1_dim2 = 0, ditbv1_offset = 0, + ditbv2_dim1 = 0, ditbv2_dim2 = 0, ditbv2_offset = 0, fpntab_dim1 = 0, + fpntab_offset = 0, vhermt_dim1 = 0, vhermt_offset = 0, sosotb_dim1 = 0, + sosotb_dim2 = 0, sosotb_offset = 0, diditb_dim1 = 0, diditb_dim2 = 0, + diditb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, + disotb_dim1 = 0, disotb_dim2 = 0, disotb_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0; /* Local variables */ - integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp; - doublereal bid1, bid2, bid3, bid4; + integer ncfhv = 0, nuroo = 0, nvroo = 0, ii = 0, nd = 0, jj = 0, kk = 0, ibb = 0, jjm = 0, jjp = 0; + doublereal bid1 = NAN, bid2 = NAN, bid3 = NAN, bid4 = NAN; /* ********************************************************************** */ @@ -2978,17 +2980,17 @@ int mma2cd3_(integer *ndimen, integer c__1 = 1; /* System generated locals */ - integer sotbu1_dim1, sotbu1_dim2, sotbu1_offset, sotbu2_dim1, sotbu2_dim2, - sotbu2_offset, ditbu1_dim1, ditbu1_dim2, ditbu1_offset, - ditbu2_dim1, ditbu2_dim2, ditbu2_offset, fpntab_dim1, - fpntab_offset, uhermt_dim1, uhermt_offset, sosotb_dim1, - sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2, - diditb_offset, soditb_dim1, soditb_dim2, soditb_offset, - disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4; + integer sotbu1_dim1 = 0, sotbu1_dim2 = 0, sotbu1_offset = 0, sotbu2_dim1 = 0, sotbu2_dim2 = 0, + sotbu2_offset = 0, ditbu1_dim1 = 0, ditbu1_dim2 = 0, ditbu1_offset = 0, + ditbu2_dim1 = 0, ditbu2_dim2 = 0, ditbu2_offset = 0, fpntab_dim1 = 0, + fpntab_offset = 0, uhermt_dim1 = 0, uhermt_offset = 0, sosotb_dim1 = 0, + sosotb_dim2 = 0, sosotb_offset = 0, diditb_dim1 = 0, diditb_dim2 = 0, + diditb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, + disotb_dim1 = 0, disotb_dim2 = 0, disotb_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0; /* Local variables */ - integer ncfhu, nuroo, nvroo, ii, nd, jj, kk, ibb, kkm, kkp; - doublereal bid1, bid2, bid3, bid4; + integer ncfhu = 0, nuroo = 0, nvroo = 0, ii = 0, nd = 0, jj = 0, kk = 0, ibb = 0, kkm = 0, kkp = 0; + doublereal bid1 = NAN, bid2 = NAN, bid3 = NAN, bid4 = NAN; /* ********************************************************************** */ @@ -3304,22 +3306,22 @@ int AdvApp2Var_ApproxF2var::mma2cdi_( integer *ndimen, integer c__8 = 8; /* System generated locals */ - integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2, - contr2_offset, contr3_dim1, contr3_dim2, contr3_offset, - contr4_dim1, contr4_dim2, contr4_offset, sosotb_dim1, sosotb_dim2, - sosotb_offset, diditb_dim1, diditb_dim2, diditb_offset, - soditb_dim1, soditb_dim2, soditb_offset, disotb_dim1, disotb_dim2, - disotb_offset; + integer contr1_dim1 = 0, contr1_dim2 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_dim2 = 0, + contr2_offset = 0, contr3_dim1 = 0, contr3_dim2 = 0, contr3_offset = 0, + contr4_dim1 = 0, contr4_dim2 = 0, contr4_offset = 0, sosotb_dim1 = 0, sosotb_dim2 = 0, + sosotb_offset = 0, diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, + soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0, + disotb_offset = 0; /* Local variables */ - integer ilong; - intptr_t iofwr; + integer ilong = 0; + intptr_t iofwr = 0; doublereal* wrkar = 0; - doublereal* wrkar_off; - integer iszwr; - integer ibb, ier = 0; - integer isz1, isz2, isz3, isz4; - intptr_t ipt1, ipt2, ipt3; + doublereal* wrkar_off = nullptr; + integer iszwr = 0; + integer ibb = 0, ier = 0; + integer isz1 = 0, isz2 = 0, isz3 = 0, isz4 = 0; + intptr_t ipt1 = 0, ipt2 = 0, ipt3 = 0; @@ -3621,20 +3623,20 @@ int AdvApp2Var_ApproxF2var::mma2ce1_(integer *numdec, integer c__8 = 8; /* System generated locals */ - integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2, - disotb_offset, soditb_dim1, soditb_dim2, soditb_offset, - diditb_dim1, diditb_dim2, diditb_offset, patjac_dim1, patjac_dim2, - patjac_offset; + integer sosotb_dim1 = 0, sosotb_dim2 = 0, sosotb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0, + disotb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, + diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, patjac_dim1 = 0, patjac_dim2 = 0, + patjac_offset = 0; /* Local variables */ - logical ldbg; - intptr_t iofwr; + logical ldbg = 0; + intptr_t iofwr = 0; doublereal* wrkar = 0; - doublereal* wrkar_off; - integer iszwr; - integer ier; - integer isz1, isz2, isz3, isz4, isz5, isz6, isz7; - intptr_t ipt1, ipt2, ipt3, ipt4, ipt5, ipt6; + doublereal* wrkar_off = nullptr; + integer iszwr = 0; + integer ier = 0; + integer isz1 = 0, isz2 = 0, isz3 = 0, isz4 = 0, isz5 = 0, isz6 = 0, isz7 = 0; + intptr_t ipt1 = 0, ipt2 = 0, ipt3 = 0, ipt4 = 0, ipt5 = 0, ipt6 = 0; @@ -3902,20 +3904,20 @@ int mma2ce2_(integer *numdec, { /* System generated locals */ - integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2, - disotb_offset, soditb_dim1, soditb_dim2, soditb_offset, - diditb_dim1, diditb_dim2, diditb_offset, gssutb_dim1, gssvtb_dim1, - chpair_dim1, chpair_dim2, chpair_offset, chimpr_dim1, - chimpr_dim2, chimpr_offset, patjac_dim1, patjac_dim2, - patjac_offset, vecerr_dim1, vecerr_offset, i__1, i__2, i__3, i__4; + integer sosotb_dim1 = 0, sosotb_dim2 = 0, sosotb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0, + disotb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, + diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, gssutb_dim1 = 0, gssvtb_dim1 = 0, + chpair_dim1 = 0, chpair_dim2 = 0, chpair_offset = 0, chimpr_dim1 = 0, + chimpr_dim2 = 0, chimpr_offset = 0, patjac_dim1 = 0, patjac_dim2 = 0, + patjac_offset = 0, vecerr_dim1 = 0, vecerr_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0; /* Local variables */ - logical ldbg; - integer idim, igsu, minu, minv, maxu, maxv, igsv; + logical ldbg = 0; + integer idim = 0, igsu = 0, minu = 0, minv = 0, maxu = 0, maxv = 0, igsv = 0; doublereal vaux[3]; - integer i2rdu, i2rdv, ndses, nd, ii, jj, kk, nu, nv; - doublereal zu, zv; - integer nu1, nv1; + integer i2rdu = 0, i2rdv = 0, ndses = 0, nd = 0, ii = 0, jj = 0, kk = 0, nu = 0, nv = 0; + doublereal zu = NAN, zv = NAN; + integer nu1 = 0, nv1 = 0; /* ********************************************************************** */ @@ -4671,13 +4673,13 @@ int mma2cfu_(integer *ndujac, { /* System generated locals */ - integer sosotb_dim1, disotb_dim1, disotb_offset, soditb_dim1, - soditb_offset, diditb_dim1, i__1, i__2; + integer sosotb_dim1 = 0, disotb_dim1 = 0, disotb_offset = 0, soditb_dim1 = 0, + soditb_offset = 0, diditb_dim1 = 0, i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; - integer nptu2, nptv2, ii, jj; - doublereal bid0, bid1, bid2; + logical ldbg = 0; + integer nptu2 = 0, nptv2 = 0, ii = 0, jj = 0; + doublereal bid0 = NAN, bid1 = NAN, bid2 = NAN; /* ********************************************************************** */ @@ -4887,13 +4889,13 @@ int mma2cfv_(integer *ndvjac, { /* System generated locals */ - integer chpair_dim1, chpair_offset, chimpr_dim1, chimpr_offset, - patjac_offset, i__1, i__2; + integer chpair_dim1 = 0, chpair_offset = 0, chimpr_dim1 = 0, chimpr_offset = 0, + patjac_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; - integer nptv2, ii, jj; - doublereal bid1; + logical ldbg = 0; + integer nptv2 = 0, ii = 0, jj = 0; + doublereal bid1 = NAN; /* ********************************************************************** */ @@ -5043,15 +5045,15 @@ int AdvApp2Var_ApproxF2var::mma2ds1_(integer *ndimen, { /* System generated locals */ - integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2, - disotb_offset, soditb_dim1, soditb_dim2, soditb_offset, - diditb_dim1, diditb_dim2, diditb_offset, fpntab_dim1, - fpntab_offset, i__1; + integer sosotb_dim1 = 0, sosotb_dim2 = 0, sosotb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0, + disotb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, + diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, fpntab_dim1 = 0, + fpntab_offset = 0, i__1 = 0; /* Local variables */ - logical ldbg; - integer ibid1, ibid2, iuouv, nd; - integer isz1, isz2; + logical ldbg = 0; + integer ibid1 = 0, ibid2 = 0, iuouv = 0, nd = 0; + integer isz1 = 0, isz2 = 0; /* ********************************************************************** */ @@ -5364,18 +5366,18 @@ int mma2ds2_(integer *ndimen, { integer c__0 = 0; /* System generated locals */ - integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2, - disotb_offset, soditb_dim1, soditb_dim2, soditb_offset, - diditb_dim1, diditb_dim2, diditb_offset, fpntab_dim1, - fpntab_offset, i__1, i__2, i__3; + integer sosotb_dim1 = 0, sosotb_dim2 = 0, sosotb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0, + disotb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, + diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, fpntab_dim1 = 0, + fpntab_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0; /* Local variables */ - integer jdec; - logical ldbg; - doublereal alinu, blinu, alinv, blinv, tcons; + integer jdec = 0; + logical ldbg = 0; + doublereal alinu = NAN, blinu = NAN, alinv = NAN, blinv = NAN, tcons = NAN; doublereal dbfn1[2], dbfn2[2]; - integer nuroo, nvroo, id, iu, iv; - doublereal um, up; + integer nuroo = 0, nvroo = 0, id = 0, iu = 0, iv = 0; + doublereal um = NAN, up = NAN; /* ********************************************************************** @@ -5742,15 +5744,15 @@ int mma2er1_(integer *ndjacu, { /* System generated locals */ - integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3; - doublereal d__1; + integer patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0; + doublereal d__1 = NAN; /* Local variables */ - logical ldbg; - integer minu, minv; + logical ldbg = 0; + integer minu = 0, minv = 0; doublereal vaux[2]; - integer ii, nd, jj; - doublereal bid0, bid1; + integer ii = 0, nd = 0, jj = 0; + doublereal bid0 = NAN, bid1 = NAN; /* ********************************************************************** */ @@ -5908,16 +5910,16 @@ int mma2er2_(integer *ndjacu, { /* System generated locals */ - integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2; - doublereal d__1; + integer patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - logical ldbg; + logical ldbg = 0; doublereal vaux[2]; - integer i2rdu, i2rdv; - doublereal errnu, errnv; - integer ii, nd, jj, nu, nv; - doublereal bid0, bid1; + integer i2rdu = 0, i2rdv = 0; + doublereal errnu = NAN, errnv = NAN; + integer ii = 0, nd = 0, jj = 0, nu = 0, nv = 0; + doublereal bid0 = NAN, bid1 = NAN; /* ********************************************************************** */ @@ -6155,31 +6157,31 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen, integer c__8 = 8; /* System generated locals */ - integer courbe_dim1, courbe_dim2, courbe_offset, somtab_dim1, somtab_dim2, - somtab_offset, diftab_dim1, diftab_dim2, diftab_offset, - contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2, - contr2_offset, errmax_dim1, errmax_offset, errmoy_dim1, - errmoy_offset, i__1; - doublereal d__1; + integer courbe_dim1 = 0, courbe_dim2 = 0, courbe_offset = 0, somtab_dim1 = 0, somtab_dim2 = 0, + somtab_offset = 0, diftab_dim1 = 0, diftab_dim2 = 0, diftab_offset = 0, + contr1_dim1 = 0, contr1_dim2 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_dim2 = 0, + contr2_offset = 0, errmax_dim1 = 0, errmax_offset = 0, errmoy_dim1 = 0, + errmoy_offset = 0, i__1 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer ideb; - doublereal tmil; - integer ideb1, ibid1, ibid2, ncfja, ndgre, ilong, - ndwrk; + integer ideb = 0; + doublereal tmil = NAN; + integer ideb1 = 0, ibid1 = 0, ibid2 = 0, ncfja = 0, ndgre = 0, ilong = 0, + ndwrk = 0; doublereal* wrkar = 0; - doublereal* wrkar_off; - integer nupil; - intptr_t iofwr; + doublereal* wrkar_off = nullptr; + integer nupil = 0; + intptr_t iofwr = 0; doublereal uvpav[4] /* was [2][2] */; - integer nd, ii; - integer ibb; + integer nd = 0, ii = 0; + integer ibb = 0; integer ier = 0; doublereal uv11[4] /* was [2][2] */; - integer ncb1; - doublereal eps3; - integer isz1, isz2, isz3, isz4, isz5; - intptr_t ipt1, ipt2, ipt3, ipt4,iptt, jptt; + integer ncb1 = 0; + doublereal eps3 = NAN; + integer isz1 = 0, isz2 = 0, isz3 = 0, isz4 = 0, isz5 = 0; + intptr_t ipt1 = 0, ipt2 = 0, ipt3 = 0, ipt4 = 0,iptt = 0, jptt = 0; /* ********************************************************************** */ @@ -6707,16 +6709,16 @@ int AdvApp2Var_ApproxF2var::mma2fx6_(integer *ncfmxu, { /* System generated locals */ - integer epsfro_dim1, epsfro_offset, patcan_dim1, patcan_dim2, patcan_dim3, - patcan_dim4, patcan_offset, errmax_dim1, errmax_dim2, - errmax_offset, ncoefu_dim1, ncoefu_offset, ncoefv_dim1, - ncoefv_offset, i__1, i__2, i__3, i__4, i__5; - doublereal d__1, d__2; + integer epsfro_dim1 = 0, epsfro_offset = 0, patcan_dim1 = 0, patcan_dim2 = 0, patcan_dim3 = 0, + patcan_dim4 = 0, patcan_offset = 0, errmax_dim1 = 0, errmax_dim2 = 0, + errmax_offset = 0, ncoefu_dim1 = 0, ncoefu_offset = 0, ncoefv_dim1 = 0, + ncoefv_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0, i__5 = 0; + doublereal d__1 = NAN, d__2 = NAN; /* Local variables */ - integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb; - doublereal bid; - doublereal tol; + integer idim = 0, ncfu = 0, ncfv = 0, id = 0, ii = 0, nd = 0, jj = 0, ku = 0, kv = 0, ns = 0, ibb = 0; + doublereal bid = NAN; + doublereal tol = NAN; /* ********************************************************************** */ @@ -7142,12 +7144,12 @@ int AdvApp2Var_ApproxF2var::mma2jmx_(integer *ndgjac, 2.71238965987606292679677228666411 }; /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - logical ldbg; - integer numax, ii; - doublereal bid; + logical ldbg = 0; + integer numax = 0, ii = 0; + doublereal bid = NAN; /* ********************************************************************** @@ -7246,12 +7248,12 @@ int mma2moy_(integer *ndgumx, doublereal *errmoy) { /* System generated locals */ - integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3; + integer patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0; /* Local variables */ - logical ldbg; - integer minu, minv, idebu, idebv, ii, nd, jj; - doublereal bid0, bid1; + logical ldbg = 0; + integer minu = 0, minv = 0, idebu = 0, idebv = 0, ii = 0, nd = 0, jj = 0; + doublereal bid0 = NAN, bid1 = NAN; /* ********************************************************************** @@ -7393,10 +7395,10 @@ int AdvApp2Var_ApproxF2var::mma2roo_(integer *nbpntu, doublereal *vrootl) { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer ii, ibb; + integer ii = 0, ibb = 0; /* ********************************************************************** */ @@ -7498,13 +7500,13 @@ int mmmapcoe_(integer *ndim, { /* System generated locals */ - integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset, - crvjac_dim1, crvjac_offset, gsstab_dim1, i__1, i__2, i__3; + integer somtab_dim1 = 0, somtab_offset = 0, diftab_dim1 = 0, diftab_offset = 0, + crvjac_dim1 = 0, crvjac_offset = 0, gsstab_dim1 = 0, i__1 = 0, i__2 = 0, i__3 = 0; /* Local variables */ - integer igss, ikdeb; - doublereal bidon; - integer nd, ik, ir, nbroot, ibb; + integer igss = 0, ikdeb = 0; + doublereal bidon = NAN; + integer nd = 0, ik = 0, ir = 0, nbroot = 0, ibb = 0; /* ********************************************************************** */ @@ -7660,12 +7662,12 @@ int mmaperm_(integer *ncofmx, doublereal *errmoy) { /* System generated locals */ - integer crvjac_dim1, crvjac_offset, i__1, i__2; + integer crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - doublereal bidj; - integer i__, ia, nd, ncfcut, ibb; - doublereal bid; + doublereal bidj = NAN; + integer i__ = 0, ia = 0, nd = 0, ncfcut = 0, ibb = 0; + doublereal bid = NAN; /* ********************************************************************** */ @@ -7769,10 +7771,10 @@ int AdvApp2Var_ApproxF2var::mmapptt_(const integer *ndgjac, integer *iercod) { /* System generated locals */ - integer cgauss_dim1, i__1; + integer cgauss_dim1 = 0, i__1 = 0; /* Local variables */ - integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb; + integer kjac = 0, iptt = 0, ipdb0 = 0, infdg = 0, iptdb = 0, mxjac = 0, ilong = 0, ibb = 0; /* ********************************************************************** */ @@ -8071,12 +8073,12 @@ int mmjacpt_(const integer *ndimen, doublereal *ptccan) { /* System generated locals */ - integer ptccan_dim1, ptccan_dim2, ptccan_offset, ptclgd_dim1, ptclgd_dim2, - ptclgd_offset, ptcaux_dim1, ptcaux_dim2, ptcaux_dim3, - ptcaux_offset, i__1, i__2, i__3; + integer ptccan_dim1 = 0, ptccan_dim2 = 0, ptccan_offset = 0, ptclgd_dim1 = 0, ptclgd_dim2 = 0, + ptclgd_offset = 0, ptcaux_dim1 = 0, ptcaux_dim2 = 0, ptcaux_dim3 = 0, + ptcaux_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0; /* Local variables */ - integer kdim, nd, ii, jj, ibb; + integer kdim = 0, nd = 0, ii = 0, jj = 0, ibb = 0; /* *********************************************************************** */ diff --git a/src/AdvApp2Var/AdvApp2Var_Context.cxx b/src/AdvApp2Var/AdvApp2Var_Context.cxx index 23784349b5..f6ebdf7dec 100644 --- a/src/AdvApp2Var/AdvApp2Var_Context.cxx +++ b/src/AdvApp2Var/AdvApp2Var_Context.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -108,7 +110,7 @@ myNb2DSS(nb2Dss), myNb3DSS(nb3Dss) { Standard_Integer ErrorCode=0,NbPntU=0,JDegU=0,NbPntV=0,JDegV=0; -Standard_Integer ncfl; +Standard_Integer ncfl = 0; // myNbURoot,myJDegU ncfl = nlimu; @@ -120,7 +122,7 @@ myJDegU = JDegU; if (iu>-1) NbPntU = myNbURoot - 2; // myJMaxU -Standard_Integer i,j,size = JDegU-2*iu-1; +Standard_Integer i = 0,j = 0,size = JDegU-2*iu-1; Handle (TColStd_HArray1OfReal) JMaxU = new TColStd_HArray1OfReal(1,size); Standard_Real *JU_array = @@ -223,7 +225,7 @@ for (j=1;j<=4;j++) { } } if (iu>-1||iv>-1) { - Standard_Real tolmin, poids, hmax[4]; + Standard_Real tolmin = NAN, poids = NAN, hmax[4]; hmax[0] = 0; hmax[1] = 1; hmax[2] = 1.5; diff --git a/src/AdvApp2Var/AdvApp2Var_Framework.cxx b/src/AdvApp2Var/AdvApp2Var_Framework.cxx index 846781e54a..69a5ccee1c 100644 --- a/src/AdvApp2Var/AdvApp2Var_Framework.cxx +++ b/src/AdvApp2Var/AdvApp2Var_Framework.cxx @@ -45,11 +45,11 @@ AdvApp2Var_Framework::AdvApp2Var_Framework() AdvApp2Var_Framework::AdvApp2Var_Framework(const AdvApp2Var_SequenceOfNode& Frame, const AdvApp2Var_SequenceOfStrip& UFrontier, - const AdvApp2Var_SequenceOfStrip& VFrontier) + const AdvApp2Var_SequenceOfStrip& VFrontier) : myNodeConstraints(Frame), myUConstraints(UFrontier), myVConstraints(VFrontier) { - myNodeConstraints = Frame; - myUConstraints = UFrontier; - myVConstraints = VFrontier; + + + } //========================================================================================== @@ -92,7 +92,7 @@ Standard_Integer AdvApp2Var_Framework::FirstNode(const GeomAbs_IsoType Type, const Standard_Integer IndexIso, const Standard_Integer IndexStrip) const { - Standard_Integer NbIso,Index; + Standard_Integer NbIso = 0,Index = 0; NbIso = myUConstraints.Length()+1; if (Type==GeomAbs_IsoU) { Index = NbIso * (IndexStrip-1) + IndexIso; @@ -113,7 +113,7 @@ Standard_Integer AdvApp2Var_Framework::LastNode(const GeomAbs_IsoType Type, const Standard_Integer IndexIso, const Standard_Integer IndexStrip) const { - Standard_Integer NbIso,Index; + Standard_Integer NbIso = 0,Index = 0; NbIso = myUConstraints.Length()+1; if (Type==GeomAbs_IsoU) { Index = NbIso * IndexStrip + IndexIso; diff --git a/src/AdvApp2Var/AdvApp2Var_Iso.cxx b/src/AdvApp2Var/AdvApp2Var_Iso.cxx index 9f34a45f4e..386f641928 100644 --- a/src/AdvApp2Var/AdvApp2Var_Iso.cxx +++ b/src/AdvApp2Var/AdvApp2Var_Iso.cxx @@ -116,9 +116,9 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions, AdvApp2Var_Node& NodeEnd) { // fixed values - Standard_Integer NBCRMX=1, NBCRBE; + Standard_Integer NBCRMX=1, NBCRBE = 0; // data stored in the Context - Standard_Integer NDIMEN, NBSESP, NDIMSE; + Standard_Integer NDIMEN = 0, NBSESP = 0, NDIMSE = 0; NDIMEN = Conditions.TotalDimension(); NBSESP = Conditions.TotalNumberSSP(); // Attention : works only in 3D @@ -176,7 +176,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions, // data relative to the position of iso (front or cut line) Handle (TColStd_HArray1OfReal) HEPSAPR = new TColStd_HArray1OfReal(1,NBSESP); - Standard_Integer iesp; + Standard_Integer iesp = 0; switch(myPosition) { case 0 : for (iesp=1;iesp<=NBSESP;iesp++) { @@ -247,7 +247,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions, // the approximations // Standard_Integer IERCOD=0, NCOEFF=0; - Standard_Integer iapp,ncfapp,ierapp; + Standard_Integer iapp = 0,ncfapp = 0,ierapp = 0; // Standard_Integer id,ic,ideb; for (iapp=0;iapp<=IDERIV;iapp++) { // approximation of the derivative of order iapp @@ -291,7 +291,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions, if (NCOEFF<=ncfapp) NCOEFF=ncfapp; if (ierapp==-1) IERCOD = -1; // return constraints of order 0 to IORDRE of extremities - Standard_Integer ider, jpos=HCONTR1->Lower(); + Standard_Integer ider = 0, jpos=HCONTR1->Lower(); for (ider=0; ider<=IORDRE;ider++) { gp_Pnt pt(HCONTR1->Value(jpos), HCONTR1->Value(jpos+1), diff --git a/src/AdvApp2Var/AdvApp2Var_MathBase.cxx b/src/AdvApp2Var/AdvApp2Var_MathBase.cxx index 7641dfb915..85119cd108 100644 --- a/src/AdvApp2Var/AdvApp2Var_MathBase.cxx +++ b/src/AdvApp2Var/AdvApp2Var_MathBase.cxx @@ -265,14 +265,14 @@ int AdvApp2Var_MathBase::mdsptpt_(integer *ndimen, { integer c__8 = 8; /* System generated locals */ - integer i__1; - doublereal d__1; + integer i__1 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer i__; + integer i__ = 0; doublereal* differ = 0; - integer ier; - intptr_t iofset, j; + integer ier = 0; + intptr_t iofset = 0, j = 0; /* ********************************************************************** */ @@ -384,10 +384,10 @@ int mfac_(doublereal *f, { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer i__; + integer i__ = 0; /* FORTRAN CONFORME AU TEXT */ /* CALCUL DE MFACTORIEL N */ @@ -416,11 +416,11 @@ int AdvApp2Var_MathBase::mmapcmp_(integer *ndim, { /* System generated locals */ - integer crvold_dim1, crvold_offset, crvnew_dim1, crvnew_offset, i__1, - i__2; + integer crvold_dim1 = 0, crvold_offset = 0, crvnew_dim1 = 0, crvnew_offset = 0, i__1 = 0, + i__2 = 0; /* Local variables */ - integer ipair, nd, ndegre, impair, ibb, idg; + integer ipair = 0, nd = 0, ndegre = 0, impair = 0, ibb = 0, idg = 0; //extern int mgsomsg_();//mgenmsg_(), /* ********************************************************************** @@ -532,13 +532,13 @@ int mmaper0_(integer *ncofmx, { /* System generated locals */ - integer crvlgd_dim1, crvlgd_offset, i__1, i__2; - doublereal d__1; + integer crvlgd_dim1 = 0, crvlgd_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer ncut; - doublereal bidon; - integer ii, nd; + integer ncut = 0; + doublereal bidon = NAN; + integer ii = 0, nd = 0; /* *********************************************************************** */ @@ -710,13 +710,13 @@ int mmaper2_(integer *ncofmx, 3.72184531357268220291630708234186 }; /* System generated locals */ - integer crvjac_dim1, crvjac_offset, i__1, i__2; - doublereal d__1; + integer crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer idec, ncut; - doublereal bidon; - integer ii, nd; + integer idec = 0, ncut = 0; + doublereal bidon = NAN; + integer ii = 0, nd = 0; @@ -894,13 +894,13 @@ int mmaper4_(integer *ncofmx, 3.05886060707437081434964933864149 }; /* System generated locals */ - integer crvjac_dim1, crvjac_offset, i__1, i__2; - doublereal d__1; + integer crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer idec, ncut; - doublereal bidon; - integer ii, nd; + integer idec = 0, ncut = 0; + doublereal bidon = NAN; + integer ii = 0, nd = 0; @@ -1073,13 +1073,13 @@ int mmaper6_(integer *ncofmx, 2.71238965987606292679677228666411 }; /* System generated locals */ - integer crvjac_dim1, crvjac_offset, i__1, i__2; - doublereal d__1; + integer crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer idec, ncut; - doublereal bidon; - integer ii, nd; + integer idec = 0, ncut = 0; + doublereal bidon = NAN; + integer ii = 0, nd = 0; @@ -1196,10 +1196,10 @@ int AdvApp2Var_MathBase::mmaperx_(integer *ncofmx, { /* System generated locals */ - integer crvjac_dim1, crvjac_offset; + integer crvjac_dim1 = 0, crvjac_offset = 0; /* Local variables */ - integer jord; + integer jord = 0; /* ********************************************************************** */ @@ -1291,15 +1291,15 @@ int AdvApp2Var_MathBase::mmaperx_(integer *ncofmx, { /* System generated locals */ - integer crvold_dim1, crvold_offset, crvnew_dim1, crvnew_offset, i__1, - i__2, i__3; + integer crvold_dim1 = 0, crvold_offset = 0, crvnew_dim1 = 0, crvnew_offset = 0, i__1 = 0, + i__2 = 0, i__3 = 0; /* Local variables */ - integer nboct; + integer nboct = 0; doublereal tbaux[61]; - integer nd; - doublereal bid; - integer ncf, ncj; + integer nd = 0; + doublereal bid = NAN; + integer ncf = 0, ncj = 0; /* IMPLICIT DOUBLE PRECISION(A-H,O-Z) */ @@ -1535,19 +1535,19 @@ int AdvApp2Var_MathBase::mmarcin_(integer *ndimax, { /* System generated locals */ - integer crvold_dim1, crvold_offset, crvnew_dim1, crvnew_offset, i__1, - i__2, i__3; - doublereal d__1; + integer crvold_dim1 = 0, crvold_offset = 0, crvnew_dim1 = 0, crvnew_offset = 0, i__1 = 0, + i__2 = 0, i__3 = 0; + doublereal d__1 = NAN; /* Local variables */ - doublereal x0, x1; - integer nd; + doublereal x0 = NAN, x1 = NAN; + integer nd = 0; doublereal tabaux[61]; - integer ibb; - doublereal bid; - integer ncf; - integer ncj; - doublereal eps3; + integer ibb = 0; + doublereal bid = NAN; + integer ncf = 0; + integer ncj = 0; + doublereal eps3 = NAN; @@ -1762,13 +1762,13 @@ int mmatvec_(integer *nligne, { /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; - integer jmin, jmax, i__, j, k; - doublereal somme; - integer aux; + logical ldbg = 0; + integer jmin = 0, jmax = 0, i__ = 0, j = 0, k = 0; + doublereal somme = NAN; + integer aux = 0; /* *********************************************************************** @@ -1912,12 +1912,12 @@ int AdvApp2Var_MathBase::mmbulld_(integer *nbcoln, { /* System generated locals */ - integer dtabtr_dim1, dtabtr_offset, i__1, i__2; + integer dtabtr_dim1 = 0, dtabtr_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; - doublereal daux; - integer nite1, nite2, nchan, i1, i2; + logical ldbg = 0; + doublereal daux = NAN; + integer nite1 = 0, nite2 = 0, nchan = 0, i1 = 0, i2 = 0; /* *********************************************************************** */ @@ -2064,12 +2064,12 @@ int AdvApp2Var_MathBase::mmcdriv_(integer *ndimen, { /* System generated locals */ - integer courbe_dim1, courbe_offset, crvdrv_dim1, crvdrv_offset, i__1, - i__2; + integer courbe_dim1 = 0, courbe_offset = 0, crvdrv_dim1 = 0, crvdrv_offset = 0, i__1 = 0, + i__2 = 0; /* Local variables */ - integer i__, j, k; - doublereal mfactk, bid; + integer i__ = 0, j = 0, k = 0; + doublereal mfactk = NAN, bid = NAN; /* *********************************************************************** @@ -2242,19 +2242,19 @@ int AdvApp2Var_MathBase::mmcglc1_(integer *ndimax, { /* System generated locals */ - integer courbe_dim1, courbe_offset, i__1; - doublereal d__1; + integer courbe_dim1 = 0, courbe_offset = 0, i__1 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer ndec; - doublereal tdeb, tfin; - integer iter; + integer ndec = 0; + doublereal tdeb = NAN, tfin = NAN; + integer iter = 0; doublereal oldso = 0.; - integer itmax; - doublereal sottc; - integer kk, ibb; - doublereal dif, pas; - doublereal som; + integer itmax = 0; + doublereal sottc = NAN; + integer kk = 0, ibb = 0; + doublereal dif = NAN, pas = NAN; + doublereal som = NAN; /* *********************************************************************** @@ -2469,17 +2469,17 @@ int mmchole_(integer *,//mxcoef, { /* System generated locals */ - integer i__1, i__2, i__3; - doublereal d__1; + integer i__1 = 0, i__2 = 0, i__3 = 0; + doublereal d__1 = NAN; /* Builtin functions */ //double sqrt(); /* Local variables */ - logical ldbg; - integer kmin, i__, j, k; - doublereal somme; - integer ptini, ptcou; + logical ldbg = 0; + integer kmin = 0, i__ = 0, j = 0, k = 0; + doublereal somme = NAN; + integer ptini = 0, ptcou = 0; /* *********************************************************************** @@ -2641,15 +2641,15 @@ int AdvApp2Var_MathBase::mmcvctx_(integer *ndimen, { /* System generated locals */ - integer ctrtes_dim1, ctrtes_offset, crvres_dim1, crvres_offset, - xmatri_dim1, xmatri_offset, tabaux_dim1, tabaux_offset, i__1, - i__2; + integer ctrtes_dim1 = 0, ctrtes_offset = 0, crvres_dim1 = 0, crvres_offset = 0, + xmatri_dim1 = 0, xmatri_offset = 0, tabaux_dim1 = 0, tabaux_offset = 0, i__1 = 0, + i__2 = 0; /* Local variables */ - integer moup1, nordr; - integer nd; - integer ibb, ncf, ndv; - doublereal eps1; + integer moup1 = 0, nordr = 0; + integer nd = 0; + integer ibb = 0, ncf = 0, ndv = 0; + doublereal eps1 = NAN; /* *********************************************************************** @@ -2891,10 +2891,10 @@ L9999: static char nomprg[8+1] = "MMCVINV "; /* System generated locals */ - integer curve_dim1, curve_offset, curveo_dim1, curveo_offset, i__1, i__2; + integer curve_dim1 = 0, curve_offset = 0, curveo_dim1 = 0, curveo_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - integer i__, nd, ibb; + integer i__ = 0, nd = 0, ibb = 0; /* *********************************************************************** @@ -2971,11 +2971,11 @@ int mmcvstd_(integer *ncofmx, { /* System generated locals */ - integer courbe_dim1, crvcan_dim1, crvcan_offset, i__1, i__2, i__3; + integer courbe_dim1 = 0, crvcan_dim1 = 0, crvcan_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0; /* Local variables */ - integer ndeg, i__, j, j1, nd, ibb; - doublereal bid; + integer ndeg = 0, i__ = 0, j = 0, j1 = 0, nd = 0, ibb = 0; + doublereal bid = NAN; /* *********************************************************************** @@ -3124,12 +3124,12 @@ int AdvApp2Var_MathBase::mmdrc11_(integer *iordre, { /* System generated locals */ - integer courbe_dim1, courbe_offset, points_dim2, points_offset, i__1, - i__2; + integer courbe_dim1 = 0, courbe_offset = 0, points_dim2 = 0, points_offset = 0, i__1 = 0, + i__2 = 0; /* Local variables */ - integer ndeg, i__, j, ndgcb, nd, ibb; + integer ndeg = 0, i__ = 0, j = 0, ndgcb = 0, nd = 0, ibb = 0; /* ********************************************************************** @@ -3313,10 +3313,10 @@ int mmdrvcb_(integer *ideriv, { /* System generated locals */ - integer courbe_dim1, tabpnt_dim1, i__1, i__2, i__3; + integer courbe_dim1 = 0, tabpnt_dim1 = 0, i__1 = 0, i__2 = 0, i__3 = 0; /* Local variables */ - integer ndeg, i__, j, nd, ndgcrb, iptpnt, ibb; + integer ndeg = 0, i__ = 0, j = 0, nd = 0, ndgcrb = 0, iptpnt = 0, ibb = 0; /* *********************************************************************** */ @@ -3495,11 +3495,11 @@ int AdvApp2Var_MathBase::mmdrvck_(integer *ncoeff, 1.21645100408832e17,2.43290200817664e18,5.109094217170944e19 }; /* System generated locals */ - integer courbe_dim1, courbe_offset, i__1, i__2; + integer courbe_dim1 = 0, courbe_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - integer i__, j, k, nd; - doublereal mfactk, bid; + integer i__ = 0, j = 0, k = 0, nd = 0; + doublereal mfactk = NAN, bid = NAN; /* IMPLICIT INTEGER (I-N) */ @@ -3769,11 +3769,11 @@ int mmexthi_(integer *ndegre, { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer iadd, ideb, ndeg2, nmod2, ii, ibb; - integer kpt; + integer iadd = 0, ideb = 0, ndeg2 = 0, nmod2 = 0, ii = 0, ibb = 0; + integer kpt = 0; /* ********************************************************************** */ @@ -3918,11 +3918,11 @@ int mmextrl_(integer *ndegre, NCollection_Array1& rootlg) { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer iadd, ideb, ndeg2, nmod2, ii, ibb; - integer kpt; + integer iadd = 0, ideb = 0, ndeg2 = 0, nmod2 = 0, ii = 0, ibb = 0; + integer kpt = 0; /* ********************************************************************** @@ -4071,11 +4071,11 @@ int AdvApp2Var_MathBase::mmfmca8_(const integer *ndimen, { /* System generated locals */ - integer tabini_dim1, tabini_dim2, tabini_offset, tabres_dim1, tabres_dim2, - tabres_offset; + integer tabini_dim1 = 0, tabini_dim2 = 0, tabini_offset = 0, tabres_dim1 = 0, tabres_dim2 = 0, + tabres_offset = 0; /* Local variables */ - integer i__, j, k, ilong; + integer i__ = 0, j = 0, k = 0, ilong = 0; @@ -4207,11 +4207,11 @@ L9999: { /* System generated locals */ - integer tabini_dim1, tabini_dim2, tabini_offset, tabres_dim1, tabres_dim2, - tabres_offset, i__1, i__2, i__3; + integer tabini_dim1 = 0, tabini_dim2 = 0, tabini_offset = 0, tabres_dim1 = 0, tabres_dim2 = 0, + tabres_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0; /* Local variables */ - integer i__, j, k, ilong; + integer i__ = 0, j = 0, k = 0, ilong = 0; @@ -4355,14 +4355,14 @@ int AdvApp2Var_MathBase::mmfmcar_(integer *ndimen, { integer c__8 = 8; /* System generated locals */ - integer patold_dim1, patold_dim2, patnew_dim1, patnew_dim2, - i__1, patold_offset,patnew_offset; + integer patold_dim1 = 0, patold_dim2 = 0, patnew_dim1 = 0, patnew_dim2 = 0, + i__1 = 0, patold_offset = 0,patnew_offset = 0; /* Local variables */ doublereal* tbaux = 0; - integer ksize, numax, kk; - intptr_t iofst; - integer ibb, ier; + integer ksize = 0, numax = 0, kk = 0; + intptr_t iofst = 0; + integer ibb = 0, ier = 0; /* *********************************************************************** */ @@ -4598,11 +4598,11 @@ int AdvApp2Var_MathBase::mmfmcb5_(integer *isenmsc, { /* System generated locals */ - integer courb1_dim1, courb1_offset, courb2_dim1, courb2_offset, i__1, - i__2; + integer courb1_dim1 = 0, courb1_offset = 0, courb2_dim1 = 0, courb2_offset = 0, i__1 = 0, + i__2 = 0; /* Local variables */ - integer i__, nboct, nd; + integer i__ = 0, nboct = 0, nd = 0; /* ********************************************************************** @@ -4745,13 +4745,13 @@ int AdvApp2Var_MathBase::mmfmtb1_(integer *maxsz1, integer c__8 = 8; /* System generated locals */ - integer table1_dim1, table1_offset, table2_dim1, table2_offset, i__1, - i__2; + integer table1_dim1 = 0, table1_offset = 0, table2_dim1 = 0, table2_offset = 0, i__1 = 0, + i__2 = 0; /* Local variables */ doublereal* work = 0; - integer ilong, isize, ii, jj, ier = 0; - intptr_t iofst = 0,iipt, jjpt; + integer ilong = 0, isize = 0, ii = 0, jj = 0, ier = 0; + intptr_t iofst = 0,iipt = 0, jjpt = 0; /************************************************************************ @@ -4896,15 +4896,15 @@ int AdvApp2Var_MathBase::mmgaus1_(integer *ndimf, integer *iercod) { /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - integer ndeg; + integer ndeg = 0; doublereal h__[20]; - integer j; - doublereal t, u[20], x; - integer idimf; - doublereal c1x, c2x; + integer j = 0; + doublereal t = NAN, u[20], x = NAN; + integer idimf = 0; + doublereal c1x = NAN, c2x = NAN; /* ********************************************************************** */ @@ -5083,22 +5083,22 @@ int mmherm0_(doublereal *debfin, /* System generated locals */ - integer i__1, i__2; - doublereal d__1; + integer i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ doublereal amat[36] /* was [6][6] */; integer iord[2]; - doublereal prod; - integer iord1, iord2; + doublereal prod = NAN; + integer iord1 = 0, iord2 = 0; doublereal miden[36] /* was [6][6] */; - integer ncmat; - doublereal epspi, d1, d2; - integer ii, jj, pp, ncf; + integer ncmat = 0; + doublereal epspi = NAN, d1 = NAN, d2 = NAN; + integer ii = 0, jj = 0, pp = 0, ncf = 0; doublereal cof[6]; - integer iof[2], ier; + integer iof[2], ier = 0; doublereal mat[36] /* was [6][6] */; - integer cot; + integer cot = 0; doublereal abid[72] /* was [12][6] */; /* *********************************************************************** */ @@ -5420,12 +5420,12 @@ int mmherm1_(doublereal *debfin, integer *iercod) { /* System generated locals */ - integer hermit_dim1, hermit_dim2, hermit_offset; + integer hermit_dim1 = 0, hermit_dim2 = 0, hermit_offset = 0; /* Local variables */ - integer nbval; - doublereal d1; - integer cot; + integer nbval = 0; + doublereal d1 = NAN; + integer cot = 0; /* *********************************************************************** */ @@ -5642,22 +5642,22 @@ int AdvApp2Var_MathBase::mmhjcan_(integer *ndimen, integer c__2 = 2; integer c__21 = 21; /* System generated locals */ - integer tcbold_dim1, tcbold_dim2, tcbold_offset, tcbnew_dim1, tcbnew_dim2, - tcbnew_offset, i__1, i__2, i__3, i__4, i__5; + integer tcbold_dim1 = 0, tcbold_dim2 = 0, tcbold_offset = 0, tcbnew_dim1 = 0, tcbnew_dim2 = 0, + tcbnew_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0, i__5 = 0; /* Local variables */ - logical ldbg; - integer ndeg; + logical ldbg = 0; + integer ndeg = 0; doublereal taux1[21]; - integer d__, e, i__, k; - doublereal mfact; - integer ncoeff; + integer d__ = 0, e = 0, i__ = 0, k = 0; + doublereal mfact = NAN; + integer ncoeff = 0; doublereal tjacap[21]; integer iordre[2]; - doublereal hermit[36]/* was [6][3][2] */, ctenor, bornes[2]; - integer ier; - integer aux1, aux2; + doublereal hermit[36]/* was [6][3][2] */, ctenor = NAN, bornes[2]; + integer ier = 0; + integer aux1 = 0, aux2 = 0; /* *********************************************************************** */ @@ -5882,13 +5882,13 @@ L9999: integer *iercod) { /* System generated locals */ - integer tabtri_dim1, tabtri_offset, i__1, i__2; + integer tabtri_dim1 = 0, tabtri_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - logical idbg; - integer icol, ilgn, nlgn, noct, inser; + logical idbg = 0; + integer icol = 0, ilgn = 0, nlgn = 0, noct = 0, inser = 0; doublereal epsega = 0.; - integer ibb; + integer ibb = 0; /* *********************************************************************** */ @@ -6083,11 +6083,11 @@ L9999: doublereal *polcan) { /* System generated locals */ - integer poljac_dim1, i__1, i__2; + integer poljac_dim1 = 0, i__1 = 0, i__2 = 0; /* Local variables */ - integer iptt, i__, j, ibb; - doublereal bid; + integer iptt = 0, i__ = 0, j = 0, ibb = 0; + doublereal bid = NAN; /* *********************************************************************** */ @@ -6233,11 +6233,11 @@ L9999: static char nomprg[8+1] = "MMJACCV "; /* System generated locals */ - integer crvlgd_dim1, crvlgd_offset, crvcan_dim1, crvcan_offset, - polaux_dim1, i__1, i__2; + integer crvlgd_dim1 = 0, crvlgd_offset = 0, crvcan_dim1 = 0, crvcan_offset = 0, + polaux_dim1 = 0, i__1 = 0, i__2 = 0; /* Local variables */ - integer ndeg, i__, nd, ii, ibb; + integer ndeg = 0, i__ = 0, nd = 0, ii = 0, ibb = 0; /* *********************************************************************** */ @@ -6344,16 +6344,16 @@ int mmloncv_(integer *ndimax, integer kgar = 0; /* System generated locals */ - integer courbe_dim1, courbe_offset, i__1, i__2; + integer courbe_dim1 = 0, courbe_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - doublereal tran; + doublereal tran = NAN; integer ngaus = 0; - doublereal c1, c2, d1, d2, - wgaus[20] = {0.}, uroot[20] = {0.}, x1, x2, dd; - integer ii, jj, kk; - doublereal som; - doublereal der1, der2; + doublereal c1 = NAN, c2 = NAN, d1 = NAN, d2 = NAN, + wgaus[20] = {0.}, uroot[20] = {0.}, x1 = NAN, x2 = NAN, dd = NAN; + integer ii = 0, jj = 0, kk = 0; + doublereal som = NAN; + doublereal der1 = NAN, der2 = NAN; @@ -6883,11 +6883,11 @@ L9999: { /* System generated locals */ - integer courbe_dim1, courbe_offset, i__1, i__2; + integer courbe_dim1 = 0, courbe_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - integer ncof2; - integer isize, nd, kcf, ncf; + integer ncof2 = 0; + integer isize = 0, nd = 0, kcf = 0, ncf = 0; /* *********************************************************************** @@ -7012,11 +7012,11 @@ L9999: { /* System generated locals */ - integer courbe_dim1, courbe_offset, i__1; + integer courbe_dim1 = 0, courbe_offset = 0, i__1 = 0; /* Local variables */ - integer i__, nd; - doublereal fu; + integer i__ = 0, nd = 0; + doublereal fu = NAN; /* *********************************************************************** @@ -7098,12 +7098,12 @@ int mmpojac_(doublereal *tparam, integer c__2 = 2; /* System generated locals */ - integer valjac_dim1, i__1, i__2; + integer valjac_dim1 = 0, i__1 = 0, i__2 = 0; /* Local variables */ - doublereal cofa, cofb, denom, tnorm[100]; - integer ii, jj, kk1, kk2; - doublereal aux1, aux2; + doublereal cofa = NAN, cofb = NAN, denom = NAN, tnorm[100]; + integer ii = 0, jj = 0, kk1 = 0, kk2 = 0; + doublereal aux1 = NAN, aux2 = NAN; /* *********************************************************************** @@ -7319,12 +7319,12 @@ L9999: { /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; - integer imin, jmin, i__, j, k; - logical trouve; + logical ldbg = 0; + integer imin = 0, jmin = 0, i__ = 0, j = 0, k = 0; + logical trouve = 0; /* *********************************************************************** */ @@ -7486,20 +7486,20 @@ L9999: integer c__100 = 100; /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; + logical ldbg = 0; doublereal* mcho = 0; - integer jmin, jmax, i__, j, k, l; - intptr_t iofv1, iofv2, iofv3, iofv4; + integer jmin = 0, jmax = 0, i__ = 0, j = 0, k = 0, l = 0; + intptr_t iofv1 = 0, iofv2 = 0, iofv3 = 0, iofv4 = 0; doublereal *v1 = 0, *v2 = 0, *v3 = 0, *v4 = 0; - integer deblig, dimhch; + integer deblig = 0, dimhch = 0; doublereal* hchole = 0; - intptr_t iofmch, iofmam, iofhch; + intptr_t iofmch = 0, iofmam = 0, iofhch = 0; doublereal* matsym = 0; - integer ier; - integer aux; + integer ier = 0; + integer aux = 0; @@ -7848,13 +7848,13 @@ int mmrslss_(integer *,//mxcoef, integer *iercod) { /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; - integer i__, j; - doublereal somme; - integer pointe, ptcour; + logical ldbg = 0; + integer i__ = 0, j = 0; + doublereal somme = NAN; + integer pointe = 0, ptcour = 0; /* *********************************************************************** */ @@ -8004,15 +8004,15 @@ int mmrslw_(integer *normax, integer *iercod) { /* System generated locals */ - integer abmatr_dim1, abmatr_offset, xmatri_dim1, xmatri_offset, i__1, - i__2, i__3; - doublereal d__1; + integer abmatr_dim1 = 0, abmatr_offset = 0, xmatri_dim1 = 0, xmatri_offset = 0, i__1 = 0, + i__2 = 0, i__3 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer kpiv; - doublereal pivot; - integer ii, jj, kk; - doublereal akj; + integer kpiv = 0; + doublereal pivot = NAN; + integer ii = 0, jj = 0, kk = 0; + doublereal akj = NAN; /* ********************************************************************** @@ -8228,12 +8228,12 @@ L9999: { /* System generated locals */ - integer amat_dim1, amat_offset, bmat_dim1, bmat_offset, xmat_dim1, - xmat_offset, aaux_dim1, aaux_offset, i__1, i__2; + integer amat_dim1 = 0, amat_offset = 0, bmat_dim1 = 0, bmat_offset = 0, xmat_dim1 = 0, + xmat_offset = 0, aaux_dim1 = 0, aaux_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - integer i__, j; - integer ibb; + integer i__ = 0, j = 0; + integer ibb = 0; /* IMPLICIT DOUBLE PRECISION (A-H,O-Z) */ /* IMPLICIT INTEGER (I-N) */ @@ -8369,7 +8369,7 @@ L9999: doublereal *rtlegd) { - integer ideb, nmod2, nsur2, ilong, ibb; + integer ideb = 0, nmod2 = 0, nsur2 = 0, ilong = 0, ibb = 0; /* ********************************************************************** @@ -8497,10 +8497,10 @@ L9999: integer *iercod) { /* System generated locals */ - doublereal d__1; + doublereal d__1 = NAN; /* Local variables */ - integer ideb, ifin, imil, ibb; + integer ideb = 0, ifin = 0, imil = 0, ibb = 0; /* *********************************************************************** */ @@ -8650,13 +8650,13 @@ int mmtmave_(integer *nligne, { /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - logical ldbg; - integer imin, imax, i__, j, k; - doublereal somme; - integer aux; + logical ldbg = 0; + integer imin = 0, imax = 0, i__ = 0, j = 0, k = 0; + doublereal somme = NAN; + integer aux = 0; /* *********************************************************************** @@ -8800,13 +8800,13 @@ int mmtrpj0_(integer *ncofmx, { /* System generated locals */ - integer crvlgd_dim1, crvlgd_offset, i__1, i__2; - doublereal d__1; + integer crvlgd_dim1 = 0, crvlgd_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer ncut, i__; - doublereal bidon, error; - integer nd; + integer ncut = 0, i__ = 0; + doublereal bidon = NAN, error = NAN; + integer nd = 0; /* *********************************************************************** @@ -8980,14 +8980,14 @@ int mmtrpj2_(integer *ncofmx, 3.72184531357268220291630708234186 }; /* System generated locals */ - integer crvlgd_dim1, crvlgd_offset, i__1, i__2; - doublereal d__1; + integer crvlgd_dim1 = 0, crvlgd_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer ncut, i__; - doublereal bidon, error; - integer ia, nd; - doublereal bid, eps1; + integer ncut = 0, i__ = 0; + doublereal bidon = NAN, error = NAN; + integer ia = 0, nd = 0; + doublereal bid = NAN, eps1 = NAN; /* *********************************************************************** @@ -9184,14 +9184,14 @@ int mmtrpj4_(integer *ncofmx, 3.05886060707437081434964933864149 }; /* System generated locals */ - integer crvlgd_dim1, crvlgd_offset, i__1, i__2; - doublereal d__1; + integer crvlgd_dim1 = 0, crvlgd_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer ncut, i__; - doublereal bidon, error; - integer ia, nd; - doublereal bid, eps1; + integer ncut = 0, i__ = 0; + doublereal bidon = NAN, error = NAN; + integer ia = 0, nd = 0; + doublereal bid = NAN, eps1 = NAN; @@ -9388,14 +9388,14 @@ int mmtrpj6_(integer *ncofmx, 2.71238965987606292679677228666411 }; /* System generated locals */ - integer crvlgd_dim1, crvlgd_offset, i__1, i__2; - doublereal d__1; + integer crvlgd_dim1 = 0, crvlgd_offset = 0, i__1 = 0, i__2 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer ncut, i__; - doublereal bidon, error; - integer ia, nd; - doublereal bid, eps1; + integer ncut = 0, i__ = 0; + doublereal bidon = NAN, error = NAN; + integer ia = 0, nd = 0; + doublereal bid = NAN, eps1 = NAN; @@ -9535,10 +9535,10 @@ L9999: integer *ncfnew) { /* System generated locals */ - integer crvlgd_dim1, crvlgd_offset; + integer crvlgd_dim1 = 0, crvlgd_offset = 0; /* Local variables */ - integer ia; + integer ia = 0; /* *********************************************************************** @@ -9623,15 +9623,15 @@ L9999: doublereal c_b2 = 10.; /* System generated locals */ - integer i__1; - doublereal d__1; + integer i__1 = 0; + doublereal d__1 = NAN; /* Local variables */ - integer nchif, iunit = 1, izero; - doublereal vnorm; - integer ii; - doublereal bid; - doublereal eps0; + integer nchif = 0, iunit = 1, izero = 0; + doublereal vnorm = NAN; + integer ii = 0; + doublereal bid = NAN; + doublereal eps0 = NAN; @@ -9763,7 +9763,7 @@ L9999: static char nomprg[8+1] = "MMEPS1 "; - integer ibb; + integer ibb = 0; @@ -9868,15 +9868,15 @@ L9999: { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - logical ldbg; - integer d__; + logical ldbg = 0; + integer d__ = 0; doublereal vaux1[3], vaux2[3]; - logical colin; - doublereal valaux; - integer aux; + logical colin = 0; + doublereal valaux = NAN; + integer aux = 0; /* *********************************************************************** */ @@ -10155,8 +10155,8 @@ void AdvApp2Var_MathBase::mmwprcs_(doublereal *epsil1, doublereal AdvApp2Var_MathBase::pow__di (doublereal *x, integer *n) { - doublereal result ; - integer absolute ; + doublereal result = NAN ; + integer absolute = 0 ; result = 1.0e0 ; if ( *n > 0 ) {absolute = *n;} else {absolute = -*n;} @@ -10212,8 +10212,8 @@ integer pow__ii(integer *x, integer *n) { - integer result ; - integer absolute ; + integer result = 0 ; + integer absolute = 0 ; result = 1 ; if ( *n > 0 ) {absolute = *n;} else {absolute = -*n;} @@ -10273,12 +10273,12 @@ integer pow__ii(integer *x, { /* System generated locals */ - integer i__1; - doublereal ret_val; + integer i__1 = 0; + doublereal ret_val = NAN; /* Local variables */ - integer i__; - doublereal x; + integer i__ = 0; + doublereal x = NAN; @@ -10348,12 +10348,12 @@ int mvcvin2_(integer *ncoeff, { /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - integer m1jm1, ncfm1, j, k; - doublereal bid; - doublereal cij1, cij2; + integer m1jm1 = 0, ncfm1 = 0, j = 0, k = 0; + doublereal bid = NAN; + doublereal cij1 = NAN, cij2 = NAN; @@ -10498,13 +10498,13 @@ int mvcvinv_(integer *ncoeff, { /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - integer m1jm1, ncfm1, j, k; - doublereal bid; + integer m1jm1 = 0, ncfm1 = 0, j = 0, k = 0; + doublereal bid = NAN; //extern /* Subroutine */ int maermsg_(); - doublereal cij1, cij2, cij3; + doublereal cij1 = NAN, cij2 = NAN, cij3 = NAN; /* ********************************************************************** @@ -10782,11 +10782,11 @@ int mvpscr2_(integer *ncoeff, doublereal *pntcrb) { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer ndeg, kk; - doublereal xxx, yyy; + integer ndeg = 0, kk = 0; + doublereal xxx = NAN, yyy = NAN; @@ -10910,11 +10910,11 @@ int mvpscr3_(integer *ncoeff, { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer ndeg, kk; - doublereal xxx, yyy, zzz; + integer ndeg = 0, kk = 0; + doublereal xxx = NAN, yyy = NAN, zzz = NAN; @@ -11049,12 +11049,12 @@ L9999: { /* System generated locals */ - integer dtab_dim1, dtab_offset, i__1, i__2; + integer dtab_dim1 = 0, dtab_offset = 0, i__1 = 0, i__2 = 0; /* Local variables */ - integer incr; - doublereal dsave; - integer i3, i4, i5, incrp1; + integer incr = 0; + doublereal dsave = NAN; + integer i3 = 0, i4 = 0, i5 = 0, incrp1 = 0; /************************************************************************ @@ -11179,12 +11179,12 @@ L9900: { /* System generated locals */ - integer i__1; - doublereal ret_val, d__1, d__2; + integer i__1 = 0; + doublereal ret_val = NAN, d__1 = NAN, d__2 = NAN; /* Local variables */ - doublereal xsom; - integer i__, irmax; + doublereal xsom = NAN; + integer i__ = 0, irmax = 0; diff --git a/src/AdvApp2Var/AdvApp2Var_Network.cxx b/src/AdvApp2Var/AdvApp2Var_Network.cxx index a2476c50c5..37e55bea08 100644 --- a/src/AdvApp2Var/AdvApp2Var_Network.cxx +++ b/src/AdvApp2Var/AdvApp2Var_Network.cxx @@ -39,11 +39,11 @@ AdvApp2Var_Network::AdvApp2Var_Network() AdvApp2Var_Network::AdvApp2Var_Network(const AdvApp2Var_SequenceOfPatch& Net, const TColStd_SequenceOfReal& TheU, - const TColStd_SequenceOfReal& TheV) + const TColStd_SequenceOfReal& TheV) : myNet(Net), myUParameters(TheU), myVParameters(TheV) { - myNet=Net; - myUParameters=TheU; - myVParameters=TheV; + + + } //========================================================================================== @@ -75,7 +75,7 @@ void AdvApp2Var_Network::UpdateInU(const Standard_Real CuttingValue) { // insertion du nouveau parametre de decoupe - Standard_Integer i=1,j; + Standard_Integer i=1,j = 0; while (myUParameters.Value(i) + #include #include #include @@ -109,21 +111,21 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions, { // data stored in the Context - Standard_Integer NDIMEN, ISOFAV; + Standard_Integer NDIMEN = 0, ISOFAV = 0; NDIMEN = Conditions.TotalDimension(); // Attention : works only for 3D ISOFAV = Conditions.FavorIso(); // data related to the patch to be discretized - Standard_Integer NBPNTU, NBPNTV; + Standard_Integer NBPNTU = 0, NBPNTV = 0; Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV; Handle (TColStd_HArray1OfReal) HUROOT = Conditions.URoots(); Handle (TColStd_HArray1OfReal) HVROOT = Conditions.VRoots(); - Standard_Real * UROOT; + Standard_Real * UROOT = nullptr; UROOT = (Standard_Real *) &HUROOT ->ChangeArray1()(HUROOT ->Lower()); NBPNTU = (Conditions.URoots())->Length(); if (myOrdInU>-1) NBPNTU -= 2; - Standard_Real * VROOT; + Standard_Real * VROOT = nullptr; VROOT = (Standard_Real *) &HVROOT ->ChangeArray1()(HVROOT ->Lower()); NBPNTV = (Conditions.VRoots())->Length(); if (myOrdInV>-1) NBPNTV -= 2; @@ -135,8 +137,8 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions, new TColStd_HArray1OfReal(1,SIZE*4); HCOINS->Init(0.); - Standard_Integer iu,iv; - Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho,valnorm; + Standard_Integer iu = 0,iv = 0; + Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho = NAN,valnorm = NAN; for (iu=0;iu<=myOrdInU;iu++) { for (iv=0;iv<=myOrdInV;iv++) { @@ -209,7 +211,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions, ( (Constraints.IsoU(myU1,myV0,myV1)).DifTab() ) ->Array1(); // normalization - Standard_Integer ideb1,ideb2,ideb3,ideb4,jj; + Standard_Integer ideb1 = 0,ideb2 = 0,ideb3 = 0,ideb4 = 0,jj = 0; for (iu=1;iu<=IORDRU;iu++) { rho = pow(du,iu); ideb1 = HSU0->Lower() + iu*SIZE -1; @@ -402,8 +404,8 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions, const AdvApp2Var_Framework& Constraints) { // data stored in the Context - Standard_Integer NDIMEN; - Standard_Integer IERCOD, NCFLMU, NCFLMV, NDegU, NDegV; + Standard_Integer NDIMEN = 0; + Standard_Integer IERCOD = 0, NCFLMU = 0, NCFLMV = 0, NDegU = 0, NDegV = 0; NDIMEN = Conditions.TotalDimension(); // Attention : works only for 3D NCFLMU = Conditions.ULimit(); @@ -443,9 +445,9 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions, HCFU1->Init( (Constraints.IsoU(myU1,myV0,myV1)).NbCoeff() ); // normalization of Isos U - Standard_Integer iu,iv; - Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho,valnorm; - Standard_Integer ideb0,ideb1,jj; + Standard_Integer iu = 0,iv = 0; + Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho = NAN,valnorm = NAN; + Standard_Integer ideb0 = 0,ideb1 = 0,jj = 0; for (iu=1;iu<=IORDRU;iu++) { rho = pow(du,iu); @@ -532,7 +534,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions, } // add constraints at the corners - Standard_Integer ideb; + Standard_Integer ideb = 0; SIZE=NDIMEN*(IORDRU+2)*(IORDRV+2); Handle (TColStd_HArray1OfReal) HCOINS = new TColStd_HArray1OfReal(1,SIZE*4); @@ -590,8 +592,8 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions, Standard_Real *FACT = (Standard_Real *) &HFACT ->ChangeArray1()(HFACT ->Lower()); - Standard_Integer idim,ncf0,ncf1,iun=1; - Standard_Real *Is; + Standard_Integer idim = 0,ncf0 = 0,ncf1 = 0,iun=1; + Standard_Real *Is = nullptr; // add extremities of isos U for (iu=1;iu<=IORDRU+1;iu++) { @@ -656,10 +658,10 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions, void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints) { - Standard_Integer NBSESP = 1, iesp; - Standard_Integer iu,iv; + Standard_Integer NBSESP = 1, iesp = 0; + Standard_Integer iu = 0,iv = 0; - Standard_Real errU,errV,error,hmax[4]; + Standard_Real errU = NAN,errV = NAN,error = NAN,hmax[4]; hmax[0] = 0; hmax[1] = 1; hmax[2] = 1.5; @@ -718,7 +720,7 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints) ((Constraints.IsoU(myU1,myV0,myV1)).MaxErrors())->Value(iesp,1)); // calculate max errors at the corners - Standard_Real emax1=0.,emax2=0.,emax3=0.,emax4=0.,err1,err2,err3,err4; + Standard_Real emax1=0.,emax2=0.,emax3=0.,emax4=0.,err1 = NAN,err2 = NAN,err3 = NAN,err4 = NAN; for (iu=0;iu<=myOrdInU;iu++) { for (iv=0;iv<=myOrdInV;iv++) { error = (Constraints.Node(myU0,myV0))->Error(iu,iv); @@ -766,9 +768,9 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions, { // data stored in the Context - Standard_Integer NDIMEN, NBSESP, NDIMSE; - Standard_Integer NBPNTU, NBPNTV, NCFLMU, NCFLMV, NDJACU, NDJACV; - Standard_Integer NDegU, NDegV, NJacU, NJacV; + Standard_Integer NDIMEN = 0, NBSESP = 0, NDIMSE = 0; + Standard_Integer NBPNTU = 0, NBPNTV = 0, NCFLMU = 0, NCFLMV = 0, NDJACU = 0, NDJACV = 0; + Standard_Integer NDegU = 0, NDegV = 0, NJacU = 0, NJacV = 0; NDIMEN = Conditions.TotalDimension(); NBSESP = Conditions.TotalNumberSSP(); NDIMSE = 3; @@ -787,7 +789,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions, // data relative to the processed patch Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV, - NDMINU = 1, NDMINV = 1, NCOEFU, NCOEFV; + NDMINU = 1, NDMINV = 1, NCOEFU = 0, NCOEFV = 0; // NDMINU and NDMINV depend on the nb of coeff of neighboring isos // and of the required order of continuity NDMINU = Max(1,2*IORDRU+1); @@ -807,7 +809,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions, new TColStd_HArray1OfReal(1,NBSESP); Handle (TColStd_HArray1OfReal) HEPSFRO = new TColStd_HArray1OfReal(1,NBSESP*8); - Standard_Integer iesp; + Standard_Integer iesp = 0; for (iesp=1;iesp<=NBSESP;iesp++) { HEPSAPR->SetValue(iesp,(Conditions.IToler())->Value(iesp)); HEPSFRO->SetValue(iesp,(Conditions.FToler())->Value(iesp,1)); @@ -937,7 +939,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions, &myNbCoeffInV); // transposition (NCFLMU,NCFLMV,NDIMEN)Fortran-C++ - Standard_Integer aIU, aIN, dim, ii, jj; + Standard_Integer aIU = 0, aIN = 0, dim = 0, ii = 0, jj = 0; for (dim=1; dim<=NDIMEN; dim++){ aIN = (dim-1)*NCFLMU*NCFLMV; for (ii=1; ii<=NCFLMU; ii++) { diff --git a/src/AdvApp2Var/AdvApp2Var_SysBase.cxx b/src/AdvApp2Var/AdvApp2Var_SysBase.cxx index 7f32dcb631..12480b48d6 100644 --- a/src/AdvApp2Var/AdvApp2Var_SysBase.cxx +++ b/src/AdvApp2Var/AdvApp2Var_SysBase.cxx @@ -14,6 +14,7 @@ // AdvApp2Var_SysBase.cxx #include #include +#include #include #include #include @@ -273,7 +274,7 @@ int AdvApp2Var_SysBase::macrai4_(integer *nbelem, /* *********************************************************************** */ - integer iunit; + integer iunit = 0; iunit = sizeof(integer); @@ -372,10 +373,10 @@ int macrbrk_() int AdvApp2Var_SysBase::macrchk_() { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer i__, j; + integer i__ = 0, j = 0; /* *********************************************************************** */ @@ -557,7 +558,7 @@ int AdvApp2Var_SysBase::macrdi4_(integer *nbelem, /* > */ /* *********************************************************************** */ - integer iunit; + integer iunit = 0; iunit = sizeof(integer); /* Function Body */ @@ -713,7 +714,7 @@ int macrgfl_(intptr_t *iadfld, integer ifois = 1; char cbid[1] = {}; - integer ibid, ienr; + integer ibid = 0, ienr = 0; integer novfl = 0; /* *********************************************************************** @@ -849,7 +850,7 @@ int macrmsg_(const char *,//crout, { /* Local variables */ - integer inum; + integer inum = 0; char /*cfm[80],*/ cln[3]; /* *********************************************************************** @@ -1152,7 +1153,7 @@ int magtlog_(const char *cnmlog, /* Local variables */ char cbid[255]; - integer ibid, ier; + integer ibid = 0, ier = 0; /* ********************************************************************** @@ -1307,12 +1308,12 @@ int AdvApp2Var_SysBase::maitbr8_(integer *itaill, }; /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer i__; + integer i__ = 0; doublereal buffx[63]; - integer nbfois, noffst, nreste, nufois; + integer nbfois = 0, noffst = 0, nreste = 0, nufois = 0; /* *********************************************************************** */ @@ -1552,7 +1553,7 @@ int maostrb_() //======================================================================= int maostrd_() { - integer imod; + integer imod = 0; /* *********************************************************************** */ @@ -1615,12 +1616,12 @@ int maoverf_(integer *nbentr, integer ifois = 0; /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Local variables */ - integer ibid; + integer ibid = 0; doublereal buff[63]; - integer ioct, indic, nrest, icompt; + integer ioct = 0, indic = 0, nrest = 0, icompt = 0; /* *********************************************************************** */ @@ -1789,7 +1790,7 @@ int maoverf_(integer *nbentr, /* Loop. The upper limit is the integer value of the logarithm of base 2 */ /* of NBENTR/NLONGR. */ - i__1 = (integer) (log((real) (*nbentr) / (float)63.) / log((float)2.)) + i__1 = (integer) (std::log((real) (*nbentr) / (float)63.) / std::log((float)2.)) ; for (ibid = 1; ibid <= i__1; ++ibid) { @@ -1943,14 +1944,14 @@ int mcrcomm_(integer *kop, integer ntab = 0; /* System generated locals */ - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - intptr_t ideb; + intptr_t ideb = 0; doublereal dtab[32000]; intptr_t itab[160] /* was [4][40] */; - intptr_t ipre; - integer i__, j, k; + intptr_t ipre = 0; + integer i__ = 0, j = 0, k = 0; /************************************************************************ @@ -2118,12 +2119,12 @@ int AdvApp2Var_SysBase::mcrdelt_(integer *iunit, integer *iercod) { - integer ibid; - doublereal xbid; - integer noct, iver, ksys, i__, n, nrang, - ibyte, ier; - intptr_t iadfd, iadff, iaddr, loc; /* Les adrresses en long*/ - integer kop; + integer ibid = 0; + doublereal xbid = NAN; + integer noct = 0, iver = 0, ksys = 0, i__ = 0, n = 0, nrang = 0, + ibyte = 0, ier = 0; + intptr_t iadfd = 0, iadff = 0, iaddr = 0, loc = 0; /* Les adrresses en long*/ + integer kop = 0; /* *********************************************************************** */ @@ -2516,14 +2517,14 @@ int AdvApp2Var_SysBase::mcrlist_(integer *ier) const { /* System generated locals */ - integer i__1; + integer i__1 = 0; /* Builtin functions */ /* Local variables */ char cfmt[1]; - doublereal dfmt; - integer ifmt, i__, nufmt, ntotal; + doublereal dfmt = NAN; + integer ifmt = 0, i__ = 0, nufmt = 0, ntotal = 0; char subrou[7]; @@ -2664,15 +2665,15 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit, { - integer i__1, i__2; + integer i__1 = 0, i__2 = 0; /* Local variables */ - doublereal dfmt; - integer ifmt, iver; + doublereal dfmt = NAN; + integer ifmt = 0, iver = 0; char subr[7]; - integer ksys , ibyte, irest, ier; - intptr_t iadfd, iadff, iaddr,lofset, loc; - integer izu; + integer ksys = 0 , ibyte = 0, irest = 0, ier = 0; + intptr_t iadfd = 0, iadff = 0, iaddr = 0,lofset = 0, loc = 0; + integer izu = 0; /* ********************************************************************** @@ -3064,7 +3065,7 @@ void AdvApp2Var_SysBase::miraz_(integer *taille, //======================================================================= integer AdvApp2Var_SysBase::mnfndeb_() { - integer ret_val; + integer ret_val = 0; ret_val = 0; return ret_val; } /* mnfndeb_ */ @@ -3077,7 +3078,7 @@ int AdvApp2Var_SysBase::msifill_(integer *nbintg, integer *ivecin, integer *ivecou) { - integer nocte; + integer nocte = 0; /* *********************************************************************** */ @@ -3132,7 +3133,7 @@ int AdvApp2Var_SysBase::msrfill_(integer *nbreel, doublereal *vecent, doublereal * vecsor) { - integer nocte; + integer nocte = 0; /* *********************************************************************** @@ -3309,7 +3310,7 @@ void AdvApp2Var_SysBase::mvriraz_(integer *taille, void *adt) { - integer offset; + integer offset = 0; offset = *taille * 8 ; /* printf(" adt %d long %d\n",adt,offset); */ memset(adt , '\0' , offset) ; diff --git a/src/AdvApp2Var/AdvApp2Var_SysBase.hxx b/src/AdvApp2Var/AdvApp2Var_SysBase.hxx index 8cf12ccfba..bed9087bd4 100644 --- a/src/AdvApp2Var/AdvApp2Var_SysBase.hxx +++ b/src/AdvApp2Var/AdvApp2Var_SysBase.hxx @@ -140,7 +140,7 @@ private: mitem icore[MAX_ALLOC_NB]; integer ncore; unsigned char lprot; - } mcrgene_; + } mcrgene_{}; /* Contains statistics on allocation requests. Index 0 corresponds to static_allocation, 1 - to heap allocation. @@ -151,7 +151,7 @@ private: */ struct { integer nrqst[2], ndelt[2], nbyte[2], mbyte[2]; - } mcrstac_; + } mcrstac_{}; }; #endif diff --git a/src/AdvApprox/AdvApprox_ApproxAFunction.cxx b/src/AdvApprox/AdvApprox_ApproxAFunction.cxx index 388ddf909d..7766c4f260 100644 --- a/src/AdvApprox/AdvApprox_ApproxAFunction.cxx +++ b/src/AdvApprox/AdvApprox_ApproxAFunction.cxx @@ -21,6 +21,8 @@ // facilement approchable ont de petites erreurs. // Modified PMN 15/04/1997 : Gestion fine de la continuite aux lieux de decoupes +#include + #include #include #include @@ -138,13 +140,13 @@ static void PrepareConvert(const Standard_Integer NumCurves, { // Declaration - Standard_Boolean isCi; - Standard_Integer icurve, idim, iordre, ii, + Standard_Boolean isCi = 0; + Standard_Integer icurve = 0, idim = 0, iordre = 0, ii = 0, Dimension=Num1DSS + 2*Num2DSS + 3*Num3DSS, NbSpace = Num1DSS + Num2DSS + Num3DSS; - Standard_Real diff, moy, facteur1, facteur2, normal1, normal2, eps; - Standard_Real *Res1, *Res2, *Val1, *Val2; - Standard_Real *Coef1, *Coef2; + Standard_Real diff = NAN, moy = NAN, facteur1 = NAN, facteur2 = NAN, normal1 = NAN, normal2 = NAN, eps = NAN; + Standard_Real *Res1 = nullptr, *Res2 = nullptr, *Val1 = nullptr, *Val2 = nullptr; + Standard_Real *Coef1 = nullptr, *Coef2 = nullptr; Standard_Integer RealDegree = Max(MaxDegree + 1, 2 * ContinuityOrder + 2); gp_Vec V1,V2; @@ -194,7 +196,7 @@ static void PrepareConvert(const Standard_Integer NumCurves, Standard_Real f2_dividend = PolynomialIntervals(icurve+1,2)-PolynomialIntervals(icurve+1,1); Standard_Real f1_divizor = TrueIntervals(icurve+1)-TrueIntervals(icurve); Standard_Real f2_divizor = TrueIntervals(icurve+2)-TrueIntervals(icurve+1); - Standard_Real fract1, fract2; + Standard_Real fract1 = NAN, fract2 = NAN; if( Abs(f1_divizor) < Toler ) // this is to avoid divizion by zero //in this case fract1 = 5.14755758946803e-85 @@ -419,7 +421,7 @@ void AdvApprox_ApproxAFunction::Approximation( Standard_Integer& ErrorCode) { // Standard_Real EpsPar = Precision::Confusion(); - Standard_Integer IDIM, NUPIL,TheDeg; + Standard_Integer IDIM = 0, NUPIL = 0,TheDeg = 0; #ifdef OCCT_DEBUG Standard_Integer NDIMEN = TotalDimension; #endif @@ -465,7 +467,7 @@ void AdvApprox_ApproxAFunction::Approximation( //--> NDJAC est le degre de "travail" dans la base orthogonale. - Standard_Integer NbGaussPoints, WorkDegree; + Standard_Integer NbGaussPoints = 0, WorkDegree = 0; PLib::JacobiParameters(Continuity, NumMaxCoeffs-1, code_precis, NbGaussPoints, WorkDegree); @@ -483,8 +485,8 @@ void AdvApprox_ApproxAFunction::Approximation( //C********************************************************************** Handle(PLib_JacobiPolynomial) JacobiBase = new (PLib_JacobiPolynomial) (WorkDegree, Continuity); //Portage HP le compilateur refuse le debranchement - Standard_Integer IS ; - Standard_Boolean goto_fin_de_boucle; + Standard_Integer IS = 0 ; + Standard_Boolean goto_fin_de_boucle = 0; Standard_Integer MaxDegree = NumMaxCoeffs-1; AdvApprox_SimpleApprox Approx (TotalDimension, TotalNumSS, Continuity, @@ -531,8 +533,8 @@ void AdvApprox_ApproxAFunction::Approximation( else { //-> ...sinon on essai de decouper l' intervalle courant en 2... - Standard_Real TMIL; - Standard_Boolean Large; + Standard_Real TMIL = NAN; + Standard_Boolean Large = 0; Large = CutTool.Value(TABINT[NumCurves], TABINT[NumCurves+1], TMIL); @@ -581,7 +583,7 @@ void AdvApprox_ApproxAFunction::Approximation( TColStd_Array1OfReal Coefficients(0,(TheDeg+1)*TotalDimension-1); JacobiBase->ToCoefficients (TotalDimension, TheDeg, HJacCoeff->Array1(), Coefficients); - Standard_Integer i,j, f = (TheDeg+1)*TotalDimension; + Standard_Integer i = 0,j = 0, f = (TheDeg+1)*TotalDimension; for (i=0,j=(NumCurves-1)*TotalDimension*NumMaxCoeffs+1; iValue(ii,Index)) ; } @@ -987,7 +989,7 @@ Standard_Integer AdvApprox_ApproxAFunction::NbPoles() const void AdvApprox_ApproxAFunction::Poles2d(const Standard_Integer Index, TColgp_Array1OfPnt2d& P) const { - Standard_Integer ii ; + Standard_Integer ii = 0 ; for (ii = P.Lower() ; ii <= P.Upper() ; ii++) { P.SetValue(ii,my2DPoles->Value(ii,Index)) ; } @@ -1000,7 +1002,7 @@ void AdvApprox_ApproxAFunction::Poles2d(const Standard_Integer Index, void AdvApprox_ApproxAFunction::Poles1d(const Standard_Integer Index, TColStd_Array1OfReal& P) const { - Standard_Integer ii ; + Standard_Integer ii = 0 ; for (ii = P.Lower() ; ii <= P.Upper() ; ii++) { P.SetValue(ii,my1DPoles->Value(ii,Index)) ; } @@ -1089,7 +1091,7 @@ Standard_Real AdvApprox_ApproxAFunction::AverageError( void AdvApprox_ApproxAFunction::Dump(Standard_OStream& o) const { - Standard_Integer ii; + Standard_Integer ii = 0; o << "Dump of ApproxAFunction" << std::endl; if (myNumSubSpaces[0] > 0) { o << "Error(s) 1d = " << std::endl; diff --git a/src/AdvApprox/AdvApprox_ApproxAFunction.hxx b/src/AdvApprox/AdvApprox_ApproxAFunction.hxx index 74f58b76ca..0b9b0934bb 100644 --- a/src/AdvApprox/AdvApprox_ApproxAFunction.hxx +++ b/src/AdvApprox/AdvApprox_ApproxAFunction.hxx @@ -138,7 +138,7 @@ private: Standard_EXPORT void Perform (const Standard_Integer Num1DSS, const Standard_Integer Num2DSS, const Standard_Integer Num3DSS, const AdvApprox_Cutting& CutTool); - Standard_Integer myNumSubSpaces[3]; + Standard_Integer myNumSubSpaces[3]{}; Handle(TColStd_HArray1OfReal) my1DTolerances; Handle(TColStd_HArray1OfReal) my2DTolerances; Handle(TColStd_HArray1OfReal) my3DTolerances; @@ -154,7 +154,7 @@ private: Handle(TColgp_HArray2OfPnt) my3DPoles; Handle(TColStd_HArray1OfReal) myKnots; Handle(TColStd_HArray1OfInteger) myMults; - Standard_Integer myDegree; + Standard_Integer myDegree{}; Standard_Address myEvaluator; Handle(TColStd_HArray1OfReal) my1DMaxError; Handle(TColStd_HArray1OfReal) my1DAverageError; diff --git a/src/AdvApprox/AdvApprox_PrefAndRec.cxx b/src/AdvApprox/AdvApprox_PrefAndRec.cxx index be5e8ba9c2..6403580b1b 100644 --- a/src/AdvApprox/AdvApprox_PrefAndRec.cxx +++ b/src/AdvApprox/AdvApprox_PrefAndRec.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -22,12 +24,10 @@ AdvApprox_PrefAndRec::AdvApprox_PrefAndRec(const TColStd_Array1OfReal& RecCut, const TColStd_Array1OfReal& PrefCut, const Standard_Real Weight): - myRecCutting(1, RecCut.Length()), - myPrefCutting(1, PrefCut.Length()), + myRecCutting(RecCut), + myPrefCutting(PrefCut), myWeight(Weight) { - myRecCutting = RecCut; - myPrefCutting = PrefCut; if (myWeight <= 1) { throw Standard_DomainError("PrefAndRec : Weight is too small");} } @@ -37,8 +37,8 @@ Standard_Boolean AdvApprox_PrefAndRec::Value(const Standard_Real a, { // longueur minimum d'un intervalle parametrique : 10*PConfusion() Standard_Real lgmin = 10 * Precision::PConfusion(); - Standard_Integer i; - Standard_Real cut, mil=(a+b)/2, dist; + Standard_Integer i = 0; + Standard_Real cut = NAN, mil=(a+b)/2, dist = NAN; Standard_Boolean isfound = Standard_False; cut = mil; diff --git a/src/AdvApprox/AdvApprox_PrefCutting.cxx b/src/AdvApprox/AdvApprox_PrefCutting.cxx index 02753ec1f7..416be30f96 100644 --- a/src/AdvApprox/AdvApprox_PrefCutting.cxx +++ b/src/AdvApprox/AdvApprox_PrefCutting.cxx @@ -15,14 +15,14 @@ // commercial license or contractual agreement. +#include + #include #include AdvApprox_PrefCutting::AdvApprox_PrefCutting(const TColStd_Array1OfReal& CutPnts): - myPntOfCutting(1, CutPnts.Length()) -{ - myPntOfCutting = CutPnts; -} + myPntOfCutting(CutPnts) +{} Standard_Boolean AdvApprox_PrefCutting::Value(const Standard_Real a, const Standard_Real b, @@ -31,8 +31,8 @@ Standard_Boolean AdvApprox_PrefCutting::Value(const Standard_Real a, // longueur minimum d'un intervalle parametrique : PConfusion() // pour F(U,V) : EPS1=1.e-9 (cf.MMEPS1) Standard_Real lgmin = 10 * Precision::PConfusion(); - Standard_Integer i; - Standard_Real cut, mil=(a+b)/2, + Standard_Integer i = 0; + Standard_Real cut = NAN, mil=(a+b)/2, dist = Abs((a-b)/2); cut = mil; for ( i=myPntOfCutting.Lower(); i<= myPntOfCutting.Upper(); i++) { diff --git a/src/AdvApprox/AdvApprox_SimpleApprox.cxx b/src/AdvApprox/AdvApprox_SimpleApprox.cxx index 6ffcec798b..ce3d3d0ea4 100644 --- a/src/AdvApprox/AdvApprox_SimpleApprox.cxx +++ b/src/AdvApprox/AdvApprox_SimpleApprox.cxx @@ -16,6 +16,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -90,7 +92,7 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi // ======= the computation of Pp(t) = Rr(t) + W(t)*Qq(t) ======= done = Standard_False; - Standard_Integer i,idim,k,numss; + Standard_Integer i = 0,idim = 0,k = 0,numss = 0; Standard_Integer Dimension = myTotalDimension; AdvApprox_EvaluatorFunction& Evaluator = @@ -106,10 +108,10 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi FirstLast[1] = Last; math_Vector Result(1,myTotalDimension); - Standard_Integer ErrorCode,derive,i_idim; + Standard_Integer ErrorCode = 0,derive = 0,i_idim = 0; Standard_Real Fact=(Last-First)/2; Standard_Real *pResult = (Standard_Real*) &Result.Value(1); - Standard_Real param; + Standard_Real param = NAN; for (param = First, derive = myNivConstr; derive >= 0 ; derive--) { @@ -148,7 +150,7 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi Standard_Real* Coef1 = (Standard_Real*) &(myCoeff->ChangeArray1().Value(0)); derive = 0; - Standard_Real ti, tip, tin, alin = (Last-First)/2, blin = (Last+First)/2.; + Standard_Real ti = NAN, tip = NAN, tin = NAN, alin = (Last-First)/2, blin = (Last+First)/2.; i_idim = myTotalDimension; for (i=1; i<=myNbGaussPoints/2; i++) { @@ -234,8 +236,8 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi // the computing of NewDegree TColStd_Array1OfReal JacCoeff(0, myTotalDimension*(myWorkDegree+1)-1); - Standard_Real MaxErr,AverageErr; - Standard_Integer Dim, RangSS, RangCoeff, RangJacCoeff, RangDim, NewDegree, NewDegreeMax = 0; + Standard_Real MaxErr = NAN,AverageErr = NAN; + Standard_Integer Dim = 0, RangSS = 0, RangCoeff = 0, RangJacCoeff = 0, RangDim = 0, NewDegree = 0, NewDegreeMax = 0; myMaxError = new TColStd_HArray1OfReal (1,myTotalNumSS); myAverageError = new TColStd_HArray1OfReal (1,myTotalNumSS); @@ -377,7 +379,7 @@ Standard_Real AdvApprox_SimpleApprox::AverageError(const Standard_Integer Index) void AdvApprox_SimpleApprox::Dump(Standard_OStream& o) const { - Standard_Integer ii; + Standard_Integer ii = 0; o << "Dump of SimpleApprox " << std::endl; for (ii=1; ii <= myTotalNumSS; ii++) { o << "Error " << MaxError(ii) << std::endl; diff --git a/src/AdvApprox/AdvApprox_SimpleApprox.hxx b/src/AdvApprox/AdvApprox_SimpleApprox.hxx index 757db18ef7..2f012334e2 100644 --- a/src/AdvApprox/AdvApprox_SimpleApprox.hxx +++ b/src/AdvApprox/AdvApprox_SimpleApprox.hxx @@ -101,7 +101,7 @@ private: Handle(TColStd_HArray1OfReal) myTabPoints; Handle(TColStd_HArray2OfReal) myTabWeights; Standard_Address myEvaluator; - Standard_Integer myDegree; + Standard_Integer myDegree{}; Handle(TColStd_HArray1OfReal) myCoeff; Handle(TColStd_HArray2OfReal) myFirstConstr; Handle(TColStd_HArray2OfReal) myLastConstr; diff --git a/src/AppCont/AppCont_ContMatrices.cxx b/src/AppCont/AppCont_ContMatrices.cxx index 54a258b826..ce0cf2456f 100644 --- a/src/AppCont/AppCont_ContMatrices.cxx +++ b/src/AppCont/AppCont_ContMatrices.cxx @@ -2070,7 +2070,7 @@ void InvMMatrix(const Standard_Integer classe, math_Matrix& InvM) { if (classe > 24) throw Standard_DimensionError("InvMMatrix: classe > 24"); - Standard_Integer i, j, k = 0, Som = 0; + Standard_Integer i = 0, j = 0, k = 0, Som = 0; for (i = 2; i < classe; i++) { Som += (i)*(i); } diff --git a/src/AppCont/AppCont_ContMatrices_1.cxx b/src/AppCont/AppCont_ContMatrices_1.cxx index 0956cea935..f559efff76 100644 --- a/src/AppCont/AppCont_ContMatrices_1.cxx +++ b/src/AppCont/AppCont_ContMatrices_1.cxx @@ -416,7 +416,7 @@ void IBPMatrix(const Standard_Integer classe, math_Matrix& IBPMa) { if (classe > 26) throw Standard_DimensionError("IBPMatrix: classe > 26"); // math_Matrix IBPMa(1, classe-2, 1, classe-2); - Standard_Integer i, j, k = 0, Som = 0; + Standard_Integer i = 0, j = 0, k = 0, Som = 0; for (i = 1; i < classe-2; i++) { Som += (i)*(i); } diff --git a/src/AppCont/AppCont_ContMatrices_2.cxx b/src/AppCont/AppCont_ContMatrices_2.cxx index 3243a8ef23..18cff5e5dc 100644 --- a/src/AppCont/AppCont_ContMatrices_2.cxx +++ b/src/AppCont/AppCont_ContMatrices_2.cxx @@ -3277,7 +3277,7 @@ void MMatrix(const Standard_Integer classe, math_Matrix& M) { if (classe > 24) throw Standard_DimensionError("MMatrix: classe > 24"); - Standard_Integer i, j, k = 0, Som = 0; + Standard_Integer i = 0, j = 0, k = 0, Som = 0; for (i = 2; i < classe; i++) { Som += (i)*(i); } diff --git a/src/AppCont/AppCont_ContMatrices_3.cxx b/src/AppCont/AppCont_ContMatrices_3.cxx index 20f4443249..1d44506e82 100644 --- a/src/AppCont/AppCont_ContMatrices_3.cxx +++ b/src/AppCont/AppCont_ContMatrices_3.cxx @@ -354,7 +354,7 @@ void IBTMatrix(const Standard_Integer classe, math_Matrix& IBTMa) { if (classe > 26) throw Standard_DimensionError("IBTMatrix: classe > 26"); // math_Matrix IBTMa(1, classe-4, 1, classe-4); - Standard_Integer i, j, k = 0, Som = 0; + Standard_Integer i = 0, j = 0, k = 0, Som = 0; for (i = 1; i < classe-4; i++) { Som += (i)*(i); } diff --git a/src/AppCont/AppCont_ContMatrices_4.cxx b/src/AppCont/AppCont_ContMatrices_4.cxx index 7cc15f2dbc..3c29bba8a1 100644 --- a/src/AppCont/AppCont_ContMatrices_4.cxx +++ b/src/AppCont/AppCont_ContMatrices_4.cxx @@ -1238,11 +1238,11 @@ void VBernstein(const Standard_Integer classe, if (nbpoints > 24) throw Standard_DimensionError("VBernstein: nbpoints > 24"); // math_Matrix VB(classe, nbpoints); - Standard_Integer i, j, k = 0, Som; + Standard_Integer i = 0, j = 0, k = 0, Som = 0; // 300 = 1+2+ ... +24 points. Som = (Standard_Integer )( 300*((classe-1)*classe/2.-1) + classe * (nbpoints-1)*nbpoints/2.); - const Standard_Real *tmpVB; + const Standard_Real *tmpVB = nullptr; tmpVB = VBMatrix + Som; for (i = 1; i <= classe; i++) { for (j = 1; j <= nbpoints; j++) { diff --git a/src/AppCont/AppCont_LeastSquare.cxx b/src/AppCont/AppCont_LeastSquare.cxx index 01acce62da..806307311b 100644 --- a/src/AppCont/AppCont_LeastSquare.cxx +++ b/src/AppCont/AppCont_LeastSquare.cxx @@ -18,6 +18,8 @@ #define No_Standard_OutOfRange #define No_Standard_RangeError #endif +#include + #include #include @@ -42,7 +44,7 @@ void AppCont_LeastSquare::FixSingleBorderPoint(const AppCont_Function& the NCollection_Array1 aTabP2d(1, Max (myNbP2d, 1)), aPrevP2d(1, Max (myNbP2d, 1)); Standard_Real aMult = ((theU - theU0) > (theU1 - theU)) ? 1.0: -1.0; Standard_Real aStartParam = theU, - aCurrParam, aPrevDist = 1.0, aCurrDist = 1.0; + aCurrParam = NAN, aPrevDist = 1.0, aCurrDist = 1.0; Standard_Real du = -(theU1 - theU0) / 2.0 * aMult; Standard_Real eps = Epsilon(1.); @@ -103,14 +105,14 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, myPoles(1, Deg + 1, 1, 3 * SSP.GetNbOf3dPoints() + 2 * SSP.GetNbOf2dPoints(), 0.0), myParam(1, myNbPoints), myVB(1, Deg+1, 1, myNbPoints), - myPerInfo(1, 3 * SSP.GetNbOf3dPoints() + 2 * SSP.GetNbOf2dPoints() ) + myPerInfo(1, 3 * SSP.GetNbOf3dPoints() + 2 * SSP.GetNbOf2dPoints() ), myDone(Standard_False), myDegre(Deg), myNbdiscret(myNbPoints) { - myDone = Standard_False; - myDegre = Deg; - Standard_Integer i, j, k, c, i2; + + + Standard_Integer i = 0, j = 0, k = 0, c = 0, i2 = 0; Standard_Integer classe = Deg + 1, cl1 = Deg; - Standard_Real U, dU, Coeff, Coeff2; - Standard_Real IBij, IBPij; + Standard_Real U = NAN, dU = NAN, Coeff = NAN, Coeff2 = NAN; + Standard_Real IBij = NAN, IBPij = NAN; Standard_Integer FirstP = 1, LastP = myNbPoints; Standard_Integer nbcol = 3 * SSP.GetNbOf3dPoints() + 2 * SSP.GetNbOf2dPoints(); @@ -119,8 +121,8 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, AppParCurves_Constraint myFirstC = FirstCons, myLastC = LastCons; SSP.GetNumberOfPoints(myNbP, myNbP2d); - Standard_Integer i2plus1, i2plus2; - myNbdiscret = myNbPoints; + Standard_Integer i2plus1 = 0, i2plus2 = 0; + NCollection_Array1 aTabP(1, Max (myNbP, 1)); NCollection_Array1 aTabP2d(1, Max (myNbP2d, 1)); NCollection_Array1 aTabV(1, Max (myNbP, 1)); @@ -133,7 +135,7 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, myPerInfo(aDimIdx).myPeriod); } - Standard_Boolean Ok; + Standard_Boolean Ok = 0; if (myFirstC == AppParCurves_TangencyPoint) { Ok = SSP.D1(U0, aTabV2d, aTabV); @@ -469,7 +471,7 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, const AppParCurves_MultiCurve& AppCont_LeastSquare::Value() { - Standard_Integer i, j, j2; + Standard_Integer i = 0, j = 0, j2 = 0; gp_Pnt Pt; gp_Pnt2d Pt2d; Standard_Integer ideb = 1, ifin = myDegre+1; @@ -504,8 +506,8 @@ void AppCont_LeastSquare::Error(Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d) const { - Standard_Integer i, j, k, c, i2, classe = myDegre + 1; - Standard_Real Coeff, err3d = 0.0, err2d = 0.0; + Standard_Integer i = 0, j = 0, k = 0, c = 0, i2 = 0, classe = myDegre + 1; + Standard_Real Coeff = NAN, err3d = 0.0, err2d = 0.0; Standard_Integer ncol = myPoints.UpperCol() - myPoints.LowerCol() + 1; math_Matrix MyPoints(1, myNbdiscret, 1, ncol); @@ -531,7 +533,7 @@ void AppCont_LeastSquare::Error(Standard_Real& F, } } - Standard_Real e1, e2, e3; + Standard_Real e1 = NAN, e2 = NAN, e3 = NAN; for (i = 1; i <= myNbdiscret; i++) { i2 = 1; diff --git a/src/AppCont/AppCont_LeastSquare.hxx b/src/AppCont/AppCont_LeastSquare.hxx index 51300f2903..b1694b8b4e 100644 --- a/src/AppCont/AppCont_LeastSquare.hxx +++ b/src/AppCont/AppCont_LeastSquare.hxx @@ -68,7 +68,7 @@ private: NCollection_Array1 myPerInfo; Standard_Boolean myDone; Standard_Integer myDegre; - Standard_Integer myNbdiscret, myNbP, myNbP2d; + Standard_Integer myNbdiscret, myNbP{}, myNbP2d{}; }; #endif diff --git a/src/AppDef/AppDef_LinearCriteria.cxx b/src/AppDef/AppDef_LinearCriteria.cxx index ae23fb5090..10fd202285 100644 --- a/src/AppDef/AppDef_LinearCriteria.cxx +++ b/src/AppDef/AppDef_LinearCriteria.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -218,7 +220,7 @@ Handle(FEmTool_HAssemblyTable) AppDef_LinearCriteria::AssemblyTable() const Handle(TColStd_HArray1OfInteger) GlobIndex, Aux; - Standard_Integer i, el = 1, dim = 1, NbGlobVar = 0, gi0; + Standard_Integer i = 0, el = 1, dim = 1, NbGlobVar = 0, gi0 = 0; // For dim = 1 // For first element (el = 1) @@ -288,7 +290,7 @@ Handle(TColStd_HArray2OfInteger) AppDef_LinearCriteria::DependenceTable() const Handle(TColStd_HArray2OfInteger) DepTab = new TColStd_HArray2OfInteger(1, Dim, 1, Dim, 0); - Standard_Integer i; + Standard_Integer i = 0; for(i=1; i <= Dim; i++) DepTab->SetValue(i,i,1); return DepTab; @@ -315,8 +317,8 @@ Standard_Integer AppDef_LinearCriteria::QualityValues(const Standard_Real J1min, TColStd_Array1OfReal& Knots = myCurve->Knots(); Handle(TColStd_HArray2OfReal) Coeff; - Standard_Integer el, deg = 0, curdeg, i; - Standard_Real UFirst, ULast; + Standard_Integer el = 0, deg = 0, curdeg = 0, i = 0; + Standard_Real UFirst = NAN, ULast = NAN; J1 = J2 = J3 = 0.; for(el = 1; el <= NbElm; el++) { @@ -451,8 +453,8 @@ void AppDef_LinearCriteria::ErrorValues(Standard_Real& MaxError, gp_Pnt2d P2d; gp_Pnt P3d; - Standard_Integer i, ipnt, c0 = 0; - Standard_Real SqrDist, Dist; + Standard_Integer i = 0, ipnt = 0, c0 = 0; + Standard_Real SqrDist = NAN, Dist = NAN; MaxError = QuadraticError = AverageError = 0.; @@ -510,11 +512,11 @@ void AppDef_LinearCriteria::Hessian(const Standard_Integer Element, math_Matrix AuxH(0, H.RowNumber()-1, 0, H.ColNumber()-1, 0.); TColStd_Array1OfReal& Knots = myCurve->Knots(); - Standard_Real UFirst, ULast; + Standard_Real UFirst = NAN, ULast = NAN; UFirst = Knots(Element); ULast = Knots(Element + 1); - Standard_Integer icrit; + Standard_Integer icrit = 0; // Quality criterion part of Hessian @@ -530,12 +532,12 @@ void AppDef_LinearCriteria::Hessian(const Standard_Integer Element, AuxH.Init(0.); - Standard_Real coeff = (ULast - UFirst)/2., curcoeff, poid; - Standard_Integer ipnt, ii, degH = 2 * Order+1; + Standard_Real coeff = (ULast - UFirst)/2., curcoeff = NAN, poid = NAN; + Standard_Integer ipnt = 0, ii = 0, degH = 2 * Order+1; Handle(PLib_Base) myBase = myCurve->Base(); - Standard_Integer k1, k2, i, j, i0 = H.LowerRow(), j0 = H.LowerCol(), i1, j1, + Standard_Integer k1 = 0, k2 = 0, i = 0, j = 0, i0 = H.LowerRow(), j0 = H.LowerCol(), i1 = 0, j1 = 0, di = myPntWeight.Lower() - myParameters->Lower(); //BuilCache @@ -603,8 +605,8 @@ void AppDef_LinearCriteria::Gradient(const Standard_Integer Element, TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d)); TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d)); - Standard_Boolean In3d; - Standard_Integer IndPnt, IndCrd; + Standard_Boolean In3d = 0; + Standard_Integer IndPnt = 0, IndCrd = 0; if(Dimension <= 3*myNbP3d) { In3d = Standard_True; @@ -622,7 +624,7 @@ void AppDef_LinearCriteria::Gradient(const Standard_Integer Element, } TColStd_Array1OfReal& Knots = myCurve->Knots(); - Standard_Real UFirst, ULast, Pnt; + Standard_Real UFirst = NAN, ULast = NAN, Pnt = NAN; UFirst = Knots(Element); ULast = Knots(Element + 1); Standard_Real coeff = (ULast-UFirst)/2; @@ -632,9 +634,9 @@ void AppDef_LinearCriteria::Gradient(const Standard_Integer Element, Handle(PLib_Base) myBase = myCurve->Base(); Standard_Integer MxDeg = myBase->WorkDegree(); - Standard_Real curcoeff; + Standard_Real curcoeff = NAN; Standard_Integer degH = 2 * Order + 1; - Standard_Integer ipnt, k, i, ii, i0 = G.Lower(), + Standard_Integer ipnt = 0, k = 0, i = 0, ii = 0, i0 = G.Lower(), di = myPntWeight.Lower() - myParameters->Lower(); if (myE != Element) BuildCache(Element); @@ -686,7 +688,7 @@ void AppDef_LinearCriteria::InputVector(const math_Vector& X, Handle(TColStd_HArray1OfInteger) GlobIndex; - Standard_Integer el, dim, i, i0 = X.Lower() - 1; + Standard_Integer el = 0, dim = 0, i = 0, i0 = X.Lower() - 1; for(el = 1; el <= NbElm; el++) { for(dim = 1; dim <= NbDim; dim++) { @@ -751,9 +753,9 @@ void AppDef_LinearCriteria::SetWeight(const TColStd_Array1OfReal& Weight) //======================================================================= void AppDef_LinearCriteria::BuildCache(const Standard_Integer Element) { - Standard_Real t; - Standard_Real UFirst, ULast; - Standard_Integer ipnt; + Standard_Real t = NAN; + Standard_Real UFirst = NAN, ULast = NAN; + Standard_Integer ipnt = 0; UFirst = myCurve->Knots()(Element); ULast = myCurve->Knots()(Element + 1); @@ -770,7 +772,7 @@ void AppDef_LinearCriteria::BuildCache(const Standard_Integer Element) if (IF != 0) { Handle(PLib_Base) myBase = myCurve->Base(); - Standard_Integer order = myBase->WorkDegree()+1, ii; + Standard_Integer order = myBase->WorkDegree()+1, ii = 0; myCache = new TColStd_HArray1OfReal (1, (IL-IF+1)*(order)); ii =1; @@ -778,7 +780,7 @@ void AppDef_LinearCriteria::BuildCache(const Standard_Integer Element) Standard_Real * cache = &myCache->ChangeValue(ii); TColStd_Array1OfReal BasicValue(cache[0], 0, order-1); t = myParameters->Value(ipnt); - Standard_Real coeff = 2./(ULast - UFirst), c0 = -(ULast + UFirst)/2., s; + Standard_Real coeff = 2./(ULast - UFirst), c0 = -(ULast + UFirst)/2., s = NAN; s = (t + c0) * coeff; myBase->D0(s, BasicValue); } diff --git a/src/AppDef/AppDef_LinearCriteria.hxx b/src/AppDef/AppDef_LinearCriteria.hxx index 7c7d2938b6..7f598fb935 100644 --- a/src/AppDef/AppDef_LinearCriteria.hxx +++ b/src/AppDef/AppDef_LinearCriteria.hxx @@ -96,10 +96,10 @@ private: Handle(TColStd_HArray1OfReal) myParameters; Handle(TColStd_HArray1OfReal) myCache; Handle(FEmTool_ElementaryCriterion) myCriteria[3]; - Standard_Real myEstimation[3]; + Standard_Real myEstimation[3]{}; Standard_Real myQuadraticWeight; Standard_Real myQualityWeight; - Standard_Real myPercent[3]; + Standard_Real myPercent[3]{}; TColStd_Array1OfReal myPntWeight; Handle(FEmTool_Curve) myCurve; Standard_Real myLength; diff --git a/src/AppDef/AppDef_MultiLine.cxx b/src/AppDef/AppDef_MultiLine.cxx index b53ea7db6d..66c44d7128 100644 --- a/src/AppDef/AppDef_MultiLine.cxx +++ b/src/AppDef/AppDef_MultiLine.cxx @@ -31,20 +31,20 @@ AppDef_MultiLine::AppDef_MultiLine (const Standard_Integer NbMult) } -AppDef_MultiLine::AppDef_MultiLine (const AppDef_Array1OfMultiPointConstraint& tabMultiP) +AppDef_MultiLine::AppDef_MultiLine (const AppDef_Array1OfMultiPointConstraint& tabMultiP) : tabMult(new AppDef_HArray1OfMultiPointConstraint (1, tabMultiP.Length())) { - tabMult = new AppDef_HArray1OfMultiPointConstraint (1, tabMultiP.Length()); - Standard_Integer i, Lower = tabMultiP.Lower(); + + Standard_Integer i = 0, Lower = tabMultiP.Lower(); for (i = 1; i <= tabMultiP.Length(); i++) { tabMult->SetValue(i, tabMultiP.Value(Lower+i-1)); } } -AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt& tabP3d) +AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt& tabP3d) : tabMult(new AppDef_HArray1OfMultiPointConstraint (1, tabP3d.Length())) { - tabMult = new AppDef_HArray1OfMultiPointConstraint (1, tabP3d.Length()); - Standard_Integer i, Lower = tabP3d.Lower(); + + Standard_Integer i = 0, Lower = tabP3d.Lower(); for (i = 1; i <= tabP3d.Length(); i++) { AppDef_MultiPointConstraint MP(1, 0); MP.SetPoint(1, tabP3d(Lower+i-1)); @@ -54,10 +54,10 @@ AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt& tabP3d) -AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt2d& tabP2d) +AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt2d& tabP2d) : tabMult(new AppDef_HArray1OfMultiPointConstraint (1, tabP2d.Length())) { - tabMult = new AppDef_HArray1OfMultiPointConstraint (1, tabP2d.Length()); - Standard_Integer i, Lower = tabP2d.Lower(); + + Standard_Integer i = 0, Lower = tabP2d.Lower(); for (i = 1; i <= tabP2d.Length(); i++) { AppDef_MultiPointConstraint MP(0, 1); MP.SetPoint2d(1, tabP2d(Lower+i-1)); diff --git a/src/AppDef/AppDef_MultiPointConstraint.cxx b/src/AppDef/AppDef_MultiPointConstraint.cxx index b35ba67def..5434e28b91 100644 --- a/src/AppDef/AppDef_MultiPointConstraint.cxx +++ b/src/AppDef/AppDef_MultiPointConstraint.cxx @@ -77,7 +77,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint tabTang = new TColgp_HArray1OfVec(1, tabVec.Length()); tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); - Standard_Integer i, Lower = tabVec.Lower(); + Standard_Integer i = 0, Lower = tabVec.Lower(); for (i = 1; i <= tabVec.Length(); i++) { tabTang->SetValue(i, tabVec.Value(Lower+i-1)); } @@ -116,7 +116,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint tabTang = new TColgp_HArray1OfVec(1, tabVec.Length()); tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); - Standard_Integer i, Lower = tabVec.Lower(); + Standard_Integer i = 0, Lower = tabVec.Lower(); for (i = 1; i <= tabVec.Length(); i++) { tabTang->SetValue(i, tabVec.Value(Lower+i-1)); } @@ -139,7 +139,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint ( tabTang = new TColgp_HArray1OfVec(1, tabVec.Length()); - Standard_Integer i, Lower = tabVec.Lower(); + Standard_Integer i = 0, Lower = tabVec.Lower(); for (i = 1; i <= tabVec.Length(); i++) { tabTang->SetValue(i, tabVec.Value(Lower+i-1)); } @@ -158,7 +158,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint } tabTang = new TColgp_HArray1OfVec(1, tabVec.Length()); - Standard_Integer i, Lower = tabVec.Lower(); + Standard_Integer i = 0, Lower = tabVec.Lower(); for (i = 1; i <= tabVec.Length(); i++) { tabTang->SetValue(i, tabVec.Value(Lower+i-1)); } @@ -183,7 +183,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint } tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); - Standard_Integer i, Lower = tabVec2d.Lower(); + Standard_Integer i = 0, Lower = tabVec2d.Lower(); for (i = 1; i <= tabVec2d.Length(); i++) { tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1)); } @@ -204,7 +204,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint } tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length()); - Standard_Integer i, Lower = tabVec2d.Lower(); + Standard_Integer i = 0, Lower = tabVec2d.Lower(); for (i = 1; i <= tabVec2d.Length(); i++) { tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1)); } diff --git a/src/AppDef/AppDef_MyLineTool.cxx b/src/AppDef/AppDef_MyLineTool.cxx index 3bc30bc204..0772585b8e 100644 --- a/src/AppDef/AppDef_MyLineTool.cxx +++ b/src/AppDef/AppDef_MyLineTool.cxx @@ -73,7 +73,7 @@ void AppDef_MyLineTool::Value(const AppDef_MultiLine& ML, TColgp_Array1OfPnt2d& tabPt2d) { AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex); - Standard_Integer i, nbp2d = MPC.NbPoints2d(), low2d = tabPt2d.Lower(); + Standard_Integer i = 0, nbp2d = MPC.NbPoints2d(), low2d = tabPt2d.Lower(); Standard_Integer nbp3d = MPC.NbPoints(), low = tabPt.Lower(); for (i = 1; i <= nbp3d; i++) { tabPt(i+low-1) = MPC.Point(i); @@ -123,7 +123,7 @@ Standard_Boolean AppDef_MyLineTool::Tangency(const AppDef_MultiLine& ML, { AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex); if (MPC.IsTangencyPoint()) { - Standard_Integer i, nbp3d = MPC.NbPoints(), low = tabV.Lower(); + Standard_Integer i = 0, nbp3d = MPC.NbPoints(), low = tabV.Lower(); Standard_Integer nbp2d = MPC.NbPoints2d(), low2d = tabV2d.Lower(); for (i = 1; i <= nbp3d; i++) { tabV(i+low-1) = MPC.Tang(i); @@ -204,7 +204,7 @@ Standard_Boolean AppDef_MyLineTool::Curvature(const AppDef_MultiLine& ML, { AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex); if (MPC.IsCurvaturePoint()) { - Standard_Integer i, nbp3d = MPC.NbPoints(), low = tabV.Lower(); + Standard_Integer i = 0, nbp3d = MPC.NbPoints(), low = tabV.Lower(); Standard_Integer nbp2d = MPC.NbPoints2d(), low2d = tabV2d.Lower(); for (i = 1; i <= nbp3d; i++) { tabV(i+low-1) = MPC.Curv(i); diff --git a/src/AppDef/AppDef_Variational.cxx b/src/AppDef/AppDef_Variational.cxx index b4604d0e35..74ca2c216c 100644 --- a/src/AppDef/AppDef_Variational.cxx +++ b/src/AppDef/AppDef_Variational.cxx @@ -17,6 +17,8 @@ // Approximation d une MultiLine de points decrite par le tool MLineTool. // avec criteres variationnels +#include + #include #include #include @@ -145,7 +147,7 @@ myWithCutting(WithCutting) // // Table of Points initialization // - Standard_Integer ipoint,jp2d,jp3d,index; + Standard_Integer ipoint = 0,jp2d = 0,jp3d = 0,index = 0; TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d)); TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d)); gp_Pnt2d P2d; @@ -212,8 +214,8 @@ myWithCutting(WithCutting) void AppDef_Variational::Init() { - Standard_Integer ipoint,jp2d,jp3d,index,jndex; - Standard_Integer CurMultyPoint; + Standard_Integer ipoint = 0,jp2d = 0,jp3d = 0,index = 0,jndex = 0; + Standard_Integer CurMultyPoint = 0; TColgp_Array1OfVec TabV3d(1, Max(1,myNbP3d)); TColgp_Array1OfVec2d TabV2d(1, Max(1,myNbP2d)); TColgp_Array1OfVec TabV3dcurv(1, Max(1,myNbP3d)); @@ -233,7 +235,7 @@ void AppDef_Variational::Init() // // Table of types initialization - Standard_Integer iconstr; + Standard_Integer iconstr = 0; index=1; jndex=1; CurMultyPoint = 1; @@ -412,7 +414,7 @@ void AppDef_Variational::Init() CurMultyPoint += myNbP3d * 6 + myNbP2d * 2; } // OverConstraint Detection - Standard_Integer MaxSeg; + Standard_Integer MaxSeg = 0; if(myWithCutting == Standard_True) MaxSeg = myMaxSegment ; else MaxSeg = 1; if (((myMaxDegree-myNivCont)*MaxSeg-myNbPassPoints-2*myNbTangPoints-3*myNbCurvPoints) < 0 ) @@ -439,7 +441,7 @@ void AppDef_Variational::Approximate() if (myIsCreated == Standard_False ) throw StdFail_NotDone(); - Standard_Real WQuadratic, WQuality; + Standard_Real WQuadratic = NAN, WQuality = NAN; TColStd_Array1OfReal Ecarts(myFirstPoint, myLastPoint); @@ -459,7 +461,7 @@ void AppDef_Variational::Approximate() //--------------------------------------------------------------------- - Standard_Integer jp2d,jp3d,index,ipole, + Standard_Integer jp2d = 0,jp3d = 0,index = 0,ipole = 0, NbElem = TheCurve->NbElements(); TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d)); @@ -490,7 +492,7 @@ void AppDef_Variational::Approximate() TheCurve->GetPolynom(CoeffPtr->ChangeArray1()); - Standard_Integer ii; + Standard_Integer ii = 0; for(ii = 1; ii <= NbElem; ii++) NbCoeffPtr->SetValue(ii, TheCurve->Degree(ii)+1); @@ -699,7 +701,7 @@ void AppDef_Variational::Distance(math_Matrix& mat) { if (myIsDone == Standard_False) throw StdFail_NotDone(); - Standard_Integer ipoint,jp2d,jp3d,index; + Standard_Integer ipoint = 0,jp2d = 0,jp3d = 0,index = 0; TColgp_Array1OfPnt TabP3d(1,Max(1,myNbP3d)); TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d)); Standard_Integer j0 = mat.LowerCol() - myFirstPoint; @@ -1150,22 +1152,22 @@ void AppDef_Variational::TheMotor( Handle(TColStd_HArray1OfReal) CurrentTi, NewTi, OldTi; Handle(TColStd_HArray2OfInteger) Dependence; - Standard_Boolean lestim, lconst, ToOptim, iscut; + Standard_Boolean lestim = 0, lconst = 0, ToOptim = 0, iscut = 0; Standard_Boolean isnear = Standard_False, again = Standard_True; - Standard_Integer NbEst, ICDANA, NumPnt, Iter; + Standard_Integer NbEst = 0, ICDANA = 0, NumPnt = 0, Iter = 0; Standard_Integer MaxNbEst =5; Standard_Real VOCRI[3] = {BigValue, BigValue, BigValue}, EROLD = BigValue, - VALCRI[3], ERRMAX = BigValue, ERRMOY, ERRQUA; - Standard_Real CBLONG, LNOLD; + VALCRI[3], ERRMAX = BigValue, ERRMOY = NAN, ERRQUA = NAN; + Standard_Real CBLONG = NAN, LNOLD = NAN; Standard_Integer NbrPnt = myLastPoint - myFirstPoint + 1; Standard_Integer NbrConstraint = myNbPassPoints + myNbTangPoints + myNbCurvPoints; Handle(FEmTool_Curve) CCurrent, COld, CNew; Standard_Real EpsLength = SmallValue; - Standard_Real EpsDeg; + Standard_Real EpsDeg = NAN; - Standard_Real e1, e2, e3; - Standard_Real J1min, J2min, J3min; - Standard_Integer iprog; + Standard_Real e1 = NAN, e2 = NAN, e3 = NAN; + Standard_Real J1min = NAN, J2min = NAN, J3min = NAN; + Standard_Integer iprog = 0; // (0) Init @@ -1368,7 +1370,7 @@ void AppDef_Variational::TheMotor( if ( (ERRMAX > WQuality) && (ERRMAX > 2*EROLD)) iregre++; if ( (EROLD > WQuality) && (ERRMAX <= 0.5*EROLD)) iregre--; } - Standard_Real E1, E2, E3; + Standard_Real E1 = NAN, E2 = NAN, E3 = NAN; J->GetEstimation(E1, E2, E3); if ( (VALCRI[0] > E1) && (VALCRI[0] > 1.1*VOCRI[0])) iregre++; if ( (VALCRI[1] > E2) && (VALCRI[1] > 1.1*VOCRI[1])) iregre++; @@ -1413,7 +1415,7 @@ void AppDef_Variational::TheMotor( if ((CurrentTi->Value(1)!= 0.) || (CurrentTi->Value(NbrPnt)!= 1.)) { - Standard_Real t, DelatT = + Standard_Real t = NAN, DelatT = 1.0 /(CurrentTi->Value(NbrPnt)-CurrentTi->Value(1)); for (Standard_Integer ii=2; iiValue(ii)-CurrentTi->Value(1))*DelatT; @@ -1489,7 +1491,7 @@ void AppDef_Variational::Optimization(Handle(AppDef_SmoothCriterion)& J, math_Matrix H(0, MxDeg, 0, MxDeg); math_Vector G(0, MxDeg), Sol(1, A.NbGlobVar()); - Standard_Integer el, dim; + Standard_Integer el = 0, dim = 0; A.GetAssemblyTable(AssTable); Standard_Integer NbConstr = myNbPassPoints + myNbTangPoints + myNbCurvPoints; @@ -1532,8 +1534,8 @@ void AppDef_Variational::Optimization(Handle(AppDef_SmoothCriterion)& J, // Updating Curve and reduction of degree - Standard_Integer Newdeg; - Standard_Real MaxError; + Standard_Integer Newdeg = 0; + Standard_Real MaxError = NAN; if(NbConstr == 0) { for(el = 1; el <= NbElm; el++) { @@ -1543,7 +1545,7 @@ void AppDef_Variational::Optimization(Handle(AppDef_SmoothCriterion)& J, else { TColStd_Array1OfReal& TabInt = Curve->Knots(); - Standard_Integer Icnt = 1, p0 = Parameters.Lower() - myFirstPoint, point; + Standard_Integer Icnt = 1, p0 = Parameters.Lower() - myFirstPoint, point = 0; for(el = 1; el <= NbElm; el++) { while((Icnt < NbConstr) && (Parameters(p0 + myTypConstraints->Value(2 * Icnt - 1)) <= TabInt(el))) Icnt++; @@ -1573,11 +1575,11 @@ void AppDef_Variational::Project(const Handle(FEmTool_Curve)& C, MaxErr = QuaErr = AveErr = 0.; - Standard_Integer Ipnt, NItCv, Iter, i, i0 = -myDimension, d0 = Distance.Lower() - 1; + Standard_Integer Ipnt = 0, NItCv = 0, Iter = 0, i = 0, i0 = -myDimension, d0 = Distance.Lower() - 1; - Standard_Real TNew, Dist, T0, Dist0, F1, F2, Aux, DF, Ecart; + Standard_Real TNew = NAN, Dist = NAN, T0 = NAN, Dist0 = NAN, F1 = NAN, F2 = NAN, Aux = NAN, DF = NAN, Ecart = NAN; - Standard_Boolean EnCour; + Standard_Boolean EnCour = 0; TColStd_Array1OfReal ValOfC(1, myDimension), FirstDerOfC(1, myDimension), SecndDerOfC(1, myDimension); @@ -1684,8 +1686,8 @@ void AppDef_Variational::ACR(Handle(FEmTool_Curve)& Curve, Standard_Integer NbrPnt = Ti.Length(), TiFirst = Ti.Lower(), TiLast = Ti.Upper(), KFirst = Knots.Lower(), KLast = Knots.Upper(); - Standard_Real CbLong, DeltaT, VTest, UNew, UOld, DU, TPara, TOld, DTInv, Ratio; - Standard_Integer ipnt, ii, IElm, IOld, POld, PCnt, ICnt=0; + Standard_Real CbLong = NAN, DeltaT = NAN, VTest = NAN, UNew = NAN, UOld = NAN, DU = NAN, TPara = NAN, TOld = NAN, DTInv = NAN, Ratio = NAN; + Standard_Integer ipnt = 0, ii = 0, IElm = 0, IOld = 0, POld = 0, PCnt = 0, ICnt=0; Standard_Integer NbCntr = myNbPassPoints + myNbTangPoints + myNbCurvPoints; // (1) Calcul de la longueur de courbe @@ -1806,7 +1808,7 @@ static Standard_Integer NearIndex(const Standard_Real T, if(T < TabPar(Loi)) { Flag = -1; return Loi;} if(T > TabPar(Upi)) { Flag = 1; return Upi;} - Standard_Integer Ibeg = Loi, Ifin = Upi, Imidl; + Standard_Integer Ibeg = Loi, Ifin = Upi, Imidl = 0; while(Ibeg + 1 != Ifin) { Imidl = (Ibeg + Ifin) / 2; @@ -1840,9 +1842,9 @@ static void GettingKnots(const TColStd_Array1OfReal& TabPar, TColStd_Array1OfReal& OldKnots = InCurve->Knots(); Standard_Integer NbMaxOld = InCurve->NbElements(); - Standard_Integer NbMax = NewKnots.Upper(), Ipt, Ipt1, Ipt2; - Standard_Integer el = 0, i1 = OldKnots.Lower(), i0 = i1 - 1, Flag; - Standard_Real TPar; + Standard_Integer NbMax = NewKnots.Upper(), Ipt = 0, Ipt1 = 0, Ipt2 = 0; + Standard_Integer el = 0, i1 = OldKnots.Lower(), i0 = i1 - 1, Flag = 0; + Standard_Real TPar = NAN; while((NbElm < NbMax) && (el < NbMaxOld)) { @@ -1904,7 +1906,7 @@ void AppDef_Variational::SplitCurve(const Handle(FEmTool_Curve)& InCurve, TColStd_Array1OfReal& OutKnots = OutCurve->Knots(); TColStd_Array1OfReal& InKnots = InCurve->Knots(); - Standard_Integer i, i0 = OutKnots.Lower(); + Standard_Integer i = 0, i0 = OutKnots.Lower(); for(i = InKnots.Lower(); i <= InKnots.Upper(); i++) OutKnots(i) = InKnots(i); for(i = NbElmOld + 1; i <= NbElm; i++) OutKnots(i + i0) = NewKnots(i); @@ -1927,13 +1929,13 @@ void AppDef_Variational::InitSmoothCriterion() - Standard_Real Length; + Standard_Real Length = NAN; InitParameters(Length); mySmoothCriterion->SetParameters(myParameters); - Standard_Real E1, E2, E3; + Standard_Real E1 = NAN, E2 = NAN, E3 = NAN; InitCriterionEstimations(Length, E1, E2, E3); /* @@ -1946,7 +1948,7 @@ void AppDef_Variational::InitSmoothCriterion() mySmoothCriterion->EstLength() = Length; mySmoothCriterion->SetEstimation(E1, E2, E3); - Standard_Real WQuadratic, WQuality; + Standard_Real WQuadratic = NAN, WQuality = NAN; if(!myWithMinMax && myTolerance != 0.) WQuality = myTolerance; @@ -1968,7 +1970,7 @@ void AppDef_Variational::InitSmoothCriterion() Handle(PLib_Base) TheBase = new PLib_HermitJacobi(myMaxDegree, myContinuity); Handle(FEmTool_Curve) TheCurve; - Standard_Integer NbElem; + Standard_Integer NbElem = 0; Standard_Real CurvTol = Eps2 * Length / myNbPoints; // Decoupe de l'intervalle en fonction des contraintes @@ -2006,8 +2008,8 @@ void AppDef_Variational::InitParameters(Standard_Real& Length) const Standard_Real Eps1 = Precision::Confusion() * .01; - Standard_Real aux, dist; - Standard_Integer i, i0, i1 = 0, ipoint; + Standard_Real aux = NAN, dist = NAN; + Standard_Integer i = 0, i0 = 0, i1 = 0, ipoint = 0; Length = 0.; @@ -2136,7 +2138,7 @@ void AppDef_Variational::InitCriterionEstimations(const Standard_Real Length, Delta = .5 * (myParameters->Value(myLastPoint) - myParameters->Value(myLastPoint - 1)); if(Delta <= Eps1) Delta = 1.; - Standard_Real aux; + Standard_Real aux = NAN; if(CurrPoint == 1) { @@ -2179,7 +2181,7 @@ void AppDef_Variational::EstTangent(const Standard_Integer ipnt, math_Vector& VTang) const { - Standard_Integer i ; + Standard_Integer i = 0 ; const Standard_Real Eps1 = Precision::Confusion() * .01; const Standard_Real EpsNorm = 1.e-9; @@ -2207,7 +2209,7 @@ void AppDef_Variational::EstTangent(const Standard_Integer ipnt, Standard_Real V2 = 0.; if(V1 > Eps1) V2 = Pnt3.Subtracted(Pnt2).Norm(); if(V2 > Eps1) { - Standard_Real d = V1 / (V1 + V2), d1; + Standard_Real d = V1 / (V1 + V2), d1 = NAN; d1 = 1. / (d * (1 - d)); d *= d; VTang = ((d - 1.) * Pnt1 + Pnt2 - d * Pnt3) * d1; } @@ -2240,7 +2242,7 @@ void AppDef_Variational::EstTangent(const Standard_Integer ipnt, Standard_Real V2 = 0.; if(V1 > Eps1) V2 = Pnt3.Subtracted(Pnt2).Norm(); if(V2 > Eps1) { - Standard_Real d = V1 / (V1 + V2), d1; + Standard_Real d = V1 / (V1 + V2), d1 = NAN; d1 = 1. / (d * (1 - d)); d *= d - 2; VTang = ((d + 1.) * Pnt1 - Pnt2 - d * Pnt3) * d1; } @@ -2332,13 +2334,13 @@ void AppDef_Variational::EstSecnd(const Standard_Integer ipnt, const Standard_Real Length, math_Vector& VScnd) const { - Standard_Integer i ; + Standard_Integer i = 0 ; const Standard_Real Eps = 1.e-9; Standard_Real Wpnt = 1.; - Standard_Real aux; + Standard_Real aux = NAN; if(ipnt == myFirstPoint) aux = myParameters->Value(ipnt + 1) - myParameters->Value(ipnt); @@ -2411,7 +2413,7 @@ void AppDef_Variational::InitCutting(const Handle(PLib_Base)& aBase, { // Definition of number of elements - Standard_Integer ORCMx = -1, NCont = 0, i, kk, NbElem; + Standard_Integer ORCMx = -1, NCont = 0, i = 0, kk = 0, NbElem = 0; Standard_Integer NbConstr = myNbPassPoints + myNbTangPoints + myNbCurvPoints; for(i = 1; i <= NbConstr; i++) { @@ -2534,15 +2536,15 @@ void AppDef_Variational::Adjusting( /* Local variables */ - Standard_Integer iter, ipnt; - Standard_Real ecart, emold, erold, tpara; - Standard_Real vocri[4], j1cibl, vtest, vseuil; - Standard_Integer i, numint, flag; + Standard_Integer iter = 0, ipnt = 0; + Standard_Real ecart = NAN, emold = NAN, erold = NAN, tpara = NAN; + Standard_Real vocri[4], j1cibl = NAN, vtest = NAN, vseuil = NAN; + Standard_Integer i = 0, numint = 0, flag = 0; TColStd_Array1OfReal tbpoid(myFirstPoint, myLastPoint); - Standard_Boolean loptim, lrejet; + Standard_Boolean loptim = 0, lrejet = 0; Handle(AppDef_SmoothCriterion) JNew; Handle(FEmTool_Curve) CNew; - Standard_Real E1, E2, E3; + Standard_Real E1 = NAN, E2 = NAN, E3 = NAN; /* (0.b) Initialisations */ @@ -2694,12 +2696,12 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv V1((Standard_Real*)&G1(0), 0, MxDeg), V2((Standard_Real*)&G2(0), 0, MxDeg); - Standard_Integer IndexOfConstraint, Ng3d, Ng2d, NBeg2d, NPass, NgPC1, - NTang3d, NTang2d, - Point, TypOfConstr, + Standard_Integer IndexOfConstraint = 0, Ng3d = 0, Ng2d = 0, NBeg2d = 0, NPass = 0, NgPC1 = 0, + NTang3d = 0, NTang2d = 0, + Point = 0, TypOfConstr = 0, p0 = Parameters.Lower() - myFirstPoint, - curel = 1, el, i, ipnt, ityp, j, k, pnt, curdim, - jt, Ntheta = 6 * myNbP3d + 2 * myNbP2d; + curel = 1, el = 0, i = 0, ipnt = 0, ityp = 0, j = 0, k = 0, pnt = 0, curdim = 0, + jt = 0, Ntheta = 6 * myNbP3d + 2 * myNbP2d; Standard_Integer NbConstr = myNbPassPoints + myNbTangPoints + myNbCurvPoints; // Ng3d = 3 * NbConstr + 2 * myNbTangPoints + 5 * myNbCurvPoints; @@ -2715,13 +2717,13 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv TColStd_Array1OfReal& Intervals = Curve->Knots(); - Standard_Real t, R1, R2; + Standard_Real t = NAN, R1 = NAN, R2 = NAN; Handle(PLib_Base) myBase = Curve->Base(); Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase); Standard_Integer Order = myHermitJacobi->NivConstr() + 1; - Standard_Real UFirst, ULast, coeff, c0, mfact, mfact1; + Standard_Real UFirst = NAN, ULast = NAN, coeff = NAN, c0 = NAN, mfact = NAN, mfact1 = NAN; A.NullifyConstraint(); @@ -2960,7 +2962,7 @@ Standard_Boolean AppDef_Variational::InitTthetaF(const Standard_Integer ndimen, gp_Vec T, V; gp_Vec theta1, theta2; gp_Vec F; - Standard_Real XX, XY, YY, XZ, YZ, ZZ; + Standard_Real XX = NAN, XY = NAN, YY = NAN, XZ = NAN, YZ = NAN, ZZ = NAN; if ((typcon == AppParCurves_TangencyPoint)||(typcon == AppParCurves_CurvaturePoint)) { diff --git a/src/AppDef/AppDef_Variational.hxx b/src/AppDef/AppDef_Variational.hxx index 3e2c7465de..60b6b9952c 100644 --- a/src/AppDef/AppDef_Variational.hxx +++ b/src/AppDef/AppDef_Variational.hxx @@ -254,11 +254,11 @@ private: Standard_Integer myNbPoints; Handle(TColStd_HArray1OfReal) myTabPoints; Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints; - Standard_Integer myNbConstraints; + Standard_Integer myNbConstraints{}; Handle(TColStd_HArray1OfReal) myTabConstraints; - Standard_Integer myNbPassPoints; - Standard_Integer myNbTangPoints; - Standard_Integer myNbCurvPoints; + Standard_Integer myNbPassPoints{}; + Standard_Integer myNbTangPoints{}; + Standard_Integer myNbCurvPoints{}; Handle(TColStd_HArray1OfInteger) myTypConstraints; Handle(TColStd_HArray1OfReal) myTtheta; Handle(TColStd_HArray1OfReal) myTfthet; @@ -270,15 +270,15 @@ private: Standard_Integer myNivCont; Standard_Boolean myWithMinMax; Standard_Boolean myWithCutting; - Standard_Real myPercent[3]; - Standard_Real myCriterium[4]; + Standard_Real myPercent[3]{}; + Standard_Real myCriterium[4]{}; Handle(AppDef_SmoothCriterion) mySmoothCriterion; Handle(TColStd_HArray1OfReal) myParameters; Handle(TColStd_HArray1OfReal) myKnots; AppParCurves_MultiBSpCurve myMBSpCurve; - Standard_Real myMaxError; - Standard_Integer myMaxErrorIndex; - Standard_Real myAverageError; + Standard_Real myMaxError{}; + Standard_Integer myMaxErrorIndex{}; + Standard_Real myAverageError{}; Standard_Boolean myIsCreated; Standard_Boolean myIsDone; Standard_Boolean myIsOverConstr; diff --git a/src/AppParCurves/AppParCurves.cxx b/src/AppParCurves/AppParCurves.cxx index 94c9c18dd1..0a62be251d 100644 --- a/src/AppParCurves/AppParCurves.cxx +++ b/src/AppParCurves/AppParCurves.cxx @@ -16,6 +16,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -25,8 +27,8 @@ void AppParCurves::BernsteinMatrix(const Standard_Integer NbPoles, const math_Vector& U, math_Matrix& A) { - Standard_Integer i, j, id; - Standard_Real u0, u1, y0, y1, xs; + Standard_Integer i = 0, j = 0, id = 0; + Standard_Real u0 = NAN, u1 = NAN, y0 = NAN, y1 = NAN, xs = NAN; Standard_Integer first = U.Lower(), last = U.Upper(); math_Vector B(1, NbPoles-1); @@ -62,8 +64,8 @@ void AppParCurves::Bernstein(const Standard_Integer NbPoles, math_Matrix& A, math_Matrix& DA) { - Standard_Integer i, j, id, Ndeg = NbPoles-1; - Standard_Real u0, u1, y0, y1, xs, bj, bj1; + Standard_Integer i = 0, j = 0, id = 0, Ndeg = NbPoles-1; + Standard_Real u0 = NAN, u1 = NAN, y0 = NAN, y1 = NAN, xs = NAN, bj = NAN, bj1 = NAN; Standard_Integer first = U.Lower(), last = U.Upper(); math_Vector B(1, NbPoles-1); @@ -101,9 +103,9 @@ void AppParCurves::Bernstein(const Standard_Integer NbPoles, void AppParCurves::SecondDerivativeBernstein(const Standard_Real U, math_Vector& DDA) { // Standard_Real U1 = 1-U, Y0, Y1, Xs; - Standard_Real Y0, Y1, Xs; + Standard_Real Y0 = NAN, Y1 = NAN, Xs = NAN; Standard_Integer NbPoles = DDA.Length(); - Standard_Integer id, j, N4, deg = NbPoles-1; + Standard_Integer id = 0, j = 0, N4 = 0, deg = NbPoles-1; N4 = deg*(deg-1); math_Vector B(1, deg-1); B(1) = 1.; @@ -155,13 +157,13 @@ void AppParCurves::SplineFunction(const Standard_Integer nbpoles, math_IntegerVector& index) { // Standard_Real U, NewU, co, diff, t1, t2; - Standard_Real U, NewU; + Standard_Real U = NAN, NewU = NAN; // gp_Pnt2d Pt, P0; // gp_Vec2d V1; // Standard_Integer i, j, k, iter, in, ik, deg1 = deg+1; - Standard_Integer i, j, deg1 = deg+1; + Standard_Integer i = 0, j = 0, deg1 = deg+1; // Standard_Integer oldkindex, kindex, theindex, ttindex; - Standard_Integer oldkindex, kindex, theindex; + Standard_Integer oldkindex = 0, kindex = 0, theindex = 0; math_Vector locpoles(1 , deg1); math_Vector locdpoles(1 , deg1); Standard_Integer firstp = Parameters.Lower(), lastp = Parameters.Upper(); @@ -174,8 +176,8 @@ void AppParCurves::SplineFunction(const Standard_Integer nbpoles, oldkindex = 1; - Standard_Integer pp, qq; - Standard_Real Saved, Inverse, LocalInverse, locqq, locdqq, val; + Standard_Integer pp = 0, qq = 0; + Standard_Real Saved = NAN, Inverse = NAN, LocalInverse = NAN, locqq = NAN, locdqq = NAN, val = NAN; for (i = firstp; i <= lastp; i++) { U = Parameters(i); diff --git a/src/AppParCurves/AppParCurves_ConstraintCouple.cxx b/src/AppParCurves/AppParCurves_ConstraintCouple.cxx index 27ff6969b6..1f35992f24 100644 --- a/src/AppParCurves/AppParCurves_ConstraintCouple.cxx +++ b/src/AppParCurves/AppParCurves_ConstraintCouple.cxx @@ -25,10 +25,10 @@ AppParCurves_ConstraintCouple:: AppParCurves_ConstraintCouple:: AppParCurves_ConstraintCouple(const Standard_Integer TheIndex, - const AppParCurves_Constraint Cons) + const AppParCurves_Constraint Cons) : myIndex(TheIndex), myConstraint(Cons) { - myIndex = TheIndex; - myConstraint = Cons; + + } diff --git a/src/AppParCurves/AppParCurves_MultiBSpCurve.cxx b/src/AppParCurves/AppParCurves_MultiBSpCurve.cxx index ed0a35993a..c4b082bee8 100644 --- a/src/AppParCurves/AppParCurves_MultiBSpCurve.cxx +++ b/src/AppParCurves/AppParCurves_MultiBSpCurve.cxx @@ -32,7 +32,7 @@ static Standard_Integer ComputeDegree(const TColStd_Array1OfInteger& mults, const Standard_Integer nbPoles) { - Standard_Integer i, sum = 0; + Standard_Integer i = 0, sum = 0; for (i = mults.Lower(); i <= mults.Upper(); i++) { sum += mults(i); } @@ -73,13 +73,13 @@ AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve (const AppParCurves_Array1OfMultiPoint& tabMU, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults): - AppParCurves_MultiCurve(tabMU) + AppParCurves_MultiCurve(tabMU), myknots(new TColStd_HArray1OfReal(Knots.Lower(), Knots.Upper())), mymults(new TColStd_HArray1OfInteger(Mults.Lower(), Mults.Upper())), myDegree(ComputeDegree(Mults,NbPoles())) { - myknots = new TColStd_HArray1OfReal(Knots.Lower(), Knots.Upper()); + myknots->ChangeArray1() = Knots; - mymults = new TColStd_HArray1OfInteger(Mults.Lower(), Mults.Upper()); + mymults->ChangeArray1() = Mults; - myDegree = ComputeDegree(Mults,NbPoles()); + } @@ -92,13 +92,13 @@ AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve (const AppParCurves_MultiCurve& SC, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults): - AppParCurves_MultiCurve(SC) + AppParCurves_MultiCurve(SC), myknots(new TColStd_HArray1OfReal(Knots.Lower(), Knots.Upper())), mymults(new TColStd_HArray1OfInteger(Mults.Lower(), Mults.Upper())), myDegree(ComputeDegree(Mults,NbPoles())) { - myknots = new TColStd_HArray1OfReal(Knots.Lower(), Knots.Upper()); + myknots->ChangeArray1() = Knots; - mymults = new TColStd_HArray1OfInteger(Mults.Lower(), Mults.Upper()); + mymults->ChangeArray1() = Mults; - myDegree = ComputeDegree(Mults,NbPoles()); + } diff --git a/src/AppParCurves/AppParCurves_MultiCurve.cxx b/src/AppParCurves/AppParCurves_MultiCurve.cxx index e9fd509252..c2e5f7da6e 100644 --- a/src/AppParCurves/AppParCurves_MultiCurve.cxx +++ b/src/AppParCurves/AppParCurves_MultiCurve.cxx @@ -27,17 +27,17 @@ AppParCurves_MultiCurve::AppParCurves_MultiCurve() {} -AppParCurves_MultiCurve::AppParCurves_MultiCurve (const Standard_Integer NbPol) +AppParCurves_MultiCurve::AppParCurves_MultiCurve (const Standard_Integer NbPol) : tabPoint(new AppParCurves_HArray1OfMultiPoint(1, NbPol)) { - tabPoint = new AppParCurves_HArray1OfMultiPoint(1, NbPol); + } -AppParCurves_MultiCurve::AppParCurves_MultiCurve (const AppParCurves_Array1OfMultiPoint& tabMU) +AppParCurves_MultiCurve::AppParCurves_MultiCurve (const AppParCurves_Array1OfMultiPoint& tabMU) : tabPoint(new AppParCurves_HArray1OfMultiPoint(1, tabMU.Length())) { - tabPoint = new AppParCurves_HArray1OfMultiPoint(1, tabMU.Length()); - Standard_Integer i, Lower = tabMU.Lower(); + + Standard_Integer i = 0, Lower = tabMU.Lower(); for (i = 1; i <= tabMU.Length(); i++) { tabPoint->SetValue(i, tabMU.Value(Lower+i-1)); } diff --git a/src/AppParCurves/AppParCurves_MultiPoint.cxx b/src/AppParCurves/AppParCurves_MultiPoint.cxx index faf2c490d8..28b0a77355 100644 --- a/src/AppParCurves/AppParCurves_MultiPoint.cxx +++ b/src/AppParCurves/AppParCurves_MultiPoint.cxx @@ -32,10 +32,10 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint() AppParCurves_MultiPoint::AppParCurves_MultiPoint (const Standard_Integer NbPoles, - const Standard_Integer NbPoles2d) + const Standard_Integer NbPoles2d) : nbP(NbPoles), nbP2d(NbPoles2d) { - nbP = NbPoles; - nbP2d = NbPoles2d; + + if (nbP != 0) { Handle(TColgp_HArray1OfPnt) tab3d = new TColgp_HArray1OfPnt(1, NbPoles); @@ -50,10 +50,10 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint (const Standard_Integer NbPoles -AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP) +AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP) : nbP2d(0), nbP(tabP.Length()) { - nbP2d = 0; - nbP = tabP.Length(); + + Handle(TColgp_HArray1OfPnt) tab3d = new TColgp_HArray1OfPnt(1, nbP); ttabPoint = tab3d; @@ -66,10 +66,10 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP) -AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt2d& tabP2d) +AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt2d& tabP2d) : nbP(0), nbP2d(tabP2d.Length()) { - nbP = 0; - nbP2d = tabP2d.Length(); + + Handle(TColgp_HArray1OfPnt2d) tab2d = new TColgp_HArray1OfPnt2d(1, nbP2d); ttabPoint2d = tab2d; @@ -82,10 +82,10 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt2d& tab AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP, - const TColgp_Array1OfPnt2d& tabP2d) + const TColgp_Array1OfPnt2d& tabP2d) : nbP(tabP.Length()), nbP2d(tabP2d.Length()) { - nbP = tabP.Length(); - nbP2d = tabP2d.Length(); + + Handle(TColgp_HArray1OfPnt) t3d = new TColgp_HArray1OfPnt(1, nbP); ttabPoint = t3d; @@ -95,7 +95,7 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tab ttabPoint2d = t2d; TColgp_Array1OfPnt& P3d = tabPoint->ChangeArray1(); - Standard_Integer i, Lower = tabP.Lower(); + Standard_Integer i = 0, Lower = tabP.Lower(); for (i = 1; i <= nbP; i++) { P3d.SetValue(i, tabP.Value(Lower+i-1)); } diff --git a/src/Approx/Approx_Curve2d.cxx b/src/Approx/Approx_Curve2d.cxx index be3c9def4c..f0aa89b19a 100644 --- a/src/Approx/Approx_Curve2d.cxx +++ b/src/Approx/Approx_Curve2d.cxx @@ -34,16 +34,16 @@ class Approx_Curve2d_Eval : public AdvApprox_EvaluatorFunction Standard_Real First, Standard_Real Last) : fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Adaptor2d_Curve2d) fonct; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Approx_Curve2d_Eval::Evaluate (Standard_Integer *Dimension, @@ -96,7 +96,7 @@ void Approx_Curve2d_Eval::Evaluate (Standard_Integer *Dimension, } } - Approx_Curve2d::Approx_Curve2d(const Handle(Adaptor2d_Curve2d)& C2D,const Standard_Real First,const Standard_Real Last,const Standard_Real TolU,const Standard_Real TolV,const GeomAbs_Shape Continuity,const Standard_Integer MaxDegree,const Standard_Integer MaxSegments) + Approx_Curve2d::Approx_Curve2d(const Handle(Adaptor2d_Curve2d)& C2D,const Standard_Real First,const Standard_Real Last,const Standard_Real TolU,const Standard_Real TolV,const GeomAbs_Shape Continuity,const Standard_Integer MaxDegree,const Standard_Integer MaxSegments) : myMaxError2dU(0), myMaxError2dV(0) { C2D->Trim(First,Last,Precision::PConfusion()); @@ -115,8 +115,8 @@ void Approx_Curve2d_Eval::Evaluate (Standard_Integer *Dimension, AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3); - myMaxError2dU = 0; - myMaxError2dV = 0; + + Approx_Curve2d_Eval ev (C2D, First, Last); AdvApprox_ApproxAFunction aApprox (Num1DSS, Num2DSS, Num3DSS, diff --git a/src/Approx/Approx_Curve3d.cxx b/src/Approx/Approx_Curve3d.cxx index ccbab07868..d67e4780a4 100644 --- a/src/Approx/Approx_Curve3d.cxx +++ b/src/Approx/Approx_Curve3d.cxx @@ -38,16 +38,16 @@ class Approx_Curve3d_Eval : public AdvApprox_EvaluatorFunction Standard_Real First, Standard_Real Last) : fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Adaptor3d_Curve) fonct; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Approx_Curve3d_Eval::Evaluate (Standard_Integer *Dimension, @@ -105,7 +105,7 @@ Approx_Curve3d::Approx_Curve3d(const Handle(Adaptor3d_Curve)& Curve, const Standard_Real Tol3d, const GeomAbs_Shape Order, const Standard_Integer MaxSegments, - const Standard_Integer MaxDegree) + const Standard_Integer MaxDegree) : myMaxError(0) { // Initialisation of input parameters of AdvApprox @@ -127,7 +127,7 @@ Approx_Curve3d::Approx_Curve3d(const Handle(Adaptor3d_Curve)& Curve, AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3); - myMaxError = 0; + Approx_Curve3d_Eval ev (Curve, First, Last); AdvApprox_ApproxAFunction aApprox (Num1DSS, Num2DSS, Num3DSS, diff --git a/src/Approx/Approx_CurveOnSurface.cxx b/src/Approx/Approx_CurveOnSurface.cxx index 1899d0eb82..f7affbeeef 100644 --- a/src/Approx/Approx_CurveOnSurface.cxx +++ b/src/Approx/Approx_CurveOnSurface.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,17 +57,17 @@ class Approx_CurveOnSurface_Eval : public AdvApprox_EvaluatorFunction : fonct(theFunc), fonct2d(theFunc2d) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Adaptor3d_Curve) fonct; Handle(Adaptor2d_Curve2d) fonct2d; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Approx_CurveOnSurface_Eval::Evaluate (Standard_Integer *Dimension, @@ -154,16 +156,16 @@ class Approx_CurveOnSurface_Eval3d : public AdvApprox_EvaluatorFunction Standard_Real First, Standard_Real Last) : fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Adaptor3d_Curve) fonct; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Approx_CurveOnSurface_Eval3d::Evaluate (Standard_Integer *Dimension, @@ -235,16 +237,16 @@ class Approx_CurveOnSurface_Eval2d : public AdvApprox_EvaluatorFunction Standard_Real First, Standard_Real Last) : fonct2d(theFunc2d) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Adaptor2d_Curve2d) fonct2d; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Approx_CurveOnSurface_Eval2d::Evaluate (Standard_Integer *Dimension, @@ -381,8 +383,8 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments, Handle( Adaptor2d_Curve2d ) TrimmedC2D = myC2D->Trim( myFirst, myLast, Precision::PConfusion() ); - Standard_Boolean isU, isForward; - Standard_Real aParam; + Standard_Boolean isU = 0, isForward = 0; + Standard_Real aParam = NAN; if (theOnly3d && isIsoLine(TrimmedC2D, isU, aParam, isForward)) { if (buildC3dOnIsoLine(TrimmedC2D, isU, aParam, isForward)) @@ -404,7 +406,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments, Approx_CurveOnSurface_Eval3d Eval3dCvOnSurf (HCOnS, myFirst, myLast); Approx_CurveOnSurface_Eval2d Eval2dCvOnSurf ( TrimmedC2D, myFirst, myLast); Approx_CurveOnSurface_Eval EvalCvOnSurf (HCOnS, TrimmedC2D, myFirst, myLast); - AdvApprox_EvaluatorFunction* EvalPtr; + AdvApprox_EvaluatorFunction* EvalPtr = nullptr; if ( theOnly3d ) EvalPtr = &Eval3dCvOnSurf; else if ( theOnly2d ) EvalPtr = &Eval2dCvOnSurf; else EvalPtr = &EvalCvOnSurf; @@ -414,7 +416,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments, Num1DSS = 2; OneDTol = new TColStd_HArray1OfReal(1,Num1DSS); - Standard_Real TolU, TolV; + Standard_Real TolU = NAN, TolV = NAN; TolU = mySurf->UResolution(myTol) / 2.; TolV = mySurf->VResolution(myTol) / 2.; @@ -445,7 +447,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments, ThreeDTol->Init(myTol/2); } - AdvApprox_Cutting* CutTool; + AdvApprox_Cutting* CutTool = nullptr; if (aContinuity <= myC2D->Continuity() && aContinuity <= mySurf->UContinuity() && @@ -556,7 +558,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments, //function : isIsoLine //purpose : //============================================================================= -Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d) theC2D, +Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D, Standard_Boolean& theIsU, Standard_Real& theParam, Standard_Boolean& theIsForward) const @@ -638,7 +640,7 @@ Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d //function : buildC3dOnIsoLine //purpose : //============================================================================= -Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d) theC2D, +Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D, const Standard_Boolean theIsU, const Standard_Real theParam, const Standard_Boolean theIsForward) @@ -659,7 +661,7 @@ Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d gp_Pnt2d aL2d = theC2D->Value(theC2D->LastParameter()); Standard_Boolean isToTrim = Standard_True; - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; aSurf->Bounds(U1, U2, V1, V2); if (theIsU) diff --git a/src/Approx/Approx_CurveOnSurface.hxx b/src/Approx/Approx_CurveOnSurface.hxx index 55f376e5c8..c3541e357d 100644 --- a/src/Approx/Approx_CurveOnSurface.hxx +++ b/src/Approx/Approx_CurveOnSurface.hxx @@ -85,7 +85,7 @@ protected: //! @param theParam Line parameter. //! @param theIsForward Flag indicating forward parameterization on a isoline. //! @return Standard_True when 2d curve is a line and Standard_False otherwise. - Standard_Boolean isIsoLine(const Handle(Adaptor2d_Curve2d) theC2D, + Standard_Boolean isIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D, Standard_Boolean& theIsU, Standard_Real& theParam, Standard_Boolean& theIsForward) const; @@ -97,7 +97,7 @@ protected: //! @param theParam Line parameter. //! @param theIsForward Flag indicating forward parameterization on a isoline. //! @return Standard_True when 3d curve is built and Standard_False otherwise. - Standard_Boolean buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d) theC2D, + Standard_Boolean buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D, const Standard_Boolean theIsU, const Standard_Real theParam, const Standard_Boolean theIsForward); diff --git a/src/Approx/Approx_CurvilinearParameter.cxx b/src/Approx/Approx_CurvilinearParameter.cxx index 77ca7f8e2c..e311a147f5 100644 --- a/src/Approx/Approx_CurvilinearParameter.cxx +++ b/src/Approx/Approx_CurvilinearParameter.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -73,16 +75,16 @@ class Approx_CurvilinearParameter_EvalCurv : public AdvApprox_EvaluatorFunction Standard_Real First, Standard_Real Last) : fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Approx_CurvlinFunc) fonct; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Approx_CurvilinearParameter_EvalCurv::Evaluate (Standard_Integer * Dimension, @@ -95,7 +97,7 @@ void Approx_CurvilinearParameter_EvalCurv::Evaluate (Standard_Integer * Dimensio *ErrorCode = 0; Standard_Real S = *Param; TColStd_Array1OfReal Res(0, 2); - Standard_Integer i; + Standard_Integer i = 0; // Dimension is incorrect if (*Dimension != 3) { @@ -126,7 +128,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_ const GeomAbs_Shape Order, const Standard_Integer MaxDegree, const Standard_Integer MaxSegments) -: myMaxError2d1(0.0), +: myCase(1), myMaxError2d1(0.0), myMaxError2d2(0.0) { #ifdef OCCT_DEBUG_CHRONO @@ -134,7 +136,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_ uparam_count = 0; InitChron(chr_total); #endif - myCase = 1; + // Initialisation of input parameters of AdvApprox Standard_Integer Num1DSS=0, Num2DSS=0, Num3DSS=1; @@ -212,16 +214,16 @@ class Approx_CurvilinearParameter_EvalCurvOnSurf : public AdvApprox_EvaluatorFun Standard_Real First, Standard_Real Last) : fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Approx_CurvlinFunc) fonct; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Approx_CurvilinearParameter_EvalCurvOnSurf::Evaluate (Standard_Integer * Dimension, @@ -234,7 +236,7 @@ void Approx_CurvilinearParameter_EvalCurvOnSurf::Evaluate (Standard_Integer * Di *ErrorCode = 0; Standard_Real S = *Param; TColStd_Array1OfReal Res(0, 4); - Standard_Integer i; + Standard_Integer i = 0; // Dimension is incorrect if (*Dimension != 5) { @@ -265,21 +267,21 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_ const Standard_Real Tol, const GeomAbs_Shape Order, const Standard_Integer MaxDegree, - const Standard_Integer MaxSegments) + const Standard_Integer MaxSegments) : myCase(2) { #ifdef OCCT_DEBUG_CHRONO t_total = t_init = t_approx = t_uparam = 0; uparam_count = 0; InitChron(chr_total); #endif - myCase = 2; + // Initialisation of input parameters of AdvApprox - Standard_Integer Num1DSS=2, Num2DSS=0, Num3DSS=1, i; + Standard_Integer Num1DSS=2, Num2DSS=0, Num3DSS=1, i = 0; Handle(TColStd_HArray1OfReal) OneDTol = new TColStd_HArray1OfReal(1,Num1DSS); - Standard_Real TolV,TolW; + Standard_Real TolV = NAN,TolW = NAN; ToleranceComputation(C2D,Surf,10,Tol,TolV,TolW); OneDTol->SetValue(1,TolV); @@ -373,16 +375,16 @@ class Approx_CurvilinearParameter_EvalCurvOn2Surf : public AdvApprox_EvaluatorFu Standard_Real First, Standard_Real Last) : fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Approx_CurvlinFunc) fonct; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Approx_CurvilinearParameter_EvalCurvOn2Surf::Evaluate (Standard_Integer * Dimension, @@ -395,7 +397,7 @@ void Approx_CurvilinearParameter_EvalCurvOn2Surf::Evaluate (Standard_Integer * D *ErrorCode = 0; Standard_Real S = *Param; TColStd_Array1OfReal Res(0, 6); - Standard_Integer i; + Standard_Integer i = 0; // Dimension is incorrect if (*Dimension != 7) { @@ -428,23 +430,23 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_ const Standard_Real Tol, const GeomAbs_Shape Order, const Standard_Integer MaxDegree, - const Standard_Integer MaxSegments) + const Standard_Integer MaxSegments) : myCase(3) { - Standard_Integer i; + Standard_Integer i = 0; #ifdef OCCT_DEBUG_CHRONO t_total = t_init = t_approx = t_uparam = 0; uparam_count = 0; InitChron(chr_total); #endif - myCase = 3; + // Initialisation of input parameters of AdvApprox Standard_Integer Num1DSS=4, Num2DSS=0, Num3DSS=1; Handle(TColStd_HArray1OfReal) OneDTol = new TColStd_HArray1OfReal(1,Num1DSS); - Standard_Real TolV,TolW; + Standard_Real TolV = NAN,TolW = NAN; ToleranceComputation(C2D1,Surf1,10,Tol,TolV,TolW); OneDTol->SetValue(1,TolV); OneDTol->SetValue(2,TolW); diff --git a/src/Approx/Approx_CurvilinearParameter.hxx b/src/Approx/Approx_CurvilinearParameter.hxx index bf014252db..e0dfb3fa02 100644 --- a/src/Approx/Approx_CurvilinearParameter.hxx +++ b/src/Approx/Approx_CurvilinearParameter.hxx @@ -90,7 +90,7 @@ private: Handle(Geom2d_BSplineCurve) myCurve2d1; Standard_Real myMaxError2d1; Handle(Geom2d_BSplineCurve) myCurve2d2; - Standard_Real myMaxError2d2; + Standard_Real myMaxError2d2{}; }; diff --git a/src/Approx/Approx_CurvlinFunc.cxx b/src/Approx/Approx_CurvlinFunc.cxx index ba82388e95..156224da69 100644 --- a/src/Approx/Approx_CurvlinFunc.cxx +++ b/src/Approx/Approx_CurvlinFunc.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -43,7 +45,7 @@ Standard_IMPORT void ResultChron( OSD_Chronometer & ch, Standard_Real & time); static Standard_Real cubic(const Standard_Real X, const Standard_Real *Xi, const Standard_Real *Yi) { - Standard_Real I1, I2, I3, I21, I22, I31, Result; + Standard_Real I1 = NAN, I2 = NAN, I3 = NAN, I21 = NAN, I22 = NAN, I31 = NAN, Result = NAN; I1 = (Yi[0] - Yi[1])/(Xi[0] - Xi[1]); I2 = (Yi[1] - Yi[2])/(Xi[1] - Xi[2]); @@ -68,7 +70,7 @@ static void findfourpoints(const Standard_Real , const Standard_Real prevU, Standard_Real *Xi, Standard_Real *Yi) { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Standard_Integer NbInt = Si->Length() - 1; if (NbInt < 3) throw Standard_ConstructionError("Approx_CurvlinFunc::GetUParameter"); @@ -193,8 +195,8 @@ void Approx_CurvlinFunc::Init() void Approx_CurvlinFunc::Init(Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const { - Standard_Real Step, FirstU, LastU; - Standard_Integer i, j, k, NbInt, NbIntC3; + Standard_Real Step = NAN, FirstU = NAN, LastU = NAN; + Standard_Integer i = 0, j = 0, k = 0, NbInt = 0, NbIntC3 = 0; FirstU = C.FirstParameter(); LastU = C.LastParameter(); @@ -260,7 +262,7 @@ Standard_Integer Approx_CurvlinFunc::NbIntervals(const GeomAbs_Shape S) const CurOnSur.Load(mySurf1); return CurOnSur.NbIntervals(S); case 3: - Standard_Integer NbInt; + Standard_Integer NbInt = 0; CurOnSur.Load(myC2D1); CurOnSur.Load(mySurf1); NbInt = CurOnSur.NbIntervals(S); @@ -284,7 +286,7 @@ Standard_Integer Approx_CurvlinFunc::NbIntervals(const GeomAbs_Shape S) const void Approx_CurvlinFunc::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const { Adaptor3d_CurveOnSurface CurOnSur; - Standard_Integer i; + Standard_Integer i = 0; switch(myCase) { case 1: @@ -296,7 +298,7 @@ void Approx_CurvlinFunc::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape CurOnSur.Intervals(T, S); break; case 3: - Standard_Integer NbInt; + Standard_Integer NbInt = 0; CurOnSur.Load(myC2D1); CurOnSur.Load(mySurf1); NbInt = CurOnSur.NbIntervals(S); @@ -324,7 +326,7 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las if (First < 0 || Last >1) throw Standard_OutOfRange("Approx_CurvlinFunc::Trim"); if ((Last - First) < Tol) return; - Standard_Real FirstU, LastU; + Standard_Real FirstU = NAN, LastU = NAN; Adaptor3d_CurveOnSurface CurOnSur; Handle(Adaptor3d_CurveOnSurface) HCurOnSur; @@ -373,7 +375,7 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las void Approx_CurvlinFunc::Length() { Adaptor3d_CurveOnSurface CurOnSur; - Standard_Real FirstU, LastU; + Standard_Real FirstU = NAN, LastU = NAN; switch(myCase){ case 1: @@ -408,7 +410,7 @@ void Approx_CurvlinFunc::Length() Standard_Real Approx_CurvlinFunc::Length(Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LastU) const { - Standard_Real Length; + Standard_Real Length = NAN; Length = GCPnts_AbscissaPoint::Length(C, FirstU, LastU, myTolLen); return Length; @@ -422,7 +424,7 @@ Standard_Real Approx_CurvlinFunc::GetLength() const Standard_Real Approx_CurvlinFunc::GetSParameter(const Standard_Real U) const { - Standard_Real S=0, S1, S2; + Standard_Real S=0, S1 = NAN, S2 = NAN; Adaptor3d_CurveOnSurface CurOnSur; switch (myCase) { @@ -452,8 +454,8 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const { - Standard_Real deltaS, base, U, Length; - Standard_Integer NbInt, NInterval, i; + Standard_Real deltaS = NAN, base = NAN, U = NAN, Length = NAN; + Standard_Integer NbInt = 0, NInterval = 0, i = 0; Handle(TColStd_HArray1OfReal) InitUArray, InitSArray; #ifdef OCCT_DEBUG_CHRONO InitChron(chr_uparam); @@ -495,7 +497,7 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C, deltaS = (S - InitSArray->Value(NInterval))*Length; // to find an initial point - Standard_Real Xi[4], Yi[4], UGuess; + Standard_Real Xi[4], Yi[4], UGuess = NAN; findfourpoints(S, NInterval, InitSArray, InitUArray, myPrevS, myPrevU, Xi, Yi); UGuess = cubic(S , Xi, Yi); @@ -515,7 +517,7 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C, Standard_Real Approx_CurvlinFunc::GetSParameter(Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Len) const { - Standard_Real S, Origin; + Standard_Real S = NAN, Origin = NAN; Origin = C.FirstParameter(); S = myFirstS + Length(C, Origin, U)/Len; @@ -528,7 +530,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase1(const Standard_Real S, const Stan gp_Pnt C; gp_Vec dC_dU, dC_dS, d2C_dU2, d2C_dS2; - Standard_Real U, Mag, dU_dS, d2U_dS2; + Standard_Real U = NAN, Mag = NAN, dU_dS = NAN, d2U_dS2 = NAN; U = GetUParameter (*myC3D, S, 1); @@ -575,7 +577,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase2(const Standard_Real S, const Stan { if(myCase != 2) throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCase2"); - Standard_Boolean Done; + Standard_Boolean Done = 0; Done = EvalCurOnSur(S, Order, Result, 1); @@ -587,7 +589,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase3(const Standard_Real S, const Stan if(myCase != 3) throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCase3"); TColStd_Array1OfReal tmpRes1(0, 4), tmpRes2(0, 4); - Standard_Boolean Done; + Standard_Boolean Done = 0; Done = EvalCurOnSur(S, Order, tmpRes1, 1); @@ -628,7 +630,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCurOnSur(const Standard_Real S, const S else throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCurOnSur"); - Standard_Real Mag, dU_dS, d2U_dS2, dV_dU, dW_dU, dV_dS, dW_dS, d2V_dS2, d2W_dS2, d2V_dU2, d2W_dU2; + Standard_Real Mag = NAN, dU_dS = NAN, d2U_dS2 = NAN, dV_dU = NAN, dW_dU = NAN, dV_dS = NAN, dW_dS = NAN, d2V_dS2 = NAN, d2W_dS2 = NAN, d2V_dU2 = NAN, d2W_dU2 = NAN; gp_Pnt2d C2D; gp_Pnt C; gp_Vec2d dC2D_dU, d2C2D_dU2; diff --git a/src/Approx/Approx_CurvlinFunc.hxx b/src/Approx/Approx_CurvlinFunc.hxx index c97e46146b..b83494e474 100644 --- a/src/Approx/Approx_CurvlinFunc.hxx +++ b/src/Approx/Approx_CurvlinFunc.hxx @@ -115,13 +115,13 @@ private: Standard_Integer myCase; Standard_Real myFirstS; Standard_Real myLastS; - Standard_Real myFirstU1; - Standard_Real myLastU1; - Standard_Real myFirstU2; - Standard_Real myLastU2; - Standard_Real myLength; - Standard_Real myLength1; - Standard_Real myLength2; + Standard_Real myFirstU1{}; + Standard_Real myLastU1{}; + Standard_Real myFirstU2{}; + Standard_Real myLastU2{}; + Standard_Real myLength{}; + Standard_Real myLength1{}; + Standard_Real myLength2{}; Standard_Real myTolLen; Standard_Real myPrevS; Standard_Real myPrevU; diff --git a/src/Approx/Approx_MCurvesToBSpCurve.cxx b/src/Approx/Approx_MCurvesToBSpCurve.cxx index f929166f90..9c40996027 100644 --- a/src/Approx/Approx_MCurvesToBSpCurve.cxx +++ b/src/Approx/Approx_MCurvesToBSpCurve.cxx @@ -52,9 +52,9 @@ static void DEBUG(const AppParCurves_MultiCurve& MC) { -Approx_MCurvesToBSpCurve::Approx_MCurvesToBSpCurve() +Approx_MCurvesToBSpCurve::Approx_MCurvesToBSpCurve() : myDone(Standard_False) { - myDone = Standard_False; + } void Approx_MCurvesToBSpCurve::Reset() @@ -78,7 +78,7 @@ void Approx_MCurvesToBSpCurve::Perform (const AppParCurves_SequenceOfMultiCurve& TheSeq) { - Standard_Integer i, j, deg=0; + Standard_Integer i = 0, j = 0, deg=0; Standard_Integer nbcu = TheSeq.Length(); AppParCurves_MultiCurve CU; Standard_Integer nbpolesspl=0, nbknots=0; @@ -167,8 +167,8 @@ void Approx_MCurvesToBSpCurve::Perform } Standard_Integer kpol = 1, kpoles3d=1, kpoles2d=1; - Standard_Integer mydegre, k; - Standard_Integer first, last, Inc, thefirst; + Standard_Integer mydegre = 0, k = 0; + Standard_Integer first = 0, last = 0, Inc = 0, thefirst = 0; if (nb3d != 0) thefirst = 1; else thefirst = 2; diff --git a/src/Approx/Approx_SameParameter.cxx b/src/Approx/Approx_SameParameter.cxx index 9bb7b22e24..0330c25c78 100644 --- a/src/Approx/Approx_SameParameter.cxx +++ b/src/Approx/Approx_SameParameter.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -46,12 +48,12 @@ public: Poles(thePoles), HCurve2d(theHCurve2d) {} - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: const TColStd_Array1OfReal& FlatKnots; @@ -119,7 +121,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue, gp_Pnt a_point; gp_Vec vector, d1, d2; - Standard_Real func, func_derivative, + Standard_Real func = NAN, func_derivative = NAN, param = InitValue; Status = Standard_False; do @@ -236,7 +238,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots, Standard_Real t = unsurnn*i; Standard_Real tc3d = pc3d[0]*(1.0 - t) + pc3d[nbp - 1] * t; // weight function. gp_Pnt Pc3d = c3d->Value(tc3d); - Standard_Real tcons; + Standard_Real tcons = NAN; BSplCLib::Eval(tc3d, Standard_False, 0, extrap_mode[0], aDegree, FlatKnots, 1, (Standard_Real&)Poles(1), tcons); @@ -276,11 +278,11 @@ Approx_SameParameter::Approx_SameParameter(const Handle(Geom_Curve)& C3D, const Standard_Real Tol) : myDeltaMin(Precision::PConfusion()), mySameParameter(Standard_True), - myDone(Standard_False) + myDone(Standard_False), myHCurve2d(new Geom2dAdaptor_Curve(C2D)), myC3d(new GeomAdaptor_Curve(C3D)), mySurf(new GeomAdaptor_Surface(S)) { - myHCurve2d = new Geom2dAdaptor_Curve(C2D); - myC3d = new GeomAdaptor_Curve(C3D); - mySurf = new GeomAdaptor_Surface(S); + + + Build(Tol); } @@ -294,11 +296,11 @@ Approx_SameParameter::Approx_SameParameter(const Handle(Adaptor3d_Curve)& C3D, const Standard_Real Tol) : myDeltaMin(Precision::PConfusion()), mySameParameter(Standard_True), - myDone(Standard_False) + myDone(Standard_False), myHCurve2d(new Geom2dAdaptor_Curve(C2D)), myC3d(C3D), mySurf(S) { - myC3d = C3D; - mySurf = S; - myHCurve2d = new Geom2dAdaptor_Curve(C2D); + + + Build(Tol); } @@ -312,11 +314,11 @@ Approx_SameParameter::Approx_SameParameter(const Handle(Adaptor3d_Curve)& C3D, const Standard_Real Tol) : myDeltaMin(Precision::PConfusion()), mySameParameter(Standard_True), - myDone(Standard_False) + myDone(Standard_False), myHCurve2d(C2D), myC3d(C3D), mySurf(S) { - myC3d = C3D; - mySurf = S; - myHCurve2d = C2D; + + + Build(Tol); } @@ -657,7 +659,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D Projector.Initialize (*myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol); Standard_Integer count = 1; - Standard_Real previousp = theData.myC3dPF, initp=0, curp; + Standard_Real previousp = theData.myC3dPF, initp=0, curp = NAN; Standard_Real bornesup = theData.myC3dPL - myDeltaMin; Standard_Boolean isProjOk = Standard_False; for (Standard_Integer ii = 1; ii < theData.myNbPnt; ii++) @@ -813,7 +815,7 @@ Standard_Boolean Approx_SameParameter::Interpolate(const Approx_SameParameter_Da thePoles(ii) = theData.myPC2d[ii - 2]; aParameters(ii) = theFlatKnots(ii+2) = theData.myPC3d[ii - 2]; } - Standard_Integer inversion_problem; + Standard_Integer inversion_problem = 0; BSplCLib::Interpolate(3,theFlatKnots,aParameters,ContactOrder, 1,thePoles(1),inversion_problem); if(inversion_problem) @@ -842,7 +844,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea const Standard_Integer aDegree = 3; const Standard_Integer DerivativeRequest = 0; Standard_Integer extrap_mode[2] = {aDegree, aDegree}; - Standard_Real eval_result; + Standard_Real eval_result = NAN; Standard_Real *PolesArray = (Standard_Real *) &thePoles(thePoles.Lower()); Standard_Integer newcount = 0; for (Standard_Integer ii = 0; ii < theData.myNbPnt; ii++) diff --git a/src/Approx/Approx_SameParameter.hxx b/src/Approx/Approx_SameParameter.hxx index 257a019336..72e6f8dc82 100644 --- a/src/Approx/Approx_SameParameter.hxx +++ b/src/Approx/Approx_SameParameter.hxx @@ -186,7 +186,7 @@ private: Standard_Boolean mySameParameter; Standard_Boolean myDone; - Standard_Real myTolReached; + Standard_Real myTolReached{}; Handle(Geom2d_Curve) myCurve2d; Handle(Adaptor2d_Curve2d) myHCurve2d; Handle(Adaptor3d_Curve) myC3d; diff --git a/src/Approx/Approx_SweepApproximation.cxx b/src/Approx/Approx_SweepApproximation.cxx index 5e136d2fc9..0baa75efbe 100644 --- a/src/Approx/Approx_SweepApproximation.cxx +++ b/src/Approx/Approx_SweepApproximation.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,12 +39,12 @@ class Approx_SweepApproximation_Eval : public AdvApprox_EvaluatorFunction Approx_SweepApproximation_Eval (Approx_SweepApproximation& theTool) : Tool(theTool) {} - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Approx_SweepApproximation &Tool; @@ -60,14 +62,14 @@ void Approx_SweepApproximation_Eval::Evaluate (Standard_Integer *,/*Dimension*/ } Approx_SweepApproximation:: -Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func) +Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func) : myFunc(Func), myParam(0), myOrder(-1), first(1.e100), last(-1.e100), done(Standard_False) { - myFunc = Func; + // Init of variables of control - myParam = 0; - myOrder = -1; - first = 1.e100; last = -1.e100; - done = Standard_False; + + + + } void Approx_SweepApproximation::Perform(const Standard_Real First, @@ -80,8 +82,8 @@ void Approx_SweepApproximation::Perform(const Standard_Real First, const Standard_Integer Degmax, const Standard_Integer Segmax) { - Standard_Integer NbPolSect, NbKnotSect, ii; - Standard_Real Tol, Tol3dMin = Tol3d, The3D2DTol=0 ; + Standard_Integer NbPolSect = 0, NbKnotSect = 0, ii = 0; + Standard_Real Tol = NAN, Tol3dMin = Tol3d, The3D2DTol=0 ; GeomAbs_Shape continuity = Continuity; // (1) Characteristics of a section @@ -107,7 +109,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First, if (ThreeDTol->Value(ii) < Tol3dMin) Tol3dMin = ThreeDTol->Value(ii); if (myFunc->IsRational()) { - Standard_Real Size; + Standard_Real Size = NAN; Num1DSS = NbPolSect; TColStd_Array1OfReal Wmin(1, Num1DSS); myFunc->GetMinimalWeight(Wmin); @@ -129,7 +131,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First, else { // for 2d define affinity using resolutions, to // avoid homogenuous tolerance of approximation (u/v and 2d/3d) - Standard_Real res, tolu, tolv; + Standard_Real res = NAN, tolu = NAN, tolv = NAN; TwoDTol = new (TColStd_HArray1OfReal) (1, Num2DSS); AAffin = new (Approx_HArray1OfGTrsf2d) (1, Num2DSS); The3D2DTol= 0.9*BoundTol; // 10% of security @@ -175,7 +177,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First, // Checks if myFunc->D2 is implemented if (continuity >= GeomAbs_C2) { - Standard_Boolean B; + Standard_Boolean B = 0; B = myFunc->D2(First, First, Last, myPoles->ChangeArray1(), myDPoles->ChangeArray1(), myD2Poles->ChangeArray1(), @@ -187,7 +189,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First, } // Checks if myFunc->D1 is implemented if (continuity == GeomAbs_C1) { - Standard_Boolean B; + Standard_Boolean B = 0; B = myFunc->D1(First, First, Last, myPoles->ChangeArray1(), myDPoles->ChangeArray1(), myPoles2d->ChangeArray1(), myDPoles2d->ChangeArray1(), @@ -267,7 +269,7 @@ Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol, if (done) { // --> Fill Champs of the surface ---- - Standard_Integer ii, jj; + Standard_Integer ii = 0, jj = 0; vdeg = Approx.Degree(); // Unfortunately Adv_Approx stores the transposition of the required @@ -279,7 +281,7 @@ Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol, (1, Num3DSS, 1, Approx.NbPoles()); if (Num1DSS == Num3DSS) { - Standard_Real wpoid; + Standard_Real wpoid = NAN; gp_Pnt P; for (ii=1; ii <=Num3DSS; ii++) { for (jj=1; jj <=Approx.NbPoles() ; jj++) { @@ -384,7 +386,7 @@ Standard_Boolean Approx_SweepApproximation::D0(const Standard_Real Param, const Standard_Real Last, Standard_Real& Result) { - Standard_Integer index, ii; + Standard_Integer index = 0, ii = 0; Standard_Boolean Ok=Standard_True; Standard_Real * LocalResult = &Result; @@ -448,7 +450,7 @@ Standard_Boolean Approx_SweepApproximation::D1(const Standard_Real Param, { gp_XY Vcoord; gp_Vec Vaux; - Standard_Integer index, ii; + Standard_Integer index = 0, ii = 0; Standard_Boolean Ok=Standard_True; Standard_Real * LocalResult = &Result; @@ -525,7 +527,7 @@ Standard_Boolean Approx_SweepApproximation::D2(const Standard_Real Param, { gp_XY Vcoord; gp_Vec Vaux; - Standard_Integer index, ii; + Standard_Integer index = 0, ii = 0; Standard_Boolean Ok=Standard_True; Standard_Real * LocalResult = &Result; @@ -642,8 +644,8 @@ Surface(TColgp_Array2OfPnt& TPoles, Standard_Real Approx_SweepApproximation::MaxErrorOnSurf() const { - Standard_Integer ii; - Standard_Real MaxError = 0, err; + Standard_Integer ii = 0; + Standard_Real MaxError = 0, err = NAN; if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");} if (myFunc->IsRational()) { @@ -666,8 +668,8 @@ Standard_Real Approx_SweepApproximation::MaxErrorOnSurf() const Standard_Real Approx_SweepApproximation::AverageErrorOnSurf() const { - Standard_Integer ii; - Standard_Real MoyError = 0, err; + Standard_Integer ii = 0; + Standard_Real MoyError = 0, err = NAN; if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");} if (myFunc->IsRational()) { diff --git a/src/Approx/Approx_SweepApproximation.hxx b/src/Approx/Approx_SweepApproximation.hxx index bc37483456..63b6fd59ab 100644 --- a/src/Approx/Approx_SweepApproximation.hxx +++ b/src/Approx/Approx_SweepApproximation.hxx @@ -164,12 +164,12 @@ private: Handle(Approx_SweepFunction) myFunc; Standard_Boolean done; - Standard_Integer Num1DSS; - Standard_Integer Num2DSS; - Standard_Integer Num3DSS; - Standard_Integer udeg; - Standard_Integer vdeg; - Standard_Integer deg2d; + Standard_Integer Num1DSS{}; + Standard_Integer Num2DSS{}; + Standard_Integer Num3DSS{}; + Standard_Integer udeg{}; + Standard_Integer vdeg{}; + Standard_Integer deg2d{}; Handle(TColgp_HArray2OfPnt) tabPoles; Handle(TColStd_HArray2OfReal) tabWeights; Handle(TColStd_HArray1OfReal) tabUKnots; diff --git a/src/ApproxInt/ApproxInt_KnotTools.cxx b/src/ApproxInt/ApproxInt_KnotTools.cxx index d7acaf76d5..ea13582f6d 100644 --- a/src/ApproxInt/ApproxInt_KnotTools.cxx +++ b/src/ApproxInt/ApproxInt_KnotTools.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -45,8 +47,8 @@ static Standard_Real EvalCurv(const Standard_Real dim, // V1^V2 is outer product of two vectors: // P(i,j) = V1(i)*V2(j) - V1(j)*V2(i); Standard_Real mp = 0.; - Standard_Integer i, j; - Standard_Real p; + Standard_Integer i = 0, j = 0; + Standard_Real p = NAN; for(i = 1; i < dim; ++i) { for(j = 0; j < i; ++j) @@ -100,7 +102,7 @@ void ApproxInt_KnotTools::BuildCurvature( { // Arrays are allocated for max theDim = 7: 1 3d curve + 2 2d curves. Standard_Real Val[21], Par[3], Res[21]; - Standard_Integer i, j, m, ic; + Standard_Integer i = 0, j = 0, m = 0, ic = 0; Standard_Integer dim = theDim; // theMaxCurv = 0.; @@ -189,7 +191,7 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray V1(theDim), V2(theDim); Standard_Real mp = 0., m1 = 0., m2 = 0.; - Standard_Real p; + Standard_Real p = NAN; for(Standard_Integer k = 0; k < theDim; ++k) { V1[k] = theCoords[icm + k] - theCoords[ici + k]; @@ -482,7 +484,7 @@ Standard_Boolean ApproxInt_KnotTools::InsKnotBefI(const Standard_Integer theI, } // Standard_Real curv = 0.5*(theCurv(anInd) + theCurv(anInd1)); - Standard_Integer mid = 0, j, jj; + Standard_Integer mid = 0, j = 0, jj = 0; const Standard_Real aLimitCurvatureChange = 3.0; for(j = anInd+1; j < anInd1; ++j) { @@ -532,9 +534,9 @@ Standard_Boolean ApproxInt_KnotTools::InsKnotBefI(const Standard_Integer theI, ici1 = (anInd1 - theCurv.Lower()) * theDim, icm = (mid - theCurv.Lower()) * theDim; NCollection_LocalArray V1(theDim), V2(theDim); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real mp = 0., m1 = 0., m2 = 0.; - Standard_Real p; + Standard_Real p = NAN; for(i = 0; i < theDim; ++i) { V1[i] = theCoords[icm + i] - theCoords[ici + i]; @@ -596,7 +598,7 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ, aDim += 2; NCollection_LocalArray aCoords(thePars.Length()*aDim); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for(i = thePars.Lower(); i <= thePars.Upper(); ++i) { j = (i - thePars.Lower()) * aDim; @@ -654,7 +656,7 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ, //======================================================================= static Standard_Real MaxParamRatio(const math_Vector& thePars) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Real aMaxRatio = 0.; // for (i = thePars.Lower() + 1; i < thePars.Upper(); ++i) @@ -694,7 +696,7 @@ Approx_ParametrizationType ApproxInt_KnotTools::DefineParType( TColgp_Array1OfPnt2d aPntU1V1(theFpar, theLpar); TColgp_Array1OfPnt2d aPntU2V2(theFpar, theLpar); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for (i = theFpar; i <= theLpar; ++i) { diff --git a/src/Aspect/Aspect_Background.cxx b/src/Aspect/Aspect_Background.cxx index 88739b2efc..af66ff5e3c 100644 --- a/src/Aspect/Aspect_Background.cxx +++ b/src/Aspect/Aspect_Background.cxx @@ -40,9 +40,9 @@ Quantity_Color MatraGray (Quantity_NOC_MATRAGRAY); } -Aspect_Background::Aspect_Background (const Quantity_Color& AColor) { +Aspect_Background::Aspect_Background (const Quantity_Color& AColor) : MyColor(AColor) { - MyColor = AColor; + } diff --git a/src/Aspect/Aspect_CircularGrid.cxx b/src/Aspect/Aspect_CircularGrid.cxx index 400fdeaac0..efa491cfee 100644 --- a/src/Aspect/Aspect_CircularGrid.cxx +++ b/src/Aspect/Aspect_CircularGrid.cxx @@ -80,7 +80,7 @@ void Aspect_CircularGrid::Compute(const Standard_Real X, Standard_Real cs=0,sn=0; Standard_Boolean done = Standard_False; Standard_Integer nmax = 2*myDivisionNumber; - Standard_Integer nquad,qmax; + Standard_Integer nquad = 0,qmax = 0; if( ra == 0. ) { nquad = 4; qmax = nmax/nquad; diff --git a/src/Aspect/Aspect_CircularGrid.hxx b/src/Aspect/Aspect_CircularGrid.hxx index f507b6a5cc..a91d2a17e2 100644 --- a/src/Aspect/Aspect_CircularGrid.hxx +++ b/src/Aspect/Aspect_CircularGrid.hxx @@ -56,9 +56,9 @@ private: Standard_Real myRadiusStep; Standard_Integer myDivisionNumber; - Standard_Real myAlpha; - Standard_Real myA1; - Standard_Real myB1; + Standard_Real myAlpha{}; + Standard_Real myA1{}; + Standard_Real myB1{}; }; diff --git a/src/Aspect/Aspect_DisplayConnection.cxx b/src/Aspect/Aspect_DisplayConnection.cxx old mode 100755 new mode 100644 index 288c067546..cd2b29b413 --- a/src/Aspect/Aspect_DisplayConnection.cxx +++ b/src/Aspect/Aspect_DisplayConnection.cxx @@ -27,13 +27,13 @@ IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection,Standard_Transient) // function : Aspect_DisplayConnection // purpose : // ======================================================================= -Aspect_DisplayConnection::Aspect_DisplayConnection() +Aspect_DisplayConnection::Aspect_DisplayConnection() : myDisplay(NULL), myDefVisualInfo(NULL), myDefFBConfig(NULL), myIsOwnDisplay(false) { #if defined(HAVE_XLIB) - myDisplay = NULL; - myDefVisualInfo = NULL; - myDefFBConfig = NULL; - myIsOwnDisplay = false; + + + + OSD_Environment anEnv ("DISPLAY"); myDisplayName = anEnv.Value(); Init (NULL); @@ -67,9 +67,9 @@ Aspect_DisplayConnection::Aspect_DisplayConnection (const TCollection_AsciiStrin : myDisplay (NULL), myDefVisualInfo (NULL), myDefFBConfig (NULL), - myIsOwnDisplay (false) + myDisplayName(theDisplayName), myIsOwnDisplay (false) { - myDisplayName = theDisplayName; + Init (NULL); } diff --git a/src/Aspect/Aspect_GradientBackground.cxx b/src/Aspect/Aspect_GradientBackground.cxx index ae3a2754c9..cea8126ca2 100644 --- a/src/Aspect/Aspect_GradientBackground.cxx +++ b/src/Aspect/Aspect_GradientBackground.cxx @@ -16,23 +16,23 @@ #include -Aspect_GradientBackground::Aspect_GradientBackground () { +Aspect_GradientBackground::Aspect_GradientBackground () : MyGradientMethod(Aspect_GradientFillMethod_None) { Quantity_Color Black (Quantity_NOC_BLACK); SetColor( Black ); MyColor2 = Black; - MyGradientMethod = Aspect_GradientFillMethod_None; + } Aspect_GradientBackground::Aspect_GradientBackground( const Quantity_Color& AColor1, const Quantity_Color& AColor2, - const Aspect_GradientFillMethod AMethod ) + const Aspect_GradientFillMethod AMethod ) : MyColor2(AColor2), MyGradientMethod(AMethod) { SetColor( AColor1 ); - MyColor2 = AColor2; - MyGradientMethod = AMethod; + + } diff --git a/src/Aspect/Aspect_RectangularGrid.hxx b/src/Aspect/Aspect_RectangularGrid.hxx index 870b1368a2..48545d3a0a 100644 --- a/src/Aspect/Aspect_RectangularGrid.hxx +++ b/src/Aspect/Aspect_RectangularGrid.hxx @@ -75,12 +75,12 @@ private: Standard_Real myYStep; Standard_Real myFirstAngle; Standard_Real mySecondAngle; - Standard_Real a1; - Standard_Real b1; - Standard_Real c1; - Standard_Real a2; - Standard_Real b2; - Standard_Real c2; + Standard_Real a1{}; + Standard_Real b1{}; + Standard_Real c1{}; + Standard_Real a2{}; + Standard_Real b2{}; + Standard_Real c2{}; }; diff --git a/src/Aspect/Aspect_Window.hxx b/src/Aspect/Aspect_Window.hxx index a849aaea73..5faadf4e7c 100644 --- a/src/Aspect/Aspect_Window.hxx +++ b/src/Aspect/Aspect_Window.hxx @@ -170,7 +170,7 @@ protected: Aspect_Background MyBackground; Aspect_GradientBackground MyGradientBackground; Aspect_FillMethod MyBackgroundFillMethod; - Standard_Boolean MyIsVirtual; + Standard_Boolean MyIsVirtual{}; }; diff --git a/src/Aspect/Aspect_WindowInputListener.hxx b/src/Aspect/Aspect_WindowInputListener.hxx index d4b5e1128a..720868e6d3 100644 --- a/src/Aspect/Aspect_WindowInputListener.hxx +++ b/src/Aspect/Aspect_WindowInputListener.hxx @@ -260,7 +260,7 @@ protected: protected: //! @name 3d mouse input variables - bool my3dMouseButtonState[32];//!< cached button state + bool my3dMouseButtonState[32]{};//!< cached button state NCollection_Vec3 my3dMouseNoRotate; //!< ignore 3d mouse rotation axes NCollection_Vec3 my3dMouseToReverse; //!< reverse 3d mouse rotation axes float my3dMouseAccelTrans; //!< acceleration ratio for translation event diff --git a/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx b/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx index af16ada090..f382963860 100644 --- a/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx +++ b/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -345,7 +347,7 @@ void BOPAlgo_ArgumentAnalyzer::TestTypes() void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences(const Message_ProgressRange& theRange) { Message_ProgressScope aPS(theRange, NULL, (!myShape1.IsNull() && !myShape2.IsNull() ? 2 : 1)); - Standard_Integer ii; + Standard_Integer ii = 0; // for(ii = 0; ii < 2; ii++) { const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2; @@ -358,7 +360,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences(const Message_ProgressRange continue; } // - Standard_Integer n1, n2; + Standard_Integer n1 = 0, n2 = 0; BOPDS_MapIteratorOfMapOfPair aItMPK; TopTools_ListOfShape anArgs; BOPAlgo_CheckerSI aChecker; @@ -812,8 +814,8 @@ void BOPAlgo_ArgumentAnalyzer::TestMergeEdge() // ================================================================================ void BOPAlgo_ArgumentAnalyzer::TestContinuity() { - Standard_Integer i, j, aNbS; - Standard_Real f, l; + Standard_Integer i = 0, j = 0, aNbS = 0; + Standard_Real f = NAN, l = NAN; TopExp_Explorer aExp; // for (i = 0; i < 2; ++i) { @@ -869,8 +871,8 @@ void BOPAlgo_ArgumentAnalyzer::TestContinuity() // ================================================================================ void BOPAlgo_ArgumentAnalyzer::TestCurveOnSurface() { - Standard_Integer i; - Standard_Real aT, aD, aTolE; + Standard_Integer i = 0; + Standard_Real aT = NAN, aD = NAN, aTolE = NAN; TopExp_Explorer aExpF, aExpE; // for(i = 0; i < 2; i++) { diff --git a/src/BOPAlgo/BOPAlgo_BOP.cxx b/src/BOPAlgo/BOPAlgo_BOP.cxx index 39641f6869..de53e80d27 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP.cxx @@ -120,8 +120,8 @@ BOPAlgo_Operation BOPAlgo_BOP::Operation()const //======================================================================= void BOPAlgo_BOP::CheckData() { - Standard_Integer i, j, aNbArgs, aNbTools; - Standard_Boolean bFuse; + Standard_Integer i = 0, j = 0, aNbArgs = 0, aNbTools = 0; + Standard_Boolean bFuse = 0; TopTools_ListIteratorOfListOfShape aItLS; // if (!(myOperation==BOPAlgo_COMMON || @@ -178,7 +178,7 @@ void BOPAlgo_BOP::CheckData() continue; } - Standard_Integer iDMin, iDMax; + Standard_Integer iDMin = 0, iDMax = 0; BOPTools_AlgoTools::Dimensions(aS, iDMin, iDMax); if (iDMin < iDimMin[i]) @@ -355,7 +355,7 @@ void BOPAlgo_BOP::BuildResult(const TopAbs_ShapeEnum theType) void BOPAlgo_BOP::Perform(const Message_ProgressRange& theRange) { Handle(NCollection_BaseAllocator) aAllocator; - BOPAlgo_PaveFiller* pPF; + BOPAlgo_PaveFiller* pPF = nullptr; TopTools_ListIteratorOfListOfShape aItLS; // GetReport()->Clear(); @@ -585,8 +585,8 @@ void BOPAlgo_BOP::BuildRC(const Message_ProgressRange& theRange) } // B. Common, Cut, Cut21 // - Standard_Integer i, j, aNb, iDim; - Standard_Boolean bCheckEdges, bContains, bCut21, bCommon; + Standard_Integer i = 0, j = 0, aNb = 0, iDim = 0; + Standard_Boolean bCheckEdges = 0, bContains = 0, bCut21 = 0, bCommon = 0; TopTools_ListIteratorOfListOfShape aItLS; // // prepare the building elements of arguments to get its splits @@ -662,7 +662,7 @@ void BOPAlgo_BOP::BuildRC(const Message_ProgressRange& theRange) // // compare the maps and make the result // - Standard_Integer iDimMin, iDimMax; + Standard_Integer iDimMin = 0, iDimMax = 0; // iDimMin = Min(myDims[0], myDims[1]); bCommon = (myOperation == BOPAlgo_COMMON); @@ -755,7 +755,7 @@ void BOPAlgo_BOP::BuildRC(const Message_ProgressRange& theRange) return; } // The squats around degenerated edges - Standard_Integer nVD; + Standard_Integer nVD = 0; TopTools_IndexedMapOfShape aMVC; // // 1. Vertices of aC @@ -841,7 +841,7 @@ void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange) return; } // - Standard_Integer i; + Standard_Integer i = 0; TopAbs_ShapeEnum aType, aT1, aT2; TopTools_ListOfShape aLSC, aLCB; TopTools_ListIteratorOfListOfShape aItLS, aItLSIm, aItLCB; @@ -1044,7 +1044,7 @@ void BOPAlgo_BOP::BuildSolid(const Message_ProgressRange& theRange) // // Find solids in input arguments sharing faces with other solids TopTools_MapOfShape aMTSols; - Standard_Integer i, aNb = aMFS.Extent(); + Standard_Integer i = 0, aNb = aMFS.Extent(); for (i = 1; i < aNb; ++i) { const TopTools_ListOfShape& aLSols = aMFS(i); if (aLSols.Extent() > 1) { @@ -1505,7 +1505,7 @@ void RemoveDuplicates(TopTools_ListOfShape& theContainers, // compare the contents of the containers and find duplicates TopTools_MapOfShape aDuplicates; // - Standard_Integer i, j, aNb = aContents.Extent(); + Standard_Integer i = 0, j = 0, aNb = aContents.Extent(); for (i = 1; i <= aNb; ++i) { const TopoDS_Shape& aCi = aContents.FindKey(i); if (aDuplicates.Contains(aCi)) { diff --git a/src/BOPAlgo/BOPAlgo_BOP.hxx b/src/BOPAlgo/BOPAlgo_BOP.hxx index ea63fa5276..114119534d 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.hxx +++ b/src/BOPAlgo/BOPAlgo_BOP.hxx @@ -125,7 +125,7 @@ protected: protected: BOPAlgo_Operation myOperation; - Standard_Integer myDims[2]; + Standard_Integer myDims[2]{}; TopoDS_Shape myRC; }; diff --git a/src/BOPAlgo/BOPAlgo_Builder.cxx b/src/BOPAlgo/BOPAlgo_Builder.cxx index d4c080e419..748ac01ecf 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder.cxx @@ -452,7 +452,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, cons //======================================================================= void BOPAlgo_Builder::PostTreat(const Message_ProgressRange& theRange) { - Standard_Integer i, aNbS; + Standard_Integer i = 0, aNbS = 0; TopAbs_ShapeEnum aType; TopTools_IndexedMapOfShape aMA; if (myPaveFiller->NonDestructive()) { diff --git a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx index 2154b04c30..82e06ab6ad 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx @@ -16,6 +16,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -66,9 +68,9 @@ static //======================================================================= BOPAlgo_BuilderFace::BOPAlgo_BuilderFace() : - BOPAlgo_BuilderArea() + BOPAlgo_BuilderArea(), myOrientation(TopAbs_EXTERNAL) { - myOrientation=TopAbs_EXTERNAL; + } //======================================================================= //function : @@ -77,9 +79,9 @@ BOPAlgo_BuilderFace::BOPAlgo_BuilderFace() BOPAlgo_BuilderFace::BOPAlgo_BuilderFace (const Handle(NCollection_BaseAllocator)& theAllocator) : - BOPAlgo_BuilderArea(theAllocator) + BOPAlgo_BuilderArea(theAllocator), myOrientation(TopAbs_EXTERNAL) { - myOrientation=TopAbs_EXTERNAL; + } //======================================================================= //function : ~ @@ -166,8 +168,8 @@ void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& theRange) //======================================================================= void BOPAlgo_BuilderFace::PerformShapesToAvoid(const Message_ProgressRange& theRange) { - Standard_Boolean bFound; - Standard_Integer i, iCnt, aNbV, aNbE; + Standard_Boolean bFound = 0; + Standard_Integer i = 0, iCnt = 0, aNbV = 0, aNbE = 0; TopTools_IndexedDataMapOfShapeListOfShape aMVE; TopTools_ListIteratorOfListOfShape aIt; // @@ -244,8 +246,8 @@ void BOPAlgo_BuilderFace::PerformShapesToAvoid(const Message_ProgressRange& theR //======================================================================= void BOPAlgo_BuilderFace::PerformLoops(const Message_ProgressRange& theRange) { - Standard_Boolean bFlag; - Standard_Integer i, aNbEA; + Standard_Boolean bFlag = 0; + Standard_Integer i = 0, aNbEA = 0; TopTools_ListIteratorOfListOfShape aIt; TopTools_IndexedDataMapOfShapeListOfShape aVEMap; TopTools_MapOfOrientedShape aMAdded; @@ -456,7 +458,7 @@ void BOPAlgo_BuilderFace::PerformAreas(const Message_ProgressRange& theRange) // Prepare tree with the boxes of the hole faces BOPTools_Box2dTree aBoxTree; - Standard_Integer i, aNbH = aHoleFaces.Extent(); + Standard_Integer i = 0, aNbH = aHoleFaces.Extent(); aBoxTree.SetSize (aNbH); for (i = 1; i <= aNbH; ++i) { @@ -746,7 +748,7 @@ void BOPAlgo_BuilderFace::PerformInternalShapes(const Message_ProgressRange& the void MakeInternalWires(const TopTools_IndexedMapOfShape& theME, TopTools_ListOfShape& theWires) { - Standard_Integer i, aNbE; + Standard_Integer i = 0, aNbE = 0; TopTools_MapOfShape aAddedMap; TopTools_ListIteratorOfListOfShape aItE; TopTools_IndexedDataMapOfShapeListOfShape aMVE; @@ -828,7 +830,7 @@ Standard_Boolean IsInside(const TopoDS_Shape& theWire, return isInside; // Get 2d curve of the edge on the face - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; const Handle(Geom2d_Curve)& aC2D = BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2); if (aC2D.IsNull()) continue; diff --git a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx index 05db2286c5..7fd69339eb 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx @@ -141,8 +141,8 @@ void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange) //======================================================================= void BOPAlgo_BuilderSolid::PerformShapesToAvoid(const Message_ProgressRange& theRange) { - Standard_Boolean bFound; - Standard_Integer i, iCnt, aNbE, aNbF; + Standard_Boolean bFound = 0; + Standard_Integer i = 0, iCnt = 0, aNbE = 0, aNbF = 0; TopAbs_Orientation aOrE; TopTools_IndexedDataMapOfShapeListOfShape aMEF; TopTools_ListIteratorOfListOfShape aIt; @@ -226,7 +226,7 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid(const Message_ProgressRange& the //======================================================================= void BOPAlgo_BuilderSolid::PerformLoops(const Message_ProgressRange& theRange) { - Standard_Integer i, aNbSh; + Standard_Integer i = 0, aNbSh = 0; TopTools_ListIteratorOfListOfShape aIt; TopoDS_Iterator aItS; Handle(NCollection_BaseAllocator) aAlr; @@ -446,7 +446,7 @@ void BOPAlgo_BuilderSolid::PerformAreas(const Message_ProgressRange& theRange) // Prepare tree with the boxes of the hole shells BOPTools_BoxTree aBBTree; - Standard_Integer i, aNbH = aHoleShells.Extent(); + Standard_Integer i = 0, aNbH = aHoleShells.Extent(); aBBTree.SetSize (aNbH); for (i = 1; i <= aNbH; ++i) { @@ -632,7 +632,7 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes(const Message_ProgressRange& th // Prepare list of faces to classify TopTools_ListOfShape aLFaces; - Standard_Integer i, aNbF = aMFs.Extent(); + Standard_Integer i = 0, aNbF = aMFs.Extent(); for (i = 1; i <= aNbF; ++i) aLFaces.Append(aMFs(i)); @@ -725,7 +725,7 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes(const Message_ProgressRange& th void MakeInternalShells(const TopTools_IndexedMapOfShape& theMF, TopTools_ListOfShape& theShells) { - Standard_Integer i, aNbF; + Standard_Integer i = 0, aNbF = 0; BRep_Builder aBB; TopTools_ListIteratorOfListOfShape aItF; TopTools_IndexedDataMapOfShapeListOfShape aMEF; @@ -733,7 +733,7 @@ void MakeInternalShells(const TopTools_IndexedMapOfShape& theMF, // aNbF = theMF.Extent(); for (i = 1; i <= aNbF; ++i) { - TopoDS_Shape aF = theMF(i); + const TopoDS_Shape& aF = theMF(i); TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF); diff --git a/src/BOPAlgo/BOPAlgo_Builder_1.cxx b/src/BOPAlgo/BOPAlgo_Builder_1.cxx index df89fac43a..381f98aba0 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_1.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_1.cxx @@ -69,7 +69,7 @@ void BOPAlgo_Builder::FillImagesVertices(const Message_ProgressRange& theRange) //======================================================================= void BOPAlgo_Builder::FillImagesEdges(const Message_ProgressRange& theRange) { - Standard_Integer i, aNbS = myDS->NbSourceShapes(); + Standard_Integer i = 0, aNbS = myDS->NbSourceShapes(); Message_ProgressScope aPS(theRange, "Filling splits of edges", aNbS); for (i = 0; i < aNbS; ++i, aPS.Next()) { const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i); @@ -160,7 +160,7 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType) //======================================================================= void BOPAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType, const Message_ProgressRange& theRange) { - Standard_Integer i, aNbS; + Standard_Integer i = 0, aNbS = 0; TopTools_MapOfShape aMFP(100, myAllocator); // aNbS=myDS->NbSourceShapes(); @@ -183,7 +183,7 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType) //======================================================================= void BOPAlgo_Builder::FillImagesCompounds(const Message_ProgressRange& theRange) { - Standard_Integer i, aNbS; + Standard_Integer i = 0, aNbS = 0; TopTools_MapOfShape aMFP(100, myAllocator); // aNbS=myDS->NbSourceShapes(); @@ -266,7 +266,7 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType) void BOPAlgo_Builder::FillImagesCompound(const TopoDS_Shape& theS, TopTools_MapOfShape& theMFP) { - Standard_Boolean bInterferred; + Standard_Boolean bInterferred = 0; TopAbs_Orientation aOrX; TopoDS_Iterator aIt; BRep_Builder aBB; diff --git a/src/BOPAlgo/BOPAlgo_Builder_2.cxx b/src/BOPAlgo/BOPAlgo_Builder_2.cxx index f2ebfef171..2cd27184e2 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_2.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_2.cxx @@ -16,6 +16,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -72,7 +74,7 @@ class BOPAlgo_PairOfShapeBoolean : public BOPAlgo_ParallelAlgo { myFlag(Standard_False) { } // - virtual ~BOPAlgo_PairOfShapeBoolean() { + ~BOPAlgo_PairOfShapeBoolean() override { } // TopoDS_Shape& Shape1() { @@ -95,7 +97,7 @@ class BOPAlgo_PairOfShapeBoolean : public BOPAlgo_ParallelAlgo { return myContext; } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -142,7 +144,7 @@ public: private: //! Disable the range enabled method - virtual void Perform(const Message_ProgressRange& /*theRange*/) {}; + void Perform(const Message_ProgressRange& /*theRange*/) override {}; private: Message_ProgressRange myRange; @@ -163,7 +165,7 @@ class BOPAlgo_VFI : public BOPAlgo_ParallelAlgo { myIsInternal(Standard_False) { } // - virtual ~BOPAlgo_VFI(){ + ~BOPAlgo_VFI() override{ } // void SetVertex(const TopoDS_Vertex& aV) { @@ -194,14 +196,14 @@ class BOPAlgo_VFI : public BOPAlgo_ParallelAlgo { return myContext; } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { return; } - Standard_Real aT1, aT2, dummy; + Standard_Real aT1 = NAN, aT2 = NAN, dummy = NAN; // Standard_Integer iFlag = myContext->ComputeVF(myV, myF, aT1, aT2, dummy, myFuzzyValue); @@ -242,8 +244,8 @@ void BOPAlgo_Builder::FillImagesFaces(const Message_ProgressRange& theRange) //======================================================================= void BOPAlgo_Builder::BuildSplitFaces(const Message_ProgressRange& theRange) { - Standard_Boolean bHasFaceInfo, bIsClosed, bIsDegenerated, bToReverse; - Standard_Integer i, j, k, aNbS, aNbPBIn, aNbPBOn, aNbPBSc, aNbAV, nSp; + Standard_Boolean bHasFaceInfo = 0, bIsClosed = 0, bIsDegenerated = 0, bToReverse = 0; + Standard_Integer i = 0, j = 0, k = 0, aNbS = 0, aNbPBIn = 0, aNbPBOn = 0, aNbPBSc = 0, aNbAV = 0, nSp = 0; TopoDS_Face aFF, aFSD; TopoDS_Edge aSp, aEE; TopAbs_Orientation anOriF, anOriE; diff --git a/src/BOPAlgo/BOPAlgo_Builder_3.cxx b/src/BOPAlgo/BOPAlgo_Builder_3.cxx index 390b762625..e5944afcdc 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_3.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_3.cxx @@ -116,7 +116,7 @@ void BOPAlgo_Builder::FillIn3DParts(TopTools_DataMapOfShapeShape& theDraftSolids // Get all faces TopTools_ListOfShape aLFaces(anAlloc); - Standard_Integer i, aNbS = myDS->NbSourceShapes(); + Standard_Integer i = 0, aNbS = myDS->NbSourceShapes(); for (i = 0; i < aNbS; ++i) { const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i); @@ -248,8 +248,8 @@ void BOPAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid, TopoDS_Shape& theDraftSolid, TopTools_ListOfShape& theLIF) { - Standard_Boolean bToReverse; - Standard_Integer iFlag; + Standard_Boolean bToReverse = 0; + Standard_Integer iFlag = 0; TopAbs_Orientation aOrF, aOrSh, aOrSd; TopoDS_Iterator aIt1, aIt2; TopoDS_Shell aShD; @@ -365,7 +365,7 @@ public: private: //! Disable the range enabled method - virtual void Perform(const Message_ProgressRange&/* theRange*/) {} + void Perform(const Message_ProgressRange&/* theRange*/) override {} private: TopoDS_Solid mySolid; //!< Solid to split @@ -382,8 +382,8 @@ typedef NCollection_Vector BOPAlgo_VectorOfBuilderSolid; void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSolids, const Message_ProgressRange& theRange) { - Standard_Boolean bFlagSD; - Standard_Integer i, aNbS; + Standard_Boolean bFlagSD = 0; + Standard_Integer i = 0, aNbS = 0; TopExp_Explorer aExp; TopTools_ListIteratorOfListOfShape aIt; // @@ -473,7 +473,7 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol aBS.SetRunParallel(myRunParallel); }//for (i=0; i map // - Standard_Integer i, aNbS = myIndex.Extent(); + Standard_Integer i = 0, aNbS = myIndex.Extent(); for (i = 1; i <= aNbS; ++i) { const TopoDS_Shape& aSP = myIndex.FindKey(i); const TopTools_ListOfShape& aLSOr = myIndex(i); @@ -780,7 +780,7 @@ Standard_Boolean BOPAlgo_CellsBuilder::RemoveInternals(const TopTools_ListOfShap } // // Unify same domain - Standard_Boolean bFaces, bEdges; + Standard_Boolean bFaces = 0, bEdges = 0; // bFaces = (aType == TopAbs_FACE); bEdges = (aType == TopAbs_EDGE); @@ -808,7 +808,7 @@ Standard_Boolean BOPAlgo_CellsBuilder::RemoveInternals(const TopTools_ListOfShap // // fill map of modified shapes TopTools_IndexedMapOfShape aMG; - Standard_Integer i, aNb; + Standard_Integer i = 0, aNb = 0; // TopExp::MapShapes(aShape, TopAbs_VERTEX, aMG); TopExp::MapShapes(aShape, TopAbs_EDGE, aMG); @@ -881,7 +881,7 @@ Standard_Boolean BOPAlgo_CellsBuilder::RemoveInternals(const TopTools_ListOfShap // // to build unified solid, select only faces attached to only one solid TopTools_ListOfShape aLFUnique; - Standard_Integer i, aNb = aDMFS.Extent(); + Standard_Integer i = 0, aNb = aDMFS.Extent(); for (i = 1; i <= aNb; ++i) { if (aDMFS(i).Extent() == 1) { aLFUnique.Append(aDMFS.FindKey(i)); diff --git a/src/BOPAlgo/BOPAlgo_CheckerSI.cxx b/src/BOPAlgo/BOPAlgo_CheckerSI.cxx index 0f7db656d1..ef301df84d 100644 --- a/src/BOPAlgo/BOPAlgo_CheckerSI.cxx +++ b/src/BOPAlgo/BOPAlgo_CheckerSI.cxx @@ -57,7 +57,7 @@ class BOPAlgo_FaceSelfIntersect : myIF(-1), myTolF(1.e-7) { } // - virtual ~BOPAlgo_FaceSelfIntersect() { + ~BOPAlgo_FaceSelfIntersect() override { } // void SetIndex(const Standard_Integer nF) { @@ -84,7 +84,7 @@ class BOPAlgo_FaceSelfIntersect : return myTolF; } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -110,9 +110,9 @@ typedef NCollection_Vector BOPAlgo_VectorOfFaceSelfIn //======================================================================= BOPAlgo_CheckerSI::BOPAlgo_CheckerSI() : - BOPAlgo_PaveFiller() + BOPAlgo_PaveFiller(), myLevelOfCheck(BOPDS_DS::NbInterfTypes()-1) { - myLevelOfCheck=BOPDS_DS::NbInterfTypes()-1; + myNonDestructive=Standard_True; SetAvoidBuildPCurve(Standard_True); } @@ -129,7 +129,7 @@ BOPAlgo_CheckerSI::~BOPAlgo_CheckerSI() //======================================================================= void BOPAlgo_CheckerSI::SetLevelOfCheck(const Standard_Integer theLevel) { - Standard_Integer aNbLists; + Standard_Integer aNbLists = 0; // aNbLists=BOPDS_DS::NbInterfTypes(); if (theLevel >= 0 && theLevel < aNbLists) { @@ -215,7 +215,7 @@ void BOPAlgo_CheckerSI::Perform(const Message_ProgressRange& theRange) //======================================================================= void BOPAlgo_CheckerSI::PostTreat() { - Standard_Integer i, aNb, n1, n2; + Standard_Integer i = 0, aNb = 0, n1 = 0, n2 = 0; BOPDS_Pair aPK; // BOPDS_MapOfPair& aMPK= @@ -293,8 +293,8 @@ void BOPAlgo_CheckerSI::PostTreat() BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF(); aNb=aFFs.Length(); for (i=0; i!=aNb; ++i) { - Standard_Boolean bTangentFaces, bFlag; - Standard_Integer aNbC, aNbP, j, iFound; + Standard_Boolean bTangentFaces = 0, bFlag = 0; + Standard_Integer aNbC = 0, aNbP = 0, j = 0, iFound = 0; // const BOPDS_InterfFF& aFF=aFFs(i); aFF.Indices(n1, n2); diff --git a/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx b/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx index a033ba6101..27c1a02354 100644 --- a/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx +++ b/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx @@ -15,6 +15,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -103,7 +105,7 @@ class BOPAlgo_VertexSolid { return; } - Standard_Real aTol; + Standard_Real aTol = NAN; gp_Pnt aPV; // BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(myZ); @@ -179,7 +181,7 @@ class BOPAlgo_ShapeSolid { return; } - Standard_Boolean bHasInterf; + Standard_Boolean bHasInterf = 0; // myHasInterf=Standard_False; // @@ -212,17 +214,17 @@ class BOPAlgo_SolidSolid : public BOPAlgo_ShapeSolid { BOPAlgo_ShapeSolid() { }; // - virtual ~BOPAlgo_SolidSolid(){ + ~BOPAlgo_SolidSolid() override{ }; // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (!aPS.More()) { return; } - Standard_Boolean bFlag; + Standard_Boolean bFlag = 0; // bFlag=Standard_False; myHasInterf=Standard_False; @@ -244,7 +246,7 @@ void BOPAlgo_CheckerSI::PerformVZ(const Message_ProgressRange& theRange) { Message_ProgressScope aPSOuter(theRange, NULL, 1); - Standard_Integer iSize, nV, nZ, k, aNbVVS; + Standard_Integer iSize = 0, nV = 0, nZ = 0, k = 0, aNbVVS = 0; TopAbs_State aState; BOPDS_MapOfPair aMPK; // @@ -339,8 +341,8 @@ void BOPAlgo_CheckerSI::PerformZZ(const Message_ProgressRange& theRange) { Message_ProgressScope aPSOuter(theRange, NULL, 1); - Standard_Boolean bHasInterf; - Standard_Integer iSize, nZ1, nZ, k, aNbSolidSolid; + Standard_Boolean bHasInterf = 0; + Standard_Integer iSize = 0, nZ1 = 0, nZ = 0, k = 0, aNbSolidSolid = 0; // myIterator->Initialize(TopAbs_SOLID, TopAbs_SOLID); iSize=myIterator->ExpectedLength(); @@ -398,8 +400,8 @@ void BOPAlgo_CheckerSI::PerformSZ(const TopAbs_ShapeEnum theTS, const Message_Pr { Message_ProgressScope aPSOuter(theRange, NULL, 1); - Standard_Boolean bHasInterf; - Standard_Integer iSize, nS, nZ, k, aNbShapeSolid; + Standard_Boolean bHasInterf = 0; + Standard_Integer iSize = 0, nS = 0, nZ = 0, k = 0, aNbShapeSolid = 0; // myIterator->Initialize(theTS, TopAbs_SOLID); iSize=myIterator->ExpectedLength(); diff --git a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx index 58e480dc28..58106ddbaf 100644 --- a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx +++ b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -211,7 +213,7 @@ void BOPAlgo_MakerVolume::fillPISteps(BOPAlgo_PISteps& theSteps) const void BOPAlgo_MakerVolume::CollectFaces() { // - Standard_Integer i, aNbShapes; + Standard_Integer i = 0, aNbShapes = 0; TopTools_ListIteratorOfListOfShape aIt; TopTools_MapOfShape aMFence; // @@ -249,7 +251,7 @@ void BOPAlgo_MakerVolume::CollectFaces() void BOPAlgo_MakerVolume::MakeBox(TopTools_MapOfShape& theBoxFaces) { // - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN, anExt = NAN; // anExt = sqrt(myBBox.SquareExtent()) * 0.5; myBBox.Enlarge(anExt); @@ -302,7 +304,7 @@ void BOPAlgo_MakerVolume::RemoveBox(TopTools_ListOfShape& theLSR, // TopTools_ListIteratorOfListOfShape aIt; TopExp_Explorer aExp; - Standard_Boolean bFound; + Standard_Boolean bFound = 0; // bFound = Standard_False; aIt.Initialize(theLSR); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx index be31c116d8..672e9ce046 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx @@ -58,14 +58,14 @@ namespace //======================================================================= BOPAlgo_PaveFiller::BOPAlgo_PaveFiller() : - BOPAlgo_Algo() + BOPAlgo_Algo(), myDS(NULL), myIterator(NULL), myNonDestructive(Standard_False), myIsPrimary(Standard_True), myAvoidBuildPCurve(Standard_False), myGlue(BOPAlgo_GlueOff) { - myDS = NULL; - myIterator = NULL; - myNonDestructive = Standard_False; - myIsPrimary = Standard_True; - myAvoidBuildPCurve = Standard_False; - myGlue = BOPAlgo_GlueOff; + + + + + + } //======================================================================= //function : @@ -75,17 +75,17 @@ BOPAlgo_PaveFiller::BOPAlgo_PaveFiller (const Handle (NCollection_BaseAllocator)& theAllocator) : BOPAlgo_Algo (theAllocator), - myFPBDone (1, theAllocator), + myDS(NULL), myIterator(NULL), myNonDestructive(Standard_False), myIsPrimary(Standard_True), myAvoidBuildPCurve(Standard_False), myGlue(BOPAlgo_GlueOff), myFPBDone (1, theAllocator), myIncreasedSS (1, theAllocator), myVertsToAvoidExtension (1, theAllocator), myDistances (1, theAllocator) { - myDS = NULL; - myIterator = NULL; - myNonDestructive = Standard_False; - myIsPrimary = Standard_True; - myAvoidBuildPCurve = Standard_False; - myGlue = BOPAlgo_GlueOff; + + + + + + } //======================================================================= //function : ~ @@ -387,7 +387,7 @@ void BOPAlgo_PaveFiller::RepeatIntersection (const Message_ProgressRange& theRan } // Check if the vertex created a new vertex with greater tolerance - Standard_Integer nVSD; + Standard_Integer nVSD = 0; if (!myDS->HasShapeSD (i, nVSD)) continue; diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx index 9435f46ec6..156af606c3 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx @@ -44,7 +44,7 @@ //======================================================================= void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange) { - Standard_Integer n1, n2, iFlag, aSize; + Standard_Integer n1 = 0, n2 = 0, iFlag = 0, aSize = 0; Handle(NCollection_BaseAllocator) aAllocator; // myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX); @@ -140,7 +140,7 @@ Standard_Integer BOPAlgo_PaveFiller::MakeSDVertices TColStd_ListIteratorOfListOfInteger aItLI(theVertIndices); TopTools_ListOfShape aLV; for (; aItLI.More(); aItLI.Next()) { - Standard_Integer nX = aItLI.Value(), nSD1; + Standard_Integer nX = aItLI.Value(), nSD1 = 0; if (myDS->HasShapeSD(nX, nSD1)) { const TopoDS_Shape& aVSD1 = myDS->Shape(nSD1); if (nSD == -1) { @@ -155,10 +155,10 @@ Standard_Integer BOPAlgo_PaveFiller::MakeSDVertices aLV.Append(aV); } BOPTools_AlgoTools::MakeVertex(aLV, aVn); - Standard_Integer nV; + Standard_Integer nV = 0; if (nSD != -1) { // update old SD vertex with new value - BRep_TVertex* aTVertex = static_cast(aVSD.TShape().get()); + BRep_TVertex* aTVertex = dynamic_cast(aVSD.TShape().get()); aTVertex->Pnt(BRep_Tool::Pnt(aVn)); aTVertex->Tolerance(BRep_Tool::Tolerance(aVn)); aVn = aVSD; diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx index bacc0fbccf..7c028a919e 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx @@ -15,6 +15,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -44,7 +46,7 @@ void BOPAlgo_PaveFiller::SetNonDestructive() return; } // - Standard_Boolean bFlag; + Standard_Boolean bFlag = 0; TopTools_ListIteratorOfListOfShape aItLS; // bFlag=Standard_False; @@ -74,7 +76,7 @@ void BOPAlgo_PaveFiller::UpdateEdgeTolerance (const Standard_Integer nE, TColStd_ListIteratorOfListOfInteger itLI(aLI); for (; itLI.More(); itLI.Next()) { - Standard_Integer nV = itLI.Value(), nVSD; + Standard_Integer nV = itLI.Value(), nVSD = 0; if (!myDS->IsNewShape(nV) && !myDS->HasShapeSD(nV, nVSD)) return; @@ -104,8 +106,8 @@ Standard_Integer BOPAlgo_PaveFiller::UpdateVertex (const Standard_Integer nV, const Standard_Real aTolNew) { - Standard_Integer nVNew; - Standard_Real aTolV; + Standard_Integer nVNew = 0; + Standard_Real aTolV = NAN; BRep_Builder aBB; nVNew = nV; @@ -176,7 +178,7 @@ void BOPAlgo_PaveFiller::UpdateCommonBlocksWithSDVertices() UpdatePaveBlocksWithSDVertices(); return; } - Standard_Integer aNbPBP; + Standard_Integer aNbPBP = 0; // BOPDS_VectorOfListOfPaveBlock& aPBP=myDS->ChangePaveBlocksPool(); aNbPBP=aPBP.Length(); @@ -184,8 +186,8 @@ void BOPAlgo_PaveFiller::UpdateCommonBlocksWithSDVertices() return; } // - Standard_Integer i, nV1, nV2; - Standard_Real aTolV; + Standard_Integer i = 0, nV1 = 0, nV2 = 0; + Standard_Real aTolV = NAN; BOPDS_MapOfCommonBlock aMCB; BOPDS_ListIteratorOfListOfPaveBlock aItPB; Handle(BOPDS_PaveBlock) aPB; @@ -225,10 +227,10 @@ namespace for (Standard_Integer i = 0; i < theInterfs.Length(); i++) { InterfType& anIntf = theInterfs(i); - Standard_Integer anInd; + Standard_Integer anInd = 0; if (anIntf.HasIndexNew(anInd)) { - Standard_Integer anIndSD; + Standard_Integer anIndSD = 0; if (theDS->HasShapeSD(anInd, anIndSD)) { anIntf.SetIndexNew(anIndSD); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_11.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_11.cxx index 7a3f312d18..daf2496d55 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_11.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_11.cxx @@ -36,7 +36,7 @@ void BOPAlgo_PaveFiller::CheckSelfInterference() // BRep_Builder aBB; // - Standard_Integer i, aNbR = myDS->NbRanges(); + Standard_Integer i = 0, aNbR = myDS->NbRanges(); for (i = 0; i < aNbR; ++i) { const BOPDS_IndexRange& aR = myDS->Range(i); // @@ -149,7 +149,7 @@ void BOPAlgo_PaveFiller::CheckSelfInterference() // for (Standard_Integer k = 0; k < 2; ++k) { const BOPDS_IndexedMapOfPaveBlock& aMPBF = !k ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc(); - Standard_Integer iPB, aNbPB = aMPBF.Extent(); + Standard_Integer iPB = 0, aNbPB = aMPBF.Extent(); for (iPB = 1; iPB <= aNbPB; ++iPB) { const Handle(BOPDS_PaveBlock)& aPB = aMPBF(iPB); Standard_ASSERT(aPB->HasEdge(), "Face information is not up to date", continue); @@ -175,7 +175,7 @@ void BOPAlgo_PaveFiller::CheckSelfInterference() TopoDS_Compound aWC; aBB.MakeCompound(aWC); // - Standard_Integer iS, aNbS = aMCS.Extent(); + Standard_Integer iS = 0, aNbS = aMCS.Extent(); for (iS = 1; iS <= aNbS; ++iS) { const TopoDS_Shape& aSx = aMCS(iS); aBB.Add(aWC, aSx); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx index eecb0ff9a3..b06fbbc27f 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx @@ -16,6 +16,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -50,7 +52,7 @@ class BOPAlgo_VertexEdge : public BOPAlgo_ParallelAlgo { myIV(-1), myIE(-1), myFlag(-1), myT(-1.), myTolVNew(-1.) { }; // - virtual ~BOPAlgo_VertexEdge(){ + ~BOPAlgo_VertexEdge() override{ }; // void SetIndices(const Standard_Integer nV, @@ -109,7 +111,7 @@ class BOPAlgo_VertexEdge : public BOPAlgo_ParallelAlgo { return myPB; } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -164,7 +166,7 @@ void BOPAlgo_PaveFiller::PerformVE(const Message_ProgressRange& theRange) { return; } - Standard_Integer nV, nE; + Standard_Integer nV = 0, nE = 0; myIterator->Value(nV, nE); // const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE); @@ -213,7 +215,7 @@ void BOPAlgo_PaveFiller::IntersectVE const Message_ProgressRange& theRange, const Standard_Boolean theAddInterfs) { - Standard_Integer i, aNbVE = theVEPairs.Extent(); + Standard_Integer i = 0, aNbVE = theVEPairs.Extent(); if (!aNbVE) { return; } @@ -318,7 +320,7 @@ void BOPAlgo_PaveFiller::IntersectVE continue; } // - Standard_Integer nV, nE; + Standard_Integer nV = 0, nE = 0; aVESolver.Indices(nV, nE); // Parameter of vertex on edge Standard_Real aT = aVESolver.Parameter(); @@ -334,7 +336,7 @@ void BOPAlgo_PaveFiller::IntersectVE for (; itPB.More(); itPB.Next()) { aPB = itPB.Value(); - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; aPB->Range (aT1, aT2); if (aT > aT1 && aT < aT2) break; @@ -448,7 +450,7 @@ void BOPAlgo_PaveFiller::SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges, Standard_Boolean bCheckDist = (bHasValidRange && !aPBN->IsSplittable()); if (!bHasValidRange || bCheckDist) { - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; aPBN->Indices(nV1, nV2); if (nV1 == nV2) // Same vertices -> no valid range, no need to unify vertices @@ -501,7 +503,7 @@ void BOPAlgo_PaveFiller::SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges, } // // Make Common Blocks - Standard_Integer i, aNbCB = aMCBNewPB.Extent(); + Standard_Integer i = 0, aNbCB = aMCBNewPB.Extent(); for (i = 1; i <= aNbCB; ++i) { const Handle(BOPDS_CommonBlock)& aCB = aMCBNewPB.FindKey(i); const BOPDS_ListOfPaveBlock& aLPBN = aMCBNewPB(i); @@ -522,11 +524,11 @@ void BOPAlgo_PaveFiller::SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges, pLPBx->Append(aPB); } // - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; aCB->PaveBlock1()->Indices(nV1, nV2); Standard_Boolean bIsClosed = (nV1 == nV2); // - Standard_Integer j, aNbPairs = aMInds.Extent(); + Standard_Integer j = 0, aNbPairs = aMInds.Extent(); for (j = 1; j <= aNbPairs; ++j) { BOPDS_ListOfPaveBlock& aLPB = aMInds(j); // @@ -564,7 +566,7 @@ void BOPAlgo_PaveFiller::SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges, const TopoDS_Edge& aE = TopoDS::Edge(myDS->Shape(aPB->OriginalEdge())); Standard_Real aTolE = BRep_Tool::MaxTolerance(aE, TopAbs_VERTEX); // - Standard_Real aTOut, aDist; + Standard_Real aTOut = NAN, aDist = NAN; Standard_Integer iErr = myContext->ComputePE(aPMFirst, aTolEFirst + aTolE + myFuzzyValue, aE, aTOut, aDist); if (!iErr && ((aTOut > aPB->Pave1().Parameter()) && (aTOut < aPB->Pave2().Parameter()))) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index 0e36f380fb..731be8e955 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -16,6 +16,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -66,7 +68,7 @@ class BOPAlgo_EdgeEdge : BOPAlgo_ParallelAlgo() { }; // - virtual ~BOPAlgo_EdgeEdge(){ + ~BOPAlgo_EdgeEdge() override{ }; // void SetPaveBlock1(const Handle(BOPDS_PaveBlock)& aPB) { @@ -96,7 +98,7 @@ class BOPAlgo_EdgeEdge : IntTools_EdgeEdge::SetFuzzyValue(theFuzz); } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -165,10 +167,10 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) return; } // - Standard_Boolean bExpressCompute, bIsPBSplittable1, bIsPBSplittable2; - Standard_Integer i, iX, nE1, nE2, aNbCPrts, k, aNbEdgeEdge; - Standard_Integer nV11, nV12, nV21, nV22; - Standard_Real aTS11, aTS12, aTS21, aTS22, aT11, aT12, aT21, aT22; + Standard_Boolean bExpressCompute = 0, bIsPBSplittable1 = 0, bIsPBSplittable2 = 0; + Standard_Integer i = 0, iX = 0, nE1 = 0, nE2 = 0, aNbCPrts = 0, k = 0, aNbEdgeEdge = 0; + Standard_Integer nV11 = 0, nV12 = 0, nV21 = 0, nV22 = 0; + Standard_Real aTS11 = NAN, aTS12 = NAN, aTS21 = NAN, aTS22 = NAN, aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN; TopAbs_ShapeEnum aType; BOPDS_ListIteratorOfListOfPaveBlock aIt1, aIt2; Handle(NCollection_BaseAllocator) aAllocator; @@ -367,8 +369,8 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) } // Standard_Boolean bIsOnPave[4]; - Standard_Integer nV[4], j; - Standard_Real aT1, aT2, aTol; + Standard_Integer nV[4], j = 0; + Standard_Real aT1 = NAN, aT2 = NAN, aTol = NAN; TopoDS_Vertex aVnew; IntTools_Range aCR1, aCR2; // @@ -453,8 +455,8 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) } // <-LXBR { - Standard_Integer nVS[2], iFound; - Standard_Real aTolVx, aD2, aDT2; + Standard_Integer nVS[2], iFound = 0; + Standard_Real aTolVx = NAN, aD2 = NAN, aDT2 = NAN; TColStd_MapOfInteger aMV; gp_Pnt aPx; // @@ -513,7 +515,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) break; } // - Standard_Boolean bHasSameBounds; + Standard_Boolean bHasSameBounds = 0; bHasSameBounds=aPB1->HasSameBounds(aPB2); if (!bHasSameBounds) { break; @@ -593,7 +595,7 @@ void BOPAlgo_PaveFiller::PerformNewVertices // // 4. Compute Extra Paves and split Pave blocks by the Extra paves Message_ProgressScope aPS(theRange, NULL, 2); - Standard_Integer i, aNb = aImages.Extent(); + Standard_Integer i = 0, aNb = aImages.Extent(); Message_ProgressScope aPS1(aPS.Next(), NULL, aNb + aNbV); for (i = 1; i <= aNb; ++i, aPS1.Next()) { if (UserBreak(aPS)) @@ -663,7 +665,7 @@ void BOPAlgo_PaveFiller::TreatNewVertices // // Prepare for intersection TopTools_IndexedDataMapOfShapeReal aVerts; - Standard_Integer i, aNbV = theMVCPB.Extent(); + Standard_Integer i = 0, aNbV = theMVCPB.Extent(); for (i = 1; i <= aNbV; ++i) { const TopoDS_Shape& aV = theMVCPB.FindKey(i); Standard_Real aTol = theMVCPB.FindFromIndex(i).Tolerance(); @@ -691,7 +693,7 @@ void BOPAlgo_PaveFiller::TreatNewVertices void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB) { // Vertices - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; thePB->Indices(nV1, nV2); if (nV1 < 0 || nV2 < 0) @@ -712,7 +714,7 @@ void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB) const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); // Range - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; thePB->Range(aT1, aT2); // IntTools_ShrunkRange aSR; @@ -734,7 +736,7 @@ void BOPAlgo_PaveFiller::AnalyzeShrunkData(const Handle(BOPDS_PaveBlock)& thePB, TopoDS_Shape aWarnShape; // if (!theSR.IsDone() || !theSR.IsSplittable()) { - Standard_Real aEFirst, aELast, aPBFirst, aPBLast; + Standard_Real aEFirst = NAN, aELast = NAN, aPBFirst = NAN, aPBLast = NAN; BRep_Tool::Range(theSR.Edge(), aEFirst, aELast); thePB->Range(aPBFirst, aPBLast); bWholeEdge = !(aPBFirst > aEFirst || aPBLast < aELast); @@ -755,7 +757,7 @@ void BOPAlgo_PaveFiller::AnalyzeShrunkData(const Handle(BOPDS_PaveBlock)& thePB, AddWarning (new BOPAlgo_AlertTooSmallEdge (aWarnShape)); else AddWarning (new BOPAlgo_AlertBadPositioning (aWarnShape)); - Standard_Real aTS1, aTS2; + Standard_Real aTS1 = NAN, aTS2 = NAN; theSR.ShrunkRange(aTS1, aTS2); thePB->SetShrunkData(aTS1, aTS2, Bnd_Box(), Standard_False); return; @@ -767,7 +769,7 @@ void BOPAlgo_PaveFiller::AnalyzeShrunkData(const Handle(BOPDS_PaveBlock)& thePB, AddWarning (new BOPAlgo_AlertBadPositioning (aWarnShape)); } // - Standard_Real aTS1, aTS2; + Standard_Real aTS1 = NAN, aTS2 = NAN; theSR.ShrunkRange(aTS1, aTS2); Bnd_Box aBox = theSR.BndBox(); aBox.SetGap(aBox.GetGap() + myFuzzyValue / 2.); @@ -781,8 +783,8 @@ Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVE(const Standard_Integer nV, Handle(BOPDS_PaveBlock)& aPB, TColStd_MapOfInteger& theMEdges) { - Standard_Integer nE, nVx, nVSD, iFlag; - Standard_Real aT, aTolVNew; + Standard_Integer nE = 0, nVx = 0, nVSD = 0, iFlag = 0; + Standard_Real aT = NAN, aTolVNew = NAN; // nE = aPB->OriginalEdge(); // @@ -876,7 +878,7 @@ Standard_Boolean BOPAlgo_PaveFiller::GetPBBox(const TopoDS_Edge& theE, // // check shrunk data if (thePB->HasShrunkData()) { - Standard_Boolean bIsSplittable; + Standard_Boolean bIsSplittable = 0; thePB->ShrunkData(theSFirst, theSLast, theBox, bIsSplittable); return bValid; } @@ -997,7 +999,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) continue; // Get indices - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; aPBR->Indices(nV1, nV2); // Add pave block to a map @@ -1029,7 +1031,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) continue; const BOPDS_Pair& aPair = aPBMap.FindKey(i); - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; aPair.Indices(nV1, nV2); const TopoDS_Vertex& aV1 = TopoDS::Vertex(myDS->Shape(nV1)); @@ -1051,7 +1053,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) const Standard_Integer nE1 = aPB1->OriginalEdge(); const Standard_Integer iR1 = myDS->Rank(nE1); const TopoDS_Edge& aE1 = TopoDS::Edge(myDS->Shape(nE1)); - Standard_Real aT11, aT12; + Standard_Real aT11 = NAN, aT12 = NAN; aPB1->Range(aT11, aT12); BRepAdaptor_Curve aBAC1(aE1); gp_Pnt aPm; @@ -1088,7 +1090,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) } const TopoDS_Edge& aE2 = TopoDS::Edge(myDS->Shape(nE2)); - Standard_Real aT21, aT22; + Standard_Real aT21 = NAN, aT22 = NAN; aPB2->Range(aT21, aT22); // Check the angle between edges in the middle point. diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx index e39b6276a1..611064dc07 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx @@ -16,6 +16,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -46,7 +48,7 @@ class BOPAlgo_VertexFace : public BOPAlgo_ParallelAlgo { myFlag(-1), myT1(-1.), myT2(-1.), myTolVNew(-1.) { } // - virtual ~BOPAlgo_VertexFace(){ + ~BOPAlgo_VertexFace() override{ } // void SetIndices(const Standard_Integer nV, @@ -99,7 +101,7 @@ class BOPAlgo_VertexFace : public BOPAlgo_ParallelAlgo { return myContext; } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -140,7 +142,7 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) myIterator->Initialize(TopAbs_VERTEX, TopAbs_FACE); Standard_Integer iSize = myIterator->ExpectedLength(); // - Standard_Integer nV, nF; + Standard_Integer nV = 0, nF = 0; // Message_ProgressScope aPSOuter(theRange, NULL, 10); if (myGlue == BOPAlgo_GlueFull) { @@ -164,8 +166,8 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) return; } // - Standard_Integer nVSD, iFlag, nVx, aNbVF, k; - Standard_Real aT1, aT2; + Standard_Integer nVSD = 0, iFlag = 0, nVx = 0, aNbVF = 0, k = 0; + Standard_Real aT1 = NAN, aT2 = NAN; BOPAlgo_VectorOfVertexFace aVVF; // aVFs.SetIncrement(iSize); @@ -292,8 +294,8 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) //======================================================================= void BOPAlgo_PaveFiller::TreatVerticesEE() { - Standard_Integer i, aNbS,aNbEEs, nF, nV, iFlag; - Standard_Real aT1, aT2, dummy; + Standard_Integer i = 0, aNbS = 0,aNbEEs = 0, nF = 0, nV = 0, iFlag = 0; + Standard_Real aT1 = NAN, aT2 = NAN, dummy = NAN; TColStd_ListIteratorOfListOfInteger aItLI; Handle(NCollection_BaseAllocator) aAllocator; // diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index 0e4c6ed89f..9f527d1ca2 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -16,6 +16,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -67,7 +69,7 @@ class BOPAlgo_EdgeFace : myIE(-1), myIF(-1) { }; // - virtual ~BOPAlgo_EdgeFace(){ + ~BOPAlgo_EdgeFace() override{ }; // void SetIndices(const Standard_Integer nE, @@ -109,7 +111,7 @@ class BOPAlgo_EdgeFace : myBox2 = theBox2; } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -179,7 +181,7 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) return; } // - Standard_Integer nE, nF; + Standard_Integer nE = 0, nF = 0; // if (myGlue == BOPAlgo_GlueFull) { // there is no need to intersect edges with faces in this mode @@ -193,12 +195,12 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) return; } // - Standard_Boolean bV[2], bIsPBSplittable; - Standard_Boolean bV1, bV2, bExpressCompute; - Standard_Integer nV1, nV2; - Standard_Integer i, aNbCPrts, iX, nV[2]; - Standard_Integer aNbEdgeFace, k; - Standard_Real aTolE, aTolF, aTS1, aTS2, aT1, aT2; + Standard_Boolean bV[2], bIsPBSplittable = 0; + Standard_Boolean bV1 = 0, bV2 = 0, bExpressCompute = 0; + Standard_Integer nV1 = 0, nV2 = 0; + Standard_Integer i = 0, aNbCPrts = 0, iX = 0, nV[2]; + Standard_Integer aNbEdgeFace = 0, k = 0; + Standard_Real aTolE = NAN, aTolF = NAN, aTS1 = NAN, aTS2 = NAN, aT1 = NAN, aT2 = NAN; Handle(NCollection_BaseAllocator) aAllocator; TopAbs_ShapeEnum aType; BOPDS_ListIteratorOfListOfPaveBlock aIt; @@ -388,8 +390,8 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) switch (aType) { case TopAbs_VERTEX: { Standard_Boolean bIsOnPave[2]; - Standard_Integer j; - Standard_Real aT, aTolToDecide; + Standard_Integer j = 0; + Standard_Real aT = NAN, aTolToDecide = NAN; TopoDS_Vertex aVnew; // IntTools_Tools::VertexParameter(aCPart, aT); @@ -573,8 +575,8 @@ Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves const TColStd_MapOfInteger& aMIFOn, const TColStd_MapOfInteger& aMIFIn) { - Standard_Boolean bRet; - Standard_Integer nV; + Standard_Boolean bRet = 0; + Standard_Integer nV = 0; TColStd_MapIteratorOfMapOfInteger aIt; // bRet=Standard_False; @@ -606,8 +608,8 @@ Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves (const TopoDS_Vertex& aVnew, const TColStd_MapOfInteger& aMIF) { - Standard_Boolean bRet; - Standard_Integer nV, iFlag; + Standard_Boolean bRet = 0; + Standard_Integer nV = 0, iFlag = 0; TColStd_MapIteratorOfMapOfInteger aIt; // bRet=Standard_True; @@ -632,9 +634,9 @@ Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVF (const Standard_Integer nV, const Standard_Integer nF) { - Standard_Boolean bRet; - Standard_Integer iFlag, nVx; - Standard_Real U, V, aTolVNew; + Standard_Boolean bRet = 0; + Standard_Integer iFlag = 0, nVx = 0; + Standard_Real U = NAN, V = NAN, aTolVNew = NAN; // bRet = Standard_False; const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&myDS->Shape(nV); @@ -705,8 +707,8 @@ void BOPAlgo_PaveFiller::ReduceIntersectionRange(const Standard_Integer theV1, return; } // - Standard_Integer i, nV, nE1, nE2; - Standard_Real aTR1, aTR2; + Standard_Integer i = 0, nV = 0, nE1 = 0, nE2 = 0; + Standard_Real aTR1 = NAN, aTR2 = NAN; // // get face's edges to check that E/E contains the edge from the face TColStd_MapOfInteger aMFE; @@ -844,9 +846,9 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB return; } - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Bnd_Box aPBBox; - Standard_Boolean isSplit; + Standard_Boolean isSplit = 0; aPB->ShrunkData(f, l, aPBBox, isSplit); aBBTree.Add(aPBMap.Add(aPB), Bnd_Tools::Bnd2BVH(aPBBox)); @@ -931,14 +933,14 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB continue; // Check if the face contains both vertices of the pave block - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; aPB->Indices(nV1, nV2); if (!aMVF.Contains(nV1) || !aMVF.Contains(nV2)) // Face does not contain the vertices continue; // Get the edge - Standard_Integer nE; + Standard_Integer nE = 0; if (!aPB->HasEdge(nE)) { nE = aPB->OriginalEdge(); @@ -962,7 +964,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB Standard_Real aTS[2]; Bnd_Box aPBBox; - Standard_Boolean isSplit; + Standard_Boolean isSplit = 0; aPB->ShrunkData(aTS[0], aTS[1], aPBBox, isSplit); // Middle point @@ -991,7 +993,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB if (aProjPS.LowerDistance() > aTolCheck + myFuzzyValue) continue; - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; aProjPS.LowerDistanceParameters(U, V); if (!myContext->IsPointInFace(aF, gp_Pnt2d(U, V))) continue; @@ -1119,7 +1121,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB if (aCP.Type() != TopAbs_EDGE) continue; - Standard_Integer nE, nF; + Standard_Integer nE = 0, nF = 0; anEdgeFace.Indices(nE, nF); if (theAddInterf) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index 68fc9e9e97..4a9ccf0537 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -15,6 +15,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -98,7 +100,7 @@ class BOPAlgo_FaceFace : myIF1(-1), myIF2(-1), myTolFF(1.e-7) { } // - virtual ~BOPAlgo_FaceFace() { + ~BOPAlgo_FaceFace() override { } // void SetIndices(const Standard_Integer nF1, @@ -147,7 +149,7 @@ class BOPAlgo_FaceFace : // const gp_Trsf& Trsf() const { return myTrsf; } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -240,7 +242,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) // Collect faces from intersection pairs TColStd_MapOfInteger aMIFence; - Standard_Integer nF1, nF2; + Standard_Integer nF1 = 0, nF2 = 0; for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nF1, nF2); @@ -290,7 +292,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) { continue; } - Standard_Integer nE1, nE2; + Standard_Integer nE1 = 0, nE2 = 0; aEE.Indices(nE1, nE2); const Standard_Integer nVN = aEE.IndexNew(); @@ -438,7 +440,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) } }//for (; myIterator->More(); myIterator->Next()) { // - Standard_Integer k, aNbFaceFace = aVFaceFace.Length();; + Standard_Integer k = 0, aNbFaceFace = aVFaceFace.Length();; Message_ProgressScope aPS(aPSOuter.Next(), "Performing Face-Face intersection", aNbFaceFace); for (k = 0; k < aNbFaceFace; k++) { @@ -575,10 +577,10 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) return; } // - Standard_Boolean bExist, bValid2D; - Standard_Integer i, nF1, nF2, aNbC, aNbP, j; - Standard_Integer nV1, nV2; - Standard_Real aT1, aT2; + Standard_Boolean bExist = 0, bValid2D = 0; + Standard_Integer i = 0, nF1 = 0, nF2 = 0, aNbC = 0, aNbP = 0, j = 0; + Standard_Integer nV1 = 0, nV2 = 0; + Standard_Real aT1 = NAN, aT2 = NAN; Handle(NCollection_BaseAllocator) aAllocator = new NCollection_IncAllocator; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; TopoDS_Edge aES; @@ -767,7 +769,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) continue; } // - Standard_Integer nEOut; + Standard_Integer nEOut = 0; Standard_Real aTolNew = -1.; bExist = IsExistingPaveBlock(aPB, aNC, aLSE, nEOut, aTolNew); if (bExist) @@ -783,7 +785,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2))); // // check if the pave block has a valid range - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aTolR3D, aT1, BRep_Tool::Pnt(aV1), Max (aTolR3D, BRep_Tool::Tolerance(aV1)), aT2, BRep_Tool::Pnt(aV2), Max (aTolR3D, BRep_Tool::Tolerance(aV2)), @@ -835,7 +837,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) // Try fusing the vertices of the existing pave block // with the vertices put on the real section curve (except // for technological vertices, which will be removed) - Standard_Integer nVOut1, nVOut2; + Standard_Integer nVOut1 = 0, nVOut2 = 0; aPBOut->Indices(nVOut1, nVOut2); if (nV1 != nVOut1 && nV1 != nVOut2 && !aMVBounds.Contains(nV1)) { @@ -986,14 +988,14 @@ void BOPAlgo_PaveFiller::PostTreatFF return; } // - Standard_Boolean bHasPaveBlocks, bOld; - Standard_Integer nSx, nVSD, iX, iP, iC, j, nV, iV = 0, iE, k; - Standard_Integer aNbLPBx; + Standard_Boolean bHasPaveBlocks = 0, bOld = 0; + Standard_Integer nSx = 0, nVSD = 0, iX = 0, iP = 0, iC = 0, j = 0, nV = 0, iV = 0, iE = 0, k = 0; + Standard_Integer aNbLPBx = 0; TopAbs_ShapeEnum aType; TopoDS_Shape aV, aE; TopTools_ListIteratorOfListOfShape aItLS; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; - BOPDS_PDS aPDS; + BOPDS_PDS aPDS = nullptr; Handle(BOPDS_PaveBlock) aPB1; BOPDS_Pave aPave[2]; BOPDS_ShapeInfo aSI; @@ -1013,7 +1015,7 @@ void BOPAlgo_PaveFiller::PostTreatFF for (Standard_Integer i = 0; i < aNbFF; i++) { BOPDS_InterfFF& aFF = aFFs(i); - Standard_Integer nF1, nF2; + Standard_Integer nF1 = 0, nF2 = 0; aFF.Indices(nF1, nF2); TColStd_MapOfInteger aMV, aMVEF, aMI; @@ -1329,7 +1331,7 @@ void BOPAlgo_PaveFiller::PostTreatFF else { // check aPDS to have the SD connection between these vertices const TopoDS_Shape& aVPave = myDS->Shape(aP1.Index()); - Standard_Integer nVnewSD, nVnew = aPDS->Index(aVPave); + Standard_Integer nVnewSD = 0, nVnew = aPDS->Index(aVPave); if (aPDS->HasShapeSD(nVnew, nVnewSD)) { if (nVnewSD == nV) { aDMNewSD.Bind(aP1.Index(), iV); @@ -1415,8 +1417,8 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo const TColStd_DataMapOfIntegerInteger& theDMV, const BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap) { - Standard_Integer i, j, nV1, nF1, nF2, - aNbFF, aNbC, aNbP; + Standard_Integer i = 0, j = 0, nV1 = 0, nF1 = 0, nF2 = 0, + aNbFF = 0, aNbC = 0, aNbP = 0; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; TColStd_MapOfInteger aMF; @@ -1585,7 +1587,7 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo // // 2. Update Face Info information with new vertices and new // pave blocks created in PostTreatFF from existing ones - Standard_Integer nV2; + Standard_Integer nV2 = 0; TColStd_MapIteratorOfMapOfInteger aItMF; TColStd_DataMapIteratorOfDataMapOfIntegerInteger aItMV; // @@ -1662,9 +1664,9 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingVertex const Standard_Real theTolR3D, const TColStd_MapOfInteger& aMVOnIn)const { - Standard_Boolean bRet; - Standard_Integer nV, iFlag; - Standard_Real aTolCheck; + Standard_Boolean bRet = 0; + Standard_Integer nV = 0, iFlag = 0; + Standard_Real aTolCheck = NAN; gp_Pnt aPV; Bnd_Box aBoxP; TColStd_MapIteratorOfMapOfInteger aIt; @@ -1705,8 +1707,8 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock if (theLSE.IsEmpty()) return Standard_False; - Standard_Real aT1, aT2, aTm, aTx, aTolE, aTolCheck, aTol, aDist; - Standard_Integer nE, iFlag, nV1, nV2; + Standard_Real aT1 = NAN, aT2 = NAN, aTm = NAN, aTx = NAN, aTolE = NAN, aTolCheck = NAN, aTol = NAN, aDist = NAN; + Standard_Integer nE = 0, iFlag = 0, nV1 = 0, nV2 = 0; gp_Pnt aPm; Bnd_Box aBoxPm; TColStd_ListIteratorOfListOfInteger aItLI; @@ -1764,10 +1766,10 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock { const IntTools_Curve& aIC=theNC.Curve(); - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; thePB->Range(aT1, aT2); - Standard_Integer nV11, nV12; + Standard_Integer nV11 = 0, nV12 = 0; thePB->Indices (nV11, nV12); //first point @@ -1823,7 +1825,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock { const Handle (BOPDS_PaveBlock)& aPB = theMPBOnIn (it.Value()); - Standard_Integer nV21, nV22; + Standard_Integer nV21 = 0, nV22 = 0; aPB->Indices (nV21, nV22); const Standard_Real aTolV21 = BRep_Tool::Tolerance (TopoDS::Vertex (myDS->Shape (nV21))); @@ -1871,7 +1873,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock if (aIC.Type() != GeomAbs_Line || aBAC2.GetType() != GeomAbs_Line) { - Standard_Real aTldp; + Standard_Real aTldp = NAN; Standard_Real aTolAdd = 2. * Min(aMaxTolAdd, Max(aRealTol, Max(aTolV1, aTolV2))); aPEStatus = myContext->ComputePE(aPm, aTolAdd, aSp, aTldp, aDistm1m2); @@ -1901,7 +1903,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock aBoxTmp.Enlarge(aRealTol); Standard_Real aDistToSp = 0.; - Standard_Real aTx; + Standard_Real aTx = NAN; if (aBoxSp.IsOut(aBoxTmp) || aPEStatus < 0) { continue; @@ -1964,8 +1966,8 @@ static void getBoundPaves(const BOPDS_DS* theDS, for (BOPDS_ListIteratorOfListOfPave aItLP(aLP); aItLP.More(); aItLP.Next()) { const BOPDS_Pave& aPv = aItLP.Value(); - Standard_Integer nV; - Standard_Real aTV; + Standard_Integer nV = 0; + Standard_Real aTV = NAN; aPv.Contents(nV, aTV); if (aTV < aTmin) { theNV[0] = aPv.Index(); @@ -2068,7 +2070,7 @@ void BOPAlgo_PaveFiller::PutPavesOnCurve(const TColStd_MapOfInteger& theMVOnIn, TColStd_DataMapOfIntegerReal& theMVTol, TColStd_DataMapOfIntegerListOfInteger& theDMVLV) { - Standard_Integer nV; + Standard_Integer nV = 0; TColStd_MapIteratorOfMapOfInteger aIt; // const Bnd_Box& aBoxC = theNC.Box(); @@ -2130,7 +2132,7 @@ void BOPAlgo_PaveFiller::FilterPavesOnCurves(const BOPDS_VectorOfCurve& theVNC, // For each vertex found in ExtPaves of pave blocks of section curves // collect list of pave blocks with distance to the curve NCollection_IndexedDataMap > aIDMVertPBs; - Standard_Integer i; + Standard_Integer i = 0; const Standard_Real anEps = gp::Resolution(); for (i = 0; i < theVNC.Length(); ++i) { @@ -2235,8 +2237,8 @@ Standard_Boolean BOPAlgo_PaveFiller::ExtendedTolerance return bFound; } // - Standard_Integer i, k, aNbLines, aNbInt; - Standard_Real aT11, aT12, aD1, aD2, aD; + Standard_Integer i = 0, k = 0, aNbLines = 0, aNbInt = 0; + Standard_Real aT11 = NAN, aT12 = NAN, aD1 = NAN, aD2 = NAN, aD = NAN; TopoDS_Vertex aV; gp_Pnt aPV, aP11, aP12; // @@ -2292,8 +2294,8 @@ void BOPAlgo_PaveFiller::GetEFPnts const Standard_Integer nF2, IntSurf_ListOfPntOn2S& aListOfPnts) { - Standard_Integer nE, nF, nFOpposite, aNbEFs, i; - Standard_Real U1, U2, V1, V2, f, l; + Standard_Integer nE = 0, nF = 0, nFOpposite = 0, aNbEFs = 0, i = 0; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN, f = NAN, l = NAN; TColStd_MapOfInteger aMI; // //collect indexes of all shapes from nF1 and nF2. @@ -2383,7 +2385,7 @@ void BOPAlgo_PaveFiller::GetEFPnts return; } // - Standard_Integer nV; + Standard_Integer nV = 0; TColStd_MapOfInteger aMV; // aMV.Assign(aMVEF); @@ -2392,7 +2394,7 @@ void BOPAlgo_PaveFiller::GetEFPnts return; } // - Standard_Real aDist; + Standard_Real aDist = NAN; BOPDS_Pave aPave; // const Handle(Geom_Curve)& aC3D=aIC.Curve(); @@ -2453,8 +2455,8 @@ void BOPAlgo_PaveFiller::GetEFPnts aC2D[0]=aIC.FirstCurve2d(); aC2D[1]=aIC.SecondCurve2d(); if (!aC2D[0].IsNull() && !aC2D[1].IsNull()) { - Standard_Integer nV, m, n; - Standard_Real aTC[2], aD, aD2, u, v, aDT2, aScPr, aDScPr; + Standard_Integer nV = 0, m = 0, n = 0; + Standard_Real aTC[2], aD = NAN, aD2 = NAN, u = NAN, v = NAN, aDT2 = NAN, aScPr = NAN, aDScPr = NAN; gp_Pnt aPC[2], aPV; gp_Dir aDN[2]; gp_Pnt2d aP2D; @@ -2514,7 +2516,7 @@ void BOPAlgo_PaveFiller::GetStickVertices(const Standard_Integer nF1, TColStd_MapOfInteger& aMVEF, TColStd_MapOfInteger& aMI) { - Standard_Integer nS1, nS2, nVNew, aTypeInt, i; + Standard_Integer nS1 = 0, nS2 = 0, nVNew = 0, aTypeInt = 0, i = 0; // BOPDS_VectorOfInterfVV& aVVs=myDS->InterfVV(); BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE(); @@ -2571,7 +2573,7 @@ void BOPAlgo_PaveFiller::GetFullShapeMap(const Standard_Integer nF, TColStd_MapOfInteger& aMI) { TColStd_ListIteratorOfListOfInteger aIt; - Standard_Integer nS; + Standard_Integer nS = 0; // const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(nF); const TColStd_ListOfInteger& aLI = aSI.SubShapes(); @@ -2626,8 +2628,8 @@ void BOPAlgo_PaveFiller::PutPaveOnCurve TColStd_DataMapOfIntegerListOfInteger& aDMVLV, const Standard_Integer iCheckExtend) { - Standard_Boolean bIsVertexOnLine; - Standard_Real aT; + Standard_Boolean bIsVertexOnLine = 0; + Standard_Real aT = NAN; // const TopoDS_Vertex& aV = (*(TopoDS_Vertex *)(&myDS->Shape(nV))); const Handle(BOPDS_PaveBlock)& aPB = aNC.PaveBlocks().First(); @@ -2653,9 +2655,9 @@ void BOPAlgo_PaveFiller::PutPaveOnCurve // if (bIsVertexOnLine) { // check if aPB contains the parameter aT - Standard_Boolean bExist; - Standard_Integer nVUsed; - Standard_Real aPTol, aDTol; + Standard_Boolean bExist = 0; + Standard_Integer nVUsed = 0; + Standard_Real aPTol = NAN, aDTol = NAN; // aDTol = BOPTools_AlgoTools::DTolerance(); // @@ -2773,7 +2775,7 @@ void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks (const Standard_Integer theIn if (!pList) continue; - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; aPBF->Range (aT1, aT2); Standard_Real aDist = RealLast(); @@ -2829,8 +2831,8 @@ void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks return; } // - Standard_Real aT, dummy; - Standard_Integer nV, nE, iC, iFlag; + Standard_Real aT = NAN, dummy = NAN; + Standard_Integer nV = 0, nE = 0, iC = 0, iFlag = 0; TColStd_ListIteratorOfListOfInteger aItLI; TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItBV; // @@ -2918,8 +2920,8 @@ void BOPAlgo_PaveFiller::UpdateExistingPaveBlocks return; } // - Standard_Integer nE; - Standard_Boolean bCB; + Standard_Integer nE = 0; + Standard_Boolean bCB = 0; Handle(BOPDS_PaveBlock) aPB, aPB1, aPB2, aPB2n; Handle(BOPDS_CommonBlock) aCB; BOPDS_ListIteratorOfListOfPaveBlock aIt, aIt1, aIt2; @@ -3000,7 +3002,7 @@ void BOPAlgo_PaveFiller::UpdateExistingPaveBlocks // Compute the parameter by projecting the point const TopoDS_Vertex& aV = TopoDS::Vertex(myDS->Shape(nV)); const TopoDS_Edge& aEOr = TopoDS::Edge(myDS->Shape(nE)); - Standard_Real aTOut, aDist; + Standard_Real aTOut = NAN, aDist = NAN; Standard_Integer iErr = myContext->ComputeVE(aV, aEOr, aTOut, aDist, myFuzzyValue); if (!iErr) { aPave[i].SetParameter(aTOut); @@ -3173,7 +3175,7 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC) } // Check if there will be valid range on the curve - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Standard_Real aNewTolV = Max(aTolV, aDistVP + BOPTools_AlgoTools::DTolerance()); if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(), aT[0], aP[0], aNewTolV, @@ -3214,7 +3216,7 @@ void BOPAlgo_PaveFiller::PreparePostTreatFF TopTools_DataMapOfShapeInteger& aMVI, BOPDS_ListOfPaveBlock& aLPBC) { - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; // aLPBC.Append(aPB); // @@ -3241,8 +3243,8 @@ Standard_Boolean BOPAlgo_PaveFiller::CheckPlanes (const Standard_Integer nF1, const Standard_Integer nF2)const { - Standard_Boolean bToIntersect; - Standard_Integer i, nV2, iCnt; + Standard_Boolean bToIntersect = 0; + Standard_Integer i = 0, nV2 = 0, iCnt = 0; TColStd_MapIteratorOfMapOfInteger aIt; // bToIntersect=Standard_False; @@ -3284,9 +3286,9 @@ void BOPAlgo_PaveFiller::UpdatePaveBlocks return; } // - Standard_Integer nSp, aNbPBP, nV[2], i, j; + Standard_Integer nSp = 0, aNbPBP = 0, nV[2], i = 0, j = 0; Standard_Real aT[2]; - Standard_Boolean bCB, bRebuild; + Standard_Boolean bCB = 0, bRebuild = 0; BOPDS_ListIteratorOfListOfPaveBlock aItPB; BOPDS_MapOfPaveBlock aMPB; TColStd_MapOfInteger aMicroEdges; @@ -3399,7 +3401,7 @@ void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger& theEdges) // // 1. from the Pave Blocks Pool BOPDS_VectorOfListOfPaveBlock& aPBP = myDS->ChangePaveBlocksPool(); - Standard_Integer aNbPBP = aPBP.Length(), i; + Standard_Integer aNbPBP = aPBP.Length(), i = 0; for (i = 0; i < aNbPBP; ++i) { BOPDS_ListOfPaveBlock& aLPB = aPBP(i); // @@ -3416,7 +3418,7 @@ void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger& theEdges) // 2. from section curves TColStd_MapOfInteger aMPassed; BOPDS_VectorOfInterfFF& aFFs = myDS->InterfFF(); - Standard_Integer aNbFF = aFFs.Length(), j; + Standard_Integer aNbFF = aFFs.Length(), j = 0; for (i = 0; i < aNbFF; ++i) { BOPDS_InterfFF& aFF = aFFs(i); // remove from Section pave blocks @@ -3451,7 +3453,7 @@ void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger& theEdges) &aFI.ChangePaveBlocksSc() }; for (Standard_Integer k = 0; k < 3; k++) { - Standard_Integer aNbPB = aIMPB[k]->Extent(), m; + Standard_Integer aNbPB = aIMPB[k]->Extent(), m = 0; for (m = 1; m <= aNbPB; ++m) { const Handle(BOPDS_PaveBlock)& aPB = aIMPB[k]->FindKey(m); @@ -3485,7 +3487,7 @@ Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1, Standard_Real aTol2 = aBAS2.Tolerance(); Standard_Real aTolFF = Max(aTol1, aTol2); // - Standard_Boolean isAna1, isAna2; + Standard_Boolean isAna1 = 0, isAna2 = 0; isAna1 = (aBAS1.GetType() == GeomAbs_Plane || aBAS1.GetType() == GeomAbs_Cylinder || aBAS1.GetType() == GeomAbs_Cone || @@ -3513,7 +3515,7 @@ void BOPAlgo_PaveFiller::UpdateBlocksWithSharedVertices() return; } // - Standard_Integer aNbFF; + Standard_Integer aNbFF = 0; // BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF(); aNbFF=aFFs.Length(); @@ -3521,9 +3523,9 @@ void BOPAlgo_PaveFiller::UpdateBlocksWithSharedVertices() return; } // - Standard_Boolean bOnCurve, bHasShapeSD; - Standard_Integer i, nF1, nF2, aNbC, j, nV, nVSD; - Standard_Real aTolV; + Standard_Boolean bOnCurve = 0, bHasShapeSD = 0; + Standard_Integer i = 0, nF1 = 0, nF2 = 0, aNbC = 0, j = 0, nV = 0, nVSD = 0; + Standard_Real aTolV = NAN; TColStd_MapOfInteger aMF; // for (i=0; iShape(nV)); const IntTools_Curve& aIC=aNC.Curve(); @@ -3632,19 +3634,19 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE() BOPDS_MapOfPaveBlock aMPB; // // 1. iterate on all sections F-F - Standard_Integer aNb = aFFs.Length(), i; + Standard_Integer aNb = aFFs.Length(), i = 0; for (i = 0; i < aNb; ++i) { BOPDS_InterfFF& aFF = aFFs(i); // BOPDS_VectorOfCurve& aVNC = aFF.ChangeCurves(); - Standard_Integer aNbC = aVNC.Length(), k; + Standard_Integer aNbC = aVNC.Length(), k = 0; for (k = 0; k < aNbC; ++k) { BOPDS_Curve& aNC = aVNC(k); BOPDS_ListOfPaveBlock& aLPB = aNC.ChangePaveBlocks(); BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB); for (; aItLPB.More(); ) { const Handle(BOPDS_PaveBlock)& aPB = aItLPB.Value(); - Standard_Integer nE; + Standard_Integer nE = 0; if (!aPB->HasEdge(nE)) { aLPB.Remove(aItLPB); continue; @@ -3672,7 +3674,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE() Standard_Real aTolE = BRep_Tool::Tolerance(aE); if (aTolC < aTolE) { // reduce edge tolerance - static_cast(aE.TShape().get())->Tolerance(aTolC); + dynamic_cast(aE.TShape().get())->Tolerance(aTolC); bIsReduced = Standard_True; } } @@ -3713,7 +3715,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE() BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB); for (; aItLPB.More(); aItLPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB = aItLPB.Value(); - Standard_Integer nE; + Standard_Integer nE = 0; if (!aPB->HasEdge(nE)) { continue; } @@ -3790,7 +3792,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE() } // if (aMaxTol < aTolV) { - static_cast(aV.TShape().get())->Tolerance(aMaxTol); + dynamic_cast(aV.TShape().get())->Tolerance(aMaxTol); } } } @@ -3933,7 +3935,7 @@ void BOPAlgo_PaveFiller::RemoveMicroEdges() if (aMPBFence.Add(aPBR)) { - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; aPBR->Indices(nV1, nV2); if (nV1 == nV2) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx index c78e87804f..43ef3e8401 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx @@ -15,6 +15,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -76,13 +78,13 @@ class BOPAlgo_SplitEdge : public BOPAlgo_ParallelAlgo { DEFINE_STANDARD_ALLOC BOPAlgo_SplitEdge() : - BOPAlgo_ParallelAlgo() { - myT1=0.; - myT2=0.; - myTol = 0.; + BOPAlgo_ParallelAlgo(), myT1(0.), myT2(0.), myTol(0.) { + + + } // - virtual ~BOPAlgo_SplitEdge() { + ~BOPAlgo_SplitEdge() override { } // void SetData(const TopoDS_Edge& aE, @@ -134,7 +136,7 @@ class BOPAlgo_SplitEdge : public BOPAlgo_ParallelAlgo { myContext = aContext; } // - virtual void Perform () { + void Perform () override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -164,7 +166,7 @@ class BOPAlgo_SplitEdge : public BOPAlgo_ParallelAlgo { Bnd_Box myBox; Standard_Real myTol; // - BOPDS_PDS myDS; + BOPDS_PDS myDS{}; Handle(IntTools_Context) myContext; }; // @@ -185,7 +187,7 @@ class BOPAlgo_MPC : public BOPAlgo_ParallelAlgo { myFlag(Standard_False) { }; // - virtual ~BOPAlgo_MPC(){ + ~BOPAlgo_MPC() override{ }; // void SetEdge(const TopoDS_Edge& aE) { @@ -232,7 +234,7 @@ class BOPAlgo_MPC : public BOPAlgo_ParallelAlgo { return myContext; } // - virtual void Perform() { + void Perform() override { Message_ProgressScope aPS(myProgressRange, NULL, 1); if (UserBreak(aPS)) { @@ -245,7 +247,7 @@ class BOPAlgo_MPC : public BOPAlgo_ParallelAlgo { // Check if edge has pcurve. If no then make its copy to avoid data races, // and use it to build pcurve. TopoDS_Edge aCopyE = myE; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(aCopyE, myF, f, l); if (aC2d.IsNull()) { @@ -316,11 +318,11 @@ class BOPAlgo_MPC : public BOPAlgo_ParallelAlgo { TopoDS_Face myF; TopoDS_Edge myEz; TopoDS_Vertex myV1; - Standard_Real myT1; + Standard_Real myT1{}; TopoDS_Vertex myV2; - Standard_Real myT2; + Standard_Real myT2{}; Handle(Geom2d_Curve) myNewC2d; - Standard_Real myNewTol; + Standard_Real myNewTol{}; // Handle(IntTools_Context) myContext; }; @@ -378,7 +380,7 @@ class BOPAlgo_BPC { TopoDS_Edge myE; TopoDS_Face myF; Handle(Geom2d_Curve) myCurve; - Standard_Boolean myToUpdate; + Standard_Boolean myToUpdate{}; private: Message_ProgressRange myRange; }; @@ -398,8 +400,8 @@ void BOPAlgo_PaveFiller::MakeSplitEdges(const Message_ProgressRange& theRange) return; } // - Standard_Integer i, nE, nV1, nV2, nSp, aNbVBSE, k; - Standard_Real aT1, aT2; + Standard_Integer i = 0, nE = 0, nV1 = 0, nV2 = 0, nSp = 0, aNbVBSE = 0, k = 0; + Standard_Real aT1 = NAN, aT2 = NAN; BOPDS_ListIteratorOfListOfPaveBlock aItPB; Handle(BOPDS_PaveBlock) aPB; BOPDS_MapOfCommonBlock aMCB(100); @@ -566,7 +568,7 @@ Standard_Integer BOPAlgo_PaveFiller::SplitEdge(const Standard_Integer nE, const Standard_Integer nV2, const Standard_Real aT2) { - Standard_Integer nSp; + Standard_Integer nSp = 0; TopoDS_Vertex aV1, aV2; TopoDS_Edge aE, aSp; BOPDS_ShapeInfo aSI; @@ -603,9 +605,9 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) if (myAvoidBuildPCurve || (!mySectionAttribute.PCurveOnS1() && !mySectionAttribute.PCurveOnS2())) return; - Standard_Boolean bHasPC; - Standard_Integer i, nF1, aNbC, k, nE, aNbFF, aNbFI, nEx; - Standard_Integer j, aNbPBIn, aNbPBOn; + Standard_Boolean bHasPC = 0; + Standard_Integer i = 0, nF1 = 0, aNbC = 0, k = 0, nE = 0, aNbFF = 0, aNbFI = 0, nEx = 0; + Standard_Integer j = 0, aNbPBIn = 0, aNbPBOn = 0; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; TopoDS_Face aF1F, aF2F; BOPAlgo_VectorOfMPC aVMPC; @@ -673,8 +675,8 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) continue; } // - Standard_Integer nV1x, nV2x; - Standard_Real aT1x, aT2x; + Standard_Integer nV1x = 0, nV2x = 0; + Standard_Real aT1x = NAN, aT2x = NAN; TopoDS_Vertex aV1x, aV2x; TopoDS_Edge aEz; // @@ -804,8 +806,8 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) void UpdateVertices(const TopoDS_Edge& aE, const TopoDS_Face& aF) { - Standard_Integer j; - Standard_Real aT[2], aUx, aVx, aTolV2, aD2, aD; + Standard_Integer j = 0; + Standard_Real aT[2], aUx = NAN, aVx = NAN, aTolV2 = NAN, aD2 = NAN, aD = NAN; gp_Pnt aP3D, aP3Dx; gp_Pnt2d aP2Dx; Handle(Geom_Surface) aS; @@ -854,8 +856,8 @@ void BOPAlgo_PaveFiller::Prepare(const Message_ProgressRange& theRange) TopAbs_EDGE, TopAbs_FACE }; - Standard_Boolean bIsBasedOnPlane; - Standard_Integer i, aNb, n1, nF, aNbF; + Standard_Boolean bIsBasedOnPlane = 0; + Standard_Integer i = 0, aNb = 0, n1 = 0, nF = 0, aNbF = 0; TopExp_Explorer aExp; TopTools_IndexedMapOfShape aMF; // diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx index 6a90599df3..ef39a464ff 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx @@ -15,6 +15,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -58,7 +60,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange) { Message_ProgressScope aPSOuter(theRange, NULL, 1); - Standard_Integer nF, aNb, nE, nV, nVSD, aNbPB; + Standard_Integer nF = 0, aNb = 0, nE = 0, nV = 0, nVSD = 0, aNbPB = 0; Handle(NCollection_BaseAllocator) aAllocator; Handle(BOPDS_PaveBlock) aPBD; TColStd_ListIteratorOfListOfInteger aItLI; @@ -106,7 +108,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange) } if (aSIF.ShapeType() == TopAbs_EDGE) { Standard_Real aTol=1.e-7; - Standard_Integer nEn; + Standard_Integer nEn = 0; BRep_Builder BB; const TopoDS_Edge& aDE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); const TopoDS_Vertex& aVn = (*(TopoDS_Vertex *)(&myDS->Shape(nV))); @@ -141,7 +143,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange) const Standard_Integer nF, BOPDS_ListOfPaveBlock& aLPBOut) { - Standard_Integer i, aNbPBOn, aNbPBIn, aNbPBSc, nV1, nV2; + Standard_Integer i = 0, aNbPBOn = 0, aNbPBIn = 0, aNbPBSc = 0, nV1 = 0, nV2 = 0; // const BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF); // In @@ -183,8 +185,8 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange) void BOPAlgo_PaveFiller::MakeSplitEdge (const Standard_Integer nDE, const Standard_Integer nDF) { - Standard_Integer nSp, nV1, nV2, aNbPB; - Standard_Real aT1, aT2; + Standard_Integer nSp = 0, nV1 = 0, nV2 = 0, aNbPB = 0; + Standard_Real aT1 = NAN, aT2 = NAN; TopoDS_Edge aDE, aSp; TopoDS_Vertex aV1, aV2; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; @@ -271,7 +273,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange) // in the direction of the 2D curve of degenerated edge Standard_Real aTolCmp = Precision::PConfusion(); // Get 2D curve - Standard_Real aTD1, aTD2; + Standard_Real aTD1 = NAN, aTD2 = NAN; Handle(Geom2d_Curve) aC2DDE = BRep_Tool::CurveOnSurface(aDE, aDF, aTD1, aTD2); // Get direction of the curve Standard_Boolean bUDir = Abs(aC2DDE->Value(aTD1).Y() - aC2DDE->Value(aTD2).Y()) < Precision::PConfusion(); @@ -290,7 +292,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange) continue; } const TopoDS_Edge& aE = (*(TopoDS_Edge *)(&myDS->Shape(nE))); - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; Handle(Geom2d_Curve) aC2D = BRep_Tool::CurveOnSurface(aE, aDF, aT1, aT2); if (aC2D.IsNull()) { continue; @@ -311,7 +313,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange) if (aGInter.IsDone() && aGInter.NbPoints()) { // Analyze intersection points - Standard_Integer i, aNbPoints = aGInter.NbPoints(); + Standard_Integer i = 0, aNbPoints = aGInter.NbPoints(); for (i = 1; i <= aNbPoints; ++i) { Standard_Real aX = aGInter.Point(i).ParamOnFirst(); aPave.SetParameter(aX); @@ -376,7 +378,7 @@ Standard_Boolean AddSplitPoint(const Handle(BOPDS_PaveBlock)& thePBD, const BOPDS_Pave& thePave, const Standard_Real theTol) { - Standard_Real aTD1, aTD2; + Standard_Real aTD1 = NAN, aTD2 = NAN; thePBD->Range(aTD1, aTD2); Standard_Real aT = thePave.Parameter(); @@ -385,7 +387,7 @@ Standard_Boolean AddSplitPoint(const Handle(BOPDS_PaveBlock)& thePBD, return Standard_False; // Check that the pave block does not contain the same parameter - Standard_Integer anInd; + Standard_Integer anInd = 0; if (thePBD->ContainsParameter(aT, theTol, anInd)) return Standard_False; diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_9.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_9.cxx index 50a2efb8c5..54ab2e6967 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_9.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_9.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -38,7 +40,7 @@ class BOPAlgo_ShrunkRange : public IntTools_ShrunkRange { : IntTools_ShrunkRange() { } // - virtual ~BOPAlgo_ShrunkRange() { + ~BOPAlgo_ShrunkRange() override { } // void SetPaveBlock(const Handle(BOPDS_PaveBlock)& aPB) { @@ -73,8 +75,8 @@ void BOPAlgo_PaveFiller::FillShrunkData(const TopAbs_ShapeEnum aType1, return; } // - Standard_Integer i, nS[2], nE, nV1, nV2, aNbVSD, k; - Standard_Real aT1, aT2; + Standard_Integer i = 0, nS[2], nE = 0, nV1 = 0, nV2 = 0, aNbVSD = 0, k = 0; + Standard_Real aT1 = NAN, aT2 = NAN; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; TColStd_MapOfInteger aMI; BOPAlgo_VectorOfShrunkRange aVSD; diff --git a/src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx b/src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx index 12b972b3a1..b928e52d95 100644 --- a/src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx +++ b/src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx @@ -783,8 +783,8 @@ private: //! @name Fields // Inputs Standard_Boolean myRunParallel; //!< Defines the mode of processing of the single feature TopoDS_Shape myFeature; //!< Feature to remove - TopTools_IndexedDataMapOfShapeListOfShape* myEFMap; //!< EF Connection map to find adjacent faces - TopTools_IndexedDataMapOfShapeListOfShape* myFSMap; //!< FS Connection map to find solids participating in the feature removal + TopTools_IndexedDataMapOfShapeListOfShape* myEFMap{}; //!< EF Connection map to find adjacent faces + TopTools_IndexedDataMapOfShapeListOfShape* myFSMap{}; //!< FS Connection map to find solids participating in the feature removal Message_ProgressRange myRange; //!< Indication of progress // Results diff --git a/src/BOPAlgo/BOPAlgo_Section.cxx b/src/BOPAlgo/BOPAlgo_Section.cxx index 47b97ef5a2..6dd50f329e 100644 --- a/src/BOPAlgo/BOPAlgo_Section.cxx +++ b/src/BOPAlgo/BOPAlgo_Section.cxx @@ -66,7 +66,7 @@ BOPAlgo_Section::~BOPAlgo_Section() //======================================================================= void BOPAlgo_Section::CheckData() { - Standard_Integer aNbArgs; + Standard_Integer aNbArgs = 0; // aNbArgs=myArguments.Extent(); if (!aNbArgs) { @@ -174,8 +174,8 @@ void BOPAlgo_Section::PerformInternal1 void BOPAlgo_Section::BuildSection(const Message_ProgressRange& theRange) { Message_ProgressScope aPS(theRange, "Building the result of Section operation", 1); - Standard_Integer i, aNbMS, aNbLE; - Standard_Integer j, nE, nV, aNb, aNbF, aNbPBSc; + Standard_Integer i = 0, aNbMS = 0, aNbLE = 0; + Standard_Integer j = 0, nE = 0, nV = 0, aNb = 0, aNbF = 0, aNbPBSc = 0; TopoDS_Shape aRC, aRC1; BRep_Builder aBB; TopExp_Explorer aExp; diff --git a/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx b/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx index 3cec99060d..1f51ea6600 100644 --- a/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx @@ -165,8 +165,8 @@ void BOPAlgo_ShellSplitter::Perform(const Message_ProgressRange& theRange) //======================================================================= void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB) { - Standard_Integer aNbLF, aNbOff, aNbFP; - Standard_Integer i; + Standard_Integer aNbLF = 0, aNbOff = 0, aNbFP = 0; + Standard_Integer i = 0; TopAbs_Orientation anOr; TopoDS_Edge aEL; BRep_Builder aBB; @@ -437,7 +437,7 @@ void RefineShell(TopoDS_Shell& theShell, // edges on which the input shell should be split TopTools_MapOfShape aMEStop; // - Standard_Integer i, aNbMEF = theMEF.Extent(); + Standard_Integer i = 0, aNbMEF = theMEF.Extent(); for (i = 1; i <= aNbMEF; ++i) { const TopoDS_Edge& aE = TopoDS::Edge(theMEF.FindKey(i)); const TopTools_ListOfShape& aLF = theMEF(i); @@ -579,8 +579,8 @@ void RefineShell(TopoDS_Shell& theShell, //======================================================================= void BOPAlgo_ShellSplitter::MakeShells(const Message_ProgressRange& theRange) { - Standard_Boolean bIsRegular; - Standard_Integer aNbVCBK, k; + Standard_Boolean bIsRegular = 0; + Standard_Integer aNbVCBK = 0, k = 0; BOPTools_ListIteratorOfListOfConnexityBlock aItCB; TopTools_ListIteratorOfListOfShape aIt; BOPAlgo_VectorOfCBK aVCBK; diff --git a/src/BOPAlgo/BOPAlgo_Tools.cxx b/src/BOPAlgo/BOPAlgo_Tools.cxx index 13151f8413..10b26dafb7 100644 --- a/src/BOPAlgo/BOPAlgo_Tools.cxx +++ b/src/BOPAlgo/BOPAlgo_Tools.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -111,7 +113,7 @@ void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_IndexedDataMapOfPaveBlockListOfPav BOPDS_PDS& pDS, const Handle(IntTools_Context)& theContext) { - Standard_Integer aNbCB; + Standard_Integer aNbCB = 0; // aNbCB=aMPBLPB.Extent(); if (!aNbCB) { @@ -183,7 +185,7 @@ void BOPAlgo_Tools::PerformCommonBlocks(const BOPDS_IndexedDataMapOfPaveBlockLis BOPDS_PDS& pDS, const Handle(IntTools_Context)& theContext) { - Standard_Integer nF, i, aNb; + Standard_Integer nF = 0, i = 0, aNb = 0; TColStd_ListIteratorOfListOfInteger aItLI; Handle(BOPDS_PaveBlock) aPB; Handle(BOPDS_CommonBlock) aCB; @@ -250,7 +252,7 @@ Standard_Real BOPAlgo_Tools::ComputeToleranceOfCB } // const Standard_Integer aNbPnt = 11; - Standard_Real aTol, aT, aT1, aT2, aDt; + Standard_Real aTol = NAN, aT = NAN, aT1 = NAN, aT2 = NAN, aDt = NAN; gp_Pnt aP; // const Handle(Geom_Curve)& aC3D = BRep_Tool::Curve(aEOr, aT1, aT2); @@ -436,7 +438,7 @@ Standard_Integer BOPAlgo_Tools::EdgesToWires(const TopoDS_Shape& theEdges, TopTools_MapOfShape aMEFence; // // look for a planes on the single edges - Standard_Integer i, j, aNbPlanes = aDMEdgePln.Extent(), aNbEdges = aDMEdgeTgt.Extent(); + Standard_Integer i = 0, j = 0, aNbPlanes = aDMEdgePln.Extent(), aNbEdges = aDMEdgeTgt.Extent(); for (i = 1; i <= aNbPlanes; ++i) { const TopoDS_Shape& aEI = aDMEdgePln.FindKey(i); if (!aMEFence.Add(aEI)) { @@ -629,7 +631,7 @@ Standard_Boolean BOPAlgo_Tools::WiresToFaces(const TopoDS_Shape& theWires, } } // - Standard_Integer i, j, aNb = aDMWirePln.Extent(); + Standard_Integer i = 0, j = 0, aNb = aDMWirePln.Extent(); for (i = 1; i <= aNb; ++i) { const TopoDS_Shape& aWireI = aDMWirePln.FindKey(i); if (aMFence.Contains(aWireI)) { @@ -732,7 +734,7 @@ void MakeWires(const TopTools_IndexedMapOfShape& theEdges, { TopoDS_Compound aCE; BRep_Builder().MakeCompound(aCE); - Standard_Integer i, aNbE = theEdges.Extent(); + Standard_Integer i = 0, aNbE = theEdges.Extent(); for (i = 1; i <= aNbE; ++i) { BRep_Builder().Add(aCE, theEdges(i)); } @@ -800,7 +802,7 @@ Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve, } // // for other curves take D1 and check for its length - Standard_Real aT, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter()); + Standard_Real aT = NAN, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter()); const Standard_Integer aNbP = 11; const Standard_Real aDt = (aT2 - aT1) / aNbP; // @@ -847,7 +849,7 @@ Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve, // for all other types of curve compute two tangent vectors // on the curve and cross them bFound = Standard_False; - Standard_Real aT, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter()); + Standard_Real aT = NAN, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter()); const Standard_Integer aNbP = 11; const Standard_Real aDt = (aT2 - aT1) / aNbP; // @@ -971,7 +973,7 @@ public: } //! Checks and accepts the pair of elements. - virtual Standard_Boolean Accept (const Standard_Integer theID1, + Standard_Boolean Accept (const Standard_Integer theID1, const Standard_Integer theID2) Standard_OVERRIDE { if (!RejectElement (theID1, theID2)) @@ -1145,14 +1147,14 @@ public: DEFINE_STANDARD_ALLOC //! Constructor - BOPAlgo_FillIn3DParts() + BOPAlgo_FillIn3DParts() : myBBTree(NULL), myVShapeBox(NULL) { - myBBTree = NULL; - myVShapeBox = NULL; + + }; //! Destructor - virtual ~BOPAlgo_FillIn3DParts() {}; + ~BOPAlgo_FillIn3DParts() override {}; //! Sets the solid void SetSolid(const TopoDS_Solid& theSolid) @@ -1215,7 +1217,7 @@ public: } //! Performs the classification - virtual void Perform(); + void Perform() override; //! Returns the faces classified as IN for solid const TopTools_ListOfShape& InFaces() const @@ -1309,7 +1311,7 @@ void BOPAlgo_FillIn3DParts::Perform() // 4. Classify faces relatively solid. // Store faces that are IN mySolid into - Standard_Integer k, aNbFP = aIVec.Length(); + Standard_Integer k = 0, aNbFP = aIVec.Length(); // Sort indices if necessary if (aNbFP > 1) std::sort(aIVec.begin(), aIVec.end()); diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx index c9dfc05ad0..b66d39e6b6 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx @@ -185,8 +185,8 @@ typedef NCollection_Vector BOPAlgo_VectorOfConnexityB //======================================================================= void BOPAlgo_WireSplitter::MakeWires(const Message_ProgressRange& theRange) { - Standard_Boolean bIsRegular; - Standard_Integer aNbVCB, k; + Standard_Boolean bIsRegular = 0; + Standard_Integer aNbVCB = 0, k = 0; TopoDS_Wire aW; BOPTools_ListIteratorOfListOfConnexityBlock aItCB; TopTools_ListIteratorOfListOfShape aIt; diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx index 6225ae596a..5636ceba7e 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -144,9 +146,9 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace, BOPTools_ConnexityBlock& aCB, const Handle(IntTools_Context)& theContext) { - Standard_Boolean bNothingToDo, bIsClosed, bIsIN; - Standard_Integer aIx, aNb, i, aCntIn, aCntOut; - Standard_Real aAngle; + Standard_Boolean bNothingToDo = 0, bIsClosed = 0, bIsIN = 0; + Standard_Integer aIx = 0, aNb = 0, i = 0, aCntIn = 0, aCntOut = 0; + Standard_Real aAngle = NAN; TopAbs_Orientation aOr; TopoDS_Iterator aItS; TopoDS_Vertex aVV; @@ -238,8 +240,8 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace, // We must check edges on TShape coincidence. // If there are such edges there is something to do with. if (bNothingToDo) { - Standard_Integer aNbE, aNbMapEE; - Standard_Boolean bFlag; + Standard_Integer aNbE = 0, aNbMapEE = 0; + Standard_Boolean bFlag = 0; // TopTools_IndexedDataMapOfShapeListOfShape aMapEE(100); aNbE=myEdges.Extent(); @@ -321,7 +323,7 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace, // // 4. Do // - Standard_Boolean bIsOut, bIsNotPassed; + Standard_Boolean bIsOut = 0, bIsNotPassed = 0; TopTools_SequenceOfShape aLS, aVertVa; TColgp_SequenceOfPnt2d aCoordVa; // @@ -363,11 +365,11 @@ void Path (const GeomAdaptor_Surface& aGAS, BOPTools_ConnexityBlock& aCB, BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo& mySmartMap) { - Standard_Integer i, j, aNb, aNbj; - Standard_Real anAngleIn, anAngleOut, anAngle, aMinAngle; - Standard_Real aTol2D, aTol2D2, aD2, aTwoPI; - Standard_Boolean anIsSameV2d, anIsSameV, anIsOut, anIsNotPassed; - Standard_Boolean bIsClosed; + Standard_Integer i = 0, j = 0, aNb = 0, aNbj = 0; + Standard_Real anAngleIn = NAN, anAngleOut = NAN, anAngle = NAN, aMinAngle = NAN; + Standard_Real aTol2D = NAN, aTol2D2 = NAN, aD2 = NAN, aTwoPI = NAN; + Standard_Boolean anIsSameV2d = 0, anIsSameV = 0, anIsOut = 0, anIsNotPassed = 0; + Standard_Boolean bIsClosed = 0; TopoDS_Vertex aVa, aVb; TopoDS_Edge aEOuta; BOPAlgo_ListIteratorOfListOfEdgeInfo anIt; @@ -452,7 +454,7 @@ void Path (const GeomAdaptor_Surface& aGAS, }//if (anIsSameV) { // if (anIsSameV && anIsSameV2d) { - Standard_Integer iPriz; + Standard_Integer iPriz = 0; iPriz=1; if (aBuf.Extent()==2) { if(aBuf.First().IsSame(aBuf.Last())) { @@ -592,7 +594,7 @@ void Path (const GeomAdaptor_Surface& aGAS, const Standard_Real aAngleOut) { Standard_Real aTwoPi=M_PI+M_PI; - Standard_Real dA, A1, A2, AIn, AOut ; + Standard_Real dA = NAN, A1 = NAN, A2 = NAN, AIn = NAN, AOut = NAN ; AIn=aAngleIn; AOut=aAngleOut; @@ -631,7 +633,7 @@ void Path (const GeomAdaptor_Surface& aGAS, const TopoDS_Edge& aE1, const TopoDS_Face& aF) { - Standard_Real aT, aFirst, aLast; + Standard_Real aT = NAN, aFirst = NAN, aLast = NAN; Handle(Geom2d_Curve) aC2D; gp_Pnt2d aP2D1; // @@ -671,7 +673,7 @@ void Path (const GeomAdaptor_Surface& aGAS, //======================================================================= Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo) { - Standard_Boolean bIsOut, bIsNotPassed; + Standard_Boolean bIsOut = 0, bIsNotPassed = 0; Standard_Integer iCnt=0; BOPAlgo_ListIteratorOfListOfEdgeInfo anIt; // @@ -695,8 +697,8 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo) Standard_Real AngleIn(const TopoDS_Edge& aEIn, const BOPAlgo_ListOfEdgeInfo& aLEInfo) { - Standard_Real anAngleIn; - Standard_Boolean anIsIn; + Standard_Real anAngleIn = NAN; + Standard_Boolean anIsIn = 0; BOPAlgo_ListIteratorOfListOfEdgeInfo anIt; anIt.Initialize(aLEInfo); @@ -744,7 +746,7 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo) const Standard_Boolean bIsIN, const Handle(IntTools_Context)& theContext) { - Standard_Real aFirst, aLast, aToler, dt, aTV, aTV1, anAngle, aTX; + Standard_Real aFirst = NAN, aLast = NAN, aToler = NAN, dt = NAN, aTV = NAN, aTV1 = NAN, anAngle = NAN, aTX = NAN; gp_Pnt2d aPV, aPV1; gp_Vec2d aV2D; Handle(Geom2d_Curve) aC2D; @@ -813,7 +815,7 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo) Standard_Real Angle (const gp_Dir2d& aDir2D) { gp_Dir2d aRefDir(1., 0.); - Standard_Real anAngle; + Standard_Real anAngle = NAN; anAngle = aRefDir.Angle(aDir2D); if (anAngle < 0.) @@ -827,7 +829,7 @@ Standard_Real Angle (const gp_Dir2d& aDir2D) Standard_Real Tolerance2D (const TopoDS_Vertex& aV, const GeomAdaptor_Surface& aGAS) { - Standard_Real aTol2D, anUr, aVr, aTolV3D; + Standard_Real aTol2D = NAN, anUr = NAN, aVr = NAN, aTolV3D = NAN; GeomAbs_SurfaceType aType; // aType=aGAS.GetType(); @@ -905,9 +907,9 @@ void RefineAngles(const TopoDS_Vertex& aV, BOPAlgo_ListOfEdgeInfo& aLEI, const Handle(IntTools_Context)& theContext) { - Standard_Boolean bIsIn, bIsBoundary, bRefined; - Standard_Integer iCntBnd, iCntInt; - Standard_Real aA, aA1, aA2; + Standard_Boolean bIsIn = 0, bIsBoundary = 0, bRefined = 0; + Standard_Integer iCntBnd = 0, iCntInt = 0; + Standard_Real aA = NAN, aA1 = NAN, aA2 = NAN; TopTools_DataMapOfShapeReal aDMSR; BOPAlgo_ListIteratorOfListOfEdgeInfo aItLEI; // @@ -1004,10 +1006,10 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV, Standard_Real& aA, const Handle(IntTools_Context)& theContext) { - Standard_Boolean bRet; - Standard_Integer i, j, aNbP; - Standard_Real aTV, aTol, aT1, aT2, dT, aAngle, aT, aTOp; - Standard_Real aTolInt, aAi, aXi, aYi, aT1j, aT2j, aT1max, aT2max, aCf; + Standard_Boolean bRet = 0; + Standard_Integer i = 0, j = 0, aNbP = 0; + Standard_Real aTV = NAN, aTol = NAN, aT1 = NAN, aT2 = NAN, dT = NAN, aAngle = NAN, aT = NAN, aTOp = NAN; + Standard_Real aTolInt = NAN, aAi = NAN, aXi = NAN, aYi = NAN, aT1j = NAN, aT2j = NAN, aT1max = NAN, aT2max = NAN, aCf = NAN; gp_Pnt2d aPV, aP, aP1, aP2; Handle(Geom2d_Curve) aC2D; Handle(Geom2d_Line) aLi; diff --git a/src/BOPDS/BOPDS_CommonBlock.cxx b/src/BOPDS/BOPDS_CommonBlock.cxx index 4625fbe98e..fdec86c1e3 100644 --- a/src/BOPDS/BOPDS_CommonBlock.cxx +++ b/src/BOPDS/BOPDS_CommonBlock.cxx @@ -143,7 +143,7 @@ void BOPDS_CommonBlock::SetRealPaveBlock(const Handle(BOPDS_PaveBlock)& thePB) { static Handle(BOPDS_PaveBlock) aPBs; // - Standard_Integer aIOr; + Standard_Integer aIOr = 0; BOPDS_ListIteratorOfListOfPaveBlock anIt; // anIt.Initialize(myPaveBlocks); @@ -162,8 +162,8 @@ void BOPDS_CommonBlock::SetRealPaveBlock(const Handle(BOPDS_PaveBlock)& thePB) //======================================================================= Standard_Boolean BOPDS_CommonBlock::IsPaveBlockOnFace(const Standard_Integer aIx)const { - Standard_Boolean bFound; - Standard_Integer nF; + Standard_Boolean bFound = 0; + Standard_Integer nF = 0; TColStd_ListIteratorOfListOfInteger anIt; // bFound=Standard_False; @@ -182,8 +182,8 @@ void BOPDS_CommonBlock::SetRealPaveBlock(const Handle(BOPDS_PaveBlock)& thePB) //======================================================================= Standard_Boolean BOPDS_CommonBlock::IsPaveBlockOnEdge(const Standard_Integer aIx)const { - Standard_Boolean bFound; - Standard_Integer aIOr; + Standard_Boolean bFound = 0; + Standard_Integer aIOr = 0; BOPDS_ListIteratorOfListOfPaveBlock anIt; // bFound=Standard_False; @@ -229,8 +229,8 @@ void BOPDS_CommonBlock::SetRealPaveBlock(const Handle(BOPDS_PaveBlock)& thePB) //======================================================================= Standard_Boolean BOPDS_CommonBlock::Contains(const Handle(BOPDS_PaveBlock)& aPBx)const { - Standard_Boolean bFound; - Standard_Integer aNb1; + Standard_Boolean bFound = 0; + Standard_Integer aNb1 = 0; BOPDS_ListIteratorOfListOfPaveBlock anIt; // bFound=Standard_False; @@ -255,7 +255,7 @@ void BOPDS_CommonBlock::SetRealPaveBlock(const Handle(BOPDS_PaveBlock)& thePB) //======================================================================= Standard_Boolean BOPDS_CommonBlock::Contains(const Standard_Integer theF)const { - Standard_Boolean bFound; + Standard_Boolean bFound = 0; TColStd_ListIteratorOfListOfInteger aIt; // bFound=Standard_False; @@ -273,7 +273,7 @@ void BOPDS_CommonBlock::SetRealPaveBlock(const Handle(BOPDS_PaveBlock)& thePB) //======================================================================= void BOPDS_CommonBlock::Dump()const { - Standard_Integer nF; + Standard_Integer nF = 0; TColStd_ListIteratorOfListOfInteger aIt; BOPDS_ListIteratorOfListOfPaveBlock aItPB; // diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index 9ad33e6fdd..7140f3c0b7 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -63,7 +65,7 @@ BOPDS_DS::BOPDS_DS() : myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()), myArguments(myAllocator), - myRanges(0,myAllocator), + myNbShapes(0), myNbSourceShapes(0), myRanges(0,myAllocator), myLines(0, myAllocator), myMapShapeIndex(100, myAllocator), myPaveBlocksPool(0,myAllocator), @@ -84,8 +86,8 @@ BOPDS_DS::BOPDS_DS() myInterfZZ(0, myAllocator), myInterfered(100, myAllocator) { - myNbShapes=0; - myNbSourceShapes=0; + + } //======================================================================= //function : @@ -95,7 +97,7 @@ BOPDS_DS::BOPDS_DS(const Handle(NCollection_BaseAllocator)& theAllocator) : myAllocator(theAllocator), myArguments(myAllocator), - myRanges(0, myAllocator), + myNbShapes(0), myNbSourceShapes(0), myRanges(0, myAllocator), myLines(0, myAllocator), myMapShapeIndex(100, myAllocator), myPaveBlocksPool(0, myAllocator), @@ -116,8 +118,8 @@ BOPDS_DS::BOPDS_DS(const Handle(NCollection_BaseAllocator)& theAllocator) myInterfZZ(0, myAllocator), myInterfered(100, myAllocator) { - myNbShapes=0; - myNbSourceShapes=0; + + } //======================================================================= //function : ~ @@ -221,7 +223,7 @@ const BOPDS_IndexRange& BOPDS_DS::Range(const Standard_Integer theI)const //======================================================================= Standard_Integer BOPDS_DS::Rank(const Standard_Integer theI)const { - Standard_Integer i, aNb, iErr; + Standard_Integer i = 0, aNb = 0, iErr = 0; // iErr=-1; aNb=NbRanges(); @@ -247,7 +249,7 @@ Standard_Boolean BOPDS_DS::IsNewShape(const Standard_Integer theI)const //======================================================================= Standard_Integer BOPDS_DS::Append(const BOPDS_ShapeInfo& theSI) { - Standard_Integer iX; + Standard_Integer iX = 0; // myLines.Appended()=theSI; iX=myLines.Length()-1; @@ -261,7 +263,7 @@ Standard_Integer BOPDS_DS::Append(const BOPDS_ShapeInfo& theSI) //======================================================================= Standard_Integer BOPDS_DS::Append(const TopoDS_Shape& theS) { - Standard_Integer iX; + Standard_Integer iX = 0; // myLines.Appended().SetShape(theS); iX=myLines.Length()-1; @@ -283,7 +285,7 @@ const BOPDS_ShapeInfo& BOPDS_DS::ShapeInfo //======================================================================= BOPDS_ShapeInfo& BOPDS_DS::ChangeShapeInfo(const Standard_Integer theI) { - BOPDS_ShapeInfo *pSI; + BOPDS_ShapeInfo *pSI = nullptr; // const BOPDS_ShapeInfo& aSI=ShapeInfo(theI); pSI=(BOPDS_ShapeInfo *)&aSI; @@ -305,7 +307,7 @@ const TopoDS_Shape& BOPDS_DS::Shape(const Standard_Integer theI)const //======================================================================= Standard_Integer BOPDS_DS::Index(const TopoDS_Shape& theS)const { - Standard_Integer iRet; + Standard_Integer iRet = 0; // iRet=-1; if (myMapShapeIndex.IsBound(theS)) { @@ -319,9 +321,9 @@ Standard_Integer BOPDS_DS::Index(const TopoDS_Shape& theS)const //======================================================================= void BOPDS_DS::Init(const Standard_Real theFuzz) { - Standard_Integer i1, i2, j, aI, aNb, aNbS, aNbE, aNbSx; - Standard_Integer n1, n2, n3, nV, nW, nE, aNbF; - Standard_Real aTol, aTolAdd; + Standard_Integer i1 = 0, i2 = 0, j = 0, aI = 0, aNb = 0, aNbS = 0, aNbE = 0, aNbSx = 0; + Standard_Integer n1 = 0, n2 = 0, n3 = 0, nV = 0, nW = 0, nE = 0, aNbF = 0; + Standard_Real aTol = NAN, aTolAdd = NAN; TopAbs_ShapeEnum aTS; TopoDS_Iterator aItS; TColStd_ListIteratorOfListOfInteger aIt1, aIt2, aIt3; @@ -408,9 +410,9 @@ void BOPDS_DS::Init(const Standard_Real theFuzz) aTol = BRep_Tool::Tolerance(aE); // if (!BRep_Tool::Degenerated(aE)) { - Standard_Boolean bInf1, bInf2; - Standard_Integer aIx; - Standard_Real aT1, aT2; + Standard_Boolean bInf1 = 0, bInf2 = 0; + Standard_Integer aIx = 0; + Standard_Real aT1 = NAN, aT2 = NAN; gp_Pnt aPx; Handle(Geom_Curve) aC3D; TopoDS_Vertex aVx; @@ -645,7 +647,7 @@ void BOPDS_DS::InitShape (const Standard_Integer aI, const TopoDS_Shape& aS) { - Standard_Integer aIx; + Standard_Integer aIx = 0; TopoDS_Iterator aIt; TColStd_ListIteratorOfListOfInteger aIt1; // @@ -683,8 +685,8 @@ Standard_Boolean BOPDS_DS::HasInterfShapeSubShapes const Standard_Integer theI2, const Standard_Boolean theFlag)const { - Standard_Boolean bRet; - Standard_Integer n2; + Standard_Boolean bRet = 0; + Standard_Integer n2 = 0; TColStd_ListIteratorOfListOfInteger aIt; bRet = Standard_False; // @@ -715,8 +717,8 @@ Standard_Boolean BOPDS_DS::HasInterfSubShapes (const Standard_Integer theI1, const Standard_Integer theI2)const { - Standard_Boolean bRet; - Standard_Integer n1; + Standard_Boolean bRet = 0; + Standard_Integer n1 = 0; TColStd_ListIteratorOfListOfInteger aIt; bRet = Standard_False; // @@ -766,7 +768,7 @@ const BOPDS_ListOfPaveBlock& BOPDS_DS::PaveBlocks (const Standard_Integer theI)const { static BOPDS_ListOfPaveBlock sLPB; - Standard_Integer aRef; + Standard_Integer aRef = 0; // if (HasPaveBlocks(theI)) { aRef=ShapeInfo(theI).Reference(); @@ -783,8 +785,8 @@ const BOPDS_ListOfPaveBlock& BOPDS_DS::PaveBlocks BOPDS_ListOfPaveBlock& BOPDS_DS::ChangePaveBlocks (const Standard_Integer theI) { - Standard_Boolean bHasReference; - Standard_Integer aRef; + Standard_Boolean bHasReference = 0; + Standard_Integer aRef = 0; // BOPDS_ShapeInfo& aSI=ChangeShapeInfo(theI); bHasReference=aSI.HasReference(); @@ -801,8 +803,8 @@ BOPDS_ListOfPaveBlock& BOPDS_DS::ChangePaveBlocks //======================================================================= void BOPDS_DS::InitPaveBlocks(const Standard_Integer theI) { - Standard_Integer nV=0, iRef, aNbV, nVSD; - Standard_Real aT; + Standard_Integer nV=0, iRef = 0, aNbV = 0, nVSD = 0; + Standard_Real aT = NAN; TopAbs_Orientation aOrE; TopoDS_Vertex aV; TColStd_ListIteratorOfListOfInteger aIt; @@ -894,7 +896,7 @@ void BOPDS_DS::InitPaveBlocks(const Standard_Integer theI) //======================================================================= void BOPDS_DS::UpdatePaveBlocks() { - Standard_Integer i, aNbPBP; + Standard_Integer i = 0, aNbPBP = 0; BOPDS_ListOfPaveBlock aLPBN(myAllocator); BOPDS_ListIteratorOfListOfPaveBlock aItPB; // @@ -932,7 +934,7 @@ void BOPDS_DS::UpdatePaveBlock(const Handle(BOPDS_PaveBlock)& thePB) return; } // - Standard_Integer nE, iRef; + Standard_Integer nE = 0, iRef = 0; BOPDS_ListIteratorOfListOfPaveBlock aItPB, aItPBN; BOPDS_ListOfPaveBlock aLPBN(myAllocator); Handle(BOPDS_PaveBlock) aPB; @@ -962,7 +964,7 @@ void BOPDS_DS::UpdatePaveBlock(const Handle(BOPDS_PaveBlock)& thePB) void BOPDS_DS::UpdateCommonBlock(const Handle(BOPDS_CommonBlock)& theCB, const Standard_Real theFuzz) { - Standard_Integer nE, iRef, n1, n2; + Standard_Integer nE = 0, iRef = 0, n1 = 0, n2 = 0; BOPDS_ListIteratorOfListOfPaveBlock aItPB, aItPBCB, aItPBN; BOPDS_ListOfPaveBlock aLPBN; NCollection_DataMap aMPKLPB; @@ -1024,7 +1026,7 @@ void BOPDS_DS::UpdateCommonBlock(const Handle(BOPDS_CommonBlock)& theCB, BOPDS_ListOfPaveBlock& aLPBx=aItMPKLPB.ChangeValue(); // while (aLPBx.Extent()) { - Standard_Boolean bCoinside; + Standard_Boolean bCoinside = 0; BOPDS_ListOfPaveBlock aLPBxN; // aItPB.Initialize(aLPBx); @@ -1152,7 +1154,7 @@ Standard_Boolean BOPDS_DS::HasFaceInfo(const Standard_Integer theI)const const BOPDS_FaceInfo& BOPDS_DS::FaceInfo(const Standard_Integer theI)const { static BOPDS_FaceInfo sFI; - Standard_Integer aRef; + Standard_Integer aRef = 0; // if (HasFaceInfo(theI)) { aRef=ShapeInfo(theI).Reference(); @@ -1167,9 +1169,9 @@ const BOPDS_FaceInfo& BOPDS_DS::FaceInfo(const Standard_Integer theI)const //======================================================================= BOPDS_FaceInfo& BOPDS_DS::ChangeFaceInfo(const Standard_Integer theI) { - Standard_Boolean bHasReference; - Standard_Integer aRef; - BOPDS_FaceInfo* pFI; + Standard_Boolean bHasReference = 0; + Standard_Integer aRef = 0; + BOPDS_FaceInfo* pFI = nullptr; // BOPDS_ShapeInfo& aSI=ChangeShapeInfo(theI); bHasReference=aSI.HasReference(); @@ -1188,7 +1190,7 @@ BOPDS_FaceInfo& BOPDS_DS::ChangeFaceInfo(const Standard_Integer theI) //======================================================================= void BOPDS_DS::InitFaceInfo(const Standard_Integer theI) { - Standard_Integer iRef; + Standard_Integer iRef = 0; // BOPDS_ShapeInfo& aSI=ChangeShapeInfo(theI); BOPDS_FaceInfo &aFI=myFaceInfoPool.Appended(); @@ -1229,7 +1231,7 @@ void BOPDS_DS::InitFaceInfoIn (const Standard_Integer theI) //======================================================================= void BOPDS_DS::UpdateFaceInfoIn(const Standard_Integer theI) { - Standard_Integer iRef; + Standard_Integer iRef = 0; // BOPDS_ShapeInfo& aSI=ChangeShapeInfo(theI); if (aSI.HasReference()) { @@ -1249,7 +1251,7 @@ void BOPDS_DS::UpdateFaceInfoIn(const Standard_Integer theI) //======================================================================= void BOPDS_DS::UpdateFaceInfoOn(const Standard_Integer theI) { - Standard_Integer iRef; + Standard_Integer iRef = 0; // BOPDS_ShapeInfo& aSI=ChangeShapeInfo(theI); if (aSI.HasReference()) { @@ -1271,7 +1273,7 @@ void BOPDS_DS::FaceInfoOn(const Standard_Integer theF, BOPDS_IndexedMapOfPaveBlock& theMPB, TColStd_MapOfInteger& theMI) { - Standard_Integer nS, nSD, nV1, nV2; + Standard_Integer nS = 0, nSD = 0, nV1 = 0, nV2 = 0; TColStd_ListIteratorOfListOfInteger aIt; BOPDS_ListIteratorOfListOfPaveBlock aItPB; // @@ -1310,7 +1312,7 @@ void BOPDS_DS::FaceInfoIn(const Standard_Integer theF, BOPDS_IndexedMapOfPaveBlock& theMPB, TColStd_MapOfInteger& theMI) { - Standard_Integer i, aNbVF, aNbEF, nV, nE, nVSD; + Standard_Integer i = 0, aNbVF = 0, aNbEF = 0, nV = 0, nE = 0, nVSD = 0; TopoDS_Iterator aItS; BOPDS_ListIteratorOfListOfPaveBlock aItPB; // @@ -1421,7 +1423,7 @@ void BOPDS_DS::UpdateFaceInfoIn (const TColStd_MapOfInteger& theFaces) if (theFaces.Contains (nF)) { BOPDS_FaceInfo& aFI = myFaceInfoPool (ShapeInfo (nF).Reference()); - Standard_Integer nVNew; + Standard_Integer nVNew = 0; if (aEF.HasIndexNew (nVNew)) { HasShapeSD (nVNew, nVNew); @@ -1478,7 +1480,7 @@ void BOPDS_DS::UpdateFaceInfoOn (const TColStd_MapOfInteger& theFaces) //======================================================================= void BOPDS_DS::RefineFaceInfoOn() { - Standard_Integer i, aNb, nF, aNbPB, j; + Standard_Integer i = 0, aNb = 0, nF = 0, aNbPB = 0, j = 0; BOPDS_IndexedMapOfPaveBlock aMPB; // aNb=myFaceInfoPool.Length(); @@ -1548,7 +1550,7 @@ void BOPDS_DS::AloneVertices(const Standard_Integer theI, { if (HasFaceInfo(theI)) { // - Standard_Integer i, j, nV1, nV2, nV, aNbPB; + Standard_Integer i = 0, j = 0, nV1 = 0, nV2 = 0, nV = 0, aNbPB = 0; TColStd_MapIteratorOfMapOfInteger aItMI; // TColStd_MapOfInteger aMI(100, myAllocator); @@ -1593,7 +1595,7 @@ void BOPDS_DS::SubShapesOnIn(const Standard_Integer theNF1, BOPDS_IndexedMapOfPaveBlock& thePBOnIn, BOPDS_MapOfPaveBlock& theCommonPB)const { - Standard_Integer i, j, nV, nV1, nV2, aNbPB; + Standard_Integer i = 0, j = 0, nV = 0, nV1 = 0, nV2 = 0, aNbPB = 0; TColStd_MapIteratorOfMapOfInteger aIt; BOPDS_IndexedMapOfPaveBlock pMPB[4]; // @@ -1660,7 +1662,7 @@ void BOPDS_DS::SharedEdges(const Standard_Integer nF1, TColStd_ListOfInteger& theLI, const Handle(NCollection_BaseAllocator)& aAllocator) { - Standard_Integer nE, nSp; + Standard_Integer nE = 0, nSp = 0; TColStd_ListIteratorOfListOfInteger aItLI; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; TColStd_MapOfInteger aMI(100, aAllocator); @@ -1759,7 +1761,7 @@ Standard_Boolean BOPDS_DS::HasShapeSD //======================================================================= void BOPDS_DS::Dump()const { - Standard_Integer i, aNb, aNbSS; + Standard_Integer i = 0, aNb = 0, aNbSS = 0; // printf(" *** DS ***\n"); aNb=NbRanges(); @@ -1794,9 +1796,9 @@ Standard_Boolean BOPDS_DS::CheckCoincidence const Handle(BOPDS_PaveBlock)& aPB2, const Standard_Real theFuzz) { - Standard_Boolean bRet; - Standard_Integer nE1, nE2, aNbPoints; - Standard_Real aT11, aT12, aT21, aT22, aT1m, aD, aTol, aT2x; + Standard_Boolean bRet = 0; + Standard_Integer nE1 = 0, nE2 = 0, aNbPoints = 0; + Standard_Real aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN, aT1m = NAN, aD = NAN, aTol = NAN, aT2x = NAN; gp_Pnt aP1m; // bRet=Standard_False; @@ -1811,7 +1813,7 @@ Standard_Boolean BOPDS_DS::CheckCoincidence nE2=aPB2->OriginalEdge(); const TopoDS_Edge& aE2=(*(TopoDS_Edge*)(&Shape(nE2))); // - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve)aC2 = BRep_Tool::Curve (aE2, f, l); GeomAPI_ProjectPointOnCurve aPPC; aPPC.Init(aC2, f, l); @@ -1839,8 +1841,8 @@ Standard_Boolean BOPDS_DS::IsSubShape (const Standard_Integer theI1, const Standard_Integer theI2) { - Standard_Boolean bRet; - Standard_Integer nS; + Standard_Boolean bRet = 0; + Standard_Integer nS = 0; bRet = Standard_False; // TColStd_ListIteratorOfListOfInteger aItLI; @@ -1865,7 +1867,7 @@ Standard_Boolean BOPDS_DS::IsSubShape void BOPDS_DS::Paves(const Standard_Integer theEdge, BOPDS_ListOfPave& theLP) { - Standard_Integer aNb, i; + Standard_Integer aNb = 0, i = 0; BOPDS_ListIteratorOfListOfPaveBlock aIt; BOPDS_MapOfPave aMP; // @@ -1929,7 +1931,7 @@ void TotalShapes(const TopoDS_Shape& aS, Standard_Real ComputeParameter(const TopoDS_Vertex& aV, const TopoDS_Edge& aE) { - Standard_Real aT1, aT2, aTRet, aTolE2, aD2; + Standard_Real aT1 = NAN, aT2 = NAN, aTRet = NAN, aTolE2 = NAN, aD2 = NAN; gp_Pnt aPC, aPV; Handle(Geom_Curve) aC3D; TopoDS_Edge aEE; @@ -1968,9 +1970,9 @@ void BOPDS_DS::BuildBndBoxSolid(const Standard_Integer theIndex, Bnd_Box& aBoxS, const Standard_Boolean theCheckInverted) { - Standard_Boolean bIsOpenBox, bIsInverted; - Standard_Integer nSh, nFc; - Standard_Real aTolS, aTolFc; + Standard_Boolean bIsOpenBox = 0, bIsInverted = 0; + Standard_Integer nSh = 0, nFc = 0; + Standard_Real aTolS = NAN, aTolFc = NAN; TColStd_ListIteratorOfListOfInteger aItLI, aItLI1; // const BOPDS_ShapeInfo& aSI=ShapeInfo(theIndex); @@ -2044,7 +2046,7 @@ void BOPDS_DS::BuildBndBoxSolid(const Standard_Integer theIndex, //======================================================================= void BOPDS_DS::UpdatePaveBlocksWithSDVertices() { - Standard_Integer i, aNbPBP; + Standard_Integer i = 0, aNbPBP = 0; BOPDS_ListIteratorOfListOfPaveBlock aItPB; // BOPDS_VectorOfListOfPaveBlock& aPBP=myPaveBlocksPool; @@ -2067,7 +2069,7 @@ void BOPDS_DS::UpdatePaveBlocksWithSDVertices() void BOPDS_DS::UpdatePaveBlockWithSDVertices (const Handle(BOPDS_PaveBlock)& thePB) { - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; BOPDS_Pave aPave1, aPave2; // aPave1 = thePB->Pave1(); @@ -2142,7 +2144,7 @@ void BOPDS_DS::ReleasePaveBlocks() if (aLPB.Extent() == 1) { const Handle(BOPDS_PaveBlock)& aPB = aLPB.First(); if (!IsCommonBlock(aPB)) { - Standard_Integer nV1, nV2; + Standard_Integer nV1 = 0, nV2 = 0; aPB->Indices(nV1, nV2); if (!IsNewShape(nV1) && !IsNewShape(nV2)) { // Both vertices are original, thus the PB is untouched. @@ -2174,7 +2176,7 @@ Standard_Boolean BOPDS_DS::IsValidShrunkData(const Handle(BOPDS_PaveBlock)& theP // Shrunk range Standard_Real aTS[2]; Bnd_Box aBox; - Standard_Boolean bIsSplit; + Standard_Boolean bIsSplit = 0; // thePB->ShrunkData(aTS[0], aTS[1], aBox, bIsSplit); // diff --git a/src/BOPDS/BOPDS_Iterator.cxx b/src/BOPDS/BOPDS_Iterator.cxx index b0adff25bc..51473956bc 100644 --- a/src/BOPDS/BOPDS_Iterator.cxx +++ b/src/BOPDS/BOPDS_Iterator.cxx @@ -43,7 +43,7 @@ class BOPDS_TSR : public BOPTools_BoxTreeSelector myHasBRep(Standard_False), myIndex(-1) {} // - virtual ~BOPDS_TSR() { + ~BOPDS_TSR() override { } // void SetHasBRep(const Standard_Boolean bFlag) { @@ -76,13 +76,13 @@ typedef NCollection_Vector BOPDS_VectorOfTSR; BOPDS_Iterator::BOPDS_Iterator() : myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()), - myRunParallel(Standard_False), + myDS(NULL), myLength(0), myRunParallel(Standard_False), myUseExt(Standard_False) { - Standard_Integer i, aNb; + Standard_Integer i = 0, aNb = 0; // - myDS=NULL; - myLength=0; + + // aNb=BOPDS_DS::NbInterfTypes(); myLists.SetIncrement(aNb); @@ -104,15 +104,15 @@ BOPDS_Iterator::BOPDS_Iterator (const Handle(NCollection_BaseAllocator)& theAllocator) : myAllocator(theAllocator), - myLists(0, theAllocator), + myDS(NULL), myLength(0), myLists(0, theAllocator), myRunParallel(Standard_False), myExtLists(0, theAllocator), myUseExt(Standard_False) { - Standard_Integer i, aNb; + Standard_Integer i = 0, aNb = 0; // - myDS=NULL; - myLength=0; + + // aNb=BOPDS_DS::NbInterfTypes(); myLists.SetIncrement(aNb); @@ -179,7 +179,7 @@ Standard_Integer BOPDS_Iterator::ExpectedLength() const //======================================================================= Standard_Integer BOPDS_Iterator::BlockLength() const { - Standard_Integer aNbIIs; + Standard_Integer aNbIIs = 0; Standard_Real aCfPredict=.5; aNbIIs=ExpectedLength(); @@ -198,7 +198,7 @@ Standard_Integer BOPDS_Iterator::BlockLength() const void BOPDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1, const TopAbs_ShapeEnum aType2) { - Standard_Integer iX; + Standard_Integer iX = 0; // myLength=0; iX=BOPDS_Tools::TypeToInteger(aType1, aType2); @@ -236,7 +236,7 @@ void BOPDS_Iterator::Next() void BOPDS_Iterator::Value(Standard_Integer& theI1, Standard_Integer& theI2) const { - Standard_Integer iT1, iT2, n1, n2; + Standard_Integer iT1 = 0, iT2 = 0, n1 = 0, n2 = 0; // const BOPDS_Pair& aPair = myIterator.Value(); aPair.Indices(n1, n2); @@ -259,7 +259,7 @@ void BOPDS_Iterator::Prepare(const Handle(IntTools_Context)& theCtx, const Standard_Boolean theCheckOBB, const Standard_Real theFuzzyValue) { - Standard_Integer i, aNbInterfTypes; + Standard_Integer i = 0, aNbInterfTypes = 0; // aNbInterfTypes=BOPDS_DS::NbInterfTypes(); myLength=0; diff --git a/src/BOPDS/BOPDS_IteratorSI.cxx b/src/BOPDS/BOPDS_IteratorSI.cxx index 581c74569d..7419a776be 100644 --- a/src/BOPDS/BOPDS_IteratorSI.cxx +++ b/src/BOPDS/BOPDS_IteratorSI.cxx @@ -57,7 +57,7 @@ BOPDS_IteratorSI::~BOPDS_IteratorSI() //======================================================================= void BOPDS_IteratorSI::UpdateByLevelOfCheck(const Standard_Integer theLevel) { - Standard_Integer i, aNbInterfTypes; + Standard_Integer i = 0, aNbInterfTypes = 0; // aNbInterfTypes=BOPDS_DS::NbInterfTypes(); for (i=theLevel+1; iIndices(n21, n22); @@ -256,7 +256,7 @@ void BOPDS_PaveBlock::RemoveExtPave(const Standard_Integer theVertNum) const Standard_Real theTol, Standard_Integer& theInd) const { - Standard_Boolean bRet; + Standard_Boolean bRet = 0; BOPDS_ListIteratorOfListOfPave aIt; // bRet = Standard_False; @@ -278,7 +278,7 @@ void BOPDS_PaveBlock::RemoveExtPave(const Standard_Integer theVertNum) void BOPDS_PaveBlock::Update(BOPDS_ListOfPaveBlock& theLPB, const Standard_Boolean theFlag) { - Standard_Integer i, aNb; + Standard_Integer i = 0, aNb = 0; BOPDS_Pave aPave1, aPave2; Handle(BOPDS_PaveBlock) aPB; BOPDS_ListIteratorOfListOfPave aIt; diff --git a/src/BOPDS/BOPDS_SubIterator.cxx b/src/BOPDS/BOPDS_SubIterator.cxx index 479c65f778..95a528ac8d 100644 --- a/src/BOPDS/BOPDS_SubIterator.cxx +++ b/src/BOPDS/BOPDS_SubIterator.cxx @@ -32,9 +32,9 @@ BOPDS_SubIterator::BOPDS_SubIterator() : myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()), - myList(1, myAllocator) + myDS(NULL), myList(1, myAllocator) { - myDS=NULL; + } //======================================================================= //function : BOPDS_SubIterator @@ -43,9 +43,9 @@ BOPDS_SubIterator::BOPDS_SubIterator(const Handle(NCollection_BaseAllocator)& theAllocator) : myAllocator(theAllocator), - myList(1, myAllocator) + myDS(NULL), myList(1, myAllocator) { - myDS=NULL; + } //======================================================================= //function : ~ @@ -72,7 +72,7 @@ void BOPDS_SubIterator::Initialize() void BOPDS_SubIterator::Value(Standard_Integer& theI1, Standard_Integer& theI2) const { - Standard_Integer iT1, iT2, n1, n2; + Standard_Integer iT1 = 0, iT2 = 0, n1 = 0, n2 = 0; // const BOPDS_Pair& aPKB = myIterator.Value(); aPKB.Indices(n1, n2); diff --git a/src/BOPDS/BOPDS_SubIterator.hxx b/src/BOPDS/BOPDS_SubIterator.hxx index df3070771f..b87b74642e 100644 --- a/src/BOPDS/BOPDS_SubIterator.hxx +++ b/src/BOPDS/BOPDS_SubIterator.hxx @@ -121,8 +121,8 @@ protected: BOPDS_PDS myDS; BOPDS_VectorOfPair myList; BOPDS_VectorOfPair::Iterator myIterator; - TColStd_ListOfInteger* mySubSet1; - TColStd_ListOfInteger* mySubSet2; + TColStd_ListOfInteger* mySubSet1{}; + TColStd_ListOfInteger* mySubSet2{}; private: diff --git a/src/BOPTools/BOPTools_AlgoTools.cxx b/src/BOPTools/BOPTools_AlgoTools.cxx index 78322a73c5..19a6de34cc 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/BOPTools/BOPTools_AlgoTools.cxx @@ -16,6 +16,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -355,8 +357,8 @@ void BOPTools_AlgoTools::OrientEdgesOnWire(TopoDS_Shape& theWire) //======================================================================= void BOPTools_AlgoTools::OrientFacesOnShell (TopoDS_Shape& aShell) { - Standard_Boolean bIsProcessed1, bIsProcessed2; - Standard_Integer i, aNbE, aNbF, j; + Standard_Boolean bIsProcessed1 = 0, bIsProcessed2 = 0; + Standard_Integer i = 0, aNbE = 0, aNbF = 0, j = 0; TopAbs_Orientation anOrE1, anOrE2; TopoDS_Face aF1x, aF2x; TopoDS_Shape aShellNew; @@ -509,7 +511,7 @@ void BOPTools_AlgoTools::MakeConnexityBlock TopTools_ListOfShape& theLCB, const Handle(NCollection_BaseAllocator)& theAllocator) { - Standard_Integer aNbF, aNbAdd1, aNbAdd, i; + Standard_Integer aNbF = 0, aNbAdd1 = 0, aNbAdd = 0, i = 0; TopExp_Explorer aExp; TopTools_ListIteratorOfListOfShape aIt; // @@ -701,7 +703,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeState const Standard_Real theTol, const Handle(IntTools_Context)& theContext) { - Standard_Real aT1, aT2, aT = 0.; + Standard_Real aT1 = NAN, aT2 = NAN, aT = 0.; TopAbs_State aState; Handle(Geom_Curve) aC3D; gp_Pnt aP3D; @@ -717,7 +719,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeState aP3D=BRep_Tool::Pnt(aV); } else {//usual case - Standard_Boolean bF2Inf, bL2Inf; + Standard_Boolean bF2Inf = 0, bL2Inf = 0; Standard_Real dT=10.; // bF2Inf = Precision::IsNegativeInfinite(aT1); @@ -773,7 +775,7 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace const Standard_Real theTol, const Handle(IntTools_Context)& theContext) { - Standard_Boolean bDegenerated; + Standard_Boolean bDegenerated = 0; TopAbs_Orientation aOr; TopoDS_Edge aE1; TopExp_Explorer aExp; @@ -854,7 +856,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace TopTools_ListOfShape& theLF, const Handle(IntTools_Context)& theContext) { - Standard_Integer aNbF, iRet; + Standard_Integer aNbF = 0, iRet = 0; // iRet=0; // @@ -949,9 +951,9 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff TopoDS_Face& theFOff, const Handle(IntTools_Context)& theContext) { - Standard_Boolean bRet, bIsComputed; - Standard_Real aT, aT1, aT2, aAngle, aTwoPI, aAngleMin, aDt3D; - Standard_Real aUmin, aUsup, aVmin, aVsup; + Standard_Boolean bRet = 0, bIsComputed = 0; + Standard_Real aT = NAN, aT1 = NAN, aT2 = NAN, aAngle = NAN, aTwoPI = NAN, aAngleMin = NAN, aDt3D = NAN; + Standard_Real aUmin = NAN, aUsup = NAN, aVmin = NAN, aVsup = NAN; gp_Pnt aPn1, aPn2, aPx; gp_Dir aDN1, aDN2, aDBF, aDBF2, aDTF; gp_Vec aVTgt; @@ -1044,7 +1046,7 @@ Standard_Boolean BOPTools_AlgoTools::GetEdgeOff(const TopoDS_Edge& theE1, const TopoDS_Face& theF2, TopoDS_Edge& theE2) { - Standard_Boolean bFound; + Standard_Boolean bFound = 0; TopAbs_Orientation aOr1, aOr1C, aOr2; TopExp_Explorer anExp; // @@ -1191,7 +1193,7 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse const Handle(IntTools_Context)& theContext, Standard_Integer *theError) { - Standard_Boolean bRet; + Standard_Boolean bRet = 0; TopAbs_ShapeEnum aType; // bRet=Standard_False; @@ -1229,7 +1231,7 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverseWithWarn(const TopoDS_Shape const Handle(IntTools_Context)& theContext, const Handle(Message_Report)& theReport) { - Standard_Integer anErr; + Standard_Integer anErr = 0; Standard_Boolean isToReverse = BOPTools_AlgoTools::IsSplitToReverse(theSplit, theShape, theContext, &anErr); if (anErr != 0 && !theReport.IsNull()) { @@ -1271,7 +1273,7 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse gp_Pnt2d aP2DFSp; // // Error status - Standard_Integer iErr; + Standard_Integer iErr = 0; // Use the hatcher to find the point in the middle of the face iErr = BOPTools_AlgoTools3D::PointInFace(theFSp, aPFSp, aP2DFSp, theContext); if (iErr) { @@ -1323,7 +1325,7 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse return bDone; } // UV coordinates of the point on the original face - Standard_Real aU, aV; + Standard_Real aU = NAN, aV = NAN; aProjector.LowerDistanceParameters(aU, aV); // // Compute normal direction for the original face in this point @@ -1370,7 +1372,7 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse *theError = 0; // Get the curves from the edges - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) aCSp = BRep_Tool::Curve(theESp, f, l); Handle(Geom_Curve) aCOr = BRep_Tool::Curve(theEOr, f, l); @@ -1402,7 +1404,7 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse } // Find corresponding parameter on the original edge - Standard_Real aTmOr; + Standard_Real aTmOr = NAN; if (!theContext->ProjectPointOnEdge(aCSp->Value(aTm), theEOr, aTmOr)) { // Unable to project the point inside the split edge @@ -1439,11 +1441,11 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW, const TopoDS_Shape& aFace) { - Standard_Boolean bIsHole; - Standard_Integer i, aNbS; - Standard_Real aT1, aT2, aS; - Standard_Real aU1, aU, dU; - Standard_Real aX1, aY1, aX0, aY0; + Standard_Boolean bIsHole = 0; + Standard_Integer i = 0, aNbS = 0; + Standard_Real aT1 = NAN, aT2 = NAN, aS = NAN; + Standard_Real aU1 = NAN, aU = NAN, dU = NAN; + Standard_Real aX1 = NAN, aY1 = NAN, aX0 = NAN, aY0 = NAN; TopAbs_Orientation aOr; gp_Pnt2d aP2D0, aP2D1; @@ -1566,12 +1568,12 @@ void BOPTools_AlgoTools::MakePCurve(const TopoDS_Edge& aE, const Handle(IntTools_Context)& theContext) { - Standard_Integer i; - Standard_Real aTolE, aT1, aT2, aOutFirst, aOutLast, aOutTol; + Standard_Integer i = 0; + Standard_Real aTolE = NAN, aT1 = NAN, aT2 = NAN, aOutFirst = NAN, aOutLast = NAN, aOutTol = NAN; Handle(Geom2d_Curve) aC2D, aC2DA, aC2Dx1; TopoDS_Face aFFWD; BRep_Builder aBB; - Standard_Boolean bPC; + Standard_Boolean bPC = 0; // aTolE=BRep_Tool::Tolerance(aE); // @@ -1649,7 +1651,7 @@ Standard_Integer BOPTools_AlgoTools::ComputeVV(const TopoDS_Vertex& aV1, const gp_Pnt& aP2, const Standard_Real aTolP2) { - Standard_Real aTolV1, aTolSum, aTolSum2, aD2; + Standard_Real aTolV1 = NAN, aTolSum = NAN, aTolSum2 = NAN, aD2 = NAN; gp_Pnt aP1; // aTolV1=BRep_Tool::Tolerance(aV1); @@ -1673,7 +1675,7 @@ Standard_Integer BOPTools_AlgoTools::ComputeVV(const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV2, const Standard_Real aFuzz) { - Standard_Real aTolV1, aTolV2, aTolSum, aTolSum2, aD2; + Standard_Real aTolV1 = NAN, aTolV2 = NAN, aTolSum = NAN, aTolSum2 = NAN, aD2 = NAN; gp_Pnt aP1, aP2; Standard_Real aFuzz1 = (aFuzz > Precision::Confusion() ? aFuzz : Precision::Confusion()); // @@ -1703,7 +1705,7 @@ void BOPTools_AlgoTools::MakeVertex(const TopTools_ListOfShape& aLV, aVnew=*((TopoDS_Vertex*)(&aLV.First())); else if (aNb > 1) { - Standard_Real aNTol; + Standard_Real aNTol = NAN; gp_Pnt aNC; BRepLib::BoundingVertex(aLV, aNC, aNTol); BRep_Builder aBB; @@ -1719,7 +1721,7 @@ Standard_Boolean BOPTools_AlgoTools::GetEdgeOnFace const TopoDS_Face& theF2, TopoDS_Edge& theE2) { - Standard_Boolean bFound; + Standard_Boolean bFound = 0; TopoDS_Iterator aItF, aItW; // bFound=Standard_False; @@ -1748,8 +1750,8 @@ Standard_Boolean FindFacePairs (const TopoDS_Edge& theE, BOPTools_ListOfCoupleOfShape& theLCFF, const Handle(IntTools_Context)& theContext) { - Standard_Boolean bFound; - Standard_Integer i, aNbCEF; + Standard_Boolean bFound = 0; + Standard_Integer i = 0, aNbCEF = 0; TopAbs_Orientation aOr, aOrC = TopAbs_FORWARD; TopTools_MapOfShape aMFP; TopoDS_Face aF1, aF2; @@ -1839,7 +1841,7 @@ Standard_Real AngleWithRef(const gp_Dir& theD1, const gp_Dir& theD2, const gp_Dir& theDRef) { - Standard_Real aCosinus, aSinus, aBeta, aHalfPI, aScPr; + Standard_Real aCosinus = NAN, aSinus = NAN, aBeta = NAN, aHalfPI = NAN, aScPr = NAN; gp_XYZ aXYZ; // aHalfPI=0.5*M_PI; @@ -1874,13 +1876,13 @@ Standard_Boolean BOPTools_AlgoTools::IsBlockInOnFace const TopoDS_Edge& aE1, const Handle(IntTools_Context)& aContext) { - Standard_Boolean bFlag; - Standard_Real f1, l1, ULD, VLD; + Standard_Boolean bFlag = 0; + Standard_Real f1 = NAN, l1 = NAN, ULD = NAN, VLD = NAN; gp_Pnt2d aP2D; gp_Pnt aP11, aP12; // aShrR.Range(f1, l1); - Standard_Real dt=0.0075, k;//dt=0.001, k; + Standard_Real dt=0.0075, k = NAN;//dt=0.001, k; k=dt*(l1-f1); f1=f1+k; l1=l1-k; @@ -1925,7 +1927,7 @@ Standard_Boolean BOPTools_AlgoTools::IsBlockInOnFace } // // Treatment intemediate - Standard_Real m1, aTolF, aTolE, aTol, aDist; + Standard_Real m1 = NAN, aTolF = NAN, aTolE = NAN, aTol = NAN, aDist = NAN; m1=IntTools_Tools::IntermediatePoint(f1, l1); BOPTools_AlgoTools::PointOnEdge(aE1, m1, aP12); // @@ -1964,8 +1966,8 @@ Standard_Boolean BOPTools_AlgoTools::IsMicroEdge const Handle(IntTools_Context)& aCtx, const Standard_Boolean bCheckSplittable) { - Standard_Boolean bRet; - Standard_Real aT1, aT2, aTmp; + Standard_Boolean bRet = 0; + Standard_Real aT1 = NAN, aT2 = NAN, aTmp = NAN; Handle(Geom_Curve) aC3D; TopoDS_Vertex aV1, aV2; // @@ -2013,7 +2015,7 @@ Standard_Boolean GetFaceDir(const TopoDS_Edge& aE, GeomAPI_ProjectPointOnSurf& aProjPL, const Standard_Real aDt) { - Standard_Real aTolE; + Standard_Real aTolE = NAN; gp_Pnt aPx; // BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE, aF, aT, aDN, theContext); @@ -2058,9 +2060,9 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF, const Standard_Real aDt, const Standard_Real aTolE) { - Standard_Integer aNbItMax; - Standard_Real aDist, aDTol, aPM, anEps; - Standard_Boolean bRet; + Standard_Integer aNbItMax = 0; + Standard_Real aDist = NAN, aDTol = NAN, aPM = NAN, anEps = NAN; + Standard_Boolean bRet = 0; gp_Pnt aP1, aPS; // aDTol = Precision::Angular(); @@ -2126,7 +2128,7 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1, const Handle(IntTools_Context)& theContext, Standard_Boolean& theSmallFaces) { - Standard_Real aDt, aTolE, aTolF, aDtMax, aDtMin; + Standard_Real aDt = NAN, aTolE = NAN, aTolF = NAN, aDtMax = NAN, aDtMin = NAN; // // add the current pair of edge/face for checking as well BOPTools_CoupleOfShape aCS1; @@ -2197,7 +2199,7 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1, // const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(aF); // - Standard_Real aUMin, aUMax, aVMin, aVMax; + Standard_Real aUMin = NAN, aUMax = NAN, aVMin = NAN, aVMax = NAN; theContext->UVBounds(aF, aUMin, aUMax, aVMin, aVMax); // Standard_Real aDU = aUMax - aUMin; @@ -2227,8 +2229,8 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1, //======================================================================= Standard_Boolean BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh) { - Standard_Boolean bRet; - Standard_Integer i, aNbE, aNbF; + Standard_Boolean bRet = 0; + Standard_Integer i = 0, aNbE = 0, aNbF = 0; TopAbs_Orientation aOrF; TopTools_IndexedDataMapOfShapeListOfShape aMEF; TopTools_ListIteratorOfListOfShape aItLS; @@ -2271,7 +2273,7 @@ Standard_Boolean BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh) Standard_Boolean BOPTools_AlgoTools::IsInvertedSolid (const TopoDS_Solid& aSolid) { - Standard_Real aTolS; + Standard_Real aTolS = NAN; TopAbs_State aState; BRepClass3d_SolidClassifier aSC(aSolid); // diff --git a/src/BOPTools/BOPTools_AlgoTools2D.cxx b/src/BOPTools/BOPTools_AlgoTools2D.cxx index 9bcafe1c33..127069afbd 100644 --- a/src/BOPTools/BOPTools_AlgoTools2D.cxx +++ b/src/BOPTools/BOPTools_AlgoTools2D.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -55,9 +57,9 @@ void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE, { BRep_Builder aBB; Handle(Geom2d_Curve) aC2D; - Standard_Real aTolPC, aTolFact, aTolEdge, aFirst, aLast; + Standard_Real aTolPC = NAN, aTolFact = NAN, aTolEdge = NAN, aFirst = NAN, aLast = NAN; - Standard_Boolean aHasOld; + Standard_Boolean aHasOld = 0; aHasOld=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF, aC2D, aFirst, aLast, aTolEdge); @@ -85,8 +87,8 @@ Standard_Boolean BOPTools_AlgoTools2D::EdgeTangent const Standard_Real aT, gp_Vec& aTau) { - Standard_Boolean isdgE; - Standard_Real first, last; + Standard_Boolean isdgE = 0; + Standard_Real first = NAN, last = NAN; isdgE = BRep_Tool::Degenerated(anEdge); if (isdgE) { @@ -123,7 +125,7 @@ void BOPTools_AlgoTools2D::PointOnSurface (const TopoDS_Edge& aE, { gp_Pnt2d aP2D; Handle(Geom2d_Curve) aC2D; - Standard_Real aToler, aFirst, aLast; + Standard_Real aToler = NAN, aFirst = NAN, aLast = NAN; BOPTools_AlgoTools2D::CurveOnSurface (aE, aF, aC2D, aFirst, aLast, aToler, theContext); aC2D->D0(aParameter, aP2D); @@ -142,7 +144,7 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE, Standard_Real& aToler, const Handle(IntTools_Context)& theContext) { - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; // BOPTools_AlgoTools2D::CurveOnSurface(aE, aF, aC2D, aFirst, aLast, aToler, theContext); // @@ -160,7 +162,7 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE, Standard_Real& aToler, const Handle(IntTools_Context)& theContext) { - Standard_Boolean aHasOld; + Standard_Boolean aHasOld = 0; Handle(Geom2d_Curve) C2D; aHasOld=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF, C2D, @@ -187,7 +189,7 @@ Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface Standard_Real& aLast, Standard_Real& aToler) { - Standard_Boolean aHasOld; + Standard_Boolean aHasOld = 0; aToler=BRep_Tool::Tolerance(aE); BRep_Tool::Range(aE, aFirst, aLast); @@ -208,9 +210,9 @@ Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF) { - Standard_Boolean bHasOld; + Standard_Boolean bHasOld = 0; Handle(Geom2d_Curve) aC2D; - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; // BRep_Tool::Range(aE, aFirst, aLast); // @@ -252,7 +254,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnFace const Handle(IntTools_Context)& theContext) { BRepAdaptor_Surface aBASTmp; - const BRepAdaptor_Surface* pBAS; + const BRepAdaptor_Surface* pBAS = nullptr; if (!theContext.IsNull()) { pBAS = &theContext->SurfaceAdaptor(theF); } @@ -274,9 +276,9 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA) { - Standard_Boolean mincond, maxcond; - Standard_Real UMin, UMax, VMin, VMax, aT, u2, v2, du, dv, aDelta; - Standard_Real aUPeriod; + Standard_Boolean mincond = 0, maxcond = 0; + Standard_Real UMin = NAN, UMax = NAN, VMin = NAN, VMax = NAN, aT = NAN, u2 = NAN, v2 = NAN, du = NAN, dv = NAN, aDelta = NAN; + Standard_Real aUPeriod = NAN; // const TopoDS_Face& aF=aBAS.Face(); UMin=aBAS.FirstUParameter(); @@ -312,7 +314,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf // if (du==0.) { if (aBAS.GetType()==GeomAbs_Cylinder) { - Standard_Real aR, dFi, aTol; + Standard_Real aR = NAN, dFi = NAN, aTol = NAN; // gp_Cylinder aCylinder=aBAS.Cylinder(); aR=aCylinder.Radius(); @@ -334,7 +336,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf // dv dv = 0.; if (aBAS.IsVPeriodic()) { - Standard_Real aVPeriod, aVm, aVr, aVmid, dVm, dVr; + Standard_Real aVPeriod = NAN, aVm = NAN, aVr = NAN, aVmid = NAN, dVm = NAN, dVr = NAN; // aVPeriod = aBAS.VPeriod(); mincond = (VMin - v2 > aDelta); @@ -358,7 +360,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf // { //check the point with classifier - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; u = u2 + du; v = v2 + dv; if (aBAS.IsUPeriodic()) { @@ -415,7 +417,7 @@ Standard_Real BOPTools_AlgoTools2D::IntermediatePoint { //define parameter division number as 10*e^(-PI) = 0.43213918 const Standard_Real PAR_T = 0.43213918; - Standard_Real aParm; + Standard_Real aParm = NAN; aParm=(1.-PAR_T)*aFirst + PAR_T*aLast; return aParm; } @@ -427,7 +429,7 @@ Standard_Real BOPTools_AlgoTools2D::IntermediatePoint (const TopoDS_Edge& aE) { - Standard_Real aT, aT1, aT2; + Standard_Real aT = NAN, aT1 = NAN, aT2 = NAN; Handle(Geom_Curve)aC1=BRep_Tool::Curve(aE, aT1, aT2); if (aC1.IsNull()) @@ -448,8 +450,8 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE, Standard_Real& aToler, const Handle(IntTools_Context)& theContext) { - Standard_Boolean aLocIdentity; - Standard_Real f3d, l3d; + Standard_Boolean aLocIdentity = 0; + Standard_Real f3d = NAN, l3d = NAN; TopLoc_Location aLoc; Handle(Geom2d_Curve) C2D; @@ -497,7 +499,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace (const TopoDS_Face& aF, Standard_Real& TolReached2d, const Handle(IntTools_Context)& theContext) { - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; aFirst = aC3D -> FirstParameter(); aLast = aC3D -> LastParameter(); @@ -522,7 +524,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace const Handle(IntTools_Context)& theContext) { BRepAdaptor_Surface aBASTmp; - const BRepAdaptor_Surface* pBAS; + const BRepAdaptor_Surface* pBAS = nullptr; if (!theContext.IsNull()) { pBAS = &theContext->SurfaceAdaptor(aF); } @@ -534,7 +536,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace Handle(BRepAdaptor_Surface) aBAHS = new BRepAdaptor_Surface(*pBAS); Handle(GeomAdaptor_Curve) aBAHC = new GeomAdaptor_Curve(aC3D, aT1, aT2); // - Standard_Real aTolR; + Standard_Real aTolR = NAN; Standard_Real aTR = Precision::Confusion();//1.e-7; Standard_Real aMaxTol = 1.e3 * aTR; //0.0001 Standard_Boolean isAnaSurf = ProjLib::IsAnaSurf(aBAHS); @@ -642,7 +644,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace Handle(Geom_Surface) aS = pBAS->Surface().Surface(); aS = Handle(Geom_Surface)::DownCast(aS->Transformed(pBAS->Trsf())); // - Standard_Real aT; + Standard_Real aT = NAN; if (IntTools_Tools::ComputeTolerance (aC3D, aC2D, aS, aT1, aT2, aTolR, aT)) { if (aTolR > TolReached2d) { @@ -657,7 +659,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace //======================================================================= Standard_Real MaxToleranceEdge (const TopoDS_Face& aF) { - Standard_Real aTol, aTolMax; + Standard_Real aTol = NAN, aTolMax = NAN; TopExp_Explorer aExp; // aTolMax=0.; diff --git a/src/BOPTools/BOPTools_AlgoTools2D_1.cxx b/src/BOPTools/BOPTools_AlgoTools2D_1.cxx index 1d4d5252de..0f34de75ee 100644 --- a/src/BOPTools/BOPTools_AlgoTools2D_1.cxx +++ b/src/BOPTools/BOPTools_AlgoTools2D_1.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -54,10 +56,10 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve const TopoDS_Face& theF, const Handle(IntTools_Context)& aCtx) { - Standard_Boolean bIsToReverse, bIsClosed, bComp; - Standard_Integer iRet; - Standard_Real aTol, aT11, aT12, aT21, aT22, aTolPPC; - Standard_Real aTolSP, aTMax; + Standard_Boolean bIsToReverse = 0, bIsClosed = 0, bComp = 0; + Standard_Integer iRet = 0; + Standard_Real aTol = NAN, aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN, aTolPPC = NAN; + Standard_Real aTolSP = NAN, aTMax = NAN; Handle(Geom2d_Curve) aC2Dold, aC2DoldC; Handle(Geom2d_Curve) aC2DT; BRep_Builder aBB; @@ -81,7 +83,7 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve // bIsToReverse = BOPTools_AlgoTools::IsSplitToReverse(aE1, aE2, aCtx); if (bIsToReverse) { - Standard_Real aT21r, aT22r; + Standard_Real aT21r = NAN, aT22r = NAN; // aC2DoldC->Reverse(); // @@ -166,10 +168,10 @@ Standard_Integer UpdateClosedPCurve(const TopoDS_Edge& aEold, const TopoDS_Face& aF, const Handle(IntTools_Context)& aCtx) { - Standard_Boolean bUClosed, bRevOrder; - Standard_Integer aNbPoints, iRet; - Standard_Real aTS1, aTS2, aTS, aScPr, aUS1, aVS1, aUS2, aVS2, aT, aU, aV; - Standard_Real aT1, aT2, aTol; + Standard_Boolean bUClosed = 0, bRevOrder = 0; + Standard_Integer aNbPoints = 0, iRet = 0; + Standard_Real aTS1 = NAN, aTS2 = NAN, aTS = NAN, aScPr = NAN, aUS1 = NAN, aVS1 = NAN, aUS2 = NAN, aVS2 = NAN, aT = NAN, aU = NAN, aV = NAN; + Standard_Real aT1 = NAN, aT2 = NAN, aTol = NAN; gp_Pnt2d aP2DS1, aP2DS2, aP2D; gp_Vec2d aV2DT, aV2D, aV2DS1, aV2DS2; gp_Pnt aP; @@ -281,11 +283,11 @@ Standard_Integer UpdateClosedPCurve(const TopoDS_Edge& aEold, Standard_Boolean IsClosed(const TopoDS_Edge& aE, const TopoDS_Face& aF) { - Standard_Boolean bRet; + Standard_Boolean bRet = 0; // bRet=BRep_Tool::IsClosed(aE, aF); if (bRet) { - Standard_Integer iCnt; + Standard_Integer iCnt = 0; // iCnt=0; TopExp_Explorer aExp(aF, TopAbs_EDGE); diff --git a/src/BOPTools/BOPTools_AlgoTools3D.cxx b/src/BOPTools/BOPTools_AlgoTools3D.cxx index c620cbd701..a293b58538 100644 --- a/src/BOPTools/BOPTools_AlgoTools3D.cxx +++ b/src/BOPTools/BOPTools_AlgoTools3D.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -61,11 +63,11 @@ static Standard_Boolean BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit, const TopoDS_Face& aF) { - Standard_Boolean bIsUPeriodic, bIsVPeriodic, bIsLeft; + Standard_Boolean bIsUPeriodic = 0, bIsVPeriodic = 0, bIsLeft = 0; Standard_Real anUPeriod = 0., anVPeriod = 0.; - Standard_Real aTol, a, b, aT, anU, dU, anU1; - Standard_Real aScPr, anV, dV, anV1; - Standard_Real aUmin, aUmax, aVmin, aVmax; + Standard_Real aTol = NAN, a = NAN, b = NAN, aT = NAN, anU = NAN, dU = NAN, anU1 = NAN; + Standard_Real aScPr = NAN, anV = NAN, dV = NAN, anV1 = NAN; + Standard_Real aUmin = NAN, aUmax = NAN, aVmin = NAN, aVmax = NAN; gp_Pnt2d aP2D; gp_Vec2d aVec2D; Handle(Geom2d_Curve) aTmpC1, aTmpC2; @@ -119,7 +121,7 @@ Standard_Boolean BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSp { Standard_Boolean bIsUClosed = aSB->IsUClosed(); Standard_Boolean bIsVClosed = aSB->IsVClosed(); - Standard_Real aGlobalUmin, aGlobalUmax, aGlobalVmin, aGlobalVmax; + Standard_Real aGlobalUmin = NAN, aGlobalUmax = NAN, aGlobalVmin = NAN, aGlobalVmax = NAN; aSB->Bounds(aGlobalUmin, aGlobalUmax, aGlobalVmin, aGlobalVmax); if (bIsUClosed && @@ -238,12 +240,12 @@ Standard_Boolean BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& the TopoDS_Face aFace = theFace; aFace.Orientation (TopAbs_FORWARD); - Standard_Real aTS1, aTS2; + Standard_Real aTS1 = NAN, aTS2 = NAN; Handle(Geom2d_Curve) aC2DSplit = BRep_Tool::CurveOnSurface (aESplit, aFace, aTS1, aTS2); if (aC2DSplit.IsNull()) return Standard_False; - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; Handle(Geom2d_Curve) aC2D1 = BRep_Tool::CurveOnSurface ( TopoDS::Edge (theEOrigin.Oriented (TopAbs_FORWARD)), aFace, aT1, aT2); Handle(Geom2d_Curve) aC2D2 = BRep_Tool::CurveOnSurface ( @@ -314,7 +316,7 @@ void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE, gp_Dir& aDNF, const Handle(IntTools_Context)& theContext) { - Standard_Real aT, aT1, aT2; + Standard_Real aT = NAN, aT1 = NAN, aT2 = NAN; BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2); aT=BOPTools_AlgoTools2D::IntermediatePoint(aT1, aT2); @@ -335,7 +337,7 @@ void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE, gp_Dir& aDNF1, const Handle(IntTools_Context)& theContext) { - Standard_Real U, V, aTolPC; + Standard_Real U = NAN, V = NAN, aTolPC = NAN; gp_Pnt2d aP2D; gp_Pnt aP; gp_Vec aD1U, aD1V; @@ -362,14 +364,14 @@ void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE, Standard_Integer BOPTools_AlgoTools3D::SenseFlag (const gp_Dir& aDNF1, const gp_Dir& aDNF2) { - Standard_Boolean bIsDirsCoinside; + Standard_Boolean bIsDirsCoinside = 0; // bIsDirsCoinside=IntTools_Tools::IsDirsCoinside(aDNF1, aDNF2); if (!bIsDirsCoinside) { return 0; } - Standard_Real aScPr; + Standard_Real aScPr = NAN; aScPr=aDNF1*aDNF2; if (aScPr<0.) { @@ -510,7 +512,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointNearEdge gp_Pnt2d& aPx2DNear, gp_Pnt& aPxNear) { - Standard_Real aFirst, aLast, aETol, aFTol, transVal; + Standard_Real aFirst = NAN, aLast = NAN, aETol = NAN, aFTol = NAN, transVal = NAN; GeomAbs_SurfaceType aTS; Handle(Geom2d_Curve) aC2D; Handle(Geom_Surface) aS; @@ -555,7 +557,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointNearEdge gp_Vec2d transVec( aDP ); transVal = aDt2D + aETol + aFTol; if (aTS==GeomAbs_Cylinder) {// pkv/909/F8 - Standard_Real aR, dT; + Standard_Real aR = NAN, dT = NAN; // gp_Cylinder aCyl=aGAS.Cylinder(); aR=aCyl.Radius(); @@ -594,7 +596,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointNearEdge gp_Pnt& aPxNear, const Handle(IntTools_Context)& theContext) { - Standard_Real aTolE, aTolF, dTx, dT2D; + Standard_Real aTolE = NAN, aTolF = NAN, dTx = NAN, dT2D = NAN; Handle(Geom_Surface) aS; GeomAdaptor_Surface aGAS; // @@ -677,7 +679,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointNearEdge gp_Pnt& aPInFace, const Handle(IntTools_Context)& theContext) { - Standard_Real aT, aT1, aT2; + Standard_Real aT = NAN, aT1 = NAN, aT2 = NAN; // // 1. compute parameter on edge BRep_Tool::Range(aE, aT1, aT2); @@ -726,7 +728,7 @@ void Add(const TopoDS_Shape& aS, TopTools_IndexedMapOfShape& myShapes, Standard_Boolean& bHasGeometry) { - Standard_Integer anIndex; + Standard_Integer anIndex = 0; // if (bHasGeometry) { return; @@ -736,7 +738,7 @@ void Add(const TopoDS_Shape& aS, return; } // - TopoDS_Shape aSx = aS; + const TopoDS_Shape& aSx = aS; // anIndex=myShapes.FindIndex(aSx); if (!anIndex) { @@ -867,8 +869,8 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace gp_Pnt2d& theP2D, const Handle(IntTools_Context)& theContext) { - Standard_Integer i, iErr = 1; - Standard_Real aUMin, aUMax, aVMin, aVMax, aUx; + Standard_Integer i = 0, iErr = 1; + Standard_Real aUMin = NAN, aUMax = NAN, aVMin = NAN, aVMax = NAN, aUx = NAN; // theContext->UVBounds(theF, aUMin, aUMax, aVMin, aVMax); // @@ -906,8 +908,8 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace gp_Pnt2d& theP2D, const Handle(IntTools_Context)& theContext) { - Standard_Integer iErr; - Standard_Real f, l; + Standard_Integer iErr = 0; + Standard_Real f = NAN, l = NAN; Handle(Geom2d_Curve) aC2D; // iErr = 0; @@ -955,9 +957,9 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace const Handle(IntTools_Context)& theContext, const Standard_Real theDt2D) { - Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint; - Standard_Integer iErr, aIH, aNbDomains; - Standard_Real aVx, aV1, aV2; + Standard_Boolean bIsDone = 0, bHasFirstPoint = 0, bHasSecondPoint = 0; + Standard_Integer iErr = 0, aIH = 0, aNbDomains = 0; + Standard_Real aVx = NAN, aV1 = NAN, aV2 = NAN; // Geom2dHatch_Hatcher& aHatcher = theContext->Hatcher(theF); // diff --git a/src/BOPTools/BOPTools_AlgoTools_1.cxx b/src/BOPTools/BOPTools_AlgoTools_1.cxx index 49357bf62f..1c8050caf6 100644 --- a/src/BOPTools/BOPTools_AlgoTools_1.cxx +++ b/src/BOPTools/BOPTools_AlgoTools_1.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -542,8 +544,8 @@ static return aMaxDist; } // - Standard_Real aT1, aT2, aTint1, aTint2, aHalfR1, aHalfR2, aDist; - Standard_Integer i, aNb; + Standard_Real aT1 = NAN, aT2 = NAN, aTint1 = NAN, aTint2 = NAN, aHalfR1 = NAN, aHalfR2 = NAN, aDist = NAN; + Standard_Integer i = 0, aNb = 0; gp_Pnt aP, aPV; gp_Pnt2d aP2d; NCollection_List aLP; @@ -613,8 +615,8 @@ static void CorrectWires(const TopoDS_Face& aFx, const TopTools_IndexedMapOfShape& aMapToAvoid) { - Standard_Integer i, aNbV; - Standard_Real aTol, aTol2, aD2, aD2max, aT1, aT2; + Standard_Integer i = 0, aNbV = 0; + Standard_Real aTol = NAN, aTol2 = NAN, aD2 = NAN, aD2max = NAN, aT1 = NAN, aT2 = NAN; gp_Pnt aP, aPV; gp_Pnt2d aP2D; TopoDS_Face aF; @@ -708,7 +710,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape, Handle(BRep_TEdge)& TEx = *((Handle(BRep_TEdge)*)&myShape.TShape()); BRep_ListIteratorOfListOfCurveRepresentation itcrx(TEx->Curves()); - Standard_Boolean Degenerated, SameParameterx, SameRangex; + Standard_Boolean Degenerated = 0, SameParameterx = 0, SameRangex = 0; Standard_Integer unique = 0; @@ -757,7 +759,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape, if (!myCref.IsNull()) { Handle(BRep_GCurve) GCref (Handle(BRep_GCurve)::DownCast (myCref)); - Standard_Real First,Last; + Standard_Real First = NAN,Last = NAN; GCref->Range(First,Last); if (Last<=First) { myCref.Nullify(); @@ -815,7 +817,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape, if (cr != myCref && cr->IsCurveOnSurface(Su,L)) { pcurvefound = Standard_True; Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr)); - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; GC->Range(f,l); if (SameRange && (f != First || l != Last)) { return ;//BRepCheck_InvalidSameRangeFlag; @@ -924,7 +926,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape, void CorrectVertexTolerance(const TopoDS_Edge& aE, const TopTools_IndexedMapOfShape& aMapToAvoid) { - Standard_Real aTolE, aTolV; + Standard_Real aTolE = NAN, aTolV = NAN; TopoDS_Iterator aIt; // aTolE=BRep_Tool::Tolerance(aE); @@ -944,7 +946,7 @@ void CorrectVertexTolerance(const TopoDS_Edge& aE, void UpdateEdges(const TopoDS_Face& aF, const TopTools_IndexedMapOfShape& aMapToAvoid) { - Standard_Real aTolF, aTolE, aTolV; + Standard_Real aTolF = NAN, aTolE = NAN, aTolV = NAN; TopoDS_Iterator aItF, aItW, aItE; // aTolE=aTolF= BRep_Tool::Tolerance(aF); diff --git a/src/BOPTools/BOPTools_AlgoTools_2.cxx b/src/BOPTools/BOPTools_AlgoTools_2.cxx index f066189c52..5cf26855d7 100644 --- a/src/BOPTools/BOPTools_AlgoTools_2.cxx +++ b/src/BOPTools/BOPTools_AlgoTools_2.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -40,7 +42,7 @@ void BOPTools_AlgoTools::UpdateVertex (const TopoDS_Vertex& aVF, const TopoDS_Vertex& aNewVertex) { - Standard_Real aTolVF, aTolNewVertex, aDist, aNewTol; + Standard_Real aTolVF = NAN, aTolNewVertex = NAN, aDist = NAN, aNewTol = NAN; // gp_Pnt aPVF=BRep_Tool::Pnt(aVF); gp_Pnt aPNewVertex=BRep_Tool::Pnt(aNewVertex); @@ -64,7 +66,7 @@ void BOPTools_AlgoTools::UpdateVertex (const TopoDS_Edge& aE, const Standard_Real aT, const TopoDS_Vertex& aV) { - Standard_Real aTolV, aDist, aFirst, aLast; + Standard_Real aTolV = NAN, aDist = NAN, aFirst = NAN, aLast = NAN; gp_Pnt aPc; gp_Pnt aPv=BRep_Tool::Pnt(aV); @@ -87,7 +89,7 @@ void BOPTools_AlgoTools::UpdateVertex (const IntTools_Curve& aC, const Standard_Real aT, const TopoDS_Vertex& aV) { - Standard_Real aTolV, aDist; + Standard_Real aTolV = NAN, aDist = NAN; gp_Pnt aPc; gp_Pnt aPv=BRep_Tool::Pnt(aV); @@ -112,7 +114,7 @@ void BOPTools_AlgoTools::MakeSectEdge(const IntTools_Curve& aIC, const Standard_Real aP2, TopoDS_Edge& aNewEdge) { - Handle(Geom_Curve) aC=aIC.Curve (); + const Handle(Geom_Curve)& aC=aIC.Curve (); BRepBuilderAPI_MakeEdge aMakeEdge(aC, aV1, aV2, aP1, aP2); @@ -197,7 +199,7 @@ void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Vertex& aV1, gp_Pnt aPnt2=BRep_Tool::Pnt(aV2); Standard_Real aTol2=BRep_Tool::Tolerance(aV2); - Standard_Real aMaxTol, aDist; + Standard_Real aMaxTol = NAN, aDist = NAN; aDist=aPnt1.Distance(aPnt2); aMaxTol=(aTol1>aTol2)? aTol1 : aTol2; @@ -233,7 +235,7 @@ void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1, const Standard_Real aParm2, TopoDS_Vertex& aNewVertex) { - Standard_Real aTol1, aTol2, aMaxTol, aDist; + Standard_Real aTol1 = NAN, aTol2 = NAN, aMaxTol = NAN, aDist = NAN; gp_Pnt aPnt1, aPnt2; PointOnEdge (aE1, aParm1, aPnt1); @@ -263,7 +265,7 @@ void BOPTools_AlgoTools::MakeNewVertex(const TopoDS_Edge& aE1, const TopoDS_Face& aF1, TopoDS_Vertex& aNewVertex) { - Standard_Real aTol1, aTol2, aMaxTol; + Standard_Real aTol1 = NAN, aTol2 = NAN, aMaxTol = NAN; gp_Pnt aPnt; PointOnEdge (aE1, aParm1, aPnt); @@ -285,7 +287,7 @@ void BOPTools_AlgoTools::PointOnEdge(const TopoDS_Edge& aE, const Standard_Real aParm, gp_Pnt& aPnt) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) C1=BRep_Tool::Curve(aE, f, l); C1->D0(aParm, aPnt); } @@ -299,8 +301,8 @@ void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE1, const IntTools_Range& aSR, IntTools_Range& aNewSR) { - Standard_Integer i; - Standard_Real aRes, aTolE1, aTolE2, aTF, aTL, dT; + Standard_Integer i = 0; + Standard_Real aRes = NAN, aTolE1 = NAN, aTolE2 = NAN, aTF = NAN, aTL = NAN, dT = NAN; BRepAdaptor_Curve aBC; GeomAbs_CurveType aCT; gp_Pnt aP; @@ -372,8 +374,8 @@ void BOPTools_AlgoTools::CorrectRange(const TopoDS_Edge& aE, const IntTools_Range& aSR, IntTools_Range& aNewSR) { - Standard_Integer i; - Standard_Real aRes, aTolF, aTF, aTL, dT; + Standard_Integer i = 0; + Standard_Real aRes = NAN, aTolF = NAN, aTF = NAN, aTL = NAN, dT = NAN; BRepAdaptor_Curve aBC; GeomAbs_CurveType aCT; gp_Pnt aP; @@ -500,7 +502,7 @@ void BOPTools_AlgoTools::Dimensions (const TopoDS_Shape& theS, //======================================================================= Standard_Integer BOPTools_AlgoTools::Dimension(const TopoDS_Shape& theS) { - Standard_Integer aDMin, aDMax; + Standard_Integer aDMin = 0, aDMax = 0; Dimensions (theS, aDMin, aDMax); return (aDMin == aDMax) ? aDMin : -1; } diff --git a/src/BOPTools/BOPTools_Set.cxx b/src/BOPTools/BOPTools_Set.cxx index d6a146aef0..0ebc53b776 100644 --- a/src/BOPTools/BOPTools_Set.cxx +++ b/src/BOPTools/BOPTools_Set.cxx @@ -31,11 +31,11 @@ static BOPTools_Set::BOPTools_Set() : myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()), - myShapes(myAllocator) + myShapes(myAllocator), myNbShapes(0), mySum(0), myUpper(432123) { - myNbShapes=0; - mySum=0; - myUpper=432123; + + + } //======================================================================= //function : @@ -45,11 +45,11 @@ BOPTools_Set::BOPTools_Set (const Handle(NCollection_BaseAllocator)& theAllocator) : myAllocator(theAllocator), - myShapes(myAllocator) + myShapes(myAllocator), myNbShapes(0), mySum(0), myUpper(432123) { - myNbShapes=0; - mySum=0; - myUpper=432123; + + + } //======================================================================= @@ -143,7 +143,7 @@ Standard_Integer BOPTools_Set::HashCode (const Standard_Integer theUpperBound) c Standard_Boolean BOPTools_Set::IsEqual (const BOPTools_Set& theOther)const { - Standard_Boolean bRet; + Standard_Boolean bRet = 0; // bRet=Standard_False; // @@ -177,7 +177,7 @@ Standard_Boolean BOPTools_Set::IsEqual void BOPTools_Set::Add(const TopoDS_Shape& theS, const TopAbs_ShapeEnum theType) { - Standard_Integer aId, aIdN; + Standard_Integer aId = 0, aIdN = 0; TopAbs_Orientation aOr; TopExp_Explorer aExp; // @@ -235,7 +235,7 @@ void BOPTools_Set::Add(const TopoDS_Shape& theS, Standard_Integer NormalizedIds(const Standard_Integer aId, const Standard_Integer aDiv) { - Standard_Integer aMax, aTresh, aIdRet; + Standard_Integer aMax = 0, aTresh = 0, aIdRet = 0; // aIdRet=aId; aMax=::IntegerLast(); diff --git a/src/BRep/BRep_Tool.cxx b/src/BRep/BRep_Tool.cxx index f4d4c59df4..237b0efee6 100644 --- a/src/BRep/BRep_Tool.cxx +++ b/src/BRep/BRep_Tool.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -77,7 +79,7 @@ static const Handle(Geom_Surface)& BRep_Tool::Surface(const TopoDS_Face& F, TopLoc_Location& L) { - const BRep_TFace* TF = static_cast(F.TShape().get()); + const BRep_TFace* TF = dynamic_cast(F.TShape().get()); L = F.Location() * TF->Location(); return TF->Surface(); } @@ -90,7 +92,7 @@ const Handle(Geom_Surface)& BRep_Tool::Surface(const TopoDS_Face& F, Handle(Geom_Surface) BRep_Tool::Surface(const TopoDS_Face& F) { - const BRep_TFace* TF = static_cast(F.TShape().get()); + const BRep_TFace* TF = dynamic_cast(F.TShape().get()); const Handle(Geom_Surface)& S = TF->Surface(); if(S.IsNull()) return S; @@ -98,7 +100,7 @@ Handle(Geom_Surface) BRep_Tool::Surface(const TopoDS_Face& F) TopLoc_Location L = F.Location() * TF->Location(); if (!L.IsIdentity()) { Handle(Geom_Geometry) aCopy = S->Transformed(L.Transformation()); - Geom_Surface* aGS = static_cast(aCopy.get()); + Geom_Surface* aGS = dynamic_cast(aCopy.get()); return Handle(Geom_Surface)(aGS); } return S; @@ -113,7 +115,7 @@ const Handle(Poly_Triangulation)& BRep_Tool::Triangulation (const TopoDS_Face& t const Poly_MeshPurpose theMeshPurpose) { theLocation = theFace.Location(); - const BRep_TFace* aTFace = static_cast(theFace.TShape().get()); + const BRep_TFace* aTFace = dynamic_cast(theFace.TShape().get()); return aTFace->Triangulation (theMeshPurpose); } @@ -125,7 +127,7 @@ const Poly_ListOfTriangulation& BRep_Tool::Triangulations (const TopoDS_Face& th TopLoc_Location& theLocation) { theLocation = theFace.Location(); - const BRep_TFace* aTFace = static_cast(theFace.TShape().get()); + const BRep_TFace* aTFace = dynamic_cast(theFace.TShape().get()); return aTFace->Triangulations(); } @@ -136,7 +138,7 @@ const Poly_ListOfTriangulation& BRep_Tool::Triangulations (const TopoDS_Face& th Standard_Real BRep_Tool::Tolerance(const TopoDS_Face& F) { - const BRep_TFace* TF = static_cast(F.TShape().get()); + const BRep_TFace* TF = dynamic_cast(F.TShape().get()); Standard_Real p = TF->Tolerance(); Standard_Real pMin = Precision::Confusion(); if (p > pMin) return p; @@ -150,7 +152,7 @@ Standard_Real BRep_Tool::Tolerance(const TopoDS_Face& F) Standard_Boolean BRep_Tool::NaturalRestriction(const TopoDS_Face& F) { - const BRep_TFace* TF = static_cast(F.TShape().get()); + const BRep_TFace* TF = dynamic_cast(F.TShape().get()); return TF->NaturalRestriction(); } @@ -169,13 +171,13 @@ const Handle(Geom_Curve)& BRep_Tool::Curve(const TopoDS_Edge& E, Standard_Real& Last) { // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsCurve3D()) { - const BRep_Curve3D* GC = static_cast(cr.get()); + const BRep_Curve3D* GC = dynamic_cast(cr.get()); L = E.Location() * GC->Location(); GC->Range(First,Last); return GC->Curve3D(); @@ -203,7 +205,7 @@ Handle(Geom_Curve) BRep_Tool::Curve(const TopoDS_Edge& E, if ( !C.IsNull() ) { if ( !L.IsIdentity() ) { Handle(Geom_Geometry) aCopy = C->Transformed(L.Transformation()); - Geom_Curve* aGC = static_cast(aCopy.get()); + Geom_Curve* aGC = dynamic_cast(aCopy.get()); return Handle(Geom_Curve)(aGC); } } @@ -216,7 +218,7 @@ Handle(Geom_Curve) BRep_Tool::Curve(const TopoDS_Edge& E, //======================================================================= Standard_Boolean BRep_Tool::IsGeometric (const TopoDS_Face& F) { - const BRep_TFace* TF = static_cast(F.TShape().get()); + const BRep_TFace* TF = dynamic_cast(F.TShape().get()); const Handle(Geom_Surface)& S = TF->Surface(); return !S.IsNull(); } @@ -230,7 +232,7 @@ Standard_Boolean BRep_Tool::IsGeometric (const TopoDS_Face& F) Standard_Boolean BRep_Tool::IsGeometric(const TopoDS_Edge& E) { // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { @@ -258,13 +260,13 @@ const Handle(Poly_Polygon3D)& BRep_Tool::Polygon3D(const TopoDS_Edge& E, TopLoc_Location& L) { // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsPolygon3D()) { - const BRep_Polygon3D* GC = static_cast(cr.get()); + const BRep_Polygon3D* GC = dynamic_cast(cr.get()); L = E.Location() * GC->Location(); return GC->Polygon3D(); } @@ -320,13 +322,13 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E, *theIsStored = Standard_True; // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsCurveOnSurface(S,loc)) { - const BRep_GCurve* GC = static_cast(cr.get()); + const BRep_GCurve* GC = dynamic_cast(cr.get()); GC->Range(First,Last); if (GC->IsCurveOnClosedSurface() && Eisreversed) return GC->PCurve2(); @@ -368,7 +370,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnPlane(const TopoDS_Edge& E, return nullPCurve; // Check existence of 3d curve in edge - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; TopLoc_Location aCurveLocation; Handle(Geom_Curve) C3D = BRep_Tool::Curve(E, aCurveLocation, f, l); @@ -422,13 +424,13 @@ void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E, Standard_Real& Last) { // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsCurveOnSurface()) { - const BRep_GCurve* GC = static_cast(cr.get()); + const BRep_GCurve* GC = dynamic_cast(cr.get()); C = GC->PCurve(); S = GC->Surface(); L = E.Location() * GC->Location(); @@ -462,14 +464,14 @@ void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E, Standard_Integer i = 0; // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); for (; itcr.More(); itcr.Next()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsCurveOnSurface()) { - const BRep_GCurve* GC = static_cast(cr.get()); + const BRep_GCurve* GC = dynamic_cast(cr.get()); ++i; // Compare index taking into account the fact that for the curves on // closed surfaces there are two PCurves @@ -533,7 +535,7 @@ Handle(Poly_Polygon2D) BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E, Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED); // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { @@ -561,13 +563,13 @@ void BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E, TopLoc_Location& L) { // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsPolygonOnSurface()) { - const BRep_PolygonOnSurface* PS = static_cast(cr.get()); + const BRep_PolygonOnSurface* PS = dynamic_cast(cr.get()); P = PS->Polygon(); S = PS->Surface(); L = E.Location() * PS->Location(); @@ -595,13 +597,13 @@ void BRep_Tool::PolygonOnSurface(const TopoDS_Edge& E, Standard_Integer i = 0; // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsPolygonOnSurface()) { - const BRep_PolygonOnSurface* PS = static_cast(cr.get()); + const BRep_PolygonOnSurface* PS = dynamic_cast(cr.get()); i++; if (i > Index) break; if (i == Index) { @@ -637,7 +639,7 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E, Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED); // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { @@ -666,14 +668,14 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E, TopLoc_Location& L) { // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsPolygonOnTriangulation()) { const BRep_PolygonOnTriangulation* PT = - static_cast(cr.get()); + dynamic_cast(cr.get()); P = PT->PolygonOnTriangulation(); T = PT->Triangulation(); L = E.Location() * PT->Location(); @@ -702,14 +704,14 @@ BRep_Tool::PolygonOnTriangulation(const TopoDS_Edge& E, Standard_Integer i = 0; // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsPolygonOnTriangulation()) { const BRep_PolygonOnTriangulation* PT = - static_cast(cr.get()); + dynamic_cast(cr.get()); i++; if (i > Index) break; if (i == Index) { @@ -764,7 +766,7 @@ Standard_Boolean BRep_Tool::IsClosed(const TopoDS_Edge& E, TopLoc_Location l = L.Predivided(E.Location()); // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { @@ -790,7 +792,7 @@ Standard_Boolean BRep_Tool::IsClosed(const TopoDS_Edge& E, TopLoc_Location l = L.Predivided(E.Location()); // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { @@ -810,7 +812,7 @@ Standard_Boolean BRep_Tool::IsClosed(const TopoDS_Edge& E, Standard_Real BRep_Tool::Tolerance(const TopoDS_Edge& E) { - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); Standard_Real p = TE->Tolerance(); Standard_Real pMin = Precision::Confusion(); if (p > pMin) return p; @@ -824,7 +826,7 @@ Standard_Real BRep_Tool::Tolerance(const TopoDS_Edge& E) Standard_Boolean BRep_Tool::SameParameter(const TopoDS_Edge& E) { - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); return TE->SameParameter(); } @@ -835,7 +837,7 @@ Standard_Boolean BRep_Tool::SameParameter(const TopoDS_Edge& E) Standard_Boolean BRep_Tool::SameRange(const TopoDS_Edge& E) { - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); return TE->SameRange(); } @@ -846,7 +848,7 @@ Standard_Boolean BRep_Tool::SameRange(const TopoDS_Edge& E) Standard_Boolean BRep_Tool::Degenerated(const TopoDS_Edge& E) { - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); return TE->Degenerated(); } @@ -860,13 +862,13 @@ void BRep_Tool::Range(const TopoDS_Edge& E, Standard_Real& Last) { // set the range to all the representations - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsCurve3D()) { - const BRep_Curve3D* CR = static_cast(cr.get()); + const BRep_Curve3D* CR = dynamic_cast(cr.get()); if (!CR->Curve3D().IsNull()) { First = CR->First(); Last = CR->Last(); @@ -874,7 +876,7 @@ void BRep_Tool::Range(const TopoDS_Edge& E, } } else if (cr->IsCurveOnSurface()) { - const BRep_GCurve* CR = static_cast(cr.get()); + const BRep_GCurve* CR = dynamic_cast(cr.get()); First = CR->First(); Last = CR->Last(); return; @@ -898,13 +900,13 @@ void BRep_Tool::Range(const TopoDS_Edge& E, TopLoc_Location l = L.Predivided(E.Location()); // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); if (cr->IsCurveOnSurface(S,l)) { - const BRep_CurveOnSurface* CR = static_cast(cr.get()); + const BRep_CurveOnSurface* CR = dynamic_cast(cr.get()); CR->Range(First,Last); break; } @@ -946,7 +948,7 @@ void BRep_Tool::UVPoints(const TopoDS_Edge& E, Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED); // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { @@ -955,13 +957,13 @@ void BRep_Tool::UVPoints(const TopoDS_Edge& E, if (cr->IsCurveOnClosedSurface() && Eisreversed) { const BRep_CurveOnClosedSurface* CR = - static_cast(cr.get()); + dynamic_cast(cr.get()); CR->UVPoints2(PFirst, PLast); } else { const BRep_CurveOnSurface* CR = - static_cast(cr.get()); + dynamic_cast(cr.get()); CR->UVPoints(PFirst, PLast); } return; @@ -987,7 +989,7 @@ void BRep_Tool::UVPoints(const TopoDS_Edge& E, TopLoc_Location Linverted = L.Inverted(); Vf.Move(Linverted, Standard_False); Vl.Move(Linverted, Standard_False); - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; gp_Pln pln = GP->Pln(); u=v=0.; @@ -1049,7 +1051,7 @@ void BRep_Tool::SetUVPoints(const TopoDS_Edge& E, Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED); // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { @@ -1057,12 +1059,12 @@ void BRep_Tool::SetUVPoints(const TopoDS_Edge& E, if (cr->IsCurveOnSurface(S,l)) { if (cr->IsCurveOnClosedSurface() && Eisreversed) { - BRep_CurveOnClosedSurface* CS = static_cast(cr.get()); + BRep_CurveOnClosedSurface* CS = dynamic_cast(cr.get()); CS->SetUVPoints2(PFirst, PLast); } else { - BRep_CurveOnSurface* CS = static_cast(cr.get()); + BRep_CurveOnSurface* CS = dynamic_cast(cr.get()); CS->SetUVPoints(PFirst, PLast); } } @@ -1139,7 +1141,7 @@ Standard_Boolean BRep_Tool::HasContinuity(const TopoDS_Edge& E, TopLoc_Location l2 = L2.Predivided(Eloc); // find the representation - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); while (itcr.More()) { @@ -1185,7 +1187,7 @@ GeomAbs_Shape BRep_Tool::Continuity(const TopoDS_Edge& E, Standard_Boolean BRep_Tool::HasContinuity(const TopoDS_Edge& E) { - const BRep_TEdge* TE = static_cast(E.TShape().get()); + const BRep_TEdge* TE = dynamic_cast(E.TShape().get()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); for (; itcr.More(); itcr.Next()) @@ -1227,7 +1229,7 @@ GeomAbs_Shape BRep_Tool::MaxContinuity (const TopoDS_Edge& theEdge) gp_Pnt BRep_Tool::Pnt(const TopoDS_Vertex& V) { - const BRep_TVertex* TV = static_cast(V.TShape().get()); + const BRep_TVertex* TV = dynamic_cast(V.TShape().get()); if (TV == 0) { @@ -1250,7 +1252,7 @@ gp_Pnt BRep_Tool::Pnt(const TopoDS_Vertex& V) Standard_Real BRep_Tool::Tolerance(const TopoDS_Vertex& V) { - const BRep_TVertex* aTVert = static_cast(V.TShape().get()); + const BRep_TVertex* aTVert = dynamic_cast(V.TShape().get()); if (aTVert == 0) { @@ -1306,7 +1308,7 @@ Standard_Boolean BRep_Tool::Parameter (const TopoDS_Vertex& theV, if (!VF.IsNull()) orient = VF.Orientation(); - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; if (orient == TopAbs_FORWARD) { BRep_Tool::Range(theE, f, l); @@ -1325,7 +1327,7 @@ Standard_Boolean BRep_Tool::Parameter (const TopoDS_Vertex& theV, const Handle(Geom_Curve)& C = BRep_Tool::Curve(theE, L, f, l); L = L.Predivided(theV.Location()); if (!C.IsNull() || BRep_Tool::Degenerated(theE)) { - const BRep_TVertex* TV = static_cast(theV.TShape().get()); + const BRep_TVertex* TV = dynamic_cast(theV.TShape().get()); BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points()); while (itpr.More()) { @@ -1368,7 +1370,7 @@ Standard_Boolean BRep_Tool::Parameter (const TopoDS_Vertex& theV, Handle(Geom_Surface) S; BRep_Tool::CurveOnSurface(theE, PC, S, L, f, l); L = L.Predivided(theV.Location()); - const BRep_TVertex* TV = static_cast(theV.TShape().get()); + const BRep_TVertex* TV = dynamic_cast(theV.TShape().get()); BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points()); while (itpr.More()) { @@ -1402,7 +1404,7 @@ Standard_Boolean BRep_Tool::Parameter (const TopoDS_Vertex& theV, Standard_Real BRep_Tool::Parameter(const TopoDS_Vertex& V, const TopoDS_Edge& E) { - Standard_Real p; + Standard_Real p = NAN; if (Parameter(V, E, p)) return p; throw Standard_NoSuchObject("BRep_Tool:: no parameter on edge"); } @@ -1454,7 +1456,7 @@ Standard_Real BRep_Tool::Parameter(const TopoDS_Vertex& V, TopAbs_Orientation orient = TopAbs_INTERNAL; if (!VF.IsNull()) orient = VF.Orientation(); - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; if (orient == TopAbs_FORWARD) { BRep_Tool::Range(E,S,L,f,l); @@ -1468,7 +1470,7 @@ Standard_Real BRep_Tool::Parameter(const TopoDS_Vertex& V, else { Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(E,S,L,f,l); - const BRep_TVertex* TV = static_cast(V.TShape().get()); + const BRep_TVertex* TV = dynamic_cast(V.TShape().get()); BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points()); while (itpr.More()) { @@ -1484,7 +1486,7 @@ Standard_Real BRep_Tool::Parameter(const TopoDS_Vertex& V, const Handle(Geom_Curve)& C = BRep_Tool::Curve(E,L1,f,l); L1 = L1.Predivided(V.Location()); if (!C.IsNull() || Degenerated(E)) { - const BRep_TVertex* TV = static_cast(V.TShape().get()); + const BRep_TVertex* TV = dynamic_cast(V.TShape().get()); BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points()); while (itpr.More()) { @@ -1528,7 +1530,7 @@ gp_Pnt2d BRep_Tool::Parameters(const TopoDS_Vertex& V, TopLoc_Location L; const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,L); L = L.Predivided(V.Location()); - const BRep_TVertex* TV = static_cast(V.TShape().get()); + const BRep_TVertex* TV = dynamic_cast(V.TShape().get()); BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points()); // It is checked if there is PointRepresentation (case non Manifold) @@ -1611,7 +1613,7 @@ Standard_Boolean BRep_Tool::IsClosed (const TopoDS_Shape& theShape) //======================================================================= Standard_Boolean IsPlane(const Handle(Geom_Surface)& aS) { - Standard_Boolean bRet; + Standard_Boolean bRet = 0; Handle(Geom_Plane) aGP; Handle(Geom_RectangularTrimmedSurface) aGRTS; Handle(Geom_OffsetSurface) aGOFS; diff --git a/src/BRepAdaptor/BRepAdaptor_CompCurve.cxx b/src/BRepAdaptor/BRepAdaptor_CompCurve.cxx index 92a732e37c..a9299a97cf 100644 --- a/src/BRepAdaptor/BRepAdaptor_CompCurve.cxx +++ b/src/BRepAdaptor/BRepAdaptor_CompCurve.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -105,7 +107,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const void BRepAdaptor_CompCurve::Initialize(const TopoDS_Wire& W, const Standard_Boolean AC) { - Standard_Integer ii, NbEdge; + Standard_Integer ii = 0, NbEdge = 0; BRepTools_WireExplorer wexp; TopoDS_Edge E; @@ -174,8 +176,8 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const // Trim the extremal curves. Handle (BRepAdaptor_Curve) HC; - Standard_Integer i1, i2; - Standard_Real f=TFirst, l=TLast, d; + Standard_Integer i1 = 0, i2 = 0; + Standard_Real f=TFirst, l=TLast, d = NAN; i1 = i2 = CurIndex; Prepare(f, d, i1); Prepare(l, d, i2); @@ -190,7 +192,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const else { const BRepAdaptor_Curve& c1 = myCurves->Value(i1); const BRepAdaptor_Curve& c2 = myCurves->Value(i2); - Standard_Real k; + Standard_Real k = NAN; k = c1.LastParameter(); if (k>f) @@ -217,7 +219,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const TopoDS_Edge& E, Standard_Real& UonE) const { - Standard_Real d; + Standard_Real d = NAN; Standard_Integer index = CurIndex; UonE = U; Prepare(UonE, d, index); @@ -242,7 +244,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const Standard_Integer BRepAdaptor_CompCurve::NbIntervals(const GeomAbs_Shape S) const { - Standard_Integer NbInt, ii; + Standard_Integer NbInt = 0, ii = 0; for (ii=1, NbInt=0; ii<=myCurves->Length(); ii++) NbInt += myCurves->ChangeValue(ii).NbIntervals(S); @@ -252,8 +254,8 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const void BRepAdaptor_CompCurve::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const { - Standard_Integer ii, jj, kk, n; - Standard_Real f, F, delta; + Standard_Integer ii = 0, jj = 0, kk = 0, n = 0; + Standard_Real f = NAN, F = NAN, delta = NAN; // First curve (direction of parsing of the edge) n = myCurves->ChangeValue(1).NbIntervals(S); @@ -318,7 +320,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const gp_Pnt BRepAdaptor_CompCurve::Value(const Standard_Real U) const { - Standard_Real u = U, d; + Standard_Real u = U, d = NAN; Standard_Integer index = CurIndex; Prepare(u, d, index); return myCurves->Value(index).Value(u); @@ -327,7 +329,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const void BRepAdaptor_CompCurve::D0(const Standard_Real U, gp_Pnt& P) const { - Standard_Real u = U, d; + Standard_Real u = U, d = NAN; Standard_Integer index = CurIndex; Prepare(u, d, index); myCurves->Value(index).D0(u, P); @@ -337,7 +339,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const gp_Pnt& P, gp_Vec& V) const { - Standard_Real u = U, d; + Standard_Real u = U, d = NAN; Standard_Integer index = CurIndex; Prepare(u, d, index); myCurves->Value(index).D1(u, P, V); @@ -349,7 +351,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const gp_Vec& V1, gp_Vec& V2) const { - Standard_Real u = U, d; + Standard_Real u = U, d = NAN; Standard_Integer index = CurIndex; Prepare(u, d, index); myCurves->Value(index).D2(u, P, V1, V2); @@ -362,7 +364,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const gp_Vec& V2, gp_Vec& V3) const { - Standard_Real u = U, d; + Standard_Real u = U, d = NAN; Standard_Integer index = CurIndex; Prepare(u, d, index); myCurves->Value(index).D3(u, P, V1, V2, V3); @@ -374,7 +376,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const gp_Vec BRepAdaptor_CompCurve::DN(const Standard_Real U, const Standard_Integer N) const { - Standard_Real u = U, d; + Standard_Real u = U, d = NAN; Standard_Integer index = CurIndex; Prepare(u, d, index); @@ -383,8 +385,8 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const Standard_Real BRepAdaptor_CompCurve::Resolution(const Standard_Real R3d) const { - Standard_Real Res = 1.e200, r; - Standard_Integer ii, L = myCurves->Length(); + Standard_Real Res = 1.e200, r = NAN; + Standard_Integer ii = 0, L = myCurves->Length(); for (ii=1; ii<=L; ii++) { r = myCurves->Value(ii).Resolution(R3d); if (r < Res) Res = r; @@ -467,8 +469,8 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const Standard_Real& Delta, Standard_Integer& theCurIndex) const { - Standard_Real f,l, Wtest, Eps; - Standard_Integer ii; + Standard_Real f = NAN,l = NAN, Wtest = NAN, Eps = NAN; + Standard_Integer ii = 0; if (W-TFirst < TLast-W) { Eps = PTol; } else { Eps = -PTol;} @@ -498,7 +500,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const // Invert ? const TopoDS_Edge& E = myCurves->Value(theCurIndex).Edge(); TopAbs_Orientation Or = E.Orientation(); - Standard_Boolean Reverse; + Standard_Boolean Reverse = 0; Reverse = (Forward && (Or == TopAbs_REVERSED)) || (!Forward && (Or != TopAbs_REVERSED)); @@ -523,13 +525,13 @@ void BRepAdaptor_CompCurve::InvPrepare(const Standard_Integer index, // Invert? const TopoDS_Edge& E = myCurves->Value(index).Edge(); TopAbs_Orientation Or = E.Orientation(); - Standard_Boolean Reverse; + Standard_Boolean Reverse = 0; Reverse = (Forward && (Or == TopAbs_REVERSED)) || (!Forward && (Or != TopAbs_REVERSED)); // Calculate the parameters of reparametrisation // such as : T = Ti + (t-First)*Delta - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; BRep_Tool::Range(E, f, l); Delta = myKnots->Value(index+1) - myKnots->Value(index); if (l-f > PTol*1.e-9) Delta /= (l-f); diff --git a/src/BRepAdaptor/BRepAdaptor_Curve.cxx b/src/BRepAdaptor/BRepAdaptor_Curve.cxx index d82c69d26f..cf7b404b0d 100644 --- a/src/BRepAdaptor/BRepAdaptor_Curve.cxx +++ b/src/BRepAdaptor/BRepAdaptor_Curve.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -114,7 +116,7 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E) { myConSurf.Nullify(); myEdge = E; - Standard_Real pf,pl; + Standard_Real pf = NAN,pl = NAN; TopLoc_Location L; Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,pf,pl); @@ -153,7 +155,7 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E, myEdge = E; TopLoc_Location L; - Standard_Real pf,pl; + Standard_Real pf = NAN,pl = NAN; Handle(Geom_Surface) S = BRep_Tool::Surface(F,L); Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(E,F,pf,pl); diff --git a/src/BRepAdaptor/BRepAdaptor_Curve2d.cxx b/src/BRepAdaptor/BRepAdaptor_Curve2d.cxx index b1a938bc32..857d3e7ad4 100644 --- a/src/BRepAdaptor/BRepAdaptor_Curve2d.cxx +++ b/src/BRepAdaptor/BRepAdaptor_Curve2d.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -74,7 +76,7 @@ void BRepAdaptor_Curve2d::Initialize(const TopoDS_Edge& E, { myEdge = E; myFace = F; - Standard_Real pf,pl; + Standard_Real pf = NAN,pl = NAN; const Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(E,F,pf,pl); Geom2dAdaptor_Curve::Load(PC,pf,pl); } diff --git a/src/BRepAdaptor/BRepAdaptor_Surface.cxx b/src/BRepAdaptor/BRepAdaptor_Surface.cxx index 66d769c103..6d9688fd47 100644 --- a/src/BRepAdaptor/BRepAdaptor_Surface.cxx +++ b/src/BRepAdaptor/BRepAdaptor_Surface.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -93,7 +95,7 @@ void BRepAdaptor_Surface::Initialize(const TopoDS_Face& F, return; if (Restriction) { - Standard_Real umin,umax,vmin,vmax; + Standard_Real umin = NAN,umax = NAN,vmin = NAN,vmax = NAN; BRepTools::UVBounds(F,umin,umax,vmin,vmax); mySurf.Load(aSurface,umin,umax,vmin,vmax); } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx index 845b4f4e20..09b05a2005 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx @@ -219,8 +219,8 @@ void BRepAlgoAPI_BooleanOperation::Build(const Message_ProgressRange& theRange) { myBuilder = new BOPAlgo_BOP(myAllocator); myBuilder->SetArguments(myArguments); - ((BOPAlgo_BOP*)myBuilder)->SetTools(myTools); - ((BOPAlgo_BOP*)myBuilder)->SetOperation(myOperation); + (dynamic_cast(myBuilder))->SetTools(myTools); + (dynamic_cast(myBuilder))->SetOperation(myOperation); } // Build the result diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx index 740a7fa66b..c0b7383fda 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx @@ -48,9 +48,9 @@ BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo(const BOPAlgo_PaveFiller& aPF) myCheckInverted(Standard_True), myFillHistory(Standard_True), myIsIntersectionNeeded(Standard_False), - myBuilder(NULL) + myDSFiller((BOPAlgo_PaveFiller*)&aPF), myBuilder(NULL) { - myDSFiller = (BOPAlgo_PaveFiller*)&aPF; + } //======================================================================= // function: ~ diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx index 032a3eb82b..ba8bed7c72 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx @@ -282,7 +282,7 @@ Standard_Boolean BRepAlgoAPI_Section::HasAncestorFaceOn1 (const TopoDS_Shape& aE, TopoDS_Shape& aF) const { - Standard_Boolean bRes; + Standard_Boolean bRes = 0; // bRes = HasAncestorFace(myDSFiller,1 , aE, aF); return bRes; @@ -295,7 +295,7 @@ Standard_Boolean BRepAlgoAPI_Section::HasAncestorFaceOn2 (const TopoDS_Shape& aE, TopoDS_Shape& aF) const { - Standard_Boolean bRes; + Standard_Boolean bRes = 0; // bRes = HasAncestorFace(myDSFiller, 2, aE, aF); return bRes; @@ -309,7 +309,7 @@ Standard_Boolean HasAncestorFace (const BOPAlgo_PPaveFiller& pPF, const TopoDS_Shape& aE, TopoDS_Shape& aF) { - Standard_Boolean bRes; + Standard_Boolean bRes = 0; // bRes = Standard_False; if(aE.IsNull()) { @@ -340,7 +340,7 @@ Standard_Boolean HasAncestorFaces (const BOPAlgo_PPaveFiller& pPF, TopoDS_Shape& aF2) { - Standard_Integer aNbFF, i, j, nE, nF1, nF2, aNbVC; + Standard_Integer aNbFF = 0, i = 0, j = 0, nE = 0, nF1 = 0, nF2 = 0, aNbVC = 0; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; // const BOPDS_PDS& pDS = pPF->PDS(); diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx index 78e525f8b7..fe689934d4 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx @@ -203,9 +203,9 @@ protected: private: - Standard_Boolean myApprox; - Standard_Boolean myComputePCurve1; - Standard_Boolean myComputePCurve2; + Standard_Boolean myApprox{}; + Standard_Boolean myComputePCurve1{}; + Standard_Boolean myComputePCurve2{}; }; diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx index bd5a978792..849ea9848a 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx @@ -67,7 +67,7 @@ void BRepAlgoAPI_Splitter::Build(const Message_ProgressRange& theRange) // Initialization of the building tool myBuilder = new BOPAlgo_Splitter(myAllocator); myBuilder->SetArguments(myArguments); - ((BOPAlgo_Splitter*)myBuilder)->SetTools(myTools); + (dynamic_cast(myBuilder))->SetTools(myTools); // Build result shape basing on the intersection results BuildResult(aPS.Next(30)); diff --git a/src/BRepApprox/BRepApprox_ApproxLine.cxx b/src/BRepApprox/BRepApprox_ApproxLine.cxx index 595b48f1b4..5edfcaee4c 100644 --- a/src/BRepApprox/BRepApprox_ApproxLine.cxx +++ b/src/BRepApprox/BRepApprox_ApproxLine.cxx @@ -32,11 +32,11 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepApprox_ApproxLine,Standard_Transient) BRepApprox_ApproxLine::BRepApprox_ApproxLine (const Handle(Geom_BSplineCurve)& CurveXYZ, const Handle(Geom2d_BSplineCurve)& CurveUV1, - const Handle(Geom2d_BSplineCurve)& CurveUV2) + const Handle(Geom2d_BSplineCurve)& CurveUV2) : myCurveXYZ(CurveXYZ), myCurveUV1(CurveUV1), myCurveUV2(CurveUV2) { - myCurveXYZ = CurveXYZ; - myCurveUV1 = CurveUV1; - myCurveUV2 = CurveUV2; + + + } diff --git a/src/BRepBndLib/BRepBndLib.cxx b/src/BRepBndLib/BRepBndLib.cxx index f3ab8ed860..0bc451d1dc 100644 --- a/src/BRepBndLib/BRepBndLib.cxx +++ b/src/BRepBndLib/BRepBndLib.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ // static Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS); // -static void FindExactUVBounds(const TopoDS_Face F, +static void FindExactUVBounds(const TopoDS_Face& F, Standard_Real& umin, Standard_Real& umax, Standard_Real& vmin, Standard_Real& vmax, const Standard_Real Tol, @@ -78,7 +80,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria // Add the faces BRepAdaptor_Surface BS; TopLoc_Location l, aDummyLoc; - Standard_Integer i, nbNodes; + Standard_Integer i = 0, nbNodes = 0; BRepAdaptor_Curve BC; for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) { @@ -237,7 +239,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B, BRepAdaptor_Surface BS; Handle(Poly_Triangulation) T; TopLoc_Location l; - Standard_Integer i, nbNodes; + Standard_Integer i = 0, nbNodes = 0; BRepAdaptor_Curve BC; for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) { @@ -248,7 +250,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B, { // B.Enlarge(T->Deflection()); aLocBox.Enlarge(T->Deflection() + BRep_Tool::Tolerance(F)); - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; aLocBox.Get(xmin, ymin, zmin, xmax, ymax, zmax); B.Update(xmin, ymin, zmin, xmax, ymax, zmax); } @@ -266,7 +268,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B, } else { - Standard_Real Tol; + Standard_Real Tol = NAN; for (;ex2.More();ex2.Next()) { Bnd_Box anEBox; const TopoDS_Edge& anE = TopoDS::Edge(ex2.Current()); @@ -283,7 +285,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B, } else { - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; Standard_Boolean isNaturalRestriction = Standard_False; Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(F) : 0.; FindExactUVBounds(F, umin, umax, vmin, vmax, Tol, isNaturalRestriction); @@ -314,7 +316,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B, if (!aLocBox.IsVoid()) { - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; aLocBox.Get(xmin, ymin, zmin, xmax, ymax, zmax); B.Update(xmin, ymin, zmin, xmax, ymax, zmax); } @@ -375,7 +377,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B, } if (!aLocBox.IsVoid()) { - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; aLocBox.Get(xmin, ymin, zmin, xmax, ymax, zmax); B.Update(xmin, ymin, zmin, xmax, ymax, zmax); } @@ -389,7 +391,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B, aLocBox.Add(BRep_Tool::Pnt(aV)); Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(aV) : 0.; aLocBox.Enlarge(Tol); - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; aLocBox.Get(xmin, ymin, zmin, xmax, ymax, zmax); B.Update(xmin, ymin, zmin, xmax, ymax, zmax); } @@ -460,7 +462,7 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS) //function : FindExactUVBounds //purpose : //======================================================================= -void FindExactUVBounds(const TopoDS_Face FF, +void FindExactUVBounds(const TopoDS_Face& FF, Standard_Real& umin, Standard_Real& umax, Standard_Real& vmin, Standard_Real& vmax, const Standard_Real Tol, @@ -481,7 +483,7 @@ void FindExactUVBounds(const TopoDS_Face FF, vmin = aBAS.FirstVParameter(); vmax = aBAS.LastVParameter(); Standard_Boolean isUperiodic = aBAS.IsUPeriodic(), isVperiodic = aBAS.IsVPeriodic(); - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; Standard_Real TolU = Max(aBAS.UResolution(Tol), Precision::PConfusion()); Standard_Real TolV = Max(aBAS.VResolution(Tol), Precision::PConfusion()); Standard_Integer Nu = 0, Nv = 0, NbEdges = 0; @@ -574,7 +576,7 @@ void FindExactUVBounds(const TopoDS_Face FF, } // fill box for the given face - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; Standard_Real TolU = Max(aBAS.UResolution(Tol), Precision::PConfusion()); Standard_Real TolV = Max(aBAS.VResolution(Tol), Precision::PConfusion()); Standard_Real TolUV = Max(TolU, TolV); @@ -596,7 +598,7 @@ void FindExactUVBounds(const TopoDS_Face FF, // TopLoc_Location aLoc; Handle(Geom_Surface) aS = BRep_Tool::Surface(FF, aLoc); - Standard_Real aUmin, aUmax, aVmin, aVmax; + Standard_Real aUmin = NAN, aUmax = NAN, aVmin = NAN, aVmax = NAN; aS->Bounds(aUmin, aUmax, aVmin, aVmax); if(!aS->IsUPeriodic()) { @@ -652,7 +654,7 @@ Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS, const BRepTopAdaptor_FClass2d& theFClass, const Standard_Real theTolU, const Standard_Real theTolV) { - Standard_Real pu1 = 0, pu2, pv1 = 0, pv2; + Standard_Real pu1 = 0, pu2 = NAN, pv1 = 0, pv2 = NAN; ElSLib::PlaneParameters(thePln.Position(), theP, pu2, pv2); Reorder(pu1, pu2); Reorder(pv1, pv2); @@ -663,7 +665,7 @@ Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS, { if(anExtr.NbExt() > 0) { - Standard_Integer i, imin = 0; + Standard_Integer i = 0, imin = 0; Standard_Real dmin = RealLast(); Standard_Real uextr = 0., vextr = 0.; Extrema_POnSurf P1, P2; @@ -722,8 +724,8 @@ void AdjustFaceBox(const BRepAdaptor_Surface& BS, return; } - Standard_Real fxmin, fymin, fzmin, fxmax, fymax, fzmax; - Standard_Real exmin, eymin, ezmin, exmax, eymax, ezmax; + Standard_Real fxmin = NAN, fymin = NAN, fzmin = NAN, fxmax = NAN, fymax = NAN, fzmax = NAN; + Standard_Real exmin = NAN, eymin = NAN, ezmin = NAN, exmax = NAN, eymax = NAN, ezmax = NAN; // FaceBox.Get(fxmin, fymin, fzmin, fxmax, fymax, fzmax); EdgeBox.Get(exmin, eymin, ezmin, exmax, eymax, ezmax); diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx index 2f54913e2c..c179841760 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx @@ -58,7 +58,7 @@ static void BuildBack (const TopTools_DataMapOfShapeListOfShape& M1, //======================================================================= static void Replace ( TopTools_ListOfShape& L, - const TopoDS_Shape Old, + const TopoDS_Shape& Old, const TopTools_ListOfShape& New) { //----------------------------------- @@ -150,7 +150,7 @@ static void Update ( TopTools_DataMapOfShapeListOfShape& Mod, if (!LIG.IsEmpty()) { if (ModBack.IsBound(S)) { // Generation de modif => generation du shape initial - TopoDS_Shape IS = ModBack(S); + const TopoDS_Shape& IS = ModBack(S); StoreImage (Gen,IS,GenBack,LIG); } else { diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx index a4ac6438fc..fa945c79a1 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx @@ -584,10 +584,10 @@ BRepBuilderAPI_FastSewing::NodeInspector:: const Standard_Real theTol) : myVecOfVertexes(theVec), myPoint(thePnt), - myResID(-1), + mySQToler(theTol*theTol), myResID(-1), myIsFindingEnable(Standard_False) { - mySQToler = theTol*theTol; + } //======================================================================= diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_FindPlane.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_FindPlane.cxx index 0f4e35eeac..008aad2bd4 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_FindPlane.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_FindPlane.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -77,11 +79,11 @@ void BRepBuilderAPI_FindPlane::Init(const TopoDS_Shape& S, Standard_Real tol2 = tolerance*tolerance; // try to find an analytical curve and calculate points TopLoc_Location loc; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Standard_Boolean found = Standard_False; Handle(Geom_Plane) P; TColgp_SequenceOfPnt points; - Standard_Integer nbPnts; + Standard_Integer nbPnts = 0; for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) { Handle(Geom_Curve) c3d = diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx index 5d74c71856..8f919bfa6e 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx @@ -237,7 +237,7 @@ void BRepBuilderAPI_MakeShapeOnMesh::Build(const Message_ProgressRange& theRange gp_Pln aPln(myMesh->Node(anIdx[0]), aNorm); BRepBuilderAPI_MakeFace aFaceMaker(aPln, aWire); - const TopoDS_Face aFace = aFaceMaker.Face(); + const TopoDS_Face& aFace = aFaceMaker.Face(); aBB.Add(aResult, aFace); } diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_ModifyShape.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_ModifyShape.cxx index 7ab53d2f76..4bda8f1f6b 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_ModifyShape.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_ModifyShape.cxx @@ -43,9 +43,9 @@ BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape (const TopoDS_Shape& S): //======================================================================= BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape - (const Handle(BRepTools_Modification)& M) + (const Handle(BRepTools_Modification)& M) : myModification(M) { - myModification = M; + } @@ -56,9 +56,9 @@ BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape BRepBuilderAPI_ModifyShape::BRepBuilderAPI_ModifyShape (const TopoDS_Shape& S, - const Handle(BRepTools_Modification)& M): myModifier(S),myInitialShape(S) + const Handle(BRepTools_Modification)& M): myModifier(S),myInitialShape(S), myModification(M) { - myModification = M; + DoModif(); } diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx index 65bb5ab958..7e8a3c931a 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx @@ -42,6 +42,8 @@ #define TEST 1 +#include + #include #include #include @@ -106,6 +108,7 @@ #include #include #include +#include IMPLEMENT_STANDARD_RTTIEXT(BRepBuilderAPI_Sewing,Standard_Transient) @@ -171,7 +174,7 @@ static Standard_Boolean IsClosedShape(const TopoDS_Shape& theshape, TopExp::Vertices(aedge,ve1,ve2); if (!ve1.IsSame(v1) && !ve1.IsSame(v2)) continue; if (BRep_Tool::Degenerated(aedge)) continue; - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(aedge), first, last); if (!c3d.IsNull()) { GeomAdaptor_Curve cAdapt(c3d); @@ -248,7 +251,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsUClosedSurface(const Handle(Geom_Surfa else { Standard_Boolean isClosed = tmpsurf->IsUClosed(); if(!isClosed) { - Standard_Real f2d, l2d; + Standard_Real f2d = NAN, l2d = NAN; Handle(Geom2d_Curve) acrv2d = BRep_Tool::CurveOnSurface(TopoDS::Edge(theEdge), surf,theloc, f2d, l2d); if(!acrv2d.IsNull()) isClosed = IsClosedByIsos(tmpsurf,acrv2d,f2d, l2d,Standard_False ); @@ -277,7 +280,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsVClosedSurface(const Handle(Geom_Surfa else { Standard_Boolean isClosed = tmpsurf->IsVClosed(); if(!isClosed) { - Standard_Real f2d, l2d; + Standard_Real f2d = NAN, l2d = NAN; Handle(Geom2d_Curve) acrv2d = BRep_Tool::CurveOnSurface(TopoDS::Edge(theEdge), surf,theloc, f2d, l2d); if(!acrv2d.IsNull()) isClosed = IsClosedByIsos(tmpsurf,acrv2d,f2d, l2d,Standard_True ); @@ -374,7 +377,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Shape& edge, for (Standard_Integer i = 1; i <= seqEdges.Length(); i++) { // Retrieve candidate section - TopoDS_Shape oedge2 = seqEdges(i); + const TopoDS_Shape& oedge2 = seqEdges(i); if (mySewing) { @@ -442,7 +445,7 @@ static Standard_Boolean findNMVertices(const TopoDS_Edge& theEdge, Standard_Integer nbV = theSeqNMVert.Length(); if(!nbV) return Standard_False; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(theEdge,first, last); GeomAdaptor_Curve GAC(c3d); Extrema_ExtPC locProj; @@ -461,7 +464,7 @@ static Standard_Boolean findNMVertices(const TopoDS_Edge& theEdge, locProj.Perform(pt); if (locProj.IsDone() && locProj.NbExt() > 0) { Standard_Real dist2Min = Min(distF2,distL2); - Standard_Integer ind, indMin = 0; + Standard_Integer ind = 0, indMin = 0; for (ind = 1; ind <= locProj.NbExt(); ind++) { Standard_Real dProj2 = locProj.SquareDistance(ind); if (dProj2 < dist2Min) { @@ -481,15 +484,15 @@ static Standard_Boolean findNMVertices(const TopoDS_Edge& theEdge, static void ComputeToleranceVertex(TopoDS_Vertex theV1, TopoDS_Vertex theV2, TopoDS_Vertex& theNewV) { - Standard_Integer m, n; - Standard_Real aR[2], dR, aD, aEps; + Standard_Integer m = 0, n = 0; + Standard_Real aR[2], dR = NAN, aD = NAN, aEps = NAN; TopoDS_Vertex aV[2]; gp_Pnt aP[2]; BRep_Builder aBB; // aEps = RealEpsilon(); - aV[0] = theV1; - aV[1] = theV2; + aV[0] = std::move(theV1); + aV[1] = std::move(theV2); for (m = 0; m < 2; ++m) { aP[m] = BRep_Tool::Pnt(aV[m]); aR[m] = BRep_Tool::Tolerance(aV[m]); @@ -510,7 +513,7 @@ static void ComputeToleranceVertex(TopoDS_Vertex theV1, TopoDS_Vertex theV2, aBB.MakeVertex (theNewV, aP[m], aR[m]); } else { - Standard_Real aRr; + Standard_Real aRr = NAN; gp_XYZ aXYZr; gp_Pnt aPr; // @@ -526,15 +529,15 @@ static void ComputeToleranceVertex(TopoDS_Vertex theV1, TopoDS_Vertex theV2, static void ComputeToleranceVertex(TopoDS_Vertex theV1, TopoDS_Vertex theV2, TopoDS_Vertex theV3, TopoDS_Vertex& theNewV) { - Standard_Real aDi, aDmax; + Standard_Real aDi = NAN, aDmax = NAN; gp_Pnt aCenter; gp_Pnt aP[3]; Standard_Real aR[3]; TopoDS_Vertex aV[3]; gp_XYZ aXYZ(0.,0.,0.); - aV[0] = theV1; - aV[1] = theV2; - aV[2] = theV3; + aV[0] = std::move(theV1); + aV[1] = std::move(theV2); + aV[2] = std::move(theV3); for (Standard_Integer i = 0; i < 3; ++i) { aP[i] = BRep_Tool::Pnt(aV[i]); aR[i] = BRep_Tool::Tolerance(aV[i]); @@ -572,7 +575,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs TopoDS_Edge edge1, edge2; if (firstCall) { // Take the longest edge as first - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) c3d1 = BRep_Tool::Curve(TopoDS::Edge(edgeFirst), f, l); GeomAdaptor_Curve cAdapt1(c3d1); Standard_Real len1 = GCPnts_AbscissaPoint::Length(cAdapt1, f, l); @@ -603,7 +606,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs } } - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_Tool::Range(edge1, first, last); BRep_Builder aBuilder; @@ -621,7 +624,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs // Retrieve edge curve TopLoc_Location loc3d; - Standard_Real first3d, last3d; + Standard_Real first3d = NAN, last3d = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge1, loc3d, first3d, last3d); if (!loc3d.IsIdentity()) { c3d = Handle(Geom_Curve)::DownCast(c3d->Copy()); @@ -740,7 +743,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs TopoDS_Face fac2; for (; itf2.More(); itf2.Next()) { Handle(Geom2d_Curve) c2d2, c2d21; - Standard_Real firstOld, lastOld; + Standard_Real firstOld = NAN, lastOld = NAN; fac2 = TopoDS::Face(itf2.Value()); surf2 = BRep_Tool::Surface(fac2, loc2); @@ -799,7 +802,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs TopLoc_Location loc1; Handle(Geom_Surface) surf1 = BRep_Tool::Surface(fac1, loc1); - Standard_Real first2d, last2d; + Standard_Real first2d = NAN, last2d = NAN; Standard_Boolean isSeam1 = ((IsUClosedSurface(surf1,edge1,loc1) || IsVClosedSurface(surf1,edge1,loc1)) && BRep_Tool::IsClosed(TopoDS::Edge(edge1),fac1)); c2d1 = BRep_Tool::CurveOnSurface(edge1, fac1, first2d, last2d); @@ -834,7 +837,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs gp_Pnt2d p21n = c2d2->Value(Max(first,c2d2->FirstParameter())); gp_Pnt2d p22n = c2d2->Value(Min(last,c2d2->LastParameter())); Standard_Real aDist = Min(p1n.Distance(p21n), p1n.Distance(p22n)); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; surf2->Bounds(U1, U2, V1, V2); isSeam = ((uclosed && aDist > 0.75*(fabs(U2-U1))) || (vclosed && aDist > 0.75*(fabs(V2-V1)))); @@ -915,7 +918,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs GeomAdaptor_Curve c3dAdapt(c3d); // Discretize edge curve - Standard_Integer i, j, nbp = 23; + Standard_Integer i = 0, j = 0, nbp = 23; Standard_Real deltaT = (last3d - first3d) / (nbp -1); TColgp_Array1OfPnt c3dpnt(1,nbp); for (i = 1; i <= nbp; i++) @@ -953,7 +956,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs if (tolReached > MaxTolerance()) { // Set tolerance directly to overwrite too large tolerance - static_cast(edge.TShape().get())->Tolerance(maxTol); + dynamic_cast(edge.TShape().get())->Tolerance(maxTol); } else { @@ -982,12 +985,12 @@ void BRepBuilderAPI_Sewing::EvaluateAngulars(TopTools_SequenceOfShape& sequenceS { tabAng.Init(-1.0); - Standard_Integer i, j, npt = 4, lengSec = sequenceSec.Length(); + Standard_Integer i = 0, j = 0, npt = 4, lengSec = sequenceSec.Length(); TopoDS_Edge edge; TopoDS_Face face; TopLoc_Location loc; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom_Curve) c3d; Handle(Geom2d_Curve) c2d; Handle(Geom_Surface) surf; @@ -1064,7 +1067,7 @@ void BRepBuilderAPI_Sewing::EvaluateDistances(TopTools_SequenceOfShape& sequence const Standard_Integer npt = 8; // Number of points for curve discretization TColgp_Array1OfPnt ptsRef(1, npt), ptsSec(1, npt); - Standard_Integer i, j, lengSec = sequenceSec.Length(); + Standard_Integer i = 0, j = 0, lengSec = sequenceSec.Length(); TColgp_SequenceOfPnt seqSec; Handle(Geom_Curve) c3dRef; @@ -1076,7 +1079,7 @@ void BRepBuilderAPI_Sewing::EvaluateDistances(TopTools_SequenceOfShape& sequence const TopoDS_Edge& sec = TopoDS::Edge(sequenceSec(i)); TopLoc_Location loc; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(sec, loc, first, last); if (c3d.IsNull()) continue; if (!loc.IsIdentity()) { @@ -1091,7 +1094,7 @@ void BRepBuilderAPI_Sewing::EvaluateDistances(TopTools_SequenceOfShape& sequence Standard_Real dist = Precision::Infinite(), distFor = -1.0, distRev = -1.0; Standard_Real aMinDist = Precision::Infinite(); - Standard_Real T, deltaT = (last - first) / (npt - 1); + Standard_Real T = NAN, deltaT = (last - first) / (npt - 1); Standard_Real aLenSec2 = 0.; Standard_Integer nbFound = 0; @@ -1262,7 +1265,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1, Handle(Geom_Curve) C3d2 = BRep_Tool::Curve(Edge2,first2,last2); if (C3d1.IsNull() || C3d2.IsNull()) return Standard_False; */ - Standard_Real first2d1,last2d1,first2d2,last2d2; + Standard_Real first2d1 = NAN,last2d1 = NAN,first2d2 = NAN,last2d2 = NAN; Handle(Geom2d_Curve) C2d1 = BRep_Tool::CurveOnSurface(Edge1,face,first2d1,last2d1); Handle(Geom2d_Curve) C2d2 = BRep_Tool::CurveOnSurface(Edge2,face,first2d2,last2d2); if (C2d1.IsNull() || C2d2.IsNull()) return Standard_False; @@ -1277,10 +1280,10 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1, Standard_Real distSurf = Max(Ads.UResolution(dist), Ads.VResolution(dist)); return (dist2d*0.2 >= distSurf); */ - Standard_Integer isULongC1, isULongC2, isVLongC1, isVLongC2; - Standard_Real SUmin, SUmax, SVmin, SVmax; - Standard_Real C1Umin, C1Vmin, C1Umax, C1Vmax; - Standard_Real C2Umin, C2Vmin, C2Umax, C2Vmax; + Standard_Integer isULongC1 = 0, isULongC2 = 0, isVLongC1 = 0, isVLongC2 = 0; + Standard_Real SUmin = NAN, SUmax = NAN, SVmin = NAN, SVmax = NAN; + Standard_Real C1Umin = NAN, C1Vmin = NAN, C1Umax = NAN, C1Vmax = NAN; + Standard_Real C2Umin = NAN, C2Vmin = NAN, C2Umax = NAN, C2Vmax = NAN; { //szv: Use brackets to destroy local variables Bnd_Box2d B1, B2; Geom2dAdaptor_Curve aC2d1(C2d1), aC2d2(C2d2); @@ -1288,7 +1291,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1, BndLib_Add2dCurve::Add(aC2d2,first2d2,last2d2,Precision::PConfusion(),B2); B1.Get(C1Umin,C1Vmin,C1Umax,C1Vmax); B2.Get(C2Umin,C2Vmin,C2Umax,C2Vmax); - Standard_Real du, dv; + Standard_Real du = NAN, dv = NAN; du = (C1Umax - C1Umin); dv = (C1Vmax - C1Vmin); isULongC1 = (dv <= du); isVLongC1 = (du <= dv); du = (C2Umax - C2Umin); dv = (C2Vmax - C2Vmin); @@ -1393,7 +1396,7 @@ void BRepBuilderAPI_Sewing::AnalysisNearestEdges(const TopTools_SequenceOfShape& // (they have other nearest edges belonging to the work face) for(Standard_Integer k = 1; k<= seqNotCandidate.Length(); k++) { Standard_Integer index1 = seqNotCandidate.Value(k); - TopoDS_Shape edge = sequenceSec.Value(index1); + const TopoDS_Shape& edge = sequenceSec.Value(index1); TopTools_SequenceOfShape tmpSeq; tmpSeq.Append(edge); for(Standard_Integer kk = 1; kk <= seqIndCandidate.Length();kk++) @@ -1449,7 +1452,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape& TColStd_SequenceOfInteger& seqCandidates, TColStd_SequenceOfBoolean& seqOrientations) { - Standard_Integer i, nbSections = seqSections.Length(); + Standard_Integer i = 0, nbSections = seqSections.Length(); if(nbSections <= 1) return Standard_False; // Retrieve last reference index @@ -1704,9 +1707,9 @@ BRepBuilderAPI_Sewing::BRepBuilderAPI_Sewing(const Standard_Real tolerance, const Standard_Boolean optionSewing, const Standard_Boolean optionAnalysis, const Standard_Boolean optionCutting, - const Standard_Boolean optionNonmanifold) + const Standard_Boolean optionNonmanifold) : myReShape(new BRepTools_ReShape) { - myReShape = new BRepTools_ReShape; + Init(tolerance, optionSewing, optionAnalysis, optionCutting, optionNonmanifold); } @@ -2168,7 +2171,7 @@ TopoDS_Shape BRepBuilderAPI_Sewing::ModifiedSubShape(const TopoDS_Shape& aShape) void BRepBuilderAPI_Sewing::Dump() const { - Standard_Integer i, NbBounds = myBoundFaces.Extent(), NbSections = 0; + Standard_Integer i = 0, NbBounds = myBoundFaces.Extent(), NbSections = 0; TopTools_MapOfShape mapVertices, mapEdges; for (i = 1; i <= NbBounds; i++) { TopoDS_Shape bound = myBoundFaces.FindKey(i); @@ -2272,7 +2275,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Message_ProgressRange& theProgres if (!isSmall) { // Check for small edge - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,first,last); if (c3d.IsNull()) { #ifdef OCCT_DEBUG @@ -2283,7 +2286,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Message_ProgressRange& theProgres // Evaluate curve compactness const Standard_Integer npt = 5; gp_Pnt cp((c3d->Value(first).XYZ()+c3d->Value(last).XYZ())*0.5); - Standard_Real dist, maxdist = 0.0; + Standard_Real dist = NAN, maxdist = 0.0; Standard_Real delta = (last - first)/(npt - 1); for (Standard_Integer idx = 0; idx < npt; idx++) { dist = cp.Distance(c3d->Value(first + idx*delta)); @@ -2362,7 +2365,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Message_ProgressRange& theProgres // Create new degenerated edge aTmpShape = edge.Oriented(TopAbs_FORWARD); TopoDS_Edge fedge = TopoDS::Edge(aTmpShape); - Standard_Real pfirst, plast; + Standard_Real pfirst = NAN, plast = NAN; Handle(Geom2d_Curve) c2d = BRep_Tool::CurveOnSurface(fedge,face,pfirst,plast); if (!c2d.IsNull()) { TopoDS_Edge nedge; @@ -2461,7 +2464,7 @@ void BRepBuilderAPI_Sewing::FindFreeBoundaries() } // Create map Edge -> Faces TopTools_IndexedDataMapOfShapeListOfShape EdgeFaces; - Standard_Integer i, nbShapes = myOldShapes.Extent(); + Standard_Integer i = 0, nbShapes = myOldShapes.Extent(); for (i = 1; i <= nbShapes; i++) { // Retrieve new shape const TopoDS_Shape& shape = myOldShapes(i); @@ -2531,7 +2534,7 @@ void BRepBuilderAPI_Sewing::FindFreeBoundaries() - Standard_Real first2d,last2d; + Standard_Real first2d = NAN,last2d = NAN; Handle(Geom2d_Curve) c2dold = BRep_Tool::CurveOnSurface(TopoDS::Edge(edge),TopoDS::Face(listFaces.First()),first2d,last2d); @@ -2540,7 +2543,7 @@ void BRepBuilderAPI_Sewing::FindFreeBoundaries() B.UpdateEdge(TopoDS::Edge(anewEdge),c2d,c2d,TopoDS::Face(listFaces.First()),0); B.UpdateEdge(TopoDS::Edge(anewEdge),c2dold,TopoDS::Face(listFaces.First()),0); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; BRep_Tool::Range(TopoDS::Edge(edge),aFirst, aLast); aB.Range(TopoDS::Edge(anewEdge),aFirst, aLast); aB.Range(TopoDS::Edge(anewEdge),TopoDS::Face(listFaces.First()),first2d,last2d); @@ -2924,11 +2927,11 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Message_ProgressRange& theP Message_ProgressScope aPS (theProgress, "Vertices assembling", 2); if (nbVert || nbVertFree) { // Fill map node -> sections - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= myBoundFaces.Extent(); i++) { TopoDS_Shape bound = myBoundFaces.FindKey(i); for (TopoDS_Iterator itv(bound,Standard_False); itv.More(); itv.Next()) { - TopoDS_Shape node = itv.Value(); + const TopoDS_Shape& node = itv.Value(); if (myNodeSections.IsBound(node)) myNodeSections(node).Append(bound); else { @@ -2971,7 +2974,7 @@ static void replaceNMVertices(const TopoDS_Edge& theEdge, Standard_Boolean hasNMVert = findNMVertices(theEdge,aSeqNMVert,aSeqNMPars); if(!hasNMVert) return; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_Tool::Range(theEdge, first, last); TopLoc_Location aLoc; Handle(Geom_Curve) c3d = BRep_Tool::Curve(theEdge,aLoc,first, last); @@ -2991,7 +2994,7 @@ static void replaceNMVertices(const TopoDS_Edge& theEdge, theReShape->Replace(aSeqNMVert.Value(i),theV2); continue; } - TopoDS_Shape aV = aSeqNMVert.Value(i); + const TopoDS_Shape& aV = aSeqNMVert.Value(i); Standard_Integer j =1; for( ; j <= aEdParams.Length();j++) { Standard_Real apar2 = aEdParams.Value(j); @@ -3508,7 +3511,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e TopTools_MapOfShape mapEdges; mapEdges.Add(edge); for (Standard_Integer i = 1; i <= mapVert1.Extent(); i++) { - TopoDS_Shape node1 = mapVert1.FindKey(i); + const TopoDS_Shape& node1 = mapVert1.FindKey(i); if (!myNodeSections.IsBound(node1)) continue; TopTools_ListIteratorOfListOfShape ilsec(myNodeSections(node1)); for (; ilsec.More(); ilsec.Next()) { @@ -3553,11 +3556,11 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e Standard_Integer nbSection = seqEdges.Length(); if (nbSection > 1) { // Find the longest edge CCI60011 - Standard_Integer i, indRef = 1; + Standard_Integer i = 0, indRef = 1; if (myNonmanifold) { Standard_Real lenRef = 0.; for (i = 1; i <= nbSection; i++) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(seqEdges(i)), f, l); GeomAdaptor_Curve cAdapt(c3d); Standard_Real len = GCPnts_AbscissaPoint::Length(cAdapt, f, l); @@ -3603,7 +3606,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e void BRepBuilderAPI_Sewing::Cutting(const Message_ProgressRange& theProgress) { - Standard_Integer i, nbVertices = myVertexNode.Extent(); + Standard_Integer i = 0, nbVertices = myVertexNode.Extent(); if (!nbVertices) return; // Create a box tree with vertices Standard_Real eps = myTolerance*0.5; @@ -3621,7 +3624,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Message_ProgressRange& theProgress) Handle(Geom_Curve) c3d; TopLoc_Location loc; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; // Iterate on all boundaries Standard_Integer nbBounds = myBoundFaces.Extent(); Message_ProgressScope aPS (theProgress, "Cutting bounds", nbBounds); @@ -3739,7 +3742,7 @@ static void GetSeqEdges(const TopoDS_Shape& edge, const TopoDS_Shape& edge1 = lIt.Value(); if (edge1.IsSame(edge)) continue; Standard_Boolean isContained = Standard_False; - Standard_Integer i, index = 1; + Standard_Integer i = 0, index = 1; for (i = 1; i <= seqEdges.Length() && !isContained; i++) { isContained = seqEdges.Value(i).IsSame(edge1); if (!isContained && seqEdges.Value(i).IsSame(edge)) index = i; @@ -3779,7 +3782,7 @@ void BRepBuilderAPI_Sewing::GetFreeWires(TopTools_IndexedMapOfShape& MapFreeEdge } } BRep_Builder B; - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for (i = 1; i <= seqFreeEdges.Length(); i++) { TopTools_SequenceOfShape seqEdges; const TopoDS_Shape& edge = seqFreeEdges.Value(i); @@ -3811,7 +3814,7 @@ static Standard_Boolean IsDegeneratedWire(const TopoDS_Shape& wire) //Standard_Real tol = Max(BRep_Tool::Tolerance(V1),BRep_Tool::Tolerance(V2)); Standard_Real wireLength = 0.0; TopLoc_Location loc; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Standard_Integer nume = 0; Standard_Integer isSmall = 0; for (TopoDS_Iterator aIt(wire,Standard_False); aIt.More(); aIt.Next()) { @@ -3875,7 +3878,7 @@ static TopoDS_Edge DegeneratedSection(const TopoDS_Shape& section, const TopoDS_ // Retrieve edge curve TopLoc_Location loc; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(section), loc, first, last); if (c3d.IsNull()) { //gka BRep_Builder aB; @@ -3941,7 +3944,7 @@ static TopoDS_Edge DegeneratedSection(const TopoDS_Shape& section, const TopoDS_ aBuilder.Degenerated(edge, Standard_True); Handle(Geom_Curve) aC3dNew; if (!face.IsNull()) { - Standard_Real af,al; + Standard_Real af = NAN,al = NAN; Handle(Geom2d_Curve) aC2dt = BRep_Tool::CurveOnSurface(TopoDS::Edge(section),TopoDS::Face(face),af,al); aBuilder.UpdateEdge(edge,aC3dNew,0); Handle(Geom2d_Curve) aC2dn = BRep_Tool::CurveOnSurface(edge,TopoDS::Face(face),af,al); @@ -4207,7 +4210,7 @@ void BRepBuilderAPI_Sewing::CreateSewedShape() void BRepBuilderAPI_Sewing::CreateOutputInformations() { // Construct edgeSections - Standard_Integer i; + Standard_Integer i = 0; //TopTools_DataMapOfShapeListOfShape edgeSections; TopTools_IndexedDataMapOfShapeListOfShape edgeSections; //use index map for regulating free edges for (i = 1; i <= myBoundFaces.Extent(); i++) { @@ -4307,7 +4310,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn locProj.Perform(pt); if (locProj.IsDone() && locProj.NbExt() > 0) { Standard_Real dist2Min = (isConsiderEnds || i1 == find || i1 == lind ? Min(distF2,distL2) : Precision::Infinite()); - Standard_Integer ind, indMin = 0; + Standard_Integer ind = 0, indMin = 0; for (ind = 1; ind <= locProj.NbExt(); ind++) { Standard_Real dProj2 = locProj.SquareDistance(ind); if (dProj2 < dist2Min) { indMin = ind; dist2Min = dProj2; } @@ -4380,7 +4383,7 @@ void BRepBuilderAPI_Sewing::CreateCuttingNodes(const TopTools_IndexedMapOfShape& TopTools_SequenceOfShape& seqVert, TColStd_SequenceOfReal& seqPara) { - Standard_Integer i, j, nbProj = MapVert.Extent(); + Standard_Integer i = 0, j = 0, nbProj = MapVert.Extent(); // Reorder projections by distance TColStd_SequenceOfInteger seqOrderedIndex; @@ -4414,7 +4417,7 @@ void BRepBuilderAPI_Sewing::CreateCuttingNodes(const TopTools_IndexedMapOfShape& { //szv: Use brackets to destroy local variables // Retrieve bound curve TopLoc_Location loc; - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(bound), loc, first, last); if (!loc.IsIdentity()) { c3d = Handle(Geom_Curve)::DownCast(c3d->Copy()); @@ -4440,7 +4443,7 @@ void BRepBuilderAPI_Sewing::CreateCuttingNodes(const TopTools_IndexedMapOfShape& // Find the closest vertex Standard_Integer indexMin = 1; - Standard_Real dist, distMin = pntProj.Distance(seqPnt(1)); + Standard_Real dist = NAN, distMin = pntProj.Distance(seqPnt(1)); for (j = 2; j <= seqPnt.Length(); j++) { dist = pntProj.Distance(seqPnt(j)); if (dist < distMin) { distMin = dist; indexMin = j; } @@ -4453,7 +4456,7 @@ void BRepBuilderAPI_Sewing::CreateCuttingNodes(const TopTools_IndexedMapOfShape& if (jdist < 0.0) { // Bind new cutting node (end vertex only) seqDist.SetValue(indexMin,disProj); - TopoDS_Shape cvertex = seqVert.Value(indexMin); + const TopoDS_Shape& cvertex = seqVert.Value(indexMin); NodeCuttingVertex.Add(node,cvertex); } else { @@ -4536,13 +4539,13 @@ void BRepBuilderAPI_Sewing::CreateSections(const TopoDS_Shape& section, BRep_Builder aBuilder; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_Tool::Range(sec, first, last); // Create cutting sections - Standard_Real par1, par2; + Standard_Real par1 = NAN, par2 = NAN; TopoDS_Shape V1, V2; - Standard_Integer i, len = seqPara.Length() + 1; + Standard_Integer i = 0, len = seqPara.Length() + 1; for (i = 1; i <= len; i++) { TopoDS_Edge edge = sec; @@ -4743,7 +4746,7 @@ NCollection_CellFilter_Action BRepBuilderAPI_VertexInspector::Inspect (const Sta myResInd.Append (theTarget);*/ const gp_XYZ& aPnt = myPoints.Value (theTarget - 1); - Standard_Real aDx, aDy, aDz; + Standard_Real aDx = NAN, aDy = NAN, aDz = NAN; aDx = myCurrent.X() - aPnt.X(); aDy = myCurrent.Y() - aPnt.Y(); aDz = myCurrent.Z() - aPnt.Z(); diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx index 883f3d6c3f..ba730bd4a0 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.hxx @@ -333,11 +333,11 @@ protected: //! This method is called from Perform only Standard_EXPORT virtual void SameParameterShape(); - Standard_Real myTolerance; - Standard_Boolean mySewing; - Standard_Boolean myAnalysis; - Standard_Boolean myCutting; - Standard_Boolean myNonmanifold; + Standard_Real myTolerance{}; + Standard_Boolean mySewing{}; + Standard_Boolean myAnalysis{}; + Standard_Boolean myCutting{}; + Standard_Boolean myNonmanifold{}; TopTools_IndexedDataMapOfShapeShape myOldShapes; TopoDS_Shape mySewedShape; TopTools_IndexedMapOfShape myDegenerated; @@ -345,9 +345,9 @@ protected: TopTools_IndexedMapOfShape myMultipleEdges; TopTools_IndexedDataMapOfShapeListOfShape myContigousEdges; TopTools_DataMapOfShapeShape myContigSecBound; - Standard_Integer myNbShapes; - Standard_Integer myNbVertices; - Standard_Integer myNbEdges; + Standard_Integer myNbShapes{}; + Standard_Integer myNbVertices{}; + Standard_Integer myNbEdges{}; TopTools_IndexedDataMapOfShapeListOfShape myBoundFaces; TopTools_DataMapOfShapeListOfShape myBoundSections; TopTools_DataMapOfShapeShape mySectionBound; @@ -363,12 +363,12 @@ protected: private: - Standard_Boolean myFaceMode; - Standard_Boolean myFloatingEdgesMode; - Standard_Boolean mySameParameterMode; - Standard_Boolean myLocalToleranceMode; - Standard_Real myMinTolerance; - Standard_Real myMaxTolerance; + Standard_Boolean myFaceMode{}; + Standard_Boolean myFloatingEdgesMode{}; + Standard_Boolean mySameParameterMode{}; + Standard_Boolean myLocalToleranceMode{}; + Standard_Real myMinTolerance{}; + Standard_Real myMaxTolerance{}; TopTools_MapOfShape myMergedEdges; diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Transform.hxx b/src/BRepBuilderAPI/BRepBuilderAPI_Transform.hxx index b0cdaa1813..fed5409b9c 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Transform.hxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Transform.hxx @@ -104,7 +104,7 @@ private: gp_Trsf myTrsf; TopLoc_Location myLocation; - Standard_Boolean myUseModif; + Standard_Boolean myUseModif{}; }; diff --git a/src/BRepCheck/BRepCheck_Edge.cxx b/src/BRepCheck/BRepCheck_Edge.cxx index 32d55b8cd7..9f3e612ee7 100644 --- a/src/BRepCheck/BRepCheck_Edge.cxx +++ b/src/BRepCheck/BRepCheck_Edge.cxx @@ -17,6 +17,8 @@ #include #include +#include + #include #include #include @@ -64,11 +66,11 @@ static const Standard_Integer NCONTROL=23; //purpose : //======================================================================= -BRepCheck_Edge::BRepCheck_Edge(const TopoDS_Edge& E) +BRepCheck_Edge::BRepCheck_Edge(const TopoDS_Edge& E) : myGctrl(Standard_True), myIsExactMethod(Standard_False) { Init(E); - myGctrl = Standard_True; - myIsExactMethod = Standard_False; + + } //======================================================================= @@ -141,7 +143,7 @@ void BRepCheck_Edge::Minimum() if (!myCref.IsNull()) { Handle(BRep_GCurve) GCref (Handle(BRep_GCurve)::DownCast (myCref)); Standard_Real eps = Precision::PConfusion(); - Standard_Real First,Last; + Standard_Real First = NAN,Last = NAN; GCref->Range(First,Last); if (Last<=First) { myCref.Nullify(); @@ -321,7 +323,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S) if (cr != myCref && cr->IsCurveOnSurface(Su,L)) { pcurvefound = Standard_True; Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast(cr)); - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; GC->Range(f,l); Standard_Real ff = f, ll = l; if(myCref->IsCurve3D()) @@ -567,12 +569,12 @@ void BRepCheck_Edge::SetStatus(const BRepCheck_Status theStatus) Standard_Real BRepCheck_Edge::Tolerance() { Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&myShape.TShape()); - Standard_Integer it, iRep=1, nbRep=(TE->Curves()).Extent(); + Standard_Integer it = 0, iRep=1, nbRep=(TE->Curves()).Extent(); if (nbRep<=1) { return Precision::Confusion(); } TColStd_Array1OfTransient theRep(1, nbRep*2); - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; if (!myHCurve.IsNull()) { First = myHCurve->FirstParameter(); Last= myHCurve->LastParameter(); @@ -634,9 +636,9 @@ Standard_Real BRepCheck_Edge::Tolerance() } } - Standard_Real dist2, tol2, tolCal=0., prm; + Standard_Real dist2 = NAN, tol2 = NAN, tolCal=0., prm = NAN; gp_Pnt center, othP; - Standard_Integer i; + Standard_Integer i = 0; for (i= 0; i< NCONTROL; i++) { prm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1); tol2=dist2=0.; diff --git a/src/BRepCheck/BRepCheck_Face.cxx b/src/BRepCheck/BRepCheck_Face.cxx index f128ec6d4d..86de687b58 100644 --- a/src/BRepCheck/BRepCheck_Face.cxx +++ b/src/BRepCheck/BRepCheck_Face.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -79,15 +81,15 @@ static Standard_Boolean CheckThin(const TopoDS_Shape& w, //======================================================================= BRepCheck_Face::BRepCheck_Face (const TopoDS_Face& F) -: myIntres(BRepCheck_NoError), - myImbres(BRepCheck_NoError), - myOrires(BRepCheck_NoError) +: myIntdone(Standard_False), myIntres(BRepCheck_NoError), + myImbdone(Standard_False), myImbres(BRepCheck_NoError), + myOridone(Standard_False), myOrires(BRepCheck_NoError), myGctrl(Standard_True) { Init(F); - myIntdone = Standard_False; - myImbdone = Standard_False; - myOridone = Standard_False; - myGctrl = Standard_True; + + + + } //======================================================================= @@ -217,7 +219,7 @@ BRepCheck_Status BRepCheck_Face::IntersectWires(const Standard_Boolean Update) } Geom2dAdaptor_Curve aC; - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; DataMapOfShapeBox2d aMapShapeBox2d; for (exp1.Init (myShape, TopAbs_WIRE); exp1.More(); exp1.Next()) { @@ -245,7 +247,7 @@ BRepCheck_Status BRepCheck_Face::IntersectWires(const Standard_Boolean Update) aMapShapeBox2d.Bind (aWire, aBoxW); } - Standard_Integer Nbwire, Index,Indexbis; + Standard_Integer Nbwire = 0, Index = 0,Indexbis = 0; Nbwire = myMapImb.Extent(); Index = 1; @@ -625,7 +627,7 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1, MapW1.Add( exp1.Current() ); for (exp2.Init( wir2, TopAbs_VERTEX ); exp2.More(); exp2.Next()) { - TopoDS_Shape V = exp2.Current(); + const TopoDS_Shape& V = exp2.Current(); if (MapW1.Contains( V )) CommonVertices.Append( V ); } @@ -635,7 +637,7 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1, BRepAdaptor_Surface Surf(F,Standard_False); TColgp_SequenceOfPnt PntSeq; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= CommonVertices.Length(); i++) { TopoDS_Vertex V = TopoDS::Vertex( CommonVertices(i) ); @@ -646,7 +648,7 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1, Geom2dAdaptor_Curve C1,C2; gp_Pnt2d pfirst1,plast1,pfirst2,plast2; - Standard_Real first1,last1,first2,last2; + Standard_Real first1 = NAN,last1 = NAN,first2 = NAN,last2 = NAN; Geom2dInt_GInter Inter; IntRes2d_Domain myDomain1,myDomain2; Bnd_Box2d Box1, Box2; @@ -774,7 +776,7 @@ static Standard_Boolean IsInside(const TopoDS_Wire& theWire, const BRepTopAdaptor_FClass2d& FClass2d, const TopoDS_Face& theFace) { - Standard_Real aParameter, aFirst, aLast; + Standard_Real aParameter = NAN, aFirst = NAN, aLast = NAN; TopExp_Explorer anExplorer(theWire, TopAbs_EDGE); for( ; anExplorer.More(); anExplorer.Next() ) @@ -796,7 +798,7 @@ static Standard_Boolean IsInside(const TopoDS_Wire& theWire, } //Edge is skipped if its length is too small - Standard_Real aFirst3D, aLast3D; + Standard_Real aFirst3D = NAN, aLast3D = NAN; Handle(Geom_Curve) aCurve = BRep_Tool::Curve( anEdge, aFirst3D, aLast3D ); if ( aCurve.IsNull() ) { diff --git a/src/BRepCheck/BRepCheck_Shell.cxx b/src/BRepCheck/BRepCheck_Shell.cxx index d94e5226ad..b274566002 100644 --- a/src/BRepCheck/BRepCheck_Shell.cxx +++ b/src/BRepCheck/BRepCheck_Shell.cxx @@ -288,7 +288,7 @@ BRepCheck_Status BRepCheck_Shell::Closed(const Standard_Boolean Update) myCstat = BRepCheck_NoError; // - Standard_Integer index, aNbF; + Standard_Integer index = 0, aNbF = 0; TopExp_Explorer exp, ede; TopTools_IndexedMapOfShape mapS; TopTools_MapOfShape aMEToAvoid; @@ -394,7 +394,7 @@ BRepCheck_Status BRepCheck_Shell::Closed(const Standard_Boolean Update) } // // - Standard_Integer i, Nbedges, nboc, nbSet; + Standard_Integer i = 0, Nbedges = 0, nboc = 0, nbSet = 0; // Nbedges = myMapEF.Extent(); for (i = 1; i<=Nbedges; ++i) @@ -884,7 +884,7 @@ Standard_Integer BRepCheck_Shell::NbConnectedSet(TopTools_ListOfShape& theSets) TopExp_Explorer exsh(myShape, TopAbs_FACE); for (; exsh.More(); exsh.Next()) theFaces.Add(exsh.Current()); // The edges that are not oriented or have more than 2 connections are missing - Standard_Integer iCur; + Standard_Integer iCur = 0; TopTools_MapOfShape theMultiEd; TopTools_MapOfShape theUnOriEd; for (iCur=1; iCur<=parents.Extent(); iCur++) { diff --git a/src/BRepCheck/BRepCheck_Solid.cxx b/src/BRepCheck/BRepCheck_Solid.cxx index 43baa11a32..0c55529d40 100644 --- a/src/BRepCheck/BRepCheck_Solid.cxx +++ b/src/BRepCheck/BRepCheck_Solid.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -50,7 +52,7 @@ class BRepCheck_HSC : public Standard_Transient { }; // Standard_EXPORT - virtual ~BRepCheck_HSC(){ + ~BRepCheck_HSC() override{ }; // Standard_EXPORT @@ -74,9 +76,9 @@ class BRepCheck_ToolSolid { public: DEFINE_STANDARD_ALLOC - BRepCheck_ToolSolid() { - myIsHole=Standard_False; - myPntTol=Precision::Confusion(); + BRepCheck_ToolSolid() : myIsHole(Standard_False), myPntTol(Precision::Confusion()) { + + myPnt.SetCoord(-1.,-1.,-1.); }; @@ -105,7 +107,7 @@ class BRepCheck_ToolSolid { // // IsOut Standard_Boolean IsOut(BRepCheck_ToolSolid& aOther) { - Standard_Boolean bFlag; + Standard_Boolean bFlag = 0; TopAbs_State aState; // BRepClass3d_SolidClassifier& aSC=myHSC->SolidClassifier(); @@ -119,7 +121,7 @@ class BRepCheck_ToolSolid { // // Init void Init() { - Standard_Real aT, aT1, aT2, aPAR_T; + Standard_Real aT = NAN, aT1 = NAN, aT2 = NAN, aPAR_T = NAN; TopExp_Explorer aExp; // // 0.myHSC @@ -197,8 +199,8 @@ void BRepCheck_Solid::Minimum() } myMin = Standard_True; // - Standard_Boolean bFound, bIsHole, bFlag; - Standard_Integer i, j, aNbVTS, aNbVTS1, iCntSh, iCntShInt; + Standard_Boolean bFound = 0, bIsHole = 0, bFlag = 0; + Standard_Integer i = 0, j = 0, aNbVTS = 0, aNbVTS1 = 0, iCntSh = 0, iCntShInt = 0; TopoDS_Solid aZ; TopoDS_Iterator aIt, aItF; TopoDS_Builder aBB; diff --git a/src/BRepCheck/BRepCheck_Wire.cxx b/src/BRepCheck/BRepCheck_Wire.cxx index 10e40a8165..deecf29889 100644 --- a/src/BRepCheck/BRepCheck_Wire.cxx +++ b/src/BRepCheck/BRepCheck_Wire.cxx @@ -64,6 +64,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(BRepCheck_Wire,BRepCheck_Result) @@ -593,8 +594,8 @@ BRepCheck_Status BRepCheck_Wire::Closed2d(const TopoDS_Face& theFace, // Check distance between 2d ends of first and last edges // Modified by Sergey KHROMOV - Mon May 13 12:42:10 2002 Begin // First check if first and last edges are infinite: - Standard_Real aF; - Standard_Real aL; + Standard_Real aF = NAN; + Standard_Real aL = NAN; Standard_Boolean isFirstInfinite = Standard_False; Standard_Boolean isLastInfinite = Standard_False; TopAbs_Orientation anOri; @@ -763,7 +764,7 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F, // find edges that make a chain on VL if !VL.IsNull // otherwise on VF. - Standard_Integer ind; + Standard_Integer ind = 0; if (!VL.IsNull()) { ind = myMapVE.FindIndex(VL); } @@ -999,8 +1000,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, } BRepCheck_ListOfStatus& aStatusList = *aHList; - Standard_Integer i,j,Nbedges; - Standard_Real first1,last1,first2,last2, tolint; + Standard_Integer i = 0,j = 0,Nbedges = 0; + Standard_Real first1 = NAN,last1 = NAN,first2 = NAN,last2 = NAN, tolint = NAN; gp_Pnt2d pfirst1,plast1,pfirst2,plast2; gp_Pnt P3d, P3d2; Handle(BRepAdaptor_Surface) HS; @@ -1089,7 +1090,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, //-- If the point of intersection is within the tolearnce of a vertex //-- this intersection is considered correct (no error) Standard_Boolean localok = Standard_False; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; TopLoc_Location L; const Handle(Geom_Curve) ConS = BRep_Tool::Curve(E1,L,f,l); if(!ConS.IsNull()) { @@ -1108,7 +1109,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, localok==Standard_False && ExplVtx.More(); ExplVtx.Next()) { gp_Pnt p3dvtt; - Standard_Real tolvtt, p3dvttDistanceP3d; + Standard_Real tolvtt = NAN, p3dvttDistanceP3d = NAN; // const TopoDS_Vertex& vtt = TopoDS::Vertex(ExplVtx.Current()); p3dvtt = BRep_Tool::Pnt(vtt); @@ -1187,8 +1188,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, Inter.Perform(C1,myDomain1,C2,tabDom[j-1],tolint,tolint); // if(Inter.IsDone()) { - Standard_Integer nbp, nbs; - Standard_Real IP_ParamOnFirst, IP_ParamOnSecond; + Standard_Integer nbp = 0, nbs = 0; + Standard_Real IP_ParamOnFirst = NAN, IP_ParamOnSecond = NAN; IntRes2d_Transition Tr1,Tr2; TopTools_ListOfShape CommonVertices; TopTools_ListIteratorOfListOfShape itl; @@ -1225,7 +1226,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, //-- If the point of intersection is within the tolerance of a vertex //-- this intersection is considered correct (no error) Standard_Boolean localok = Standard_False; - Standard_Real f1,l1, f2, l2; + Standard_Real f1 = NAN,l1 = NAN, f2 = NAN, l2 = NAN; TopLoc_Location L, L2; // const Handle(Geom_Curve) ConS = BRep_Tool::Curve(E1,L,f1,l1); @@ -1258,7 +1259,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, // Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 End itl.Initialize( CommonVertices ); for (; itl.More(); itl.Next()) { - Standard_Real p3dvttDistanceP3d, p3dvttDistanceP3d2; + Standard_Real p3dvttDistanceP3d = NAN, p3dvttDistanceP3d2 = NAN; gp_Pnt p3dvtt; // const TopoDS_Vertex& vtt = TopoDS::Vertex(itl.Value()); @@ -1286,7 +1287,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, std::cout << "\n--- BRepCheck Wire: AutoIntersection Phase1 -> Erreur \n" < + #include #include @@ -97,8 +99,8 @@ void BRepClass_FaceClassifier::Perform(const TopoDS_Face& theF, const Standard_Boolean theUseBndBox, const Standard_Real theGapCheckTol) { - Standard_Integer aNbExt, aIndice, i; - Standard_Real aU1, aU2, aV1, aV2, aMaxDist, aD; + Standard_Integer aNbExt = 0, aIndice = 0, i = 0; + Standard_Real aU1 = NAN, aU2 = NAN, aV1 = NAN, aV2 = NAN, aMaxDist = NAN, aD = NAN; gp_Pnt2d aPuv; Extrema_ExtPS aExtrema; // diff --git a/src/BRepClass/BRepClass_FaceExplorer.cxx b/src/BRepClass/BRepClass_FaceExplorer.cxx index 88ad99afb8..515259759d 100644 --- a/src/BRepClass/BRepClass_FaceExplorer.cxx +++ b/src/BRepClass/BRepClass_FaceExplorer.cxx @@ -17,6 +17,8 @@ // Modified by skv - Thu Jul 13 17:42:58 2006 OCC12627 // Total rewriting of the method Segment; add the method OtherSegment. +#include + #include #include #include @@ -143,13 +145,13 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P, Standard_Real& Par) { TopExp_Explorer anExpF(myFace, TopAbs_EDGE); - Standard_Integer i; - Standard_Real aFPar; - Standard_Real aLPar; + Standard_Integer i = 0; + Standard_Real aFPar = NAN; + Standard_Real aLPar = NAN; Handle(Geom2d_Curve) aC2d; Standard_Real aTolParConf2 = Precision::PConfusion() * Precision::PConfusion(); gp_Pnt2d aPOnC; - Standard_Real aParamIn; + Standard_Real aParamIn = NAN; for (i = 1; anExpF.More(); anExpF.Next(), i++) { if (i != myCurEdgeInd) diff --git a/src/BRepClass/BRepClass_Intersector.cxx b/src/BRepClass/BRepClass_Intersector.cxx index b0665864e1..13bfa28df0 100644 --- a/src/BRepClass/BRepClass_Intersector.cxx +++ b/src/BRepClass/BRepClass_Intersector.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -103,7 +105,7 @@ Standard_Real MaxTol2DCurEdge(const TopoDS_Vertex& theV1, const TopoDS_Face& theF, const Standard_Real theTol) { - Standard_Real aTolV3D1, aTolV3D2; + Standard_Real aTolV3D1 = NAN, aTolV3D2 = NAN; if (theV1.IsNull()) { aTolV3D1 = 0.0; @@ -120,7 +122,7 @@ Standard_Real MaxTol2DCurEdge(const TopoDS_Vertex& theV1, { aTolV3D2 = BRep_Tool::Tolerance(theV2); } - Standard_Real aTol2D, anUr, aVr; + Standard_Real aTol2D = NAN, anUr = NAN, aVr = NAN; Standard_Real aTolV3D = Max(aTolV3D1, aTolV3D2); BRepAdaptor_Surface aS(theF, Standard_False); @@ -248,8 +250,7 @@ void CheckSkip(Geom2dInt_GInter& theInter, { return; } - const TopoDS_Edge anEl = theE.NextEdge(); // the next edge - if (!(BRep_Tool::Tolerance(aVl) > theMaxTol) || theE.NextEdge().IsNull()) + if (!(BRep_Tool::Tolerance(aVl) > theMaxTol) || theE.NextEdge().IsNull()) { return; } @@ -261,8 +262,8 @@ void CheckSkip(Geom2dInt_GInter& theInter, { return; } - Standard_Real anA, aB, aC; // coefficients of the straight line - Standard_Real aX1, anY1, aX2, anY2; // coordinates of the ends of edges + Standard_Real anA = NAN, aB = NAN, aC = NAN; // coefficients of the straight line + Standard_Real aX1 = NAN, anY1 = NAN, aX2 = NAN, anY2 = NAN; // coordinates of the ends of edges gp_Pnt2d aP1, aP2; // the ends of edges theL.Coefficients(anA, aB, aC); @@ -466,7 +467,7 @@ void BRepClass_Intersector::LocalGeometry(const BRepClass_Edge& E, gp_Dir2d& Norm, Standard_Real& C) const { - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(E.Edge(), E.Face(), fpar, lpar); Geom2dLProp_CLProps2d Prop(aPCurve, U, 2, Precision::PConfusion()); @@ -501,7 +502,7 @@ void RefineTolerance(const TopoDS_Face& aF, // aTypeS=aBAS.GetType(); if (aTypeS==GeomAbs_Cylinder) { - Standard_Real aURes, aVRes, aTolX; + Standard_Real aURes = NAN, aVRes = NAN, aTolX = NAN; gp_Pnt2d aP2D; gp_Vec2d aV2D; // diff --git a/src/BRepClass3d/BRepClass3d.cxx b/src/BRepClass3d/BRepClass3d.cxx index 4385164b1e..e62e5f9139 100644 --- a/src/BRepClass3d/BRepClass3d.cxx +++ b/src/BRepClass3d/BRepClass3d.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -33,8 +35,8 @@ static //======================================================================= TopoDS_Shell BRepClass3d::OuterShell(const TopoDS_Solid& aSolid) { - Standard_Boolean bFound; - Standard_Real aTol; + Standard_Boolean bFound = 0; + Standard_Real aTol = NAN; TopoDS_Solid aSDx; TopoDS_Shell aShell, aDummy; TopoDS_Iterator aIt; @@ -98,7 +100,7 @@ TopoDS_Shell BRepClass3d::OuterShell(const TopoDS_Solid& aSolid) //======================================================================= Standard_Boolean IsInternal(const TopoDS_Shell& aSx) { - Standard_Boolean bInternal; + Standard_Boolean bInternal = 0; TopAbs_Orientation aOr; TopoDS_Iterator aIt; // diff --git a/src/BRepClass3d/BRepClass3d_BndBoxTree.cxx b/src/BRepClass3d/BRepClass3d_BndBoxTree.cxx index eb01f8f22f..3821c293b5 100644 --- a/src/BRepClass3d/BRepClass3d_BndBoxTree.cxx +++ b/src/BRepClass3d/BRepClass3d_BndBoxTree.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -37,7 +39,7 @@ Standard_Boolean BRepClass3d_BndBoxTreeSelectorPoint::Accept (const Standard_Int const TopoDS_Edge& E = TopoDS::Edge(shp); Standard_Real EdgeTSq = BRep_Tool::Tolerance(E); EdgeTSq *= EdgeTSq; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; BRepAdaptor_Curve C(E); BRep_Tool::Range(E,f,l); @@ -85,7 +87,7 @@ Standard_Boolean BRepClass3d_BndBoxTreeSelectorLine::Accept (const Standard_Inte const TopoDS_Edge& E = TopoDS::Edge(shp); Standard_Real EdgeTSq = BRep_Tool::Tolerance(E); EdgeTSq *= EdgeTSq; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; BRepAdaptor_Curve C(E); BRep_Tool::Range(E, f, l); @@ -133,7 +135,7 @@ Standard_Boolean BRepClass3d_BndBoxTreeSelectorLine::Accept (const Standard_Inte if (ExtPL.SquareDistance(1) < VertTSq) { Extrema_POnCurv PP; - Standard_Real paramL; + Standard_Real paramL = NAN; PP = ExtPL.Point(1); paramL = PP.Parameter(); VertParam VP; diff --git a/src/BRepClass3d/BRepClass3d_SClassifier.cxx b/src/BRepClass3d/BRepClass3d_SClassifier.cxx index 1cbf729b23..094d4821ad 100644 --- a/src/BRepClass3d/BRepClass3d_SClassifier.cxx +++ b/src/BRepClass3d/BRepClass3d_SClassifier.cxx @@ -16,6 +16,8 @@ // Modified by skv - Thu Sep 4 11:22:05 2003 OCC578 +#include + #include #include #include @@ -46,7 +48,7 @@ static //gets transition of line passing through/near the edge of faces , . is // a parameter on the edge where the minimum distance between and was found -static Standard_Integer GetTransi(const TopoDS_Face& f1, const TopoDS_Face& f2, const TopoDS_Edge e, +static Standard_Integer GetTransi(const TopoDS_Face& f1, const TopoDS_Face& f2, const TopoDS_Edge& e, Standard_Real param, const gp_Lin& L, IntCurveSurface_TransitionOnCurve& trans); static Standard_Boolean GetNormalOnFaceBound(const TopoDS_Edge& E, const TopoDS_Face& F, Standard_Real param, gp_Dir& OutDir); @@ -103,8 +105,8 @@ void BRepClass3d_SClassifier::PerformInfinitePoint(BRepClass3d_SolidExplorer& aS // //------------------------------------------------------------ // 1 - Standard_Boolean bFound; - Standard_Real aParam, aU = 0., aV = 0.; + Standard_Boolean bFound = 0; + Standard_Real aParam = NAN, aU = 0., aV = 0.; gp_Pnt aPoint; gp_Dir aDN; @@ -225,14 +227,14 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, myState = 0; gp_Lin L; - Standard_Real Par; + Standard_Real Par = NAN; // We compute the intersection between the line built in the Solid Explorer and the shape. //-- -------------------------------------------------------------------------------- // Calculate intersection with the face closest to the direction of bounding boxes // by priority so that to have the smallest possible parmin. // Optimization to produce as much as possible rejections with other faces. - Standard_Integer iFlag; + Standard_Integer iFlag = 0; // If found line passes through a bound of any face, it means that the line // is not found properly and it is necessary to repeat whole procedure. @@ -359,7 +361,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, // The box must be finite in order to correctly prolong the segment to its bounds. if (!aBoxF.IsVoid() && !aBoxF.IsWhole()) { - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; aBoxF.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); Standard_Real boxaddW = GetAddToParam(L, Par, aBoxF); @@ -380,7 +382,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, Extrema_ExtPS aProj(P, aBAS, Precision::PConfusion(), Precision::PConfusion()); if (aProj.IsDone() && aProj.NbExt() > 0) { - Standard_Integer i, indmin = 0; + Standard_Integer i = 0, indmin = 0; Standard_Real d = RealLast(); for (i = 1; i <= aProj.NbExt(); ++i) { @@ -395,7 +397,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, if (d <= Tol * Tol) { const Extrema_POnSurf& aPonS = aProj.Point(indmin); - Standard_Real anU, anV; + Standard_Real anU = NAN, anV = NAN; aPonS.Parameter(anU, anV); gp_Pnt2d aP2d(anU, anV); TopAbs_State aSt = Intersector3d.ClassifyUVPoint(aP2d); @@ -527,7 +529,7 @@ Standard_Real GetAddToParam(const gp_Lin& L, const Standard_Real P, const Bnd_Box& B) { - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); Standard_Real x[2] = {aXmin,aXmax}, y[2] = {aYmin,aYmax}, z[2] = {aZmin,aZmax}; Standard_Integer i = 0, j = 0, k = 0; @@ -607,7 +609,7 @@ static Standard_Boolean GetNormalOnFaceBound(const TopoDS_Edge& E, //======================================================================= static Standard_Integer GetTransi(const TopoDS_Face& f1, const TopoDS_Face& f2, - const TopoDS_Edge e, + const TopoDS_Edge& e, const Standard_Real param, const gp_Lin& L, IntCurveSurface_TransitionOnCurve& trans) diff --git a/src/BRepClass3d/BRepClass3d_SolidClassifier.cxx b/src/BRepClass3d/BRepClass3d_SolidClassifier.cxx index 9e33ed99cf..a1639b4a6b 100644 --- a/src/BRepClass3d/BRepClass3d_SolidClassifier.cxx +++ b/src/BRepClass3d/BRepClass3d_SolidClassifier.cxx @@ -116,11 +116,11 @@ BRepClass3d_SolidClassifier::BRepClass3d_SolidClassifier(const TopoDS_Shape& S) BRepClass3d_SolidClassifier::BRepClass3d_SolidClassifier(const TopoDS_Shape& S, const gp_Pnt& P, const Standard_Real Tol) -: explorer(S) { +: aSolidLoaded(Standard_True), explorer(S) { #if LBRCOMPT STAT.NbConstrShapePnt++; #endif - aSolidLoaded = Standard_True; + #if MARCHEPASSIUNESEULEFACE PerformInfinitePoint(1e-7); if(State()==TopAbs_OUT) { diff --git a/src/BRepClass3d/BRepClass3d_SolidClassifier.hxx b/src/BRepClass3d/BRepClass3d_SolidClassifier.hxx index 420c14182e..1aad9e7679 100644 --- a/src/BRepClass3d/BRepClass3d_SolidClassifier.hxx +++ b/src/BRepClass3d/BRepClass3d_SolidClassifier.hxx @@ -77,7 +77,7 @@ private: Standard_Boolean aSolidLoaded; BRepClass3d_SolidExplorer explorer; - Standard_Boolean isaholeinspace; + Standard_Boolean isaholeinspace{}; }; diff --git a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx index 43b657b336..8ceddaee85 100644 --- a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx +++ b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx @@ -49,6 +49,7 @@ #include #include +#include #include //OCC454(apo)-> //<-OCC454(apo) @@ -63,7 +64,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace gp_Pnt& APoint_, Standard_Real& param_) { - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; Standard_Boolean r = FindAPointInTheFace(_face,APoint_,u,v,param_); return r; } @@ -259,8 +260,8 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace gp_Vec& theVecD1U, gp_Vec& theVecD1V) const { - Standard_Real u,du = (U2-U1)/6.0; - Standard_Real v,dv = (V2-V1)/6.0; + Standard_Real u = NAN,du = (U2-U1)/6.0; + Standard_Real v = NAN,dv = (V2-V1)/6.0; if(du<1e-12) du=1e-12; if(dv<1e-12) dv=1e-12; Standard_Boolean IsNotUper = !surf->IsUPeriodic(), IsNotVper = !surf->IsVPeriodic(); @@ -450,8 +451,8 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P, gp_Vec aVecD1U, aVecD1V; Standard_Real maxscal=0; Standard_Boolean ptfound=Standard_False; - Standard_Real Par; - Standard_Real _u,_v; + Standard_Real Par = NAN; + Standard_Real _u = NAN,_v = NAN; Standard_Integer IndexPoint=0; Standard_Integer NbPointsOK=0; Standard_Integer NbFacesInSolid=0; @@ -492,7 +493,7 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P, } } surf->Initialize(face, aRestr); - Standard_Real U1,V1,U2,V2; + Standard_Real U1 = NAN,V1 = NAN,U2 = NAN,V2 = NAN; U1 = surf->FirstUParameter(); V1 = surf->FirstVParameter(); U2 = surf->LastUParameter(); @@ -519,8 +520,8 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P, Extrema_ExtPS Ext(P, GA, TolU, TolV); // if (Ext.IsDone() && Ext.NbExt() > 0) { - Standard_Integer i, iNear, iEnd; - Standard_Real aUx, aVx, Dist2, Dist2Min; + Standard_Integer i = 0, iNear = 0, iEnd = 0; + Standard_Real aUx = NAN, aVx = NAN, Dist2 = NAN, Dist2Min = NAN; Extrema_POnSurf aPx; // iNear = 1; @@ -546,8 +547,8 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P, } else { BRepClass_FaceClassifier classifier2d; - Standard_Real aU; - Standard_Real aV; + Standard_Real aU = NAN; + Standard_Real aV = NAN; (Ext.Point(iNear)).Parameter(aU, aV); @@ -708,7 +709,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace Face.Orientation(TopAbs_FORWARD); Handle(BRepAdaptor_Surface) surf = new BRepAdaptor_Surface(); surf->Initialize(Face); - Standard_Real U1,V1,U2,V2;//,u,v; + Standard_Real U1 = NAN,V1 = NAN,U2 = NAN,V2 = NAN;//,u,v; U1 = surf->FirstUParameter(); V1 = surf->FirstVParameter(); U2 = surf->LastUParameter(); @@ -740,7 +741,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace (const TopoDS_Face& _face, gp_Pnt& APoint_) -{ Standard_Real u,v; +{ Standard_Real u = NAN,v = NAN; Standard_Boolean r = FindAPointInTheFace(_face,APoint_,u,v); return r; } @@ -887,7 +888,7 @@ void BRepClass3d_SolidExplorer::InitShape(const TopoDS_Shape& S) // Fill mapEV with vertices and edges from shape NCollection_UBTreeFiller aTreeFiller (myTree); // - Standard_Integer i, aNbEV = myMapEV.Extent(); + Standard_Integer i = 0, aNbEV = myMapEV.Extent(); for (i = 1; i <= aNbEV; ++i) { const TopoDS_Shape& aS = myMapEV(i); // @@ -1023,7 +1024,7 @@ Standard_Integer BRepClass3d_SolidExplorer::Segment(const gp_Pnt& P, gp_Lin& L, Standard_Real& Par) { - Standard_Integer bRetFlag; + Standard_Integer bRetFlag = 0; myFirstFace = 0; bRetFlag=OtherSegment(P,L,Par); return bRetFlag; diff --git a/src/BRepClass3d/BRepClass3d_SolidExplorer.hxx b/src/BRepClass3d/BRepClass3d_SolidExplorer.hxx index 8daba7883e..8e9a16efd8 100644 --- a/src/BRepClass3d/BRepClass3d_SolidExplorer.hxx +++ b/src/BRepClass3d/BRepClass3d_SolidExplorer.hxx @@ -157,9 +157,9 @@ private: Bnd_Box myBox; TopoDS_Shape myShape; - Standard_Boolean myReject; - Standard_Integer myFirstFace; - Standard_Real myParamOnEdge; + Standard_Boolean myReject{}; + Standard_Integer myFirstFace{}; + Standard_Real myParamOnEdge{}; TopExp_Explorer myShellExplorer; TopExp_Explorer myFaceExplorer; BRepClass3d_MapOfInter myMapOfInter; diff --git a/src/BRepExtrema/BRepExtrema_DistShapeShape.cxx b/src/BRepExtrema/BRepExtrema_DistShapeShape.cxx index fdf1594598..79e9b4dad0 100644 --- a/src/BRepExtrema/BRepExtrema_DistShapeShape.cxx +++ b/src/BRepExtrema/BRepExtrema_DistShapeShape.cxx @@ -16,6 +16,8 @@ // Modified: Mps(10-04-97) portage WNT +#include + #include #include @@ -65,8 +67,8 @@ namespace } } - inline Standard_Real DistanceInitiale(const TopoDS_Vertex V1, - const TopoDS_Vertex V2) + inline Standard_Real DistanceInitiale(const TopoDS_Vertex& V1, + const TopoDS_Vertex& V2) { return (BRep_Tool::Pnt(V1).Distance(BRep_Tool::Pnt(V2))); } @@ -1117,8 +1119,8 @@ void BRepExtrema_DistShapeShape::ParOnFaceS2(const Standard_Integer N, Standard void BRepExtrema_DistShapeShape::Dump(Standard_OStream& o) const { - Standard_Integer i; - Standard_Real r1,r2; + Standard_Integer i = 0; + Standard_Real r1 = NAN,r2 = NAN; o<< "the distance value is : " << Value()< + #include #include @@ -104,7 +106,7 @@ static void TRIM_INFINIT_EDGE(const TopoDS_Edge& S1, const TopoDS_Edge& S2, Topo return; aResEdge = S2; - Standard_Real aFirst1, aLast1, aFirst2, aLast2; + Standard_Real aFirst1 = NAN, aLast1 = NAN, aFirst2 = NAN, aLast2 = NAN; Handle(Geom_Curve) pCurv1 = BRep_Tool::Curve(S1, aFirst1, aLast1); Handle(Geom_Curve) pCurv2 = BRep_Tool::Curve(S2, aFirst2, aLast2); @@ -115,7 +117,7 @@ static void TRIM_INFINIT_EDGE(const TopoDS_Edge& S1, const TopoDS_Edge& S2, Topo return; Standard_Real Umin = 0., Umax = 0.; - Standard_Boolean bUmin, bUmax; + Standard_Boolean bUmin = 0, bUmax = 0; bUmin = bUmax = Standard_False; Handle(Geom_Curve) pCurv; @@ -156,7 +158,7 @@ static void TRIM_INFINIT_EDGE(const TopoDS_Edge& S1, const TopoDS_Edge& S2, Topo BRepBndLib::Add(S2, aEdgeBox); if (bIsTrim2) BRepBndLib::Add(S1, aEdgeBox); - Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + Standard_Real Xmin = NAN, Ymin = NAN, Zmin = NAN, Xmax = NAN, Ymax = NAN, Zmax = NAN; aEdgeBox.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); const gp_Pnt aPnt0(Xmin, Ymin, Zmin); @@ -252,9 +254,9 @@ static void TRIM_INFINIT_FACE(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const Standard_Boolean bRestrict = BRep_Tool::NaturalRestriction(aF); - Standard_Real U1, V1, U2, V2; + Standard_Real U1 = NAN, V1 = NAN, U2 = NAN, V2 = NAN; Standard_Real Umin = RealLast(), Umax = RealFirst(), Vmin = RealLast(), Vmax = RealFirst(); - Standard_Boolean bUmin, bUmax, bVmin, bVmax; + Standard_Boolean bUmin = 0, bUmax = 0, bVmin = 0, bVmax = 0; bUmin = bUmax = bVmin = bVmax = Standard_False; Standard_Boolean bIsTrim = Standard_False; @@ -311,7 +313,7 @@ static void TRIM_INFINIT_FACE(const TopoDS_Shape& S1, const TopoDS_Shape& S2, if (aEdgeBox.IsWhole()) return; - Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + Standard_Real Xmin = NAN, Ymin = NAN, Zmin = NAN, Xmax = NAN, Ymax = NAN, Zmax = NAN; aEdgeBox.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); const gp_Pnt aPnt0(Xmin, Ymin, Zmin); @@ -400,7 +402,7 @@ static void PERFORM_C0(const TopoDS_Edge& S1, const TopoDS_Edge& S2, if (BRep_Tool::Degenerated(S1) || BRep_Tool::Degenerated(S2)) return; - Standard_Integer iE; + Standard_Integer iE = 0; for (iE = 0; iE < 2; iE++) { TopoDS_Edge E, Eother; @@ -415,10 +417,10 @@ static void PERFORM_C0(const TopoDS_Edge& S1, const TopoDS_Edge& S2, Eother = S1; } - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom_Curve) pCurv = BRep_Tool::Curve(E, aFirst, aLast); - Standard_Real aFOther, aLOther; + Standard_Real aFOther = NAN, aLOther = NAN; Handle(Geom_Curve) pCurvOther = BRep_Tool::Curve(Eother, aFOther, aLOther); if (pCurv->Continuity() == GeomAbs_C0) @@ -436,11 +438,11 @@ static void PERFORM_C0(const TopoDS_Edge& S1, const TopoDS_Edge& S2, TColStd_Array1OfReal arrInterOther(1, 1 + nbIntervalsOther); aAdaptorCurveOther.Intervals(arrInterOther, GeomAbs_C1); - Standard_Real Udeb, Ufin; + Standard_Real Udeb = NAN, Ufin = NAN; BRep_Tool::Range(Eother, Udeb, Ufin); gp_Pnt P1, Pt; - Standard_Integer i, ii; + Standard_Integer i = 0, ii = 0; BRepClass_FaceClassifier classifier; for (i = 1; i <= arrInter.Length(); i++) { @@ -612,7 +614,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Shape& theS1, const TopoDS_Sha { TopoDS_Face aF2 = TopoDS::Face (theS2); TopoDS_Face aTrimFace; - Standard_Boolean bIsInfinit; + Standard_Boolean bIsInfinit = 0; TRIM_INFINIT_FACE (aE1, aF2, aTrimFace, bIsInfinit); if (bIsInfinit) aF2 = aTrimFace; @@ -639,7 +641,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Shape& theS1, const TopoDS_Sha { TopoDS_Edge aE2 = TopoDS::Edge (theS2); TopoDS_Face aTrimFace; - Standard_Boolean bIsInfinit; + Standard_Boolean bIsInfinit = 0; TRIM_INFINIT_FACE (aF1, aE2, aTrimFace, bIsInfinit); if (bIsInfinit) aF1 = aTrimFace; @@ -704,7 +706,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Vertex& theS1, if (NbExtrema > 0) { // Search minimum distance Dstmin - Standard_Integer i; + Standard_Integer i = 0; Standard_Real Dstmin = Ext.SquareDistance(1); for (i = 2; i <= NbExtrema; i++) { @@ -758,7 +760,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Vertex& theS1, if (NbExtrema > 0) { // Search minimum distance Dstmin - Standard_Integer i; + Standard_Integer i = 0; Standard_Real Dstmin = Ext.SquareDistance(1); for (i = 2; i <= NbExtrema; i++) { @@ -769,7 +771,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Vertex& theS1, Dstmin = sqrt(Dstmin); if ((Dstmin < myDstRef - myEps) || (fabs(Dstmin - myDstRef) < myEps)) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; gp_Pnt Pt, P1 = BRep_Tool::Pnt(theS1); BRepClass_FaceClassifier classifier; const Standard_Real tol = BRep_Tool::Tolerance(theS2); @@ -821,7 +823,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, if (NbExtrema > 0) { // Search minimum distance Dstmin - Standard_Integer i; + Standard_Integer i = 0; Standard_Real Dstmin = Ext.SquareDistance(1); for (i = 2; i <= NbExtrema; i++) { @@ -910,7 +912,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac if (NbExtrema > 0) { // Search minimum distance Dstmin - Standard_Integer i; + Standard_Integer i = 0; Standard_Real Dstmin = Ext.SquareDistance(1); for (i = 2; i <= NbExtrema; i++) { @@ -921,7 +923,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac Dstmin = sqrt(Dstmin); if ((Dstmin < myDstRef - myEps) || (fabs(Dstmin - myDstRef) < myEps)) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; const Standard_Real tol = BRep_Tool::Tolerance(theS2); gp_Pnt Pt1, Pt2; @@ -959,7 +961,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac } } - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom_Curve) pCurv = BRep_Tool::Curve(theS1, aFirst, aLast); if (pCurv->Continuity() == GeomAbs_C0) { @@ -973,10 +975,10 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac aAdaptorCurve.Intervals(arrInter, GeomAbs_C1); gp_Pnt Pt; - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; const Standard_Real tol = BRep_Tool::Tolerance(theS2); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= arrInter.Length(); i++) { const Standard_Real aParameter = arrInter(i); @@ -988,7 +990,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac if (NbExtremaPF > 0) { // Search minimum distance Dstmin - Standard_Integer ii; + Standard_Integer ii = 0; Standard_Real Dstmin = ExtPF.SquareDistance(1); for (ii = 2; ii <= NbExtremaPF; ii++) { @@ -1051,7 +1053,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Face& theS1, if (NbExtrema > 0) { // Search minimum distance Dstmin - Standard_Integer i; + Standard_Integer i = 0; Standard_Real Dstmin = Ext.SquareDistance(1); for (i = 2; i <= NbExtrema; i++) { @@ -1067,7 +1069,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Face& theS1, gp_Pnt Pt1, Pt2; gp_Pnt2d PUV; - Standard_Real U1, V1, U2, V2; + Standard_Real U1 = NAN, V1 = NAN, U2 = NAN, V2 = NAN; BRepClass_FaceClassifier classifier; for (i = 1; i <= NbExtrema; i++) diff --git a/src/BRepExtrema/BRepExtrema_ExtCC.cxx b/src/BRepExtrema/BRepExtrema_ExtCC.cxx index d4c24eb0e8..03d4a89b52 100644 --- a/src/BRepExtrema/BRepExtrema_ExtCC.cxx +++ b/src/BRepExtrema/BRepExtrema_ExtCC.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -41,7 +43,7 @@ void BRepExtrema_ExtCC::Initialize(const TopoDS_Edge& E2) { if (!BRep_Tool::IsGeometric(E2)) return; // protect against non-geometric type (e.g. polygon) - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; BRepAdaptor_Curve Curv(E2); myHC = new BRepAdaptor_Curve(Curv); Standard_Real Tol = Min(BRep_Tool::Tolerance(E2), Precision::Confusion()); @@ -60,7 +62,7 @@ void BRepExtrema_ExtCC::Perform(const TopoDS_Edge& E1) { if (!BRep_Tool::IsGeometric(E1)) return; // protect against non-geometric type (e.g. polygon) - Standard_Real U1, U2; + Standard_Real U1 = NAN, U2 = NAN; BRepAdaptor_Curve Curv(E1); Handle(BRepAdaptor_Curve) HC = new BRepAdaptor_Curve(Curv); Standard_Real Tol = Min(BRep_Tool::Tolerance(E1), Precision::Confusion()); diff --git a/src/BRepExtrema/BRepExtrema_ExtCF.cxx b/src/BRepExtrema/BRepExtrema_ExtCF.cxx index 44e2c2fa3e..1006529c06 100644 --- a/src/BRepExtrema/BRepExtrema_ExtCF.cxx +++ b/src/BRepExtrema/BRepExtrema_ExtCF.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -47,7 +49,7 @@ void BRepExtrema_ExtCF::Initialize(const TopoDS_Edge& E, const TopoDS_Face& F) return; // protect against non-geometric type (e.g. triangulation) BRepAdaptor_Curve aC(E); myHS = new BRepAdaptor_Surface(Surf); - Standard_Real aTolC, aTolS; + Standard_Real aTolC = NAN, aTolS = NAN; // aTolS = Min(BRep_Tool::Tolerance(F), Precision::Confusion()); aTolS = Min(Surf.UResolution(aTolS), Surf.VResolution(aTolS)); @@ -57,7 +59,7 @@ void BRepExtrema_ExtCF::Initialize(const TopoDS_Edge& E, const TopoDS_Face& F) aTolC = aC.Resolution(aTolC); aTolC = Max(aTolC, Precision::PConfusion()); // - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; BRepTools::UVBounds(F, U1, U2, V1, V2); myExtCS.Initialize (*myHS, U1, U2, V1, V2, aTolC, aTolS); } @@ -76,7 +78,7 @@ void BRepExtrema_ExtCF::Perform(const TopoDS_Edge& E, const TopoDS_Face& F2) if (myHS.IsNull()) return; // protect against non-geometric type (e.g. triangulation) - Standard_Real U1, U2; + Standard_Real U1 = NAN, U2 = NAN; BRep_Tool::Range(E, U1, U2); BRepAdaptor_Curve Curv(E); diff --git a/src/BRepExtrema/BRepExtrema_ExtFF.cxx b/src/BRepExtrema/BRepExtrema_ExtFF.cxx index 377e3e1e72..3087b98bb6 100644 --- a/src/BRepExtrema/BRepExtrema_ExtFF.cxx +++ b/src/BRepExtrema/BRepExtrema_ExtFF.cxx @@ -17,6 +17,8 @@ // modified by mps (juillet 96 ): on utilise BRepAdaptor a la place de // GeomAdaptor dans Initialize et Perform. +#include + #include #include @@ -52,7 +54,7 @@ void BRepExtrema_ExtFF::Initialize(const TopoDS_Face& F2) Standard_Real Tol = Min(BRep_Tool::Tolerance(F2), Precision::Confusion()); Tol = Min(Surf.UResolution(Tol), Surf.VResolution(Tol)); Tol = Max(Tol, Precision::PConfusion()); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; BRepTools::UVBounds(F2, U1, U2, V1, V2); myExtSS.Initialize (*myHS, U1, U2, V1, V2, Tol); } @@ -76,7 +78,7 @@ void BRepExtrema_ExtFF::Perform(const TopoDS_Face& F1, const TopoDS_Face& F2) Standard_Real Tol1 = Min(BRep_Tool::Tolerance(F1), Precision::Confusion()); Tol1 = Min(Surf1.UResolution(Tol1), Surf1.VResolution(Tol1)); Tol1 = Max(Tol1, Precision::PConfusion()); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; BRepTools::UVBounds(F1, U1, U2, V1, V2); myExtSS.Perform (*HS1, U1, U2, V1, V2, Tol1); @@ -92,7 +94,7 @@ void BRepExtrema_ExtFF::Perform(const TopoDS_Face& F1, const TopoDS_Face& F2) const Standard_Real Tol2 = BRep_Tool::Tolerance(F2); Extrema_POnSurf P1, P2; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= myExtSS.NbExt(); i++) { myExtSS.Points(i, P1, P2); diff --git a/src/BRepExtrema/BRepExtrema_ExtPC.cxx b/src/BRepExtrema/BRepExtrema_ExtPC.cxx index 23b6fb62d7..27f2fdb933 100644 --- a/src/BRepExtrema/BRepExtrema_ExtPC.cxx +++ b/src/BRepExtrema/BRepExtrema_ExtPC.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -40,7 +42,7 @@ void BRepExtrema_ExtPC::Initialize(const TopoDS_Edge& E) { if (!BRep_Tool::IsGeometric(E)) return; // protect against non-geometric type (e.g. polygon) - Standard_Real U1, U2; + Standard_Real U1 = NAN, U2 = NAN; myHC = new BRepAdaptor_Curve(E); Standard_Real Tol = Min(BRep_Tool::Tolerance(E), Precision::Confusion()); Tol = Max(myHC->Resolution(Tol), Precision::PConfusion()); diff --git a/src/BRepExtrema/BRepExtrema_ExtPF.cxx b/src/BRepExtrema/BRepExtrema_ExtPF.cxx index 41493900b9..8811128b13 100644 --- a/src/BRepExtrema/BRepExtrema_ExtPF.cxx +++ b/src/BRepExtrema/BRepExtrema_ExtPF.cxx @@ -17,6 +17,8 @@ // modified by MPS (june 96) : on utilise BRepClass_FaceClassifier seulement // si IsDone de Extrema est vrai +#include + #include #include @@ -54,10 +56,10 @@ void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace, return; // protect against non-geometric type (e.g. triangulation) Standard_Real Tol = Min(BRep_Tool::Tolerance(TheFace), Precision::Confusion()); - Standard_Real aTolU, aTolV; + Standard_Real aTolU = NAN, aTolV = NAN; aTolU = Max(mySurf.UResolution(Tol), Precision::PConfusion()); aTolV = Max(mySurf.VResolution(Tol), Precision::PConfusion()); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; BRepTools::UVBounds(TheFace, U1, U2, V1, V2); myExtPS.SetFlag(TheFlag); myExtPS.SetAlgo(TheAlgo); @@ -84,7 +86,7 @@ void BRepExtrema_ExtPF::Perform(const TopoDS_Vertex& TheVertex, const TopoDS_Fac if (myExtPS.IsDone()) { BRepClass_FaceClassifier classifier; - Standard_Real U1, U2; + Standard_Real U1 = NAN, U2 = NAN; const Standard_Real Tol = BRep_Tool::Tolerance(TheFace); for (Standard_Integer i = 1; i <= myExtPS.NbExt(); i++) { diff --git a/src/BRepExtrema/BRepExtrema_OverlapTool.cxx b/src/BRepExtrema/BRepExtrema_OverlapTool.cxx index 8dd8252c2f..2e9044afac 100644 --- a/src/BRepExtrema/BRepExtrema_OverlapTool.cxx +++ b/src/BRepExtrema/BRepExtrema_OverlapTool.cxx @@ -23,9 +23,9 @@ //======================================================================= BRepExtrema_OverlapTool::BRepExtrema_OverlapTool() : myFilter (NULL), - myTolerance (0.0) + myIsDone(Standard_False), myTolerance (0.0) { - myIsDone = Standard_False; + } //======================================================================= @@ -77,7 +77,7 @@ namespace BVH_Vec3d EdgeNormals[3]; //! Is prism initialized? - Standard_Boolean IsInited; + Standard_Boolean IsInited{}; public: @@ -348,8 +348,8 @@ namespace } else // triangles are co-planar { - Standard_Integer anX; - Standard_Integer anY; + Standard_Integer anX = 0; + Standard_Integer anY = 0; if (fabs (aTrng1Normal[0]) > fabs (aTrng1Normal[1])) { diff --git a/src/BRepExtrema/BRepExtrema_OverlapTool.hxx b/src/BRepExtrema/BRepExtrema_OverlapTool.hxx index d2cf6f55c2..db92fbdf82 100644 --- a/src/BRepExtrema/BRepExtrema_OverlapTool.hxx +++ b/src/BRepExtrema/BRepExtrema_OverlapTool.hxx @@ -126,7 +126,7 @@ private: #endif //! Is overlap test test completed? - Standard_Boolean myIsDone; + Standard_Boolean myIsDone{}; Standard_Real myTolerance; }; diff --git a/src/BRepExtrema/BRepExtrema_Poly.cxx b/src/BRepExtrema/BRepExtrema_Poly.cxx index 63a5072902..684c9bca8d 100644 --- a/src/BRepExtrema/BRepExtrema_Poly.cxx +++ b/src/BRepExtrema/BRepExtrema_Poly.cxx @@ -62,7 +62,7 @@ Standard_Boolean BRepExtrema_Poly::Distance (const TopoDS_Shape& S1, const TopoD } if (nbn2 == 0) return Standard_False; - Standard_Integer i,n; + Standard_Integer i = 0,n = 0; TColgp_Array1OfPnt TP1(1,nbn1); nbn1 = 0; @@ -106,7 +106,7 @@ Standard_Boolean BRepExtrema_Poly::Distance (const TopoDS_Shape& S1, const TopoD } } - Standard_Integer i1,i2; + Standard_Integer i1 = 0,i2 = 0; for (i1 = 1; i1 <= nbn1; i1++) { const gp_Pnt& PP1 = TP1(i1); diff --git a/src/BRepExtrema/BRepExtrema_ProximityDistTool.cxx b/src/BRepExtrema/BRepExtrema_ProximityDistTool.cxx index 5607617f18..6ccd66b980 100644 --- a/src/BRepExtrema/BRepExtrema_ProximityDistTool.cxx +++ b/src/BRepExtrema/BRepExtrema_ProximityDistTool.cxx @@ -280,7 +280,7 @@ Standard_Boolean BRepExtrema_ProximityDistTool::IsNodeOnBorder (const Standard_I { Poly_Connect aPolyConnect (theTr); - Standard_Integer aContTrg; //index of triangle containing exploring node + Standard_Integer aContTrg = 0; //index of triangle containing exploring node for (aPolyConnect.Initialize (theNodeIdx); aPolyConnect.More(); aPolyConnect.Next()) { aContTrg = aPolyConnect.Value(); diff --git a/src/BRepExtrema/BRepExtrema_ProximityDistTool.hxx b/src/BRepExtrema/BRepExtrema_ProximityDistTool.hxx index da6d5de076..c0fbac62fa 100644 --- a/src/BRepExtrema/BRepExtrema_ProximityDistTool.hxx +++ b/src/BRepExtrema/BRepExtrema_ProximityDistTool.hxx @@ -209,7 +209,7 @@ private: Standard_Integer myNbSamples1; //!< Number of samples points on the first shape //! Is vertex corresponding to proximity point of 1st shape from additional set - Standard_Integer myIsProxVtx1FromAddSet; + Standard_Integer myIsProxVtx1FromAddSet{}; BVH_Array3d myAddVertices1; //!< Additional vertices on the 1st shape NCollection_Vector myAddStatus1; //!< Status of additional vertices on the 1st shape diff --git a/src/BRepExtrema/BRepExtrema_ProximityValueTool.cxx b/src/BRepExtrema/BRepExtrema_ProximityValueTool.cxx index 66a2bd1d4f..01c9487097 100644 --- a/src/BRepExtrema/BRepExtrema_ProximityValueTool.cxx +++ b/src/BRepExtrema/BRepExtrema_ProximityValueTool.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -351,9 +353,9 @@ static void getNodesOfTrg (const Standard_Integer theTriIdx, const Handle (Poly_Triangulation)& theTr, gp_Pnt (&theTrg)[3]) { - Standard_Integer aVtxIdx1; - Standard_Integer aVtxIdx2; - Standard_Integer aVtxIdx3; + Standard_Integer aVtxIdx1 = 0; + Standard_Integer aVtxIdx2 = 0; + Standard_Integer aVtxIdx3 = 0; theTr->Triangle (theTriIdx).Get (aVtxIdx1, aVtxIdx2, aVtxIdx3); @@ -575,7 +577,7 @@ NCollection_CellFilter_Action BRepExtrema_VertexInspector::Inspect (const Standa myIsNeedAdd = Standard_True; const gp_XYZ& aPnt = myPoints.Value (theTarget - 1); - Standard_Real aDx, aDy, aDz; + Standard_Real aDx = NAN, aDy = NAN, aDz = NAN; aDx = myCurrent.X() - aPnt.X(); aDy = myCurrent.Y() - aPnt.Y(); aDz = myCurrent.Z() - aPnt.Z(); diff --git a/src/BRepExtrema/BRepExtrema_ProximityValueTool.hxx b/src/BRepExtrema/BRepExtrema_ProximityValueTool.hxx index ca65c28104..706d9fff87 100644 --- a/src/BRepExtrema/BRepExtrema_ProximityValueTool.hxx +++ b/src/BRepExtrema/BRepExtrema_ProximityValueTool.hxx @@ -207,17 +207,17 @@ private: NCollection_Vector myAddStatus1; //!< Status of additional vertices on the 1st shape. NCollection_Vector myAddStatus2; //!< Status of additional vertices on the 2nd shape. - Standard_Boolean myIsInitS1; //!< Is the 1st shape initialized? - Standard_Boolean myIsInitS2; //!< Is the 2nd shape initialized? + Standard_Boolean myIsInitS1{}; //!< Is the 1st shape initialized? + Standard_Boolean myIsInitS2{}; //!< Is the 2nd shape initialized? Standard_Boolean myIsRefinementRequired1; //!< Flag about the need to refine the 1st shape. Standard_Boolean myIsRefinementRequired2; //!< Flag about the need to refine the 2nd shape. - Standard_Integer myNbNodes1; //!< Number of nodes in triangulation of the 1st shape. - Standard_Integer myNbNodes2; //!< Number of nodes in triangulation of the 2nd shape. + Standard_Integer myNbNodes1{}; //!< Number of nodes in triangulation of the 1st shape. + Standard_Integer myNbNodes2{}; //!< Number of nodes in triangulation of the 2nd shape. - Standard_Real myStep1; //!< Step for getting vertices on the 1st shape. - Standard_Real myStep2; //!< Step for getting vertices on the 2nd shape. + Standard_Real myStep1{}; //!< Step for getting vertices on the 1st shape. + Standard_Real myStep2{}; //!< Step for getting vertices on the 2nd shape. BRepExtrema_CellFilter myCells; BRepExtrema_VertexInspector myInspector; diff --git a/src/BRepExtrema/BRepExtrema_SelfIntersection.cxx b/src/BRepExtrema/BRepExtrema_SelfIntersection.cxx index 1f99c205e6..a124fe28a0 100644 --- a/src/BRepExtrema/BRepExtrema_SelfIntersection.cxx +++ b/src/BRepExtrema/BRepExtrema_SelfIntersection.cxx @@ -23,9 +23,9 @@ //purpose : //======================================================================= BRepExtrema_SelfIntersection::BRepExtrema_SelfIntersection (const Standard_Real theTolerance) -: myTolerance (theTolerance) +: myTolerance (theTolerance), myIsInit(Standard_False) { - myIsInit = Standard_False; + } //======================================================================= @@ -148,8 +148,8 @@ BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::isRegularS BVH_Vec3d aCrossLine = BVH_Vec3d::Cross (aTrng0Normal, aTrng1Normal); - Standard_Integer anX; - Standard_Integer anY; + Standard_Integer anX = 0; + Standard_Integer anY = 0; if (aCrossLine.SquareModulus() < Precision::SquareConfusion()) // coplanar case { @@ -223,8 +223,8 @@ BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::isRegularS return BRepExtrema_ElementFilter::NoCheck; } - Standard_Integer anX; - Standard_Integer anY; + Standard_Integer anX = 0; + Standard_Integer anY = 0; getProjectionAxes (aTrng0Normal, anX, anY); diff --git a/src/BRepExtrema/BRepExtrema_SelfIntersection.hxx b/src/BRepExtrema/BRepExtrema_SelfIntersection.hxx index efb1b39fd0..a338151fe3 100644 --- a/src/BRepExtrema/BRepExtrema_SelfIntersection.hxx +++ b/src/BRepExtrema/BRepExtrema_SelfIntersection.hxx @@ -120,7 +120,7 @@ private: Standard_Real myTolerance; //! Is the input shape inited? - Standard_Boolean myIsInit; + Standard_Boolean myIsInit{}; //! List of triangulated faces of the shape. BRepExtrema_ShapeList myFaceList; diff --git a/src/BRepExtrema/BRepExtrema_ShapeProximity.hxx b/src/BRepExtrema/BRepExtrema_ShapeProximity.hxx index 63f56a941f..dc738112a4 100644 --- a/src/BRepExtrema/BRepExtrema_ShapeProximity.hxx +++ b/src/BRepExtrema/BRepExtrema_ShapeProximity.hxx @@ -171,9 +171,9 @@ private: Standard_Real myTolerance; //! Is the 1st shape initialized? - Standard_Boolean myIsInitS1; + Standard_Boolean myIsInitS1{}; //! Is the 2nd shape initialized? - Standard_Boolean myIsInitS2; + Standard_Boolean myIsInitS2{}; //! List of subshapes of the 1st shape. BRepExtrema_ShapeList myShapeList1; diff --git a/src/BRepExtrema/BRepExtrema_TriangleSet.cxx b/src/BRepExtrema/BRepExtrema_TriangleSet.cxx index e1f843d809..e40d3a47a5 100644 --- a/src/BRepExtrema/BRepExtrema_TriangleSet.cxx +++ b/src/BRepExtrema/BRepExtrema_TriangleSet.cxx @@ -273,9 +273,9 @@ Standard_Boolean BRepExtrema_TriangleSet::initFace (const TopoDS_Face& theFace, for (Standard_Integer aTriIdx = 1; aTriIdx <= aTriangulation->NbTriangles(); ++aTriIdx) { - Standard_Integer aVertex1; - Standard_Integer aVertex2; - Standard_Integer aVertex3; + Standard_Integer aVertex1 = 0; + Standard_Integer aVertex2 = 0; + Standard_Integer aVertex3 = 0; aTriangulation->Triangle (aTriIdx).Get (aVertex1, aVertex2, diff --git a/src/BRepGProp/BRepGProp.cxx b/src/BRepGProp/BRepGProp.cxx index 43c9d08129..4ce90c8045 100644 --- a/src/BRepGProp/BRepGProp.cxx +++ b/src/BRepGProp/BRepGProp.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -33,7 +35,7 @@ static Standard_Integer AffichEps = 0; #endif static gp_Pnt roughBaryCenter(const TopoDS_Shape& S){ - Standard_Integer i; TopExp_Explorer ex; + Standard_Integer i = 0; TopExp_Explorer ex; gp_XYZ xyz(0,0,0); for (ex.Init(S,TopAbs_VERTEX), i = 0; ex.More(); ex.Next(), i++) xyz += BRep_Tool::Pnt(TopoDS::Vertex(ex.Current())).XYZ(); @@ -113,11 +115,11 @@ void BRepGProp::LinearProperties(const TopoDS_Shape& S, GProp_GProps& SProps, c static Standard_Real surfaceProperties(const TopoDS_Shape& S, GProp_GProps& Props, const Standard_Real Eps, const Standard_Boolean SkipShared, const Standard_Boolean UseTriangulation) { - Standard_Integer i; + Standard_Integer i = 0; #ifdef OCCT_DEBUG Standard_Integer iErrorMax = 0; #endif - Standard_Real ErrorMax = 0.0, Error; + Standard_Real ErrorMax = 0.0, Error = NAN; TopExp_Explorer ex; gp_Pnt P(roughBaryCenter(S)); BRepGProp_Sinert G; G.SetLocation(P); @@ -216,7 +218,7 @@ Standard_Real BRepGProp::SurfaceProperties(const TopoDS_Shape& S, GProp_GProps& static Standard_Real volumeProperties(const TopoDS_Shape& S, GProp_GProps& Props, const Standard_Real Eps, const Standard_Boolean SkipShared, const Standard_Boolean UseTriangulation) { - Standard_Integer i; + Standard_Integer i = 0; #ifdef OCCT_DEBUG Standard_Integer iErrorMax = 0; #endif @@ -337,7 +339,7 @@ Standard_Real BRepGProp::VolumeProperties(const TopoDS_Shape& S, GProp_GProps& P // find the origin gp_Pnt P(0,0,0); P.Transform(S.Location()); Props = GProp_GProps(P); - Standard_Integer i; + Standard_Integer i = 0; #ifdef OCCT_DEBUG Standard_Integer iErrorMax = 0; #endif @@ -393,7 +395,7 @@ static Standard_Real volumePropertiesGK(const TopoDS_Shape &theShape, BRepGProp_VinertGK aVProps; BRepGProp_Face aPropFace(IsUseSpan); BRepGProp_Domain aPropDomain; - Standard_Real aLocalError; + Standard_Real aLocalError = NAN; Standard_Real anError = 0.; TopTools_MapOfShape aFwdFMap; TopTools_MapOfShape aRvsFMap; @@ -495,7 +497,7 @@ Standard_Real BRepGProp::VolumePropertiesGK(const TopoDS_Shape &S, // Compute the properties for each closed shell. Standard_Real aTol = Eps; - Standard_Real aLocalError; + Standard_Real aLocalError = NAN; TopTools_ListIteratorOfListOfShape anIter(aClosedShells); for (; anIter.More(); anIter.Next()) { @@ -540,7 +542,7 @@ static Standard_Real volumePropertiesGK(const TopoDS_Shape &theShape, BRepGProp_VinertGK aVProps; BRepGProp_Face aPropFace(IsUseSpan); BRepGProp_Domain aPropDomain; - Standard_Real aLocalError; + Standard_Real aLocalError = NAN; Standard_Real anError = 0.; TopTools_MapOfShape aFwdFMap; TopTools_MapOfShape aRvsFMap; @@ -643,7 +645,7 @@ Standard_Real BRepGProp::VolumePropertiesGK(const TopoDS_Shape &S, // Compute the properties for each closed shell. Standard_Real aTol = Eps; - Standard_Real aLocalError; + Standard_Real aLocalError = NAN; TopTools_ListIteratorOfListOfShape anIter(aClosedShells); for (; anIter.More(); anIter.Next()) { diff --git a/src/BRepGProp/BRepGProp_Cinert.cxx b/src/BRepGProp/BRepGProp_Cinert.cxx index c9b349e293..8500e4d0b2 100644 --- a/src/BRepGProp/BRepGProp_Cinert.cxx +++ b/src/BRepGProp/BRepGProp_Cinert.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -30,7 +32,7 @@ void BRepGProp_Cinert::SetLocation(const gp_Pnt& CLocation) void BRepGProp_Cinert::Perform (const BRepAdaptor_Curve& C) { - Standard_Real Ix, Iy, Iz, Ixx, Iyy, Izz, Ixy, Ixz, Iyz; + Standard_Real Ix = NAN, Iy = NAN, Iz = NAN, Ixx = NAN, Iyy = NAN, Izz = NAN, Ixy = NAN, Ixz = NAN, Iyz = NAN; dim = Ix = Iy = Iz = Ixx = Iyy = Izz = Ixy = Ixz = Iyz = 0.0; Standard_Real Lower = BRepGProp_EdgeTool::FirstParameter (C); @@ -40,10 +42,10 @@ void BRepGProp_Cinert::Perform (const BRepAdaptor_Curve& C) gp_Pnt P; //value on the curve gp_Vec V1; //first derivative on the curve - Standard_Real ds; //curvilign abscissae - Standard_Real ur, um, u; - Standard_Real x, y, z; - Standard_Real xloc, yloc, zloc; + Standard_Real ds = NAN; //curvilign abscissae + Standard_Real ur = NAN, um = NAN, u = NAN; + Standard_Real x = NAN, y = NAN, z = NAN; + Standard_Real xloc = NAN, yloc = NAN, zloc = NAN; math_Vector GaussP (1, Order); math_Vector GaussW (1, Order); @@ -77,13 +79,13 @@ void BRepGProp_Cinert::Perform (const BRepAdaptor_Curve& C) Upper = UU2; } - Standard_Real dimLocal, IxLocal, IyLocal, IzLocal, IxxLocal, IyyLocal, IzzLocal, IxyLocal, IxzLocal, IyzLocal; + Standard_Real dimLocal = NAN, IxLocal = NAN, IyLocal = NAN, IzLocal = NAN, IxxLocal = NAN, IyyLocal = NAN, IzzLocal = NAN, IxyLocal = NAN, IxzLocal = NAN, IyzLocal = NAN; dimLocal = IxLocal = IyLocal = IzLocal = IxxLocal = IyyLocal = IzzLocal = IxyLocal = IxzLocal = IyzLocal = 0.0; // modified by NIZHNY-MKK Thu Jun 9 12:13:32 2005.END loc.Coord (xloc, yloc, zloc); - Standard_Integer i; + Standard_Integer i = 0; // Calcul des integrales aux points de gauss : um = 0.5 * (Upper + Lower); diff --git a/src/BRepGProp/BRepGProp_Face.cxx b/src/BRepGProp/BRepGProp_Face.cxx index 38892ac8a5..ffd6213f7e 100644 --- a/src/BRepGProp/BRepGProp_Face.cxx +++ b/src/BRepGProp/BRepGProp_Face.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -41,7 +43,7 @@ static const Standard_Real Epsilon1 = Epsilon(1.); //======================================================================= Standard_Integer BRepGProp_Face::UIntegrationOrder() const { - Standard_Integer Nu; + Standard_Integer Nu = 0; switch (mySurface.GetType()) { @@ -77,7 +79,7 @@ Standard_Integer BRepGProp_Face::UIntegrationOrder() const { Standard_Integer BRepGProp_Face::VIntegrationOrder() const { - Standard_Integer Nv; + Standard_Integer Nv = 0; switch (mySurface.GetType()) { case GeomAbs_Plane : @@ -113,7 +115,7 @@ Standard_Integer BRepGProp_Face::VIntegrationOrder() const Standard_Integer BRepGProp_Face::IntegrationOrder() const { - Standard_Integer N; + Standard_Integer N = 0; switch (myCurve.GetType()) { @@ -176,7 +178,7 @@ void BRepGProp_Face::Bounds(Standard_Real& U1, bool BRepGProp_Face::Load(const TopoDS_Edge& E) { - Standard_Real a,b; + Standard_Real a = NAN,b = NAN; Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(E, mySurface.Face(), a,b); if (C.IsNull()) { @@ -240,7 +242,7 @@ static inline Standard_Real LCoeff(const Standard_Real Eps){ Standard_Integer BRepGProp_Face::SIntOrder(const Standard_Real Eps) const { - Standard_Integer Nv, Nu; + Standard_Integer Nv = 0, Nu = 0; switch (mySurface.GetType()) { case GeomAbs_Plane: Nu = 1; Nv = 1; break; @@ -273,7 +275,7 @@ Standard_Integer BRepGProp_Face::SIntOrder(const Standard_Real Eps) const Standard_Integer BRepGProp_Face::SUIntSubs() const { - Standard_Integer N; + Standard_Integer N = 0; switch (mySurface.GetType()) { case GeomAbs_Plane: N = 2; break; @@ -302,7 +304,7 @@ Standard_Integer BRepGProp_Face::SUIntSubs() const Standard_Integer BRepGProp_Face::SVIntSubs() const { - Standard_Integer N; + Standard_Integer N = 0; switch (mySurface.GetType()) { case GeomAbs_Plane: N = 2; break; @@ -389,7 +391,7 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const Bnd_Box2d aBox; BndLib_Add2dCurve::Add(myCurve, 1.e-7, aBox); - Standard_Real aXmin, aXmax, aYmin, aYmax; + Standard_Real aXmin = NAN, aXmax = NAN, aYmin = NAN, aYmax = NAN; aBox.Get(aXmin, aYmin, aXmax, aYmax); Standard_Real aVmin = mySurface.FirstVParameter(); Standard_Real aVmax = mySurface.LastVParameter(); @@ -403,7 +405,7 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const // Standard_Real NL, NS = Max(SIntOrder(1.0)*anRInt/LIntSubs(), 1); - Standard_Real NL, NS = Max(SIntOrder(1.)*anRInt/aLSubs, 1); + Standard_Real NL = NAN, NS = Max(SIntOrder(1.)*anRInt/aLSubs, 1); switch (myCurve.GetType()) { case GeomAbs_Line: NL = 1; break; @@ -441,7 +443,7 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const Standard_Integer BRepGProp_Face::LIntSubs() const { - Standard_Integer N; + Standard_Integer N = 0; switch (myCurve.GetType()) { case GeomAbs_Line: N = 2; break; @@ -496,11 +498,11 @@ void BRepGProp_Face::LKnots(TColStd_Array1OfReal& Knots) const void BRepGProp_Face::Load(const Standard_Boolean IsFirstParam, const GeomAbs_IsoType theIsoType) { - Standard_Real aLen; - Standard_Real aU1; - Standard_Real aU2; - Standard_Real aV1; - Standard_Real aV2; + Standard_Real aLen = NAN; + Standard_Real aU1 = NAN; + Standard_Real aU2 = NAN; + Standard_Real aV1 = NAN; + Standard_Real aV2 = NAN; gp_Pnt2d aLoc; gp_Dir2d aDir; @@ -565,7 +567,7 @@ static void GetRealKnots(const Standard_Real theMin, aStartI = iU; Standard_Integer aNbNode = Max(0, aEndI - aStartI + 1) + 2; - Standard_Integer j; + Standard_Integer j = 0; theRealKnots = new TColStd_HArray1OfReal(1, aNbNode); theRealKnots->SetValue(1, theMin); @@ -590,7 +592,7 @@ static void GetCurveKnots(const Standard_Real theMin, if (isSBSpline) { Handle(Geom2d_BSplineCurve) aCrv; - Standard_Integer aNbKnots; + Standard_Integer aNbKnots = 0; Handle(TColStd_HArray1OfReal) aCrvKnots; aCrv = Handle(Geom2d_BSplineCurve)::DownCast(theCurve.Curve()); @@ -632,7 +634,7 @@ void BRepGProp_Face::GetUKnots if (myIsUseSpan && (isSBSpline || isCBSpline)) { // Using span decomposition for BSpline. Handle(TColStd_HArray1OfReal) aKnots; - Standard_Integer aNbKnots; + Standard_Integer aNbKnots = 0; if (isSBSpline) { // Get U knots of BSpline surface. @@ -682,7 +684,7 @@ void BRepGProp_Face::GetTKnots if (myIsUseSpan && isBSpline) { // Using span decomposition for BSpline. Handle(TColStd_HArray1OfReal) aSurfKnots; - Standard_Integer aNbKnots; + Standard_Integer aNbKnots = 0; // Get V knots of BSpline surface. Handle(Geom_Surface) aSurf = mySurface.Surface().Surface(); diff --git a/src/BRepGProp/BRepGProp_Gauss.cxx b/src/BRepGProp/BRepGProp_Gauss.cxx index 800783d8b1..780c22f2e3 100644 --- a/src/BRepGProp/BRepGProp_Gauss.cxx +++ b/src/BRepGProp/BRepGProp_Gauss.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -153,10 +155,10 @@ void BRepGProp_Gauss::Inertia::Reset() //purpose : Constructor //======================================================================= BRepGProp_Gauss::BRepGProp_Gauss(const BRepGProp_GaussType theType) -: myType(theType) +: myType(theType), add(::Add), mult(::Mult) { - add = (::Add ); - mult = (::Mult); + + } //======================================================================= @@ -576,7 +578,7 @@ Standard_Real BRepGProp_Gauss::Compute( NCollection_Handle ErrUL = new math_Vector(1, SM, 0.0); // Face parametrization in U and V direction - Standard_Real BV1, BV2, BU1, BU2; + Standard_Real BV1 = NAN, BV2 = NAN, BU1 = NAN, BU2 = NAN; theSurface.Bounds(BU1, BU2, BV1, BV2); checkBounds(BU1, BU2, BV1, BV2); @@ -585,22 +587,22 @@ Standard_Real BRepGProp_Gauss::Compute( const TopoDS_Face& aF = theSurface.GetFace(); const Standard_Boolean isNaturalRestriction = (aF.NbChildren () == 0); //theSurface.NaturalRestriction(); - Standard_Real CIx, CIy, CIz, CIxy, CIxz, CIyz; + Standard_Real CIx = NAN, CIy = NAN, CIz = NAN, CIxy = NAN, CIxz = NAN, CIyz = NAN; Standard_Real CDim[2], CIxx[2], CIyy[2], CIzz[2]; // Boundary curve parametrization - Standard_Real u1 = BU1, u2, l1, l2, lm, lr, l, v; + Standard_Real u1 = BU1, u2 = NAN, l1 = NAN, l2 = NAN, lm = NAN, lr = NAN, l = NAN, v = NAN; // On the boundary curve u-v gp_Pnt2d Puv; gp_Vec2d Vuv; - Standard_Real Dul; // Dul = Du / Dl + Standard_Real Dul = NAN; // Dul = Du / Dl - Standard_Integer iLS, iLSubEnd, iGL, iGLEnd, NbLGaussP[2], LRange[2], iL, kL, kLEnd, IL, JL; - Standard_Integer i, iUSubEnd, NbUGaussP[2], URange[2], kU, kUEnd, IU, JU; - Standard_Integer UMaxSubs, LMaxSubs; + Standard_Integer iLS = 0, iLSubEnd = 0, iGL = 0, iGLEnd = 0, NbLGaussP[2], LRange[2], iL = 0, kL = 0, kLEnd = 0, IL = 0, JL = 0; + Standard_Integer i = 0, iUSubEnd = 0, NbUGaussP[2], URange[2], kU = 0, kUEnd = 0, IU = 0, JU = 0; + Standard_Integer UMaxSubs = 0, LMaxSubs = 0; - Standard_Real ErrorU, ErrorL, ErrorLMax = 0.0, Eps = 0.0, EpsL = 0.0, EpsU = 0.0; + Standard_Real ErrorU = NAN, ErrorL = NAN, ErrorLMax = 0.0, Eps = 0.0, EpsL = 0.0, EpsU = 0.0; iGLEnd = isErrorCalculation ? 2 : 1; NbUGaussP[0] = theSurface.SIntOrder(anEpsilon); @@ -1097,7 +1099,7 @@ void BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, { Standard_ASSERT_RAISE(myType == Sinert, "BRepGProp_Gauss: Incorrect type"); - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; theSurface.Bounds (u1, u2, v1, v2); checkBounds(u1, u2, v1, v2); @@ -1195,7 +1197,7 @@ void BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, { Standard_ASSERT_RAISE(myType == Vinert, "BRepGProp_Gauss: Incorrect type"); - Standard_Real u1, v1, u2, v2; + Standard_Real u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN; theSurface.Bounds (u1, u2, v1, v2); checkBounds(u1, u2, v1, v2); @@ -1287,7 +1289,7 @@ void BRepGProp_Gauss::Compute(const BRepGProp_Face& theSurface, gp_Pnt& theOutGravityCenter, gp_Mat& theOutInertia) { - Standard_Real LowerU, UpperU, LowerV, UpperV; + Standard_Real LowerU = NAN, UpperU = NAN, LowerV = NAN, UpperV = NAN; theSurface.Bounds(LowerU, UpperU, LowerV, UpperV); checkBounds(LowerU, UpperU, LowerV, UpperV); diff --git a/src/BRepGProp/BRepGProp_MeshCinert.cxx b/src/BRepGProp/BRepGProp_MeshCinert.cxx index be7a9dcc75..004330e03d 100644 --- a/src/BRepGProp/BRepGProp_MeshCinert.cxx +++ b/src/BRepGProp/BRepGProp_MeshCinert.cxx @@ -11,6 +11,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -42,16 +44,16 @@ void BRepGProp_MeshCinert::SetLocation(const gp_Pnt& CLocation) void BRepGProp_MeshCinert::Perform(const TColgp_Array1OfPnt& theNodes) { - Standard_Real Ix, Iy, Iz, Ixx, Iyy, Izz, Ixy, Ixz, Iyz; + Standard_Real Ix = NAN, Iy = NAN, Iz = NAN, Ixx = NAN, Iyy = NAN, Izz = NAN, Ixy = NAN, Ixz = NAN, Iyz = NAN; dim = Ix = Iy = Iz = Ixx = Iyy = Izz = Ixy = Ixz = Iyz = 0.0; Standard_Integer Order = 2; - Standard_Real ds; - Standard_Real ur, um, u; - Standard_Real x, y, z; - Standard_Real xloc, yloc, zloc; - Standard_Real Upper; + Standard_Real ds = NAN; + Standard_Real ur = NAN, um = NAN, u = NAN; + Standard_Real x = NAN, y = NAN, z = NAN; + Standard_Real xloc = NAN, yloc = NAN, zloc = NAN; + Standard_Real Upper = NAN; gp_XYZ P, D; math_Vector GaussP (1, Order); @@ -66,12 +68,12 @@ void BRepGProp_MeshCinert::Perform(const TColgp_Array1OfPnt& theNodes) { const gp_XYZ& aP1 = theNodes(nIndex).XYZ(); const gp_XYZ& aP2 = theNodes(nIndex + 1).XYZ(); - Standard_Real dimLocal, IxLocal, IyLocal, IzLocal, IxxLocal, IyyLocal, IzzLocal, IxyLocal, IxzLocal, IyzLocal; + Standard_Real dimLocal = NAN, IxLocal = NAN, IyLocal = NAN, IzLocal = NAN, IxxLocal = NAN, IyyLocal = NAN, IzzLocal = NAN, IxyLocal = NAN, IxzLocal = NAN, IyzLocal = NAN; dimLocal = IxLocal = IyLocal = IzLocal = IxxLocal = IyyLocal = IzzLocal = IxyLocal = IxzLocal = IyzLocal = 0.0; loc.Coord (xloc, yloc, zloc); - Standard_Integer i; + Standard_Integer i = 0; Upper = (aP2 - aP1).Modulus(); if (Upper < gp::Resolution()) @@ -151,7 +153,7 @@ void BRepGProp_MeshCinert::PreparePolygon(const TopoDS_Edge& theE, { const TColgp_Array1OfPnt& aNodes = aPolyg->Nodes(); thePolyg = new TColgp_HArray1OfPnt(1, aNodes.Length()); - Standard_Integer i; + Standard_Integer i = 0; if (aLoc.IsIdentity()) { for (i = 1; i <= aNodes.Length(); ++i) @@ -179,7 +181,7 @@ void BRepGProp_MeshCinert::PreparePolygon(const TopoDS_Edge& theE, Standard_Integer aNbNodes = aPOnTri->NbNodes(); thePolyg = new TColgp_HArray1OfPnt(1, aNbNodes); const TColStd_Array1OfInteger& aNodeInds = aPOnTri->Nodes(); - Standard_Integer i; + Standard_Integer i = 0; if (aLoc.IsIdentity()) { for (i = 1; i <= aNbNodes; ++i) @@ -207,7 +209,7 @@ void BRepGProp_MeshCinert::PreparePolygon(const TopoDS_Edge& theE, Standard_Integer aNbNodes = aPolyg2D->NbNodes(); thePolyg = new TColgp_HArray1OfPnt(1, aNbNodes); const TColgp_Array1OfPnt2d& aNodes2D = aPolyg2D->Nodes(); - Standard_Integer i; + Standard_Integer i = 0; if (aLoc.IsIdentity()) { for (i = 1; i <= aNbNodes; ++i) diff --git a/src/BRepGProp/BRepGProp_MeshProps.cxx b/src/BRepGProp/BRepGProp_MeshProps.cxx index c1f51a6670..e742a55e75 100644 --- a/src/BRepGProp/BRepGProp_MeshProps.cxx +++ b/src/BRepGProp/BRepGProp_MeshProps.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -39,7 +41,7 @@ static void CalculateElSProps(const Standard_Real x, //GProps[4] = Ixx, GProps[5] = Iyy, GProps[6] = Izz, //GProps[7] = Ixy, aGProps[8] = Ixz, GProps[9] = Iyz, // - Standard_Real x2, y2, z2; + Standard_Real x2 = NAN, y2 = NAN, z2 = NAN; x2 = x * x; y2 = y * y; z2 = z * z; @@ -65,7 +67,7 @@ static void CalculateElVProps(const Standard_Real x, const Standard_Real y, const Standard_Real z, const Standard_Real dv, Standard_Real* GProps) { - Standard_Real x2, y2, z2; + Standard_Real x2 = NAN, y2 = NAN, z2 = NAN; x2 = x * x; y2 = y * y; z2 = z * z; @@ -117,15 +119,15 @@ static void CalculateElVProps(const Standard_Real x, gp_Dir aDN(aNorm); gp_Ax3 aPosPln(aPC, aDN); //Coordinates of nodes on plane - Standard_Real x1, y1, x2, y2, x3, y3; + Standard_Real x1 = NAN, y1 = NAN, x2 = NAN, y2 = NAN, x3 = NAN, y3 = NAN; ElSLib::PlaneParameters(aPosPln, p1, x1, y1); ElSLib::PlaneParameters(aPosPln, p2, x2, y2); ElSLib::PlaneParameters(aPosPln, p3, x3, y3); // - Standard_Real l1, l2; //barycentriche coordinates - Standard_Real x, y, z; - Standard_Real w; //weight - Standard_Integer i; + Standard_Real l1 = NAN, l2 = NAN; //barycentriche coordinates + Standard_Real x = NAN, y = NAN, z = NAN; + Standard_Real w = NAN; //weight + Standard_Integer i = 0; for (i = 0; i < NbGaussPoints; ++i) { Standard_Integer ind = 3 * i; @@ -260,7 +262,7 @@ void BRepGProp_MeshProps::Perform (const Handle(Poly_Triangulation)& theMesh, //aGProps[7] = Ixy, aGProps[8] = Ixz, aGProps[9] = Iyz, Standard_Boolean isVolume = myType == Vinert; - Standard_Integer n1, n2, n3; //node indices + Standard_Integer n1 = 0, n2 = 0, n3 = 0; //node indices for (Standard_Integer i = 1; i <= theMesh->NbTriangles(); ++i) { const Poly_Triangle aTri = theMesh->Triangle (i); diff --git a/src/BRepGProp/BRepGProp_Sinert.hxx b/src/BRepGProp/BRepGProp_Sinert.hxx index 654ef3acd4..ce031d9676 100644 --- a/src/BRepGProp/BRepGProp_Sinert.hxx +++ b/src/BRepGProp/BRepGProp_Sinert.hxx @@ -80,7 +80,7 @@ private: - Standard_Real myEpsilon; + Standard_Real myEpsilon{}; }; diff --git a/src/BRepGProp/BRepGProp_TFunction.cxx b/src/BRepGProp/BRepGProp_TFunction.cxx index e8a8674d03..ffc0755f42 100644 --- a/src/BRepGProp/BRepGProp_TFunction.cxx +++ b/src/BRepGProp/BRepGProp_TFunction.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -67,7 +69,7 @@ Standard_Boolean BRepGProp_TFunction::Value(const Standard_Real X, gp_Pnt2d aP2d; gp_Vec2d aV2d; - Standard_Real aUMax; + Standard_Real aUMax = NAN; Handle(TColStd_HArray1OfReal) anUKnots; mySurface.D12d(X, aP2d, aV2d); @@ -83,7 +85,7 @@ Standard_Boolean BRepGProp_TFunction::Value(const Standard_Real X, myUFunction.SetVParam(aP2d.Y()); // Compute the integral from myUMin to aUMax of myUFunction. - Standard_Integer i; + Standard_Integer i = 0; Standard_Real aCoeff = aV2d.Y(); //Standard_Integer aNbUIntervals = anUKnots->Length() - 1; //Standard_Real aTol = myTolerance/aNbUIntervals; @@ -123,7 +125,7 @@ Standard_Boolean BRepGProp_TFunction::Value(const Standard_Real X, // aTol = 0.1; Standard_Integer iU = anUKnots->Upper(); - Standard_Integer aNbPntsStart; + Standard_Integer aNbPntsStart = 0; Standard_Integer aNbMaxIter = 1000; math_KronrodSingleIntegration anIntegral; Standard_Real aLocalErr = 0.; diff --git a/src/BRepGProp/BRepGProp_UFunction.cxx b/src/BRepGProp/BRepGProp_UFunction.cxx index 5083b266b9..8178e1ae3c 100644 --- a/src/BRepGProp/BRepGProp_UFunction.cxx +++ b/src/BRepGProp/BRepGProp_UFunction.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -46,8 +48,8 @@ Standard_Boolean BRepGProp_UFunction::Value(const Standard_Real X, // Volume computation if (myValueType == GProp_Mass) { gp_XYZ aPMP0; - Standard_Real aTmpPar1; - Standard_Real aTmpPar2; + Standard_Real aTmpPar1 = NAN; + Standard_Real aTmpPar2 = NAN; F = VolumeValue(X, aPMP0, aTmpPar1, aTmpPar2); @@ -112,8 +114,8 @@ Standard_Boolean BRepGProp_UFunction::CenterMassValue(const Standard_Real X, Standard_Real &F) { gp_XYZ aPmP0; - Standard_Real aS; - Standard_Real aD1; + Standard_Real aS = NAN; + Standard_Real aD1 = NAN; F = VolumeValue(X, aPmP0, aS, aD1); @@ -153,10 +155,10 @@ Standard_Boolean BRepGProp_UFunction::InertiaValue(const Standard_Real X, Standard_Real &F) { gp_XYZ aPmP0; - Standard_Real aS; - Standard_Real aD1; - Standard_Real aParam1; - Standard_Real aParam2; + Standard_Real aS = NAN; + Standard_Real aD1 = NAN; + Standard_Real aParam1 = NAN; + Standard_Real aParam2 = NAN; const Standard_Real* aCoeffs = myCoeffs; F = VolumeValue(X, aPmP0, aS, aD1); @@ -196,10 +198,10 @@ Standard_Boolean BRepGProp_UFunction::InertiaValue(const Standard_Real X, // Inertia computation for ByPlane mode. Standard_Real aD2 = aD1*aD1; Standard_Real aD3 = aD1*aD2/3.; - Standard_Real aPPar1; - Standard_Real aPPar2; - Standard_Real aCoeff1; - Standard_Real aCoeff2; + Standard_Real aPPar1 = NAN; + Standard_Real aPPar2 = NAN; + Standard_Real aCoeff1 = NAN; + Standard_Real aCoeff2 = NAN; // Inertia computation for XX, YY and ZZ. if (myValueType == GProp_InertiaXX || diff --git a/src/BRepGProp/BRepGProp_Vinert.hxx b/src/BRepGProp/BRepGProp_Vinert.hxx index 5c4cf05c13..ee238ad14a 100644 --- a/src/BRepGProp/BRepGProp_Vinert.hxx +++ b/src/BRepGProp/BRepGProp_Vinert.hxx @@ -211,7 +211,7 @@ private: - Standard_Real myEpsilon; + Standard_Real myEpsilon{}; }; diff --git a/src/BRepGProp/BRepGProp_VinertGK.cxx b/src/BRepGProp/BRepGProp_VinertGK.cxx index bf8b8d8677..73b9ef5be8 100644 --- a/src/BRepGProp/BRepGProp_VinertGK.cxx +++ b/src/BRepGProp/BRepGProp_VinertGK.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -217,9 +219,9 @@ Standard_Real BRepGProp_VinertGK::Perform(BRepGProp_Face &theSurface, { Standard_Real aCoeff[4]; - Standard_Real aXLoc; - Standard_Real aYLoc; - Standard_Real aZLoc; + Standard_Real aXLoc = NAN; + Standard_Real aYLoc = NAN; + Standard_Real aZLoc = NAN; loc.Coord(aXLoc, aYLoc, aZLoc); thePlane.Coefficients (aCoeff[0], aCoeff[1], aCoeff[2], aCoeff[3]); @@ -244,9 +246,9 @@ Standard_Real BRepGProp_VinertGK::Perform(BRepGProp_Face &theSurface, { Standard_Real aCoeff[4]; - Standard_Real aXLoc; - Standard_Real aYLoc; - Standard_Real aZLoc; + Standard_Real aXLoc = NAN; + Standard_Real aYLoc = NAN; + Standard_Real aZLoc = NAN; loc.Coord(aXLoc, aYLoc, aZLoc); thePlane.Coefficients (aCoeff[0], aCoeff[1], aCoeff[2], aCoeff[3]); @@ -299,21 +301,21 @@ Standard_Real BRepGProp_VinertGK::PrivatePerform //Standard_Real aCrvTol = 0.5*theTolerance/aNbCurves; Standard_Real aCrvTol = 0.1*theTolerance; - Standard_Real aUMin; - Standard_Real aUMax; - Standard_Real aTMin; - Standard_Real aTMax; - Standard_Integer aNbPnts; + Standard_Real aUMin = NAN; + Standard_Real aUMax = NAN; + Standard_Real aTMin = NAN; + Standard_Real aTMax = NAN; + Standard_Integer aNbPnts = 0; Standard_Integer aNbMaxIter = 1000; Standard_Integer aNbVal = 10; - Standard_Integer k; + Standard_Integer k = 0; math_Vector aLocalValue(1, aNbVal); math_Vector aLocalTolReached(1, aNbVal); math_Vector aValue(1, aNbVal); math_Vector aTolReached(1, aNbVal); TColStd_Array1OfBoolean CFlags(1, aNbVal); CFlags.Init(Standard_False); - Standard_Boolean isMore; + Standard_Boolean isMore = 0; //aNbVal = 1; aValue.Init(0.); @@ -323,12 +325,12 @@ Standard_Real BRepGProp_VinertGK::PrivatePerform CFlags(1) = Standard_True; if(theCGFlag || theIFlag) { - Standard_Integer i; + Standard_Integer i = 0; for(i = 2; i <= 4; ++i) {CFlags(i) = Standard_True;} } if(theIFlag) { - Standard_Integer i; + Standard_Integer i = 0; for(i = 5; i <= 10; ++i) {CFlags(i) = Standard_True;} } diff --git a/src/BRepGProp/BRepGProp_VinertGK.hxx b/src/BRepGProp/BRepGProp_VinertGK.hxx index 1593ace13b..390c55433f 100644 --- a/src/BRepGProp/BRepGProp_VinertGK.hxx +++ b/src/BRepGProp/BRepGProp_VinertGK.hxx @@ -157,7 +157,7 @@ private: Standard_Real myErrorReached; - Standard_Real myAbsolutError; + Standard_Real myAbsolutError{}; }; diff --git a/src/BRepIntCurveSurface/BRepIntCurveSurface_Inter.cxx b/src/BRepIntCurveSurface/BRepIntCurveSurface_Inter.cxx index 8d4fef7bbd..cc9fbb0e6b 100644 --- a/src/BRepIntCurveSurface/BRepIntCurveSurface_Inter.cxx +++ b/src/BRepIntCurveSurface/BRepIntCurveSurface_Inter.cxx @@ -34,9 +34,9 @@ //function :BRepIntCurveSurface_Inter::BRepIntCurveSurface_Inte //purpose : //=========================================================================== -BRepIntCurveSurface_Inter::BRepIntCurveSurface_Inter() +BRepIntCurveSurface_Inter::BRepIntCurveSurface_Inter() : myFastClass(new BRepTopAdaptor_TopolTool()) { - myFastClass = new BRepTopAdaptor_TopolTool(); + Clear(); } diff --git a/src/BRepIntCurveSurface/BRepIntCurveSurface_Inter.hxx b/src/BRepIntCurveSurface/BRepIntCurveSurface_Inter.hxx index 1694ed1ca9..b6985291d9 100644 --- a/src/BRepIntCurveSurface/BRepIntCurveSurface_Inter.hxx +++ b/src/BRepIntCurveSurface/BRepIntCurveSurface_Inter.hxx @@ -132,17 +132,17 @@ private: - Standard_Real myTolerance; + Standard_Real myTolerance{}; Handle(GeomAdaptor_Curve) myCurve; IntCurveSurface_HInter myIntcs; - Standard_Integer myCurrentindex; - Standard_Integer myCurrentnbpoints; + Standard_Integer myCurrentindex{}; + Standard_Integer myCurrentnbpoints{}; Handle(BRepTopAdaptor_TopolTool) myFastClass; TopAbs_State myCurrentstate; - Standard_Real myCurrentU; - Standard_Real myCurrentV; + Standard_Real myCurrentU{}; + Standard_Real myCurrentV{}; Bnd_Box myCurveBox; - Standard_Integer myIndFace; + Standard_Integer myIndFace{}; TopTools_SequenceOfShape myFaces; Handle(Bnd_HArray1OfBox) myFaceBoxes; diff --git a/src/BRepLib/BRepLib.cxx b/src/BRepLib/BRepLib.cxx index 3eec408309..3a06aedb77 100644 --- a/src/BRepLib/BRepLib.cxx +++ b/src/BRepLib/BRepLib.cxx @@ -17,6 +17,8 @@ //pmn 26/09/97 Add parameters of approximation in BuildCurve3d // Modified by skv - Thu Jun 3 12:39:19 2004 OCC5898 +#include + #include #include @@ -159,7 +161,7 @@ Standard_Boolean BRepLib::CheckSameRange(const TopoDS_Edge& AnEdge, BRep_ListIteratorOfListOfCurveRepresentation an_Iterator ((*((Handle(BRep_TEdge)*)&AnEdge.TShape()))->ChangeCurves()); - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Standard_Real current_first =0., current_last =0. ; Handle(BRep_GCurve) geometric_representation_ptr ; @@ -200,13 +202,13 @@ void BRepLib::SameRange(const TopoDS_Edge& AnEdge, TopLoc_Location LocalLoc ; Standard_Boolean first_time_in = Standard_True, - has_curve, - has_closed_curve ; + has_curve = 0, + has_closed_curve = 0 ; Handle(BRep_GCurve) geometric_representation_ptr ; - Standard_Real first, - current_first, - last, - current_last ; + Standard_Real first = NAN, + current_first = NAN, + last = NAN, + current_last = NAN ; const Handle(Geom_Curve) C = BRep_Tool::Curve(AnEdge, LocalLoc, @@ -288,8 +290,8 @@ static Standard_Integer evaluateMaxSegment(const Standard_Integer aMaxSegment, { if (aMaxSegment != 0) return aMaxSegment; - Handle(Adaptor3d_Surface) aSurf = aCurveOnSurface.GetSurface(); - Handle(Adaptor2d_Curve2d) aCurv2d = aCurveOnSurface.GetCurve(); + const Handle(Adaptor3d_Surface)& aSurf = aCurveOnSurface.GetSurface(); + const Handle(Adaptor2d_Curve2d)& aCurv2d = aCurveOnSurface.GetCurve(); Standard_Real aNbSKnots = 0, aNbC2dKnots = 0; @@ -317,19 +319,19 @@ Standard_Boolean BRepLib::BuildCurve3d(const TopoDS_Edge& AnEdge, { Standard_Integer //ErrorCode, // ReturnCode = 0, - ii, + ii = 0, // num_knots, - jj; + jj = 0; TopLoc_Location LocalLoc,L[2],LC; - Standard_Real f,l,fc,lc, first[2], last[2], - tolerance, - max_deviation, - average_deviation ; + Standard_Real f = NAN,l = NAN,fc = NAN,lc = NAN, first[2], last[2], + tolerance = NAN, + max_deviation = NAN, + average_deviation = NAN ; Handle(Geom2d_Curve) Curve2dPtr, Curve2dArray[2] ; Handle(Geom_Surface) SurfacePtr, SurfaceArray[2] ; - Standard_Integer not_done ; + Standard_Integer not_done = 0 ; // if the edge has a 3d curve returns true @@ -375,7 +377,7 @@ Standard_Boolean BRepLib::BuildCurve3d(const TopoDS_Edge& AnEdge, if (C3d.IsNull()) return Standard_False; // update the edge - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; BRep_Builder B; B.UpdateEdge(AnEdge,C3d,LocalLoc,0.0e0); @@ -484,7 +486,7 @@ Standard_Boolean BRepLib::BuildCurves3d(const TopoDS_Shape& S, const Standard_Integer MaxDegree, const Standard_Integer MaxSegment) { - Standard_Boolean boolean_value, + Standard_Boolean boolean_value = 0, ok = Standard_True; TopTools_MapOfShape a_counter ; TopExp_Explorer ex(S,TopAbs_EDGE); @@ -511,13 +513,13 @@ Standard_Boolean BRepLib::UpdateEdgeTol(const TopoDS_Edge& AnEdge, const Standard_Real MaxToleranceToCheck) { - Standard_Integer curve_on_surface_index, - curve_index, - not_done, - has_closed_curve, - has_curve, - jj, - ii, + Standard_Integer curve_on_surface_index = 0, + curve_index = 0, + not_done = 0, + has_closed_curve = 0, + has_curve = 0, + jj = 0, + ii = 0, geom_reference_curve_flag = 0, max_sampling_points = 90, min_sampling_points = 30 ; @@ -525,10 +527,10 @@ Standard_Boolean BRepLib::UpdateEdgeTol(const TopoDS_Edge& AnEdge, Standard_Real factor = 100.0e0, // sampling_array[2], safe_factor = 1.4e0, - current_last, - current_first, - max_distance, - coded_edge_tolerance, + current_last = NAN, + current_first = NAN, + max_distance = NAN, + coded_edge_tolerance = NAN, edge_tolerance = 0.0e0 ; Handle(TColStd_HArray1OfReal) parameters_ptr ; Handle(BRep_GCurve) geometric_representation_ptr ; @@ -720,7 +722,7 @@ Standard_Boolean BRepLib::UpdateEdgeTolerance(const TopoDS_Shape& S, TopTools_MapOfShape a_counter ; Standard_Boolean return_status = Standard_False, - local_flag ; + local_flag = 0 ; while (ex.More()) { if (a_counter.Add(ex.Current())) { @@ -769,7 +771,7 @@ static void GetEdgeTol(const TopoDS_Edge& theEdge, Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface(); TopLoc_Location LC; - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; HC->Load(BRep_Tool::Curve(theEdge,LC,First,Last)); LC = L.Predivided(LC); @@ -814,7 +816,7 @@ static void UpdTolMap(const TopoDS_Shape& theSh, Standard_Real theNewTol, TopTools_DataMapOfShapeReal& theShToTol) { TopAbs_ShapeEnum aSt = theSh.ShapeType(); - Standard_Real aShTol; + Standard_Real aShTol = NAN; if (aSt == TopAbs_VERTEX) aShTol = BRep_Tool::Tolerance(TopoDS::Vertex(theSh)); else if (aSt == TopAbs_EDGE) @@ -1017,7 +1019,7 @@ static Standard_Boolean EvalTol(const Handle(Geom2d_Curve)& pc, Standard_Real l = gac.LastParameter(); Extrema_LocateExtPC Projector; Projector.Initialize(gac,f,l,tol); - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; gp_Pnt p; tolbail = tol; for(Standard_Integer i = 1; i <= 5; i++){ @@ -1188,7 +1190,7 @@ static void GetCurve3d(const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theC3d, S //function : UpdateVTol //purpose : //======================================================================= -void UpdateVTol(const TopoDS_Vertex theV1, const TopoDS_Vertex& theV2, Standard_Real theTol) +void UpdateVTol(const TopoDS_Vertex& theV1, const TopoDS_Vertex& theV2, Standard_Real theTol) { BRep_Builder aB; if (!theV1.IsNull()) @@ -1384,7 +1386,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, } if(bs2d->Continuity() == GeomAbs_C0) { - Standard_Real tolbail; + Standard_Real tolbail = NAN; if(EvalTol(curPC,S,GAC,theTolerance,tolbail)){ bs2d = bs2dsov; Standard_Real UResbail = GAS.UResolution(tolbail); @@ -1475,7 +1477,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, Standard_Real critratio = 10.; Standard_Real dtprev = Knots(2) - Knots(1), dtratio = 1.; Standard_Real dtmin = dtprev; - Standard_Real dtcur; + Standard_Real dtcur = NAN; for(Standard_Integer j = 2; j < NbKnots; j++) { dtcur = Knots(j+1) - Knots(j); dtmin = Min(dtmin, dtcur); @@ -1629,7 +1631,7 @@ static void InternalUpdateTolerances(const TopoDS_Shape& theOldShape, TopLoc_Location l; TopExp_Explorer ex; Bnd_Box aB; - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, dMax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN, dMax = NAN; for (ex.Init(theOldShape, TopAbs_FACE); ex.More(); ex.Next()) { const TopoDS_Face& curf=TopoDS::Face(ex.Current()); S = BRep_Tool::Surface(curf, l); @@ -1678,13 +1680,13 @@ static void InternalUpdateTolerances(const TopoDS_Shape& theOldShape, TopTools_IndexedDataMapOfShapeListOfShape parents; TopExp::MapShapesAndAncestors(theOldShape, TopAbs_EDGE, TopAbs_FACE, parents); TopTools_ListIteratorOfListOfShape lConx; - Standard_Integer iCur; + Standard_Integer iCur = 0; for (iCur=1; iCur<=parents.Extent(); iCur++) { tol=0; for (lConx.Initialize(parents(iCur)); lConx.More(); lConx.Next()) { const TopoDS_Face& FF = TopoDS::Face(lConx.Value()); - Standard_Real Ftol; + Standard_Real Ftol = NAN; if (IsVerifyTolerance && aShToTol.IsBound(FF)) //first condition for speed-up Ftol = aShToTol(FF); else @@ -1821,7 +1823,7 @@ void BRepLib::UpdateInnerTolerances(const TopoDS_Shape& aShape) TopoDS_Vertex V1, V2; TopExp::Vertices(anEdge, V1, V2); - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; BRep_Tool::Range(anEdge, fpar, lpar); Standard_Real TolEdge = BRep_Tool::Tolerance(anEdge); gp_Pnt Pnt1, Pnt2; @@ -2016,7 +2018,7 @@ GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge, TopoDS_Edge anEdgeInFace1, anEdgeInFace2; Handle(Geom2d_Curve) aCurve1, aCurve2; - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; if (!theFace1.IsSame (theFace2) && BRep_Tool::IsClosed (theEdge, theFace1) && @@ -2082,7 +2084,7 @@ GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge, SurfaceProperties aSP1(aSurface1, aSurf1Trsf, aCurve1, theFace1.Orientation() == TopAbs_REVERSED); SurfaceProperties aSP2(aSurface2, aSurf2Trsf, aCurve2, theFace2.Orientation() == TopAbs_REVERSED); - Standard_Real f, l, eps; + Standard_Real f = NAN, l = NAN, eps = NAN; BRep_Tool::Range (theEdge,f,l); Extrema_LocateExtPC ext; Handle(BRepAdaptor_Curve) aHC2; @@ -2094,13 +2096,13 @@ GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge, const Standard_Real anAngleTol2 = theAngleTol * theAngleTol; gp_Vec aDer1, aDer2; - Standard_Real aSqLen1, aSqLen2; + Standard_Real aSqLen1 = NAN, aSqLen2 = NAN; gp_Dir aCrvDir1[2], aCrvDir2[2]; Standard_Real aCrvLen1[2], aCrvLen2[2]; GeomAbs_Shape aCont = (isElementary ? GeomAbs_CN : GeomAbs_C2); GeomAbs_Shape aCurCont; - Standard_Real u; + Standard_Real u = NAN; for (Standard_Integer i = 0; i <= 20 && aCont > GeomAbs_C0; i++) { // First suppose that this is sameParameter @@ -2235,7 +2237,7 @@ static void EncodeRegularity(const TopoDS_Shape& theShape, TopTools_ListIteratorOfListOfShape It; TopExp_Explorer Ex; TopoDS_Face F1,F2; - Standard_Boolean found; + Standard_Boolean found = 0; for (Standard_Integer i = 1; i <= M.Extent(); i++){ TopoDS_Edge E = TopoDS::Edge(M.FindKey(i)); if (!theEdgesToEncode.IsEmpty()) @@ -2502,7 +2504,7 @@ namespace //! Represents link of triangulation. struct Link { - Standard_Integer Node[2]; + Standard_Integer Node[2]{}; //! Constructor Link (const Standard_Integer theNode1, const Standard_Integer theNode2) @@ -2763,7 +2765,7 @@ void BRepLib::ReverseSortFaces (const TopoDS_Shape& Sh, void BRepLib::BoundingVertex(const NCollection_List& theLV, gp_Pnt& theNewCenter, Standard_Real& theNewTol) { - Standard_Integer aNb; + Standard_Integer aNb = 0; // aNb=theLV.Extent(); if (aNb < 2) { @@ -2771,8 +2773,8 @@ void BRepLib::BoundingVertex(const NCollection_List& theLV, } // else if (aNb==2) { - Standard_Integer m, n; - Standard_Real aR[2], dR, aD, aEps; + Standard_Integer m = 0, n = 0; + Standard_Real aR[2], dR = NAN, aD = NAN, aEps = NAN; TopoDS_Vertex aV[2]; gp_Pnt aP[2]; // @@ -2801,7 +2803,7 @@ void BRepLib::BoundingVertex(const NCollection_List& theLV, theNewTol = aR[m]; } else { - Standard_Real aRr; + Standard_Real aRr = NAN; gp_XYZ aXYZr; gp_Pnt aPr; // @@ -2821,7 +2823,7 @@ void BRepLib::BoundingVertex(const NCollection_List& theLV, // // issue 0027540 - sum of doubles may depend on the order // of addition, thus sort the coordinates for stable result - Standard_Integer i; + Standard_Integer i = 0; NCollection_Array1 aPoints(0, aNb-1); NCollection_List::Iterator aIt(theLV); for (i = 0; aIt.More(); aIt.Next(), ++i) { @@ -2841,7 +2843,7 @@ void BRepLib::BoundingVertex(const NCollection_List& theLV, gp_Pnt aP(aXYZ); // // compute the tolerance for the new vertex - Standard_Real aTi, aDi, aDmax; + Standard_Real aTi = NAN, aDi = NAN, aDmax = NAN; // aDmax=-1.; aIt.Initialize(theLV); @@ -2898,7 +2900,7 @@ void BRepLib::ExtendFace(const TopoDS_Face& theF, DownCast(aBAS.Surface().Surface()->Transformed(aBAS.Trsf())); // Get bounds of the basis surface - Standard_Real aSUMin, aSUMax, aSVMin, aSVMax; + Standard_Real aSUMin = NAN, aSUMax = NAN, aSVMin = NAN, aSVMax = NAN; aSurf->Bounds(aSUMin, aSUMax, aSVMin, aSVMax); Standard_Boolean isUPeriodic = aBAS.IsUPeriodic(); @@ -2962,7 +2964,7 @@ void BRepLib::ExtendFace(const TopoDS_Face& theF, } // Get surfaces bounds - Standard_Real aSUMin, aSUMax, aSVMin, aSVMax; + Standard_Real aSUMin = NAN, aSUMax = NAN, aSVMin = NAN, aSVMax = NAN; aSB->Bounds(aSUMin, aSUMax, aSVMin, aSVMax); Standard_Boolean isUClosed = aSB->IsUClosed(); diff --git a/src/BRepLib/BRepLib_1.cxx b/src/BRepLib/BRepLib_1.cxx index 5fe6d8c177..c0292b13df 100644 --- a/src/BRepLib/BRepLib_1.cxx +++ b/src/BRepLib/BRepLib_1.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -213,7 +215,7 @@ Standard_Boolean BRepLib::FindValidRange (const TopoDS_Edge& theEdge, Standard_Real& theFirst, Standard_Real& theLast) { TopLoc_Location aLoc; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; if (BRep_Tool::Curve(theEdge, aLoc, f, l).IsNull()) return Standard_False; BRepAdaptor_Curve anAC(theEdge); @@ -256,8 +258,8 @@ Standard_Boolean BRepLib::FindValidRange void BRepLib::BuildPCurveForEdgeOnPlane(const TopoDS_Edge& aE, const TopoDS_Face& aF) { - Standard_Boolean bToUpdate; - Standard_Real aTolE; + Standard_Boolean bToUpdate = 0; + Standard_Real aTolE = NAN; Handle(Geom2d_Curve) aC2D; BRep_Builder aBB; // @@ -277,8 +279,8 @@ void BRepLib::BuildPCurveForEdgeOnPlane(const TopoDS_Edge& aE, Handle(Geom2d_Curve)& aC2D, Standard_Boolean& bToUpdate) { - Standard_Real aT1, aT2; - Standard_Boolean isStored; + Standard_Real aT1 = NAN, aT2 = NAN; + Standard_Boolean isStored = 0; aC2D = BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2, &isStored); bToUpdate = !isStored && !aC2D.IsNull(); } diff --git a/src/BRepLib/BRepLib_CheckCurveOnSurface.cxx b/src/BRepLib/BRepLib_CheckCurveOnSurface.cxx index 335e4b748a..9cc742236b 100644 --- a/src/BRepLib/BRepLib_CheckCurveOnSurface.cxx +++ b/src/BRepLib/BRepLib_CheckCurveOnSurface.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -61,7 +63,7 @@ void BRepLib_CheckCurveOnSurface::Init(const TopoDS_Edge& theEdge, const TopoDS_ // Surface initialization TopLoc_Location aLocation; - Standard_Real aFirstParam, aLastParam; + Standard_Real aFirstParam = NAN, aLastParam = NAN; Handle(Geom2d_Curve) aGeom2dCurve = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirstParam, aLastParam); Handle(Geom_Surface) aGeomSurface = BRep_Tool::Surface(theFace); diff --git a/src/BRepLib/BRepLib_FindSurface.cxx b/src/BRepLib/BRepLib_FindSurface.cxx index 029abf4df3..18ce57be38 100644 --- a/src/BRepLib/BRepLib_FindSurface.cxx +++ b/src/BRepLib/BRepLib_FindSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -55,8 +57,8 @@ static Standard_Real Controle(const TColgp_SequenceOfPnt& thePoints, const Handle(Geom_Plane)& thePlane) { Standard_Real dfMaxDist=0.; - Standard_Real a,b,c,d, dist; - Standard_Integer ii; + Standard_Real a = NAN,b = NAN,c = NAN,d = NAN, dist = NAN; + Standard_Integer ii = 0; thePlane->Coefficients(a,b,c,d); for (ii=1; ii<=thePoints.Length(); ii++) { const gp_XYZ& xyz = thePoints(ii).XYZ(); @@ -77,7 +79,7 @@ inline static Standard_Boolean Is2DConnected(const TopoDS_Edge& theEdge1, const Handle(Geom_Surface)& theSurface, const TopLoc_Location& theLocation) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; //TopLoc_Location aLoc; Handle(Geom2d_Curve) aCurve; gp_Pnt2d p1, p2; @@ -210,7 +212,7 @@ static void fillPoints (const BRepAdaptor_Curve& theCurve, TColgp_SequenceOfPnt& thePoints, TColStd_SequenceOfReal& theWeights) { - Standard_Real aDistPrev = 0., aDistNext; + Standard_Real aDistPrev = 0., aDistNext = NAN; gp_Pnt aPPrev (theCurve.Value (theParams (0))), aPNext; for (Standard_Integer iP = 1; iP <= theParams.Length(); ++iP) @@ -260,11 +262,11 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S, if (!ex.More()) return; // no edges .... TopoDS_Edge E = TopoDS::Edge(ex.Current()); - Standard_Real f,l,ff,ll; + Standard_Real f = NAN,l = NAN,ff = NAN,ll = NAN; Handle(Geom2d_Curve) PC,aPPC; Handle(Geom_Surface) SS; TopLoc_Location L; - Standard_Integer i = 0,j; + Standard_Integer i = 0,j = 0; // iterate on the surfaces of the first edge for(;;) { @@ -398,7 +400,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S, // ======================= Step #2 myLocation.Identity(); - Standard_Integer iPoint; + Standard_Integer iPoint = 0; math_Matrix aMat (1,3,1,3, 0.); math_Vector aVec (1,3, 0.); // Find the barycenter and normalize weights diff --git a/src/BRepLib/BRepLib_FindSurface.hxx b/src/BRepLib/BRepLib_FindSurface.hxx index dc682feee8..f717a63081 100644 --- a/src/BRepLib/BRepLib_FindSurface.hxx +++ b/src/BRepLib/BRepLib_FindSurface.hxx @@ -101,9 +101,9 @@ private: Handle(Geom_Surface) mySurface; - Standard_Real myTolerance; - Standard_Real myTolReached; - Standard_Boolean isExisted; + Standard_Real myTolerance{}; + Standard_Real myTolReached{}; + Standard_Boolean isExisted{}; TopLoc_Location myLocation; diff --git a/src/BRepLib/BRepLib_FuseEdges.cxx b/src/BRepLib/BRepLib_FuseEdges.cxx index a1b802143c..c059a452a0 100644 --- a/src/BRepLib/BRepLib_FuseEdges.cxx +++ b/src/BRepLib/BRepLib_FuseEdges.cxx @@ -19,6 +19,8 @@ // Modif : Thu Jan 21 11:40:20 1999. Add trace context #if DEB // add test to avoid loop while in NextConnexEdge (in case of a closed connex wire) +#include + #include #include #include @@ -79,7 +81,7 @@ static void BCSmoothing(Handle(Geom_BSplineCurve)& theC, theC->Multiplicities(aMults); theC->Knots(aKnots); - Standard_Integer i, m = theC->Degree(); + Standard_Integer i = 0, m = theC->Degree(); m = m - theCont; if(m < 1) return; @@ -146,7 +148,7 @@ static void MakeClosedCurve(Handle(Geom_Curve)& C, const gp_Pnt& PF, aBC->SetPeriodic(); Standard_Integer fk = aBC->FirstUKnotIndex(); Standard_Integer lk = aBC->LastUKnotIndex(); - Standard_Integer k; + Standard_Integer k = 0; Standard_Real eps = Precision::Confusion(); eps *= eps; Standard_Real porig = 2.*l; @@ -298,7 +300,7 @@ Standard_Integer BRepLib_FuseEdges::NbVertices() { Standard_NullObject_Raise_if(myShape.IsNull(),"FuseEdges : No Shape"); - Standard_Integer nbedges, nbvertices = 0; + Standard_Integer nbedges = 0, nbvertices = 0; if (!myEdgesDone) { BuildListEdges(); @@ -364,7 +366,7 @@ void BRepLib_FuseEdges::BuildListEdges() TopExp::MapShapesAndUniqueAncestors(myShape,TopAbs_VERTEX,TopAbs_EDGE,myMapVerLstEdg); TopExp::MapShapesAndAncestors(myShape,TopAbs_EDGE,TopAbs_FACE,myMapEdgLstFac); - Standard_Integer iEdg; + Standard_Integer iEdg = 0; TopTools_MapOfShape mapUniqEdg; // for each edge of myMapEdgLstFac @@ -403,7 +405,7 @@ void BRepLib_FuseEdges::BuildListResultEdges() TopoDS_Vertex VF,VL; Handle(Geom_Curve) C; TopLoc_Location loc; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; TopoDS_Edge NewEdge; myMapEdg.Clear(); @@ -730,7 +732,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, Handle(Geom_Curve) C1,C2; TopLoc_Location loc; - Standard_Real f1,l1,f2,l2; + Standard_Real f1 = NAN,l1 = NAN,f2 = NAN,l2 = NAN; Handle(Standard_Type) typC1,typC2; C1 = BRep_Tool::Curve(E1,loc,f1,l1); @@ -986,7 +988,7 @@ Standard_Boolean BRepLib_FuseEdges::UpdatePCurve(const TopoDS_Edge& theOldEdge, Handle(Geom2d_Curve) Curv2d; Handle(Geom_Surface) Surf; TopLoc_Location loc,locbid; - Standard_Real ef,el,cf,cl; + Standard_Real ef = NAN,el = NAN,cf = NAN,cl = NAN; Standard_Integer iedg = 1; // take care that we want only Pcurve that maps on the surface where the 3D edges lies. @@ -1042,7 +1044,7 @@ Standard_Boolean BRepLib_FuseEdges::UpdatePCurve(const TopoDS_Edge& theOldEdge, // update the new edge if (Curv2d->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) Curv2d = Handle(Geom2d_TrimmedCurve)::DownCast (Curv2d)->BasisCurve(); - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; f = Curv2d->FirstParameter(); l = Curv2d->LastParameter(); if (l-f + 2.* Epsilon(l-f) < el-ef) @@ -1056,7 +1058,7 @@ Standard_Boolean BRepLib_FuseEdges::UpdatePCurve(const TopoDS_Edge& theOldEdge, for (; iter.More(); iter.Next()) { TopoDS_Edge& E = TopoDS::Edge(iter.Value()); - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface( E, Surf, loc, first, last ); Handle(Geom2d_BoundedCurve) BC = Handle(Geom2d_BoundedCurve)::DownCast(C); if (BC.IsNull()) diff --git a/src/BRepLib/BRepLib_MakeEdge.cxx b/src/BRepLib/BRepLib_MakeEdge.cxx index f1ddbdcefb..c13cfe7890 100644 --- a/src/BRepLib/BRepLib_MakeEdge.cxx +++ b/src/BRepLib/BRepLib_MakeEdge.cxx @@ -17,6 +17,8 @@ // Modified: Wed Oct 23 09:17:47 1996 // check ponctuallity (PRO4896) +#include + #include #include #include @@ -65,7 +67,7 @@ static Standard_Boolean Project(const Handle(Geom_Curve)& C, GeomAdaptor_Curve GAC(C); // Afin de faire les extremas, on verifie les distances en bout - Standard_Real D1,D2; + Standard_Real D1 = NAN,D2 = NAN; gp_Pnt P1,P2; P1 = GAC.Value(GAC.FirstParameter()); P2 = GAC.Value(GAC.LastParameter()); @@ -84,8 +86,8 @@ static Standard_Boolean Project(const Handle(Geom_Curve)& C, Extrema_ExtPC extrema(P,GAC); if (extrema.IsDone()) { - Standard_Integer i, index = 0, n = extrema.NbExt(); - Standard_Real Dist2 = RealLast(), dist2min; + Standard_Integer i = 0, index = 0, n = extrema.NbExt(); + Standard_Real Dist2 = RealLast(), dist2min = NAN; for (i = 1; i <= n; i++) { dist2min = extrema.SquareDistance(i); @@ -124,7 +126,7 @@ static Standard_Boolean Project(const Handle(Geom2d_Curve)& C, Handle(GeomAdaptor_Surface) HGAHS = new GeomAdaptor_Surface (S); Adaptor3d_CurveOnSurface ACOS(HG2AHC,HGAHS); - Standard_Real D1,D2; + Standard_Real D1 = NAN,D2 = NAN; gp_Pnt P1,P2; P1 = ACOS.Value(ACOS.FirstParameter()); P2 = ACOS.Value(ACOS.LastParameter()); @@ -143,8 +145,8 @@ static Standard_Boolean Project(const Handle(Geom2d_Curve)& C, Extrema_ExtPC extrema(P,ACOS); if (extrema.IsDone()) { - Standard_Integer i, index = 0, n = extrema.NbExt(); - Standard_Real Dist2 = RealLast(), dist2min; + Standard_Integer i = 0, index = 0, n = extrema.NbExt(); + Standard_Real Dist2 = RealLast(), dist2min = NAN; for (i = 1; i <= n; i++) { dist2min = extrema.SquareDistance(i); @@ -711,7 +713,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& C, { // try projecting the vertices on the curve - Standard_Real p1,p2; + Standard_Real p1 = NAN,p2 = NAN; if (V1.IsNull()) p1 = C->FirstParameter(); @@ -986,7 +988,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom2d_Curve)& C, { // try projecting the vertices on the curve - Standard_Real p1,p2; + Standard_Real p1 = NAN,p2 = NAN; if (V1.IsNull()) p1 = C->FirstParameter(); diff --git a/src/BRepLib/BRepLib_MakeEdge2d.cxx b/src/BRepLib/BRepLib_MakeEdge2d.cxx index f04af3e5a8..b20368d45c 100644 --- a/src/BRepLib/BRepLib_MakeEdge2d.cxx +++ b/src/BRepLib/BRepLib_MakeEdge2d.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -61,7 +63,7 @@ static gp_Pnt Point(const gp_Pnt2d& P) static gp_Pnt2d Project(const TopoDS_Vertex& Ve) { gp_Pnt P = BRep_Tool::Pnt(Ve); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; ElSLib::Parameters(BRepLib::Plane()->Pln(),P,U,V); return gp_Pnt2d(U,V); } @@ -86,7 +88,7 @@ static Standard_Boolean Project(const Handle(Geom2d_Curve)& C, else { Extrema_ExtPC2d extrema(P,AC); if (extrema.IsDone()) { - Standard_Integer i,n = extrema.NbExt(); + Standard_Integer i = 0,n = extrema.NbExt(); Standard_Real d2 = RealLast(); for (i = 1; i <= n; i++) { @@ -523,7 +525,7 @@ void BRepLib_MakeEdge2d::Init(const Handle(Geom2d_Curve)& C, { // try projecting the vertices on the curve - Standard_Real p1,p2; + Standard_Real p1 = NAN,p2 = NAN; if (V1.IsNull()) p1 = C->FirstParameter(); diff --git a/src/BRepLib/BRepLib_MakeFace.cxx b/src/BRepLib/BRepLib_MakeFace.cxx index 632372c33b..69974ae073 100644 --- a/src/BRepLib/BRepLib_MakeFace.cxx +++ b/src/BRepLib/BRepLib_MakeFace.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -439,7 +441,7 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& S, { myError = BRepLib_FaceDone; if (Bound) { - Standard_Real UMin,UMax,VMin,VMax; + Standard_Real UMin = NAN,UMax = NAN,VMin = NAN,VMax = NAN; S->Bounds(UMin,UMax,VMin,VMax); Init(S,UMin,UMax,VMin,VMax,TolDegen); } @@ -532,7 +534,7 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS, Standard_Real VMin = Vm; Standard_Real VMax = VM; - Standard_Real umin,umax,vmin,vmax,T; + Standard_Real umin = NAN,umax = NAN,vmin = NAN,vmax = NAN,T = NAN; Handle(Geom_Surface) S = SS, BS = SS; Handle(Geom_RectangularTrimmedSurface) RS = @@ -612,7 +614,7 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS, // compute 3d curves and degenerate flag Standard_Real maxTol = TolDegen; Handle(Geom_Curve) Cumin,Cumax,Cvmin,Cvmax; - Standard_Boolean Dumin,Dumax,Dvmin,Dvmax; + Standard_Boolean Dumin = 0,Dumax = 0,Dvmin = 0,Dvmax = 0; Dumin = Dumax = Dvmin = Dvmax = Standard_False; Standard_Real uminTol = Precision::Confusion(), umaxTol = Precision::Confusion(), diff --git a/src/BRepLib/BRepLib_MakeShell.cxx b/src/BRepLib/BRepLib_MakeShell.cxx index e29094422b..22e2cea145 100644 --- a/src/BRepLib/BRepLib_MakeShell.cxx +++ b/src/BRepLib/BRepLib_MakeShell.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -55,7 +57,7 @@ BRepLib_MakeShell::BRepLib_MakeShell() : BRepLib_MakeShell::BRepLib_MakeShell(const Handle(Geom_Surface)& S, const Standard_Boolean Segment) { - Standard_Real UMin,UMax,VMin,VMax; + Standard_Real UMin = NAN,UMax = NAN,VMin = NAN,VMax = NAN; S->Bounds(UMin,UMax,VMin,VMax); Init(S,UMin,UMax,VMin,VMax,Segment); } @@ -115,7 +117,7 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S, TColGeom2d_Array1OfCurve uisos(1,nu+1); TColGeom2d_Array1OfCurve visos(1,nv+1); - Standard_Integer iu,iv; + Standard_Integer iu = 0,iv = 0; GS.UIntervals(upars,GeomAbs_C2); gp_Dir2d dv(0,1); @@ -356,10 +358,10 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S, myShape.Closed (BRep_Tool::IsClosed (myShape)); // Additional checking for degenerated edges - Standard_Boolean isDegenerated; - Standard_Real aFirst, aLast; + Standard_Boolean isDegenerated = 0; + Standard_Real aFirst = NAN, aLast = NAN; Standard_Real aTol = Precision::Confusion(); - Standard_Real anActTol; + Standard_Real anActTol = NAN; TopExp_Explorer anExp(myShape, TopAbs_EDGE); for ( ; anExp.More(); anExp.Next()) { diff --git a/src/BRepLib/BRepLib_MakeWire.cxx b/src/BRepLib/BRepLib_MakeWire.cxx index b91b7d0d03..54db994122 100644 --- a/src/BRepLib/BRepLib_MakeWire.cxx +++ b/src/BRepLib/BRepLib_MakeWire.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -293,13 +295,13 @@ void BRepLib_MakeWire::Add(const TopoDS_Edge& E, Standard_Boolean IsCheckGeomet for (Standard_Integer i = 1; i <= myVertices.Extent(); i++) { const TopoDS_Vertex& VW = TopoDS::Vertex(myVertices.FindKey(i)); gp_Pnt PW = BRep_Tool::Pnt(VW); - Standard_Real l = PE.Distance(PW), tolE, tolW; + Standard_Real l = PE.Distance(PW), tolE = NAN, tolW = NAN; tolW = BRep_Tool::Tolerance(VW); tolE = BRep_Tool::Tolerance(VE); if ((l < tolE) || (l < tolW)) { - Standard_Real maxtol = .5*(tolW + tolE + l), cW, cE; + Standard_Real maxtol = .5*(tolW + tolE + l), cW = NAN, cE = NAN; if(maxtol > tolW && maxtol > tolE) { cW = (maxtol - tolE)/l; cE = 1. - cW; diff --git a/src/BRepLib/BRepLib_MakeWire_1.cxx b/src/BRepLib/BRepLib_MakeWire_1.cxx index 7e3f332ecb..6dc56f1b70 100644 --- a/src/BRepLib/BRepLib_MakeWire_1.cxx +++ b/src/BRepLib/BRepLib_MakeWire_1.cxx @@ -353,7 +353,7 @@ void BRepLib_MakeWire::CreateNewListOfEdges(const TopTools_ListOfShape& theL, TopTools_ListOfShape& theNewEList) { ///create the new list (theNewEList) from the input list L - Standard_Boolean IsNewEdge; + Standard_Boolean IsNewEdge = 0; NCollection_List aVList; TopExp_Explorer exp; BRep_Builder aBB; diff --git a/src/BRepLib/BRepLib_PointCloudShape.cxx b/src/BRepLib/BRepLib_PointCloudShape.cxx index 0dcb94a095..68b62d6d82 100644 --- a/src/BRepLib/BRepLib_PointCloudShape.cxx +++ b/src/BRepLib/BRepLib_PointCloudShape.cxx @@ -205,7 +205,7 @@ Standard_Boolean BRepLib_PointCloudShape::addDensityPoints (const TopoDS_Shape& BRepTools::UVBounds (aFace, anUMin, anUMax, aVMin, aVMax); BRepTopAdaptor_FClass2d aClassifier (aFace, Precision::Confusion()); - TopLoc_Location aLoc = theFace.Location(); + const TopLoc_Location& aLoc = theFace.Location(); const gp_Trsf& aTrsf = aLoc.Transformation(); TopLoc_Location aLoc1; Handle(Geom_Surface) aSurf = BRep_Tool::Surface (aFace, aLoc1); diff --git a/src/BRepLib/BRepLib_ValidateEdge.cxx b/src/BRepLib/BRepLib_ValidateEdge.cxx index 2b55aa7c21..586a8ea7f3 100644 --- a/src/BRepLib/BRepLib_ValidateEdge.cxx +++ b/src/BRepLib/BRepLib_ValidateEdge.cxx @@ -17,6 +17,7 @@ #include #include #include +#include //============================================================================= //function : BRepLib_ValidateEdge @@ -25,8 +26,8 @@ BRepLib_ValidateEdge::BRepLib_ValidateEdge(Handle(Adaptor3d_Curve) theReferenceCurve, Handle(Adaptor3d_CurveOnSurface) theOtherCurve, Standard_Boolean theSameParameter): - myReferenceCurve(theReferenceCurve), - myOtherCurve(theOtherCurve), + myReferenceCurve(std::move(theReferenceCurve)), + myOtherCurve(std::move(theOtherCurve)), mySameParameter(theSameParameter), myControlPointsNumber(22), myToleranceForChecking(0), diff --git a/src/BRepMAT2d/BRepMAT2d_BisectingLocus.cxx b/src/BRepMAT2d/BRepMAT2d_BisectingLocus.cxx index dcbd1e4084..06806a673c 100644 --- a/src/BRepMAT2d/BRepMAT2d_BisectingLocus.cxx +++ b/src/BRepMAT2d/BRepMAT2d_BisectingLocus.cxx @@ -65,7 +65,7 @@ void BRepMAT2d_BisectingLocus::Compute(BRepMAT2d_Explorer& anExplo, MAT2d_Mat2d TheMAT( IsOpenResult ); Handle(MAT_ListOfBisector) TheRoots = new MAT_ListOfBisector(); MAT2d_SequenceOfSequenceOfGeometry Figure; - Standard_Integer i; + Standard_Integer i = 0; nbSect.Clear(); theGraph = new MAT_Graph(); @@ -169,10 +169,10 @@ void BRepMAT2d_BisectingLocus::RenumerationAndFusion Standard_Integer& IndexLast, MAT_DataMapOfIntegerBasicElt& NewMap) { - Standard_Integer IndFirst; - Standard_Integer i,j; - Standard_Integer GeomIndexArc1,GeomIndexArc2,GeomIndexArc3,GeomIndexArc4; - Standard_Boolean MergeArc1,MergeArc2; + Standard_Integer IndFirst = 0; + Standard_Integer i = 0,j = 0; + Standard_Integer GeomIndexArc1 = 0,GeomIndexArc2 = 0,GeomIndexArc3 = 0,GeomIndexArc4 = 0; + Standard_Boolean MergeArc1 = 0,MergeArc2 = 0; for ( i = 1; i <= LengthLine; i++) { const TColStd_SequenceOfInteger& S = theTool.Circuit()->RefToEqui(ILine,i); @@ -259,7 +259,7 @@ Handle(MAT_BasicElt) BRepMAT2d_BisectingLocus::BasicElt const Standard_Integer Index ) const { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer Ind = Index; for (i = 1 ; i < IndLine ; i++){ @@ -323,9 +323,9 @@ static void CutSketch (MAT2d_SequenceOfSequenceOfGeometry& Figure, MAT2d_DataMapOfBiIntInteger& NbSect) { MAT2d_CutCurve Cuter; - Standard_Integer i,j,k,ico; - Standard_Integer ICurveInit; - Standard_Integer NbSection; + Standard_Integer i = 0,j = 0,k = 0,ico = 0; + Standard_Integer ICurveInit = 0; + Standard_Integer NbSection = 0; for ( i = 1; i <= Figure.Length(); i++) { TColGeom2d_SequenceOfGeometry& Contour = Figure.ChangeValue(i); diff --git a/src/BRepMAT2d/BRepMAT2d_Explorer.cxx b/src/BRepMAT2d/BRepMAT2d_Explorer.cxx index 32ba12c3be..e1e4948759 100644 --- a/src/BRepMAT2d/BRepMAT2d_Explorer.cxx +++ b/src/BRepMAT2d/BRepMAT2d_Explorer.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -132,7 +134,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, TopoDS_Edge aFirstEdge = anExp.Current(); TopoDS_Edge aPrevEdge = aFirstEdge; - Standard_Real UFirst,ULast, aD; + Standard_Real UFirst = NAN,ULast = NAN, aD = NAN; Handle(Geom2d_Curve) C2d; Handle(Geom2d_TrimmedCurve) CT2d; Handle(Geom2d_TrimmedCurve) aFirstCurve; @@ -163,7 +165,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, // Treatment of the next edges: for (; anExp.More(); anExp.Next()) { - TopoDS_Edge anEdge = anExp.Current(); + const TopoDS_Edge& anEdge = anExp.Current(); anOldNewE.Add(anEdge, anEdge); C2d = BRep_Tool::CurveOnSurface (anEdge, aFace, UFirst, ULast); @@ -294,7 +296,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, BRep_Builder aBuilder; if (isModif) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer aNbEdges = anOldNewE.Extent(); aBuilder.MakeWire(aNewWire); diff --git a/src/BRepMAT2d/BRepMAT2d_Explorer.hxx b/src/BRepMAT2d/BRepMAT2d_Explorer.hxx index 9c530d1822..19a704f3e0 100644 --- a/src/BRepMAT2d/BRepMAT2d_Explorer.hxx +++ b/src/BRepMAT2d/BRepMAT2d_Explorer.hxx @@ -121,8 +121,8 @@ private: MAT2d_SequenceOfSequenceOfCurve theCurves; - Standard_Integer current; - Standard_Integer currentContour; + Standard_Integer current{}; + Standard_Integer currentContour{}; TopoDS_Shape myShape; TColStd_SequenceOfBoolean myIsClosed; TopTools_IndexedDataMapOfShapeShape myModifShapes; diff --git a/src/BRepMAT2d/BRepMAT2d_LinkTopoBilo.cxx b/src/BRepMAT2d/BRepMAT2d_LinkTopoBilo.cxx index b28b253baa..2ac41ad384 100644 --- a/src/BRepMAT2d/BRepMAT2d_LinkTopoBilo.cxx +++ b/src/BRepMAT2d/BRepMAT2d_LinkTopoBilo.cxx @@ -164,7 +164,7 @@ void BRepMAT2d_LinkTopoBilo::LinkToWire(const TopoDS_Wire& W, const BRepMAT2d_BisectingLocus& BiLo) { BRepTools_WireExplorer TheExp (W); - Standard_Integer KC; + Standard_Integer KC = 0; TopoDS_Vertex VF,VL; TopoDS_Shape S; Handle(MAT_BasicElt) BE; @@ -234,7 +234,7 @@ void LinkToContour (const BRepMAT2d_Explorer& Explo, Handle (Standard_Type) Type; Standard_Boolean DirectSense = Standard_True; Standard_Boolean LastPoint = Standard_False; - Standard_Integer NbSect,ISect; + Standard_Integer NbSect = 0,ISect = 0; //--------------------------------------------------- // NbSect : number of sections on the current curve. diff --git a/src/BRepMAT2d/BRepMAT2d_LinkTopoBilo.hxx b/src/BRepMAT2d/BRepMAT2d_LinkTopoBilo.hxx index 98ff365f5a..77e1ead67c 100644 --- a/src/BRepMAT2d/BRepMAT2d_LinkTopoBilo.hxx +++ b/src/BRepMAT2d/BRepMAT2d_LinkTopoBilo.hxx @@ -88,8 +88,8 @@ private: BRepMAT2d_DataMapOfShapeSequenceOfBasicElt myMap; BRepMAT2d_DataMapOfBasicEltShape myBEShape; TopoDS_Shape myKey; - Standard_Integer current; - Standard_Boolean isEmpty; + Standard_Integer current{}; + Standard_Boolean isEmpty{}; }; diff --git a/src/BRepMesh/BRepMesh_BaseMeshAlgo.cxx b/src/BRepMesh/BRepMesh_BaseMeshAlgo.cxx index da37dfca9b..47e77f86b6 100644 --- a/src/BRepMesh/BRepMesh_BaseMeshAlgo.cxx +++ b/src/BRepMesh/BRepMesh_BaseMeshAlgo.cxx @@ -182,7 +182,7 @@ Standard_Integer BRepMesh_BaseMeshAlgo::addLinkToMesh( const Standard_Integer theLastNodeId, const TopAbs_Orientation theOrientation) { - Standard_Integer aLinkIndex; + Standard_Integer aLinkIndex = 0; if (theOrientation == TopAbs_REVERSED) aLinkIndex = myStructure->AddLink(BRepMesh_Edge(theLastNodeId, theFirstNodeId, BRepMesh_Frontier)); else if (theOrientation == TopAbs_INTERNAL) diff --git a/src/BRepMesh/BRepMesh_CircleTool.cxx b/src/BRepMesh/BRepMesh_CircleTool.cxx index 67aa20ee60..9fa2370fab 100644 --- a/src/BRepMesh/BRepMesh_CircleTool.cxx +++ b/src/BRepMesh/BRepMesh_CircleTool.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -147,7 +149,7 @@ Standard_Boolean BRepMesh_CircleTool::Bind(const Standard_Integer theIndex, const gp_XY& thePoint3) { gp_XY aLocation; - Standard_Real aRadius; + Standard_Real aRadius = NAN; if (!MakeCircle(thePoint1, thePoint2, thePoint3, aLocation, aRadius)) return Standard_False; diff --git a/src/BRepMesh/BRepMesh_Classifier.cxx b/src/BRepMesh/BRepMesh_Classifier.cxx index 30f853cb84..7a8e349bfc 100644 --- a/src/BRepMesh/BRepMesh_Classifier.cxx +++ b/src/BRepMesh/BRepMesh_Classifier.cxx @@ -88,7 +88,7 @@ void BRepMesh_Classifier::RegisterWire( // Accumulate angle TColgp_Array1OfPnt2d aPClass(1, aNbPnts); Standard_Real anAngle = 0.0; - const gp_Pnt2d *p1 = theWire(1), *p2 = theWire(2), *p3; + const gp_Pnt2d *p1 = theWire(1), *p2 = theWire(2), *p3 = nullptr; aPClass(1) = *p1; aPClass(2) = *p2; diff --git a/src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx b/src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx index cc61eedb9d..5cf3606d9a 100644 --- a/src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -35,7 +37,7 @@ std::pair BRepMesh_ConeRangeSplitter::GetSplitStep Standard_Real aRadius = Max(Abs(aRefR + aRangeV.first * Sin(aSAng)), Abs(aRefR + aRangeV.second * Sin(aSAng))); - Standard_Real Dv, Du = GCPnts_TangentialDeflection::ArcAngularStep( + Standard_Real Dv = NAN, Du = GCPnts_TangentialDeflection::ArcAngularStep( aRadius, GetDFace()->GetDeflection(), theParameters.Angle, theParameters.MinSize); diff --git a/src/BRepMesh/BRepMesh_CurveTessellator.cxx b/src/BRepMesh/BRepMesh_CurveTessellator.cxx index c8e942ec3a..8bb71c4a00 100644 --- a/src/BRepMesh/BRepMesh_CurveTessellator.cxx +++ b/src/BRepMesh/BRepMesh_CurveTessellator.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -183,7 +185,7 @@ void BRepMesh_CurveTessellator::splitByDeflection2d () const TopoDS_Edge aCurrEdge = TopoDS::Edge(myEdge.Oriented(aPCurve->GetOrientation())); - Standard_Real aF, aL; + Standard_Real aF = NAN, aL = NAN; Handle (Geom2d_Curve) aCurve2d = BRep_Tool::CurveOnSurface (aCurrEdge, aFace, aF, aL); TColStd_Array1OfReal aParamArray (1, aNodesNb); for (Standard_Integer i = 1; i <= aNodesNb; ++i) @@ -305,7 +307,7 @@ void BRepMesh_CurveTessellator::splitSegment ( gp_Pnt2d uvf, uvl, uvm; gp_Pnt P3dF, P3dL, midP3d, midP3dFromSurf; - Standard_Real midpar; + Standard_Real midpar = NAN; if (Abs(theLast - theFirst) < 2 * Precision::PConfusion()) { diff --git a/src/BRepMesh/BRepMesh_CurveTessellator.hxx b/src/BRepMesh/BRepMesh_CurveTessellator.hxx index d9406a8423..a5386b31be 100644 --- a/src/BRepMesh/BRepMesh_CurveTessellator.hxx +++ b/src/BRepMesh/BRepMesh_CurveTessellator.hxx @@ -102,11 +102,11 @@ private: GCPnts_TangentialDeflection myDiscretTool; TopoDS_Vertex myFirstVertex; TopoDS_Vertex myLastVertex; - Standard_Real mySquareEdgeDef; - Standard_Real mySquareMinSize; - Standard_Real myEdgeSqTol; - Standard_Real myFaceRangeU[2]; - Standard_Real myFaceRangeV[2]; + Standard_Real mySquareEdgeDef{}; + Standard_Real mySquareMinSize{}; + Standard_Real myEdgeSqTol{}; + Standard_Real myFaceRangeU[2]{}; + Standard_Real myFaceRangeV[2]{}; }; #endif \ No newline at end of file diff --git a/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx b/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx index dee351928b..b84600cc25 100644 --- a/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -162,8 +164,8 @@ Standard_Real BRepMesh_DefaultRangeSplitter::computeLengthU() Standard_Real du = 0.05 * (myRangeU.second - myRangeU.first); Standard_Real dfvave = 0.5 * (myRangeV.second + myRangeV.first); - Standard_Real dfucur; - Standard_Integer i1; + Standard_Real dfucur = NAN; + Standard_Integer i1 = 0; const Handle(BRepAdaptor_Surface)& gFace = GetSurface(); gFace->D0(myRangeU.first, myRangeV.first, P11); @@ -194,8 +196,8 @@ Standard_Real BRepMesh_DefaultRangeSplitter::computeLengthV() Standard_Real dv = 0.05 * (myRangeV.second - myRangeV.first); Standard_Real dfuave = 0.5 * (myRangeU.second + myRangeU.first); - Standard_Real dfvcur; - Standard_Integer i1; + Standard_Real dfvcur = NAN; + Standard_Integer i1 = 0; const Handle(BRepAdaptor_Surface)& gFace = GetSurface(); gFace->D0(myRangeU.first, myRangeV.first, P11); diff --git a/src/BRepMesh/BRepMesh_Deflection.cxx b/src/BRepMesh/BRepMesh_Deflection.cxx index 7e274d7b01..2980861266 100644 --- a/src/BRepMesh/BRepMesh_Deflection.cxx +++ b/src/BRepMesh/BRepMesh_Deflection.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -47,7 +49,7 @@ Standard_Real BRepMesh_Deflection::ComputeAbsoluteDeflection( // Adjust resulting value in relation to the total size - Standard_Real aX1, aY1, aZ1, aX2, aY2, aZ2; + Standard_Real aX1 = NAN, aY1 = NAN, aZ1 = NAN, aX2 = NAN, aY2 = NAN, aZ2 = NAN; aBox.Get(aX1, aY1, aZ1, aX2, aY2, aZ2); const Standard_Real aMaxShapeSize = (theMaxShapeSize > 0.0) ? theMaxShapeSize : Max(aX2 - aX1, Max(aY2 - aY1, aZ2 - aZ1)); @@ -87,7 +89,7 @@ void BRepMesh_Deflection::ComputeDeflection ( TopExp::Vertices(anEdge, aFirstVertex, aLastVertex); Handle(Geom_Curve) aCurve; - Standard_Real aFirstParam, aLastParam; + Standard_Real aFirstParam = NAN, aLastParam = NAN; if (BRepMesh_ShapeTool::Range(anEdge, aCurve, aFirstParam, aLastParam)) { const Standard_Real aDistF = aFirstVertex.IsNull() ? -1.0 : diff --git a/src/BRepMesh/BRepMesh_Delaun.cxx b/src/BRepMesh/BRepMesh_Delaun.cxx index 0aa1eeb2ba..a0e7febd1f 100644 --- a/src/BRepMesh/BRepMesh_Delaun.cxx +++ b/src/BRepMesh/BRepMesh_Delaun.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -226,7 +228,7 @@ void BRepMesh_Delaun::initCirclesTool (const Bnd_Box2d& theBox, const Standard_Integer theCellsCountU, const Standard_Integer theCellsCountV) { - Standard_Real aMinX, aMinY, aMaxX, aMaxY; + Standard_Real aMinX = NAN, aMinY = NAN, aMaxX = NAN, aMaxY = NAN; theBox.Get ( aMinX, aMinY, aMaxX, aMaxY ); const Standard_Real aDeltaX = aMaxX - aMinX; const Standard_Real aDeltaY = aMaxY - aMinY; @@ -287,7 +289,7 @@ void BRepMesh_Delaun::perform(IMeshData::VectorOfInteger& theVertexIndices, //======================================================================= void BRepMesh_Delaun::superMesh(const Bnd_Box2d& theBox) { - Standard_Real aMinX, aMinY, aMaxX, aMaxY; + Standard_Real aMinX = NAN, aMinY = NAN, aMaxX = NAN, aMaxY = NAN; theBox.Get ( aMinX, aMinY, aMaxX, aMaxY ); Standard_Real aDeltaX = aMaxX - aMinX; Standard_Real aDeltaY = aMaxY - aMinY; @@ -548,7 +550,7 @@ void BRepMesh_Delaun::createTrianglesOnNewVertices( Handle(NCollection_IncAllocator) aAllocator = new NCollection_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE); - Standard_Real aTolU, aTolV; + Standard_Real aTolU = NAN, aTolV = NAN; myMeshData->Data()->GetTolerance(aTolU, aTolV); const Standard_Real aSqTol = aTolU * aTolU + aTolV * aTolV; @@ -979,7 +981,7 @@ Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf( const BRepMesh_Edge& aRefEdge = GetEdge( theStartEdgeId ); IMeshData::SequenceOfInteger aPolygon; - Standard_Integer aStartNode, aPivotNode; + Standard_Integer aStartNode = 0, aPivotNode = 0; if ( isForward ) { aPolygon.Append( theStartEdgeId ); @@ -1103,7 +1105,7 @@ Standard_Integer BRepMesh_Delaun::findNextPolygonLink( const gp_Vec2d& theRefLinkDir, const IMeshData::SequenceOfBndB2d& theBoxes, const IMeshData::SequenceOfInteger& thePolygon, - const Handle(IMeshData::MapOfInteger) theSkipped, + const Handle(IMeshData::MapOfInteger)& theSkipped, const Standard_Boolean& isSkipLeprous, IMeshData::MapOfInteger& theLeprousLinks, IMeshData::MapOfInteger& theDeadLinks, @@ -2182,14 +2184,14 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex ) { const BRepMesh_Edge& anEdge = GetEdge( aLoopEdgesIt.Key() ); Standard_Integer aFirstNode = anEdge.FirstNode(); - Standard_Integer aLastNode; + Standard_Integer aLastNode = 0; Standard_Integer aPivotNode = anEdge.LastNode(); Standard_Integer anEdgeId = aLoopEdgesIt.Key(); Standard_Boolean isPositive = aLoopEdges( anEdgeId ) != 0; if ( !isPositive ) { - Standard_Integer aTmp; + Standard_Integer aTmp = 0; aTmp = aFirstNode; aFirstNode = aPivotNode; aPivotNode = aTmp; @@ -2212,7 +2214,7 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex ) if ( aLinkIt.Value() != anEdgeId && aLoopEdges.IsBound( aLinkIt.Value() ) ) { - Standard_Integer aCurrentNode; + Standard_Integer aCurrentNode = 0; anEdgeId = aLinkIt.Value(); const BRepMesh_Edge& anEdge1 = GetEdge( anEdgeId ); @@ -2446,8 +2448,8 @@ Standard_Boolean BRepMesh_Delaun::Contains( const Standard_Integer theTriangleId Standard_Real aDistance[3]; Standard_Real aSqModulus[3]; - Standard_Real aSqMinDist; - Standard_Integer aEdgeOnId; + Standard_Real aSqMinDist = NAN; + Standard_Integer aEdgeOnId = 0; aSqMinDist = calculateDist( aVEdges, aPoints, theVertex, aDistance, aSqModulus, aEdgeOnId ); if ( aSqMinDist < 0 ) return Standard_False; diff --git a/src/BRepMesh/BRepMesh_Delaun.hxx b/src/BRepMesh/BRepMesh_Delaun.hxx old mode 100755 new mode 100644 index fb575548b2..810659092c --- a/src/BRepMesh/BRepMesh_Delaun.hxx +++ b/src/BRepMesh/BRepMesh_Delaun.hxx @@ -214,7 +214,7 @@ private: const gp_Vec2d& theRefLinkDir, const IMeshData::SequenceOfBndB2d& theBoxes, const IMeshData::SequenceOfInteger& thePolygon, - const Handle(IMeshData::MapOfInteger) theSkipped, + const Handle(IMeshData::MapOfInteger)& theSkipped, const Standard_Boolean& isSkipLeprous, IMeshData::MapOfInteger& theLeprousLinks, IMeshData::MapOfInteger& theDeadLinks, diff --git a/src/BRepMesh/BRepMesh_EdgeDiscret.cxx b/src/BRepMesh/BRepMesh_EdgeDiscret.cxx index 31c7963c59..803ede971e 100644 --- a/src/BRepMesh/BRepMesh_EdgeDiscret.cxx +++ b/src/BRepMesh/BRepMesh_EdgeDiscret.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -258,7 +260,7 @@ void BRepMesh_EdgeDiscret::Tessellate3d( if (theUpdateEnds) { gp_Pnt aPoint; - Standard_Real aParam; + Standard_Real aParam = NAN; theTessellator->Value(1, aPoint, aParam); aCurve->AddPoint(BRep_Tool::Pnt(aFirstVertex), aParam); } @@ -268,7 +270,7 @@ void BRepMesh_EdgeDiscret::Tessellate3d( for (Standard_Integer i = 2; i < theTessellator->PointsNb(); ++i) { gp_Pnt aPoint; - Standard_Real aParam; + Standard_Real aParam = NAN; if (!theTessellator->Value(i, aPoint, aParam)) continue; @@ -286,7 +288,7 @@ void BRepMesh_EdgeDiscret::Tessellate3d( if (theUpdateEnds) { gp_Pnt aPoint; - Standard_Real aParam; + Standard_Real aParam = NAN; theTessellator->Value(theTessellator->PointsNb(), aPoint, aParam); aCurve->AddPoint(BRep_Tool::Pnt(aLastVertex), aParam); } @@ -311,7 +313,7 @@ void BRepMesh_EdgeDiscret::Tessellate2d( const Handle(Adaptor2d_Curve2d)& aGeomPCurve = aProvider.GetPCurve(); - Standard_Integer aParamIdx, aParamNb; + Standard_Integer aParamIdx = 0, aParamNb = 0; if (theUpdateEnds) { aParamIdx = 0; diff --git a/src/BRepMesh/BRepMesh_FaceChecker.cxx b/src/BRepMesh/BRepMesh_FaceChecker.cxx index b78238d692..32563d78bf 100644 --- a/src/BRepMesh/BRepMesh_FaceChecker.cxx +++ b/src/BRepMesh/BRepMesh_FaceChecker.cxx @@ -132,13 +132,13 @@ namespace } //! Indicates should the given box be rejected or not. - virtual Standard_Boolean Reject(const Bnd_Box2d& theBox) const + Standard_Boolean Reject(const Bnd_Box2d& theBox) const override { return myBox.IsOut(theBox); } //! Accepts segment with the given index in case if it fits conditions. - virtual Standard_Boolean Accept(const Standard_Integer& theSegmentIndex) + Standard_Boolean Accept(const Standard_Integer& theSegmentIndex) override { const BRepMesh_FaceChecker::Segment& aSegment = mySegments->Value(theSegmentIndex); diff --git a/src/BRepMesh/BRepMesh_GeomTool.cxx b/src/BRepMesh/BRepMesh_GeomTool.cxx index ffa7649433..b5e0519486 100644 --- a/src/BRepMesh/BRepMesh_GeomTool.cxx +++ b/src/BRepMesh/BRepMesh_GeomTool.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -210,7 +212,7 @@ Standard_Boolean BRepMesh_GeomTool::Value( const TopoDS_Face& aFace = theSurface->Face(); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(*myEdge, aFace, aFirst, aLast); @@ -445,14 +447,14 @@ std::pair BRepMesh_GeomTool::CellsCount ( const GeomAbs_SurfaceType aType = theSurface->GetType (); - Standard_Real anErrFactorU, anErrFactorV; + Standard_Real anErrFactorU = NAN, anErrFactorV = NAN; ComputeErrFactors(theDeflection, theSurface, anErrFactorU, anErrFactorV); const std::pair& aRangeU = theRangeSplitter->GetRangeU(); const std::pair& aRangeV = theRangeSplitter->GetRangeV(); const std::pair& aDelta = theRangeSplitter->GetDelta (); - Standard_Integer aCellsCountU, aCellsCountV; + Standard_Integer aCellsCountU = 0, aCellsCountV = 0; if (aType == GeomAbs_Torus) { aCellsCountU = (Standard_Integer)Ceiling(Pow(2, Log10( diff --git a/src/BRepMesh/BRepMesh_IncrementalMesh.hxx b/src/BRepMesh/BRepMesh_IncrementalMesh.hxx index 3853c84075..71d0f5f4d5 100644 --- a/src/BRepMesh/BRepMesh_IncrementalMesh.hxx +++ b/src/BRepMesh/BRepMesh_IncrementalMesh.hxx @@ -144,8 +144,8 @@ public: //! @name plugin API protected: IMeshTools_Parameters myParameters; - Standard_Boolean myModified; - Standard_Integer myStatus; + Standard_Boolean myModified{}; + Standard_Integer myStatus{}; }; #endif diff --git a/src/BRepMesh/BRepMesh_ModelBuilder.cxx b/src/BRepMesh/BRepMesh_ModelBuilder.cxx index 79c25f8de9..57bf0404e6 100644 --- a/src/BRepMesh/BRepMesh_ModelBuilder.cxx +++ b/src/BRepMesh/BRepMesh_ModelBuilder.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -60,7 +62,7 @@ Handle (IMeshData_Model) BRepMesh_ModelBuilder::performInternal ( if (theParameters.Relative) { - Standard_Real aMaxSize; + Standard_Real aMaxSize = NAN; BRepMesh_ShapeTool::BoxMaxDimension (aBox, aMaxSize); aModel->SetMaxSize(aMaxSize); } diff --git a/src/BRepMesh/BRepMesh_ModelPreProcessor.cxx b/src/BRepMesh/BRepMesh_ModelPreProcessor.cxx index e987376b2c..66be29774c 100644 --- a/src/BRepMesh/BRepMesh_ModelPreProcessor.cxx +++ b/src/BRepMesh/BRepMesh_ModelPreProcessor.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -186,7 +188,7 @@ namespace TopoDS_Edge aE = theDEdge->GetEdge(); const TopoDS_Face& aF = theDFace->GetFace(); - Standard_Real aFParam, aLParam; + Standard_Real aFParam = NAN, aLParam = NAN; Handle(Geom_Curve) aHC = BRep_Tool::Curve (aE, aFParam, aLParam); @@ -212,7 +214,7 @@ namespace // Define two pcurves of the seam-edge. Handle(Geom2d_Curve) aPC1, aPC2; - Standard_Real af, al; + Standard_Real af = NAN, al = NAN; aE.Orientation (TopAbs_FORWARD); aPC1 = BRep_Tool::CurveOnSurface (aE, aF, af, al); diff --git a/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx b/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx index 0f78d5e924..809dce4efd 100644 --- a/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -57,7 +59,7 @@ namespace { myParameters = theParameters; - Standard_Integer aStartIndex, aEndIndex; + Standard_Integer aStartIndex = 0, aEndIndex = 0; if (myIsoU) { aStartIndex = 1; @@ -589,7 +591,7 @@ Handle(IMeshData::SequenceOfReal) BRepMesh_NURBSRangeSplitter::filterParameters( } TColStd_Array1OfReal aParamArray(1, anInitLen); - Standard_Integer j; + Standard_Integer j = 0; for (j = 1; j <= anInitLen; j++) aParamArray(j) = theParams(j); @@ -607,7 +609,7 @@ Handle(IMeshData::SequenceOfReal) BRepMesh_NURBSRangeSplitter::filterParameters( } //perform filtering on series - Standard_Real aLastAdded, aLastCandidate; + Standard_Real aLastAdded = NAN, aLastCandidate = NAN; Standard_Boolean isCandidateDefined = Standard_False; aLastAdded = aParamArray(1); aLastCandidate = aLastAdded; diff --git a/src/BRepMesh/BRepMesh_ShapeTool.cxx b/src/BRepMesh/BRepMesh_ShapeTool.cxx index bb3f924d2f..a90321be4c 100644 --- a/src/BRepMesh/BRepMesh_ShapeTool.cxx +++ b/src/BRepMesh/BRepMesh_ShapeTool.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -89,7 +91,7 @@ void BRepMesh_ShapeTool::BoxMaxDimension(const Bnd_Box& theBox, if (theBox.IsVoid()) return; - Standard_Real aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ; + Standard_Real aMinX = NAN, aMinY = NAN, aMinZ = NAN, aMaxX = NAN, aMaxY = NAN, aMaxZ = NAN; theBox.Get(aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ); theMaxDimension = Max(aMaxX - aMinX, Max(aMaxY - aMinY, aMaxZ - aMinZ)); @@ -115,7 +117,7 @@ void BRepMesh_ShapeTool::CheckAndUpdateFlags ( const TopoDS_Face& aFace = thePCurve->GetFace ()->GetFace (); Handle (Geom_Curve) aCurve; - Standard_Real aFirstParam, aLastParam; + Standard_Real aFirstParam = NAN, aLastParam = NAN; Range (aEdge, aCurve, aFirstParam, aLastParam); if (aCurve.IsNull()) { @@ -326,7 +328,7 @@ Standard_Boolean BRepMesh_ShapeTool::UVPoints ( { Handle (Geom2d_Curve) aCurve2d; - Standard_Real aFirstParam, aLastParam; + Standard_Real aFirstParam = NAN, aLastParam = NAN; if (!Range(theEdge, theFace, aCurve2d, aFirstParam, aLastParam, isConsiderOrientation)) { return Standard_False; diff --git a/src/BRepMesh/BRepMesh_TorusRangeSplitter.cxx b/src/BRepMesh/BRepMesh_TorusRangeSplitter.cxx index 455a473aba..914d082369 100644 --- a/src/BRepMesh/BRepMesh_TorusRangeSplitter.cxx +++ b/src/BRepMesh/BRepMesh_TorusRangeSplitter.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -42,7 +44,7 @@ Handle(IMeshData::ListOfPnt2d) BRepMesh_TorusRangeSplitter::GenerateSurfaceNodes const Standard_Integer nbV = Max((Standard_Integer) (aDiffV / Dv), 2); Dv = aDiffV / (nbV + 1); - Standard_Real Du; + Standard_Real Du = NAN; const Standard_Real ru = R + r; if (ru > 1.e-16) { @@ -188,8 +190,8 @@ Handle(IMeshData::SequenceOfReal) BRepMesh_TorusRangeSplitter::fillParams( Standard_Real BRepMesh_TorusRangeSplitter::FUN_CalcAverageDUV( TColStd_Array1OfReal& P, const Standard_Integer PLen) const { - Standard_Integer i, j, n = 0; - Standard_Real p, result = 0.; + Standard_Integer i = 0, j = 0, n = 0; + Standard_Real p = NAN, result = 0.; for (i = 1; i <= PLen; i++) { diff --git a/src/BRepMesh/BRepMesh_VertexTool.cxx b/src/BRepMesh/BRepMesh_VertexTool.cxx index 3393f92497..33e758b7e4 100644 --- a/src/BRepMesh/BRepMesh_VertexTool.cxx +++ b/src/BRepMesh/BRepMesh_VertexTool.cxx @@ -33,7 +33,7 @@ NCollection_CellFilter_Action BRepMesh_VertexInspector::Inspect( } gp_XY aVec = (myPoint - aVertex.Coord()); - Standard_Boolean inTol; + Standard_Boolean inTol = 0; if (Abs(myTolerance[1]) < Precision::Confusion()) { inTol = aVec.SquareModulus() < myTolerance[0]; diff --git a/src/BRepMesh/BRepMesh_VertexTool.hxx b/src/BRepMesh/BRepMesh_VertexTool.hxx index 68abb52863..d2c66c1aee 100644 --- a/src/BRepMesh/BRepMesh_VertexTool.hxx +++ b/src/BRepMesh/BRepMesh_VertexTool.hxx @@ -179,7 +179,7 @@ private: Handle(NCollection_IncAllocator) myAllocator; IMeshData::VertexCellFilter myCellFilter; BRepMesh_VertexInspector mySelector; - Standard_Real myTolerance[2]; + Standard_Real myTolerance[2]{}; }; #endif diff --git a/src/BRepMesh/delabella.cpp b/src/BRepMesh/delabella.cpp index c4b6f9cfb4..cb068d411f 100644 --- a/src/BRepMesh/delabella.cpp +++ b/src/BRepMesh/delabella.cpp @@ -89,7 +89,7 @@ struct Vect Norm cross (const Vect& v) const // cross prod { - Norm n; + Norm n{}; n.x = (Signed45)y*v.z - (Signed45)z*v.y; n.y = (Signed45)z*v.x - (Signed45)x*v.z; n.z = (Signed29)x*v.y - (Signed29)y*v.x; @@ -108,7 +108,7 @@ struct CDelaBella : IDelaBella Vect operator - (const Vert& v) const // diff { - Vect d; + Vect d{}; d.x = (Signed15)x - (Signed15)v.x; d.y = (Signed15)y - (Signed15)v.y; d.z = (Signed29)z - (Signed29)v.z; @@ -192,20 +192,20 @@ struct CDelaBella : IDelaBella } }; - Vert* vert_alloc; - Face* face_alloc; - int max_verts; - int max_faces; + Vert* vert_alloc{}; + Face* face_alloc{}; + int max_verts{}; + int max_faces{}; - Face* first_dela_face; - Face* first_hull_face; - Vert* first_hull_vert; + Face* first_dela_face{}; + Face* first_hull_face{}; + Vert* first_hull_vert{}; - int inp_verts; - int out_verts; + int inp_verts{}; + int out_verts{}; - int(*errlog_proc)(void* file, const char* fmt, ...); - void* errlog_file; + int(*errlog_proc)(void* file, const char* fmt, ...){}; + void* errlog_file{}; virtual ~CDelaBella () { @@ -294,7 +294,7 @@ struct CDelaBella : IDelaBella Face* cache = face_alloc; Face* hull = 0; - Face f; // tmp + Face f{}; // tmp f.v[0] = vert_alloc + 0; f.v[1] = vert_alloc + 1; f.v[2] = vert_alloc + 2; @@ -835,7 +835,7 @@ struct CDelaBella : IDelaBella return true; } - virtual int Triangulate(int points, const float* x, const float* y = 0, int advance_bytes = 0) + int Triangulate(int points, const float* x, const float* y = 0, int advance_bytes = 0) override { if (!x) return 0; @@ -862,7 +862,7 @@ struct CDelaBella : IDelaBella return out_verts; } - virtual int Triangulate(int points, const double* x, const double* y, int advance_bytes) + int Triangulate(int points, const double* x, const double* y, int advance_bytes) override { if (!x) return 0; @@ -889,7 +889,7 @@ struct CDelaBella : IDelaBella return out_verts; } - virtual void Destroy() + void Destroy() override { if (face_alloc) free(face_alloc); @@ -899,33 +899,33 @@ struct CDelaBella : IDelaBella } // num of points passed to last call to Triangulate() - virtual int GetNumInputPoints() const + int GetNumInputPoints() const override { return inp_verts; } // num of verts returned from last call to Triangulate() - virtual int GetNumOutputVerts() const + int GetNumOutputVerts() const override { return out_verts; } - virtual const DelaBella_Triangle* GetFirstDelaunayTriangle() const + const DelaBella_Triangle* GetFirstDelaunayTriangle() const override { return first_dela_face; } - virtual const DelaBella_Triangle* GetFirstHullTriangle() const + const DelaBella_Triangle* GetFirstHullTriangle() const override { return first_hull_face; } - virtual const DelaBella_Vertex* GetFirstHullVertex() const + const DelaBella_Vertex* GetFirstHullVertex() const override { return first_hull_vert; } - virtual void SetErrLog(int(*proc)(void* stream, const char* fmt, ...), void* stream) + void SetErrLog(int(*proc)(void* stream, const char* fmt, ...), void* stream) override { errlog_proc = proc; errlog_file = stream; diff --git a/src/BRepPrim/BRepPrim_Cone.hxx b/src/BRepPrim/BRepPrim_Cone.hxx index ef1270d2f2..a40de6ee16 100644 --- a/src/BRepPrim/BRepPrim_Cone.hxx +++ b/src/BRepPrim/BRepPrim_Cone.hxx @@ -96,8 +96,8 @@ private: Standard_EXPORT void SetParameters (const Standard_Real R1, const Standard_Real R2, const Standard_Real H); - Standard_Real myHalfAngle; - Standard_Real myRadius; + Standard_Real myHalfAngle{}; + Standard_Real myRadius{}; }; diff --git a/src/BRepPrim/BRepPrim_FaceBuilder.cxx b/src/BRepPrim/BRepPrim_FaceBuilder.cxx index 70be550200..2c80646b50 100644 --- a/src/BRepPrim/BRepPrim_FaceBuilder.cxx +++ b/src/BRepPrim/BRepPrim_FaceBuilder.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -72,7 +74,7 @@ BRepPrim_FaceBuilder::BRepPrim_FaceBuilder(const BRep_Builder& B, void BRepPrim_FaceBuilder::Init(const BRep_Builder& B, const Handle(Geom_Surface)& S) { - Standard_Real UMin,UMax,VMin,VMax; + Standard_Real UMin = NAN,UMax = NAN,VMin = NAN,VMax = NAN; S->Bounds(UMin,UMax,VMin,VMax); Init(B,S,UMin,UMax,VMin,VMax); } @@ -90,7 +92,7 @@ void BRepPrim_FaceBuilder::Init(const BRep_Builder& B, const Standard_Real VMax) { // Check the values - Standard_Real USMin,USMax,VSMin,VSMax; + Standard_Real USMin = NAN,USMax = NAN,VSMin = NAN,VSMax = NAN; S->Bounds(USMin,USMax,VSMin,VSMax); if (UMin >= UMax) throw Standard_ConstructionError("BRepPrim_FaceBuilder"); diff --git a/src/BRepPrim/BRepPrim_GWedge.cxx b/src/BRepPrim/BRepPrim_GWedge.cxx index c8343464ae..cc604d4dd5 100644 --- a/src/BRepPrim/BRepPrim_GWedge.cxx +++ b/src/BRepPrim/BRepPrim_GWedge.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -95,7 +97,7 @@ static void BRepPrim_Wedge_Check(const Standard_Boolean V[], const Standard_Boolean W[], const Standard_Boolean F[]) { - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i < NBVERTICES; i++) if (V[i]) throw Standard_DomainError(); for (i = 0; i < NBEDGES; i++) @@ -117,7 +119,7 @@ static void BRepPrim_Wedge_Init(Standard_Boolean& S, Standard_Boolean W[], Standard_Boolean F[]) { - Standard_Integer i; + Standard_Integer i = 0; S = Standard_False; for (i = 0; i < NBVERTICES; i++) V[i] = Standard_False; @@ -482,7 +484,7 @@ const TopoDS_Face& BRepPrim_GWedge::Face gp_Lin L; gp_Dir DX = P.XAxis().Direction(); gp_Dir DY = P.YAxis().Direction(); - Standard_Real U,V,DU,DV; + Standard_Real U = NAN,V = NAN,DU = NAN,DV = NAN; if (HasEdge(d1,dd4)) { L = Line(d1,dd4); ElSLib::Parameters(P,L.Location(),U,V); diff --git a/src/BRepPrim/BRepPrim_GWedge.hxx b/src/BRepPrim/BRepPrim_GWedge.hxx index 854f147004..d720ac3d86 100644 --- a/src/BRepPrim/BRepPrim_GWedge.hxx +++ b/src/BRepPrim/BRepPrim_GWedge.hxx @@ -211,16 +211,16 @@ private: Standard_Real X2Min; Standard_Real X2Max; TopoDS_Shell myShell; - Standard_Boolean ShellBuilt; + Standard_Boolean ShellBuilt{}; TopoDS_Vertex myVertices[8]; - Standard_Boolean VerticesBuilt[8]; + Standard_Boolean VerticesBuilt[8]{}; TopoDS_Edge myEdges[12]; - Standard_Boolean EdgesBuilt[12]; + Standard_Boolean EdgesBuilt[12]{}; TopoDS_Wire myWires[6]; - Standard_Boolean WiresBuilt[6]; + Standard_Boolean WiresBuilt[6]{}; TopoDS_Face myFaces[6]; - Standard_Boolean FacesBuilt[6]; - Standard_Boolean myInfinite[6]; + Standard_Boolean FacesBuilt[6]{}; + Standard_Boolean myInfinite[6]{}; }; diff --git a/src/BRepPrim/BRepPrim_OneAxis.cxx b/src/BRepPrim/BRepPrim_OneAxis.cxx index f3a1e71add..ff55754814 100644 --- a/src/BRepPrim/BRepPrim_OneAxis.cxx +++ b/src/BRepPrim/BRepPrim_OneAxis.cxx @@ -75,7 +75,7 @@ static void BRepPrim_OneAxis_Check(const Standard_Boolean V[], const Standard_Boolean W[], const Standard_Boolean F[]) { - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i < NBVERTICES; i++) if (V[i]) throw Standard_DomainError(); for (i = 0; i < NBEDGES; i++) @@ -100,12 +100,12 @@ BRepPrim_OneAxis::BRepPrim_OneAxis(const BRepPrim_Builder& B, myAngle(2*M_PI), myVMin(VMin), myVMax(VMax), - myMeridianOffset(0) + myMeridianOffset(0), ShellBuilt(Standard_False) { // init Built flags - Standard_Integer i; - ShellBuilt = Standard_False; + Standard_Integer i = 0; + for (i = 0; i < NBVERTICES; i++) VerticesBuilt[i] = Standard_False; for (i = 0; i < NBEDGES; i++) diff --git a/src/BRepPrim/BRepPrim_OneAxis.hxx b/src/BRepPrim/BRepPrim_OneAxis.hxx index ea07e580a1..675d089a3e 100644 --- a/src/BRepPrim/BRepPrim_OneAxis.hxx +++ b/src/BRepPrim/BRepPrim_OneAxis.hxx @@ -287,13 +287,13 @@ private: TopoDS_Shell myShell; Standard_Boolean ShellBuilt; TopoDS_Vertex myVertices[6]; - Standard_Boolean VerticesBuilt[6]; + Standard_Boolean VerticesBuilt[6]{}; TopoDS_Edge myEdges[9]; - Standard_Boolean EdgesBuilt[9]; + Standard_Boolean EdgesBuilt[9]{}; TopoDS_Wire myWires[9]; - Standard_Boolean WiresBuilt[9]; + Standard_Boolean WiresBuilt[9]{}; TopoDS_Face myFaces[5]; - Standard_Boolean FacesBuilt[5]; + Standard_Boolean FacesBuilt[5]{}; }; diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeHalfSpace.cxx b/src/BRepPrimAPI/BRepPrimAPI_MakeHalfSpace.cxx index 880be6166d..c97bb47e52 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeHalfSpace.cxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeHalfSpace.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -66,7 +68,7 @@ static Standard_Boolean getNormalFromEdge(const TopoDS_Shape& theShape, TopExp_Explorer ex1(aF, TopAbs_EDGE); for (; ex1.More(); ex1.Next()) { if (ex1.Current().IsSame(theEdge)) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theEdge, aF, f, l); gp_Pnt2d aP2d = aC2d->Value(thePar); gp_Dir aNorm = getNormalOnFace(aF, aP2d.X(), aP2d.Y()); @@ -138,7 +140,7 @@ static Standard_Boolean FindExtrema(const gp_Pnt& thePnt, if (ext.SupportTypeShape2(iext) == BRepExtrema_IsInFace) { TopoDS_Face aF = TopoDS::Face(ext.SupportOnShape2(iext)); theMinPnt = ext.PointOnShape2(iext); - Standard_Real aU, aV; + Standard_Real aU = NAN, aV = NAN; ext.ParOnFaceS2(iext, aU, aV); theNormal = getNormalOnFace(aF, aU, aV); return Standard_True; @@ -149,7 +151,7 @@ static Standard_Boolean FindExtrema(const gp_Pnt& thePnt, for (Standard_Integer iext = 1; iext <= nbext; iext++) { if (ext.SupportTypeShape2(iext) == BRepExtrema_IsOnEdge) { theMinPnt = ext.PointOnShape2(iext); - Standard_Real aPar; + Standard_Real aPar = NAN; ext.ParOnEdgeS2(iext, aPar); TopoDS_Edge aE = TopoDS::Edge(ext.SupportOnShape2(iext)); if (getNormalFromEdge(theShape, aE, aPar, theNormal)) diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx b/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx index 8385f5aa13..ca104e6471 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx @@ -17,6 +17,8 @@ // Modified by skv - Fri Mar 4 15:50:09 2005 // Add methods for supporting history. +#include + #include #include #include @@ -314,7 +316,7 @@ Standard_Boolean BRepPrimAPI_MakeRevol::CheckValidity(const TopoDS_Shape& theSha } TopLoc_Location L; - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; Handle(Geom_Curve) C = BRep_Tool::Curve(anE, L, First, Last); gp_Trsf Tr = L.Transformation(); C = Handle(Geom_Curve)::DownCast(C->Copy()); @@ -326,7 +328,7 @@ Standard_Boolean BRepPrimAPI_MakeRevol::CheckValidity(const TopoDS_Shape& theSha //Checking coincidence axe of revolution and basis curve //This code is taken directly from GeomAdaptor_SurfaceOfRevolution Standard_Integer Ratio = 1; - Standard_Real Dist; + Standard_Real Dist = NAN; gp_Pnt PP; do { PP = HC->Value(First + (Last - First) / Ratio); diff --git a/src/BRepSweep/BRepSweep_NumLinearRegularSweep.cxx b/src/BRepSweep/BRepSweep_NumLinearRegularSweep.cxx index 590d80fd11..b572c271cc 100644 --- a/src/BRepSweep/BRepSweep_NumLinearRegularSweep.cxx +++ b/src/BRepSweep/BRepSweep_NumLinearRegularSweep.cxx @@ -523,7 +523,7 @@ Standard_Boolean BRepSweep_NumLinearRegularSweep::IsUsed(const TopoDS_Shape& aGe { return Standard_False; } - Standard_Integer j; + Standard_Integer j = 0; Standard_Boolean isBuilt = Standard_False; Standard_Boolean isUsed = Standard_False; for (j = 2; j <= myBuiltShapes.UpperCol(); ++j) diff --git a/src/BRepSweep/BRepSweep_Rotation.cxx b/src/BRepSweep/BRepSweep_Rotation.cxx index 679b850ff7..32cd3af9b0 100644 --- a/src/BRepSweep/BRepSweep_Rotation.cxx +++ b/src/BRepSweep/BRepSweep_Rotation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -74,7 +76,7 @@ static Standard_Real ComputeTolerance(TopoDS_Edge& E, { if(BRep_Tool::Degenerated(E)) return BRep_Tool::Tolerance(E); - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; Handle(Geom_Surface) surf = BRep_Tool::Surface(F); Handle(Geom_Curve) c3d = BRep_Tool::Curve(E,first,last); @@ -109,7 +111,7 @@ static void SetThePCurve(const BRep_Builder& B, const Handle(Geom2d_Curve)& C) { // check if there is already a pcurve - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Handle(Geom2d_Curve) OC; TopLoc_Location SL; Handle(Geom_Plane) GP = Handle(Geom_Plane)::DownCast(BRep_Tool::Surface(F,SL)); @@ -231,7 +233,7 @@ TopoDS_Shape BRepSweep_Rotation::MakeEmptyGeneratingEdge } else { - Standard_Real First,Last; + Standard_Real First = NAN,Last = NAN; TopLoc_Location Loc; Handle(Geom_Curve) C = Handle(Geom_Curve)::DownCast (BRep_Tool::Curve(TopoDS::Edge(aGenE),Loc,First,Last)->Copy()); @@ -328,12 +330,12 @@ TopoDS_Shape BRepSweep_Rotation::MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) { - Standard_Real toler; + Standard_Real toler = NAN; TopoDS_Face F; Handle(Geom_Surface) S; if(aGenS.ShapeType()==TopAbs_EDGE){ TopLoc_Location L; - Standard_Real First,Last; + Standard_Real First = NAN,Last = NAN; Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(aGenS),L,First,Last); toler = BRep_Tool::Tolerance(TopoDS::Edge(aGenS)); gp_Trsf Tr = L.Transformation(); @@ -419,7 +421,7 @@ void BRepSweep_Rotation::SetPCurve { //Set on edges of cap faces the same pcurves as //on edges of the generator face. - Standard_Real First,Last; + Standard_Real First = NAN,Last = NAN; SetThePCurve(myBuilder.Builder(), TopoDS::Edge(aNewEdge), TopoDS::Face(aNewFace), @@ -444,8 +446,8 @@ void BRepSweep_Rotation::SetGeneratingPCurve { TopLoc_Location Loc; GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewFace),Loc)); - Standard_Real First,Last; - Standard_Real u,v; + Standard_Real First = NAN,Last = NAN; + Standard_Real u = NAN,v = NAN; gp_Pnt point; gp_Pnt2d pnt2d; gp_Dir2d dir2d; @@ -550,7 +552,7 @@ void BRepSweep_Rotation::SetDirectingPCurve par = BRep_Tool::Parameter(TopoDS::Vertex(aGenV),TopoDS::Edge(aGenE)); gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(aGenV)); gp_Pnt2d p22d; - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; Handle(Geom2d_Curve) thePCurve; switch(AS.GetType()){ @@ -596,7 +598,7 @@ void BRepSweep_Rotation::SetDirectingPCurve case GeomAbs_Torus : { gp_Pnt p1; - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; gp_Torus tor = AS.Torus(); BRepAdaptor_Curve BC(TopoDS::Edge(aGenE)); p1 = BC.Value(BC.FirstParameter()); @@ -660,7 +662,7 @@ TopAbs_Orientation BRepSweep_Rotation::DirectSolid (const TopoDS_Shape& aGenS, const Sweep_NumShape&) { // compare the face normal and the direction - Standard_Real aU1, aU2, aV1, aV2, aUx, aVx, aX, aMV2, aTol2, aTx; + Standard_Real aU1 = NAN, aU2 = NAN, aV1 = NAN, aV2 = NAN, aUx = NAN, aVx = NAN, aX = NAN, aMV2 = NAN, aTol2 = NAN, aTx = NAN; TopAbs_Orientation aOr; gp_Pnt aP; gp_Vec du,dv; @@ -856,7 +858,7 @@ Standard_Boolean BRepSweep_Rotation::HasShape // if(BRep_Tool::Degenerated(anEdge)) return Standard_False; - Standard_Real aPFirst, aPLast; + Standard_Real aPFirst = NAN, aPLast = NAN; TopLoc_Location aLoc; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aLoc, aPFirst, aPLast); if(aCurve.IsNull()) return Standard_False; diff --git a/src/BRepSweep/BRepSweep_Translation.cxx b/src/BRepSweep/BRepSweep_Translation.cxx index 388f7a2b71..cd09dcec77 100644 --- a/src/BRepSweep/BRepSweep_Translation.cxx +++ b/src/BRepSweep/BRepSweep_Translation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -56,7 +58,7 @@ static void SetThePCurve(const BRep_Builder& B, const Handle(Geom2d_Curve)& C) { // check if there is already a pcurve on non planar faces - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Handle(Geom2d_Curve) OC; TopLoc_Location SL; Handle(Geom_Plane) GP = Handle(Geom_Plane)::DownCast(BRep_Tool::Surface(F,SL)); @@ -158,7 +160,7 @@ TopoDS_Shape BRepSweep_Translation::MakeEmptyGeneratingEdge else { TopLoc_Location L; - Standard_Real First,Last; + Standard_Real First = NAN,Last = NAN; Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(aGenE),L,First,Last); if(!C.IsNull()) { @@ -244,12 +246,12 @@ TopoDS_Shape BRepSweep_Translation::MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) { - Standard_Real toler; + Standard_Real toler = NAN; TopoDS_Face F; Handle(Geom_Surface) S; if (myDirShapeTool.Type(aDirS)==TopAbs_EDGE){ TopLoc_Location L; - Standard_Real First,Last; + Standard_Real First = NAN,Last = NAN; Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(aGenS),L,First,Last); toler = BRep_Tool::Tolerance(TopoDS::Edge(aGenS)); gp_Trsf Tr = L.Transformation(); @@ -311,7 +313,7 @@ void BRepSweep_Translation::SetPCurve Standard_Boolean isclosed = BRep_Tool::IsClosed(TopoDS::Edge(aGenE), TopoDS::Face(aGenF)); if(isclosed) { - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; TopoDS_Edge anE = TopoDS::Edge(aGenE.Oriented(TopAbs_FORWARD)); Handle(Geom2d_Curve) aC1 = BRep_Tool::CurveOnSurface(anE, TopoDS::Face(aGenF), First, Last); anE.Reverse(); @@ -320,7 +322,7 @@ void BRepSweep_Translation::SetPCurve } else { - Standard_Real First,Last; + Standard_Real First = NAN,Last = NAN; myBuilder.Builder().UpdateEdge(TopoDS::Edge(aNewEdge), BRep_Tool::CurveOnSurface(TopoDS::Edge(aGenE),TopoDS::Face(aGenF),First,Last), TopoDS::Face(aNewFace),Precision::PConfusion()); diff --git a/src/BRepSweep/BRepSweep_Trsf.cxx b/src/BRepSweep/BRepSweep_Trsf.cxx index b1649a7dd9..e333581609 100644 --- a/src/BRepSweep/BRepSweep_Trsf.cxx +++ b/src/BRepSweep/BRepSweep_Trsf.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -89,7 +91,7 @@ Standard_Boolean BRepSweep_Trsf::Process(const TopoDS_Shape& aGenS, void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) { - Standard_Real tl = Precision::Confusion(), tol3d; + Standard_Real tl = Precision::Confusion(), tol3d = NAN; //angular etant un peu severe pour les contours sketches. Standard_Real ta = 0.00175;//environ 0.1 degre GeomAbs_Shape cont; @@ -98,7 +100,7 @@ void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS, if (HasShape(aGenS,aDirS)){ TopoDS_Edge E = TopoDS::Edge(aGenS); BRepAdaptor_Curve e; - Standard_Real ud,uf; + Standard_Real ud = NAN,uf = NAN; TopoDS_Vertex d,f; TopExp::Vertices(E,d,f); if(d.IsSame(f)){ @@ -122,7 +124,7 @@ void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS, Shape(aGenS,dirv), aGenS,aDirS,dirv)){ TopLoc_Location Lo; - Standard_Real fi,la; + Standard_Real fi = NAN,la = NAN; cont = BRep_Tool::Curve(E,Lo,fi,la)->Continuity(); if(cont >= 1){ TopoDS_Shape s_wnt = Shape(aGenS,dirv); @@ -138,7 +140,7 @@ void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS, else if(aGenS.ShapeType() == TopAbs_WIRE){ TopoDS_Edge E1,E2; BRepAdaptor_Curve e1,e2; - Standard_Real u1,u2; + Standard_Real u1 = NAN,u2 = NAN; TopTools_IndexedDataMapOfShapeListOfShape M; TopExp::MapShapesAndAncestors(aGenS,TopAbs_VERTEX,TopAbs_EDGE,M); TopTools_ListIteratorOfListOfShape It,Jt; diff --git a/src/BRepTools/BRepTools.cxx b/src/BRepTools/BRepTools.cxx index 7f2c71c14b..8323c1b217 100644 --- a/src/BRepTools/BRepTools.cxx +++ b/src/BRepTools/BRepTools.cxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -140,7 +141,7 @@ void BRepTools::AddUVBounds(const TopoDS_Face& FF, Bnd_Box2d& B) // if the box is empty (face without edges or without pcurves), // get natural bounds if (aBox.IsVoid()) { - Standard_Real UMin,UMax,VMin,VMax; + Standard_Real UMin = NAN,UMax = NAN,VMin = NAN,VMax = NAN; TopLoc_Location L; const Handle(Geom_Surface)& aSurf = BRep_Tool::Surface(F, L); if (aSurf.IsNull()) @@ -180,8 +181,8 @@ void BRepTools::AddUVBounds(const TopoDS_Face& aF, const TopoDS_Edge& aE, Bnd_Box2d& aB) { - Standard_Real aT1, aT2, aXmin = 0.0, aYmin = 0.0, aXmax = 0.0, aYmax = 0.0; - Standard_Real aUmin, aUmax, aVmin, aVmax; + Standard_Real aT1 = NAN, aT2 = NAN, aXmin = 0.0, aYmin = 0.0, aXmax = 0.0, aYmax = 0.0; + Standard_Real aUmin = NAN, aUmax = NAN, aVmin = NAN, aVmax = NAN; Bnd_Box2d aBoxC, aBoxS; TopLoc_Location aLoc; // @@ -599,8 +600,8 @@ TopoDS_Wire BRepTools::OuterWire(const TopoDS_Face& F) Wres = TopoDS::Wire(expw.Current()); expw.Next(); if (expw.More()) { - Standard_Real UMin, UMax, VMin, VMax; - Standard_Real umin, umax, vmin, vmax; + Standard_Real UMin = NAN, UMax = NAN, VMin = NAN, VMax = NAN; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; BRepTools::UVBounds(F,Wres,UMin,UMax,VMin,VMax); while (expw.More()) { const TopoDS_Wire& W = TopoDS::Wire(expw.Current()); @@ -838,7 +839,7 @@ void BRepTools::Clean (const TopoDS_Shape& theShape, const Standard_Boolean theF if (theForce) { Handle(BRep_CurveRepresentation) aCR; - BRep_TEdge* aTE = static_cast(anEdge.TShape().get()); + BRep_TEdge* aTE = dynamic_cast(anEdge.TShape().get()); BRep_ListOfCurveRepresentation& aLCR = aTE->ChangeCurves(); BRep_ListIteratorOfListOfCurveRepresentation anIterCR(aLCR); @@ -919,7 +920,7 @@ void BRepTools::RemoveUnusedPCurves(const TopoDS_Shape& S) TopTools_IndexedMapOfShape Emap; TopExp::MapShapes(S, TopAbs_EDGE, Emap); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= Emap.Extent(); i++) { const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &Emap(i).TShape()); @@ -1278,7 +1279,7 @@ void BRepTools::DetectClosedness(const TopoDS_Face& theFace, if (BRep_Tool::IsClosed(anEdge, theFace) && BRepTools::IsReallyClosed(anEdge, theFace)) { - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar); Handle(Geom2d_Curve) PCurve2 = BRep_Tool::CurveOnSurface(TopoDS::Edge(anEdge.Reversed()), theFace, fpar, lpar); @@ -1300,7 +1301,7 @@ void BRepTools::DetectClosedness(const TopoDS_Face& theFace, Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE, const Handle(Geom_Curve)& C3d, - const Handle(Geom2d_Curve) C2d, + const Handle(Geom2d_Curve)& C2d, const Handle(Geom_Surface)& S, const Standard_Real f, const Standard_Real l) @@ -1343,7 +1344,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE, Standard_Integer nbint = 22; Standard_Real dt = (last - first) / nbint; dt = Max(dt, Precision::Confusion()); - Standard_Real d, dmax = 0.; + Standard_Real d = NAN, dmax = 0.; gp_Pnt2d aP2d; gp_Pnt aPC, aPS; Standard_Integer cnt = 0; @@ -1529,7 +1530,7 @@ void BRepTools::CheckLocations(const TopoDS_Shape& theS, TopTools_IndexedMapOfShape aMapS; TopExp::MapShapes(theS, aMapS, Standard_False, Standard_False); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= aMapS.Extent(); ++i) { const TopoDS_Shape& anS = aMapS(i); diff --git a/src/BRepTools/BRepTools.hxx b/src/BRepTools/BRepTools.hxx index aad8edf62c..579dc9244a 100644 --- a/src/BRepTools/BRepTools.hxx +++ b/src/BRepTools/BRepTools.hxx @@ -330,7 +330,7 @@ public: //! Method returns actual tolerance of edge Standard_EXPORT static Standard_Real EvalAndUpdateTol(const TopoDS_Edge& theE, const Handle(Geom_Curve)& theC3d, - const Handle(Geom2d_Curve) theC2d, + const Handle(Geom2d_Curve)& theC2d, const Handle(Geom_Surface)& theS, const Standard_Real theF, const Standard_Real theL); diff --git a/src/BRepTools/BRepTools_CopyModification.cxx b/src/BRepTools/BRepTools_CopyModification.cxx index 7d9a7b2933..b76bb529a5 100644 --- a/src/BRepTools/BRepTools_CopyModification.cxx +++ b/src/BRepTools/BRepTools_CopyModification.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -85,7 +87,7 @@ Standard_Boolean BRepTools_CopyModification::NewCurve(const TopoDS_Edge& theEdg TopLoc_Location& theLoc, Standard_Real& theTol) { - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; theCurve = BRep_Tool::Curve(theEdge, theLoc, aFirst, aLast); theTol = BRep_Tool::Tolerance(theEdge); @@ -171,7 +173,7 @@ Standard_Boolean BRepTools_CopyModification::NewCurve2d(const TopoDS_Edge& th Standard_Real& theTol) { theTol = BRep_Tool::Tolerance(theEdge); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; theCurve = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirst, aLast); if (!theCurve.IsNull() && myCopyGeom) diff --git a/src/BRepTools/BRepTools_GTrsfModification.cxx b/src/BRepTools/BRepTools_GTrsfModification.cxx index 7f2d9731d6..ca7500f488 100644 --- a/src/BRepTools/BRepTools_GTrsfModification.cxx +++ b/src/BRepTools/BRepTools_GTrsfModification.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ BRepTools_GTrsfModification::BRepTools_GTrsfModification(const gp_GTrsf& T) : myGTrsf(T) { // on prend comme dilatation maximale pour la tolerance la norme sup - Standard_Real loc1, loc2, loc3, loc4; + Standard_Real loc1 = NAN, loc2 = NAN, loc3 = NAN, loc4 = NAN; loc1 = Max(Abs(T.Value(1,1)), Abs(T.Value(1,2))); loc2 = Max(Abs(T.Value(2,1)), Abs(T.Value(2,2))); @@ -145,7 +147,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewCurve TopLoc_Location& L, Standard_Real& Tol) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; gp_GTrsf gtrsf; gtrsf.SetVectorialPart(myGTrsf.VectorialPart()); gtrsf.SetTranslationPart(myGTrsf.TranslationPart()); @@ -219,7 +221,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewCurve2d TopLoc_Location loc; Tol = BRep_Tool::Tolerance(E); Tol *= myGScale; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; C = BRep_Tool::CurveOnSurface(E,F,f,l); if (C.IsNull()) { @@ -299,7 +301,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewTriangulation(const TopoDS_Face for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbTriangles(); ++anInd) { Poly_Triangle aTria = theTriangulation->Triangle(anInd); - Standard_Integer aN1, aN2, aN3; + Standard_Integer aN1 = 0, aN2 = 0, aN3 = 0; aTria.Get(aN1, aN2, aN3); aTria.Set(aN1, aN3, aN2); theTriangulation->SetTriangle(anInd, aTria); diff --git a/src/BRepTools/BRepTools_Modifier.cxx b/src/BRepTools/BRepTools_Modifier.cxx index df686dd4cc..d658edbeb2 100644 --- a/src/BRepTools/BRepTools_Modifier.cxx +++ b/src/BRepTools/BRepTools_Modifier.cxx @@ -16,6 +16,8 @@ // IFV 04.06.99 - PRO18974 - processing of INTERNAL shapes. +#include + #include #include #include @@ -138,7 +140,7 @@ void BRepTools_Modifier::Perform(const Handle(BRepTools_Modification)& M, if (!myMutableInput) CreateOtherVertices(aMVE, aMEF, M); - Standard_Boolean aNewGeom; + Standard_Boolean aNewGeom = 0; Rebuild(myShape, M, aNewGeom, aPS.Next()); if (!aPS.More()) @@ -251,7 +253,7 @@ Standard_Boolean BRepTools_Modifier::Rebuild Standard_Boolean rebuild = Standard_False, RevWires = Standard_False; TopAbs_Orientation ResOr = TopAbs_FORWARD; BRep_Builder B; - Standard_Real tol; + Standard_Real tol = NAN; Standard_Boolean No3DCurve = Standard_False; // en fait, si on n`a pas de //modif geometry 3d , it is necessary to test the existence of a curve 3d. @@ -454,7 +456,7 @@ Standard_Boolean BRepTools_Modifier::Rebuild aLocalResult.Orientation(TopAbs_FORWARD); TopoDS_Face CurF = TopoDS::Face(aLocalResult); Handle(Geom2d_Curve) curve2d1, currcurv; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; if ((!RevWires && fcor != edge.Orientation()) || ( RevWires && fcor == edge.Orientation())) { CurE.Orientation(TopAbs_FORWARD); @@ -478,10 +480,10 @@ Standard_Boolean BRepTools_Modifier::Rebuild } TopLoc_Location theLoc; - Standard_Real theF,theL; + Standard_Real theF = NAN,theL = NAN; Handle(Geom_Curve) C3D = BRep_Tool::Curve(TopoDS::Edge(myMap(ex.Current())), theLoc, theF, theL); if (C3D.IsNull()) { // Update vertices - Standard_Real param; + Standard_Real param = NAN; TopExp_Explorer ex2(edge,TopAbs_VERTEX); while (ex2.More()) { const TopoDS_Vertex& vertex = TopoDS::Vertex(ex2.Current()); @@ -548,7 +550,7 @@ Standard_Boolean BRepTools_Modifier::Rebuild // else if (ts == TopAbs_EDGE) { else if (ts == TopAbs_EDGE && !No3DCurve) { // Vertices - Standard_Real param; + Standard_Real param = NAN; const TopoDS_Edge& edge = TopoDS::Edge(S); TopAbs_Orientation edor = edge.Orientation(); if(edor != TopAbs_REVERSED) edor = TopAbs_FORWARD; @@ -599,7 +601,7 @@ Standard_Boolean BRepTools_Modifier::Rebuild void BRepTools_Modifier::CreateNewVertices( const TopTools_IndexedDataMapOfShapeListOfShape& theMVE, const Handle(BRepTools_Modification)& M) { - double aToler; + double aToler = NAN; BRep_Builder aBB; gp_Pnt aPnt; for (int i = 1; i <= theMVE.Extent(); i++ ) @@ -625,7 +627,7 @@ void BRepTools_Modifier::FillNewCurveInfo(const TopTools_IndexedDataMapOfShapeLi Handle(Geom_Curve) aCurve; TopLoc_Location aLocation; BRepTools_Modifier::NewCurveInfo aNCinfo; - double aToler; + double aToler = NAN; for (int i = 1; i <= theMEF.Extent(); i++ ) { const TopoDS_Edge& anE = TopoDS::Edge(theMEF.FindKey(i)); @@ -649,11 +651,11 @@ void BRepTools_Modifier::FillNewSurfaceInfo(const Handle(BRepTools_Modification) for (int i = 1; i <= aMF.Extent(); i++ ) { const TopoDS_Face& aF = TopoDS::Face(aMF(i)); - Standard_Boolean RevFace; - Standard_Boolean RevWires; + Standard_Boolean RevFace = 0; + Standard_Boolean RevWires = 0; Handle(Geom_Surface) aSurface; TopLoc_Location aLocation; - double aToler1; + double aToler1 = NAN; Standard_Boolean IsNewSur = M->NewSurface(aF, aSurface, aLocation, aToler1, RevWires,RevFace); if (IsNewSur) { @@ -705,7 +707,7 @@ void BRepTools_Modifier::CreateOtherVertices(const TopTools_IndexedDataMapOfShap const TopTools_IndexedDataMapOfShapeListOfShape& theMEF, const Handle(BRepTools_Modification)& M) { - double aToler; + double aToler = NAN; //The following logic in some ways repeats the logic from the Rebuild() method. //If the face with its subshapes is not going to be modified //(i.e. NewSurface() for this face and NewCurve(), NewPoint() for its edges/vertices returns false) diff --git a/src/BRepTools/BRepTools_NurbsConvertModification.cxx b/src/BRepTools/BRepTools_NurbsConvertModification.cxx index 85a30c63c6..b5c72a5517 100644 --- a/src/BRepTools/BRepTools_NurbsConvertModification.cxx +++ b/src/BRepTools/BRepTools_NurbsConvertModification.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -233,8 +235,8 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface Standard_Boolean& RevWires, Standard_Boolean& RevFace) { - Standard_Real U1, U2, curvU1, curvU2, surfU1, surfU2, UTol; - Standard_Real V1, V2, curvV1, curvV2, surfV1, surfV2, VTol; + Standard_Real U1 = NAN, U2 = NAN, curvU1 = NAN, curvU2 = NAN, surfU1 = NAN, surfU2 = NAN, UTol = NAN; + Standard_Real V1 = NAN, V2 = NAN, curvV1 = NAN, curvV2 = NAN, surfV1 = NAN, surfV2 = NAN, VTol = NAN; RevWires = Standard_False; RevFace = Standard_False; Handle(Geom_Surface) SS = BRep_Tool::Surface(F,L); @@ -432,7 +434,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve L.Identity(); return Standard_True; } - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) Caux = BRep_Tool::Curve(E, L, f, l); @@ -472,7 +474,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve C = GeomConvert::CurveToBSplineCurve(C); - Standard_Real fnew = C->FirstParameter(), lnew = C->LastParameter(), UTol; + Standard_Real fnew = C->FirstParameter(), lnew = C->LastParameter(), UTol = NAN; Handle(Geom_BSplineCurve) BC = Handle(Geom_BSplineCurve)::DownCast(C) ; @@ -509,7 +511,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygon(const TopoDS_Edg if (thePoly->HasParameters()) { Standard_Real aTol = BRep_Tool::Tolerance(theEdge); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast); Handle(Geom_Curve) aNewCurve = newCurve(myMap, theEdge, aFirst, aLast); if (!aCurve.IsNull() && !aNewCurve.IsNull()) // skip processing degenerated edges @@ -553,9 +555,9 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d { Tol = BRep_Tool::Tolerance(E); - Standard_Real f2d,l2d; + Standard_Real f2d = NAN,l2d = NAN; Handle(Geom2d_Curve) aBaseC2d = BRep_Tool::CurveOnSurface(E,F,f2d,l2d); - Standard_Real f3d,l3d; + Standard_Real f3d = NAN,l3d = NAN; TopLoc_Location Loc; Handle(Geom_Curve) C3d = BRep_Tool::Curve(E, Loc, f3d,l3d); Standard_Boolean isConvert2d = ((!C3d.IsNull() && !C3d->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) && @@ -605,7 +607,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d GeomAdaptor_Curve G3dAC(C3d, f3d, l3d); Handle(GeomAdaptor_Curve) G3dAHC = new GeomAdaptor_Curve(G3dAC); - Standard_Real Uinf, Usup, Vinf, Vsup, u = 0, v = 0; + Standard_Real Uinf = NAN, Usup = NAN, Vinf = NAN, Vsup = NAN, u = 0, v = 0; Handle(Geom_Surface) S = BRep_Tool::Surface(F); Handle(Standard_Type) myT = S->DynamicType(); if(myT != STANDARD_TYPE(Geom_Plane)) { @@ -754,7 +756,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d } if (!itled.More()) { // on stocke l`edge et la curve2d Handle(Geom2d_Curve) C2dBis; - Standard_Real f2dBis,l2dBis; + Standard_Real f2dBis = NAN,l2dBis = NAN; C2d = new Geom2d_TrimmedCurve(C2d, f2d, l2d); Geom2dAdaptor_Curve G2dAC(C2d, f2d, l2d); Handle(Geom2dAdaptor_Curve) G2dAHC = new Geom2dAdaptor_Curve(G2dAC); @@ -817,7 +819,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d else { S = BRep_Tool::Surface(newF);// S est une BSplineSurface : pas besoin de la trimmed } - Standard_Real Uinf, Usup, Vinf, Vsup, u = 0, v = 0; + Standard_Real Uinf = NAN, Usup = NAN, Vinf = NAN, Vsup = NAN, u = 0, v = 0; S->Bounds(Uinf, Usup, Vinf, Vsup); //Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9; u = (Usup - Uinf)*0.1; @@ -907,7 +909,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygonOnTriangulation( TopLoc_Location aLoc; Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace, aLoc); Handle(Geom_Surface) aNewSurf = newSurface(myMap, theFace); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirst, aLast); Handle(Geom2d_Curve) aNewC2d = newCurve(myMap, theEdge, theFace, aFirst, aLast); if (!aSurf.IsNull() && !aC2d.IsNull() && !aNewSurf.IsNull() && !aNewC2d.IsNull()) @@ -949,7 +951,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewParameter gp_Pnt pnt = BRep_Tool::Pnt(V); P = BRep_Tool::Parameter(V,E); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom_Curve) aNewCurve = newCurve(myMap, E, aFirst, aLast); return !aNewCurve.IsNull() && newParameter(pnt, aNewCurve, aFirst, aLast, Tol, P); } diff --git a/src/BRepTools/BRepTools_PurgeLocations.cxx b/src/BRepTools/BRepTools_PurgeLocations.cxx index c7359b73eb..dfe775b6ff 100644 --- a/src/BRepTools/BRepTools_PurgeLocations.cxx +++ b/src/BRepTools/BRepTools_PurgeLocations.cxx @@ -42,7 +42,7 @@ Standard_Boolean BRepTools_PurgeLocations::Perform(const TopoDS_Shape& theShape) AddShape(myShape); //Check locations; - Standard_Integer ind; + Standard_Integer ind = 0; NCollection_Vector aBadTrsfInds; for (ind = 1; ; ++ind) { @@ -67,7 +67,7 @@ Standard_Boolean BRepTools_PurgeLocations::Perform(const TopoDS_Shape& theShape) Standard_Integer aNbShapes = myMapShapes.Extent(); myMapNewShapes.Clear(); - Standard_Integer inds; + Standard_Integer inds = 0; for (inds = 1; inds <= aNbShapes; ++inds) { const TopoDS_Shape& anS = myMapShapes(inds); @@ -76,7 +76,7 @@ Standard_Boolean BRepTools_PurgeLocations::Perform(const TopoDS_Shape& theShape) { continue; } - Standard_Integer il; + Standard_Integer il = 0; for (il = 0; il < aBadTrsfInds.Size(); ++il) { if (aBadTrsfInds(il) == aLocInd) diff --git a/src/BRepTools/BRepTools_Quilt.cxx b/src/BRepTools/BRepTools_Quilt.cxx index d36202ab25..c4f2fa05a0 100644 --- a/src/BRepTools/BRepTools_Quilt.cxx +++ b/src/BRepTools/BRepTools_Quilt.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -79,7 +81,7 @@ static void CopyShape(const TopoDS_Edge& E,TopTools_IndexedDataMapOfShapeShape& } } // set the 3d range - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; BRep_Tool::Range(E,f,l); B.Range(NE,f,l); myBounds.Add(E,NE.Oriented(TopAbs_FORWARD)); @@ -209,7 +211,7 @@ void BRepTools_Quilt::Add(const TopoDS_Shape& S) TopoDS_Wire NW; B.MakeWire(NW); TopoDS_Iterator ite(W,Standard_False); - Standard_Real UFirst,ULast; + Standard_Real UFirst = NAN,ULast = NAN; // Reconstruction des wires. @@ -462,7 +464,7 @@ TopoDS_Shape BRepTools_Quilt::Shells() const // itm.More(); ) { if(!M.IsBound(aexp.Current())) continue; - TopoDS_Shape ae = aexp.Current(); + const TopoDS_Shape& ae = aexp.Current(); TopoDS_Shape as = M.Find(ae); if (as.IsSame(oldShell)) { // update the orientation of free edges in SH. diff --git a/src/BRepTools/BRepTools_ReShape.cxx b/src/BRepTools/BRepTools_ReShape.cxx index 7b282a9850..89ff3a136c 100644 --- a/src/BRepTools/BRepTools_ReShape.cxx +++ b/src/BRepTools/BRepTools_ReShape.cxx @@ -109,9 +109,9 @@ static void CopyRanges (const TopoDS_Shape& toedge, const TopoDS_Shape& fromedge //======================================================================= BRepTools_ReShape::BRepTools_ReShape() -: myStatus(-1) +: myStatus(-1), myConsiderLocation(Standard_False) { - myConsiderLocation = Standard_False; + } @@ -388,7 +388,7 @@ TopoDS_Shape BRepTools_ReShape::Apply (const TopoDS_Shape& shape, // apply recorded modifications to subshapes Standard_Boolean isEmpty = Standard_True; for ( TopoDS_Iterator it(shape,Standard_False); it.More(); it.Next() ) { - TopoDS_Shape sh = it.Value(); + const TopoDS_Shape& sh = it.Value(); newsh = Apply ( sh, until ); if ( newsh != sh ) { if ( myStatus & EncodeStatus(4)) //ShapeExtend::DecodeStatus ( myStatus, ShapeExtend_DONE4 ) ) @@ -408,7 +408,7 @@ TopoDS_Shape BRepTools_ReShape::Apply (const TopoDS_Shape& shape, } Standard_Integer nitems = 0; for ( TopoDS_Iterator subit(newsh); subit.More(); subit.Next(), nitems++ ) { - TopoDS_Shape subsh = subit.Value(); + const TopoDS_Shape& subsh = subit.Value(); if ( subsh.ShapeType() == sh.ShapeType() ) B.Add ( result, subsh );//fix for SAMTECH bug OCC322 about abcense internal vertices after sewing. else locStatus |= EncodeStatus(10);//ShapeExtend::EncodeStatus ( ShapeExtend_FAIL1 ); } diff --git a/src/BRepTools/BRepTools_ShapeSet.cxx b/src/BRepTools/BRepTools_ShapeSet.cxx index 4473b78cad..c5b4cbd296 100644 --- a/src/BRepTools/BRepTools_ShapeSet.cxx +++ b/src/BRepTools/BRepTools_ShapeSet.cxx @@ -16,6 +16,8 @@ // Modified: Portage NT 7-5-97 DPF (strcasecmp) +#include + #include #include #include @@ -409,7 +411,7 @@ void BRepTools_ShapeSet::DumpGeometry(const TopoDS_Shape& S, if (TE->SameRange()) OS << " same range on curves\n"; if (TE->Degenerated()) OS << " degenerated\n"; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_ListIteratorOfListOfCurveRepresentation itrc = TE->Curves(); while (itrc.More()) { const Handle(BRep_CurveRepresentation)& CR = itrc.Value(); @@ -571,7 +573,7 @@ void BRepTools_ShapeSet::WriteGeometry (const TopoDS_Shape& S, Standard_OStream OS << ((TE->SameRange()) ? 1 : 0) << " "; OS << ((TE->Degenerated()) ? 1 : 0) << "\n"; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_ListIteratorOfListOfCurveRepresentation itrc = TE->Curves(); while (itrc.More()) { const Handle(BRep_CurveRepresentation)& CR = itrc.Value(); @@ -754,11 +756,11 @@ void BRepTools_ShapeSet::ReadGeometry (const TopAbs_ShapeEnum T, { // Read the geometry - Standard_Integer val,c,pc,pc2 = 0,s,s2,l,l2,t, pt, pt2 = 0; - Standard_Real tol,X,Y,Z,first,last,p1,p2; - Standard_Real PfX,PfY,PlX,PlY; + Standard_Integer val = 0,c = 0,pc = 0,pc2 = 0,s = 0,s2 = 0,l = 0,l2 = 0,t = 0, pt = 0, pt2 = 0; + Standard_Real tol = NAN,X = NAN,Y = NAN,Z = NAN,first = NAN,last = NAN,p1 = NAN,p2 = NAN; + Standard_Real PfX = NAN,PfY = NAN,PlX = NAN,PlY = NAN; gp_Pnt2d aPf, aPl; - Standard_Boolean closed; + Standard_Boolean closed = 0; GeomAbs_Shape reg = GeomAbs_C0; switch (T) { @@ -1170,7 +1172,7 @@ void BRepTools_ShapeSet::WritePolygonOnTriangulation(Standard_OStream& OS, const Standard_Boolean Compact, const Message_ProgressRange& theProgress)const { - Standard_Integer i, j, nbpOntri = myNodes.Extent(); + Standard_Integer i = 0, j = 0, nbpOntri = myNodes.Extent(); Message_ProgressScope aPS(theProgress, "Polygons On Triangulation", nbpOntri); if (Compact) @@ -1237,9 +1239,9 @@ void BRepTools_ShapeSet::ReadPolygonOnTriangulation(Standard_IStream& IS, char buffer[255]; IS >> buffer; if (strstr(buffer,"PolygonOnTriangulations") == NULL) return; - Standard_Integer i, j, val, nbpol = 0, nbnodes =0; - Standard_Integer hasparameters; - Standard_Real par; + Standard_Integer i = 0, j = 0, val = 0, nbpol = 0, nbnodes =0; + Standard_Integer hasparameters = 0; + Standard_Real par = NAN; Handle(TColStd_HArray1OfReal) Param; Handle(Poly_PolygonOnTriangulation) Poly; IS >> nbpol; @@ -1254,7 +1256,7 @@ void BRepTools_ShapeSet::ReadPolygonOnTriangulation(Standard_IStream& IS, } IS >> buffer; // if (!strcasecmp(buffer, "p")) { - Standard_Real def; + Standard_Real def = NAN; GeomTools::GetReal(IS, def); IS >> hasparameters; if (hasparameters) { @@ -1289,7 +1291,7 @@ void BRepTools_ShapeSet::WritePolygon3D(Standard_OStream& OS, const Standard_Boolean Compact, const Message_ProgressRange& theProgress)const { - Standard_Integer i, j, nbpol = myPolygons3D.Extent(); + Standard_Integer i = 0, j = 0, nbpol = myPolygons3D.Extent(); Message_ProgressScope aPS(theProgress, "3D Polygons", nbpol); @@ -1321,7 +1323,7 @@ void BRepTools_ShapeSet::WritePolygon3D(Standard_OStream& OS, // write the nodes if (!Compact) OS << "\nNodes :\n"; - Standard_Integer i1, nbNodes = P->NbNodes(); + Standard_Integer i1 = 0, nbNodes = P->NbNodes(); const TColgp_Array1OfPnt& Nodes = P->Nodes(); for (j = 1; j <= nbNodes; j++) { if (!Compact) OS << std::setw(10) << j << " : "; @@ -1367,8 +1369,8 @@ void BRepTools_ShapeSet::ReadPolygon3D(Standard_IStream& IS, const Message_Progr { char buffer[255]; // Standard_Integer i, j, p, val, nbpol, nbnodes, hasparameters; - Standard_Integer i, j, p, nbpol=0, nbnodes =0, hasparameters = Standard_False; - Standard_Real d, x, y, z; + Standard_Integer i = 0, j = 0, p = 0, nbpol=0, nbnodes =0, hasparameters = Standard_False; + Standard_Real d = NAN, x = NAN, y = NAN, z = NAN; IS >> buffer; if (strstr(buffer,"Polygon3D") == NULL) return; @@ -1411,8 +1413,8 @@ void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS, const Standard_Boolean Compact, const Message_ProgressRange& theProgress)const { - Standard_Integer i, j, nbNodes, nbtri = myTriangulations.Extent(); - Standard_Integer nbTriangles = 0, n1, n2, n3; + Standard_Integer i = 0, j = 0, nbNodes = 0, nbtri = myTriangulations.Extent(); + Standard_Integer nbTriangles = 0, n1 = 0, n2 = 0, n3 = 0; Message_ProgressScope aPS(theProgress, "Triangulations", nbtri); @@ -1547,8 +1549,8 @@ void BRepTools_ShapeSet::DumpTriangulation(Standard_OStream& OS)const void BRepTools_ShapeSet::ReadTriangulation(Standard_IStream& IS, const Message_ProgressRange& theProgress) { char buffer[255]; - Standard_Integer i, j, nbtri =0; - Standard_Real d, x, y, z; + Standard_Integer i = 0, j = 0, nbtri =0; + Standard_Real d = NAN, x = NAN, y = NAN, z = NAN; Standard_Integer nbNodes =0, nbTriangles=0; Standard_Boolean hasUV= Standard_False; Standard_Boolean hasNormals= Standard_False; @@ -1588,7 +1590,7 @@ void BRepTools_ShapeSet::ReadTriangulation(Standard_IStream& IS, const Message_P } // read the triangles - Standard_Integer n1,n2,n3; + Standard_Integer n1 = 0,n2 = 0,n3 = 0; for (j = 1; j <= nbTriangles; j++) { IS >> n1 >> n2 >> n3; T->SetTriangle (j, Poly_Triangle (n1, n2, n3)); diff --git a/src/BRepTools/BRepTools_Substitution.cxx b/src/BRepTools/BRepTools_Substitution.cxx index 0ee437456f..3d710043e5 100644 --- a/src/BRepTools/BRepTools_Substitution.cxx +++ b/src/BRepTools/BRepTools_Substitution.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -89,7 +91,7 @@ void BRepTools_Substitution::Build(const TopoDS_Shape& S) NewS.EmptyCopy(); if (NewS.ShapeType() == TopAbs_EDGE) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; BRep_Tool::Range(TopoDS::Edge(S),f,l); B.Range(TopoDS::Edge(NewS),f,l); } diff --git a/src/BRepTools/BRepTools_TrsfModification.cxx b/src/BRepTools/BRepTools_TrsfModification.cxx index 238afe6970..26a90f2d1d 100644 --- a/src/BRepTools/BRepTools_TrsfModification.cxx +++ b/src/BRepTools/BRepTools_TrsfModification.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -162,7 +164,7 @@ Standard_Boolean BRepTools_TrsfModification::NewTriangulation for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbTriangles(); ++anInd) { Poly_Triangle aTria = theTriangulation->Triangle(anInd); - Standard_Integer aN1, aN2, aN3; + Standard_Integer aN1 = 0, aN2 = 0, aN3 = 0; aTria.Get(aN1, aN2, aN3); aTria.Set(aN1, aN3, aN2); theTriangulation->SetTriangle(anInd, aTria); @@ -221,7 +223,7 @@ Standard_Boolean BRepTools_TrsfModification::NewPolygon if (theP->HasParameters()) { TopLoc_Location aCurveLoc; - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theE, aCurveLoc, aFirst, aLast); if (!aCurve.IsNull()) { @@ -272,7 +274,7 @@ Standard_Boolean BRepTools_TrsfModification::NewPolygonOnTriangulation // transform the parametrization Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theF, aLoc); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theE, theF, aFirst, aLast); if (!aSurf.IsNull() && !aC2d.IsNull() && Abs(Abs(myTrsf.ScaleFactor()) - 1.0) > TopLoc_Location::ScalePrec()) { @@ -305,7 +307,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve TopLoc_Location& L, Standard_Real& Tol) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; C = BRep_Tool::Curve(E,L,f,l); if (C.IsNull()) { @@ -373,12 +375,12 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d if (GAsurf.GetType() == GeomAbs_Plane) return Standard_False; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Handle(Geom2d_Curve) NewC = BRep_Tool::CurveOnSurface(E,F,f,l); if (NewC.IsNull()) return Standard_False; - Standard_Real newf,newl; + Standard_Real newf = NAN,newl = NAN; Handle(Standard_Type) TheType = NewC->DynamicType(); @@ -426,7 +428,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d TopExp::Vertices(E,V1,V2); TopoDS_Shape initEFOR = E.Oriented(TopAbs_FORWARD); // skl TopoDS_Edge EFOR = TopoDS::Edge(initEFOR/*E.Oriented(TopAbs_FORWARD)*/); //skl - Standard_Real aTolV; + Standard_Real aTolV = NAN; NewParameter(V1, EFOR, f, aTolV); NewParameter(V2, EFOR, l, aTolV); GeomLib::SameRange(Precision::PConfusion(), NewC, newf, newl, f, l, C); @@ -452,7 +454,7 @@ Standard_Boolean BRepTools_TrsfModification::NewParameter Tol *= Abs(myTrsf.ScaleFactor()); P = BRep_Tool::Parameter(V,E); - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Handle(Geom_Curve) C = BRep_Tool::Curve(E,loc,f,l); if (!C.IsNull()) { diff --git a/src/BRepTools/BRepTools_WireExplorer.cxx b/src/BRepTools/BRepTools_WireExplorer.cxx index 0cd69bc486..c8caa24aa4 100644 --- a/src/BRepTools/BRepTools_WireExplorer.cxx +++ b/src/BRepTools/BRepTools_WireExplorer.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -180,7 +182,7 @@ void BRepTools_WireExplorer::Init(const TopoDS_Wire& W, gp_Pnt aP; gp_Vec aD1U, aD1V; aGAS.D1(UMin, VMin, aP, aD1U, aD1V); - Standard_Real tol1, tol2, maxtol = .0005*(UMax - UMin); + Standard_Real tol1 = NAN, tol2 = NAN, maxtol = .0005*(UMax - UMin); Standard_Real a = aD1U.Magnitude(); if (a <= Precision::Confusion()) @@ -322,8 +324,8 @@ void BRepTools_WireExplorer::Init(const TopoDS_Wire& W, for (; itt.More(); itt.Next()) { TopoDS_Edge anEdge = TopoDS::Edge(itt.Key()); TopAbs_Orientation anOri = anEdge.Orientation(); - Standard_Real aF; - Standard_Real aL; + Standard_Real aF = NAN; + Standard_Real aL = NAN; BRep_Tool::Range(anEdge, aF, aL); if ((anOri == TopAbs_FORWARD && aF == -Precision::Infinite()) || @@ -408,11 +410,11 @@ void BRepTools_WireExplorer::Next() if (!myFace.IsNull() && aV1.IsSame(aV2)) { Handle(Geom2d_Curve) aPrevPC; Handle(Geom2d_Curve) aNextPC; - Standard_Real aPar11, aPar12; - Standard_Real aPar21, aPar22; - Standard_Real aPrevPar; - Standard_Real aNextFPar; - Standard_Real aNextLPar; + Standard_Real aPar11 = NAN, aPar12 = NAN; + Standard_Real aPar21 = NAN, aPar22 = NAN; + Standard_Real aPrevPar = NAN; + Standard_Real aNextFPar = NAN; + Standard_Real aNextLPar = NAN; aPrevPC = BRep_Tool::CurveOnSurface(myEdge, myFace, aPar11, aPar12); aNextPC = BRep_Tool::CurveOnSurface(aNextEdge, myFace, aPar21, aPar22); diff --git a/src/BRepTools/BRepTools_WireExplorer.hxx b/src/BRepTools/BRepTools_WireExplorer.hxx index 0800a002bd..334d0ba637 100644 --- a/src/BRepTools/BRepTools_WireExplorer.hxx +++ b/src/BRepTools/BRepTools_WireExplorer.hxx @@ -116,9 +116,9 @@ private: TopoDS_Vertex myVertex; TopoDS_Face myFace; TopTools_MapOfShape myDoubles; - Standard_Boolean myReverse; - Standard_Real myTolU; - Standard_Real myTolV; + Standard_Boolean myReverse{}; + Standard_Real myTolU{}; + Standard_Real myTolV{}; }; diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx index 76804d5107..1607c8dfa0 100644 --- a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx @@ -19,6 +19,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -104,7 +106,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const TopoDS_Edge edge; TopAbs_Orientation Or; - Standard_Real u,du,Tole = 0.0,Tol=0.0; + Standard_Real u = NAN,du = NAN,Tole = 0.0,Tol=0.0; BRepTools_WireExplorer WireExplorer; TopExp_Explorer FaceExplorer; @@ -139,7 +141,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const Or = edge.Orientation(); if(Or == TopAbs_FORWARD || Or == TopAbs_REVERSED) { - Standard_Real pfbid,plbid; + Standard_Real pfbid = NAN,plbid = NAN; if(BRep_Tool::CurveOnSurface(edge,Face,pfbid,plbid).IsNull()) return; BRepAdaptor_Curve2d C(edge,Face); @@ -344,7 +346,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const Or = edge.Orientation(); if (Or == TopAbs_FORWARD || Or == TopAbs_REVERSED) { - Standard_Real pfbid, plbid; + Standard_Real pfbid = NAN, plbid = NAN; BRep_Tool::Range(edge, Face, pfbid, plbid); if (Abs(plbid - pfbid) < 1.e-9) continue; BRepAdaptor_Curve2d C(edge, Face); @@ -499,7 +501,7 @@ TopAbs_State BRepTopAdaptor_FClass2d::Perform(const gp_Pnt2d& _Puv, STAT.NbPerform++; #endif - Standard_Integer dedans; + Standard_Integer dedans = 0; Standard_Integer nbtabclass = TabClass.Length(); if(nbtabclass==0) { @@ -633,7 +635,7 @@ TopAbs_State BRepTopAdaptor_FClass2d::TestOnRestriction(const gp_Pnt2d& _Puv, STAT.NbConstrShape++; #endif - Standard_Integer dedans; + Standard_Integer dedans = 0; Standard_Integer nbtabclass = TabClass.Length(); if(nbtabclass==0) { diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_HVertex.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_HVertex.cxx index d8da86887a..5f633ef6bf 100644 --- a/src/BRepTopAdaptor/BRepTopAdaptor_HVertex.cxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_HVertex.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -53,7 +55,7 @@ Standard_Real BRepTopAdaptor_HVertex::Resolution const TopoDS_Face& F = brhc->Face(); BRepAdaptor_Surface S(F,0); Standard_Real tv = BRep_Tool::Tolerance(myVtx); - Standard_Real pp, p = BRep_Tool::Parameter (myVtx, brhc->Edge(), brhc->Face()); + Standard_Real pp = NAN, p = BRep_Tool::Parameter (myVtx, brhc->Edge(), brhc->Face()); TopAbs_Orientation Or = Orientation(); gp_Pnt2d p2d; gp_Vec2d v2d; C->D1(p,p2d,v2d); @@ -61,7 +63,7 @@ Standard_Real BRepTopAdaptor_HVertex::Resolution gp_Vec DU, DV, DC; S.D1(p2d.X(),p2d.Y(),P,DU,DV); DC.SetLinearForm(v2d.X(),DU,v2d.Y(),DV); - Standard_Real ResUV, mag = DC.Magnitude(); + Standard_Real ResUV = NAN, mag = DC.Magnitude(); Standard_Real URes = S.UResolution(tv); Standard_Real VRes = S.VResolution(tv); @@ -96,7 +98,7 @@ Standard_Real BRepTopAdaptor_HVertex::Resolution Standard_Real Dist=P.Distance(P1); if ((Dist>1e-12) && ((Dist > 1.1*tv) || (Dist< 0.8*tv))) { // Refine if possible - Standard_Real Dist1; + Standard_Real Dist1 = NAN; if (Or == TopAbs_REVERSED) pp = p+tv/Dist; else pp = p-tv/Dist; diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx index 1fbdc1509b..436eca0f18 100644 --- a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx @@ -21,31 +21,31 @@ #include #include -BRepTopAdaptor_Tool::BRepTopAdaptor_Tool() { - myTopolTool = new BRepTopAdaptor_TopolTool(); +BRepTopAdaptor_Tool::BRepTopAdaptor_Tool() : myloaded(Standard_False), myTopolTool(new BRepTopAdaptor_TopolTool()) { + - myloaded=Standard_False; + } BRepTopAdaptor_Tool::BRepTopAdaptor_Tool(const TopoDS_Face& F, - const Standard_Real /*Tol2d*/) { - myTopolTool = new BRepTopAdaptor_TopolTool(); + const Standard_Real /*Tol2d*/) : myloaded(Standard_True), myTopolTool(new BRepTopAdaptor_TopolTool()) { + Handle(BRepAdaptor_Surface) surface = new BRepAdaptor_Surface(); surface->Initialize(F,Standard_True); const Handle(Adaptor3d_Surface)& aSurf = surface; // to avoid ambiguity myTopolTool->Initialize(aSurf); myHSurface = surface; - myloaded=Standard_True; + } BRepTopAdaptor_Tool::BRepTopAdaptor_Tool(const Handle(Adaptor3d_Surface)& surface, - const Standard_Real /*Tol2d*/) + const Standard_Real /*Tol2d*/) : myloaded(Standard_True), myTopolTool(new BRepTopAdaptor_TopolTool()), myHSurface(surface) { - myTopolTool = new BRepTopAdaptor_TopolTool(); + myTopolTool->Initialize(surface); - myHSurface = surface; - myloaded=Standard_True; + + } void BRepTopAdaptor_Tool::Init(const TopoDS_Face& F, @@ -96,7 +96,7 @@ void BRepTopAdaptor_Tool::SetTopolTool(const Handle(BRepTopAdaptor_TopolTool)& T } void BRepTopAdaptor_Tool::Destroy() { - int i; + int i = 0; i=0; i++; diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_TopolTool.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_TopolTool.cxx index 8be3506a8f..1d3c7e4694 100644 --- a/src/BRepTopAdaptor/BRepTopAdaptor_TopolTool.cxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_TopolTool.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -255,7 +257,7 @@ void Analyse(const TColgp_Array2OfPnt& array2, Standard_Integer& myNbSamplesV) { gp_Vec Vi,Vip1; - Standard_Integer sh,nbch,i,j; + Standard_Integer sh = 0,nbch = 0,i = 0,j = 0; sh = 1; nbch = 0; @@ -329,7 +331,7 @@ void Analyse(const TColgp_Array2OfPnt& array2, //======================================================================= void BRepTopAdaptor_TopolTool::ComputeSamplePoints() { - Standard_Real uinf,usup,vinf,vsup; + Standard_Real uinf = NAN,usup = NAN,vinf = NAN,vsup = NAN; uinf = myS->FirstUParameter(); usup = myS->LastUParameter(); vinf = myS->FirstVParameter(); vsup = myS->LastVParameter(); if (usup < uinf) { Standard_Real temp=uinf; uinf=usup; usup=temp; } @@ -342,7 +344,7 @@ void Analyse(const TColgp_Array2OfPnt& array2, else if (vinf == RealFirst()) { vinf=vsup-2.e5; } else if (vsup == RealLast()) { vsup=vinf+2.e5; } - Standard_Integer nbsu,nbsv; + Standard_Integer nbsu = 0,nbsv = 0; GeomAbs_SurfaceType typS = myS->GetType(); switch(typS) { case GeomAbs_Plane: { nbsv=2; nbsu=2; } break; @@ -474,7 +476,7 @@ void Analyse(const TColgp_Array2OfPnt& array2, //======================================================================= Standard_Boolean BRepTopAdaptor_TopolTool::DomainIsInfinite() { - Standard_Real uinf,usup,vinf,vsup; + Standard_Real uinf = NAN,usup = NAN,vinf = NAN,vsup = NAN; uinf = myS->FirstUParameter(); usup = myS->LastUParameter(); vinf = myS->FirstVParameter(); vsup = myS->LastVParameter(); if(Precision::IsNegativeInfinite(uinf)) return(Standard_True); diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_TopolTool.hxx b/src/BRepTopAdaptor/BRepTopAdaptor_TopolTool.hxx index f5f17b1847..648c33742b 100644 --- a/src/BRepTopAdaptor/BRepTopAdaptor_TopolTool.hxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_TopolTool.hxx @@ -140,10 +140,10 @@ private: Handle(BRepAdaptor_Curve2d) myCurve; TColStd_ListOfTransient myCurves; TColStd_ListIteratorOfListOfTransient myCIterator; - Standard_Real myU0; - Standard_Real myV0; - Standard_Real myDU; - Standard_Real myDV; + Standard_Real myU0{}; + Standard_Real myV0{}; + Standard_Real myDU{}; + Standard_Real myDV{}; }; diff --git a/src/BSplCLib/BSplCLib.cxx b/src/BSplCLib/BSplCLib.cxx index 6a2aa5f112..8d9dc21439 100644 --- a/src/BSplCLib/BSplCLib.cxx +++ b/src/BSplCLib/BSplCLib.cxx @@ -27,6 +27,8 @@ // jct : 24-Apr-97 : correction on computation of Tbord and NewFlatKnots // in TangExtendToConstraint; Continuity can be equal to 0 +#include + #include #include #include @@ -62,7 +64,7 @@ public: private: // local buffer, to be sufficient for addressing by index [Degree+1][Degree+1] // (see math_Matrix implementation) - Standard_Real myBuffer[27*27]; + Standard_Real myBuffer[27*27]{}; }; //======================================================================= @@ -154,7 +156,7 @@ Standard_Integer BSplCLib::FlatIndex const TColStd_Array1OfInteger& Mults, const Standard_Boolean Periodic) { - Standard_Integer i, index = Index; + Standard_Integer i = 0, index = Index; const Standard_Integer MLower = Mults.Lower(); const Standard_Integer *pmu = &Mults(MLower); pmu -= MLower; @@ -253,7 +255,7 @@ void BSplCLib::LocateParameter If Ki <= U < K(i+1) then KnotIndex should be equal to sum (M1+M2+...+Mi). */ - Standard_Integer First,Last; + Standard_Integer First = 0,Last = 0; if (FromK1 < ToK2) { First = FromK1; Last = ToK2; @@ -269,7 +271,7 @@ void BSplCLib::LocateParameter BSplCLib::Hunt (Knots, NewU, KnotIndex); - Standard_Real val; + Standard_Real val = NAN; const Standard_Integer KLower = Knots.Lower(), KUpper = Knots.Upper(); @@ -321,7 +323,7 @@ void BSplCLib::LocateParameter Standard_Integer& KnotIndex, Standard_Real& NewU) { - Standard_Integer first,last; + Standard_Integer first = 0,last = 0; if (Mults) { if (Periodic) { first = Knots.Lower(); @@ -394,7 +396,7 @@ Standard_Integer BSplCLib::NbPoles(const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfInteger& Mults) { - Standard_Integer i,sigma = 0; + Standard_Integer i = 0,sigma = 0; Standard_Integer f = Mults.Lower(); Standard_Integer l = Mults.Upper(); const Standard_Integer * pmu = &Mults(f); @@ -434,7 +436,7 @@ Standard_Integer BSplCLib::KnotSequenceLength const Standard_Integer Degree, const Standard_Boolean Periodic) { - Standard_Integer i,l = 0; + Standard_Integer i = 0,l = 0; Standard_Integer MLower = Mults.Lower(); Standard_Integer MUpper = Mults.Upper(); const Standard_Integer * pmu = &Mults(MLower); @@ -472,8 +474,8 @@ void BSplCLib::KnotSequence const Standard_Boolean Periodic, TColStd_Array1OfReal& KnotSeq) { - Standard_Real K; - Standard_Integer Mult; + Standard_Real K = NAN; + Standard_Integer Mult = 0; Standard_Integer MLower = Mults.Lower(); const Standard_Integer * pmu = &Mults(MLower); pmu -= MLower; @@ -482,7 +484,7 @@ void BSplCLib::KnotSequence const Standard_Real * pkn = &Knots(KLower); pkn -= KLower; Standard_Integer M1 = Degree + 1 - pmu[MLower]; // for periodic - Standard_Integer i,j,index = Periodic ? M1 + 1 : 1; + Standard_Integer i = 0,j = 0,index = Periodic ? M1 + 1 : 1; for (i = KLower; i <= KUpper; i++) { Mult = pmu[i]; @@ -495,7 +497,7 @@ void BSplCLib::KnotSequence } if (Periodic) { Standard_Real period = pkn[KUpper] - pkn[KLower]; - Standard_Integer m; + Standard_Integer m = 0; m = 1; j = KUpper - 1; @@ -586,7 +588,7 @@ BSplCLib_KnotDistribution BSplCLib::KnotForm const Standard_Integer FromK1, const Standard_Integer ToK2) { - Standard_Real DU0,DU1,Ui,Uj,Eps0,val; + Standard_Real DU0 = NAN,DU1 = NAN,Ui = NAN,Uj = NAN,Eps0 = NAN,val = NAN; BSplCLib_KnotDistribution KForm = BSplCLib_Uniform; if (FromK1 + 1 > Knots.Upper()) @@ -630,7 +632,7 @@ BSplCLib_MultDistribution BSplCLib::MultForm const Standard_Integer FromK1, const Standard_Integer ToK2) { - Standard_Integer First,Last; + Standard_Integer First = 0,Last = 0; if (FromK1 < ToK2) { First = FromK1; Last = ToK2; @@ -719,7 +721,7 @@ void BSplCLib::KnotAnalysis (const Standard_Integer Degree, Periodic ? CKnots.Upper() : BSplCLib::LastUKnotIndex (Degree,CMults); MaxKnotMult = 0; if (LastKM - FirstKM != 1) { - Standard_Integer Multi; + Standard_Integer Multi = 0; for (Standard_Integer i = FirstKM + 1; i < LastKM; i++) { Multi = CMults (i); MaxKnotMult = Max (MaxKnotMult, Multi); @@ -752,8 +754,8 @@ void BSplCLib::Reparametrize } } else { - Standard_Real K2; - Standard_Real Ratio; + Standard_Real K2 = NAN; + Standard_Real Ratio = NAN; Standard_Real K1 = Knots (Lower); Standard_Real Length = Knots (Upper) - Knots (Lower); Knots (Lower) = UFirst; @@ -810,7 +812,7 @@ void BSplCLib::Reverse(TColStd_Array1OfInteger& Mults) { Standard_Integer first = Mults.Lower(); Standard_Integer last = Mults.Upper(); - Standard_Integer temp; + Standard_Integer temp = 0; while (first < last) { temp = Mults(first); @@ -829,7 +831,7 @@ void BSplCLib::Reverse(TColStd_Array1OfInteger& Mults) void BSplCLib::Reverse(TColStd_Array1OfReal& Weights, const Standard_Integer L) { - Standard_Integer i, l = L; + Standard_Integer i = 0, l = L; l = Weights.Lower()+(l-Weights.Lower())%(Weights.Upper()-Weights.Lower()+1); TColStd_Array1OfReal temp(0,Weights.Length()-1); @@ -855,7 +857,7 @@ Standard_Boolean BSplCLib::IsRational(const TColStd_Array1OfReal& Weights, // const Standard_Real Epsi) const Standard_Real ) { - Standard_Integer i, f = Weights.Lower(), l = Weights.Length(); + Standard_Integer i = 0, f = Weights.Lower(), l = Weights.Length(); Standard_Integer I3 = I2 - f; const Standard_Real * WG = &Weights(f); WG -= f; @@ -877,8 +879,8 @@ void BSplCLib::Eval(const Standard_Real U, const Standard_Integer Dimension, Standard_Real& Poles) { - Standard_Integer step,i,Dms,Dm1,Dpi,Sti; - Standard_Real X, Y, *poles, *knots = &Knots; + Standard_Integer step = 0,i = 0,Dms = 0,Dm1 = 0,Dpi = 0,Sti = 0; + Standard_Real X = NAN, Y = NAN, *poles = nullptr, *knots = &Knots; Dm1 = Dms = Degree; Dm1--; Dms++; @@ -967,7 +969,7 @@ void BSplCLib::Eval(const Standard_Real U, break; } default : { - Standard_Integer k; + Standard_Integer k = 0; for (step = - 1; step < Dm1; step++) { Dms--; @@ -1032,9 +1034,9 @@ void BSplCLib::BoorScheme(const Standard_Real U, // P(0,0) P(1,0) P(2,0) ...... P(2,l-1) P(1,l-1) P(0,l) // - Standard_Integer i,k,step; + Standard_Integer i = 0,k = 0,step = 0; Standard_Real *knots = &Knots; - Standard_Real *pole, *firstpole = &Poles - 2 * Dimension; + Standard_Real *pole = nullptr, *firstpole = &Poles - 2 * Dimension; // the steps of recursion for (step = 0; step < Depth; step++) { @@ -1073,9 +1075,9 @@ Standard_Boolean BSplCLib::AntiBoorScheme(const Standard_Real U, { // do the Boor scheme reverted. - Standard_Integer i,k,step, half_length; + Standard_Integer i = 0,k = 0,step = 0, half_length = 0; Standard_Real *knots = &Knots; - Standard_Real z,X,Y,*pole, *firstpole = &Poles + (Depth-1) * Dimension; + Standard_Real z = NAN,X = NAN,Y = NAN,*pole = nullptr, *firstpole = &Poles + (Depth-1) * Dimension; // Test the special case length = 1 // only verification of the central point @@ -1152,7 +1154,7 @@ void BSplCLib::Derivative(const Standard_Integer Degree, const Standard_Integer Order, Standard_Real& Poles) { - Standard_Integer i,k,step,span = Degree; + Standard_Integer i = 0,k = 0,step = 0,span = Degree; Standard_Real *knot = &Knots; for (step = 1; step <= Order; step++) { @@ -1184,8 +1186,8 @@ void BSplCLib::Bohm(const Standard_Real U, Standard_Real& Poles) { // First phase independent of U, compute the poles of the derivatives - Standard_Integer i,j,iDim,min,Dmi,DDmi,jDmi,Degm1; - Standard_Real *knot = &Knots, *pole, coef, *tbis, *psav, *psDD, *psDDmDim; + Standard_Integer i = 0,j = 0,iDim = 0,min = 0,Dmi = 0,DDmi = 0,jDmi = 0,Degm1 = 0; + Standard_Real *knot = &Knots, *pole = nullptr, coef = NAN, *tbis = nullptr, *psav = nullptr, *psDD = nullptr, *psDDmDim = nullptr; psav = &Poles; if (N < Degree) min = N; else min = Degree; @@ -1391,7 +1393,7 @@ void BSplCLib::Bohm(const Standard_Real U, break; } default : { - Standard_Integer k; + Standard_Integer k = 0; Standard_Integer Dim2 = Dimension << 1; psDD = psav + Degree * Dimension; psDDmDim = psDD - Dimension; @@ -1533,7 +1535,7 @@ void BSplCLib::BuildKnots(const Standard_Integer Degree, break; } default : { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Standard_Integer Deg2 = Degree << 1; j = Index - Degree; @@ -1545,7 +1547,7 @@ void BSplCLib::BuildKnots(const Standard_Integer Degree, } } else { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer Deg1 = Degree - 1; Standard_Integer KUpper = Knots.Upper(); Standard_Integer MLower = Mults->Lower(); @@ -1611,7 +1613,7 @@ Standard_Integer BSplCLib::PoleIndex(const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfInteger& Mults) { - Standard_Integer i, pindex = 0; + Standard_Integer i = 0, pindex = 0; for (i = Mults.Lower(); i <= Index; i++) pindex += Mults(i); @@ -1635,7 +1637,7 @@ void BSplCLib::BuildBoor(const Standard_Integer Index, Standard_Real& LP) { Standard_Real *poles = &LP; - Standard_Integer i,k, ip = Poles.Lower() + Index * Dimension; + Standard_Integer i = 0,k = 0, ip = Poles.Lower() + Index * Dimension; for (i = 0; i < Length+1; i++) { @@ -1675,7 +1677,7 @@ void BSplCLib::GetPole(const Standard_Integer Index, Standard_Integer& Position, TColStd_Array1OfReal& Pole) { - Standard_Integer k; + Standard_Integer k = 0; Standard_Real* pole = &LP + BoorIndex(Index,Length,Depth) * Dimension; for (k = 0; k < Dimension; k++) { @@ -1704,7 +1706,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots { Standard_Boolean addflat = AddMults == NULL; - Standard_Integer first,last; + Standard_Integer first = 0,last = 0; if (Periodic) { first = Knots.Lower(); last = Knots.Upper(); @@ -1718,7 +1720,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots if (adeltaK1 > Tolerance) return Standard_False; if (adeltaK2 > Tolerance) return Standard_False; - Standard_Integer sigma = 0, mult, amult; + Standard_Integer sigma = 0, mult = 0, amult = 0; NbKnots = 0; Standard_Integer k = Knots.Lower() - 1; Standard_Integer ak = AddKnots.Lower(); @@ -1733,7 +1735,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots } Standard_Integer aLastKnotMult = Mults (Knots.Upper()); - Standard_Real au,oldau = AddKnots(ak),Eps; + Standard_Real au = NAN,oldau = AddKnots(ak),Eps = NAN; while (ak <= AddKnots.Upper()) { au = AddKnots(ak); @@ -1855,7 +1857,7 @@ static void Copy(const Standard_Integer NbPoles, (NewFirst - NewPoles.Lower()) % (NewPoles.Upper() - NewPoles.Lower() + 1); // copy - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= NbPoles; i++) { NewPoles(NewFirst) = OldPoles(OldFirst); @@ -1888,12 +1890,12 @@ void BSplCLib::InsertKnots { Standard_Boolean addflat = AddMults == NULL; - Standard_Integer i,k,mult,firstmult; - Standard_Integer index,kn,curnk,curk; - Standard_Integer p,np, curp, curnp, length, depth; - Standard_Real u; - Standard_Integer need; - Standard_Real Eps; + Standard_Integer i = 0,k = 0,mult = 0,firstmult = 0; + Standard_Integer index = 0,kn = 0,curnk = 0,curk = 0; + Standard_Integer p = 0,np = 0, curp = 0, curnp = 0, length = 0, depth = 0; + Standard_Real u = NAN; + Standard_Integer need = 0; + Standard_Real Eps = NAN; // ------------------- // create local arrays @@ -2137,12 +2139,12 @@ Standard_Boolean BSplCLib::RemoveKnot TColStd_Array1OfInteger& NewMults, const Standard_Real Tolerance) { - Standard_Integer index,i,j,k,p,np; + Standard_Integer index = 0,i = 0,j = 0,k = 0,p = 0,np = 0; Standard_Integer TheIndex = Index; // protection - Standard_Integer first,last; + Standard_Integer first = 0,last = 0; if (Periodic) { first = Knots.Lower(); last = Knots.Upper(); @@ -2299,7 +2301,7 @@ Standard_Integer BSplCLib::IncreaseDegreeCountKnots if (Periodic) return Mults.Length(); Standard_Integer f = FirstUKnotIndex(Degree,Mults); Standard_Integer l = LastUKnotIndex(Degree,Mults); - Standard_Integer m,i,removed = 0, step = NewDegree - Degree; + Standard_Integer m = 0,i = 0,removed = 0, step = NewDegree - Degree; i = Mults.Lower(); m = Degree + (f - i + 1) * step + 1; @@ -2370,7 +2372,7 @@ void BSplCLib::IncreaseDegree // create the working curve //------------------------- - Standard_Integer i,k,f,l,m,pf,pl,firstknot; + Standard_Integer i = 0,k = 0,f = 0,l = 0,m = 0,pf = 0,pl = 0,firstknot = 0; pf = 0; // number of null poles added at beginning pl = 0; // number of null poles added at end @@ -2485,7 +2487,7 @@ void BSplCLib::IncreaseDegree // Loop on degree incrementation //------------------------------ - Standard_Integer step,curDeg; + Standard_Integer step = 0,curDeg = 0; Standard_Integer nbp = nbwpoles; nbwp = nbp; @@ -2653,7 +2655,7 @@ void BSplCLib::PrepareUnperiodize Standard_Integer& NbKnots, Standard_Integer& NbPoles) { - Standard_Integer i; + Standard_Integer i = 0; // initialize NbKnots and NbPoles NbKnots = Mults.Length(); NbPoles = - Degree - 1; @@ -2661,7 +2663,7 @@ void BSplCLib::PrepareUnperiodize for (i = Mults.Lower(); i <= Mults.Upper(); i++) NbPoles += Mults(i); - Standard_Integer sigma, k; + Standard_Integer sigma = 0, k = 0; // Add knots at the beginning of the curve to raise Multiplicities // to Degre + 1; sigma = Mults(Mults.Lower()); @@ -2710,7 +2712,7 @@ void BSplCLib::Unperiodize TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewPoles) { - Standard_Integer sigma, k, index = 0; + Standard_Integer sigma = 0, k = 0, index = 0; // evaluation of index : number of knots to insert before knot(1) to // raise sum of multiplicities to sigma = Mults(Mults.Lower()); @@ -2768,8 +2770,8 @@ void BSplCLib::PrepareTrimming(const Standard_Integer Degree, Standard_Integer& NbKnots, Standard_Integer& NbPoles) { - Standard_Integer i; - Standard_Real NewU1, NewU2; + Standard_Integer i = 0; + Standard_Real NewU1 = NAN, NewU2 = NAN; Standard_Integer index1 = 0, index2 = 0; // Eval index1, index2 : position of U1 and U2 in the Array Knots @@ -2810,7 +2812,7 @@ void BSplCLib::Trimming(const Standard_Integer Degree, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewPoles) { - Standard_Integer i, nbpoles=0, nbknots=0; + Standard_Integer i = 0, nbpoles=0, nbknots=0; Standard_Real kk[2] = { U1, U2 }; Standard_Integer mm[2] = { Degree, Degree }; TColStd_Array1OfReal K( kk[0], 1, 2 ); @@ -2833,8 +2835,8 @@ void BSplCLib::Trimming(const Standard_Integer Degree, Standard_False); // find in TempPoles the index of the pole corresponding to U1 - Standard_Integer Kindex = 0, Pindex; - Standard_Real NewU1; + Standard_Integer Kindex = 0, Pindex = 0; + Standard_Real NewU1 = NAN; LocateParameter( Degree, TempKnots, TempMults, U1, Periodic, TempKnots.Lower(), TempKnots.Upper(), Kindex, NewU1); Pindex = PoleIndex ( Degree, Kindex, Periodic, TempMults); @@ -2862,15 +2864,15 @@ BSplCLib::SolveBandedSystem(const math_Matrix& Matrix, const Standard_Integer ArrayDimension, Standard_Real& Array) { - Standard_Integer ii, - jj, - kk, - MinIndex, - MaxIndex, + Standard_Integer ii = 0, + jj = 0, + kk = 0, + MinIndex = 0, + MaxIndex = 0, ReturnCode = 0 ; Standard_Real *PolesArray = &Array ; - Standard_Real Inverse ; + Standard_Real Inverse = NAN ; if (Matrix.LowerCol() != 1 || @@ -2940,12 +2942,12 @@ BSplCLib::SolveBandedSystem(const math_Matrix& Matrix, Standard_Real& Poles, Standard_Real& Weights) { - Standard_Integer ii, - kk, + Standard_Integer ii = 0, + kk = 0, ErrorCode = 0, ReturnCode = 0 ; - Standard_Real Inverse, + Standard_Real Inverse = NAN, *PolesArray = &Poles, *WeightsArray = &Weights ; @@ -3006,9 +3008,9 @@ void BSplCLib::BuildSchoenbergPoints(const Standard_Integer Degree, const TColStd_Array1OfReal& FlatKnots, TColStd_Array1OfReal& Parameters) { - Standard_Integer ii, - jj ; - Standard_Real Inverse ; + Standard_Integer ii = 0, + jj = 0 ; + Standard_Real Inverse = NAN ; Inverse = 1.0e0 / (Standard_Real)Degree ; for (ii = Parameters.Lower() ; ii <= Parameters.Upper() ; ii++) { @@ -3034,9 +3036,9 @@ void BSplCLib::Interpolate(const Standard_Integer Degree, Standard_Real& Poles, Standard_Integer& InversionProblem) { - Standard_Integer ErrorCode, - UpperBandWidth, - LowerBandWidth ; + Standard_Integer ErrorCode = 0, + UpperBandWidth = 0, + LowerBandWidth = 0 ; // Standard_Real *PolesArray = &Poles ; math_Matrix InterpolationMatrix(1, Parameters.Length(), 1, 2 * Degree + 1) ; @@ -3083,9 +3085,9 @@ void BSplCLib::Interpolate(const Standard_Integer Degree, Standard_Real& Weights, Standard_Integer& InversionProblem) { - Standard_Integer ErrorCode, - UpperBandWidth, - LowerBandWidth ; + Standard_Integer ErrorCode = 0, + UpperBandWidth = 0, + LowerBandWidth = 0 ; math_Matrix InterpolationMatrix(1, Parameters.Length(), 1, 2 * Degree + 1) ; @@ -3142,28 +3144,28 @@ void BSplCLib::Eval Standard_Real& PolesResults, Standard_Real& WeightsResults) { - Standard_Integer ii, - jj, + Standard_Integer ii = 0, + jj = 0, kk=0, - Index, - Index1, - Index2, - *ExtrapModeArray, - Modulus, - NewRequest, + Index = 0, + Index1 = 0, + Index2 = 0, + *ExtrapModeArray = nullptr, + Modulus = 0, + NewRequest = 0, ExtrapolatingFlag[2], - ErrorCode, + ErrorCode = 0, Order = Degree + 1, - FirstNonZeroBsplineIndex, + FirstNonZeroBsplineIndex = 0, LocalRequest = DerivativeRequest ; - Standard_Real *PResultArray, - *WResultArray, - *PolesArray, - *WeightsArray, - LocalParameter, - Period, - Inverse, - Delta ; + Standard_Real *PResultArray = nullptr, + *WResultArray = nullptr, + *PolesArray = nullptr, + *WeightsArray = nullptr, + LocalParameter = NAN, + Period = NAN, + Inverse = NAN, + Delta = NAN ; PolesArray = &Poles ; WeightsArray = &Weights ; ExtrapModeArray = &ExtrapMode ; @@ -3341,26 +3343,26 @@ void BSplCLib::Eval Standard_Real& Poles, Standard_Real& Results) { - Standard_Integer ii, - jj, - kk, - Index, - Index1, - *ExtrapModeArray, - Modulus, - NewRequest, + Standard_Integer ii = 0, + jj = 0, + kk = 0, + Index = 0, + Index1 = 0, + *ExtrapModeArray = nullptr, + Modulus = 0, + NewRequest = 0, ExtrapolatingFlag[2], - ErrorCode, + ErrorCode = 0, Order = Degree + 1, - FirstNonZeroBsplineIndex, + FirstNonZeroBsplineIndex = 0, LocalRequest = DerivativeRequest ; - Standard_Real *ResultArray, - *PolesArray, - LocalParameter, - Period, - Inverse, - Delta ; + Standard_Real *ResultArray = nullptr, + *PolesArray = nullptr, + LocalParameter = NAN, + Period = NAN, + Inverse = NAN, + Delta = NAN ; PolesArray = &Poles ; ExtrapModeArray = &ExtrapMode ; @@ -3543,7 +3545,7 @@ void BSplCLib::TangExtendToConstraint // position at the node of connection - Standard_Real Tbord ; + Standard_Real Tbord = NAN ; if (After) { Tbord = FlatKnots(FlatKnots.Upper()-CDegree); } @@ -3551,7 +3553,7 @@ void BSplCLib::TangExtendToConstraint Tbord = FlatKnots(FlatKnots.Lower()+CDegree); } Standard_Boolean periodic_flag = Standard_False ; - Standard_Integer ipos, extrap_mode[2], derivative_request = Max(Continuity,1); + Standard_Integer ipos = 0, extrap_mode[2], derivative_request = Max(Continuity,1); extrap_mode[0] = extrap_mode[1] = CDegree; TColStd_Array1OfReal EvalBS(1, CDimension * (derivative_request+1)) ; Standard_Real * Eadr = (Standard_Real *) &EvalBS(1) ; @@ -3591,7 +3593,7 @@ void BSplCLib::TangExtendToConstraint } // calculate the coefficients of extension - Standard_Integer ii, jj, kk; + Standard_Integer ii = 0, jj = 0, kk = 0; TColStd_Array1OfReal ExtraCoeffs(1,Csize*CDimension); ExtraCoeffs.Init(0.); @@ -3666,7 +3668,7 @@ void BSplCLib::TangExtendToConstraint //////////////////////////////////////////////////////////////////////// // ratio of reparametrization - Standard_Real Ratio=1, Delta; + Standard_Real Ratio=1, Delta = NAN; if ( (L1 > Precision::Confusion()) && (L2 > Precision::Confusion()) ) { Ratio = L2 / L1; } @@ -3688,7 +3690,7 @@ void BSplCLib::TangExtendToConstraint TColStd_Array1OfReal NewFlats (1, NbK1+NbK2-CDegree-2); // poles - Standard_Integer indNP, indP, indEP; + Standard_Integer indNP = 0, indP = 0, indEP = 0; if (After) { for (ii=1; ii<=NbP1+NbP2-1; ii++) { @@ -3918,15 +3920,15 @@ void BSplCLib::Resolution( Standard_Real& Poles, const Standard_Real Tolerance3D, Standard_Real& UTolerance) { - Standard_Integer ii,num_poles,ii_index,jj_index,ii_inDim; - Standard_Integer lower,upper,ii_minus,jj,ii_miDim; + Standard_Integer ii = 0,num_poles = 0,ii_index = 0,jj_index = 0,ii_inDim = 0; + Standard_Integer lower = 0,upper = 0,ii_minus = 0,jj = 0,ii_miDim = 0; Standard_Integer Deg1 = Degree + 1; Standard_Integer Deg2 = (Degree << 1) + 1; - Standard_Real value,factor,W,min_weights,inverse; - Standard_Real pa_ii_inDim_0, pa_ii_inDim_1, pa_ii_inDim_2, pa_ii_inDim_3; - Standard_Real pa_ii_miDim_0, pa_ii_miDim_1, pa_ii_miDim_2, pa_ii_miDim_3; - Standard_Real wg_ii_index, wg_ii_minus; - Standard_Real *PA,max_derivative; + Standard_Real value = NAN,factor = NAN,W = NAN,min_weights = NAN,inverse = NAN; + Standard_Real pa_ii_inDim_0 = NAN, pa_ii_inDim_1 = NAN, pa_ii_inDim_2 = NAN, pa_ii_inDim_3 = NAN; + Standard_Real pa_ii_miDim_0 = NAN, pa_ii_miDim_1 = NAN, pa_ii_miDim_2 = NAN, pa_ii_miDim_3 = NAN; + Standard_Real wg_ii_index = NAN, wg_ii_minus = NAN; + Standard_Real *PA = nullptr,max_derivative = NAN; const Standard_Real * FK = &FlatKnots(FlatKnots.Lower()); PA = &Poles; max_derivative = 0.0e0; @@ -4164,7 +4166,7 @@ void BSplCLib::Resolution( Standard_Real& Poles, break; } default : { - Standard_Integer kk; + Standard_Integer kk = 0; if (Weights != NULL) { const Standard_Real * WG = &(*Weights)(Weights->Lower()); min_weights = WG[0]; @@ -4302,7 +4304,7 @@ Standard_Integer BSplCLib::Intervals (const TColStd_Array1OfReal& theKnots, // locate the left and nearest knot for boundaries Standard_Integer anIndex1 = 0; Standard_Integer anIndex2 = 0; - Standard_Real aDummyDouble; + Standard_Real aDummyDouble = NAN; // we use version of LocateParameter that doesn't need multiplicities LocateParameter(theDegree, aNewKnots, TColStd_Array1OfInteger(), aCurFirst, Standard_False, 1, aNbNewKnots, anIndex1, aDummyDouble); LocateParameter(theDegree, aNewKnots, TColStd_Array1OfInteger(), aCurLast, Standard_False, 1, aNbNewKnots, anIndex2, aDummyDouble); diff --git a/src/BSplCLib/BSplCLib_2.cxx b/src/BSplCLib/BSplCLib_2.cxx index 0ae8628e5c..7d406cbcdc 100644 --- a/src/BSplCLib/BSplCLib_2.cxx +++ b/src/BSplCLib/BSplCLib_2.cxx @@ -18,6 +18,8 @@ // EvalBsplineBasis, // EvalPolynomial : Horners method +#include + #include #include @@ -46,9 +48,9 @@ struct BSplCLib_DataContainer "BSplCLib: bspline degree is greater than maximum supported"); } - Standard_Real poles[2*(25+1)]; - Standard_Real knots[2*25]; - Standard_Real ders[4]; + Standard_Real poles[2*(25+1)]{}; + Standard_Real knots[2*25]{}; + Standard_Real ders[4]{}; }; // methods for 1 dimensional BSplines @@ -66,9 +68,9 @@ void BSplCLib::BuildEval(const Standard_Integer Degree, { Standard_Integer PLower = Poles.Lower(); Standard_Integer PUpper = Poles.Upper(); - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer ip = PLower + Index - 1; - Standard_Real w, *pole = &LP; + Standard_Real w = NAN, *pole = &LP; if (Weights == NULL) { for (i = 0; i <= Degree; i++) { @@ -153,9 +155,9 @@ void BSplCLib::D0 const TColStd_Array1OfInteger* Mults, Standard_Real& P) { - Standard_Integer dim,index = Index; + Standard_Integer dim = 0,index = Index; Standard_Real u = U; - Standard_Boolean rational; + Standard_Boolean rational = 0; BSplCLib_DataContainer dc(Degree); PrepareEval(u,index,dim,rational,Degree,Periodic,Poles,Weights,Knots,Mults,dc); BSplCLib::Eval(u,Degree,*dc.knots,dim,*dc.poles); @@ -180,9 +182,9 @@ void BSplCLib::D1 Standard_Real& P, Standard_Real& V) { - Standard_Integer dim,index = Index; + Standard_Integer dim = 0,index = Index; Standard_Real u = U; - Standard_Boolean rational; + Standard_Boolean rational = 0; BSplCLib_DataContainer dc(Degree); PrepareEval(u,index,dim,rational,Degree,Periodic,Poles,Weights,Knots,Mults,dc); BSplCLib::Bohm(u,Degree,1,*dc.knots,dim,*dc.poles); @@ -213,9 +215,9 @@ void BSplCLib::D2 Standard_Real& V1, Standard_Real& V2) { - Standard_Integer dim,index = Index; + Standard_Integer dim = 0,index = Index; Standard_Real u = U; - Standard_Boolean rational; + Standard_Boolean rational = 0; BSplCLib_DataContainer dc(Degree); PrepareEval(u,index,dim,rational,Degree,Periodic,Poles,Weights,Knots,Mults,dc); BSplCLib::Bohm(u,Degree,2,*dc.knots,dim,*dc.poles); @@ -249,9 +251,9 @@ void BSplCLib::D3 Standard_Real& V2, Standard_Real& V3) { - Standard_Integer dim,index = Index; + Standard_Integer dim = 0,index = Index; Standard_Real u = U; - Standard_Boolean rational; + Standard_Boolean rational = 0; BSplCLib_DataContainer dc(Degree); PrepareEval(u,index,dim,rational,Degree,Periodic,Poles,Weights,Knots,Mults,dc); BSplCLib::Bohm(u,Degree,3,*dc.knots,dim,*dc.poles); @@ -285,14 +287,14 @@ void BSplCLib::DN const TColStd_Array1OfInteger* Mults, Standard_Real& VN) { - Standard_Integer dim,index = Index; + Standard_Integer dim = 0,index = Index; Standard_Real u = U; - Standard_Boolean rational; + Standard_Boolean rational = 0; BSplCLib_DataContainer dc(Degree); PrepareEval(u,index,dim,rational,Degree,Periodic,Poles,Weights,Knots,Mults,dc); BSplCLib::Bohm(u,Degree,N,*dc.knots,dim,*dc.poles); if (rational) { - Standard_Real v; + Standard_Real v = NAN; PLib::RationalDerivative(Degree,N,1,*dc.poles,v,Standard_False); VN = v; } @@ -316,15 +318,15 @@ BSplCLib::BuildBSpMatrix(const TColStd_Array1OfReal& Parameters, Standard_Integer& UpperBandWidth, Standard_Integer& LowerBandWidth) { - Standard_Integer ii, - jj, - Index, - ErrorCode, + Standard_Integer ii = 0, + jj = 0, + Index = 0, + ErrorCode = 0, ReturnCode = 0, - FirstNonZeroBsplineIndex, - BandWidth, + FirstNonZeroBsplineIndex = 0, + BandWidth = 0, MaxOrder = BSplCLib::MaxDegree() + 1, - Order ; + Order = 0 ; math_Matrix BSplineBasis(1, MaxOrder, 1, MaxOrder) ; @@ -384,16 +386,16 @@ BSplCLib::FactorBandedMatrix(math_Matrix& Matrix, const Standard_Integer LowerBandWidth, Standard_Integer& PivotIndexProblem) { - Standard_Integer ii, - jj, - kk, - Index, - MinIndex, - MaxIndex, + Standard_Integer ii = 0, + jj = 0, + kk = 0, + Index = 0, + MinIndex = 0, + MaxIndex = 0, ReturnCode = 0, BandWidth = UpperBandWidth + LowerBandWidth + 1 ; - Standard_Real Inverse ; + Standard_Real Inverse = NAN ; PivotIndexProblem = 0 ; for (ii = Matrix.LowerRow() + 1 ; ii <= Matrix.UpperRow() ; ii++) { @@ -460,20 +462,20 @@ BSplCLib::EvalBsplineBasis // i i+1 i+k-1 // Standard_Integer - ReturnCode, - ii, - pp, - qq, - ss, - NumPoles, - LocalRequest ; + ReturnCode = 0, + ii = 0, + pp = 0, + qq = 0, + ss = 0, + NumPoles = 0, + LocalRequest = 0 ; // ,Index ; - Standard_Real NewParameter, - Inverse, - Factor, - LocalInverse, - Saved ; + Standard_Real NewParameter = NAN, + Inverse = NAN, + Factor = NAN, + LocalInverse = NAN, + Saved = NAN ; // , *FlatKnotsArray ; ReturnCode = 0 ; @@ -575,30 +577,30 @@ void BSplCLib::MovePointAndTangent(const Standard_Real U, Standard_Real& NewPoles, Standard_Integer& ErrorStatus) { - Standard_Integer num_poles, - num_knots, - ii, - jj, - conditions, - start_num_poles, - end_num_poles, - index, - start_index, - end_index, - other_index, - type, - order ; + Standard_Integer num_poles = 0, + num_knots = 0, + ii = 0, + jj = 0, + conditions = 0, + start_num_poles = 0, + end_num_poles = 0, + index = 0, + start_index = 0, + end_index = 0, + other_index = 0, + type = 0, + order = 0 ; - Standard_Real new_parameter, - value, - divide, - end_value, - start_value, - *poles_array, - *new_poles_array, - *delta_array, - *derivatives_array, - *weights_array ; + Standard_Real new_parameter = NAN, + value = NAN, + divide = NAN, + end_value = NAN, + start_value = NAN, + *poles_array = nullptr, + *new_poles_array = nullptr, + *delta_array = nullptr, + *derivatives_array = nullptr, + *weights_array = nullptr ; ErrorStatus = 0 ; weights_array = NULL ; @@ -883,18 +885,18 @@ void BSplCLib::FunctionMultiply Standard_Real & NewPoles, Standard_Integer & theStatus) { - Standard_Integer ii, - jj, - index ; + Standard_Integer ii = 0, + jj = 0, + index = 0 ; Standard_Integer extrap_mode[2], - error_code, - num_new_poles, + error_code = 0, + num_new_poles = 0, derivative_request = 0 ; Standard_Boolean periodic_flag = Standard_False ; - Standard_Real result, + Standard_Real result = NAN, start_end[2], - *array_of_poles, - *array_of_new_poles ; + *array_of_poles = nullptr, + *array_of_new_poles = nullptr ; array_of_poles = (Standard_Real *) &NewPoles ; extrap_mode[0] = @@ -982,18 +984,18 @@ void BSplCLib::FunctionReparameterise Standard_Real & NewPoles, Standard_Integer & theStatus) { - Standard_Integer ii, + Standard_Integer ii = 0, // jj, - index ; + index = 0 ; Standard_Integer extrap_mode[2], - error_code, - num_new_poles, + error_code = 0, + num_new_poles = 0, derivative_request = 0 ; Standard_Boolean periodic_flag = Standard_False ; - Standard_Real result, + Standard_Real result = NAN, start_end[2], - *array_of_poles, - *array_of_new_poles ; + *array_of_poles = nullptr, + *array_of_new_poles = nullptr ; array_of_poles = (Standard_Real *) &NewPoles ; extrap_mode[0] = @@ -1149,13 +1151,13 @@ void BSplCLib::MergeBSplineKnots Handle(TColStd_HArray1OfReal) & NewKnots, Handle(TColStd_HArray1OfInteger) & NewMults) { - Standard_Integer ii, - jj, - continuity, - set_mults_flag, - degree, - index, - num_knots ; + Standard_Integer ii = 0, + jj = 0, + continuity = 0, + set_mults_flag = 0, + degree = 0, + index = 0, + num_knots = 0 ; if (StartValue < EndValue - Tolerance) { TColStd_Array1OfReal knots1(1, Knots1.Length()); TColStd_Array1OfReal knots2(1, Knots2.Length()); diff --git a/src/BSplCLib/BSplCLib_BzSyntaxes.cxx b/src/BSplCLib/BSplCLib_BzSyntaxes.cxx index 5a386157f9..2f460c3d91 100644 --- a/src/BSplCLib/BSplCLib_BzSyntaxes.cxx +++ b/src/BSplCLib/BSplCLib_BzSyntaxes.cxx @@ -39,8 +39,8 @@ class BSplCLib_BezierArrays } private: - Standard_Real aKnots[2]; - Standard_Integer aMults[2]; + Standard_Real aKnots[2]{}; + Standard_Integer aMults[2]{}; public: TColStd_Array1OfReal knots; diff --git a/src/BSplSLib/BSplSLib.cxx b/src/BSplSLib/BSplSLib.cxx index 2669af759d..ad6004e55e 100644 --- a/src/BSplSLib/BSplSLib.cxx +++ b/src/BSplSLib/BSplSLib.cxx @@ -21,6 +21,8 @@ // pmn 07-10-96 : Correction de DN dans le cas rationnal. // pmn 06-02-97 : Correction des poids dans RationalDerivative. (PRO700) +#include + #include #include #include @@ -52,10 +54,10 @@ struct BSplSLib_DataContainer VDegree > BSplCLib::MaxDegree() || BSplCLib::MaxDegree() > 25, "BSplSLib: bspline degree is greater than maximum supported"); } - Standard_Real poles[4*(25+1)*(25+1)]; - Standard_Real knots1[2*25]; - Standard_Real knots2[2*25]; - Standard_Real ders[48]; + Standard_Real poles[4*(25+1)*(25+1)]{}; + Standard_Real knots1[2*25]{}; + Standard_Real knots2[2*25]{}; + Standard_Real ders[48]{}; }; //************************************************************************** @@ -122,10 +124,10 @@ void BSplSLib::RationalDerivative(const Standard_Integer UDeg, // Numerator Denominator ... Numerator Denominator // // - Standard_Integer ii,jj,pp,qq,index,index1,index2; - Standard_Integer M1,M3,M4,N1,iiM1,iiM3,jjM1,ppM1,ppM3; - Standard_Integer MinN,MinN1,MinM,MinM1; - Standard_Integer index_u,index_u1,index_v,index_v1,index_w; + Standard_Integer ii = 0,jj = 0,pp = 0,qq = 0,index = 0,index1 = 0,index2 = 0; + Standard_Integer M1 = 0,M3 = 0,M4 = 0,N1 = 0,iiM1 = 0,iiM3 = 0,jjM1 = 0,ppM1 = 0,ppM3 = 0; + Standard_Integer MinN = 0,MinN1 = 0,MinM = 0,MinM1 = 0; + Standard_Integer index_u = 0,index_u1 = 0,index_v = 0,index_v1 = 0,index_w = 0; M1 = M + 1; N1 = N + 1; @@ -137,7 +139,7 @@ void BSplSLib::RationalDerivative(const Standard_Integer UDeg, Standard_Real *RArray = (All ? &RDerivatives : (Standard_Real*)StoreDerivatives); NCollection_LocalArray StoreW (ii); Standard_Real *HomogeneousArray = &HDerivatives; - Standard_Real denominator,Pii,Pip,Pjq; + Standard_Real denominator = NAN,Pii = NAN,Pip = NAN,Pjq = NAN; denominator = 1.0e0 / HomogeneousArray[3]; index_u = 0; @@ -322,8 +324,8 @@ static Standard_Boolean PrepareEval (const Standard_Real U, vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,*VMults); // get the poles - Standard_Integer i,j,ip,jp; - Standard_Real w, *pole = dc.poles; + Standard_Integer i = 0,j = 0,ip = 0,jp = 0; + Standard_Real w = NAN, *pole = dc.poles; d1 = UDegree; d2 = VDegree; Standard_Integer PLowerRow = Poles.LowerRow(); @@ -343,7 +345,7 @@ static Standard_Boolean PrepareEval (const Standard_Real U, w = Weights->Value(ip,jp); Standard_Real eps = Epsilon(w); - Standard_Real dw; + Standard_Real dw = NAN; for (i = 0; i <= UDegree && !rational; i++) { @@ -473,8 +475,8 @@ static Standard_Boolean PrepareEval (const Standard_Real U, vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,*VMults); // get the poles - Standard_Integer i,j,ip,jp; - Standard_Real w, *pole = dc.poles; + Standard_Integer i = 0,j = 0,ip = 0,jp = 0; + Standard_Real w = NAN, *pole = dc.poles; d1 = VDegree; d2 = UDegree; Standard_Integer PLowerRow = Poles.LowerRow(); @@ -497,7 +499,7 @@ static Standard_Boolean PrepareEval (const Standard_Real U, w = Weights->Value(ip,jp); Standard_Real eps = Epsilon(w); - Standard_Real dw; + Standard_Real dw = NAN; for (i = 0; i <= UDegree && !rational; i++) { @@ -625,7 +627,7 @@ void BSplSLib::D0 gp_Pnt& P) { // Standard_Integer k ; - Standard_Real W ; + Standard_Real W = NAN ; HomogeneousD0(U, V, UIndex, @@ -674,11 +676,11 @@ void BSplSLib::HomogeneousD0 Standard_Real & W, gp_Pnt& P) { - Standard_Boolean rational; + Standard_Boolean rational = 0; // Standard_Integer k,dim; - Standard_Integer dim; - Standard_Real u1,u2; - Standard_Integer d1,d2; + Standard_Integer dim = 0; + Standard_Real u1 = NAN,u2 = NAN; + Standard_Integer d1 = 0,d2 = 0; W = 1.0e0 ; BSplSLib_DataContainer dc (UDegree, VDegree); @@ -730,12 +732,12 @@ void BSplSLib::D1 gp_Vec& Vu, gp_Vec& Vv) { - Standard_Boolean rational; + Standard_Boolean rational = 0; // Standard_Integer k,dim,dim2; - Standard_Integer dim,dim2; - Standard_Real u1,u2; - Standard_Integer d1,d2; - Standard_Real *result, *resVu, *resVv; + Standard_Integer dim = 0,dim2 = 0; + Standard_Real u1 = NAN,u2 = NAN; + Standard_Integer d1 = 0,d2 = 0; + Standard_Real *result = nullptr, *resVu = nullptr, *resVv = nullptr; BSplSLib_DataContainer dc (UDegree, VDegree); if (PrepareEval (U,V,UIndex,VIndex,UDegree,VDegree,URat,VRat,UPer,VPer, @@ -831,11 +833,11 @@ void BSplSLib::HomogeneousD1 Standard_Real& Du, Standard_Real& Dv) { - Standard_Boolean rational; + Standard_Boolean rational = 0; // Standard_Integer k,dim; - Standard_Integer dim; - Standard_Real u1,u2; - Standard_Integer d1,d2; + Standard_Integer dim = 0; + Standard_Real u1 = NAN,u2 = NAN; + Standard_Integer d1 = 0,d2 = 0; D = 1.0e0 ; Du = 0.0e0 ; @@ -851,7 +853,7 @@ void BSplSLib::HomogeneousD1 BSplCLib::Bohm(u2,d2,1,*dc.knots2,dim,*dc.poles); BSplCLib::Eval(u2,d2,*dc.knots2,dim,*(dc.poles+dim*(d2+1))); - Standard_Real *result, *resVu, *resVv; + Standard_Real *result = nullptr, *resVu = nullptr, *resVv = nullptr; result = dc.poles; resVu = result + (ufirst ? dim*(d2+1) : dim); resVv = result + (ufirst ? dim : dim*(d2+1)); @@ -904,12 +906,12 @@ void BSplSLib::D2 gp_Vec& Vvv, gp_Vec& Vuv) { - Standard_Boolean rational; + Standard_Boolean rational = 0; // Standard_Integer k,dim,dim2; - Standard_Integer dim,dim2; - Standard_Real u1,u2; - Standard_Integer d1,d2; - Standard_Real *result, *resVu, *resVv, *resVuu, *resVvv, *resVuv; + Standard_Integer dim = 0,dim2 = 0; + Standard_Real u1 = NAN,u2 = NAN; + Standard_Integer d1 = 0,d2 = 0; + Standard_Real *result = nullptr, *resVu = nullptr, *resVv = nullptr, *resVuu = nullptr, *resVvv = nullptr, *resVuv = nullptr; BSplSLib_DataContainer dc (UDegree, VDegree); if (PrepareEval (U,V,UIndex,VIndex,UDegree,VDegree,URat,VRat,UPer,VPer, @@ -1042,13 +1044,13 @@ void BSplSLib::D3 gp_Vec& Vuuv, gp_Vec& Vuvv) { - Standard_Boolean rational; + Standard_Boolean rational = 0; // Standard_Integer k,dim,dim2; - Standard_Integer dim,dim2; - Standard_Real u1,u2; - Standard_Integer d1,d2; - Standard_Real *result, *resVu, *resVv, *resVuu, *resVvv, *resVuv, - *resVuuu, *resVvvv, *resVuuv, *resVuvv; + Standard_Integer dim = 0,dim2 = 0; + Standard_Real u1 = NAN,u2 = NAN; + Standard_Integer d1 = 0,d2 = 0; + Standard_Real *result = nullptr, *resVu = nullptr, *resVv = nullptr, *resVuu = nullptr, *resVvv = nullptr, *resVuv = nullptr, + *resVuuu = nullptr, *resVvvv = nullptr, *resVuuv = nullptr, *resVuvv = nullptr; BSplSLib_DataContainer dc (UDegree, VDegree); if (PrepareEval (U,V,UIndex,VIndex,UDegree,VDegree,URat,VRat,UPer,VPer, @@ -1234,10 +1236,10 @@ void BSplSLib::DN const Standard_Boolean VPer, gp_Vec& Vn) { - Standard_Boolean rational; - Standard_Integer k,dim; - Standard_Real u1,u2; - Standard_Integer d1,d2; + Standard_Boolean rational = 0; + Standard_Integer k = 0,dim = 0; + Standard_Real u1 = NAN,u2 = NAN; + Standard_Integer d1 = 0,d2 = 0; BSplSLib_DataContainer dc (UDegree, VDegree); Standard_Boolean ufirst = PrepareEval @@ -1263,7 +1265,7 @@ void BSplSLib::DN for (k = 0; k <= Min(n1,d1); k++) BSplCLib::Bohm(u2,d2,n2,*dc.knots2,dim,*(dc.poles+k*dim*(d2+1))); - Standard_Real *result; + Standard_Real *result = nullptr; if (rational) { BSplSLib::RationalDerivative(d1,d2,n1,n2,*dc.poles,*dc.ders,Standard_False); result = dc.ders; // because Standard_False ci-dessus. @@ -1321,7 +1323,7 @@ void BSplSLib::Iso(const Standard_Real Param, // copy the local poles // Standard_Integer f1,l1,f2,l2,i,j,k; - Standard_Integer f1,l1,f2,l2,i,j; + Standard_Integer f1 = 0,l1 = 0,f2 = 0,l2 = 0,i = 0,j = 0; if (IsU) { f1 = Poles.LowerRow(); @@ -1338,7 +1340,7 @@ void BSplSLib::Iso(const Standard_Real Param, NCollection_LocalArray locpoles ((Degree+1) * (l2-f2+1) * dim); - Standard_Real w, *pole = locpoles; + Standard_Real w = NAN, *pole = locpoles; index += f1; for (i = 0; i <= Degree; i++) { @@ -1402,7 +1404,7 @@ void BSplSLib::Reverse( TColgp_Array2OfPnt& Poles, const Standard_Integer Last, const Standard_Boolean UDirection) { - Standard_Integer i,j, l = Last; + Standard_Integer i = 0,j = 0, l = Last; if ( UDirection) { l = Poles.LowerRow() + (l - Poles.LowerRow())%(Poles.ColLength()); @@ -1468,7 +1470,7 @@ void BSplSLib::Reverse( TColStd_Array2OfReal& Weights, const Standard_Integer Last, const Standard_Boolean UDirection) { - Standard_Integer i,j, l = Last; + Standard_Integer i = 0,j = 0, l = Last; if ( UDirection) { l = Weights.LowerRow() + (l - Weights.LowerRow())%(Weights.ColLength()); @@ -1539,7 +1541,7 @@ Standard_Boolean BSplSLib::IsRational const Standard_Real Epsi) { Standard_Real eps = (Epsi > 0.0) ? Epsi : Epsilon(Weights(I1,I2)); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Standard_Integer fi = Weights.LowerRow(), li = Weights.ColLength(); Standard_Integer fj = Weights.LowerCol(), lj = Weights.RowLength(); @@ -1562,7 +1564,7 @@ void BSplSLib::SetPoles(const TColgp_Array2OfPnt& Poles, TColStd_Array1OfReal& FP, const Standard_Boolean UDirection) { - Standard_Integer i, j, l = FP.Lower(); + Standard_Integer i = 0, j = 0, l = FP.Lower(); Standard_Integer PLowerRow = Poles.LowerRow(); Standard_Integer PUpperRow = Poles.UpperRow(); Standard_Integer PLowerCol = Poles.LowerCol(); @@ -1603,7 +1605,7 @@ void BSplSLib::SetPoles(const TColgp_Array2OfPnt& Poles, TColStd_Array1OfReal& FP, const Standard_Boolean UDirection) { - Standard_Integer i, j, l = FP.Lower(); + Standard_Integer i = 0, j = 0, l = FP.Lower(); Standard_Integer PLowerRow = Poles.LowerRow(); Standard_Integer PUpperRow = Poles.UpperRow(); Standard_Integer PLowerCol = Poles.LowerCol(); @@ -1647,7 +1649,7 @@ void BSplSLib::GetPoles(const TColStd_Array1OfReal& FP, TColgp_Array2OfPnt& Poles, const Standard_Boolean UDirection) { - Standard_Integer i, j, l = FP.Lower(); + Standard_Integer i = 0, j = 0, l = FP.Lower(); Standard_Integer PLowerRow = Poles.LowerRow(); Standard_Integer PUpperRow = Poles.UpperRow(); Standard_Integer PLowerCol = Poles.LowerCol(); @@ -1688,7 +1690,7 @@ void BSplSLib::GetPoles(const TColStd_Array1OfReal& FP, TColStd_Array2OfReal& Weights, const Standard_Boolean UDirection) { - Standard_Integer i, j, l = FP.Lower(); + Standard_Integer i = 0, j = 0, l = FP.Lower(); Standard_Integer PLowerRow = Poles.LowerRow(); Standard_Integer PUpperRow = Poles.UpperRow(); Standard_Integer PLowerCol = Poles.LowerCol(); @@ -1931,9 +1933,9 @@ void BSplSLib::BuildCache TColgp_Array2OfPnt& CachePoles, TColStd_Array2OfReal* CacheWeights) { - Standard_Boolean rational,rational_u,rational_v,flag_u_or_v; - Standard_Integer kk,d1,d1p1,d2,d2p1,ii,jj,iii,jjj,Index; - Standard_Real u1,min_degree_domain,max_degree_domain,f,factor[2],u2; + Standard_Boolean rational = 0,rational_u = 0,rational_v = 0,flag_u_or_v = 0; + Standard_Integer kk = 0,d1 = 0,d1p1 = 0,d2 = 0,d2p1 = 0,ii = 0,jj = 0,iii = 0,jjj = 0,Index = 0; + Standard_Real u1 = NAN,min_degree_domain = NAN,max_degree_domain = NAN,f = NAN,factor[2],u2 = NAN; if (Weights != NULL) rational_u = rational_v = Standard_True; else @@ -2064,11 +2066,11 @@ void BSplSLib::BuildCache(const Standard_Real theU, const TColStd_Array2OfReal* theWeights, TColStd_Array2OfReal& theCacheArray) { - Standard_Boolean flag_u_or_v; - Standard_Integer d1, d2; - Standard_Real u1, u2; + Standard_Boolean flag_u_or_v = 0; + Standard_Integer d1 = 0, d2 = 0; + Standard_Real u1 = NAN, u2 = NAN; Standard_Boolean isRationalOnParam = (theWeights != NULL); - Standard_Boolean isRational; + Standard_Boolean isRational = 0; BSplSLib_DataContainer dc(theUDegree, theVDegree); flag_u_or_v = @@ -2110,8 +2112,8 @@ void BSplSLib::BuildCache(const Standard_Real theU, // aFactors[0] corresponds to variable with minimal degree // aFactors[1] corresponds to variable with maximal degree aFactors[1] = 1.0; - Standard_Integer aRow, aCol, i; - Standard_Real aCoeff; + Standard_Integer aRow = 0, aCol = 0, i = 0; + Standard_Real aCoeff = NAN; for (aRow = 0; aRow <= d2; aRow++) { aFactors[0] = 1.0; @@ -2168,13 +2170,13 @@ void BSplSLib::CacheD0(const Standard_Real UParameter, // 0 and 1 Standard_Integer // ii, - dimension, - min_degree, - max_degree ; + dimension = 0, + min_degree = 0, + max_degree = 0 ; Standard_Real new_parameter[2] , - inverse ; + inverse = NAN ; Standard_Real * PArray = (Standard_Real *) @@ -2266,13 +2268,13 @@ void BSplSLib::CacheD1(const Standard_Real UParameter, // ii, // jj, // kk, - dimension, - min_degree, - max_degree ; + dimension = 0, + min_degree = 0, + max_degree = 0 ; Standard_Real - inverse_min, - inverse_max, + inverse_min = NAN, + inverse_max = NAN, new_parameter[2] ; Standard_Real * @@ -2281,9 +2283,9 @@ void BSplSLib::CacheD1(const Standard_Real UParameter, Standard_Real local_poles_array[2][2][3], local_poles_and_weights_array[2][2][4], local_weights_array[2][2] ; - Standard_Real * my_vec_min, - * my_vec_max, - * my_point ; + Standard_Real * my_vec_min = nullptr, + * my_vec_max = nullptr, + * my_point = nullptr ; my_point = (Standard_Real *) &aPoint ; // // initialize in case of rational evaluation @@ -2472,17 +2474,17 @@ void BSplSLib::CacheD2(const Standard_Real UParameter, // the SpanLenght is the normalizing factor so that the polynomial is between // 0 and 1 Standard_Integer - ii, + ii = 0, // jj, - kk, - index, - dimension, - min_degree, - max_degree ; + kk = 0, + index = 0, + dimension = 0, + min_degree = 0, + max_degree = 0 ; Standard_Real - inverse_min, - inverse_max, + inverse_min = NAN, + inverse_max = NAN, new_parameter[2] ; Standard_Real * @@ -2491,12 +2493,12 @@ void BSplSLib::CacheD2(const Standard_Real UParameter, Standard_Real local_poles_array[3][3][3], local_poles_and_weights_array[3][3][4], local_weights_array[3][3] ; - Standard_Real * my_vec_min, - * my_vec_max, - * my_vec_min_min, - * my_vec_max_max, - * my_vec_min_max, - * my_point ; + Standard_Real * my_vec_min = nullptr, + * my_vec_max = nullptr, + * my_vec_min_min = nullptr, + * my_vec_max_max = nullptr, + * my_vec_min_max = nullptr, + * my_point = nullptr ; my_point = (Standard_Real *) &aPoint ; // @@ -2802,7 +2804,7 @@ void BSplSLib::MovePoint (const Standard_Real U, TColgp_Array2OfPnt& NewPoles) { // calculate the UBSplineBasis in the parameter U - Standard_Integer UFirstNonZeroBsplineIndex; + Standard_Integer UFirstNonZeroBsplineIndex = 0; math_Matrix UBSplineBasis(1, 1, 1, UDegree+1); Standard_Integer ErrorCod1 = BSplCLib::EvalBsplineBasis(0, @@ -2812,7 +2814,7 @@ void BSplSLib::MovePoint (const Standard_Real U, UFirstNonZeroBsplineIndex, UBSplineBasis); // calculate the VBSplineBasis in the parameter V - Standard_Integer VFirstNonZeroBsplineIndex; + Standard_Integer VFirstNonZeroBsplineIndex = 0; math_Matrix VBSplineBasis(1, 1, 1, VDegree+1); Standard_Integer ErrorCod2 = BSplCLib::EvalBsplineBasis(0, @@ -2836,7 +2838,7 @@ void BSplSLib::MovePoint (const Standard_Real U, if (ULastIndex > UIndex2) ULastIndex = UIndex2; Standard_Real maxValue = 0.0; - Standard_Integer i, ukk1=0, ukk2; + Standard_Integer i = 0, ukk1=0, ukk2 = 0; for (i = UFirstIndex-UFirstNonZeroBsplineIndex+1; i <= ULastIndex-UFirstNonZeroBsplineIndex+1; i++) { if (UBSplineBasis(1,i) > maxValue) { @@ -2862,7 +2864,7 @@ void BSplSLib::MovePoint (const Standard_Real U, if (VLastIndex > VIndex2) VLastIndex = VIndex2; maxValue = 0.0; - Standard_Integer j, vkk1=0, vkk2; + Standard_Integer j = 0, vkk1=0, vkk2 = 0; for (j = VFirstIndex-VFirstNonZeroBsplineIndex+1; j <= VLastIndex-VFirstNonZeroBsplineIndex+1; j++) { if (VBSplineBasis(1,j) > maxValue) { @@ -2883,9 +2885,9 @@ void BSplSLib::MovePoint (const Standard_Real U, // compute the vector of displacement Standard_Real D1 = 0.0; Standard_Real D2 = 0.0; - Standard_Real hN, Coef, DvalU, DvalV; + Standard_Real hN = NAN, Coef = NAN, DvalU = NAN, DvalV = NAN; - Standard_Integer ii, jj; + Standard_Integer ii = 0, jj = 0; for (i = 1; i <= UDegree+1; i++) { ii = i + UFirstNonZeroBsplineIndex - 1; @@ -3020,17 +3022,17 @@ void BSplSLib::Resolution(const TColgp_Array2OfPnt& Poles, Standard_Real& UTolerance, Standard_Real& VTolerance) { - Standard_Real Wij,Wmj,Wji,Wjm; - Standard_Real Xij,Xmj,Xji,Xjm,Xpq,Xqp; - Standard_Real Yij,Ymj,Yji,Yjm,Ypq,Yqp; - Standard_Real Zij,Zmj,Zji,Zjm,Zpq,Zqp; - Standard_Real factor,value,min,min_weights=0,inverse,max_derivative[2]; + Standard_Real Wij = NAN,Wmj = NAN,Wji = NAN,Wjm = NAN; + Standard_Real Xij = NAN,Xmj = NAN,Xji = NAN,Xjm = NAN,Xpq = NAN,Xqp = NAN; + Standard_Real Yij = NAN,Ymj = NAN,Yji = NAN,Yjm = NAN,Ypq = NAN,Yqp = NAN; + Standard_Real Zij = NAN,Zmj = NAN,Zji = NAN,Zjm = NAN,Zpq = NAN,Zqp = NAN; + Standard_Real factor = NAN,value = NAN,min = NAN,min_weights=0,inverse = NAN,max_derivative[2]; max_derivative[0] = max_derivative[1] = 0.0e0 ; - Standard_Integer PRowLength, PColLength; - Standard_Integer ii,jj,pp,qq,ii_index,jj_index,pp_index,qq_index; - Standard_Integer ii_minus,upper[2],lower[2],poles_length[2]; + Standard_Integer PRowLength = 0, PColLength = 0; + Standard_Integer ii = 0,jj = 0,pp = 0,qq = 0,ii_index = 0,jj_index = 0,pp_index = 0,qq_index = 0; + Standard_Integer ii_minus = 0,upper[2],lower[2],poles_length[2]; Standard_Integer num_poles[2],num_flat_knots[2]; num_flat_knots[0] = @@ -3279,10 +3281,10 @@ void BSplSLib::Interpolate(const Standard_Integer UDegree, TColStd_Array2OfReal& Weights, Standard_Integer& InversionProblem) { - Standard_Integer ii, jj, ll, kk, dimension; + Standard_Integer ii = 0, jj = 0, ll = 0, kk = 0, dimension = 0; Standard_Integer ULength = UParameters.Length(); Standard_Integer VLength = VParameters.Length(); - Standard_Real * poles_array; + Standard_Real * poles_array = nullptr; // extraction of iso u dimension = 4*ULength; @@ -3368,10 +3370,10 @@ void BSplSLib::Interpolate(const Standard_Integer UDegree, TColgp_Array2OfPnt& Poles, Standard_Integer& InversionProblem) { - Standard_Integer ii, jj, ll, kk, dimension; + Standard_Integer ii = 0, jj = 0, ll = 0, kk = 0, dimension = 0; Standard_Integer ULength = UParameters.Length(); Standard_Integer VLength = VParameters.Length(); - Standard_Real * poles_array; + Standard_Real * poles_array = nullptr; // extraction of iso u dimension = 3*ULength; @@ -3463,12 +3465,12 @@ void BSplSLib::FunctionMultiply TColStd_Array2OfReal& NewDenominator, Standard_Integer& theStatus) { - Standard_Integer num_uparameters, + Standard_Integer num_uparameters = 0, // ii,jj,kk, - ii,jj, - error_code, - num_vparameters ; - Standard_Real result ; + ii = 0,jj = 0, + error_code = 0, + num_vparameters = 0 ; + Standard_Real result = NAN ; num_uparameters = UFlatKnots.Length() - UNewDegree - 1 ; num_vparameters = VFlatKnots.Length() - VNewDegree - 1 ; diff --git a/src/BSplSLib/BSplSLib_BzSyntaxes.cxx b/src/BSplSLib/BSplSLib_BzSyntaxes.cxx index 5e6abc0ff8..44ecf07699 100644 --- a/src/BSplSLib/BSplSLib_BzSyntaxes.cxx +++ b/src/BSplSLib/BSplSLib_BzSyntaxes.cxx @@ -34,7 +34,7 @@ void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles, TColgp_Array2OfPnt& CachePoles, TColStd_Array2OfReal* CacheWeights) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer uclas = Poles.ColLength(); Standard_Integer vclas = Poles.RowLength(); TColStd_Array1OfReal biduflatknots(1,uclas << 1); @@ -61,7 +61,7 @@ void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles, // BuilCache exige que les resultats soient formates en [MaxCoeff,MinCoeff] TColgp_Array2OfPnt CPoles (1,vclas, 1, uclas); TColStd_Array2OfReal CWeights(1,vclas, 1, uclas); - Standard_Integer ii, jj; + Standard_Integer ii = 0, jj = 0; BSplSLib::BuildCache(0.,0., 1.,1.,0,0, uclas - 1,vclas - 1,0,0, diff --git a/src/BVH/BVH_BuildQueue.cxx b/src/BVH/BVH_BuildQueue.cxx index 86b48569d4..dc236dd96a 100644 --- a/src/BVH/BVH_BuildQueue.cxx +++ b/src/BVH/BVH_BuildQueue.cxx @@ -21,7 +21,7 @@ // ======================================================================= Standard_Integer BVH_BuildQueue::Size() { - Standard_Integer aSize; + Standard_Integer aSize = 0; myMutex.Lock(); { diff --git a/src/BinTools/BinTools_Curve2dSet.cxx b/src/BinTools/BinTools_Curve2dSet.cxx index 8979369fa7..325dde570b 100644 --- a/src/BinTools/BinTools_Curve2dSet.cxx +++ b/src/BinTools/BinTools_Curve2dSet.cxx @@ -196,7 +196,7 @@ static BinTools_OStream& operator <<(BinTools_OStream& OS, const Handle(Geom2d_B Standard_Boolean aRational = B->IsRational() ? 1:0; OS << aRational; // rational // poles and weights - Standard_Integer i,aDegree = B->Degree(); + Standard_Integer i = 0,aDegree = B->Degree(); OS << (Standard_ExtCharacter)aDegree; // Degree for (i = 1; i <= aDegree+1; i++) { OS << B->Pole(i); // Pnt2d @@ -219,7 +219,7 @@ static BinTools_OStream& operator <<(BinTools_OStream& OS, const Handle(Geom2d_B Standard_Boolean aPeriodic = B->IsPeriodic() ? 1:0; OS << aPeriodic; //periodic // poles and weights - Standard_Integer i,aDegree,aNbPoles,aNbKnots; + Standard_Integer i = 0,aDegree = 0,aNbPoles = 0,aNbKnots = 0; aDegree = B->Degree(); aNbPoles = B->NbPoles(); aNbKnots = B->NbKnots(); @@ -325,7 +325,7 @@ void BinTools_Curve2dSet::WriteCurve2d( void BinTools_Curve2dSet::Write (Standard_OStream& OS, const Message_ProgressRange& theRange) const { - Standard_Integer i, aNbCurves = myMap.Extent(); + Standard_Integer i = 0, aNbCurves = myMap.Extent(); Message_ProgressScope aPS(theRange, "Writing 2D curves",aNbCurves); OS << "Curve2ds "<< aNbCurves << "\n"; BinTools_OStream aStream (OS); @@ -689,7 +689,7 @@ void BinTools_Curve2dSet::Read (Standard_IStream& IS, } Handle(Geom2d_Curve) C; - Standard_Integer i, aNbCurves; + Standard_Integer i = 0, aNbCurves = 0; IS >> aNbCurves; Message_ProgressScope aPS(theRange, "Reading curves 2d", aNbCurves); IS.get();//remove diff --git a/src/BinTools/BinTools_CurveSet.cxx b/src/BinTools/BinTools_CurveSet.cxx index 1966f12e5c..e6fd7e1829 100644 --- a/src/BinTools/BinTools_CurveSet.cxx +++ b/src/BinTools/BinTools_CurveSet.cxx @@ -205,7 +205,7 @@ static BinTools_OStream& operator <<(BinTools_OStream& OS, const Handle(Geom_Bez Standard_Boolean aRational = B->IsRational() ? 1:0; OS << aRational; // rational // poles and weights - Standard_Integer i, aDegree = B->Degree(); + Standard_Integer i = 0, aDegree = B->Degree(); OS << (Standard_ExtCharacter)aDegree; //<< Degree for (i = 1; i <= aDegree+1; i++) { OS << B->Pole(i); // Pnt @@ -228,7 +228,7 @@ static BinTools_OStream& operator <<(BinTools_OStream& OS, const Handle(Geom_BSp Standard_Boolean aPeriodic = B->IsPeriodic() ? 1:0; OS << aPeriodic; // periodic // poles and weights - Standard_Integer i,aDegree,aNbPoles,aNbKnots; + Standard_Integer i = 0,aDegree = 0,aNbPoles = 0,aNbKnots = 0; aDegree = B->Degree(); aNbPoles = B->NbPoles(); aNbKnots = B->NbKnots(); @@ -334,7 +334,7 @@ void BinTools_CurveSet::WriteCurve(const Handle(Geom_Curve)& C, void BinTools_CurveSet::Write (Standard_OStream& OS, const Message_ProgressRange& theRange)const { - Standard_Integer i, nbcurv = myMap.Extent(); + Standard_Integer i = 0, nbcurv = myMap.Extent(); Message_ProgressScope aPS (theRange, "Writing curves", nbcurv); OS << "Curves "<< nbcurv << "\n"; BinTools_OStream aStream (OS); @@ -703,7 +703,7 @@ void BinTools_CurveSet::Read (Standard_IStream& IS, } Handle(Geom_Curve) C; - Standard_Integer i, nbcurve; + Standard_Integer i = 0, nbcurve = 0; IS >> nbcurve; Message_ProgressScope aPS(theRange, "Reading curves", nbcurve); diff --git a/src/BinTools/BinTools_IStream.cxx b/src/BinTools/BinTools_IStream.cxx index 5d5175c7a7..12f0c21e3f 100644 --- a/src/BinTools/BinTools_IStream.cxx +++ b/src/BinTools/BinTools_IStream.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -175,7 +177,7 @@ BinTools_IStream& BinTools_IStream::operator >> (Standard_Integer& theValue) //======================================================================= BinTools_IStream& BinTools_IStream::operator >> (gp_Pnt& theValue) { - Standard_Real aValue; + Standard_Real aValue = NAN; for (int aCoord = 1; aCoord <= 3; aCoord++) { if (!myStream->read ((char*)&aValue, sizeof (Standard_Real))) diff --git a/src/BinTools/BinTools_LocationSet.cxx b/src/BinTools/BinTools_LocationSet.cxx index e1f5aa286b..a5e4547678 100644 --- a/src/BinTools/BinTools_LocationSet.cxx +++ b/src/BinTools/BinTools_LocationSet.cxx @@ -160,7 +160,7 @@ Standard_Integer BinTools_LocationSet::NbLocations() const void BinTools_LocationSet::Write(Standard_OStream& OS) const { - Standard_Integer i, nbLoc = myMap.Extent(); + Standard_Integer i = 0, nbLoc = myMap.Extent(); OS << "Locations "<< nbLoc << "\n"; try { OCC_CATCH_SIGNALS @@ -210,7 +210,7 @@ void BinTools_LocationSet::Read(Standard_IStream& IS) myMap.Clear(); char buffer[255]; - Standard_Integer l1,p; + Standard_Integer l1 = 0,p = 0; IS >> buffer; if (IS.fail() || (strcmp(buffer,"Locations"))) { @@ -220,7 +220,7 @@ void BinTools_LocationSet::Read(Standard_IStream& IS) return; } - Standard_Integer i, nbLoc; + Standard_Integer i = 0, nbLoc = 0; IS >> nbLoc; IS.get();// remove lf TopLoc_Location L; diff --git a/src/BinTools/BinTools_OStream.hxx b/src/BinTools/BinTools_OStream.hxx index 5b2ce395a4..9309abd2f4 100644 --- a/src/BinTools/BinTools_OStream.hxx +++ b/src/BinTools/BinTools_OStream.hxx @@ -79,9 +79,9 @@ public: private: Standard_OStream* myStream; ///< pointer to the stream uint64_t myPosition; ///< the current position relatively to the OStream position at the moment of creation of this class instance - Standard_Real myRealBuf[12]; ///< buffer for 12 reals storage - Standard_Integer myIntBuf[3]; ///< buffer for 3 integers storage - float myFloatBuf[3]; ///< buffer for 3 floats storage + Standard_Real myRealBuf[12]{}; ///< buffer for 12 reals storage + Standard_Integer myIntBuf[3]{}; ///< buffer for 3 integers storage + float myFloatBuf[3]{}; ///< buffer for 3 floats storage }; #endif // _BinTools_OStream_HeaderFile diff --git a/src/BinTools/BinTools_ShapeReader.cxx b/src/BinTools/BinTools_ShapeReader.cxx index 336590f90e..60abacd98c 100644 --- a/src/BinTools/BinTools_ShapeReader.cxx +++ b/src/BinTools/BinTools_ShapeReader.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -97,7 +99,7 @@ TopoDS_Shape BinTools_ShapeReader::ReadShape (BinTools_IStream& theStream) TopAbs_ShapeEnum aShapeType = theStream.ShapeType(); TopAbs_Orientation aShapeOrientation = theStream.ShapeOrientation(); const TopLoc_Location* aShapeLocation = ReadLocation (theStream); - Standard_Real aTol; + Standard_Real aTol = NAN; static BRep_Builder aBuilder; try { OCC_CATCH_SIGNALS @@ -164,12 +166,12 @@ TopoDS_Shape BinTools_ShapeReader::ReadShape (BinTools_IStream& theStream) aBuilder.MakeEdge(aE); // Read the curve geometry theStream >> aTol; - Standard_Boolean aSameParameter, aSameRange, aDegenerated; + Standard_Boolean aSameParameter = 0, aSameRange = 0, aDegenerated = 0; theStream.ReadBools (aSameParameter, aSameRange, aDegenerated); aBuilder.SameParameter (aE, aSameParameter); aBuilder.SameRange (aE, aSameRange); aBuilder.Degenerated (aE, aDegenerated); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; while (theStream) { Standard_Byte aPrsType = theStream.ReadByte(); //{0|1|2|3|4|5|6|7} if (aPrsType == 0) @@ -308,7 +310,7 @@ TopoDS_Shape BinTools_ShapeReader::ReadShape (BinTools_IStream& theStream) throw Standard_Failure (aMsg.str().c_str()); } // read flags and subs - Standard_Boolean aFree, aMod, aChecked, anOrient, aClosed, anInf, aConv; + Standard_Boolean aFree = 0, aMod = 0, aChecked = 0, anOrient = 0, aClosed = 0, anInf = 0, aConv = 0; theStream.ReadBools (aFree, aMod, aChecked, anOrient, aClosed, anInf, aConv); // sub-shapes for(TopoDS_Shape aSub = ReadShape (theStream); !aSub.IsNull(); aSub = ReadShape (theStream)) diff --git a/src/BinTools/BinTools_ShapeSet.cxx b/src/BinTools/BinTools_ShapeSet.cxx index 0460882c7e..3433346cbc 100644 --- a/src/BinTools/BinTools_ShapeSet.cxx +++ b/src/BinTools/BinTools_ShapeSet.cxx @@ -46,6 +46,7 @@ #include #include +#include #include //======================================================================= @@ -317,7 +318,7 @@ void BinTools_ShapeSet::Write (Standard_OStream& OS, // write the shapes //----------------------------------------- - Standard_Integer i, nbShapes = myShapes.Extent(); + Standard_Integer i = 0, nbShapes = myShapes.Extent(); Message_ProgressScope aPSinner(aPS.Next(), "Writing shapes", nbShapes); OS << "\nTShapes " << nbShapes << "\n"; @@ -460,7 +461,7 @@ void BinTools_ShapeSet::ReadFlagsAndSubs(TopoDS_Shape& S, const TopAbs_ShapeEnum Standard_IStream& IS, const Standard_Integer nbShapes) { // Set the flags - Standard_Boolean aFree, aMod, aChecked, anOrient, aClosed, anInf, aConv; + Standard_Boolean aFree = 0, aMod = 0, aChecked = 0, anOrient = 0, aClosed = 0, anInf = 0, aConv = 0; BinTools::GetBool(IS, aFree); BinTools::GetBool(IS, aMod); BinTools::GetBool(IS, aChecked); @@ -512,12 +513,12 @@ void BinTools_ShapeSet::ReadSubs(TopoDS_Shape& S, Standard_IStream& IS, else { TopAbs_Orientation anOrient; anOrient = (TopAbs_Orientation)aChar; - Standard_Integer anIndx; + Standard_Integer anIndx = 0; BinTools::GetInteger(IS, anIndx); S = Shape (nbshapes - anIndx + 1); S.Orientation(anOrient); - Standard_Integer l; + Standard_Integer l = 0; BinTools::GetInteger(IS, l); S.Location(myLocations.Location(l), Standard_False); } @@ -633,7 +634,7 @@ void BinTools_ShapeSet::WriteShape (const TopoDS_Shape& S, aVal = (TE->Degenerated()) ? Standard_True : Standard_False; BinTools::PutBool(OS, aVal); - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_ListIteratorOfListOfCurveRepresentation itrc = TE->Curves(); while (itrc.More()) { const Handle(BRep_CurveRepresentation)& CR = itrc.Value(); @@ -778,11 +779,11 @@ void BinTools_ShapeSet::ReadShape (const TopAbs_ShapeEnum T, { // Read the geometry - Standard_Integer val, c, pc, pc2 = 0, s, s2, l, l2, t, pt, pt2 = 0; - Standard_Real tol, X, Y, Z, first, last, p1 = 0., p2; - Standard_Real PfX, PfY, PlX, PlY; + Standard_Integer val = 0, c = 0, pc = 0, pc2 = 0, s = 0, s2 = 0, l = 0, l2 = 0, t = 0, pt = 0, pt2 = 0; + Standard_Real tol = NAN, X = NAN, Y = NAN, Z = NAN, first = NAN, last = NAN, p1 = 0., p2 = NAN; + Standard_Real PfX = NAN, PfY = NAN, PlX = NAN, PlY = NAN; gp_Pnt2d aPf, aPl; - Standard_Boolean closed, bval; + Standard_Boolean closed = 0, bval = 0; GeomAbs_Shape reg = GeomAbs_C0; try { OCC_CATCH_SIGNALS diff --git a/src/BinTools/BinTools_ShapeWriter.cxx b/src/BinTools/BinTools_ShapeWriter.cxx index ac604c7bd4..80af4cd6de 100644 --- a/src/BinTools/BinTools_ShapeWriter.cxx +++ b/src/BinTools/BinTools_ShapeWriter.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -140,7 +142,7 @@ void BinTools_ShapeWriter::WriteShape (BinTools_OStream& theStream, const TopoDS Handle(BRep_TEdge) aTE = Handle(BRep_TEdge)::DownCast (aShape.TShape()); theStream << aTE->Tolerance(); theStream.PutBools (aTE->SameParameter(), aTE->SameRange(), aTE->Degenerated()); - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; for(BRep_ListIteratorOfListOfCurveRepresentation anIter = aTE->Curves(); anIter.More(); anIter.Next()) { const Handle(BRep_CurveRepresentation)& aCR = anIter.Value(); diff --git a/src/BinTools/BinTools_SurfaceSet.cxx b/src/BinTools/BinTools_SurfaceSet.cxx index d2c118ad65..9ed6154310 100644 --- a/src/BinTools/BinTools_SurfaceSet.cxx +++ b/src/BinTools/BinTools_SurfaceSet.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -242,7 +244,7 @@ static BinTools_OStream& operator <<(BinTools_OStream& OS, const Handle(Geom_Bez OS << vrational; // poles and weights - Standard_Integer i,j,udegree,vdegree; + Standard_Integer i = 0,j = 0,udegree = 0,vdegree = 0; udegree = S->UDegree(); vdegree = S->VDegree(); OS << (Standard_ExtCharacter)udegree; @@ -277,7 +279,7 @@ static BinTools_OStream& operator <<(BinTools_OStream& OS, const Handle(Geom_BSp OS << vperiodic; // poles and weights - Standard_Integer i,j,udegree,vdegree,nbupoles,nbvpoles,nbuknots,nbvknots; + Standard_Integer i = 0,j = 0,udegree = 0,vdegree = 0,nbupoles = 0,nbvpoles = 0,nbuknots = 0,nbvknots = 0; udegree = S->UDegree(); vdegree = S->VDegree(); nbupoles = S->NbUPoles(); @@ -319,7 +321,7 @@ static BinTools_OStream& operator <<(BinTools_OStream& OS, const Handle(Geom_BSp static BinTools_OStream& operator <<(BinTools_OStream& OS, const Handle(Geom_RectangularTrimmedSurface)& S) { OS << (Standard_Byte)RECTANGULAR; - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; S->Bounds(U1,U2,V1,V2); OS << U1 << U2 << V1 << V2; BinTools_SurfaceSet::WriteSurface (S->BasisSurface(), OS); @@ -406,7 +408,7 @@ void BinTools_SurfaceSet::Write (Standard_OStream& OS, const Message_ProgressRange& theRange)const { - Standard_Integer i, nbsurf = myMap.Extent(); + Standard_Integer i = 0, nbsurf = myMap.Extent(); Message_ProgressScope aPS(theRange, "Writing surfaces", nbsurf); OS << "Surfaces "<< nbsurf << "\n"; BinTools_OStream aStream (OS); @@ -604,7 +606,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, TColgp_Array2OfPnt poles(1,udegree+1,1,vdegree+1); TColStd_Array2OfReal weights(1,udegree+1,1,vdegree+1); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for (i = 1; i <= udegree+1; i++) { for (j = 1; j <= vdegree+1; j++) { IS >> poles(i,j);//Pnt @@ -650,7 +652,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, TColgp_Array2OfPnt poles(1,nbupoles,1,nbvpoles); TColStd_Array2OfReal weights(1,nbupoles,1,nbvpoles); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for (i = 1; i <= nbupoles; i++) { for (j = 1; j <= nbvpoles; j++) { IS >> poles(i,j);//Pnt @@ -858,7 +860,7 @@ void BinTools_SurfaceSet::Read (Standard_IStream& IS, } Handle(Geom_Surface) S; - Standard_Integer i, nbsurf; + Standard_Integer i = 0, nbsurf = 0; IS >> nbsurf; Message_ProgressScope aPS(theRange, "Reading surfaces", nbsurf); IS.get ();//remove diff --git a/src/Bisector/Bisector_Bisec.cxx b/src/Bisector/Bisector_Bisec.cxx index 09f3164508..b34f9410ba 100644 --- a/src/Bisector/Bisector_Bisec.cxx +++ b/src/Bisector/Bisector_Bisec.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -86,7 +88,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve , Handle(Standard_Type) Type1 = afirstcurve ->DynamicType(); Handle(Standard_Type) Type2 = asecondcurve->DynamicType(); Handle(Bisector_Curve) Bis; - Standard_Real UFirst,ULast; + Standard_Real UFirst = NAN,ULast = NAN; if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) { Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(afirstcurve) @@ -209,7 +211,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve , gp_Pnt2d aP1 = afirstcurve1->Value(afirstcurve1->LastParameter()); gp_Pnt2d aP2 = asecondcurve1->Value(asecondcurve1->FirstParameter()); gp_Pnt2d aPm(.5*(aP1.XY()+aP2.XY())); - Standard_Real Nx, Ny; + Standard_Real Nx = NAN, Ny = NAN; if(aPm.Distance(apoint) > 10.*Precision::Confusion()) { Nx = apoint.X() - aPm.X(); @@ -295,7 +297,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve , Handle(Bisector_Curve) Bis; Handle(Standard_Type) Type1 = afirstcurve ->DynamicType(); - Standard_Real UFirst,ULast; + Standard_Real UFirst = NAN,ULast = NAN; if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) { Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(afirstcurve) @@ -443,7 +445,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint , Handle(Bisector_Curve) Bis; Handle(Standard_Type) Type1 = asecondcurve ->DynamicType(); - Standard_Real UFirst,ULast; + Standard_Real UFirst = NAN,ULast = NAN; if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) { Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(asecondcurve) @@ -667,13 +669,13 @@ static Standard_Boolean IsMaxRC (const Handle(Geom2d_Curve)& C, Standard_Real U, Standard_Real& R) { - Standard_Real KF,KL; + Standard_Real KF = NAN,KL = NAN; Standard_Real US = C->FirstParameter(); Standard_Real UL = C->LastParameter(); gp_Vec2d D1,D2; gp_Pnt2d P; - Standard_Real Norm2; + Standard_Real Norm2 = NAN; C->D2(US,P,D1,D2); Norm2 = D1.SquareMagnitude(); diff --git a/src/Bisector/Bisector_BisecAna.cxx b/src/Bisector/Bisector_BisecAna.cxx index 64a31618a3..2b5e979ebd 100644 --- a/src/Bisector/Bisector_BisecAna.cxx +++ b/src/Bisector/Bisector_BisecAna.cxx @@ -17,6 +17,8 @@ // Modified by skv - Fri Jul 1 16:23:17 2005 IDEM(Airbus) // Modified by skv - Wed Jul 7 17:21:09 2004 IDEM(Airbus) +#include + #include #include #include @@ -219,11 +221,11 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , const Standard_Boolean oncurve ) { - Standard_Boolean ok; - Standard_Real distanceptsol,parameter,firstparameter =0.; - Standard_Boolean thesense = Standard_False,sense; - Standard_Real distancemini; - Standard_Integer nbsolution; + Standard_Boolean ok = 0; + Standard_Real distanceptsol = NAN,parameter = NAN,firstparameter =0.; + Standard_Boolean thesense = Standard_False,sense = 0; + Standard_Real distancemini = NAN; + Standard_Integer nbsolution = 0; Standard_Real PreConf = Precision::Confusion(); Handle(Standard_Type) type1 = afirstcurve->DynamicType(); @@ -370,7 +372,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , parameter, - Precision::Infinite()); else { - Standard_Real parameter2; + Standard_Real parameter2 = NAN; parameter2 = ElCLib::Parameter(line,circle1.Location()); parameter2 += 1.e-8; thebisector = new Geom2d_TrimmedCurve(bisectorcurve, @@ -623,7 +625,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , // ----------------------------------------------------------------- gp_Pnt2d circlecenter; gp_Lin2d gpline; - Standard_Real secondparameter; + Standard_Real secondparameter = NAN; circlecenter = circle1.Location(); gpline = TheSol->Line(); @@ -746,7 +748,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , else { gp_Lin2d l(apoint,gp_Dir2d(Direc2.XY()-Direc1.XY())); Handle(GccInt_Bisec) solution = new GccInt_BLine(l); - Standard_Boolean isOk; + Standard_Boolean isOk = 0; sense = Standard_False; // Modified by skv - Tue Feb 15 17:51:29 2005 Integration Begin // distanceptsol = Distance(apoint,solution, @@ -806,9 +808,9 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , const Standard_Real tolerance , const Standard_Boolean oncurve ) { - Standard_Boolean ok; - Standard_Boolean thesense = Standard_False,sense; - Standard_Real distanceptsol,parameter,firstparameter =0.,secondparameter; + Standard_Boolean ok = 0; + Standard_Boolean thesense = Standard_False,sense = 0; + Standard_Real distanceptsol = NAN,parameter = NAN,firstparameter =0.,secondparameter = NAN; gp_Vec2d VecRef(0.,0.); Handle(Geom2d_Curve) curve; Handle(GccInt_Bisec) TheSol; @@ -1061,8 +1063,8 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Point)& afirstpoint , const Standard_Real , const Standard_Boolean oncurve ) { - Standard_Boolean sense,ok; - Standard_Real parameter; + Standard_Boolean sense = 0,ok = 0; + Standard_Real parameter = NAN; gp_Vec2d VecRef(0.,0.); GccAna_Pnt2dBisec bisector(afirstpoint->Pnt2d(),asecondpoint->Pnt2d()); diff --git a/src/Bisector/Bisector_BisecCC.cxx b/src/Bisector/Bisector_BisecCC.cxx index 07f29490ce..55253ee573 100644 --- a/src/Bisector/Bisector_BisecCC.cxx +++ b/src/Bisector/Bisector_BisecCC.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -118,7 +120,7 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1, isConvex1 = Bisector::IsConvex(curve1,sign1); isConvex2 = Bisector::IsConvex(curve2,sign2); - Standard_Real U,UC1,UC2,Dist,dU,USol; + Standard_Real U = NAN,UC1 = NAN,UC2 = NAN,Dist = NAN,dU = NAN,USol = NAN; gp_Pnt2d P; Standard_Integer NbPnts = 21; Standard_Real EpsMin = 10*Precision::Confusion(); @@ -277,7 +279,7 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1, } if (extensionEnd) { gp_Pnt2d P1; - Standard_Real UFirst,ULast; + Standard_Real UFirst = NAN,ULast = NAN; P1 = myPolygon.Last().Point(); UFirst = endIntervals.Last(); ULast = UFirst + pointEnd.Distance(P1); @@ -553,7 +555,7 @@ static Standard_Real Curvature (const Handle(Geom2d_Curve)& C, Standard_Real U, Standard_Real Tol) { - Standard_Real K1; + Standard_Real K1 = NAN; gp_Vec2d D1,D2; gp_Pnt2d P; C->D2(U,P,D1,D2); @@ -619,7 +621,7 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U, Standard_Real UMax = myPolygon.Value(IntervalIndex + 1).ParamOnBis(); Standard_Real VMin = myPolygon.Value(IntervalIndex ).ParamOnC2(); Standard_Real VMax = myPolygon.Value(IntervalIndex + 1).ParamOnC2(); - Standard_Real Alpha,VInit; + Standard_Real Alpha = NAN,VInit = NAN; if (Abs(UMax - UMin) < gp::Resolution()) { VInit = VMin; @@ -648,7 +650,7 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U, } else { Bisector_FunctionH H (curve2,P1,sign1*sign2*T1); - Standard_Real FInit; + Standard_Real FInit = NAN; H.Value(VInit,FInit); if (Abs(FInit) < EpsH) { U2 = VInit; @@ -795,11 +797,11 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U, Standard_Boolean YaSol = Standard_False; Standard_Real DMin = Precision::Infinite(); - Standard_Real USol; + Standard_Real USol = NAN; Standard_Real EpsMax = 1.E-6; - Standard_Real EpsX; + Standard_Real EpsX = NAN; Standard_Real EpsH = 1.E-8; - Standard_Real DistPP1; + Standard_Real DistPP1 = NAN; Standard_Integer NbSamples =20; Standard_Real UFirstOnC2 = curve2->FirstParameter(); Standard_Real ULastOnC2 = curve2->LastParameter(); @@ -933,7 +935,7 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U, void Bisector_BisecCC::D0(const Standard_Real U, gp_Pnt2d& P) const { - Standard_Real U1,U2,Dist; + Standard_Real U1 = NAN,U2 = NAN,Dist = NAN; P = ValueAndDist(U,U1,U2,Dist); } @@ -1038,7 +1040,7 @@ void Bisector_BisecCC::Values (const Standard_Real U, // Calculate the current point on the bisectrice and the parameters on each // curve. //------------------------------------------------------------------------- - Standard_Real U0,V0,Dist; + Standard_Real U0 = NAN,V0 = NAN,Dist = NAN; //----------------------------------------------- // is the polygon reduced to a point or empty? @@ -1080,10 +1082,10 @@ void Bisector_BisecCC::Values (const Standard_Real U, //----------------------------- // Calculate dH/du and dH/dv. //----------------------------- - Standard_Real TuTu,TvTv,TuTv; - Standard_Real TuPuPv,TvPuPv ; - Standard_Real TuuPuPv,TuTuu ; - Standard_Real TvvPuPv,TvTvv ; + Standard_Real TuTu = NAN,TvTv = NAN,TuTv = NAN; + Standard_Real TuPuPv = NAN,TvPuPv = NAN ; + Standard_Real TuuPuPv = NAN,TuTuu = NAN ; + Standard_Real TvvPuPv = NAN,TvTvv = NAN ; TuTu = Tu.Dot(Tu) ; TvTv = Tv.Dot(Tv) ; TuTv = Tu.Dot(Tv); TuPuPv = Tu.Dot(PuPv) ; TvPuPv = Tv.Dot(PuPv); @@ -1098,8 +1100,8 @@ void Bisector_BisecCC::Values (const Standard_Real U, //----------------------------- // Calculate dF/du and dF/dv. //----------------------------- - Standard_Real NorPuPv,NuPuPv,NorTv; - Standard_Real A,B,dAdu,dAdv,dBdu,dBdv,BB; + Standard_Real NorPuPv = NAN,NuPuPv = NAN,NorTv = NAN; + Standard_Real A = NAN,B = NAN,dAdu = NAN,dAdv = NAN,dBdu = NAN,dBdv = NAN,BB = NAN; NorPuPv = Nor.Dot(PuPv); NuPuPv = Nu .Dot(PuPv); @@ -1273,7 +1275,7 @@ static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA, } Standard_Real DMin = Precision::Infinite(); - Standard_Real UPC; + Standard_Real UPC = NAN; Standard_Boolean YaSol = Standard_False; //-------------------------------------------------------------------- // Construction of the bisectrice point curve and of the straight line passing @@ -1369,7 +1371,7 @@ void Bisector_BisecCC::SupLastParameter() // of curve2 following the values of sign1 and sign2. // the bissectrice is limited by the obtained parameters. //------------------------------------------------------------------------ - Standard_Real UOnC1,UOnC2,Dist; + Standard_Real UOnC1 = NAN,UOnC2 = NAN,Dist = NAN; if (sign1 == sign2) { UOnC2 = curve2->FirstParameter(); } @@ -1438,7 +1440,7 @@ const Bisector_PolyBis& Bisector_BisecCC::Polygon() const //========================================================================== Standard_Real Bisector_BisecCC::Parameter(const gp_Pnt2d& P) const { - Standard_Real UOnCurve; + Standard_Real UOnCurve = NAN; if (P.IsEqual(Value(FirstParameter()),Precision::Confusion())) { UOnCurve = FirstParameter(); @@ -1623,8 +1625,8 @@ void Bisector_BisecCC::LastParameter (const Standard_Real U) Standard_Real Bisector_BisecCC::SearchBound (const Standard_Real U1, const Standard_Real U2) const { - Standard_Real UMid,Dist1,Dist2,DistMid,U11,U22; - Standard_Real UC1,UC2; + Standard_Real UMid = NAN,Dist1 = NAN,Dist2 = NAN,DistMid = NAN,U11 = NAN,U22 = NAN; + Standard_Real UC1 = NAN,UC2 = NAN; gp_Pnt2d PBis,PBisPrec; Standard_Real TolPnt = Precision::Confusion(); Standard_Real TolPar = Precision::PConfusion(); @@ -1756,8 +1758,8 @@ static Standard_Boolean TestExtension (const Handle(Geom2d_Curve)& C1, //============================================================================= void Bisector_BisecCC::ComputePointEnd () { - Standard_Real U1,U2; - Standard_Real KC,RC; + Standard_Real U1 = NAN,U2 = NAN; + Standard_Real KC = NAN,RC = NAN; U1 = curve1->FirstParameter(); if (sign1 == sign2) { U2 = curve2->LastParameter(); diff --git a/src/Bisector/Bisector_BisecCC.hxx b/src/Bisector/Bisector_BisecCC.hxx index b18dc89f9f..c72e2e2ae6 100644 --- a/src/Bisector/Bisector_BisecCC.hxx +++ b/src/Bisector/Bisector_BisecCC.hxx @@ -216,19 +216,19 @@ private: Handle(Geom2d_Curve) curve1; Handle(Geom2d_Curve) curve2; - Standard_Real sign1; - Standard_Real sign2; + Standard_Real sign1{}; + Standard_Real sign2{}; TColStd_SequenceOfReal startIntervals; TColStd_SequenceOfReal endIntervals; - Standard_Integer currentInterval; + Standard_Integer currentInterval{}; Bisector_PolyBis myPolygon; - Standard_Real shiftParameter; - Standard_Real distMax; - Standard_Boolean isEmpty; - Standard_Boolean isConvex1; - Standard_Boolean isConvex2; - Standard_Boolean extensionStart; - Standard_Boolean extensionEnd; + Standard_Real shiftParameter{}; + Standard_Real distMax{}; + Standard_Boolean isEmpty{}; + Standard_Boolean isConvex1{}; + Standard_Boolean isConvex2{}; + Standard_Boolean extensionStart{}; + Standard_Boolean extensionEnd{}; gp_Pnt2d pointStart; gp_Pnt2d pointEnd; diff --git a/src/Bisector/Bisector_BisecPC.cxx b/src/Bisector/Bisector_BisecPC.cxx index 5ee0290a45..a28c9339ee 100644 --- a/src/Bisector/Bisector_BisecPC.cxx +++ b/src/Bisector/Bisector_BisecPC.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -70,20 +72,20 @@ Bisector_BisecPC::Bisector_BisecPC(const Handle(Geom2d_Curve)& Cu, const gp_Pnt2d& P, const Standard_Real Side, const Standard_Real UMin, - const Standard_Real UMax) + const Standard_Real UMax) : point(P), sign(Side), bisInterval(1), extensionStart(Standard_False), extensionEnd(Standard_False), isConvex(Bisector::IsConvex(curve,sign)) { curve = Handle (Geom2d_Curve)::DownCast(Cu->Copy()); - point = P; - sign = Side; + + startIntervals.Append(UMin); endIntervals .Append(UMax); - bisInterval = 1; - extensionStart = Standard_False; - extensionEnd = Standard_False; + + + pointStartBis = Value(UMin); pointEndBis = Value(UMax); - isConvex = Bisector::IsConvex(curve,sign); + } //============================================================================= @@ -324,7 +326,7 @@ void Bisector_BisecPC::Extension(const Standard_Real U, gp_Vec2d& V2, gp_Vec2d& V3 ) const { - Standard_Real dU; + Standard_Real dU = NAN; V1.SetCoord(0., 0.); V2.SetCoord(0., 0.); @@ -398,7 +400,7 @@ void Bisector_BisecPC::Values(const Standard_Real U, Standard_Real SquarePPC = aPPC.SquareMagnitude(); Standard_Real NorPPC = Nor.Dot(aPPC); - Standard_Real A1; + Standard_Real A1 = NAN; if (Abs(NorPPC) > gp::Resolution() && (NorPPC*sign) < 0.) { A1 = 0.5*SquarePPC/NorPPC; @@ -608,7 +610,7 @@ gp_Vec2d Bisector_BisecPC::DN (const Standard_Real U, Standard_Real Bisector_BisecPC::SearchBound (const Standard_Real U1, const Standard_Real U2) const { - Standard_Real Dist1,DistMid,U11,U22; + Standard_Real Dist1 = NAN,DistMid = NAN,U11 = NAN,U22 = NAN; Standard_Real UMid = 0.; Standard_Real Tol = Precision::PConfusion(); Standard_Real DistMax2 = distMax*distMax; @@ -646,7 +648,7 @@ void Bisector_BisecPC::ComputeIntervals () { Standard_Real U1 =0.,U2 =0.,UProj =0.; Standard_Real UStart = 0., UEnd = 0.; - Standard_Real Dist1,Dist2,DistProj; + Standard_Real Dist1 = NAN,Dist2 = NAN,DistProj = NAN; isEmpty = Standard_False; shiftParameter = 0.; Standard_Boolean YaProj = Standard_False; diff --git a/src/Bisector/Bisector_BisecPC.hxx b/src/Bisector/Bisector_BisecPC.hxx index be81b90930..f45480eb10 100644 --- a/src/Bisector/Bisector_BisecPC.hxx +++ b/src/Bisector/Bisector_BisecPC.hxx @@ -185,17 +185,17 @@ private: Handle(Geom2d_Curve) curve; gp_Pnt2d point; - Standard_Real sign; + Standard_Real sign{}; TColStd_SequenceOfReal startIntervals; TColStd_SequenceOfReal endIntervals; - Standard_Integer bisInterval; - Standard_Integer currentInterval; - Standard_Real shiftParameter; - Standard_Real distMax; - Standard_Boolean isEmpty; - Standard_Boolean isConvex; - Standard_Boolean extensionStart; - Standard_Boolean extensionEnd; + Standard_Integer bisInterval{}; + Standard_Integer currentInterval{}; + Standard_Real shiftParameter{}; + Standard_Real distMax{}; + Standard_Boolean isEmpty{}; + Standard_Boolean isConvex{}; + Standard_Boolean extensionStart{}; + Standard_Boolean extensionEnd{}; gp_Pnt2d pointStartBis; gp_Pnt2d pointEndBis; diff --git a/src/Bisector/Bisector_FunctionH.cxx b/src/Bisector/Bisector_FunctionH.cxx index 3133d375d5..4fcbdbe36a 100644 --- a/src/Bisector/Bisector_FunctionH.cxx +++ b/src/Bisector/Bisector_FunctionH.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -27,10 +29,10 @@ Bisector_FunctionH::Bisector_FunctionH (const Handle(Geom2d_Curve)& C2, const gp_Pnt2d& P1, const gp_Vec2d& T1) - :p1(P1),t1(T1) + :curve2(C2), p1(P1),t1(T1) { t1.Normalize(); - curve2 = C2; + } //============================================================================= @@ -61,7 +63,7 @@ Standard_Boolean Bisector_FunctionH::Value (const Standard_Real X, Standard_Boolean Bisector_FunctionH::Derivative(const Standard_Real X, Standard_Real& D) { - Standard_Real F; + Standard_Real F = NAN; return Values (X,F,D); } diff --git a/src/Bisector/Bisector_FunctionInter.cxx b/src/Bisector/Bisector_FunctionInter.cxx index 82401af84a..90dca533c8 100644 --- a/src/Bisector/Bisector_FunctionInter.cxx +++ b/src/Bisector/Bisector_FunctionInter.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -39,11 +41,11 @@ Bisector_FunctionInter::Bisector_FunctionInter () //============================================================================= Bisector_FunctionInter::Bisector_FunctionInter (const Handle(Geom2d_Curve)& C , const Handle(Bisector_Curve)& B1 , - const Handle(Bisector_Curve)& B2 ) + const Handle(Bisector_Curve)& B2 ) : curve(C), bisector1(B1), bisector2(B2) { - curve = C; - bisector1 = B1; - bisector2 = B2; + + + } //============================================================================= @@ -82,7 +84,7 @@ Standard_Boolean Bisector_FunctionInter::Value (const Standard_Real X, Standard_Boolean Bisector_FunctionInter::Derivative(const Standard_Real X, Standard_Real& D) { - Standard_Real F; + Standard_Real F = NAN; return Values (X,F,D); } @@ -96,7 +98,7 @@ Standard_Boolean Bisector_FunctionInter::Values (const Standard_Real X, { gp_Pnt2d PC, PB1, PB2; gp_Vec2d TC, TB1, TB2; - Standard_Real F1, F2, DF1, DF2; + Standard_Real F1 = NAN, F2 = NAN, DF1 = NAN, DF2 = NAN; curve ->D1(X,PC ,TC); bisector1 ->D1(X,PB1,TB1); diff --git a/src/Bisector/Bisector_Inter.cxx b/src/Bisector/Bisector_Inter.cxx index 876a4a501b..1c79a97e78 100644 --- a/src/Bisector/Bisector_Inter.cxx +++ b/src/Bisector/Bisector_Inter.cxx @@ -16,6 +16,8 @@ // Modified by skv - Mon May 5 15:06:39 2003 OCC616 +#include + #include #include #include @@ -106,8 +108,8 @@ void Bisector_Inter::Perform(const Bisector_Bisec& C1, IntRes2d_Domain* SD2 = new IntRes2d_Domain [Bis2->NbIntervals()+1]; Standard_Integer NB1 = 0; Standard_Integer NB2 = 0; - Standard_Real MinDomain,MaxDomain; - Standard_Real UMin,UMax; + Standard_Real MinDomain = NAN,MaxDomain = NAN; + Standard_Real UMin = NAN,UMax = NAN; gp_Pnt2d PMin,PMax; //------------------------------------------------------ @@ -124,7 +126,7 @@ void Bisector_Inter::Perform(const Bisector_Bisec& C1, // continuity taking account of D1 //---------------------------------------------------------- //for (Standard_Integer IB1 = 1; IB1 <= Bis1->NbIntervals(); IB1++) { - Standard_Integer IB1; + Standard_Integer IB1 = 0; for ( IB1 = 1; IB1 <= Bis1->NbIntervals(); IB1++) { UMin = Bis1->IntervalFirst(IB1); UMax = Bis1->IntervalLast (IB1); @@ -164,7 +166,7 @@ void Bisector_Inter::Perform(const Bisector_Bisec& C1, // continuity taking account of D2 //---------------------------------------------------------- //for (Standard_Integer IB2 = 1; IB2 <= Bis2->NbIntervals(); IB2++) { - Standard_Integer IB2; + Standard_Integer IB2 = 0; for ( IB2 = 1; IB2 <= Bis2->NbIntervals(); IB2++) { UMin = Bis2->IntervalFirst(IB2); UMax = Bis2->IntervalLast (IB2); @@ -217,8 +219,8 @@ void Bisector_Inter::SinglePerform(const Handle(Geom2d_Curve)& CBis1, const Standard_Real Tol, const Standard_Boolean ComunElement) { - Handle(Geom2d_Curve) Bis1 = CBis1; - Handle(Geom2d_Curve) Bis2 = CBis2; + const Handle(Geom2d_Curve)& Bis1 = CBis1; + const Handle(Geom2d_Curve)& Bis2 = CBis2; Handle(Standard_Type) Type1 = Bis1->DynamicType(); Handle(Standard_Type) Type2 = Bis2->DynamicType(); @@ -322,7 +324,7 @@ void Bisector_Inter::NeighbourPerform(const Handle(Bisector_BisecCC)& Bis1, const IntRes2d_Domain& D2, const Standard_Real Tol) { - Standard_Real USol,U1,U2,Dist; + Standard_Real USol = NAN,U1 = NAN,U2 = NAN,Dist = NAN; Standard_Real UMin =0.,UMax =0.; Standard_Real Eps = Precision::PConfusion(); gp_Pnt2d PSol; diff --git a/src/Bisector/Bisector_PointOnBis.cxx b/src/Bisector/Bisector_PointOnBis.cxx index 0d3a1c0148..db80f9e8ab 100644 --- a/src/Bisector/Bisector_PointOnBis.cxx +++ b/src/Bisector/Bisector_PointOnBis.cxx @@ -44,9 +44,9 @@ Bisector_PointOnBis::Bisector_PointOnBis(const Standard_Real Param1, param2 (Param2), paramBis (ParamBis), distance (Distance), - point (P) + infinite(Standard_False), point (P) { - infinite = Standard_False; + } //============================================================================= diff --git a/src/Bisector/Bisector_PolyBis.cxx b/src/Bisector/Bisector_PolyBis.cxx index 6cddc59389..b84793fd77 100644 --- a/src/Bisector/Bisector_PolyBis.cxx +++ b/src/Bisector/Bisector_PolyBis.cxx @@ -24,9 +24,9 @@ //function : Bisector_PolyBis // purpose : //============================================================================= -Bisector_PolyBis::Bisector_PolyBis() +Bisector_PolyBis::Bisector_PolyBis() : nbPoints(0) { - nbPoints = 0; + } //============================================================================= diff --git a/src/Bnd/Bnd_BoundSortBox.cxx b/src/Bnd/Bnd_BoundSortBox.cxx index a9f1fd8ffe..d69d4ee45b 100644 --- a/src/Bnd/Bnd_BoundSortBox.cxx +++ b/src/Bnd/Bnd_BoundSortBox.cxx @@ -24,6 +24,7 @@ #include #include +#include #include //-- ================================================================================ //-- lbr le 27 fev 97 @@ -219,7 +220,7 @@ BSB_T3Bits::BSB_T3Bits(int size) case 16: { _DECAL=4; _DECAL2= 8; _BASE= 16; _BASEM1= 15; break; } default : { _DECAL=3; _DECAL2= 6; _BASE= 8; _BASEM1= 7; break; } } - Standard_Integer i ; + Standard_Integer i = 0 ; unsigned int nb = (size*size*size)>>5; Isize = nb; ssize = size; @@ -316,9 +317,9 @@ void BSB_T3Bits::AppendAxisX(const Standard_Integer i, //purpose : //======================================================================= Bnd_BoundSortBox::Bnd_BoundSortBox() - : discrX(0), discrY(0), discrZ(0) + : discrX(0), discrY(0), discrZ(0), TabBits(0) { - TabBits=0; + #if DEBUG NBCOMPARE=0L; NBBOITES=0L; NBBOITESATESTER=0L; APPELREJECTION=0L; REJECTNIV0=0L; REJECTNIV1=0L; @@ -336,7 +337,7 @@ void Bnd_BoundSortBox::Initialize(const Bnd_Box& CompleteBox, myBndComponents=SetOfBox; const Bnd_Array1OfBox & taBox=myBndComponents->Array1(); discrX=discrY=discrZ=ComputeSize(taBox.Upper()-taBox.Lower()); - Standard_Real Xmax, Ymax, Zmax; + Standard_Real Xmax = NAN, Ymax = NAN, Zmax = NAN; if(CompleteBox.IsVoid()) return; CompleteBox.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); @@ -353,17 +354,17 @@ void Bnd_BoundSortBox::Initialize(const Handle(Bnd_HArray1OfBox)& SetOfBox) { myBndComponents=SetOfBox; const Bnd_Array1OfBox & taBox=myBndComponents->Array1(); - Standard_Integer i0,i1; + Standard_Integer i0 = 0,i1 = 0; i0=taBox.Lower(); i1=taBox.Upper(); discrX=discrY=discrZ=ComputeSize(i1-i0); - Standard_Integer labox; + Standard_Integer labox = 0; for (labox=i0; labox<=i1; labox++) { if (!taBox(labox).IsVoid()) { myBox.Add(taBox(labox)); } } - Standard_Real Xmax, Ymax, Zmax; + Standard_Real Xmax = NAN, Ymax = NAN, Zmax = NAN; if(myBox.IsVoid()) return; myBox.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); @@ -378,11 +379,11 @@ void Bnd_BoundSortBox::Initialize(const Handle(Bnd_HArray1OfBox)& SetOfBox) //======================================================================= void Bnd_BoundSortBox::SortBoxes() { - Standard_Integer labox; - Standard_Integer lacaseX, firstcaseX, lastcaseX; - Standard_Integer lacaseY, firstcaseY, lastcaseY; - Standard_Integer lacaseZ, firstcaseZ, lastcaseZ; - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Integer labox = 0; + Standard_Integer lacaseX = 0, firstcaseX = 0, lastcaseX = 0; + Standard_Integer lacaseY = 0, firstcaseY = 0, lastcaseY = 0; + Standard_Integer lacaseZ = 0, firstcaseZ = 0, lastcaseZ = 0; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; const Bnd_Array1OfBox & taBox=myBndComponents->Array1(); Standard_Integer i0=taBox.Lower(); Standard_Integer i1=taBox.Upper(); @@ -401,7 +402,7 @@ void Bnd_BoundSortBox::SortBoxes() Map->ToTest[i]=i0-1; } } - Standard_Real _Xmax,_Xmin,_Ymax,_Ymin,_Zmin,_Zmax; + Standard_Real _Xmax = NAN,_Xmin = NAN,_Ymax = NAN,_Ymin = NAN,_Zmin = NAN,_Zmax = NAN; myBox.Get(_Xmin,_Ymin,_Zmin,_Xmax,_Ymax,_Zmax); Map->Xmax=_Xmax; Map->Ymax=_Ymax; Map->Zmax=_Zmax; Map->Xmin=_Xmin; Map->Ymin=_Ymin; Map->Zmin=_Zmin; @@ -484,7 +485,7 @@ void Bnd_BoundSortBox::Initialize(const Bnd_Box& CompleteBox, //***<<< JCD - End discrX=discrY=discrZ=ComputeSize(nbComponents); - Standard_Real Xmax, Ymax, Zmax; + Standard_Real Xmax = NAN, Ymax = NAN, Zmax = NAN; if(CompleteBox.IsVoid()) return; @@ -513,10 +514,10 @@ void Bnd_BoundSortBox::Add(const Bnd_Box& theBox, if (!theBox.IsVoid()) { Standard_Integer i0=myBndComponents->Lower(); Standard_Integer i1=myBndComponents->Upper(); - Standard_Integer theGapX, firstGapX , lastGapX; - Standard_Integer theGapY, firstGapY , lastGapY; - Standard_Integer theGapZ, firstGapZ , lastGapZ; - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Integer theGapX = 0, firstGapX = 0 , lastGapX = 0; + Standard_Integer theGapY = 0, firstGapY = 0 , lastGapY = 0; + Standard_Integer theGapZ = 0, firstGapZ = 0 , lastGapZ = 0; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; myBndComponents->SetValue(boxIndex, theBox); theBox.Get(xmin, ymin, zmin, xmax, ymax, zmax); BSB_T3Bits* Map = (BSB_T3Bits *)TabBits; @@ -528,7 +529,7 @@ void Bnd_BoundSortBox::Add(const Bnd_Box& theBox, Map->ToTest[i]=i0-1; } } - Standard_Real _Xmax,_Ymax,_Zmax; + Standard_Real _Xmax = NAN,_Ymax = NAN,_Zmax = NAN; _Xmax=Map->Xmax; _Ymax=Map->Ymax; _Zmax=Map->Zmax; if(xmin>Xmin) firstGapX=(Standard_Integer )((xmin-Xmin)*deltaX)-1; else firstGapX=1; if(ymin>Ymin) firstGapY=(Standard_Integer )((ymin-Ymin)*deltaY)-1; else firstGapY=1; @@ -629,7 +630,7 @@ static void VerifCompare(const TColStd_ListOfInteger& lastResult, const TColStd_ListOfInteger& Bnd_BoundSortBox::Compare (const Bnd_Box& theBox) { - Standard_Integer lacase ; + Standard_Integer lacase = 0 ; #if DEBUG NBCOMPARE++; #endif @@ -645,12 +646,12 @@ const TColStd_ListOfInteger& Bnd_BoundSortBox::Compare (const Bnd_Box& theBox) //-- Rejection with the table of bits Standard_Boolean touch = Standard_True; touch = Standard_False; - Standard_Real _Xmax,_Ymax,_Zmax; + Standard_Real _Xmax = NAN,_Ymax = NAN,_Zmax = NAN; BSB_T3Bits* Map = (BSB_T3Bits *)TabBits; - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; _Xmax=Map->Xmax; _Ymax=Map->Ymax; _Zmax=Map->Zmax; theBox.Get(xmin, ymin, zmin, xmax, ymax, zmax); - Standard_Integer i0,i1,j0,j1,k0,k1; + Standard_Integer i0 = 0,i1 = 0,j0 = 0,j1 = 0,k0 = 0,k1 = 0; if(xmin>Xmin) i0=(Standard_Integer )((xmin-Xmin)*deltaX)-1; else i0=1; if(ymin>Ymin) j0=(Standard_Integer )((ymin-Ymin)*deltaY)-1; else j0=1; if(zmin>Zmin) k0=(Standard_Integer )((zmin-Zmin)*deltaZ)-1; else k0=1; @@ -770,7 +771,7 @@ const TColStd_ListOfInteger& Bnd_BoundSortBox::Compare(const gp_Pln& thePlane) { lastResult.Clear(); - Standard_Integer i; + Standard_Integer i = 0; const Bnd_Array1OfBox& boxes = myBndComponents->Array1(); for (i = boxes.Lower(); i <= boxes.Upper(); i++) { if (!boxes(i).IsOut(thePlane)) diff --git a/src/Bnd/Bnd_BoundSortBox.hxx b/src/Bnd/Bnd_BoundSortBox.hxx index b83e4f5663..70c7839929 100644 --- a/src/Bnd/Bnd_BoundSortBox.hxx +++ b/src/Bnd/Bnd_BoundSortBox.hxx @@ -122,16 +122,16 @@ private: Bnd_Box myBox; Handle(Bnd_HArray1OfBox) myBndComponents; - Standard_Real Xmin; - Standard_Real Ymin; - Standard_Real Zmin; - Standard_Real deltaX; - Standard_Real deltaY; - Standard_Real deltaZ; + Standard_Real Xmin{}; + Standard_Real Ymin{}; + Standard_Real Zmin{}; + Standard_Real deltaX{}; + Standard_Real deltaY{}; + Standard_Real deltaZ{}; Standard_Integer discrX; Standard_Integer discrY; Standard_Integer discrZ; - Standard_Integer theFound; + Standard_Integer theFound{}; TColStd_DataMapOfIntegerInteger Crible; TColStd_ListOfInteger lastResult; Standard_Address TabBits; diff --git a/src/Bnd/Bnd_Box.cxx b/src/Bnd/Bnd_Box.cxx index eba846a5f5..ea9e8a5ce7 100644 --- a/src/Bnd/Bnd_Box.cxx +++ b/src/Bnd/Bnd_Box.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -445,7 +447,7 @@ void Bnd_Box::Add (const Bnd_Box& Other) void Bnd_Box::Add (const gp_Pnt& P) { - Standard_Real X,Y,Z; + Standard_Real X = NAN,Y = NAN,Z = NAN; P.Coord(X,Y,Z); Update(X,Y,Z); } @@ -469,7 +471,7 @@ void Bnd_Box::Add (const gp_Pnt& P, const gp_Dir& D) void Bnd_Box::Add (const gp_Dir& D) { - Standard_Real DX,DY,DZ; + Standard_Real DX = NAN,DY = NAN,DZ = NAN; D.Coord(DX,DY,DZ); if (DX < -RealEpsilon()) @@ -498,7 +500,7 @@ Standard_Boolean Bnd_Box::IsOut (const gp_Pnt& P) const if (IsWhole()) return Standard_False; else if (IsVoid()) return Standard_True; else { - Standard_Real X,Y,Z; + Standard_Real X = NAN,Y = NAN,Z = NAN; P.Coord(X,Y,Z); if (!IsOpenXmin() && (X < (Xmin-Gap))) return Standard_True; else if (!IsOpenXmax() && (X > (Xmax+Gap))) return Standard_True; @@ -521,7 +523,7 @@ Standard_Boolean Bnd_Box::IsOut (const gp_Pln& P) const if (IsWhole()) return Standard_False; else if (IsVoid()) return Standard_True; else { - Standard_Real A,B,C,D; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN; P.Coefficients (A, B ,C ,D); Standard_Real d = A * (Xmin-Gap) + B * (Ymin-Gap) + C * (Zmin-Gap) + D; // Standard_Boolean plus = d > 0; @@ -554,10 +556,10 @@ Standard_Boolean Bnd_Box::IsOut (const gp_Lin& L) const if (IsWhole()) return Standard_False; else if (IsVoid()) return Standard_True; else { - Standard_Real xmin = 0, xmax = 0, ymin = 0, ymax = 0, zmin, zmax; - Standard_Real parmin, parmax, par1, par2; - Standard_Boolean xToSet, yToSet; - Standard_Real myXmin, myYmin, myZmin, myXmax, myYmax, myZmax; + Standard_Real xmin = 0, xmax = 0, ymin = 0, ymax = 0, zmin = NAN, zmax = NAN; + Standard_Real parmin = NAN, parmax = NAN, par1 = NAN, par2 = NAN; + Standard_Boolean xToSet = 0, yToSet = 0; + Standard_Real myXmin = NAN, myYmin = NAN, myZmin = NAN, myXmax = NAN, myYmax = NAN, myZmax = NAN; Get (myXmin, myYmin, myZmin, myXmax, myYmax, myZmax); if (Abs(L.Direction().XYZ().X())>0.) { @@ -648,8 +650,8 @@ Standard_Boolean Bnd_Box::IsOut (const Bnd_Box& Other) const { //modified by NIZNHY-PKV Fri Jul 08 11:03:43 2011f if (!Flags && !Other.Flags) { - Standard_Boolean bRet; - Standard_Real delta; + Standard_Boolean bRet = 0; + Standard_Real delta = NAN; // delta = Other.Gap + Gap; bRet=((Xmin - Other.Xmax > delta) || @@ -766,7 +768,7 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Dir else if (IsVoid()) return Standard_True; Standard_Real eps = RealSmall(); - Standard_Real myXmin, myYmin, myZmin, myXmax, myYmax, myZmax; + Standard_Real myXmin = NAN, myYmin = NAN, myZmin = NAN, myXmax = NAN, myYmax = NAN, myZmax = NAN; Get (myXmin, myYmin, myZmin, myXmax, myYmax, myZmax); if(Abs(D.X()) < eps && Abs(D.Y()) < eps) @@ -905,7 +907,7 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Dir //======================================================================= static Standard_Real DistMini2Box( const Standard_Real r1min, const Standard_Real r1max, const Standard_Real r2min, const Standard_Real r2max) -{ Standard_Real r1, r2; +{ Standard_Real r1 = NAN, r2 = NAN; r1 = Square(r1min - r2max); r2 = Square(r1max - r2min); @@ -915,9 +917,9 @@ static Standard_Real DistMini2Box( const Standard_Real r1min, const Standard_Re Standard_Real Bnd_Box::Distance(const Bnd_Box& Other) const -{ Standard_Real xminB1, yminB1, zminB1, xmaxB1, ymaxB1, zmaxB1; - Standard_Real xminB2, yminB2, zminB2, xmaxB2, ymaxB2, zmaxB2; - Standard_Real dist_x, dist_y, dist_z, dist_t; +{ Standard_Real xminB1 = NAN, yminB1 = NAN, zminB1 = NAN, xmaxB1 = NAN, ymaxB1 = NAN, zmaxB1 = NAN; + Standard_Real xminB2 = NAN, yminB2 = NAN, zminB2 = NAN, xmaxB2 = NAN, ymaxB2 = NAN, zmaxB2 = NAN; + Standard_Real dist_x = NAN, dist_y = NAN, dist_z = NAN, dist_t = NAN; Get( xminB1, yminB1, zminB1, xmaxB1, ymaxB1, zmaxB1); Other.Get( xminB2, yminB2, zminB2, xmaxB2, ymaxB2, zmaxB2); diff --git a/src/Bnd/Bnd_Box.hxx b/src/Bnd/Bnd_Box.hxx index f9390cb87f..e18eaf7e4c 100644 --- a/src/Bnd/Bnd_Box.hxx +++ b/src/Bnd/Bnd_Box.hxx @@ -323,14 +323,14 @@ protected: private: - Standard_Real Xmin; - Standard_Real Xmax; - Standard_Real Ymin; - Standard_Real Ymax; - Standard_Real Zmin; - Standard_Real Zmax; + Standard_Real Xmin{}; + Standard_Real Xmax{}; + Standard_Real Ymin{}; + Standard_Real Ymax{}; + Standard_Real Zmin{}; + Standard_Real Zmax{}; Standard_Real Gap; - Standard_Integer Flags; + Standard_Integer Flags{}; }; diff --git a/src/Bnd/Bnd_Box2d.cxx b/src/Bnd/Bnd_Box2d.cxx index 0790c51dd1..0c82623155 100644 --- a/src/Bnd/Bnd_Box2d.cxx +++ b/src/Bnd/Bnd_Box2d.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -100,7 +102,7 @@ Bnd_Box2d Bnd_Box2d::Transformed (const gp_Trsf2d& T) const if (F == gp_Identity) {} else if (F == gp_Translation) { - Standard_Real DX,DY; + Standard_Real DX = NAN,DY = NAN; (T.TranslationPart()).Coord(DX,DY); if (!(Flags & XminMask)) newb.Xmin += DX; if (!(Flags & XmaxMask)) newb.Xmax += DX; @@ -110,7 +112,7 @@ Bnd_Box2d Bnd_Box2d::Transformed (const gp_Trsf2d& T) const else { gp_Pnt2d P[4]; Standard_Boolean Vertex[4]; - Standard_Integer i; + Standard_Integer i = 0; Vertex[0] = Standard_True; Vertex[1] = Standard_True; Vertex[2] = Standard_True; @@ -264,7 +266,7 @@ Standard_Boolean Bnd_Box2d::IsOut(const gp_Lin2d& theL) const { return Standard_True; } - Standard_Real aXMin, aXMax, aYMin, aYMax; + Standard_Real aXMin = NAN, aXMax = NAN, aYMin = NAN, aYMax = NAN; Get(aXMin, aYMin, aXMax, aYMax); gp_XY aCenter((aXMin + aXMax) / 2, (aYMin + aYMax) / 2); @@ -296,7 +298,7 @@ Standard_Boolean Bnd_Box2d::IsOut(const gp_Pnt2d& theP0, const gp_Pnt2d& theP1) } Standard_Boolean aStatus = Standard_True; - Standard_Real aLocXMin, aLocXMax, aLocYMin, aLocYMax; + Standard_Real aLocXMin = NAN, aLocXMax = NAN, aLocYMin = NAN, aLocYMax = NAN; Get(aLocXMin, aLocYMin, aLocXMax, aLocYMax); //// Intersect the line containing the segment. @@ -335,7 +337,7 @@ Standard_Boolean Bnd_Box2d::IsOut (const Bnd_Box2d& Other) const else if (Other.IsWhole()) return Standard_False; else if (Other.IsVoid()) return Standard_True; else { - Standard_Real OXmin,OXmax,OYmin,OYmax; + Standard_Real OXmin = NAN,OXmax = NAN,OYmin = NAN,OYmax = NAN; Other.Get(OXmin,OYmin,OXmax,OYmax); if (!(Flags & XminMask) && (OXmax < (Xmin-Gap))) return Standard_True; else if (!(Flags & XmaxMask) && (OXmin > (Xmax+Gap))) return Standard_True; diff --git a/src/Bnd/Bnd_OBB.cxx b/src/Bnd/Bnd_OBB.cxx index 637edf26a0..083a3d217b 100644 --- a/src/Bnd/Bnd_OBB.cxx +++ b/src/Bnd/Bnd_OBB.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -73,7 +75,7 @@ public: //! @name Getting the results public: //! @name Definition of rejection/acceptance rules //! Defines the rules for node rejection - virtual Standard_Boolean RejectNode (const BVH_Vec3d& theCMin, + Standard_Boolean RejectNode (const BVH_Vec3d& theCMin, const BVH_Vec3d& theCMax, Bnd_Range& theMetric) const Standard_OVERRIDE { @@ -116,13 +118,13 @@ public: //! @name Definition of rejection/acceptance rules } //! Rules for node rejection by the metric - virtual Standard_Boolean RejectMetric (const Bnd_Range& theMetric) const Standard_OVERRIDE + Standard_Boolean RejectMetric (const Bnd_Range& theMetric) const Standard_OVERRIDE { if (myPrmMin > myPrmMax) // no parameters computed return Standard_False; - Standard_Real aMin, aMax; + Standard_Real aMin = NAN, aMax = NAN; if (!theMetric.GetBounds (aMin, aMax)) // void metric return Standard_False; @@ -132,7 +134,7 @@ public: //! @name Definition of rejection/acceptance rules } //! Defines the rules for leaf acceptance - virtual Standard_Boolean Accept (const Standard_Integer theIndex, + Standard_Boolean Accept (const Standard_Integer theIndex, const Bnd_Range&) Standard_OVERRIDE { const gp_XYZ& theLeaf = myBVHSet->Element (theIndex); @@ -153,7 +155,7 @@ public: //! @name Definition of rejection/acceptance rules public: //! @name Choosing the best branch //! Returns true if the metric of the left branch is better than the metric of the right - virtual Standard_Boolean IsMetricBetter (const Bnd_Range& theLeft, + Standard_Boolean IsMetricBetter (const Bnd_Range& theLeft, const Bnd_Range& theRight) const Standard_OVERRIDE { if (myPrmMin > myPrmMax) @@ -357,7 +359,7 @@ private: //! Points of ditetrahedron //! given by their indices in myLExtremalPoints. - Standard_Integer myTriIdx[5]; + Standard_Integer myTriIdx[5]{}; //! List of extremal points gp_XYZ myLExtremalPoints[myNbExtremalPoints]; diff --git a/src/Bnd/Bnd_Sphere.cxx b/src/Bnd/Bnd_Sphere.cxx index 844f63f3c9..0921d6204d 100644 --- a/src/Bnd/Bnd_Sphere.cxx +++ b/src/Bnd/Bnd_Sphere.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include Bnd_Sphere::Bnd_Sphere() @@ -100,7 +102,7 @@ Standard_Boolean Bnd_Sphere::IsOut( const Bnd_Sphere& theOther ) const Standard_Boolean Bnd_Sphere::IsOut( const gp_XYZ& theXYZ, Standard_Real& theMaxDist) const { - Standard_Real aCurMinDist, aCurMaxDist; + Standard_Real aCurMinDist = NAN, aCurMaxDist = NAN; Distances( theXYZ, aCurMinDist, aCurMaxDist ); if ( aCurMinDist > theMaxDist ) return Standard_True; diff --git a/src/BndLib/BndLib.cxx b/src/BndLib/BndLib.cxx index adbd0238bc..9cbdf96c9d 100644 --- a/src/BndLib/BndLib.cxx +++ b/src/BndLib/BndLib.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -51,8 +53,8 @@ namespace const PointType& theXd, const PointType& theYd, const PointType& theO, BndBoxType& theB) { - Standard_Real aTeta1; - Standard_Real aTeta2; + Standard_Real aTeta1 = NAN; + Standard_Real aTeta2 = NAN; if(theP2 < theP1) { aTeta1 = theP2; @@ -84,13 +86,13 @@ namespace } // One places already both ends - Standard_Real aCn1, aSn1 ,aCn2, aSn2; + Standard_Real aCn1 = NAN, aSn1 = NAN ,aCn2 = NAN, aSn2 = NAN; aCn1 = Cos(aTeta1); aSn1 = Sin(aTeta1); aCn2 = Cos(aTeta2); aSn2 = Sin(aTeta2); theB.Add(PointType( theO.Coord() +theRa*aCn1*theXd.Coord() +theRb*aSn1*theYd.Coord())); theB.Add(PointType(theO.Coord() +theRa*aCn2*theXd.Coord() +theRb*aSn2*theYd.Coord())); - Standard_Real aRam, aRbm; + Standard_Real aRam = NAN, aRbm = NAN; if (aDelta > M_PI/8.) { // Main radiuses to take into account only 8 points (/cos(Pi/8.)) @@ -433,8 +435,8 @@ void BndLib::Add(const gp_Circ& C, gp_XYZ Yd = C.YAxis().Direction().XYZ(); const gp_Ax2& pos = C.Position(); // - Standard_Real tt; - Standard_Real xmin, xmax, txmin, txmax; + Standard_Real tt = NAN; + Standard_Real xmin = NAN, xmax = NAN, txmin = NAN, txmax = NAN; if(Abs(Xd.X()) > gp::Resolution()) { txmin = ATan(Yd.X() / Xd.X()); @@ -457,7 +459,7 @@ void BndLib::Add(const gp_Circ& C, txmax = tt; } // - Standard_Real ymin, ymax, tymin, tymax; + Standard_Real ymin = NAN, ymax = NAN, tymin = NAN, tymax = NAN; if(Abs(Xd.Y()) > gp::Resolution()) { tymin = ATan(Yd.Y() / Xd.Y()); @@ -480,7 +482,7 @@ void BndLib::Add(const gp_Circ& C, tymax = tt; } // - Standard_Real zmin, zmax, tzmin, tzmax; + Standard_Real zmin = NAN, zmax = NAN, tzmin = NAN, tzmax = NAN; if(Abs(Xd.Z()) > gp::Resolution()) { tzmin = ATan(Yd.Z() / Xd.Z()); @@ -513,7 +515,7 @@ void BndLib::Add(const gp_Circ& C, B.Add(P); P = ElCLib::CircleValue(utrim2, pos, R); B.Add(P); - Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + Standard_Real Xmin = NAN, Ymin = NAN, Zmin = NAN, Xmax = NAN, Ymax = NAN, Zmax = NAN; B.FinitePart().Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); Standard_Real gap = B.GetGap(); Xmin += gap; @@ -618,8 +620,8 @@ void BndLib::Add(const gp_Elips& C, gp_XYZ Yd = C.YAxis().Direction().XYZ(); const gp_Ax2& pos = C.Position(); // - Standard_Real tt; - Standard_Real xmin, xmax, txmin, txmax; + Standard_Real tt = NAN; + Standard_Real xmin = NAN, xmax = NAN, txmin = NAN, txmax = NAN; if(Abs(Xd.X()) > gp::Resolution()) { txmin = ATan((MinR*Yd.X()) / (MajR*Xd.X())); @@ -642,7 +644,7 @@ void BndLib::Add(const gp_Elips& C, txmax = tt; } // - Standard_Real ymin, ymax, tymin, tymax; + Standard_Real ymin = NAN, ymax = NAN, tymin = NAN, tymax = NAN; if(Abs(Xd.Y()) > gp::Resolution()) { tymin = ATan((MinR*Yd.Y()) / (MajR*Xd.Y())); @@ -665,7 +667,7 @@ void BndLib::Add(const gp_Elips& C, tymax = tt; } // - Standard_Real zmin, zmax, tzmin, tzmax; + Standard_Real zmin = NAN, zmax = NAN, tzmin = NAN, tzmax = NAN; if(Abs(Xd.Z()) > gp::Resolution()) { tzmin = ATan((MinR*Yd.Z()) / (MajR*Xd.Z())); @@ -698,7 +700,7 @@ void BndLib::Add(const gp_Elips& C, B.Add(P); P = ElCLib::EllipseValue(utrim2, pos, MajR, MinR); B.Add(P); - Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + Standard_Real Xmin = NAN, Ymin = NAN, Zmin = NAN, Xmax = NAN, Ymax = NAN, Zmax = NAN; B.FinitePart().Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); Standard_Real gap = B.GetGap(); Xmin += gap; @@ -1136,7 +1138,7 @@ static void ComputeSphere (const gp_Sphere& Sphere, { gp_Pnt P = Sphere.Location(); Standard_Real R = Sphere.Radius(); - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; xmin = P.X() - R; xmax = P.X() + R; ymin = P.Y() - R; @@ -1153,7 +1155,7 @@ static void ComputeSphere (const gp_Sphere& Sphere, } else { - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; Standard_Real umax = UMin + 2. * M_PI; const gp_Ax3& Pos = Sphere.Position(); gp_Pnt PExt = P; @@ -1234,7 +1236,7 @@ static void computeDegeneratedTorus (const gp_Torus& theTorus, gp_Pnt aP = theTorus.Location(); Standard_Real aRa = theTorus.MajorRadius(); Standard_Real aRi = theTorus.MinorRadius(); - Standard_Real aXmin,anYmin,aZmin,aXmax,anYmax,aZmax; + Standard_Real aXmin = NAN,anYmin = NAN,aZmin = NAN,aXmax = NAN,anYmax = NAN,aZmax = NAN; aXmin = aP.X() - aRa - aRi; aXmax = aP.X() + aRa + aRi; anYmin = aP.Y() - aRa - aRi; @@ -1253,7 +1255,7 @@ static void computeDegeneratedTorus (const gp_Torus& theTorus, return; } - Standard_Real anU,aV; + Standard_Real anU = NAN,aV = NAN; Standard_Real anUmax = theUMin + 2. * M_PI; const gp_Ax3& aPos = theTorus.Position(); gp_Pnt aPExt = aP; @@ -1332,7 +1334,7 @@ void BndLib::Add( const gp_Sphere& S,const Standard_Real Tol, Bnd_Box& B) { gp_Pnt P = S.Location(); Standard_Real R = S.Radius(); - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; xmin = P.X() - R; xmax = P.X() + R; ymin = P.Y() - R; @@ -1347,8 +1349,8 @@ void BndLib::Add(const gp_Torus& S,const Standard_Real UMin, const Standard_Real UMax,const Standard_Real VMin, const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) { - Standard_Integer Fi1; - Standard_Integer Fi2; + Standard_Integer Fi1 = 0; + Standard_Integer Fi2 = 0; if (VMax + #include #include #include @@ -109,12 +111,12 @@ class BndLib_Box2dCurve { protected: Handle(Geom2d_Curve) myCurve; Bnd_Box2d myBox; - Standard_Integer myErrorStatus; + Standard_Integer myErrorStatus{}; Handle(Geom2d_Curve) myCurveBase; - Standard_Real myOffsetBase; - Standard_Boolean myOffsetFlag; - Standard_Real myT1; - Standard_Real myT2; + Standard_Real myOffsetBase{}; + Standard_Boolean myOffsetFlag{}; + Standard_Real myT1{}; + Standard_Real myT2{}; GeomAbs_CurveType myTypeBase; }; // @@ -135,7 +137,7 @@ public: } Standard_Boolean Value (const math_Vector& X, - Standard_Real& F) + Standard_Real& F) override { if (!CheckInputData(X(1))) { @@ -150,7 +152,7 @@ public: - Standard_Integer NbVariables() const + Standard_Integer NbVariables() const override { return 1; } @@ -190,7 +192,7 @@ public: } Standard_Boolean Value (const Standard_Real X, - Standard_Real& F) + Standard_Real& F) override { if (!CheckInputData(X)) { @@ -418,8 +420,8 @@ void BndLib_Box2dCurve::PerformBezier() return; } // - Standard_Integer i, aNbPoles; - Standard_Real aT1, aT2, aTb[2]; + Standard_Integer i = 0, aNbPoles = 0; + Standard_Real aT1 = NAN, aT2 = NAN, aTb[2]; gp_Pnt2d aP2D; Handle(Geom2d_Geometry) aG; Handle(Geom2d_BezierCurve) aCBz, aCBzSeg; @@ -466,8 +468,8 @@ void BndLib_Box2dCurve::PerformBSpline() return; } // - Standard_Integer i, aNbPoles; - Standard_Real aT1, aT2, aTb[2]; + Standard_Integer i = 0, aNbPoles = 0; + Standard_Real aT1 = NAN, aT2 = NAN, aTb[2]; gp_Pnt2d aP2D; Handle(Geom2d_Geometry) aG; Handle(Geom2d_BSplineCurve) aCBS, aCBSs; @@ -516,8 +518,8 @@ void BndLib_Box2dCurve::PerformBSpline() //======================================================================= void BndLib_Box2dCurve::PerformOther() { - Standard_Integer j, aNb; - Standard_Real aT, dT; + Standard_Integer j = 0, aNb = 0; + Standard_Real aT = NAN, dT = NAN; gp_Pnt2d aP2D; // aNb=33; @@ -537,7 +539,7 @@ void BndLib_Box2dCurve::PerformOther() //======================================================================= Standard_Integer BndLib_Box2dCurve::NbSamples() { - Standard_Integer N; + Standard_Integer N = 0; switch (myTypeBase) { case GeomAbs_BezierCurve: { @@ -644,10 +646,10 @@ void BndLib_Box2dCurve::PerformGenCurv(const Standard_Real Tol) Standard_Real DeflMax[2] = {-RealLast(), -RealLast()}; // gp_Pnt2d P; - Standard_Integer i, k; + Standard_Integer i = 0, k = 0; Standard_Real du = (myT2 - myT1)/(Nu-1), du2 = du / 2.; NCollection_Array1 aPnts(1, Nu); - Standard_Real u; + Standard_Real u = NAN; for (i = 1, u = myT1; i <= Nu; i++, u += du) { D0(u,P); @@ -703,7 +705,7 @@ void BndLib_Box2dCurve::PerformGenCurv(const Standard_Real Tol) { if(aPnts(i).Coord(k+1) - CMin < d) { - Standard_Real tmin, tmax; + Standard_Real tmin = NAN, tmax = NAN; tmin = myT1 + Max(0, i-2) * du; tmax = myT1 + Min(Nu-1, i) * du; Standard_Real cmin = AdjustExtr(tmin, tmax, @@ -715,7 +717,7 @@ void BndLib_Box2dCurve::PerformGenCurv(const Standard_Real Tol) } else if(CMax - aPnts(i).Coord(k+1) < d) { - Standard_Real tmin, tmax; + Standard_Real tmin = NAN, tmax = NAN; tmin = myT1 + Max(0, i-2) * du; tmax = myT1 + Min(Nu-1, i) * du; Standard_Real cmax = AdjustExtr(tmin, tmax, @@ -746,8 +748,8 @@ void BndLib_Box2dCurve::D0(const Standard_Real aU, myCurveBase->D1(aU, aP2D, aV1); // if (myOffsetFlag) { - Standard_Integer aIndex, aMaxDegree; - Standard_Real aA, aB, aR, aRes; + Standard_Integer aIndex = 0, aMaxDegree = 0; + Standard_Real aA = NAN, aB = NAN, aR = NAN, aRes = NAN; // aMaxDegree=9; aIndex = 2; @@ -779,8 +781,8 @@ void BndLib_Box2dCurve::D0(const Standard_Real aU, //======================================================================= void BndLib_Box2dCurve::GetInfoBase() { - Standard_Boolean bIsTypeBase; - Standard_Integer iTrimmed, iOffset; + Standard_Boolean bIsTypeBase = 0; + Standard_Integer iTrimmed = 0, iOffset = 0; GeomAbs_CurveType aTypeB; Handle(Geom2d_Curve) aC2DB; Handle(Geom2d_TrimmedCurve) aCT2D; @@ -809,7 +811,7 @@ void BndLib_Box2dCurve::GetInfoBase() // aCF2D=Handle(Geom2d_OffsetCurve)::DownCast(aC2DB); if (!aCF2D.IsNull()) { - Standard_Real aOffset; + Standard_Real aOffset = NAN; // aOffset=aCF2D->Offset(); myOffsetBase=myOffsetBase+aOffset; @@ -841,7 +843,7 @@ Standard_Boolean BndLib_Box2dCurve::IsTypeBase (const Handle(Geom2d_Curve)& aC2D, GeomAbs_CurveType& aTypeB) { - Standard_Boolean bRet; + Standard_Boolean bRet = 0; Handle(Standard_Type) aType; // bRet=Standard_True; @@ -880,7 +882,7 @@ Standard_Boolean BndLib_Box2dCurve::IsTypeBase //======================================================================= void BndLib_Box2dCurve::PerformLineConic() { - Standard_Integer i, iInf[2]; + Standard_Integer i = 0, iInf[2]; Standard_Real aTb[2]; gp_Pnt2d aP2D; // @@ -934,8 +936,8 @@ void BndLib_Box2dCurve::Compute(const Handle(Geom2d_Conic)& aConic2D, const Standard_Real aT2, Bnd_Box2d& aBox2D) { - Standard_Integer i, aNbT; - Standard_Real pT[10], aT, aTwoPI, dT, aEps; + Standard_Integer i = 0, aNbT = 0; + Standard_Real pT[10], aT = NAN, aTwoPI = NAN, dT = NAN, aEps = NAN; gp_Pnt2d aP2D; // aNbT=Compute(aConic2D, aType, pT); @@ -987,9 +989,9 @@ Standard_Integer BndLib_Box2dCurve::Compute const GeomAbs_CurveType aType, Standard_Real *pT) { - Standard_Integer iRet, i, j; - Standard_Real aCosBt, aSinBt, aCosGm, aSinGm; - Standard_Real aLx, aLy; + Standard_Integer iRet = 0, i = 0, j = 0; + Standard_Real aCosBt = NAN, aSinBt = NAN, aCosGm = NAN, aSinGm = NAN; + Standard_Real aLx = NAN, aLy = NAN; // iRet=0; // @@ -1053,8 +1055,8 @@ Standard_Integer BndLib_Box2dCurve::Compute }//if (aType==GeomAbs_Ellipse) { // else if (aType==GeomAbs_Parabola) { - Standard_Real aFc, aEps; - Standard_Real aA1, aA2; + Standard_Real aFc = NAN, aEps = NAN; + Standard_Real aA1 = NAN, aA2 = NAN; Handle(Geom2d_Parabola) aPR2D; // aEps=1.e-12; @@ -1081,9 +1083,9 @@ Standard_Integer BndLib_Box2dCurve::Compute }// else if (aType==GeomAbs_Parabola) { // else if (aType==GeomAbs_Hyperbola) { - Standard_Integer k; - Standard_Real aR1, aR2; - Standard_Real aEps, aB1, aB2, aB12, aB22, aZ, aD; + Standard_Integer k = 0; + Standard_Real aR1 = NAN, aR2 = NAN; + Standard_Real aEps = NAN, aB1 = NAN, aB2 = NAN, aB12 = NAN, aB22 = NAN, aZ = NAN, aD = NAN; Handle(Geom2d_Hyperbola) aHP2D; // aEps=1.e-12; @@ -1138,8 +1140,8 @@ Standard_Integer BndLib_Box2dCurve::Compute Standard_Real BndLib_Box2dCurve::AdjustToPeriod(const Standard_Real aT, const Standard_Real aPeriod) { - Standard_Integer k; - Standard_Real aTRet; + Standard_Integer k = 0; + Standard_Real aTRet = NAN; // aTRet=aT; if (aT<0.) { @@ -1192,8 +1194,8 @@ void BndLib_Add2dCurve::Add(const Adaptor2d_Curve2d& aC, Adaptor2d_Curve2d *pC=(Adaptor2d_Curve2d *)&aC; Geom2dAdaptor_Curve *pA=dynamic_cast(pC); if (!pA) { - Standard_Real U, DU; - Standard_Integer N, j; + Standard_Real U = NAN, DU = NAN; + Standard_Integer N = 0, j = 0; gp_Pnt2d P; N = 33; U = aU1; @@ -1221,7 +1223,7 @@ void BndLib_Add2dCurve::Add(const Handle(Geom2d_Curve)& aC2D, const Standard_Real aTol, Bnd_Box2d& aBox2D) { - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; // aT1=aC2D->FirstParameter(); aT2=aC2D->LastParameter(); diff --git a/src/BndLib/BndLib_Add3dCurve.cxx b/src/BndLib/BndLib_Add3dCurve.cxx index 5a763ddc41..74c759f5c0 100644 --- a/src/BndLib/BndLib_Add3dCurve.cxx +++ b/src/BndLib/BndLib_Add3dCurve.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -52,8 +54,8 @@ static void reduceSplineBox(const Adaptor3d_Curve& theCurve, { // Guaranteed bounding box based on poles of bspline. Bnd_Box aPolesBox; - Standard_Real aPolesXMin, aPolesYMin, aPolesZMin, - aPolesXMax, aPolesYMax, aPolesZMax; + Standard_Real aPolesXMin = NAN, aPolesYMin = NAN, aPolesZMin = NAN, + aPolesXMax = NAN, aPolesYMax = NAN, aPolesZMax = NAN; if (theCurve.GetType() == GeomAbs_BSplineCurve) { @@ -83,7 +85,7 @@ static void reduceSplineBox(const Adaptor3d_Curve& theCurve, aPolesBox.Get(aPolesXMin, aPolesYMin, aPolesZMin, aPolesXMax, aPolesYMax, aPolesZMax); - Standard_Real x, y, z, X, Y, Z; + Standard_Real x = NAN, y = NAN, z = NAN, X = NAN, Y = NAN, Z = NAN; theOrigBox.Get(x, y, z, X, Y, Z); // Left bound. @@ -128,7 +130,7 @@ static Standard_Real FillBox(Bnd_Box& B, const Adaptor3d_Curve& C, C.D0(first,P1); B.Add(P1); Standard_Real p = first, dp = last-first, tol= 0.; if(Abs(dp) > Precision::PConfusion()){ - Standard_Integer i; + Standard_Integer i = 0; dp /= 2*N; for(i = 1; i <= N; i++){ p += dp; C.D0(p,P2); B.Add(P2); @@ -225,12 +227,12 @@ void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C, } //OCC566(apo)-> Bnd_Box B1; - Standard_Integer k, k1 = Bs->FirstUKnotIndex(), k2 = Bs->LastUKnotIndex(), + Standard_Integer k = 0, k1 = Bs->FirstUKnotIndex(), k2 = Bs->LastUKnotIndex(), N = Bs->Degree(), NbKnots = Bs->NbKnots(); TColStd_Array1OfReal Knots(1,NbKnots); Bs->Knots(Knots); GeomAdaptor_Curve GACurve(Bs); - Standard_Real first = Knots(k1), last; + Standard_Real first = Knots(k1), last = NAN; for(k = k1 + 1; k <= k2; k++){ last = Knots(k); tol = Max(FillBox(B1,GACurve,first,last,N), tol); @@ -251,7 +253,7 @@ void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C, static Standard_Integer N = 33; tol = FillBox(B1,C,U1,U2,N); B1.Enlarge(weakness*tol); - Standard_Real x, y, z, X, Y, Z; + Standard_Real x = NAN, y = NAN, z = NAN, X = NAN, Y = NAN, Z = NAN; B1.Get(x, y, z, X, Y, Z); B.Update(x, y, z, X, Y, Z); B.Enlarge(Tol); @@ -336,10 +338,10 @@ void BndLib_Add3dCurve::AddGenCurv(const Adaptor3d_Curve& C, Standard_Real DeflMax[3] = {-RealLast(), -RealLast(), -RealLast()}; // gp_Pnt P; - Standard_Integer i, k; + Standard_Integer i = 0, k = 0; Standard_Real du = (UMax-UMin)/(Nu-1), du2 = du / 2.; NCollection_Array1 aPnts(1, Nu); - Standard_Real u; + Standard_Real u = NAN; for (i = 1, u = UMin; i <= Nu; i++, u += du) { C.D0(u,P); @@ -396,7 +398,7 @@ void BndLib_Add3dCurve::AddGenCurv(const Adaptor3d_Curve& C, { if(aPnts(i).Coord(k+1) - CMin < d) { - Standard_Real umin, umax; + Standard_Real umin = NAN, umax = NAN; umin = UMin + Max(0, i-2) * du; umax = UMin + Min(Nu-1, i) * du; Standard_Real cmin = AdjustExtr(C, umin, umax, @@ -408,7 +410,7 @@ void BndLib_Add3dCurve::AddGenCurv(const Adaptor3d_Curve& C, } else if(CMax - aPnts(i).Coord(k+1) < d) { - Standard_Real umin, umax; + Standard_Real umin = NAN, umax = NAN; umin = UMin + Max(0, i-2) * du; umax = UMin + Min(Nu-1, i) * du; Standard_Real cmax = AdjustExtr(C, umin, umax, @@ -445,7 +447,7 @@ public: } Standard_Boolean Value (const math_Vector& X, - Standard_Real& F) + Standard_Real& F) override { if (!CheckInputData(X(1))) { @@ -460,7 +462,7 @@ public: - Standard_Integer NbVariables() const + Standard_Integer NbVariables() const override { return 1; } @@ -500,7 +502,7 @@ public: } Standard_Boolean Value (const Standard_Real X, - Standard_Real& F) + Standard_Real& F) override { if (!CheckInputData(X)) { @@ -600,7 +602,7 @@ Standard_Integer NbSamples(const Adaptor3d_Curve& C, const Standard_Real Umin, const Standard_Real Umax) { - Standard_Integer N; + Standard_Integer N = 0; GeomAbs_CurveType Type = C.GetType(); switch (Type) { case GeomAbs_BezierCurve: diff --git a/src/BndLib/BndLib_AddSurface.cxx b/src/BndLib/BndLib_AddSurface.cxx index b1ba162eac..f1afaf909b 100644 --- a/src/BndLib/BndLib_AddSurface.cxx +++ b/src/BndLib/BndLib_AddSurface.cxx @@ -17,6 +17,8 @@ // Modified by skv - Fri Aug 27 12:29:04 2004 OCC6503 #include +#include + #include #include #include @@ -87,7 +89,7 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S, static Standard_Integer NbUSamples(const Adaptor3d_Surface& S) { - Standard_Integer N; + Standard_Integer N = 0; GeomAbs_SurfaceType Type = S.GetType(); switch (Type) { case GeomAbs_BezierSurface: @@ -114,7 +116,7 @@ static Standard_Integer NbUSamples(const Adaptor3d_Surface& S) static Standard_Integer NbVSamples(const Adaptor3d_Surface& S) { - Standard_Integer N; + Standard_Integer N = 0; GeomAbs_SurfaceType Type = S.GetType(); switch (Type) { case GeomAbs_BezierSurface: @@ -141,7 +143,7 @@ static gp_Pnt BaryCenter(const gp_Pln &aPlane, const Standard_Real aVMin, const Standard_Real aVMax) { - Standard_Real aU, aV; + Standard_Real aU = NAN, aV = NAN; Standard_Boolean isU1Inf = Precision::IsInfinite(aUMin); Standard_Boolean isU2Inf = Precision::IsInfinite(aUMax); Standard_Boolean isV1Inf = Precision::IsInfinite(aVMin); @@ -432,7 +434,7 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S, } // Use poles to build convex hull. - Standard_Integer ip, jp; + Standard_Integer ip = 0, jp = 0; for (Standard_Integer i = UMinIdx; i <= UMaxIdx; i++) { ip = i; @@ -579,8 +581,8 @@ void BndLib_AddSurface::AddGenSurf(const Adaptor3d_Surface& S, Standard_Real du = (UMax-UMin)/(Nu-1), du2 = du / 2.; Standard_Real dv = (VMax-VMin)/(Nv-1), dv2 = dv / 2.; NCollection_Array2 aPnts(1, Nu, 1, Nv); - Standard_Real u, v; - Standard_Integer i, j, k; + Standard_Real u = NAN, v = NAN; + Standard_Integer i = 0, j = 0, k = 0; gp_Pnt P; for (i = 1, u = UMin; i <= Nu; i++, u += du){ for (j = 1, v = VMin;j <= Nv; j++, v += dv){ @@ -664,7 +666,7 @@ void BndLib_AddSurface::AddGenSurf(const Adaptor3d_Surface& S, { if(aPnts(i,j).Coord(k+1) - CMin < d) { - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; umin = UMin + Max(0, i-2) * du; umax = UMin + Min(Nu-1, i) * du; vmin = VMin + Max(0, j-2) * dv; @@ -678,7 +680,7 @@ void BndLib_AddSurface::AddGenSurf(const Adaptor3d_Surface& S, } else if(CMax - aPnts(i,j).Coord(k+1) < d) { - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; umin = UMin + Max(0, i-2) * du; umax = UMin + Min(Nu-1, i) * du; vmin = VMin + Max(0, j-2) * dv; @@ -725,7 +727,7 @@ public: math_Vector X(1,2); X(1) = UMin; X(2) = (VMin + VMax) / 2.; - Standard_Real F1, F2; + Standard_Real F1 = NAN, F2 = NAN; Value(X, F1); X(1) = UMax; Value(X, F2); @@ -741,7 +743,7 @@ public: } Standard_Boolean Value (const math_Vector& X, - Standard_Real& F) + Standard_Real& F) override { if (CheckInputData(X)) { @@ -750,7 +752,7 @@ public: } else { - Standard_Real UPen = 0., VPen = 0., u0, v0; + Standard_Real UPen = 0., VPen = 0., u0 = NAN, v0 = NAN; if(X(1) < myUMin) { UPen = myPenalty * (myUMin - X(1)); @@ -790,7 +792,7 @@ public: - Standard_Integer NbVariables() const + Standard_Integer NbVariables() const override { return 2; } @@ -893,7 +895,7 @@ Standard_Integer NbUSamples(const Adaptor3d_Surface& S, const Standard_Real Umin, const Standard_Real Umax) { - Standard_Integer N; + Standard_Integer N = 0; GeomAbs_SurfaceType Type = S.GetType(); switch (Type) { case GeomAbs_BezierSurface: @@ -912,7 +914,7 @@ Standard_Integer NbUSamples(const Adaptor3d_Surface& S, { const Handle(Geom_BSplineSurface)& BS = S.BSpline(); N = 2*(BS->UDegree() + 1)*(BS->NbUKnots() -1); - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; BS->Bounds(umin, umax, vmin, vmax); Standard_Real du = (Umax - Umin) / (umax - umin); if(du < .9) @@ -937,7 +939,7 @@ Standard_Integer NbVSamples(const Adaptor3d_Surface& S, const Standard_Real Vmin, const Standard_Real Vmax) { - Standard_Integer N; + Standard_Integer N = 0; GeomAbs_SurfaceType Type = S.GetType(); switch (Type) { case GeomAbs_BezierSurface: @@ -956,7 +958,7 @@ Standard_Integer NbVSamples(const Adaptor3d_Surface& S, { const Handle(Geom_BSplineSurface)& BS = S.BSpline(); N = 2*(BS->VDegree() + 1)*(BS->NbVKnots() - 1) ; - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; BS->Bounds(umin, umax, vmin, vmax); Standard_Real dv = (Vmax - Vmin) / (vmax - vmin); if(dv < .9) diff --git a/src/CDF/CDF_Application.cxx b/src/CDF/CDF_Application.cxx index 410f9bb92b..9b0b19c68a 100644 --- a/src/CDF/CDF_Application.cxx +++ b/src/CDF/CDF_Application.cxx @@ -38,10 +38,10 @@ IMPLEMENT_STANDARD_RTTIEXT(CDF_Application,CDM_Application) //function : //purpose : //======================================================================= -CDF_Application::CDF_Application():myRetrievableStatus(PCDM_RS_OK) +CDF_Application::CDF_Application():myDirectory(new CDF_Directory()), myMetaDataDriver(new CDF_FWOSDriver (MetaDataLookUpTable())), myRetrievableStatus(PCDM_RS_OK) { - myDirectory = new CDF_Directory(); - myMetaDataDriver = new CDF_FWOSDriver (MetaDataLookUpTable()); + + } //======================================================================= diff --git a/src/CDF/CDF_Store.cxx b/src/CDF/CDF_Store.cxx index 78260c2245..6896378d31 100644 --- a/src/CDF/CDF_Store.cxx +++ b/src/CDF/CDF_Store.cxx @@ -33,9 +33,9 @@ CDF_Store::CDF_Store() myStatus(PCDM_SS_No_Obj) { } -CDF_Store::CDF_Store(const Handle(CDM_Document)& aDocument):myHasSubComponents(Standard_False) { +CDF_Store::CDF_Store(const Handle(CDM_Document)& aDocument):myMainDocument(aDocument), myHasSubComponents(Standard_False) { + - myMainDocument = aDocument; Init(); } diff --git a/src/CDF/CDF_Store.hxx b/src/CDF/CDF_Store.hxx index 372de7a81c..550db5e94b 100644 --- a/src/CDF/CDF_Store.hxx +++ b/src/CDF/CDF_Store.hxx @@ -138,7 +138,7 @@ private: Handle(CDM_Document) myMainDocument; Handle(CDM_Document) myCurrentDocument; Standard_Boolean myHasSubComponents; - Standard_Boolean myIsMainDocument; + Standard_Boolean myIsMainDocument{}; TCollection_ExtendedString myPath; TCollection_ExtendedString myText; PCDM_StoreStatus myStatus; diff --git a/src/CDF/CDF_StoreList.cxx b/src/CDF/CDF_StoreList.cxx index b1d91602aa..cf4d1070b1 100644 --- a/src/CDF/CDF_StoreList.cxx +++ b/src/CDF/CDF_StoreList.cxx @@ -31,8 +31,8 @@ static void CAUGHT(const Standard_Failure& theException,TCollection_ExtendedStri status += theException.GetMessageString(); } -CDF_StoreList::CDF_StoreList(const Handle(CDM_Document)& aDocument) { - myMainDocument = aDocument; +CDF_StoreList::CDF_StoreList(const Handle(CDM_Document)& aDocument) : myMainDocument(aDocument) { + Add(aDocument); } diff --git a/src/CDM/CDM_Application.cxx b/src/CDM/CDM_Application.cxx index 1d842f5189..03db36bbe5 100644 --- a/src/CDM/CDM_Application.cxx +++ b/src/CDM/CDM_Application.cxx @@ -31,9 +31,9 @@ IMPLEMENT_STANDARD_RTTIEXT(CDM_Application,Standard_Transient) //function : Constructor //purpose : //======================================================================= -CDM_Application::CDM_Application() +CDM_Application::CDM_Application() : myMessenger(new Message_Messenger) { - myMessenger = new Message_Messenger; + } //======================================================================= //function : SetDocumentVersion diff --git a/src/CDM/CDM_Document.cxx b/src/CDM/CDM_Document.cxx index 9efef91453..ce406ebcb4 100644 --- a/src/CDM/CDM_Document.cxx +++ b/src/CDM/CDM_Document.cxx @@ -620,7 +620,7 @@ TCollection_ExtendedString CDM_Document::Folder() const { void CDM_Document::SetRequestedFolder(const TCollection_ExtendedString& aFolder) { - TCollection_ExtendedString f(aFolder); + const TCollection_ExtendedString& f(aFolder); if(f.Length() != 0) { myRequestedFolderIsDefined=Standard_True; myRequestedFolder=aFolder; @@ -975,8 +975,8 @@ void CDM_Document::RemoveFromReference(const Standard_Integer aReferenceIdentifi //purpose : //======================================================================= -TCollection_ExtendedString GetResource (const TCollection_ExtendedString aFormat, - const TCollection_ExtendedString anItem) +TCollection_ExtendedString GetResource (const TCollection_ExtendedString& aFormat, + const TCollection_ExtendedString& anItem) { TCollection_ExtendedString theResource; theResource+= aFormat; diff --git a/src/CDM/CDM_Reference.cxx b/src/CDM/CDM_Reference.cxx index 47e20540ad..29c07760d7 100644 --- a/src/CDM/CDM_Reference.cxx +++ b/src/CDM/CDM_Reference.cxx @@ -68,7 +68,7 @@ void CDM_Reference::Update(const Handle(CDM_MetaData)& aMetaData) { } Standard_Boolean CDM_Reference::IsUpToDate() const { - Standard_Integer theActualDocumentVersion; + Standard_Integer theActualDocumentVersion = 0; if(myToDocument.IsNull()) theActualDocumentVersion=myMetaData->DocumentVersion(myApplication); else @@ -78,7 +78,7 @@ Standard_Boolean CDM_Reference::IsUpToDate() const { } void CDM_Reference::SetIsUpToDate() { - Standard_Integer theActualDocumentVersion; + Standard_Integer theActualDocumentVersion = 0; if(myToDocument.IsNull()) theActualDocumentVersion=myMetaData->DocumentVersion(myApplication); else diff --git a/src/CPnts/CPnts_AbscissaPoint.hxx b/src/CPnts/CPnts_AbscissaPoint.hxx index bd6c7a6cdc..4443dda408 100644 --- a/src/CPnts/CPnts_AbscissaPoint.hxx +++ b/src/CPnts/CPnts_AbscissaPoint.hxx @@ -170,11 +170,11 @@ private: - Standard_Boolean myDone; - Standard_Real myL; - Standard_Real myParam; - Standard_Real myUMin; - Standard_Real myUMax; + Standard_Boolean myDone{}; + Standard_Real myL{}; + Standard_Real myParam{}; + Standard_Real myUMin{}; + Standard_Real myUMax{}; CPnts_MyRootFunction myF; diff --git a/src/CPnts/CPnts_UniformDeflection.cxx b/src/CPnts/CPnts_UniformDeflection.cxx index f7e1422935..7550cd9ab9 100644 --- a/src/CPnts/CPnts_UniformDeflection.cxx +++ b/src/CPnts/CPnts_UniformDeflection.cxx @@ -38,6 +38,8 @@ // each iteration calculates at maximum 3 points //------------------------------------------------------------------------- +#include + #include #include #include @@ -87,8 +89,8 @@ void CPnts_UniformDeflection::Perform() { gp_Pnt P, P1, P2; gp_Vec V1, V2, VV; - Standard_Real Un1; - Standard_Real NormD1, NormD2; + Standard_Real Un1 = NAN; + Standard_Real NormD1 = NAN, NormD2 = NAN; myIPoint = -1; myNbPoints = -1; diff --git a/src/CPnts/CPnts_UniformDeflection.hxx b/src/CPnts/CPnts_UniformDeflection.hxx index 03b290745a..11ae3ac326 100644 --- a/src/CPnts/CPnts_UniformDeflection.hxx +++ b/src/CPnts/CPnts_UniformDeflection.hxx @@ -139,21 +139,21 @@ private: Standard_EXPORT void Perform(); - Standard_Boolean myDone; - Standard_Boolean my3d; - Standard_Address myCurve; - Standard_Boolean myFinish; - Standard_Real myTolCur; - Standard_Boolean myControl; - Standard_Integer myIPoint; - Standard_Integer myNbPoints; - Standard_Real myParams[3]; + Standard_Boolean myDone{}; + Standard_Boolean my3d{}; + Standard_Address myCurve{}; + Standard_Boolean myFinish{}; + Standard_Real myTolCur{}; + Standard_Boolean myControl{}; + Standard_Integer myIPoint{}; + Standard_Integer myNbPoints{}; + Standard_Real myParams[3]{}; gp_Pnt myPoints[3]; - Standard_Real myDwmax; - Standard_Real myDeflection; - Standard_Real myFirstParam; - Standard_Real myLastParam; - Standard_Real myDu; + Standard_Real myDwmax{}; + Standard_Real myDeflection{}; + Standard_Real myFirstParam{}; + Standard_Real myLastParam{}; + Standard_Real myDu{}; }; diff --git a/src/CSLib/CSLib.cxx b/src/CSLib/CSLib.cxx index f526dd5498..d09c30846f 100644 --- a/src/CSLib/CSLib.cxx +++ b/src/CSLib/CSLib.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -177,7 +179,7 @@ void CSLib::Normal(const Standard_Integer MaxOrder, Standard_Integer i=0,Order=-1; Standard_Boolean Trouve=Standard_False; // theStatus = Singular; - Standard_Real Norme; + Standard_Real Norme = NAN; gp_Vec D; //Find k0 such that all derivatives N=dS/du ^ dS/dv are null //till order k0-1 @@ -236,11 +238,11 @@ void CSLib::Normal(const Standard_Integer MaxOrder, }//end while if(!definie) { //All lambda i exist - Standard_Integer SP; - Standard_Real inf,sup; + Standard_Integer SP = 0; + Standard_Real inf = NAN,sup = NAN; inf = 0.0 - M_PI; sup = 0.0 + M_PI; - Standard_Boolean FU,LU,FV,LV; + Standard_Boolean FU = 0,LU = 0,FV = 0,LV = 0; //Creation of the domain of definition depending on the position //of a single point (medium, border, corner). @@ -377,7 +379,7 @@ gp_Vec CSLib::DNNUV(const Standard_Integer Nu, const Standard_Integer Nv, const TColgp_Array2OfVec& DerSurf) { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; gp_Vec D(0,0,0),VG,VD,PV; for(i=0;i<=Nu;i++) for(j=0;j<=Nv;j++){ @@ -399,7 +401,7 @@ gp_Vec CSLib::DNNUV(const Standard_Integer Nu, const TColgp_Array2OfVec& DerSurf1, const TColgp_Array2OfVec& DerSurf2) { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; gp_Vec D(0,0,0),VG,VD,PV; for(i=0;i<=Nu;i++) for(j=0;j<=Nv;j++){ diff --git a/src/CSLib/CSLib_Class2d.cxx b/src/CSLib/CSLib_Class2d.cxx index 9bbe360eb8..8edcf5d8b6 100644 --- a/src/CSLib/CSLib_Class2d.cxx +++ b/src/CSLib/CSLib_Class2d.cxx @@ -16,6 +16,8 @@ //#define No_Standard_OutOfRange +#include + #include #include @@ -51,8 +53,8 @@ void CSLib_Class2d::Init(const TCol_Containers2d& TP2d, // else { - Standard_Integer i, iLower; - Standard_Real du, dv, aPrc; + Standard_Integer i = 0, iLower = 0; + Standard_Real du = NAN, dv = NAN, aPrc = NAN; // aPrc = 1.e-10; N = TP2d.Length(); @@ -126,7 +128,7 @@ Standard_Integer CSLib_Class2d::SiDans(const gp_Pnt2d& P) const return 0; } // - Standard_Real x,y, aTolu, aTolv; + Standard_Real x = NAN,y = NAN, aTolu = NAN, aTolv = NAN; // x = P.X(); y = P.Y(); aTolu=Tolu*(Umax-Umin); @@ -168,7 +170,7 @@ Standard_Integer CSLib_Class2d::SiDans_OnMode(const gp_Pnt2d& P, return 0; } // - Standard_Real x,y, aTolu, aTolv; + Standard_Real x = NAN,y = NAN, aTolu = NAN, aTolv = NAN; // x = P.X(); y = P.Y(); aTolu=Tol; @@ -200,8 +202,8 @@ Standard_Integer CSLib_Class2d::SiDans_OnMode(const gp_Pnt2d& P, Standard_Integer CSLib_Class2d::InternalSiDans(const Standard_Real Px, const Standard_Real Py) const { - Standard_Integer nbc, i, ip1, SH, NH; - Standard_Real x, y, nx, ny; + Standard_Integer nbc = 0, i = 0, ip1 = 0, SH = 0, NH = 0; + Standard_Real x = NAN, y = NAN, nx = NAN, ny = NAN; // nbc = 0; i = 0; @@ -240,9 +242,9 @@ Standard_Integer CSLib_Class2d::InternalSiDans(const Standard_Real Px, Standard_Integer CSLib_Class2d::InternalSiDansOuOn(const Standard_Real Px, const Standard_Real Py) const { - Standard_Integer nbc, i, ip1, SH, NH, iRet; - Standard_Real x, y, nx, ny, aX; - Standard_Real aYmin; + Standard_Integer nbc = 0, i = 0, ip1 = 0, SH = 0, NH = 0, iRet = 0; + Standard_Real x = NAN, y = NAN, nx = NAN, ny = NAN, aX = NAN; + Standard_Real aYmin = NAN; // nbc = 0; i = 0; diff --git a/src/CSLib/CSLib_Class2d.hxx b/src/CSLib/CSLib_Class2d.hxx index d5bc8187ed..722d77e3d6 100644 --- a/src/CSLib/CSLib_Class2d.hxx +++ b/src/CSLib/CSLib_Class2d.hxx @@ -98,13 +98,13 @@ private: const CSLib_Class2d& operator= (const CSLib_Class2d& Other) const; NCollection_Handle MyPnts2dX, MyPnts2dY; - Standard_Real Tolu; - Standard_Real Tolv; - Standard_Integer N; - Standard_Real Umin; - Standard_Real Vmin; - Standard_Real Umax; - Standard_Real Vmax; + Standard_Real Tolu{}; + Standard_Real Tolv{}; + Standard_Integer N{}; + Standard_Real Umin{}; + Standard_Real Vmin{}; + Standard_Real Umax{}; + Standard_Real Vmax{}; }; diff --git a/src/CSLib/CSLib_NormalPolyDef.cxx b/src/CSLib/CSLib_NormalPolyDef.cxx index 5104fbca9c..ebe5c83dc4 100644 --- a/src/CSLib/CSLib_NormalPolyDef.cxx +++ b/src/CSLib/CSLib_NormalPolyDef.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -22,9 +24,9 @@ CSLib_NormalPolyDef::CSLib_NormalPolyDef(const Standard_Integer k0, const TColStd_Array1OfReal& li) //============================================================================= - :myTABli(0,k0) + :myK0(k0), myTABli(0,k0) { - myK0=k0; + for(Standard_Integer i=0;i<=k0;i++) myTABli(i)=li(i); } @@ -35,7 +37,7 @@ Standard_Boolean CSLib_NormalPolyDef::Value(const Standard_Real X, //============================================================================= { F=0.0; - Standard_Real co,si; + Standard_Real co = NAN,si = NAN; co=cos(X); si=sin(X); @@ -56,7 +58,7 @@ Standard_Boolean CSLib_NormalPolyDef::Derivative(const Standard_Real X, //============================================================================= { D=0.0; - Standard_Real co,si; + Standard_Real co = NAN,si = NAN; co=cos(X); si=sin(X); if(Abs(co) <= RealSmall() || Abs(si) <= RealSmall()) @@ -78,7 +80,7 @@ Standard_Boolean CSLib_NormalPolyDef::Values(const Standard_Real X, { F=0; D=0; - Standard_Real co,si; + Standard_Real co = NAN,si = NAN; co=cos(X); si=sin(X); if(Abs(co) <= RealSmall() || Abs(si) <= RealSmall()) diff --git a/src/Contap/Contap_ArcFunction.cxx b/src/Contap/Contap_ArcFunction.cxx index 254467a8ac..9990b12da5 100644 --- a/src/Contap/Contap_ArcFunction.cxx +++ b/src/Contap/Contap_ArcFunction.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -34,9 +36,9 @@ myCosAng(0.0) void Contap_ArcFunction::Set(const Handle(Adaptor3d_Surface)& S) { mySurf = S; - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer nbs = Contap_HContTool::NbSamplePoints(S); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; // gp_Vec d1u,d1v; gp_Vec norm; if (nbs > 0) { diff --git a/src/Contap/Contap_ContAna.cxx b/src/Contap/Contap_ContAna.cxx index 9e684fbded..e88d5a96c6 100644 --- a/src/Contap/Contap_ContAna.cxx +++ b/src/Contap/Contap_ContAna.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -163,7 +165,7 @@ void Contap_ContAna::Perform (const gp_Cylinder& C, // and sinus to the solutions are obtained. prm = Sqrt(norm1 - Coefcst*Coefcst); - Standard_Real cost0,sint0,cost1,sint1; + Standard_Real cost0 = NAN,sint0 = NAN,cost1 = NAN,sint1 = NAN; cost0 = (Coefcos*Coefcst - Coefsin*prm)/norm1; cost1 = (Coefcos*Coefcst + Coefsin*prm)/norm1; @@ -252,7 +254,7 @@ void Contap_ContAna::Perform (const gp_Cone& C, // and sinus to the solutions are obtained. prm = Sqrt(norm1 - Coefcst*Coefcst); - Standard_Real cost0,sint0,cost1,sint1; + Standard_Real cost0 = NAN,sint0 = NAN,cost1 = NAN,sint1 = NAN; cost0 = (Coefcos*Coefcst - Coefsin*prm)/norm1; cost1 = (Coefcos*Coefcst + Coefsin*prm)/norm1; @@ -314,7 +316,7 @@ void Contap_ContAna::Perform (const gp_Cone& C, // and sinus to the solutions are obtained. prm = Sqrt(norm1 - Coefcst*Coefcst); - Standard_Real cost0,sint0,cost1,sint1; + Standard_Real cost0 = NAN,sint0 = NAN,cost1 = NAN,sint1 = NAN; cost0 = (Coefcos*Coefcst - Coefsin*prm)/norm1; cost1 = (Coefcos*Coefcst + Coefsin*prm)/norm1; @@ -346,7 +348,7 @@ void Contap_ContAna::Perform (const gp_Cone& C, pt4 = pt3; prm = Sqrt(norm1 - Coefcst*Coefcst); - Standard_Real cost0,sint0,cost1,sint1; + Standard_Real cost0 = NAN,sint0 = NAN,cost1 = NAN,sint1 = NAN; cost0 = (Coefcos*Coefcst - Coefsin*prm)/norm1; cost1 = (Coefcos*Coefcst + Coefsin*prm)/norm1; @@ -416,7 +418,7 @@ void Contap_ContAna::Perform (const gp_Cone& C, // and sinus to the solutions are obtained. prm = Sqrt(norm1 - Coefcst*Coefcst); - Standard_Real cost0,sint0,cost1,sint1; + Standard_Real cost0 = NAN,sint0 = NAN,cost1 = NAN,sint1 = NAN; cost0 = (Coefcos*Coefcst - Coefsin*prm)/norm1; cost1 = (Coefcos*Coefcst + Coefsin*prm)/norm1; diff --git a/src/Contap/Contap_Contour.cxx b/src/Contap/Contap_Contour.cxx index 90a00e7779..428c52bf5d 100644 --- a/src/Contap/Contap_Contour.cxx +++ b/src/Contap/Contap_Contour.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -236,10 +238,10 @@ static void ProcessSegments (const Contap_TheSearch&, static void Recadre(const Handle(Adaptor3d_Surface)& myHS1, Standard_Real& u1, Standard_Real& v1) { - Standard_Real f,l,lmf; + Standard_Real f = NAN,l = NAN,lmf = NAN; GeomAbs_SurfaceType typs1 = myHS1->GetType(); - Standard_Boolean myHS1IsUPeriodic,myHS1IsVPeriodic; + Standard_Boolean myHS1IsUPeriodic = 0,myHS1IsVPeriodic = 0; switch (typs1) { case GeomAbs_Cylinder: case GeomAbs_Cone: @@ -288,7 +290,7 @@ static void LineConstructor(Contap_TheSequenceOfLine& slin, Contap_IType typl = L.TypeContour(); //-- std::cout<<"\n ----------- Ligne Constructor "< "< "< "< + #include #include #include @@ -29,7 +31,7 @@ Standard_Integer Contap_HContTool::NbSamplesV const Standard_Real , const Standard_Real ) { - Standard_Integer nbs; + Standard_Integer nbs = 0; GeomAbs_SurfaceType typS = S->GetType(); switch(typS) { case GeomAbs_Plane: @@ -76,7 +78,7 @@ Standard_Integer Contap_HContTool::NbSamplesU const Standard_Real , const Standard_Real ) { - Standard_Integer nbs; + Standard_Integer nbs = 0; GeomAbs_SurfaceType typS = S->GetType(); switch(typS) { case GeomAbs_Plane: @@ -266,7 +268,7 @@ Standard_Boolean Contap_HContTool::Project (const Handle(Adaptor2d_Curve2d)& C, Standard_Real epsX = 1.e-8; Standard_Integer Nbu = 20; Standard_Real Tol = 1.e-5; - Standard_Real Dist2; + Standard_Real Dist2 = NAN; Extrema_EPCOfExtPC2d extrema (P, *C, Nbu, epsX, Tol); if (!extrema.IsDone()) { diff --git a/src/Contap/Contap_Line.cxx b/src/Contap/Contap_Line.cxx index f8130a6f68..a2efd9f606 100644 --- a/src/Contap/Contap_Line.cxx +++ b/src/Contap/Contap_Line.cxx @@ -23,9 +23,9 @@ #include #include -Contap_Line::Contap_Line () { - svtx = new Contap_TheHSequenceOfPoint (); - Trans = IntSurf_Undecided; +Contap_Line::Contap_Line () : svtx(new Contap_TheHSequenceOfPoint ()), Trans(IntSurf_Undecided) { + + } void Contap_Line::ResetSeqOfVertex() { diff --git a/src/Contap/Contap_Line.hxx b/src/Contap/Contap_Line.hxx index 4c5aeb63af..c435d8835f 100644 --- a/src/Contap/Contap_Line.hxx +++ b/src/Contap/Contap_Line.hxx @@ -107,7 +107,7 @@ private: gp_Pnt pt; gp_Dir dir1; gp_Dir dir2; - Standard_Real rad; + Standard_Real rad{}; }; diff --git a/src/Contap/Contap_SurfFunction.cxx b/src/Contap/Contap_SurfFunction.cxx index 4d2fadd9af..b37940c254 100644 --- a/src/Contap/Contap_SurfFunction.cxx +++ b/src/Contap/Contap_SurfFunction.cxx @@ -16,6 +16,8 @@ // jag 940616 Tolpetit = 1.e-16 +#include + #include #include #include @@ -47,9 +49,9 @@ Contap_SurfFunction::Contap_SurfFunction (): void Contap_SurfFunction::Set(const Handle(Adaptor3d_Surface)& S) { mySurf = S; - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer nbs = Contap_HContTool::NbSamplePoints(S); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; gp_Vec norm; if (nbs > 0) { myMean = 0.; diff --git a/src/Convert/Convert_CircleToBSplineCurve.cxx b/src/Convert/Convert_CircleToBSplineCurve.cxx index 1890f698bd..190bbaad7d 100644 --- a/src/Convert/Convert_CircleToBSplineCurve.cxx +++ b/src/Convert/Convert_CircleToBSplineCurve.cxx @@ -14,6 +14,8 @@ //JCV 16/10/91 +#include + #include #include #include @@ -49,10 +51,10 @@ Convert_CircleToBSplineCurve::Convert_CircleToBSplineCurve (const gp_Circ2d& C, const Convert_ParameterisationType Parameterisation) :Convert_ConicToBSplineCurve(0,0,0){ - Standard_Integer ii ; + Standard_Integer ii = 0 ; - Standard_Real R, - value ; + Standard_Real R = NAN, + value = NAN ; Handle(TColStd_HArray1OfReal) CosNumeratorPtr, SinNumeratorPtr ; @@ -133,8 +135,8 @@ Convert_CircleToBSplineCurve::Convert_CircleToBSplineCurve throw Standard_DomainError( "Convert_CircleToBSplineCurve"); } - Standard_Integer ii; - Standard_Real R, value ; + Standard_Integer ii = 0; + Standard_Real R = NAN, value = NAN ; Handle(TColStd_HArray1OfReal) CosNumeratorPtr,SinNumeratorPtr ; diff --git a/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx b/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx index 9582478e01..72b1b02cdc 100644 --- a/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx +++ b/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx @@ -93,7 +93,7 @@ const { void Convert_CompBezierCurves2dToBSplineCurve2d::Poles (TColgp_Array1OfPnt2d& Poles) const { - Standard_Integer i, Lower = Poles.Lower(), Upper = Poles.Upper(); + Standard_Integer i = 0, Lower = Poles.Lower(), Upper = Poles.Upper(); Standard_Integer k = 1; for (i = Lower; i <= Upper; i++) { Poles(i) = CurvePoles(k++); @@ -121,7 +121,7 @@ void Convert_CompBezierCurves2dToBSplineCurve2d::KnotsAndMults (TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults ) const { - Standard_Integer i, LowerK = Knots.Lower(), UpperK = Knots.Upper(); + Standard_Integer i = 0, LowerK = Knots.Lower(), UpperK = Knots.Upper(); Standard_Integer LowerM = Mults.Lower(), UpperM = Mults.Upper(); Standard_Integer k = 1; for (i = LowerK; i <= UpperK; i++) { @@ -154,7 +154,7 @@ void Convert_CompBezierCurves2dToBSplineCurve2d::Perform() // Standard_Integer NbKnotsSpl = NbrCurv + 1 ; TColStd_Array1OfReal CurveKnVals (1,NbrCurv); - Standard_Integer i; + Standard_Integer i = 0; myDegree = 0; for ( i = 1; i <= mySequence.Length(); i++) { myDegree = Max( myDegree, (mySequence(i))->Length() -1); @@ -162,7 +162,7 @@ void Convert_CompBezierCurves2dToBSplineCurve2d::Perform() Standard_Real Det=0; gp_Pnt2d P1, P2, P3; - Standard_Integer Deg, Inc, MaxDegree = myDegree; + Standard_Integer Deg = 0, Inc = 0, MaxDegree = myDegree; TColgp_Array1OfPnt2d Points(1, myDegree+1); for (i = LowerI ; i <= UpperI ; i++) { diff --git a/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.hxx b/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.hxx index 7201ac59ad..8fc8a0d20e 100644 --- a/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.hxx +++ b/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.hxx @@ -184,7 +184,7 @@ private: TColgp_SequenceOfPnt2d CurvePoles; TColStd_SequenceOfReal CurveKnots; TColStd_SequenceOfInteger KnotsMultiplicities; - Standard_Integer myDegree; + Standard_Integer myDegree{}; Standard_Real myAngular; Standard_Boolean myDone; diff --git a/src/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx b/src/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx index 8e90f10df9..e03e5ec3c6 100644 --- a/src/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx +++ b/src/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx @@ -92,7 +92,7 @@ Standard_Integer Convert_CompBezierCurvesToBSplineCurve::NbPoles() const void Convert_CompBezierCurvesToBSplineCurve::Poles (TColgp_Array1OfPnt& Poles) const { - Standard_Integer i, Lower = Poles.Lower(), Upper = Poles.Upper(); + Standard_Integer i = 0, Lower = Poles.Lower(), Upper = Poles.Upper(); Standard_Integer k = 1; for (i = Lower; i <= Upper; i++) { Poles(i) = CurvePoles(k++); @@ -120,7 +120,7 @@ void Convert_CompBezierCurvesToBSplineCurve::KnotsAndMults (TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults ) const { - Standard_Integer i, LowerK = Knots.Lower(), UpperK = Knots.Upper(); + Standard_Integer i = 0, LowerK = Knots.Lower(), UpperK = Knots.Upper(); Standard_Integer LowerM = Mults.Lower(), UpperM = Mults.Upper(); Standard_Integer k = 1; for (i = LowerK; i <= UpperK; i++) { @@ -151,7 +151,7 @@ void Convert_CompBezierCurvesToBSplineCurve::Perform() // Standard_Integer NbKnotsSpl = NbrCurv + 1 ; TColStd_Array1OfReal CurveKnVals (1,NbrCurv); - Standard_Integer i; + Standard_Integer i = 0; myDegree = 0; for ( i = 1; i <= mySequence.Length(); i++) { myDegree = Max( myDegree, (mySequence(i))->Length() -1); @@ -159,7 +159,7 @@ void Convert_CompBezierCurvesToBSplineCurve::Perform() Standard_Real Det=0; gp_Pnt P1, P2, P3; - Standard_Integer Deg, Inc, MaxDegree = myDegree; + Standard_Integer Deg = 0, Inc = 0, MaxDegree = myDegree; TColgp_Array1OfPnt Points(1, myDegree+1); for (i = LowerI ; i <= UpperI ; i++) { diff --git a/src/Convert/Convert_CompBezierCurvesToBSplineCurve.hxx b/src/Convert/Convert_CompBezierCurvesToBSplineCurve.hxx index adeb2ee599..2553ac5a6c 100644 --- a/src/Convert/Convert_CompBezierCurvesToBSplineCurve.hxx +++ b/src/Convert/Convert_CompBezierCurvesToBSplineCurve.hxx @@ -190,7 +190,7 @@ private: TColgp_SequenceOfPnt CurvePoles; TColStd_SequenceOfReal CurveKnots; TColStd_SequenceOfInteger KnotsMultiplicities; - Standard_Integer myDegree; + Standard_Integer myDegree{}; Standard_Real myAngular; Standard_Boolean myDone; diff --git a/src/Convert/Convert_CompPolynomialToPoles.cxx b/src/Convert/Convert_CompPolynomialToPoles.cxx index 8d0043c453..21daece8dc 100644 --- a/src/Convert/Convert_CompPolynomialToPoles.cxx +++ b/src/Convert/Convert_CompPolynomialToPoles.cxx @@ -25,6 +25,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -49,7 +51,7 @@ Convert_CompPolynomialToPoles::Convert_CompPolynomialToPoles( const Handle(TColStd_HArray1OfReal)& TrueIntervals) : myDone(Standard_False) { - Standard_Integer ii, delta; + Standard_Integer ii = 0, delta = 0; if (NumCurves <= 0 || NumCoeffPerCurve.IsNull() || Coefficients.IsNull() || @@ -77,7 +79,7 @@ Convert_CompPolynomialToPoles::Convert_CompPolynomialToPoles( // // prepare output // - Standard_Integer Tindex, multiplicities ; + Standard_Integer Tindex = 0, multiplicities = 0 ; myKnots = new TColStd_HArray1OfReal(1, NumCurves + 1) ; @@ -111,7 +113,7 @@ Convert_CompPolynomialToPoles(const Standard_Integer NumCurves, const TColStd_Array1OfReal& TrueIntervals) : myDone(Standard_False) { - Standard_Integer ii, delta; + Standard_Integer ii = 0, delta = 0; if (NumCurves <= 0 || MaxDegree <= 0 || Dimension <= 0 || @@ -130,7 +132,7 @@ Convert_CompPolynomialToPoles(const Standard_Integer NumCurves, // // prepare output // - Standard_Integer Tindex ; + Standard_Integer Tindex = 0 ; myKnots = new TColStd_HArray1OfReal(1, NumCurves + 1) ; @@ -209,16 +211,16 @@ Perform(const Standard_Integer NumCurves, const TColStd_Array2OfReal& PolynomialIntervals, const TColStd_Array1OfReal& TrueIntervals) { - Standard_Integer ii, - num_flat_knots, - index, Tindex, Pindex, - coeff_index, - inversion_problem, - poles_index, - num_poles ; - Standard_Real normalized_value, - *coefficient_array, - *poles_array ; + Standard_Integer ii = 0, + num_flat_knots = 0, + index = 0, Tindex = 0, Pindex = 0, + coeff_index = 0, + inversion_problem = 0, + poles_index = 0, + num_poles = 0 ; + Standard_Real normalized_value = NAN, + *coefficient_array = nullptr, + *poles_array = nullptr ; num_flat_knots = 2 * myDegree + 2 ; for (ii=2; iiLength(); ii++) { diff --git a/src/Convert/Convert_ConeToBSplineSurface.cxx b/src/Convert/Convert_ConeToBSplineSurface.cxx index 5fdf443281..eabc65b5d8 100644 --- a/src/Convert/Convert_ConeToBSplineSurface.cxx +++ b/src/Convert/Convert_ConeToBSplineSurface.cxx @@ -14,6 +14,8 @@ //JCV 16/10/91 +#include + #include #include #include @@ -38,7 +40,7 @@ static void ComputePoles( const Standard_Real R, { Standard_Real deltaU = U2 - U1; - Standard_Integer i; + Standard_Integer i = 0; // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer @@ -99,7 +101,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface isuperiodic = Standard_False; isvperiodic = Standard_False; - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; // construction of cone in the reference mark xOy. // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) @@ -128,7 +130,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface // Replace the bspline in the mark of the sphere. // and calculate the weight of the bspline. - Standard_Real W1; + Standard_Real W1 = NAN; gp_Trsf Trsf; Trsf.SetTransformation( C.Position(), gp::XOY()); @@ -160,7 +162,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface Standard_DomainError_Raise_if( Abs(V2-V1) <= Abs(Epsilon(V1)), "Convert_ConeToBSplineSurface"); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; isuperiodic = Standard_True; isvperiodic = Standard_False; @@ -186,7 +188,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface // replace bspline in the mark of the cone. // and calculate the weight of bspline. - Standard_Real W; + Standard_Real W = NAN; gp_Trsf Trsf; Trsf.SetTransformation( C.Position(), gp::XOY()); diff --git a/src/Convert/Convert_ConicToBSplineCurve.cxx b/src/Convert/Convert_ConicToBSplineCurve.cxx index 01640adbcf..05421c84a0 100644 --- a/src/Convert/Convert_ConicToBSplineCurve.cxx +++ b/src/Convert/Convert_ConicToBSplineCurve.cxx @@ -17,6 +17,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -217,8 +219,8 @@ void CosAndSinQuasiAngular(Standard_Real Parameter, Standard_Real Result[2]) { Standard_Real - param, - *coeff ; + param = NAN, + *coeff = nullptr ; coeff = (Standard_Real *) &EvalPoles(EvalPoles.Lower()) ; // @@ -252,13 +254,13 @@ void AlgorithmicCosAndSin(Standard_Integer Degree, TColStd_Array1OfReal& SinNumerator, TColStd_Array1OfReal& Denominator) { - Standard_Integer order, - num_poles, - pivot_index_problem, - ii; + Standard_Integer order = 0, + num_poles = 0, + pivot_index_problem = 0, + ii = 0; Standard_Real result[2], - inverse ; + inverse = NAN ; order = Degree + 1 ; num_poles = FlatKnots.Length() - order ; @@ -321,31 +323,31 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( Handle(TColStd_HArray1OfInteger)& MultsPtr) const { Standard_Real delta = ULast - UFirst, - direct, - inverse, - value1, - value2, - cos_beta, - sin_beta, + direct = NAN, + inverse = NAN, + value1 = NAN, + value2 = NAN, + cos_beta = NAN, + sin_beta = NAN, alpha=0, - alpha_2, - alpha_4, - tan_alpha_2, - beta, - p_param, - q_param, - param ; + alpha_2 = NAN, + alpha_4 = NAN, + tan_alpha_2 = NAN, + beta = NAN, + p_param = NAN, + q_param = NAN, + param = NAN ; Standard_Integer num_poles = 0, - ii, - jj, + ii = 0, + jj = 0, num_knots = 1, num_spans = 1, - num_flat_knots, - num_temp_knots, + num_flat_knots = 0, + num_temp_knots = 0, temp_degree = 0, - tgt_theta_flag, - num_temp_poles, + tgt_theta_flag = 0, + num_temp_poles = 0, order = 0; Convert_CosAndSinEvalFunction *EvaluatorPtr=NULL ; @@ -610,27 +612,27 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( Handle(TColStd_HArray1OfReal)& KnotsPtr, Handle(TColStd_HArray1OfInteger)& MultsPtr) const { - Standard_Real half_pi, - param, - first_param, - last_param, + Standard_Real half_pi = NAN, + param = NAN, + first_param = NAN, + last_param = NAN, // direct, - inverse, - value1, - value2, - value3 ; + inverse = NAN, + value1 = NAN, + value2 = NAN, + value3 = NAN ; Standard_Integer - ii, - jj, - index, - num_poles, - num_periodic_poles, - temp_degree, - pivot_index_problem, - num_flat_knots, - num_knots, - order ; + ii = 0, + jj = 0, + index = 0, + num_poles = 0, + num_periodic_poles = 0, + temp_degree = 0, + pivot_index_problem = 0, + num_flat_knots = 0, + num_knots = 0, + order = 0 ; if (Parameterisation != Convert_TgtThetaOver2 && Parameterisation != Convert_RationalC1) { diff --git a/src/Convert/Convert_ConicToBSplineCurve.hxx b/src/Convert/Convert_ConicToBSplineCurve.hxx index 88c219be62..319a37c5d9 100644 --- a/src/Convert/Convert_ConicToBSplineCurve.hxx +++ b/src/Convert/Convert_ConicToBSplineCurve.hxx @@ -123,7 +123,7 @@ protected: Standard_Integer degree; Standard_Integer nbPoles; Standard_Integer nbKnots; - Standard_Boolean isperiodic; + Standard_Boolean isperiodic{}; private: diff --git a/src/Convert/Convert_CylinderToBSplineSurface.cxx b/src/Convert/Convert_CylinderToBSplineSurface.cxx index cc71f19ac1..f9de99642a 100644 --- a/src/Convert/Convert_CylinderToBSplineSurface.cxx +++ b/src/Convert/Convert_CylinderToBSplineSurface.cxx @@ -14,6 +14,8 @@ //JCV 16/10/91 +#include + #include #include #include @@ -37,7 +39,7 @@ static void ComputePoles( const Standard_Real R, { Standard_Real deltaU = U2 - U1; - Standard_Integer i; + Standard_Integer i = 0; // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer @@ -90,7 +92,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface isuperiodic = Standard_False; isvperiodic = Standard_False; - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; // construction of the cylinder in the reference mark xOy. // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) @@ -118,7 +120,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface // Replace bspline in the mark of the sphere. // and calculate the weight of the bspline. - Standard_Real W1; + Standard_Real W1 = NAN; gp_Trsf Trsf; Trsf.SetTransformation( Cyl.Position(), gp::XOY()); @@ -150,7 +152,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface Standard_DomainError_Raise_if( Abs(V2-V1) <= Abs(Epsilon(V1)), "Convert_CylinderToBSplineSurface"); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; isuperiodic = Standard_True; isvperiodic = Standard_False; @@ -175,7 +177,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface // Replace the bspline inn the mark of the cone. // and calculate the weight of the bspline. - Standard_Real W; + Standard_Real W = NAN; gp_Trsf Trsf; Trsf.SetTransformation( Cyl.Position(), gp::XOY()); diff --git a/src/Convert/Convert_ElementarySurfaceToBSplineSurface.hxx b/src/Convert/Convert_ElementarySurfaceToBSplineSurface.hxx index 22b126bd97..ad8ddd279f 100644 --- a/src/Convert/Convert_ElementarySurfaceToBSplineSurface.hxx +++ b/src/Convert/Convert_ElementarySurfaceToBSplineSurface.hxx @@ -148,8 +148,8 @@ protected: Standard_Integer nbVPoles; Standard_Integer nbUKnots; Standard_Integer nbVKnots; - Standard_Boolean isuperiodic; - Standard_Boolean isvperiodic; + Standard_Boolean isuperiodic{}; + Standard_Boolean isvperiodic{}; private: diff --git a/src/Convert/Convert_EllipseToBSplineCurve.cxx b/src/Convert/Convert_EllipseToBSplineCurve.cxx index c4e239e632..63fc156654 100644 --- a/src/Convert/Convert_EllipseToBSplineCurve.cxx +++ b/src/Convert/Convert_EllipseToBSplineCurve.cxx @@ -14,6 +14,8 @@ //JCV 16/10/91 +#include + #include #include #include @@ -49,11 +51,11 @@ Convert_EllipseToBSplineCurve::Convert_EllipseToBSplineCurve (const gp_Elips2d& E, const Convert_ParameterisationType Parameterisation) :Convert_ConicToBSplineCurve(0,0,0){ - Standard_Integer ii ; + Standard_Integer ii = 0 ; - Standard_Real R, - r, - value ; + Standard_Real R = NAN, + r = NAN, + value = NAN ; Handle(TColStd_HArray1OfReal) CosNumeratorPtr, SinNumeratorPtr ; @@ -135,8 +137,8 @@ Convert_EllipseToBSplineCurve::Convert_EllipseToBSplineCurve #endif Standard_DomainError_Raise_if( (delta > (2*M_PI+Tol)) || (delta <= 0.0e0), "Convert_EllipseToBSplineCurve"); - Standard_Integer ii; - Standard_Real R, r, value; + Standard_Integer ii = 0; + Standard_Real R = NAN, r = NAN, value = NAN; Handle(TColStd_HArray1OfReal) CosNumeratorPtr, SinNumeratorPtr; R = E.MajorRadius(); diff --git a/src/Convert/Convert_GridPolynomialToPoles.cxx b/src/Convert/Convert_GridPolynomialToPoles.cxx index d95cda3d73..43877a9408 100644 --- a/src/Convert/Convert_GridPolynomialToPoles.cxx +++ b/src/Convert/Convert_GridPolynomialToPoles.cxx @@ -19,6 +19,8 @@ // Condition d'extraction corrigee // + positionnement par EvalPoly2Var +#include + #include #include #include @@ -86,13 +88,13 @@ Convert_GridPolynomialToPoles( const Handle(TColStd_HArray1OfReal)& PolynomialVIntervals, const Handle(TColStd_HArray1OfReal)& TrueUIntervals, const Handle(TColStd_HArray1OfReal)& TrueVIntervals) : - myDone(Standard_False) + myUDegree(0), myVDegree(0), myDone(Standard_False) { - Standard_Integer ii; + Standard_Integer ii = 0; Standard_Integer RealUDegree = Max(MaxUDegree, 2*UContinuity + 1); Standard_Integer RealVDegree = Max(MaxVDegree, 2*VContinuity + 1); - myUDegree = 0; - myVDegree = 0; + + // Les controles if((NumCoeffPerSurface->LowerRow()!=1) || @@ -167,9 +169,9 @@ void Convert_GridPolynomialToPoles::Perform(const Standard_Integer UContinuity, // (2) Digitalisation ------------------------------------------------------- - Standard_Integer ii, jj, Uindex=0, Vindex=0; + Standard_Integer ii = 0, jj = 0, Uindex=0, Vindex=0; Standard_Integer Patch_Indice=0; - Standard_Real NValue, UValue, VValue; + Standard_Real NValue = NAN, UValue = NAN, VValue = NAN; Standard_Integer dimension = 3*( myVDegree+1); Standard_Integer SizPatch = 3 * (MaxUDegree+1) * (MaxVDegree+1); myPoles = new (TColgp_HArray2OfPnt) (1, UParameters->Length(), @@ -202,7 +204,7 @@ void Convert_GridPolynomialToPoles::Perform(const Standard_Integer UContinuity, // (2.1) Extraction du bon Patch if (Patch_Indice != Uindex + (myUKnots->Length()-1)*(Vindex-1)) { - Standard_Integer k1, k2, pos, ll=1; + Standard_Integer k1 = 0, k2 = 0, pos = 0, ll=1; Patch_Indice = Uindex + (myUKnots->Length()-1)*(Vindex-1); for (k1 = 1; k1 <= NumCoeffPerSurface->Value(Patch_Indice, 1); k1++) { pos = SizPatch*(Patch_Indice-1)+3*(MaxVDegree+1)*(k1-1)+1; @@ -232,7 +234,7 @@ void Convert_GridPolynomialToPoles::Perform(const Standard_Integer UContinuity, // (3)Interpolation -------------------------------------------------------------- - Standard_Integer InversionProblem; + Standard_Integer InversionProblem = 0; BSplSLib::Interpolate(myUDegree, myVDegree, myUFlatKnots->Array1(), myVFlatKnots->Array1(), @@ -254,7 +256,7 @@ void Convert_GridPolynomialToPoles::BuildArray(const Standard_Integer Degree, Standard_Integer NumCurves = Knots->Length()-1; // Calcul des Multiplicites - Standard_Integer ii; + Standard_Integer ii = 0; Standard_Integer multiplicities = Degree - Continuity; Mults = new (TColStd_HArray1OfInteger)(1, Knots->Length()); diff --git a/src/Convert/Convert_PolynomialCosAndSin.cxx b/src/Convert/Convert_PolynomialCosAndSin.cxx index a5ea810290..d0204afbab 100644 --- a/src/Convert/Convert_PolynomialCosAndSin.cxx +++ b/src/Convert/Convert_PolynomialCosAndSin.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -64,18 +66,18 @@ void BuildPolynomialCosAndSin Handle(TColStd_HArray1OfReal)& DenominatorPtr) { - Standard_Real Delta, - locUFirst, + Standard_Real Delta = NAN, + locUFirst = NAN, // locULast, // temp_value, - t_min, - t_max, - trim_min, - trim_max, - middle, - Angle, + t_min = NAN, + t_max = NAN, + trim_min = NAN, + trim_max = NAN, + middle = NAN, + Angle = NAN, PI2 = 2*M_PI ; - Standard_Integer ii, degree = num_poles -1 ; + Standard_Integer ii = 0, degree = num_poles -1 ; locUFirst = UFirst ; // Return UFirst in [-2PI; 2PI] diff --git a/src/Convert/Convert_SphereToBSplineSurface.cxx b/src/Convert/Convert_SphereToBSplineSurface.cxx index 8373d93922..a30389c427 100644 --- a/src/Convert/Convert_SphereToBSplineSurface.cxx +++ b/src/Convert/Convert_SphereToBSplineSurface.cxx @@ -14,6 +14,8 @@ //JCV 16/10/91 +#include + #include #include #include @@ -38,7 +40,7 @@ static void ComputePoles ( const Standard_Real R, Standard_Real deltaU = U2 - U1; Standard_Real deltaV = V2 - V1; - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer @@ -107,7 +109,7 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface isuperiodic = Standard_False; isvperiodic = Standard_False; - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; // construction of the sphere in the reference mark xOy. // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) @@ -141,7 +143,7 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface // Replace the bspline in the reference of the sphere. // and calculate the weight of the bspline. - Standard_Real W1, W2; + Standard_Real W1 = NAN, W2 = NAN; gp_Trsf Trsf; Trsf.SetTransformation( Sph.Position(), gp::XOY()); @@ -180,15 +182,15 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface Standard_DomainError_Raise_if( (delta>2*M_PI) || (delta<0.), "Convert_SphereToBSplineSurface"); - Standard_Integer i, j; - Standard_Real deltaU, deltaV; + Standard_Integer i = 0, j = 0; + Standard_Real deltaU = NAN, deltaV = NAN; isuperiodic = !UTrim; isvperiodic = Standard_False; Standard_Real R = Sph.Radius(); - Standard_Real W1, W2, CosU, CosV; + Standard_Real W1 = NAN, W2 = NAN, CosU = NAN, CosV = NAN; if ( isuperiodic) { ComputePoles(R, 0., 2.*M_PI, Param1, Param2, poles); @@ -276,8 +278,8 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface isuperiodic = Standard_True; isvperiodic = Standard_False; - Standard_Real W1, W2; - Standard_Integer i, j; + Standard_Real W1 = NAN, W2 = NAN; + Standard_Integer i = 0, j = 0; nbUPoles = 6; nbVPoles = 5; diff --git a/src/Convert/Convert_TorusToBSplineSurface.cxx b/src/Convert/Convert_TorusToBSplineSurface.cxx index dd3487238e..b975a71c2e 100644 --- a/src/Convert/Convert_TorusToBSplineSurface.cxx +++ b/src/Convert/Convert_TorusToBSplineSurface.cxx @@ -14,6 +14,8 @@ //JCV 16/10/91 +#include + #include #include #include @@ -39,7 +41,7 @@ static void ComputePoles ( const Standard_Real R, Standard_Real deltaU = U2 - U1; Standard_Real deltaV = V2 - V1; - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer @@ -109,7 +111,7 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface isuperiodic = Standard_False; isvperiodic = Standard_False; - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; // construction of the torus in the reference mark xOy. // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) @@ -144,7 +146,7 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface // Replace the bspline in the reference of the torus. // and calculate the weight of the bspline. - Standard_Real W1, W2; + Standard_Real W1 = NAN, W2 = NAN; gp_Trsf Trsf; Trsf.SetTransformation( T.Position(), gp::XOY()); @@ -183,8 +185,8 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface Standard_DomainError_Raise_if( (delta>2*M_PI) || (delta<0.), "Convert_TorusToBSplineSurface"); - Standard_Integer i, j; - Standard_Real deltaU, deltaV; + Standard_Integer i = 0, j = 0; + Standard_Real deltaU = NAN, deltaV = NAN; isuperiodic = !UTrim; isvperiodic = UTrim; @@ -192,7 +194,7 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface Standard_Real R = T.MajorRadius(); Standard_Real r = T.MinorRadius(); - Standard_Real W1, W2, CosU, CosV; + Standard_Real W1 = NAN, W2 = NAN, CosU = NAN, CosV = NAN; if ( isuperiodic) { ComputePoles(R, r, 0, 2.*M_PI, Param1, Param2, poles); @@ -282,8 +284,8 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface isuperiodic = Standard_True; isvperiodic = Standard_True; - Standard_Real W1, W2; - Standard_Integer i, j; + Standard_Real W1 = NAN, W2 = NAN; + Standard_Integer i = 0, j = 0; nbUPoles = 6; nbVPoles = 6; diff --git a/src/DBRep/DBRep.cxx b/src/DBRep/DBRep.cxx index 9fc4e74a2d..04ce382bbf 100644 --- a/src/DBRep/DBRep.cxx +++ b/src/DBRep/DBRep.cxx @@ -42,6 +42,7 @@ #include #include +#include #include // memory management #ifdef _WIN32 @@ -668,7 +669,7 @@ static Standard_Integer nexplode(Draw_Interpretor& di, IMOStmp.Add(S); TopExp::MapShapes(S,typ,IMOStmp); TopExp_Explorer Exp(S,typ); - Standard_Integer MaxShapes, Index = 0; + Standard_Integer MaxShapes = 0, Index = 0; MaxShapes = IMOStmp.Extent()-1; TopTools_Array1OfShape aShapes(1,MaxShapes); @@ -684,7 +685,7 @@ static Standard_Integer nexplode(Draw_Interpretor& di, TColStd_Array1OfInteger OrderInd(1,MaxShapes); gp_Pnt GPoint; GProp_GProps GPr; - Standard_Integer aTemp; + Standard_Integer aTemp = 0; TColStd_Array1OfReal MidXYZ(1,MaxShapes); //X,Y,Z; Standard_Boolean NoSort = Standard_True; // @@ -851,7 +852,7 @@ static Standard_Integer numshapes(Draw_Interpretor& di, { if (n < 2) return 1; - Standard_Integer i; + Standard_Integer i = 0; TopExp_Explorer ex; for (i = 1; i < n; i++) { TopoDS_Shape S = DBRep::Get(a[i]); @@ -888,7 +889,7 @@ static void DumpExtent(const TopoDS_Shape& aS, " EDGE : ", " VERTEX : " }; - Standard_Integer i, aNb, aNbSh; + Standard_Integer i = 0, aNb = 0, aNbSh = 0; TopAbs_ShapeEnum aType; TopTools_IndexedMapOfShape aM; // @@ -914,8 +915,8 @@ static Standard_Integer nbshapes(Draw_Interpretor& di, { if (n < 2) return 1; - Standard_Integer i; - Standard_Boolean aTotal; + Standard_Integer i = 0; + Standard_Boolean aTotal = 0; TopExp_Explorer ex; // aTotal = !strcmp(a[n-1], "-t") ? Standard_True : Standard_False; @@ -948,7 +949,7 @@ static Standard_Integer countshapes(Draw_Interpretor& di, { if (n < 2) return 1; - Standard_Integer i; + Standard_Integer i = 0; TopExp_Explorer ex; for (i = 1; i < n; i++) { TopoDS_Shape Sh = DBRep::Get(a[i]); @@ -1050,7 +1051,7 @@ static Standard_Integer countshapes(Draw_Interpretor& di, //======================================================================= void setProp(TopoDS_Shape Sh, const char** a, Standard_Integer n) { - Standard_Integer i; + Standard_Integer i = 0; for(i = 2; i < n; i++) { if (strstr ( a[i], "free" )) { if(a[i][0] == '-') { @@ -1134,17 +1135,17 @@ static Standard_Integer setFlags(Draw_Interpretor& , setProp(Sh, a, n); for (ex.Init (Sh,TopAbs_VERTEX); ex.More(); ex.Next()) { - TopoDS_Shape S = ex.Current(); + const TopoDS_Shape& S = ex.Current(); setProp(S, a, n); } for (ex.Init (Sh,TopAbs_EDGE); ex.More(); ex.Next()) { - TopoDS_Shape S = ex.Current(); + const TopoDS_Shape& S = ex.Current(); setProp(S, a, n); } for (ex.Init (Sh,TopAbs_FACE); ex.More(); ex.Next()) { - TopoDS_Shape S = ex.Current(); + const TopoDS_Shape& S = ex.Current(); setProp(S, a, n); } @@ -1169,7 +1170,7 @@ static Standard_Integer check(Draw_Interpretor& , { if (n < 2) return 1; - Standard_Integer i; + Standard_Integer i = 0; TopExp_Explorer ex; for (i = 1; i < n; i++) { TopoDS_Shape S = DBRep::Get(a[i]); @@ -1364,7 +1365,7 @@ TopoDS_Shape DBRep::getShape (Standard_CString& theName, && toPick) { // try to find prom pick - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; DBRep_DrawableShape::LastPick (aShape, u, v); } if (theType != TopAbs_SHAPE diff --git a/src/DBRep/DBRep_DrawableShape.cxx b/src/DBRep/DBRep_DrawableShape.cxx index 95308e8ee9..fcfad10d10 100644 --- a/src/DBRep/DBRep_DrawableShape.cxx +++ b/src/DBRep/DBRep_DrawableShape.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -81,7 +83,7 @@ DBRep_DrawableShape::DBRep_DrawableShape const Standard_Real size, const Standard_Integer nbisos, const Standard_Integer discret) : - mySize(size), + myShape(aShape), mySize(size), myDiscret(discret), myFreeCol(FreeCol), myConnCol(ConnCol), @@ -96,7 +98,7 @@ DBRep_DrawableShape::DBRep_DrawableShape myRgN(Standard_False), myHid(Standard_False) { - myShape = aShape; + } //======================================================================= @@ -145,7 +147,7 @@ void DBRep_DrawableShape::updateDisplayData () const TopTools_IndexedDataMapOfShapeListOfShape edgemap; TopExp::MapShapesAndAncestors(myShape,TopAbs_EDGE,TopAbs_FACE,edgemap); - Standard_Integer iedge; + Standard_Integer iedge = 0; for (iedge = 1; iedge <= edgemap.Extent(); iedge++) { @@ -359,11 +361,11 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const } GeomAbs_IsoType T; - Standard_Real Par,T1,T2; - Standard_Real U1,U2,V1,V2,stepU=0.,stepV=0.; + Standard_Real Par = NAN,T1 = NAN,T2 = NAN; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN,stepU=0.,stepV=0.; // gp_Pnt P, P1; gp_Pnt P; - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; // Faces Handle(Poly_Triangulation) Tr; @@ -424,7 +426,7 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const Standard_Integer N = F->NbIsos(); - Standard_Integer Intrv, nbIntv; + Standard_Integer Intrv = 0, nbIntv = 0; Standard_Integer nbUIntv = S.NbUIntervals(GeomAbs_CN); Standard_Integer nbVIntv = S.NbVIntervals(GeomAbs_CN); TColStd_Array1OfReal TI(1,Max(nbUIntv, nbVIntv)+1); @@ -623,7 +625,7 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const // display geometrical curve if exists. Standard_Boolean isgeom = BRep_Tool::IsGeometric(E->Edge()); - Standard_Real aCheckU1, aCheckU2; + Standard_Real aCheckU1 = NAN, aCheckU2 = NAN; if (isgeom) { // check the range (to report bad edges) @@ -661,7 +663,7 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const Handle(Adaptor3d_Curve) HC = C.Trim(f, l, Precision::Confusion()); GeomAbs_CurveType CurvType = HC->GetType(); - Standard_Integer intrv, nbintv = HC->NbIntervals(GeomAbs_CN); + Standard_Integer intrv = 0, nbintv = HC->NbIntervals(GeomAbs_CN); TColStd_Array1OfReal TI(1,nbintv+1); HC->Intervals(TI,GeomAbs_CN); @@ -751,7 +753,7 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const Handle(Poly_Polygon3D) Polyg = BRep_Tool::Polygon3D(E->Edge(), loc); if (!Polyg.IsNull()) { const TColgp_Array1OfPnt& Points = Polyg->Nodes(); - Standard_Integer po; + Standard_Integer po = 0; for (po = Points.Lower()+1; po <= Points.Upper(); po++) { dis.Draw((Points.Value(po-1)).Transformed(loc), (Points.Value(po)).Transformed(loc)); @@ -832,7 +834,7 @@ void DBRep_DrawableShape::DisplayHiddenLines(Draw_Display& dis) dout.GetTrsf(id,T); Standard_Real focal = -1; if (!strcmp(dout.GetType(id),"PERS")) focal = dout.Focal(id); - Standard_Real Ang,Def; + Standard_Real Ang = NAN,Def = NAN; HLRBRep::PolyHLRAngleAndDeflection(myAng,Ang,Def); IMeshTools_Parameters aMeshParams; aMeshParams.Relative = Standard_True; @@ -1098,7 +1100,7 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T, // Build the connect tool Poly_Connect pc(T); - Standard_Integer i,j, nFree, nbTriangles = T->NbTriangles(); + Standard_Integer i = 0,j = 0, nFree = 0, nbTriangles = T->NbTriangles(); Standard_Integer t[3]; // count the free edges @@ -1136,7 +1138,7 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T, // Display the edges // free edges - Standard_Integer nn; + Standard_Integer nn = 0; dis.SetColor(Draw_rouge); nn = Free.Length() / 2; for (i = 1; i <= nn; i++) { diff --git a/src/DBRep/DBRep_DrawableShape.hxx b/src/DBRep/DBRep_DrawableShape.hxx index af6f38ea54..49840e658f 100644 --- a/src/DBRep/DBRep_DrawableShape.hxx +++ b/src/DBRep/DBRep_DrawableShape.hxx @@ -172,7 +172,7 @@ private: Standard_Boolean myRg1; Standard_Boolean myRgN; Standard_Boolean myHid; - Standard_Real myAng; + Standard_Real myAng{}; }; diff --git a/src/DBRep/DBRep_HideData.cxx b/src/DBRep/DBRep_HideData.cxx index ba2783967d..2da0361715 100644 --- a/src/DBRep/DBRep_HideData.cxx +++ b/src/DBRep/DBRep_HideData.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -64,14 +66,14 @@ void DBRep_HideData::Set(const Standard_Integer viewID, hider->Projector(HLRAlgo_Projector(myTrsf,myFocal > 0.,myFocal)); hider->Update(); - Standard_Real sta,end,dx,dy,dz; - Standard_ShortReal tolsta,tolend; + Standard_Real sta = NAN,end = NAN,dx = NAN,dy = NAN,dz = NAN; + Standard_ShortReal tolsta = NAN,tolend = NAN; HLRAlgo_EdgeIterator It; myBiPntVis.Clear(); myBiPntHid.Clear(); TopoDS_Shape Sori; - Standard_Boolean reg1,regn,outl,intl; - Standard_Address Coordinates; + Standard_Boolean reg1 = 0,regn = 0,outl = 0,intl = 0; + Standard_Address Coordinates = nullptr; HLRAlgo_EdgeStatus status; for (hider->InitHide(); hider->MoreHide(); hider->NextHide()) { diff --git a/src/DBRep/DBRep_IsoBuilder.cxx b/src/DBRep/DBRep_IsoBuilder.cxx index 03e442b574..0e13e68916 100644 --- a/src/DBRep/DBRep_IsoBuilder.cxx +++ b/src/DBRep/DBRep_IsoBuilder.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -111,7 +113,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion, for (ExpEdges.Init (TopologicalFace, TopAbs_EDGE); ExpEdges.More(); ExpEdges.Next()) { const TopoDS_Edge& TopologicalEdge = TopoDS::Edge (ExpEdges.Current()); - Standard_Real U1, U2; + Standard_Real U1 = NAN, U2 = NAN; const Handle(Geom2d_Curve) PCurve = BRep_Tool::CurveOnSurface (TopologicalEdge, TopologicalFace, U1, U2); if (PCurve.IsNull()) @@ -213,7 +215,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion, // Loading and trimming the hatchings. //----------------------------------------------------------------------- - Standard_Integer IIso ; + Standard_Integer IIso = 0 ; Standard_Real DeltaU = Abs (myUMax - myUMin) ; Standard_Real DeltaV = Abs (myVMax - myVMin) ; Standard_Real confusion = Min (DeltaU, DeltaV) * HatcherConfusion3d ; @@ -254,7 +256,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion, myNbDom = 0 ; for (IIso = 1 ; IIso <= NbIsos ; IIso++) { - Standard_Integer Index ; + Standard_Integer Index = 0 ; Index = myUInd(IIso) ; if (Index != 0) @@ -419,7 +421,7 @@ void DBRep_IsoBuilder::FillGaps(const TopoDS_Face& theFace, Handle(Geom2d_Curve)& aCurrC2d = *pPC2; // Get p-curves parameters - Standard_Real fp, lp, fc, lc; + Standard_Real fp = NAN, lp = NAN, fc = NAN, lc = NAN; fp = aPrevC2d->FirstParameter(); lp = aPrevC2d->LastParameter(); fc = aCurrC2d->FirstParameter(); @@ -508,7 +510,7 @@ void DBRep_IsoBuilder::FillGaps(const TopoDS_Face& theFace, // Collect intersection points NCollection_List aLPInt; // Get bounding points from segments - Standard_Integer iP, aNbInt = anInter.NbSegments(); + Standard_Integer iP = 0, aNbInt = anInter.NbSegments(); for (iP = 1; iP <= aNbInt; ++iP) { aLPInt.Append(anInter.Segment(iP).FirstPoint()); @@ -580,7 +582,7 @@ void DBRep_IsoBuilder::FillGaps(const TopoDS_Face& theFace, const gp_Pnt aPOnS = aBASurf.Value(aPInt.X(), aPInt.Y()); if (aTolV2 > Precision::Infinite() || aPOnS.SquareDistance(aPV) < aTolV2) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; // Trim the curves with found parameters diff --git a/src/DE/DE_ConfigurationContext.cxx b/src/DE/DE_ConfigurationContext.cxx index 14642a5c9d..3de01a6828 100644 --- a/src/DE/DE_ConfigurationContext.cxx +++ b/src/DE/DE_ConfigurationContext.cxx @@ -42,7 +42,7 @@ namespace { TCollection_AsciiString aBuffer; Standard_Integer aBufSize = 10; - Standard_Integer aLen; + Standard_Integer aLen = 0; theLine.Clear(); do { diff --git a/src/DE/DE_ConfigurationNode.cxx b/src/DE/DE_ConfigurationNode.cxx index 2d978fc71a..a73ee46876 100644 --- a/src/DE/DE_ConfigurationNode.cxx +++ b/src/DE/DE_ConfigurationNode.cxx @@ -35,10 +35,10 @@ DE_ConfigurationNode::DE_ConfigurationNode() : // function : DE_ConfigurationNode // purpose : //======================================================================= -DE_ConfigurationNode::DE_ConfigurationNode(const Handle(DE_ConfigurationNode)& theConfigurationNode) +DE_ConfigurationNode::DE_ConfigurationNode(const Handle(DE_ConfigurationNode)& theConfigurationNode) : GlobalParameters(theConfigurationNode->GlobalParameters), myIsEnabled(theConfigurationNode->IsEnabled()) { - GlobalParameters = theConfigurationNode->GlobalParameters; - myIsEnabled = theConfigurationNode->IsEnabled(); + + } //======================================================================= diff --git a/src/DE/DE_Wrapper.cxx b/src/DE/DE_Wrapper.cxx index 091fde72d6..45bac0b135 100644 --- a/src/DE/DE_Wrapper.cxx +++ b/src/DE/DE_Wrapper.cxx @@ -457,7 +457,7 @@ void DE_Wrapper::ChangePriority(const TCollection_AsciiString& theFormat, const TCollection_AsciiString& aVendorName = aVendorIter.Key(); if (!theVendorPriority.Contains(aVendorName)) { - Handle(DE_ConfigurationNode) aNode = aVendorIter.Value(); + const Handle(DE_ConfigurationNode)& aNode = aVendorIter.Value(); if (theToDisable) { aNode->SetEnabled(Standard_False); diff --git a/src/Draw/Draw.cxx b/src/Draw/Draw.cxx index 8bf5fbf036..70d85d6208 100644 --- a/src/Draw/Draw.cxx +++ b/src/Draw/Draw.cxx @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -602,7 +603,7 @@ Standard_Boolean Draw_Interprete(const char* com) if (Draw_BeforeCommand) (*Draw_BeforeCommand) (); - Standard_Integer c; + Standard_Integer c = 0; c = theCommands.RecordAndEval(Tcl_DStringValue(&command)); @@ -735,7 +736,7 @@ namespace static bool parseNumericalColorComponent (const Standard_CString theColorComponentString, Standard_Integer& theIntegerColorComponent) { - Standard_Integer anIntegerColorComponent; + Standard_Integer anIntegerColorComponent = 0; if (!Draw::ParseInteger (theColorComponentString, anIntegerColorComponent)) { return false; @@ -755,7 +756,7 @@ namespace static bool parseNumericalColorComponent (const Standard_CString theColorComponentString, Standard_ShortReal& theRealColorComponent) { - Standard_Real aRealColorComponent; + Standard_Real aRealColorComponent = NAN; if (!Draw::ParseReal (theColorComponentString, aRealColorComponent)) { return false; @@ -777,7 +778,7 @@ namespace static bool parseColorComponent (const Standard_CString theColorComponentString, Standard_ShortReal& theColorComponent) { - Standard_Integer anIntegerColorComponent; + Standard_Integer anIntegerColorComponent = 0; if (parseNumericalColorComponent (theColorComponentString, anIntegerColorComponent)) { if (anIntegerColorComponent == 1) @@ -893,7 +894,7 @@ Standard_Integer Draw::parseColor (const Standard_Integer theArgNb, if (theArgNb >= 2 && theToParseAlpha) { const Standard_CString anAlphaStr = theArgVec[1]; - Standard_ShortReal anAlphaComponent; + Standard_ShortReal anAlphaComponent = NAN; if (parseColorComponent (anAlphaStr, anAlphaComponent)) { theColor.SetAlpha (anAlphaComponent); diff --git a/src/Draw/Draw_BasicCommands.cxx b/src/Draw/Draw_BasicCommands.cxx index f115d05982..c7f202ee1b 100644 --- a/src/Draw/Draw_BasicCommands.cxx +++ b/src/Draw/Draw_BasicCommands.cxx @@ -579,7 +579,7 @@ static void cpulimitSignalHandler (int) } static void *CpuFunc(void* /*threadarg*/) { - clock_t anElapCurrent; + clock_t anElapCurrent = 0; for(;;) { sleep (5); @@ -635,7 +635,7 @@ static Standard_Integer cpulimit(Draw_Interpretor& di, Standard_Integer n, const #else // Unix & Linux - rlimit rlp; + rlimit rlp{}; rlp.rlim_max = RLIM_INFINITY; if (n <= 1) { @@ -655,7 +655,7 @@ static Standard_Integer cpulimit(Draw_Interpretor& di, Standard_Integer n, const } // set signal handler to print a message before death - struct sigaction act, oact; + struct sigaction act{}, oact{}; memset (&act, 0, sizeof(act)); act.sa_handler = cpulimitSignalHandler; sigaction (SIGXCPU, &act, &oact); @@ -663,7 +663,7 @@ static Standard_Integer cpulimit(Draw_Interpretor& di, Standard_Integer n, const // cpulimit for elapsed time aTimer.Reset(); aTimer.Start(); - pthread_t cpulimitThread; + pthread_t cpulimitThread = 0; if (aFirst) // Launch the thread only at the 1st call. { aFirst = 0; diff --git a/src/Draw/Draw_GraphicCommands.cxx b/src/Draw/Draw_GraphicCommands.cxx index 6f9cd1ef0b..527daba4fc 100644 --- a/src/Draw/Draw_GraphicCommands.cxx +++ b/src/Draw/Draw_GraphicCommands.cxx @@ -28,6 +28,7 @@ #include #include +#include #include #ifdef _WIN32 extern Draw_Viewer dout; @@ -126,8 +127,8 @@ static Standard_Integer zoom(Draw_Interpretor& , Standard_Integer n, const char* static Standard_Integer wzoom(Draw_Interpretor& di, Standard_Integer argc, const char** argv) { - Standard_Integer id,X,Y,W,H,X1,Y1,X2 = 0,Y2 = 0,b; - Standard_Real dX1,dY1,dX2,dY2,zx,zy; + Standard_Integer id = 0,X = 0,Y = 0,W = 0,H = 0,X1 = 0,Y1 = 0,X2 = 0,Y2 = 0,b = 0; + Standard_Real dX1 = NAN,dY1 = NAN,dX2 = NAN,dY2 = NAN,zx = NAN,zy = NAN; if(argc != 1 && argc != 6) { di<<"Usage : " << argv[0] << " [view-id X1 Y1 X2 Y2]\n"; @@ -234,7 +235,7 @@ static Standard_Integer wzoom(Draw_Interpretor& di, Standard_Integer argc, const static Standard_Integer wclick(Draw_Interpretor& di, Standard_Integer, const char**) { - Standard_Integer id1,X1,Y1,b; + Standard_Integer id1 = 0,X1 = 0,Y1 = 0,b = 0; dout.Flush(); di << "Just click.\n"; dout.Select(id1,X1,Y1,b); @@ -332,7 +333,7 @@ static Standard_Integer fit(Draw_Interpretor& , Standard_Integer n, const char** Standard_Boolean f2d = !strcasecmp(a[0],"2dfit"); if (n == 1) { Standard_Real zoom = RealLast(); - Standard_Integer id; + Standard_Integer id = 0; for ( id = 0; id < MAXVIEW; id++) { if (dout.HasView(id)) { if ((f2d && !dout.Is3D(id)) || (!f2d && dout.Is3D(id))) { @@ -520,7 +521,7 @@ static Standard_Integer panning(Draw_Interpretor& , Standard_Integer n, const ch } Standard_Integer DX = 0; Standard_Integer DY = 0; - Standard_Integer X,Y,W,H; + Standard_Integer X = 0,Y = 0,W = 0,H = 0; Standard_Boolean v2d = (a[0][0] == '2'); // pu2d, pd2d, pr2d, pl2d const char* com = a[0]; @@ -555,7 +556,7 @@ static Standard_Integer panning(Draw_Interpretor& , Standard_Integer n, const ch static Standard_Integer ptv(Draw_Interpretor& , Standard_Integer n, const char** a) { - Standard_Real X,Y,Z; + Standard_Real X = NAN,Y = NAN,Z = NAN; Standard_Integer start = 0; Standard_Integer end = MAXVIEW-1; if (n < 4) return 1; @@ -594,7 +595,7 @@ static Standard_Integer ptv(Draw_Interpretor& , Standard_Integer n, const char** static Standard_Integer dptv(Draw_Interpretor& , Standard_Integer n, const char** a) { - Standard_Real DX,DY,DZ; + Standard_Real DX = NAN,DY = NAN,DZ = NAN; Standard_Integer start = 0; Standard_Integer end = MAXVIEW-1; if (n < 4) return 1; @@ -729,7 +730,7 @@ static Standard_Integer hardcopy(Draw_Interpretor& , std::ofstream os(file); - Standard_Integer vxmin,vymin,vxmax,vymax; + Standard_Integer vxmin = 0,vymin = 0,vxmax = 0,vymax = 0; if (dout.HasView(iview)) { dout.GetFrame(iview,vxmin,vymin,vxmax,vymax); Standard_Real kx = (Standard_Real) (pxmax - pxmin) / (vxmax - vxmin); @@ -853,7 +854,7 @@ static Standard_Integer xwd(Draw_Interpretor& , Standard_Integer n, const char** static Standard_Integer grid (Draw_Interpretor& , Standard_Integer NbArg, const char **Arg) { - Standard_Real StepX, StepY, StepZ ; + Standard_Real StepX = NAN, StepY = NAN, StepZ = NAN ; switch (NbArg) { case 1 : @@ -913,9 +914,9 @@ static Standard_Integer dflush (Draw_Interpretor& , Standard_Integer, const char static Standard_Integer dtext(Draw_Interpretor& di, Standard_Integer n, const char** a) { gp_Pnt P; - Standard_Boolean is3d; + Standard_Boolean is3d = 0; if (n == 2) { - Standard_Integer id,X,Y,b; + Standard_Integer id = 0,X = 0,Y = 0,b = 0; di << "Pick position with button 1, other button escape\n"; dout.Select(id,X,Y,b); if (b != 1) diff --git a/src/Draw/Draw_Grid.cxx b/src/Draw/Draw_Grid.cxx index 27a5270ba3..7dc86c314b 100644 --- a/src/Draw/Draw_Grid.cxx +++ b/src/Draw/Draw_Grid.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -70,17 +72,17 @@ void Draw_Grid::DrawOn (Draw_Display& Out) const { if (!myIsActive) return ; - Standard_Integer xmin, xmax, ymin, ymax ; - Standard_Integer IndexX, IndexY ; - Standard_Real StepX, StepY ; - Standard_Integer MinIndexX, MaxIndexX, MinIndexY, MaxIndexY ; - Standard_Real Offset ; - Standard_Real zoom, Xmin, Xmax, Ymin, Ymax ; + Standard_Integer xmin = 0, xmax = 0, ymin = 0, ymax = 0 ; + Standard_Integer IndexX = 0, IndexY = 0 ; + Standard_Real StepX = NAN, StepY = NAN ; + Standard_Integer MinIndexX = 0, MaxIndexX = 0, MinIndexY = 0, MaxIndexY = 0 ; + Standard_Real Offset = NAN ; + Standard_Real zoom = NAN, Xmin = NAN, Xmax = NAN, Ymin = NAN, Ymax = NAN ; gp_Trsf T ; gp_Pnt Pnt1, Pnt2 ; - Standard_Integer IdtView ; - char *Type ; + Standard_Integer IdtView = 0 ; + char *Type = nullptr ; IdtView = Out.ViewId () ; if (!dout.HasView (IdtView)) return ; diff --git a/src/Draw/Draw_Interpretor.cxx b/src/Draw/Draw_Interpretor.cxx index 4fc5d52dd2..6046f2faf1 100644 --- a/src/Draw/Draw_Interpretor.cxx +++ b/src/Draw/Draw_Interpretor.cxx @@ -351,7 +351,7 @@ void Draw_Interpretor::add (const Standard_CString theCommandName, Standard_Boolean Draw_Interpretor::Remove(Standard_CString const n) { - Standard_PCharacter pN; + Standard_PCharacter pN = nullptr; // pN=(Standard_PCharacter)n; @@ -522,7 +522,7 @@ Standard_Integer Draw_Interpretor::PrintHelp (const Standard_CString theCommandN Standard_Boolean Draw_Interpretor::Complete(const Standard_CString line) { - Standard_PCharacter pLine; + Standard_PCharacter pLine = nullptr; // pLine=(Standard_PCharacter)line; return Tcl_CommandComplete (pLine) != 0; diff --git a/src/Draw/Draw_PloadCommands.cxx b/src/Draw/Draw_PloadCommands.cxx index a4dfc746d8..eebf8d5e77 100644 --- a/src/Draw/Draw_PloadCommands.cxx +++ b/src/Draw/Draw_PloadCommands.cxx @@ -115,7 +115,7 @@ static void resolveKeys (Draw_MapOfAsciiString& theMap, for (Standard_Integer j = 1; j <= aMapExtent; ++j) { TCollection_AsciiString aValue; - const TCollection_AsciiString aResource = theMap.FindKey (j); + const TCollection_AsciiString& aResource = theMap.FindKey (j); if (theResMgr->Find (aResource, aValue)) { #ifdef OCCT_DEBUG @@ -204,7 +204,7 @@ static Standard_Integer Pload (Draw_Interpretor& theDI, const Standard_Integer aMapExtent = aMap.Extent(); for (Standard_Integer aResIter = 1; aResIter <= aMapExtent; ++aResIter) { - const TCollection_AsciiString aResource = aMap.FindKey (aResIter); + const TCollection_AsciiString& aResource = aMap.FindKey (aResIter); #ifdef OCCT_DEBUG std::cout << "aResource = " << aResource << std::endl; #endif diff --git a/src/Draw/Draw_ProgressIndicator.cxx b/src/Draw/Draw_ProgressIndicator.cxx index a31a1717a5..5589e7c5ac 100644 --- a/src/Draw/Draw_ProgressIndicator.cxx +++ b/src/Draw/Draw_ProgressIndicator.cxx @@ -92,7 +92,7 @@ void Draw_ProgressIndicator::Show (const Message_ProgressScope& theScope, const { if (!myStartTime) { - time_t aTimeT; + time_t aTimeT = 0; time(&aTimeT); myStartTime = (Standard_Size)aTimeT; } @@ -144,7 +144,7 @@ void Draw_ProgressIndicator::Show (const Message_ProgressScope& theScope, const { // In addition, write elapsed/estimated/remaining time if ( GetPosition() > 0.01 ) { - time_t aTimeT; + time_t aTimeT = 0; time ( &aTimeT ); Standard_Size aTime = (Standard_Size)aTimeT; aText << "\nElapsed/estimated time: " << (long)(aTime - myStartTime) << diff --git a/src/Draw/Draw_VariableCommands.cxx b/src/Draw/Draw_VariableCommands.cxx index 473b212887..3c1ce3e452 100644 --- a/src/Draw/Draw_VariableCommands.cxx +++ b/src/Draw/Draw_VariableCommands.cxx @@ -222,7 +222,7 @@ static Standard_Integer erase(Draw_Interpretor& di, Standard_Integer n, const ch if (n <= 1 || donly) { // clear, 2dclear, donly, erase (without arguments) - Standard_Integer i; + Standard_Integer i = 0; // solve the names for "." before erasing if (donly) { @@ -319,7 +319,7 @@ static Standard_Integer draw(Draw_Interpretor& , Standard_Integer n, const char* Standard_Integer mo = Draw::Atoi(a[2]); Draw_Display d = dout.MakeDisplay(id); d.SetMode(mo); - Standard_Integer i; + Standard_Integer i = 0; for (i = 3; i < n; i++) { Handle(Draw_Drawable3D) D = Draw::Get(a[i]); if (!D.IsNull()) D->DrawOn(d); @@ -405,8 +405,8 @@ static Standard_Integer dname(Draw_Interpretor& di, Standard_Integer n, const ch return 1; } // - Standard_PCharacter pC; - Standard_Integer i; + Standard_PCharacter pC = nullptr; + Standard_Integer i = 0; Handle(Draw_Drawable3D) aD; // for (i = 1; i < n; ++i) { @@ -430,7 +430,7 @@ static Standard_Integer dname(Draw_Interpretor& di, Standard_Integer n, const ch static Standard_Integer dump(Draw_Interpretor& DI, Standard_Integer n, const char** a) { if(n < 2) return 1; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i < n; i++) { Handle(Draw_Drawable3D) D = Draw::Get(a[i]); if (!D.IsNull()) { @@ -589,8 +589,8 @@ Standard_Integer isprot(Draw_Interpretor& di, Standard_Integer n, const char** a static Standard_Integer pick(Draw_Interpretor& , Standard_Integer n, const char** a) { if (n < 6) return 1; - Standard_Integer id; - Standard_Integer X,Y,b; + Standard_Integer id = 0; + Standard_Integer X = 0,Y = 0,b = 0; Standard_Boolean wait = (n == 6); if (!wait) id = Draw::Atoi(a[1]); dout.Select(id,X,Y,b,wait); @@ -1145,7 +1145,7 @@ bool Draw::ParseInteger (const Standard_CString theExpressionString, Standard_In //======================================================================= void Draw::Set(const Standard_CString Name, const Standard_CString val) { - Standard_PCharacter pName, pVal; + Standard_PCharacter pName = nullptr, pVal = nullptr; // pName=(Standard_PCharacter)Name; pVal=(Standard_PCharacter)val; @@ -1208,7 +1208,7 @@ void Draw::VariableCommands(Draw_Interpretor& theCommandsArg) Draw_Number::RegisterFactory(); // set up some variables - const char* n; + const char* n = nullptr; Handle(Draw_Axis3D) theAxes3d = new Draw_Axis3D(gp_Pnt(0,0,0),Draw_bleu,20); n = "axes"; Draw::Set(n,theAxes3d); @@ -1237,7 +1237,7 @@ void Draw::VariableCommands(Draw_Interpretor& theCommandsArg) theGrid->Protected(Standard_True); - const char* g; + const char* g = nullptr; g = "DRAW Numeric functions"; diff --git a/src/Draw/Draw_View.hxx b/src/Draw/Draw_View.hxx index c3acac8bca..cd1044f231 100644 --- a/src/Draw/Draw_View.hxx +++ b/src/Draw/Draw_View.hxx @@ -103,7 +103,7 @@ protected: Standard_Integer myId; Draw_Viewer* myViewer; - char myType[5]; + char myType[5]{}; Standard_Boolean myIsPers; Standard_Boolean myIs2D; Standard_Real myFocalDistance; diff --git a/src/Draw/Draw_Viewer.cxx b/src/Draw/Draw_Viewer.cxx index 283c465823..cee487afbc 100644 --- a/src/Draw/Draw_Viewer.cxx +++ b/src/Draw/Draw_Viewer.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -61,7 +63,7 @@ static DrawingMode CurrentMode = DRAW; Draw_Viewer::Draw_Viewer() { if (Draw_Batch) return; - Standard_Integer i; + Standard_Integer i = 0; for ( i = 0; i < MAXVIEW; i++) myViews[i] = NULL; for (i = 0; i < MAXCOLOR; i++) { ps_width[i] = 1; @@ -205,7 +207,7 @@ void Draw_Viewer::SetZoom (const Standard_Integer id, const Standard_Real z) { Standard_Real zz = z / aView->GetZoom(); aView->SetZoom(z); - Standard_Integer X,Y,W,H; + Standard_Integer X = 0,Y = 0,W = 0,H = 0; GetPosSize(id,X,Y,W,H); const Standard_Real w = 0.5 * static_cast(W); @@ -382,7 +384,7 @@ void Draw_Viewer::GetFrame(const Standard_Integer id, { if (Draw_Batch) return; if (myViews[id]) { - Standard_Integer X,Y,H,W; + Standard_Integer X = 0,Y = 0,H = 0,W = 0; GetPosSize(id,X,Y,W,H); xminf = - myViews[id]->GetDx(); xmaxf = W - myViews[id]->GetDx(); @@ -403,7 +405,7 @@ void Draw_Viewer::FitView(const Standard_Integer id, const Standard_Integer fram // is this the only view in its category Standard_Boolean is2d = myViews[id]->Is2D(); - Standard_Integer i,nbviews = 0; + Standard_Integer i = 0,nbviews = 0; for (i = 1; i < MAXVIEW; i++) { if (myViews[i]) { if (myViews[i]->Is2D() == is2d) @@ -412,15 +414,15 @@ void Draw_Viewer::FitView(const Standard_Integer id, const Standard_Integer fram } Standard_Boolean only = (nbviews == 1); - Standard_Integer X,Y,H,W; + Standard_Integer X = 0,Y = 0,H = 0,W = 0; GetPosSize(id,X,Y,W,H); // compute the min max Standard_Integer n = myDrawables.Length(); if (n == 0) return; // Draw_Display DF; curview = myViews[id]; - Standard_Real umin,umax,vmin,vmax; - Standard_Real u1,u2,v1,v2; + Standard_Real umin = NAN,umax = NAN,vmin = NAN,vmax = NAN; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; umin = vmin = DRAWINFINITE; umax = vmax = -DRAWINFINITE; @@ -437,7 +439,7 @@ void Draw_Viewer::FitView(const Standard_Integer id, const Standard_Integer fram if (v2 > vmax) vmax = v2; } } - Standard_Real z; + Standard_Real z = NAN; umin = umin / curview->GetZoom(); vmin = vmin / curview->GetZoom(); umax = umax / curview->GetZoom(); @@ -907,7 +909,7 @@ void Draw_Viewer::RemoveDrawable (const Handle(Draw_Drawable3D)& D) { if (Draw_Batch) return; if (!D.IsNull() && D->Visible()) { - Standard_Integer index; + Standard_Integer index = 0; for (index = 1; index <= myDrawables.Length(); index++) { if (myDrawables(index) == D) { D->Visible(Standard_False); @@ -1022,7 +1024,7 @@ void Draw_Viewer::Select (Standard_Integer& theId, Standard_Boolean again = Standard_True; while (again) { - Draw_Window::Draw_XEvent ev; + Draw_Window::Draw_XEvent ev{}; ev.type = 0; Draw_Window::GetNextEvent (ev); switch (ev.type) @@ -1124,7 +1126,7 @@ Standard_Integer Draw_Viewer::Pick(const Standard_Integer id, // is this the only view in its category Standard_Boolean is2d = myViews[id]->Is2D(); - Standard_Integer i,nbviews = 0; + Standard_Integer i = 0,nbviews = 0; for (i = 0; i < MAXVIEW; i++) { if (myViews[i]) @@ -1138,7 +1140,7 @@ Standard_Integer Draw_Viewer::Pick(const Standard_Integer id, ypick = Y; precpick = Prec; found = Standard_False; - Standard_Real x1,x2,y1,y2; + Standard_Real x1 = NAN,x2 = NAN,y1 = NAN,y2 = NAN; for (i = first+1; i <= myDrawables.Length(); i++) { Standard_Boolean reject = Standard_False; // rejection if only view @@ -1402,7 +1404,7 @@ void Draw_Display::Project(const gp_Pnt& p, gp_Pnt2d& p2d) const if (Draw_Batch) return; gp_Pnt pt = p; pt.Transform(curview->GetMatrix()); - Standard_Real xp,yp,zp; + Standard_Real xp = NAN,yp = NAN,zp = NAN; pt.Coord(xp,yp,zp); if (curview->IsPerspective()) { const Standard_Real aDistance = curview->GetFocalDistance(); @@ -1473,7 +1475,7 @@ inline Standard_Integer CalculRegion(const Standard_Real x, const Standard_Real y1, const Standard_Real x2, const Standard_Real y2) { - Standard_Integer r; + Standard_Integer r = 0; if(xx2) { r=2; } else { r=0; } } if(yy2) { r|=8; } } return(r); @@ -1497,7 +1499,7 @@ Standard_Boolean Trim(gp_Pnt2d& P1,gp_Pnt2d& P2, dx/=dab; dy/=dab; - Standard_Real xm,ym,mfenx,mfeny; + Standard_Real xm = NAN,ym = NAN,mfenx = NAN,mfeny = NAN; mfenx=xm=0.5*(x0+x1); mfeny=ym=0.5*(y0+y1); x1-=x0; y1-=y0; @@ -1564,7 +1566,7 @@ void Draw_Display::DrawTo (const gp_Pnt2d& pp2) case DRAW : { #if 1 - Standard_Integer x0,y0,x1,y1; + Standard_Integer x0 = 0,y0 = 0,x1 = 0,y1 = 0; curview->GetFrame(x0,y0,x1,y1); diff --git a/src/Draw/Draw_Viewer.hxx b/src/Draw/Draw_Viewer.hxx index 89dbac9ed8..e6b463339b 100644 --- a/src/Draw/Draw_Viewer.hxx +++ b/src/Draw/Draw_Viewer.hxx @@ -153,7 +153,7 @@ class Draw_Viewer { private : - Draw_View* myViews[MAXVIEW]; + Draw_View* myViews[MAXVIEW]{}; Draw_SequenceOfDrawable3D myDrawables; }; diff --git a/src/Draw/Draw_Window.cxx b/src/Draw/Draw_Window.cxx index 090fa69b5e..7ac3495684 100644 --- a/src/Draw/Draw_Window.cxx +++ b/src/Draw/Draw_Window.cxx @@ -157,7 +157,7 @@ void Draw_Window::RemoveCallbackBeforeTerminate (FCallbackBeforeTerminate theCB) //! Side effects: A prompt gets output, and a Tcl script may be evaluated in interp. static void Prompt (Tcl_Interp* theInterp, int thePartial) { - Tcl_Channel errChannel; + Tcl_Channel errChannel = nullptr; Tcl_Channel outChannel = Tcl_GetStdChannel(TCL_STDOUT); const char* promptCmd = Tcl_GetVar (theInterp, thePartial ? "tcl_prompt2" : "tcl_prompt1", TCL_GLOBAL_ONLY); if (promptCmd == NULL) @@ -244,15 +244,19 @@ Draw_Window::Draw_Window (const char* theTitle, const NCollection_Vec2& theSize, Aspect_Drawable theParent, Aspect_Drawable theWin) -: myWindow (0), +: #if defined(_WIN32) + myWindow (0), myMemHbm (NULL), myCurrPen (0), myCurrMode (0), #elif defined(HAVE_XLIB) + myWindow((Window )theWin), myMother ((Window )theParent), myImageBuffer (0), myBase (new Base_Window()), +#else + myWindow (0), #endif myCurrentColor (0), myUseBuffer (Standard_False) @@ -262,7 +266,7 @@ Draw_Window::Draw_Window (const char* theTitle, myWindow = (HWND )theWin; (void )theParent; #elif defined(HAVE_XLIB) - myWindow = (Window )theWin; + if (theParent == 0) { myMother = RootWindow (Draw_WindowDisplay, Draw_WindowScreen); @@ -1053,7 +1057,7 @@ Standard_Boolean Draw_Window::Save (const char* theFileName) const XWindowAttributes aWinAttrRoot; XGetWindowAttributes (Draw_WindowDisplay, XRootWindowOfScreen (aWinAttr.screen), &aWinAttrRoot); - Window aWinChildDummy; + Window aWinChildDummy = 0; int aWinLeft = 0, aWinTop = 0; XTranslateCoordinates (Draw_WindowDisplay, myWindow, XRootWindowOfScreen (aWinAttr.screen), 0, 0, &aWinLeft, &aWinTop, &aWinChildDummy); diff --git a/src/DrawTrSurf/DrawTrSurf.cxx b/src/DrawTrSurf/DrawTrSurf.cxx index cfe5cbdbf7..b42273834d 100644 --- a/src/DrawTrSurf/DrawTrSurf.cxx +++ b/src/DrawTrSurf/DrawTrSurf.cxx @@ -491,7 +491,7 @@ static Standard_Integer transform (Draw_Interpretor& di, Standard_Integer n, con { if (n < 5) return 1; gp_Trsf T; - Standard_Integer i,last = n-1; + Standard_Integer i = 0,last = n-1; if (!strcmp(a[0],"pscale")) { Standard_Real s = Draw::Atof(a[last]); last--; @@ -566,7 +566,7 @@ static Standard_Integer d2transform (Draw_Interpretor& di, Standard_Integer n, c { if (n < 4) return 1; gp_Trsf2d T; - Standard_Integer i,last = n-1; + Standard_Integer i = 0,last = n-1; if (!strcmp(a[0],"2dpscale")) { Standard_Real s = Draw::Atof(a[last]); last--; @@ -1305,7 +1305,7 @@ void DrawTrSurf::BasicCommands(Draw_Interpretor& theCommands) DrawTrSurf_Surface::RegisterFactory(); DrawTrSurf_Triangulation::RegisterFactory(); - const char* g; + const char* g = nullptr; g = "geometric display commands"; theCommands.Add("nbiso", diff --git a/src/DrawTrSurf/DrawTrSurf_BSplineCurve.cxx b/src/DrawTrSurf/DrawTrSurf_BSplineCurve.cxx index 972be5cf74..eb9f2c8b9e 100644 --- a/src/DrawTrSurf/DrawTrSurf_BSplineCurve.cxx +++ b/src/DrawTrSurf/DrawTrSurf_BSplineCurve.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -28,14 +30,14 @@ IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve, DrawTrSurf_Curve) DrawTrSurf_BSplineCurve::DrawTrSurf_BSplineCurve (const Handle(Geom_BSplineCurve)& C) -: DrawTrSurf_Curve (C, Draw_vert, 16, 0.05, 1) +: DrawTrSurf_Curve (C, Draw_vert, 16, 0.05, 1), drawKnots(Standard_True), knotsForm(Draw_Losange), knotsDim(5), drawPoles(Standard_True) { - drawKnots = Standard_True; - knotsForm = Draw_Losange; + + knotsLook = Draw_violet; - knotsDim = 5; - drawPoles = Standard_True; + + polesLook = Draw_rouge; } @@ -45,14 +47,14 @@ DrawTrSurf_BSplineCurve::DrawTrSurf_BSplineCurve (const Handle(Geom_BSplineCurve const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode) -: DrawTrSurf_Curve (C, CurvColor, Discret, Deflection, DrawMode) +: DrawTrSurf_Curve (C, CurvColor, Discret, Deflection, DrawMode), drawKnots(ShowKnots), knotsForm(KnotsShape), knotsLook(KnotsColor), knotsDim(KnotsSize), drawPoles(ShowPoles), polesLook(PolesColor) { - drawKnots = ShowKnots; - knotsForm = KnotsShape; - knotsLook = KnotsColor; - knotsDim = KnotsSize; - drawPoles = ShowPoles; - polesLook = PolesColor; + + + + + + } void DrawTrSurf_BSplineCurve::DrawOn (Draw_Display& dis) const @@ -134,7 +136,7 @@ void DrawTrSurf_BSplineCurve::DrawOn (Draw_Display& dis, Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(curv); Standard_Real Eps1 = Abs(Epsilon (U1)); Standard_Real Eps2 = Abs(Epsilon (U2)); - Standard_Integer I1, J1, I2, J2; + Standard_Integer I1 = 0, J1 = 0, I2 = 0, J2 = 0; C->LocateU (U1, Eps1, I1, J1); C->LocateU (U2, Eps2, I2, J2); Standard_Integer ka = C->FirstUKnotIndex (); @@ -181,11 +183,11 @@ void DrawTrSurf_BSplineCurve::DrawOn (Draw_Display& dis, } else { - Standard_Integer NbPoints; + Standard_Integer NbPoints = 0; Standard_Integer Discret = GetDiscretisation(); Standard_Real Ustart = C->Knot (ka); Standard_Real Uend = C->Knot (kb); - Standard_Real Du, U, Ua, Ub, Uk1, Uk2; + Standard_Real Du = NAN, U = NAN, Ua = NAN, Ub = NAN, Uk1 = NAN, Uk2 = NAN; if (I1 > ka) { ka = I1; Uk1 = U1; } else diff --git a/src/DrawTrSurf/DrawTrSurf_BSplineCurve2d.cxx b/src/DrawTrSurf/DrawTrSurf_BSplineCurve2d.cxx index fff3069884..299cd84cd6 100644 --- a/src/DrawTrSurf/DrawTrSurf_BSplineCurve2d.cxx +++ b/src/DrawTrSurf/DrawTrSurf_BSplineCurve2d.cxx @@ -28,13 +28,13 @@ IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve2d, DrawTrSurf_Curve2d) DrawTrSurf_BSplineCurve2d::DrawTrSurf_BSplineCurve2d (const Handle(Geom2d_BSplineCurve)& C) -: DrawTrSurf_Curve2d (C, Draw_vert, 100) +: DrawTrSurf_Curve2d (C, Draw_vert, 100), drawKnots(Standard_True), knotsForm(Draw_Losange), knotsDim(5), drawPoles(Standard_True) { - drawKnots = Standard_True; - knotsForm = Draw_Losange; + + knotsLook = Draw_violet; - knotsDim = 5; - drawPoles = Standard_True; + + polesLook = Draw_rouge; } @@ -42,14 +42,14 @@ DrawTrSurf_BSplineCurve2d::DrawTrSurf_BSplineCurve2d (const Handle(Geom2d_BSplin const Draw_Color& PolesColor, const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret) -: DrawTrSurf_Curve2d (C, CurvColor, Discret) +: DrawTrSurf_Curve2d (C, CurvColor, Discret), drawKnots(ShowKnots), knotsForm(KnotsShape), knotsLook(KnotsColor), knotsDim(KnotsSize), drawPoles(ShowPoles), polesLook(PolesColor) { - drawKnots = ShowKnots; - knotsForm = KnotsShape; - knotsLook = KnotsColor; - knotsDim = KnotsSize; - drawPoles = ShowPoles; - polesLook = PolesColor; + + + + + + } void DrawTrSurf_BSplineCurve2d::DrawOn (Draw_Display& dis) const diff --git a/src/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx b/src/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx index 6bc6d6b01f..c1fd402e45 100644 --- a/src/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx +++ b/src/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -32,14 +34,14 @@ IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface) DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S) : DrawTrSurf_Surface (S, S->NbUKnots()-2, S->NbVKnots()-2, - Draw_jaune, Draw_bleu, 30, 0.05, 0) + Draw_jaune, Draw_bleu, 30, 0.05, 0), drawPoles(Standard_True), drawKnots(Standard_True), knotsIsos(Standard_True), knotsForm(Draw_Losange), knotsDim(5) { - drawPoles = Standard_True; - drawKnots = Standard_True; - knotsIsos = Standard_True; - knotsForm = Draw_Losange; + + + + knotsLook = Draw_violet; - knotsDim = 5; + polesLook = Draw_rouge; } @@ -49,15 +51,15 @@ DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineS const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode) : DrawTrSurf_Surface (S, S->NbUKnots()-2, S->NbVKnots()-2, BoundsColor, - IsosColor, Discret, Deflection, DrawMode) + IsosColor, Discret, Deflection, DrawMode), knotsIsos(Standard_True), drawPoles(ShowPoles), drawKnots(ShowKnots), knotsForm(KnotsShape), knotsLook(KnotsColor), knotsDim(KnotsSize), polesLook(PolesColor) { - knotsIsos = Standard_True; - drawPoles = ShowPoles; - drawKnots = ShowKnots; - knotsForm = KnotsShape; - knotsLook = KnotsColor; - knotsDim = KnotsSize; - polesLook = PolesColor; + + + + + + + } DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S, const Standard_Integer NbUIsos, @@ -67,23 +69,23 @@ DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineS const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode) : DrawTrSurf_Surface (S, Abs(NbUIsos), Abs(NbVIsos), BoundsColor, - IsosColor, Discret, Deflection, DrawMode) + IsosColor, Discret, Deflection, DrawMode), knotsIsos(Standard_False), drawPoles(ShowPoles), drawKnots(ShowKnots), knotsForm(KnotsShape), knotsLook(KnotsColor), knotsDim(KnotsSize), polesLook(PolesColor) { - knotsIsos = Standard_False; - drawPoles = ShowPoles; - drawKnots = ShowKnots; - knotsForm = KnotsShape; - knotsLook = KnotsColor; - knotsDim = KnotsSize; - polesLook = PolesColor; + + + + + + + } void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const { Handle(Geom_BSplineSurface) S = Handle(Geom_BSplineSurface)::DownCast(surf); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; - Standard_Real Ua,Ub,Va,Vb; + Standard_Real Ua = NAN,Ub = NAN,Va = NAN,Vb = NAN; S->Bounds(Ua,Ub,Va,Vb); if (drawPoles) @@ -121,7 +123,7 @@ void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const if (knotsIsos) { - Standard_Integer first, last; + Standard_Integer first = 0, last = 0; Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface(); HS->Load(surf); @@ -146,7 +148,7 @@ void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const if (drawKnots) { - Standard_Integer first, last; + Standard_Integer first = 0, last = 0; Standard_Integer NbUKnots = S->NbUKnots(); TColStd_Array1OfReal SUKnots (1, NbUKnots); S->UKnots (SUKnots); @@ -225,7 +227,7 @@ void DrawTrSurf_BSplineSurface::FindUKnot (const Standard_Real X, const Standard gp_Pnt2d p1(X,Y); UIndex++; Standard_Integer NbUKnots = bs->NbUKnots(); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; surf->Bounds (U1, U2, V1, V2); while (UIndex <= NbUKnots) { @@ -245,7 +247,7 @@ void DrawTrSurf_BSplineSurface::FindVKnot (const Standard_Real X, const Standard gp_Pnt2d p1(X,Y); VIndex++; Standard_Integer NbVKnots = bs->NbVKnots(); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; surf->Bounds (U1, U2, V1, V2); while (VIndex <= NbVKnots) { diff --git a/src/DrawTrSurf/DrawTrSurf_BezierCurve.cxx b/src/DrawTrSurf/DrawTrSurf_BezierCurve.cxx index 7f4034967d..d728665c24 100644 --- a/src/DrawTrSurf/DrawTrSurf_BezierCurve.cxx +++ b/src/DrawTrSurf/DrawTrSurf_BezierCurve.cxx @@ -27,9 +27,9 @@ IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve, DrawTrSurf_Curve) DrawTrSurf_BezierCurve::DrawTrSurf_BezierCurve (const Handle(Geom_BezierCurve)& C) -: DrawTrSurf_Curve (C, Draw_vert, 16, 0.05, 1) +: DrawTrSurf_Curve (C, Draw_vert, 16, 0.05, 1), drawPoles(Standard_True) { - drawPoles = Standard_True; + polesLook = Draw_rouge; } @@ -38,10 +38,10 @@ DrawTrSurf_BezierCurve::DrawTrSurf_BezierCurve ( const Draw_Color& PolesColor, const Standard_Boolean ShowPoles, const Standard_Integer Discret,const Standard_Real Deflection, const Standard_Integer DrawMode ) -: DrawTrSurf_Curve (C, CurvColor, Discret, Deflection, DrawMode) +: DrawTrSurf_Curve (C, CurvColor, Discret, Deflection, DrawMode), drawPoles(ShowPoles), polesLook(PolesColor) { - drawPoles = ShowPoles; - polesLook = PolesColor; + + } void DrawTrSurf_BezierCurve::DrawOn (Draw_Display& dis) const diff --git a/src/DrawTrSurf/DrawTrSurf_BezierCurve2d.cxx b/src/DrawTrSurf/DrawTrSurf_BezierCurve2d.cxx index 4d862c783e..a420b27f63 100644 --- a/src/DrawTrSurf/DrawTrSurf_BezierCurve2d.cxx +++ b/src/DrawTrSurf/DrawTrSurf_BezierCurve2d.cxx @@ -27,19 +27,19 @@ IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d) DrawTrSurf_BezierCurve2d::DrawTrSurf_BezierCurve2d (const Handle(Geom2d_BezierCurve)& C) -: DrawTrSurf_Curve2d (C, Draw_vert, 50) +: DrawTrSurf_Curve2d (C, Draw_vert, 50), drawPoles(Standard_True) { - drawPoles = Standard_True; + polesLook = Draw_rouge; } DrawTrSurf_BezierCurve2d::DrawTrSurf_BezierCurve2d (const Handle(Geom2d_BezierCurve)& C, const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Standard_Boolean ShowPoles, const Standard_Integer Discret) -: DrawTrSurf_Curve2d (C, CurvColor, Discret) +: DrawTrSurf_Curve2d (C, CurvColor, Discret), drawPoles(ShowPoles), polesLook(PolesColor) { - drawPoles = ShowPoles; - polesLook = PolesColor; + + } void DrawTrSurf_BezierCurve2d::DrawOn (Draw_Display& dis) const diff --git a/src/DrawTrSurf/DrawTrSurf_BezierSurface.cxx b/src/DrawTrSurf/DrawTrSurf_BezierSurface.cxx index 04818dafae..0eaeb36345 100644 --- a/src/DrawTrSurf/DrawTrSurf_BezierSurface.cxx +++ b/src/DrawTrSurf/DrawTrSurf_BezierSurface.cxx @@ -28,9 +28,9 @@ IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierSurface, DrawTrSurf_Surface) DrawTrSurf_BezierSurface::DrawTrSurf_BezierSurface (const Handle(Geom_BezierSurface)& S) -: DrawTrSurf_Surface (S, 1, 1, Draw_jaune, Draw_bleu, 30, 0.05, 0) +: DrawTrSurf_Surface (S, 1, 1, Draw_jaune, Draw_bleu, 30, 0.05, 0), drawPoles(Standard_True) { - drawPoles = Standard_True; + polesLook = Draw_rouge; } @@ -41,15 +41,15 @@ DrawTrSurf_BezierSurface::DrawTrSurf_BezierSurface (const Handle(Geom_BezierSurf const Standard_Integer Discret,const Standard_Real Deflection, const Standard_Integer DrawMode) : DrawTrSurf_Surface (S, NbUIsos, NbVIsos, BoundsColor, IsosColor, - Discret, Deflection, DrawMode) + Discret, Deflection, DrawMode), drawPoles(ShowPoles), polesLook(PolesColor) { - drawPoles = ShowPoles; - polesLook = PolesColor; + + } void DrawTrSurf_BezierSurface::DrawOn (Draw_Display& dis) const { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Handle(Geom_BezierSurface) S = Handle(Geom_BezierSurface)::DownCast(surf); if (drawPoles) { diff --git a/src/DrawTrSurf/DrawTrSurf_Curve.cxx b/src/DrawTrSurf/DrawTrSurf_Curve.cxx index 826e875ccc..6c181f0ce4 100644 --- a/src/DrawTrSurf/DrawTrSurf_Curve.cxx +++ b/src/DrawTrSurf/DrawTrSurf_Curve.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -145,18 +147,18 @@ void DrawTrSurf_Curve::DrawOn (Draw_Display& dis) const } // Draw the curvature Radius if (dispcurvradius && (C.GetType() != GeomAbs_Line)) { - Standard_Integer ii; - Standard_Integer intrv, nbintv = C.NbIntervals(GeomAbs_CN); + Standard_Integer ii = 0; + Standard_Integer intrv = 0, nbintv = C.NbIntervals(GeomAbs_CN); TColStd_Array1OfReal TI(1,nbintv+1); C.Intervals(TI,GeomAbs_CN); - Standard_Real Resolution = 1.0e-9, Curvature; + Standard_Real Resolution = 1.0e-9, Curvature = NAN; GeomLProp_CLProps LProp(curv, 2, Resolution); gp_Pnt P1, P2; for (intrv = 1; intrv <= nbintv; intrv++) { Standard_Real t = TI(intrv); Standard_Real step = (TI(intrv+1) - t) / GetDiscretisation(); - Standard_Real LRad, ratio; + Standard_Real LRad = NAN, ratio = NAN; for (ii = 1; ii <= GetDiscretisation(); ii++) { LProp.SetParameter(t); if (LProp.IsTangentDefined()) { diff --git a/src/DrawTrSurf/DrawTrSurf_Curve2d.cxx b/src/DrawTrSurf/DrawTrSurf_Curve2d.cxx index 520426b73b..8891955367 100644 --- a/src/DrawTrSurf/DrawTrSurf_Curve2d.cxx +++ b/src/DrawTrSurf/DrawTrSurf_Curve2d.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -41,14 +43,14 @@ extern Standard_Boolean Draw_Bounds; //======================================================================= DrawTrSurf_Curve2d::DrawTrSurf_Curve2d (const Handle(Geom2d_Curve)& C, const Standard_Boolean DispOrigin) -: DrawTrSurf_Drawable (50) +: DrawTrSurf_Drawable (50), curv(C), disporigin(DispOrigin), dispcurvradius(Standard_False), radiusmax(1.0e3), radiusratio(0.1) { - curv = C; + look = Draw_vert; - disporigin = DispOrigin ; - dispcurvradius = Standard_False; - radiusmax = 1.0e3; - radiusratio = 0.1; + + + + } //======================================================================= @@ -62,14 +64,14 @@ DrawTrSurf_Curve2d::DrawTrSurf_Curve2d (const Handle(Geom2d_Curve)& C, const Standard_Boolean DispCurvRadius, const Standard_Real RadiusMax, const Standard_Real RadiusRatio) : - DrawTrSurf_Drawable (Discret) + DrawTrSurf_Drawable (Discret), curv(C), look(aColor), disporigin(DispOrigin), dispcurvradius(DispCurvRadius), radiusmax(RadiusMax), radiusratio(RadiusRatio) { - curv = C; - look = aColor; - disporigin = DispOrigin ; - dispcurvradius = DispCurvRadius; - radiusmax = RadiusMax; - radiusratio = RadiusRatio; + + + + + + } //======================================================================= @@ -140,18 +142,18 @@ void DrawTrSurf_Curve2d::DrawOn (Draw_Display& dis) const // Draw the curvature Radius if (dispcurvradius && (C2d.GetType() != GeomAbs_Line)) { - Standard_Integer ii; - Standard_Integer intrv, nbintv = C2d.NbIntervals(GeomAbs_CN); + Standard_Integer ii = 0; + Standard_Integer intrv = 0, nbintv = C2d.NbIntervals(GeomAbs_CN); TColStd_Array1OfReal TI(1,nbintv+1); C2d.Intervals(TI,GeomAbs_CN); - Standard_Real Resolution = 1.0e-9, Curvature; + Standard_Real Resolution = 1.0e-9, Curvature = NAN; Geom2dLProp_CLProps2d LProp(curv, 2, Resolution); gp_Pnt2d P1, P2; for (intrv = 1; intrv <= nbintv; intrv++) { Standard_Real t = TI(intrv); Standard_Real step = (TI(intrv+1) - t) / GetDiscretisation(); - Standard_Real LRad, ratio; + Standard_Real LRad = NAN, ratio = NAN; for (ii = 1; ii <= GetDiscretisation(); ii++) { LProp.SetParameter(t); if (LProp.IsTangentDefined()) { diff --git a/src/DrawTrSurf/DrawTrSurf_Drawable.cxx b/src/DrawTrSurf/DrawTrSurf_Drawable.cxx index 180d0d3ed6..21d55cd1ae 100644 --- a/src/DrawTrSurf/DrawTrSurf_Drawable.cxx +++ b/src/DrawTrSurf/DrawTrSurf_Drawable.cxx @@ -57,7 +57,7 @@ void DrawTrSurf_Drawable::DrawCurve2dOn (Adaptor2d_Curve2d& C, gp_Pnt P; gp_Pnt2d aPoint2d, - *aPoint2dPtr ; + *aPoint2dPtr = nullptr ; if (myDrawMode == 1) { Standard_Real Fleche = myDeflection/aDisplay.Zoom(); GCPnts_UniformDeflection LineVu(C,Fleche); @@ -73,7 +73,7 @@ void DrawTrSurf_Drawable::DrawCurve2dOn (Adaptor2d_Curve2d& C, } } else { - Standard_Integer intrv, nbintv = C.NbIntervals(GeomAbs_CN); + Standard_Integer intrv = 0, nbintv = C.NbIntervals(GeomAbs_CN); TColStd_Array1OfReal TI(1,nbintv+1); C.Intervals(TI,GeomAbs_CN); C.D0(C.FirstParameter(),aPoint2d); @@ -144,8 +144,8 @@ void DrawTrSurf_Drawable::DrawCurveOn (Adaptor3d_Curve& C, } else { - Standard_Integer j; - Standard_Integer intrv, nbintv = C.NbIntervals(GeomAbs_CN); + Standard_Integer j = 0; + Standard_Integer intrv = 0, nbintv = C.NbIntervals(GeomAbs_CN); TColStd_Array1OfReal TI(1,nbintv+1); C.Intervals(TI,GeomAbs_CN); C.D0(C.FirstParameter(),P); diff --git a/src/DrawTrSurf/DrawTrSurf_Point.cxx b/src/DrawTrSurf/DrawTrSurf_Point.cxx index 20cc708de5..7731a8c010 100644 --- a/src/DrawTrSurf/DrawTrSurf_Point.cxx +++ b/src/DrawTrSurf/DrawTrSurf_Point.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -177,7 +179,7 @@ Handle(Draw_Drawable3D) DrawTrSurf_Point::Restore (Standard_IStream& theStream) const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters(); Standard_Integer is3d = 0; theStream >> is3d; - Standard_Real x,y,z = 0.0; + Standard_Real x = NAN,y = NAN,z = 0.0; if (is3d) { theStream >> x >> y >> z; diff --git a/src/DrawTrSurf/DrawTrSurf_Surface.cxx b/src/DrawTrSurf/DrawTrSurf_Surface.cxx index b9901e649b..1f8d603a25 100644 --- a/src/DrawTrSurf/DrawTrSurf_Surface.cxx +++ b/src/DrawTrSurf/DrawTrSurf_Surface.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -33,13 +35,13 @@ Standard_Real DrawTrSurf_SurfaceLimit = 400; //purpose : //======================================================================= DrawTrSurf_Surface::DrawTrSurf_Surface (const Handle(Geom_Surface)& S) -: DrawTrSurf_Drawable (16, 0.01, 1) +: DrawTrSurf_Drawable (16, 0.01, 1), surf(S), nbUIsos(1), nbVIsos(1) { - surf = S; + boundsLook = Draw_jaune; isosLook = Draw_bleu; - nbUIsos = 1; - nbVIsos = 1; + + } //======================================================================= @@ -52,13 +54,13 @@ DrawTrSurf_Surface::DrawTrSurf_Surface const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode) -: DrawTrSurf_Drawable (Discret, Deflection, DrawMode) +: DrawTrSurf_Drawable (Discret, Deflection, DrawMode), surf(S), boundsLook(BoundsColor), isosLook(IsosColor), nbUIsos(Abs(Nu)), nbVIsos(Abs(Nv)) { - surf = S; - boundsLook = BoundsColor; - isosLook = IsosColor; - nbUIsos = Abs(Nu); - nbVIsos = Abs(Nv); + + + + + } //======================================================================= @@ -76,7 +78,7 @@ void DrawTrSurf_Surface::DrawOn (Draw_Display& dis) const //======================================================================= void DrawTrSurf_Surface::DrawOn (Draw_Display& dis, const Standard_Boolean Iso) const { - Standard_Real UFirst, ULast, VFirst, VLast; + Standard_Real UFirst = NAN, ULast = NAN, VFirst = NAN, VLast = NAN; surf->Bounds (UFirst, ULast, VFirst, VLast); Standard_Boolean UfirstInf = Precision::IsNegativeInfinite(UFirst); @@ -86,7 +88,7 @@ void DrawTrSurf_Surface::DrawOn (Draw_Display& dis, const Standard_Boolean Iso) if (UfirstInf || UlastInf) { gp_Pnt P1,P2; - Standard_Real v; + Standard_Real v = NAN; if (VfirstInf && VlastInf) v = 0; else if (VfirstInf) @@ -166,7 +168,7 @@ void DrawTrSurf_Surface::DrawOn (Draw_Display& dis, const Standard_Boolean Iso) if (Iso) { dis.SetColor(isosLook); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Standard_Real Du = (ULast - UFirst) / (nbUIsos + 1); Standard_Real U = UFirst; diff --git a/src/DrawTrSurf/DrawTrSurf_Triangulation.cxx b/src/DrawTrSurf/DrawTrSurf_Triangulation.cxx index 87885b04c8..1c387e4909 100644 --- a/src/DrawTrSurf/DrawTrSurf_Triangulation.cxx +++ b/src/DrawTrSurf/DrawTrSurf_Triangulation.cxx @@ -40,7 +40,7 @@ DrawTrSurf_Triangulation::DrawTrSurf_Triangulation (const Handle(Poly_Triangulat // Build the connect tool Poly_Connect pc(T); - Standard_Integer i,j,nFree, nInternal, nbTriangles = T->NbTriangles(); + Standard_Integer i = 0,j = 0,nFree = 0, nInternal = 0, nbTriangles = T->NbTriangles(); Standard_Integer t[3]; // count the free edges @@ -88,7 +88,7 @@ DrawTrSurf_Triangulation::DrawTrSurf_Triangulation (const Handle(Poly_Triangulat void DrawTrSurf_Triangulation::DrawOn (Draw_Display& dis) const { // Display the edges - Standard_Integer i,n; + Standard_Integer i = 0,n = 0; // free edges @@ -124,7 +124,7 @@ void DrawTrSurf_Triangulation::DrawOn (Draw_Display& dis) const if (myTriangles) { dis.SetColor(Draw_vert); n = myTriangulation->NbTriangles(); - Standard_Integer t[3],j; + Standard_Integer t[3],j = 0; for (i = 1; i <= n; i++) { myTriangulation->Triangle (i).Get (t[0],t[1],t[2]); gp_Pnt P(0,0,0); diff --git a/src/DrawTrSurf/DrawTrSurf_Triangulation2D.cxx b/src/DrawTrSurf/DrawTrSurf_Triangulation2D.cxx index 0fe1b7ea17..698d1e865d 100644 --- a/src/DrawTrSurf/DrawTrSurf_Triangulation2D.cxx +++ b/src/DrawTrSurf/DrawTrSurf_Triangulation2D.cxx @@ -43,7 +43,7 @@ DrawTrSurf_Triangulation2D::DrawTrSurf_Triangulation2D // Build the connect tool Poly_Connect pc(T); - Standard_Integer i,j,nFree, nInternal, nbTriangles = T->NbTriangles(); + Standard_Integer i = 0,j = 0,nFree = 0, nInternal = 0, nbTriangles = T->NbTriangles(); Standard_Integer t[3]; // count the free edges @@ -102,7 +102,7 @@ Handle(Poly_Triangulation) DrawTrSurf_Triangulation2D::Triangulation() const void DrawTrSurf_Triangulation2D::DrawOn(Draw_Display& dis) const { // Display the edges - Standard_Integer i,n; + Standard_Integer i = 0,n = 0; if (myTriangulation->HasUVNodes()) { // free edges diff --git a/src/DsgPrs/DsgPrs.cxx b/src/DsgPrs/DsgPrs.cxx index 63f4e5494e..6309b234b8 100644 --- a/src/DsgPrs/DsgPrs.cxx +++ b/src/DsgPrs/DsgPrs.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -226,14 +228,14 @@ void DsgPrs::ComputeCurvilinearFacesLengthPresentation( const Standard_Real Firs { GeomAPI_ProjectPointOnSurf ProjectorOnSurface; GeomAPI_ProjectPointOnCurve ProjectorOnCurve; - Standard_Real U1, V1, U2, V2; - Standard_Real LastU, LastV; + Standard_Real U1 = NAN, V1 = NAN, U2 = NAN, V2 = NAN; + Standard_Real LastU = NAN, LastV = NAN; Standard_Real SquareTolerance = Precision::SquareConfusion(); ProjectorOnSurface.Init( AttachmentPoint1, SecondSurf ); Standard_Integer Index(1); Standard_Real MinDist = RealLast(); - Standard_Real LocalU, LocalV; + Standard_Real LocalU = NAN, LocalV = NAN; gp_Vec D1U, D1V; gp_Dir LocalDir; for (Standard_Integer i = 1; i <= ProjectorOnSurface.NbPoints(); i++) @@ -585,7 +587,7 @@ Standard_Real DsgPrs::DistanceFromApex(const gp_Elips & elips, const gp_Pnt & Apex, const Standard_Real par) { - Standard_Real dist; + Standard_Real dist = NAN; Standard_Real parApex = ElCLib::Parameter ( elips, Apex ); if(parApex == 0.0 || parApex == M_PI) {//Major case diff --git a/src/DsgPrs/DsgPrs_AnglePresentation.cxx b/src/DsgPrs/DsgPrs_AnglePresentation.cxx index 1a8729bf6c..04d323f3ea 100644 --- a/src/DsgPrs/DsgPrs_AnglePresentation.cxx +++ b/src/DsgPrs/DsgPrs_AnglePresentation.cxx @@ -37,6 +37,7 @@ #include #include +#include #include //------------------------------------------------------------------------------------------------------------------ // Returns 1 if C is above of CMin; 0 if C is bitween CMin and CMax; -1 if C is Below CMax @@ -117,7 +118,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat GC_MakeCircle mkCirc(AttachmentPnt, OppositePnt, aPnt); gp_Circ aCircle2 = mkCirc.Value()->Circ(); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real AttParam = ElCLib::Parameter(aCircle2, AttachmentPnt); //must be equal to zero (look circle construction) Standard_Real OppParam = ElCLib::Parameter(aCircle2, OppositePnt); @@ -340,7 +341,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat aPresentation->CurrentGroup()->SetPrimitivesAspect( LA->LineAspect()->Aspect() ); gp_Circ AngleCirc, AttachCirc; - Standard_Real FirstParAngleCirc, LastParAngleCirc, FirstParAttachCirc, LastParAttachCirc; + Standard_Real FirstParAngleCirc = NAN, LastParAngleCirc = NAN, FirstParAttachCirc = NAN, LastParAttachCirc = NAN; gp_Pnt EndOfArrow1, EndOfArrow2, ProjAttachPoint2; gp_Dir DirOfArrow1, DirOfArrow2; DsgPrs::ComputeFacesAnglePresentation( LA->ArrowAspect()->Length(), diff --git a/src/DsgPrs/DsgPrs_ConcentricPresentation.cxx b/src/DsgPrs/DsgPrs_ConcentricPresentation.cxx index 5424082130..c16ef56b45 100644 --- a/src/DsgPrs/DsgPrs_ConcentricPresentation.cxx +++ b/src/DsgPrs/DsgPrs_ConcentricPresentation.cxx @@ -49,7 +49,7 @@ void DsgPrs_ConcentricPresentation::Add( aPrims->AddBound(nbp+1); aPrims->AddVertex(pt1); Standard_Real ucur = dteta; - Standard_Integer i ; + Standard_Integer i = 0 ; for (i = 2; i<=nbp; i++, ucur += dteta) aPrims->AddVertex(ElCLib::Value(ucur, Circ)); aPrims->AddVertex(pt1); diff --git a/src/DsgPrs/DsgPrs_DatumPrs.cxx b/src/DsgPrs/DsgPrs_DatumPrs.cxx index d40aee4ea3..05f19100be 100644 --- a/src/DsgPrs/DsgPrs_DatumPrs.cxx +++ b/src/DsgPrs/DsgPrs_DatumPrs.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -38,7 +40,7 @@ void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation, gp_Dir aYDir = anAxis.YDirection(); gp_Dir aZDir = anAxis.Direction(); - Standard_Real anAxisLength; + Standard_Real anAxisLength = NAN; const Standard_Boolean toDrawLabels = theDrawer->DatumAspect()->ToDrawLabels(); Prs3d_DatumAxes anAxes = aDatumAspect->DatumAxes(); diff --git a/src/DsgPrs/DsgPrs_DiameterPresentation.cxx b/src/DsgPrs/DsgPrs_DiameterPresentation.cxx index d6312314b2..4a18aa2dd3 100644 --- a/src/DsgPrs/DsgPrs_DiameterPresentation.cxx +++ b/src/DsgPrs/DsgPrs_DiameterPresentation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -101,7 +103,7 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar, return ((para >= fpar) && (para <= lpar)); else { // fpar > lpar Standard_Real delta = 2.*M_PI-fpar; - Standard_Real lp, par, fp; + Standard_Real lp = NAN, par = NAN, fp = NAN; lp = lpar + delta; par = para + delta; while(lp > 2*M_PI) lp-=2*M_PI; diff --git a/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx b/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx index c6a7281a60..a61b2dfd8a 100644 --- a/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx +++ b/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -64,7 +66,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )& // Two small lines in the middle of this line gp_Pnt Middle( (Middle12.XYZ() + Middle34.XYZ()) * 0.5 ), aTextPos; Standard_Real Dist = Middle12.Distance( Middle34 ); - Standard_Real SmallDist; + Standard_Real SmallDist = NAN; gp_Dir LineDir, OrtDir; gp_Vec LineVec, OrtVec; @@ -171,7 +173,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )& const Handle(Prs3d_DimensionAspect) LA = aDrawer->DimensionAspect(); aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect()); - Standard_Real aPar11, aPar12, aPar21, aPar22; + Standard_Real aPar11 = NAN, aPar12 = NAN, aPar21 = NAN, aPar22 = NAN; if(aCirc1.Radius() > Precision::Confusion()){ aPar11 = ElCLib::Parameter (aCirc1, aPoint1); aPar12 = ElCLib::Parameter(aCirc1, aPoint2); @@ -194,8 +196,8 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )& aPrims->AddVertex(aPoint4); aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims); - Standard_Integer i, aNodeNb; - Standard_Real aDelta, aCurPar; + Standard_Integer i = 0, aNodeNb = 0; + Standard_Real aDelta = NAN, aCurPar = NAN; if(aPar12 < aPar11 ) aPar12 += 2.*M_PI; if (Abs(aPar12 - aPar11) > Precision::Confusion()) { diff --git a/src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx b/src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx index 2d1e9825be..626d41d44e 100644 --- a/src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -57,7 +59,7 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP //ota === beging === gp_Pnt Middle( (FirstCenter.XYZ() + SecondCenter.XYZ()) *0.5 ), aTextPos; - Standard_Real SmallDist; + Standard_Real SmallDist = NAN; //Mark of constraint TCollection_ExtendedString aText("=="); diff --git a/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx b/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx index 2627f61395..bc321945fa 100644 --- a/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx @@ -31,6 +31,7 @@ #include #include +#include #include //======================================================================= //function : Add @@ -56,8 +57,8 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr char valcar[80]; sprintf(valcar,"%5.2f",theval); - Standard_Real FirstParCirc, LastParCirc; - Standard_Boolean SpecCase; + Standard_Real FirstParCirc = NAN, LastParCirc = NAN; + Standard_Boolean SpecCase = 0; gp_Dir DirOfArrow; gp_Circ FilletCirc; // gp_Pnt NewPosition, EndOfArrow; diff --git a/src/DsgPrs/DsgPrs_LengthPresentation.cxx b/src/DsgPrs/DsgPrs_LengthPresentation.cxx index 09e43f7c20..c04e23489e 100644 --- a/src/DsgPrs/DsgPrs_LengthPresentation.cxx +++ b/src/DsgPrs/DsgPrs_LengthPresentation.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -48,7 +50,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1); gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2); gp_Lin L3 = Proj1.IsEqual(Proj2,Precision::Confusion())? gp_Lin(Proj1,aDirection) : gce_MakeLin(Proj1,Proj2); - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3,Proj2); @@ -204,7 +206,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1); gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2); gp_Lin L3 = Proj1.IsEqual(Proj2,Precision::Confusion())? gp_Lin(Proj1,aDirection) : gce_MakeLin(Proj1,Proj2); - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3,Proj2); @@ -279,7 +281,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta gp_Pnt EndOfArrow2; gp_Dir DirOfArrow1; Handle( Geom_Curve ) VCurve, UCurve; - Standard_Real FirstU, deltaU = 0.0e0, FirstV, deltaV = 0.0e0; + Standard_Real FirstU = NAN, deltaU = 0.0e0, FirstV = NAN, deltaV = 0.0e0; DsgPrs::ComputeCurvilinearFacesLengthPresentation( LA->ArrowAspect()->Length(), LA->ArrowAspect()->Length(), @@ -322,8 +324,8 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta Prs3d_Text::Draw (aPresentation->CurrentGroup(), LA->TextAspect(), aText, OffsetPoint); // Two curves from end of Arrow2 to AttachmentPoint2 - Standard_Real Alpha, delta; - Standard_Integer NodeNumber; + Standard_Real Alpha = NAN, delta = NAN; + Standard_Integer NodeNumber = 0; Alpha = Abs( deltaU ); if (Alpha > Precision::Angular() && Alpha + #include #include @@ -62,7 +64,7 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta gp_Dir d4 (v4); L4 = gp_Lin(Proj1,d4); // normale } - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3,Proj2); diff --git a/src/DsgPrs/DsgPrs_ParalPresentation.cxx b/src/DsgPrs/DsgPrs_ParalPresentation.cxx index 1ca368be20..773ada23b2 100644 --- a/src/DsgPrs/DsgPrs_ParalPresentation.cxx +++ b/src/DsgPrs/DsgPrs_ParalPresentation.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -45,7 +47,7 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1); gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2); gp_Lin L3 = gce_MakeLin(Proj1,Proj2); - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3,Proj2); @@ -131,7 +133,7 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1); gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2); gp_Lin L3 = gce_MakeLin(Proj1,Proj2); - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3,Proj2); diff --git a/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx b/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx index 60071354e9..45203f3176 100644 --- a/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx +++ b/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -56,14 +58,14 @@ static Standard_Boolean FindPointOnFace(const TopoDS_Face& face, gp_Pnt2d& pt2d) return Standard_False; } - Standard_Integer npoints, nptt = 21; + Standard_Integer npoints = 0, nptt = 21; TColgp_Array1OfPnt2d points(1, nptt); Standard_Real area=0., xcent=0., ycent=0.; TopExp_Explorer edgeExp; for (edgeExp.Init(wireExp.Current(), TopAbs_EDGE); edgeExp.More(); edgeExp.Next()) { // discretize the 2d curve - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom2d_Curve) c2d = BRep_Tool::CurveOnSurface(TopoDS::Edge(edgeExp.Current()), face, first, last); if (TopoDS::Edge(edgeExp.Current()).Orientation() == TopAbs_REVERSED) { Standard_Real change = first; @@ -76,7 +78,7 @@ static Standard_Boolean FindPointOnFace(const TopoDS_Face& face, gp_Pnt2d& pt2d) c2d->D0(last, points(2)); } else { - Standard_Real deltaT, t; + Standard_Real deltaT = NAN, t = NAN; npoints = nptt; deltaT = (last - first) / (nptt-1); for (Standard_Integer i=1; i<=nptt; i++) { @@ -95,7 +97,7 @@ static Standard_Boolean FindPointOnFace(const TopoDS_Face& face, gp_Pnt2d& pt2d) // compute the contribution to the center of gravity - Standard_Real h, c, d; + Standard_Real h = NAN, c = NAN, d = NAN; for (Standard_Integer i=1; i<=npoints-1; i++) { h = 0.5*(points(i).Y() + points(i+1).Y()); @@ -135,7 +137,7 @@ static Standard_Boolean ComputeDir(const TopoDS_Shape& shape, gp_Pnt& pt, gp_Dir { TopLoc_Location loc; if (shape.ShapeType() == TopAbs_EDGE) { - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom_Curve) curv0 = BRep_Tool::Curve(TopoDS::Edge(shape), loc, first, last); Handle(Geom_Curve) curve = Handle(Geom_Curve)::DownCast(curv0->Copy()); curve->Transform(loc.Transformation()); @@ -150,7 +152,7 @@ static Standard_Boolean ComputeDir(const TopoDS_Shape& shape, gp_Pnt& pt, gp_Dir gp_Pnt2d pt2d; Handle(Geom_Surface) surface = BRep_Tool::Surface(TopoDS::Face(shape)); if (BRep_Tool::NaturalRestriction(TopoDS::Face(shape))) { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; surface->Bounds(u1, u2, v1, v2); pt2d.SetCoord((u1+u2)*0.5, (v1+v2)*0.5); } diff --git a/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx b/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx index d8d699143c..7cdd1e5013 100644 --- a/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx +++ b/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -58,7 +60,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese gp_Vec VL1(aDirection1); gp_Vec VLa(PjAttachPnt1,ProjOffsetPoint); - Standard_Real scal; + Standard_Real scal = NAN; scal = VL1.Dot(VLa); if (scal < 0) VL1.Reverse(); VL1.Multiply(h); @@ -85,7 +87,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese } gp_Lin L3 = gce_MakeLin(P1,P2); - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,P1); parmax = parmin; parcur = ElCLib::Parameter(L3,P2); @@ -108,7 +110,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese gp_Pnt PointMin = ElCLib::Value(parmin,L3); gp_Pnt PointMax = ElCLib::Value(parmax,L3); - Standard_Real X,Y,Z; + Standard_Real X = NAN,Y = NAN,Z = NAN; Standard_Real D1(aAxis.Distance(AttachmentPoint1)),coeff(.5); gp_Pnt pint,Pj_P1,P1Previous = P1; @@ -143,7 +145,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese ===================================*/ gp_Vec Vfix; - Standard_Real alpha,b; + Standard_Real alpha = NAN,b = NAN; if(aAxis.Distance(P1) > D1*(1 + coeff) && !Cross){ @@ -441,7 +443,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese gp_Vec Vp(ProjCenter1,Center1); if (Vp.Magnitude() <= Precision::Confusion()) Vp = gp_Vec(aAxis.Direction())^aCircle1.Position().Direction(); - Standard_Real Dt,R,h; + Standard_Real Dt = NAN,R = NAN,h = NAN; Dt = ProjCenter1.Distance(ProjOffsetPoint); R = aCircle1.Radius(); if (Dt > .999*R) { @@ -456,7 +458,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese gp_Pnt P2 = ProjOffsetPoint.Translated(v); gp_Lin L3 = gce_MakeLin(P1,P2); - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,P1); parmax = parmin; parcur = ElCLib::Parameter(L3,P2); @@ -487,7 +489,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese Standard_Integer nbp = 10; Standard_Real ParamP1 = ElCLib::Parameter(aCircle1,P1); Standard_Real ParamPAttach1 = ElCLib::Parameter(aCircle1,AttachmentPoint1); - Standard_Real alpha,Dalpha,alphaIter; + Standard_Real alpha = NAN,Dalpha = NAN,alphaIter = NAN; alpha = fabs(ParamP1 - ParamPAttach1); if(ParamP1 < ParamPAttach1){ @@ -517,7 +519,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese aPrims->AddVertex(AttachmentPoint1); alphaIter = Dalpha; gp_Pnt PntIter; - Standard_Integer i; + Standard_Integer i = 0; for(i = 2; i <= nbp; i++, alphaIter += Dalpha) aPrims->AddVertex(ElCLib::Value(ParamPAttach1 + alphaIter,aCircle1)); aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims); @@ -741,7 +743,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese gp_Pnt P2 = ProjOffsetPoint.Translated(PjAtt1_Att1.Reversed()); gp_Lin L3 = gce_MakeLin(P1,P2); - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,P1); parmax = parmin; parcur = ElCLib::Parameter(L3,P2); diff --git a/src/ElSLib/ElSLib.cxx b/src/ElSLib/ElSLib.cxx index f13c9243f6..9471da4e00 100644 --- a/src/ElSLib/ElSLib.cxx +++ b/src/ElSLib/ElSLib.cxx @@ -22,6 +22,8 @@ #endif +#include + #include #include #include @@ -233,7 +235,7 @@ gp_Vec ElSLib::SphereDN (const Standard_Real U, const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); const gp_XYZ& ZDir = Pos.Direction ().XYZ(); - Standard_Real A1,A2,A3,X,Y,Z; + Standard_Real A1 = NAN,A2 = NAN,A3 = NAN,X = NAN,Y = NAN,Z = NAN; if (Nu == 0) { Standard_Real RSinV = Radius * sin(V); if (IsOdd (Nv)) { A1 = - RSinV * CosU; A2 = - RSinV * SinU; A3 = RCosV; } @@ -285,7 +287,7 @@ gp_Vec ElSLib::TorusDN (const Standard_Real U, const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); const gp_XYZ& ZDir = Pos.Direction ().XYZ(); - Standard_Real A1,A2,A3,X=0,Y=0,Z=0; + Standard_Real A1 = NAN,A2 = NAN,A3 = NAN,X=0,Y=0,Z=0; // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin Standard_Real eps = 10.*(MinorRadius + MajorRadius)*RealEpsilon(); // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 End @@ -1415,7 +1417,7 @@ void ElSLib::SphereParameters(const gp_Ax3& Pos, gp_Trsf T; T.SetTransformation (Pos); gp_Pnt Ploc = P.Transformed (T); - Standard_Real x, y, z; + Standard_Real x = NAN, y = NAN, z = NAN; Ploc.Coord (x, y, z); Standard_Real l = sqrt (x * x + y * y); if (l < gp::Resolution()) { // point on axis Z of the sphere @@ -1448,7 +1450,7 @@ void ElSLib::TorusParameters(const gp_Ax3& Pos, gp_Trsf Tref; Tref.SetTransformation (Pos); gp_Pnt Ploc = P.Transformed (Tref); - Standard_Real x, y, z; + Standard_Real x = NAN, y = NAN, z = NAN; Ploc.Coord (x, y, z); // all that to process case of Major < Minor. diff --git a/src/ExpToCasExe/ExpToCasExe.cxx b/src/ExpToCasExe/ExpToCasExe.cxx index c0b25eeab1..1098de42bd 100644 --- a/src/ExpToCasExe/ExpToCasExe.cxx +++ b/src/ExpToCasExe/ExpToCasExe.cxx @@ -67,12 +67,12 @@ static Standard_Boolean LoadList (const char *theFileName, while (anIS.getline (aBuf, 512)) { char* aCurPos = aBuf; - char* anItemName; - char* aPackageName; - char* aShortName; - char* aCheckFlag; - char* aFillSharedFlag; - char* aCategoryName; + char* anItemName = nullptr; + char* aPackageName = nullptr; + char* aShortName = nullptr; + char* aCheckFlag = nullptr; + char* aFillSharedFlag = nullptr; + char* aCategoryName = nullptr; Standard_Size aSepIdx = 0; aLineNum += 1; // ------------------------------------------------------------- @@ -358,7 +358,7 @@ Standard_Integer main (const Standard_Integer argc, const char* argv[]) Standard_Integer anIndex = -1; if (argc > 4) { - char* aStopSymbol; + char* aStopSymbol = nullptr; anIndex = (Standard_Integer) strtol (argv[4], &aStopSymbol, 10); if (*aStopSymbol != '\0') { diff --git a/src/ExpToCasExe/exptocas.tab.cxx b/src/ExpToCasExe/exptocas.tab.cxx index f213ed2006..c558716cb4 100644 --- a/src/ExpToCasExe/exptocas.tab.cxx +++ b/src/ExpToCasExe/exptocas.tab.cxx @@ -231,7 +231,7 @@ namespace exptocas { template parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v) : Base (t) - , value (YY_MOVE (v)) + , value (v) {} template @@ -262,8 +262,7 @@ namespace exptocas { {} #if 201103L <= YY_CPLUSPLUS - parser::by_kind::by_kind (by_kind&& that) - : kind_ (that.kind_) + parser::by_kind::by_kind (by_kind&& that) noexcept : kind_ (that.kind_) { that.clear (); } @@ -341,8 +340,7 @@ namespace exptocas { parser::stack_symbol_type::stack_symbol_type () {} - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.value)) + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) noexcept : super_type (that.state, YY_MOVE (that.value)) { #if 201103L <= YY_CPLUSPLUS // that is emptied. @@ -491,7 +489,7 @@ namespace exptocas { int parser::parse () { - int yyn; + int yyn = 0; /// Length of the RHS of the rule being reduced. int yylen = 0; @@ -503,7 +501,7 @@ namespace exptocas { symbol_type yyla; /// The return value of parse (). - int yyresult; + int yyresult = 0; #if YY_EXCEPTIONS try @@ -935,7 +933,7 @@ namespace exptocas { { ++yynerrs_; std::string msg = YY_("syntax error"); - error (YY_MOVE (msg)); + error (msg); } diff --git a/src/ExpToCasExe/exptocas.tab.hxx b/src/ExpToCasExe/exptocas.tab.hxx index 039b4bb374..16b4e29dc4 100644 --- a/src/ExpToCasExe/exptocas.tab.hxx +++ b/src/ExpToCasExe/exptocas.tab.hxx @@ -481,7 +481,7 @@ namespace exptocas { #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) noexcept; #endif /// Copy constructor. @@ -710,7 +710,7 @@ namespace exptocas { /// Construct an empty symbol. stack_symbol_type (); /// Move or copy construction. - stack_symbol_type (YY_RVREF (stack_symbol_type) that); + stack_symbol_type (YY_RVREF (stack_symbol_type) that) noexcept; /// Steal the contents from \a sym to build this. stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); #if YY_CPLUSPLUS < 201103L diff --git a/src/ExpToCasExe/lex.exptocas.cxx b/src/ExpToCasExe/lex.exptocas.cxx index 59c0574de6..15d086f102 100644 --- a/src/ExpToCasExe/lex.exptocas.cxx +++ b/src/ExpToCasExe/lex.exptocas.cxx @@ -811,9 +811,9 @@ static int yy_flex_strlen ( const char * ); */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + yy_state_type yy_current_state = 0; + char *yy_cp = nullptr, *yy_bp = nullptr; + int yy_act = 0; if ( !(yy_init) ) { @@ -1165,7 +1165,7 @@ case YY_STATE_EOF(FUN): */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ - yy_state_type yy_next_state; + yy_state_type yy_next_state = 0; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; @@ -1392,8 +1392,8 @@ int yyFlexLexer::yy_get_next_buffer() { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; + int number_to_move = 0, i = 0; + int ret_val = 0; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( @@ -1528,8 +1528,8 @@ int yyFlexLexer::yy_get_next_buffer() yy_state_type yyFlexLexer::yy_get_previous_state() { - yy_state_type yy_current_state; - char *yy_cp; + yy_state_type yy_current_state = 0; + char *yy_cp = nullptr; yy_current_state = (yy_start); @@ -1560,7 +1560,7 @@ int yyFlexLexer::yy_get_next_buffer() */ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) { - int yy_is_jam; + int yy_is_jam = 0; char *yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; @@ -1584,7 +1584,7 @@ int yyFlexLexer::yy_get_next_buffer() #ifndef YY_NO_UNPUT void yyFlexLexer::yyunput( int c, char* yy_bp) { - char *yy_cp; + char *yy_cp = nullptr; yy_cp = (yy_c_buf_p); @@ -1622,7 +1622,7 @@ int yyFlexLexer::yy_get_next_buffer() int yyFlexLexer::yyinput() { - int c; + int c = 0; *(yy_c_buf_p) = (yy_hold_char); @@ -1769,7 +1769,7 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) */ YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream& file, int size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b = nullptr; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) @@ -1932,7 +1932,7 @@ void yyFlexLexer::yypop_buffer_state (void) */ void yyFlexLexer::yyensure_buffer_stack(void) { - yy_size_t num_to_alloc; + yy_size_t num_to_alloc = 0; if (!(yy_buffer_stack)) { @@ -1977,7 +1977,7 @@ void yyFlexLexer::yyensure_buffer_stack(void) { if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) { - yy_size_t new_size; + yy_size_t new_size = 0; (yy_start_stack_depth) += YY_START_STACK_INCR; new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); diff --git a/src/Expr/Expr_FunctionDerivative.cxx b/src/Expr/Expr_FunctionDerivative.cxx index 93c8fa3d1b..fcfcc9fcf6 100644 --- a/src/Expr/Expr_FunctionDerivative.cxx +++ b/src/Expr/Expr_FunctionDerivative.cxx @@ -26,10 +26,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Expr_FunctionDerivative,Expr_GeneralFunction) -Expr_FunctionDerivative::Expr_FunctionDerivative (const Handle(Expr_GeneralFunction)& func, const Handle(Expr_NamedUnknown)& withX, const Standard_Integer deg) +Expr_FunctionDerivative::Expr_FunctionDerivative (const Handle(Expr_GeneralFunction)& func, const Handle(Expr_NamedUnknown)& withX, const Standard_Integer deg) : myFunction(func), myDerivate(withX) { - myFunction = func; - myDerivate = withX; + + if (deg <= 0) { throw Standard_OutOfRange(); } diff --git a/src/Expr/Expr_NamedConstant.cxx b/src/Expr/Expr_NamedConstant.cxx index ee3631c1d7..59e505be74 100644 --- a/src/Expr/Expr_NamedConstant.cxx +++ b/src/Expr/Expr_NamedConstant.cxx @@ -25,10 +25,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Expr_NamedConstant,Expr_NamedExpression) -Expr_NamedConstant::Expr_NamedConstant(const TCollection_AsciiString& name, const Standard_Real value) +Expr_NamedConstant::Expr_NamedConstant(const TCollection_AsciiString& name, const Standard_Real value) : myValue(value) { SetName(name); - myValue = value; + } const Handle(Expr_GeneralExpression)& Expr_NamedConstant::SubExpression (const Standard_Integer ) const diff --git a/src/Expr/Expr_NamedExpression.cxx b/src/Expr/Expr_NamedExpression.cxx index 7cb228e5b4..33831e531a 100644 --- a/src/Expr/Expr_NamedExpression.cxx +++ b/src/Expr/Expr_NamedExpression.cxx @@ -66,7 +66,7 @@ Standard_Boolean Expr_NamedExpression::IsIdentical //AGV 22.03.12: Comparison should be based on names rather than Handles const Expr_NamedExpression* pOther = - static_cast(theOther.get()); + dynamic_cast(theOther.get()); if (pOther == this || pOther->GetName().IsEqual(myName)) aResult = Standard_True; } diff --git a/src/Expr/Expr_NamedFunction.cxx b/src/Expr/Expr_NamedFunction.cxx index 4520d90fd2..8b3ba9ebda 100644 --- a/src/Expr/Expr_NamedFunction.cxx +++ b/src/Expr/Expr_NamedFunction.cxx @@ -28,12 +28,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Expr_NamedFunction,Expr_GeneralFunction) Expr_NamedFunction::Expr_NamedFunction (const TCollection_AsciiString& name, const Handle(Expr_GeneralExpression)& exp, const Expr_Array1OfNamedUnknown& vars) : - myVariables(vars.Lower(),vars.Upper()) -{ - myVariables=vars; - myName = name; - myExp = exp; -} + myName(name), myExp(exp), myVariables(vars) +{} void Expr_NamedFunction::SetName(const TCollection_AsciiString& newname) { diff --git a/src/Expr/Expr_NumericValue.cxx b/src/Expr/Expr_NumericValue.cxx index 43c9f5f8c6..417227aefd 100644 --- a/src/Expr/Expr_NumericValue.cxx +++ b/src/Expr/Expr_NumericValue.cxx @@ -25,9 +25,9 @@ #include IMPLEMENT_STANDARD_RTTIEXT(Expr_NumericValue,Expr_GeneralExpression) -Expr_NumericValue::Expr_NumericValue(const Standard_Real val) +Expr_NumericValue::Expr_NumericValue(const Standard_Real val) : myValue(val) { - myValue = val; + } Standard_Real Expr_NumericValue::GetValue() const diff --git a/src/Expr/Expr_PolyExpression.cxx b/src/Expr/Expr_PolyExpression.cxx index 96fd1d7e9c..05ed00e20d 100644 --- a/src/Expr/Expr_PolyExpression.cxx +++ b/src/Expr/Expr_PolyExpression.cxx @@ -112,7 +112,7 @@ Standard_Boolean Expr_PolyExpression::Contains (const Handle(Expr_GeneralExpress void Expr_PolyExpression::Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with) { Standard_Integer nbop = NbOperands(); - Standard_Integer i; + Standard_Integer i = 0; Handle(Expr_GeneralExpression) expop; for(i=1;i <= nbop; i++) { @@ -132,7 +132,7 @@ void Expr_PolyExpression::Replace (const Handle(Expr_NamedUnknown)& var, const H Handle(Expr_GeneralExpression) Expr_PolyExpression::Simplified() const { Handle(Expr_PolyExpression) cop = Handle(Expr_PolyExpression)::DownCast(Copy()); - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = cop->NbOperands(); Handle(Expr_GeneralExpression) op; for (i=1; i<= max; i++) { diff --git a/src/Expr/Expr_PolyFunction.cxx b/src/Expr/Expr_PolyFunction.cxx index 68fc1f996d..68e1448297 100644 --- a/src/Expr/Expr_PolyFunction.cxx +++ b/src/Expr/Expr_PolyFunction.cxx @@ -52,7 +52,7 @@ Handle(Expr_GeneralExpression) Expr_PolyFunction::ShallowSimplified () const { Standard_Boolean allval = Standard_True; Standard_Integer max = NbSubExpressions(); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; (i <= max) && allval ; i++) { allval = SubExpression(i)->IsKind(STANDARD_TYPE(Expr_NumericValue)); } diff --git a/src/Expr/Expr_Product.cxx b/src/Expr/Expr_Product.cxx index 547c79e0b9..5b12711b0a 100644 --- a/src/Expr/Expr_Product.cxx +++ b/src/Expr/Expr_Product.cxx @@ -34,7 +34,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Expr_Product,Expr_PolyExpression) Expr_Product::Expr_Product (const Expr_SequenceOfGeneralExpression& exps) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = exps.Length(); for (i=1; i<= max; i++) { AddOperand(exps(i)); @@ -49,7 +49,7 @@ Expr_Product::Expr_Product (const Handle(Expr_GeneralExpression)& exp1, const Ha Handle(Expr_GeneralExpression) Expr_Product::Copy () const { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = NbOperands(); Expr_SequenceOfGeneralExpression simps; for (i=1; i<= max; i++) { @@ -98,7 +98,7 @@ Standard_Boolean Expr_Product::IsIdentical (const Handle(Expr_GeneralExpression) Standard_Boolean Expr_Product::IsLinear () const { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = NbOperands(); Standard_Boolean lin = Standard_True; Standard_Boolean res = Standard_True; @@ -154,7 +154,7 @@ Handle(Expr_GeneralExpression) Expr_Product::Derivative (const Handle(Expr_Named Handle(Expr_GeneralExpression) Expr_Product::ShallowSimplified () const { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = NbOperands(); Handle(Expr_GeneralExpression) op; Expr_SequenceOfGeneralExpression newops; @@ -168,7 +168,7 @@ Handle(Expr_GeneralExpression) Expr_Product::ShallowSimplified () const if (subprod) { Handle(Expr_GeneralExpression) other; Handle(Expr_Product) prodop; - Standard_Integer nbsprodop; + Standard_Integer nbsprodop = 0; for (i=1; i<= max; i++) { op = Operand(i); if (op->IsKind(STANDARD_TYPE(Expr_Product))) { diff --git a/src/Expr/Expr_RUIterator.cxx b/src/Expr/Expr_RUIterator.cxx index 36b1d3eed7..1cb6a904c5 100644 --- a/src/Expr/Expr_RUIterator.cxx +++ b/src/Expr/Expr_RUIterator.cxx @@ -22,12 +22,12 @@ #include #include -Expr_RUIterator::Expr_RUIterator (const Handle(Expr_GeneralRelation)& rel) +Expr_RUIterator::Expr_RUIterator (const Handle(Expr_GeneralRelation)& rel) : myCurrent(1) { Expr_RelationIterator ri(rel); Handle(Expr_SingleRelation) srel; Handle(Expr_NamedUnknown) var; - myCurrent =1; + while (ri.More()) { srel = ri.Value(); ri.Next(); diff --git a/src/Expr/Expr_Sum.cxx b/src/Expr/Expr_Sum.cxx index 681634495b..2934eef2c5 100644 --- a/src/Expr/Expr_Sum.cxx +++ b/src/Expr/Expr_Sum.cxx @@ -34,7 +34,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Expr_Sum,Expr_PolyExpression) Expr_Sum::Expr_Sum (const Expr_SequenceOfGeneralExpression& exps) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = exps.Length(); for (i=1; i<= max; i++) { AddOperand(exps(i)); @@ -50,7 +50,7 @@ Expr_Sum::Expr_Sum (const Handle(Expr_GeneralExpression)& exp1, const Handle(Exp Handle(Expr_GeneralExpression) Expr_Sum::Copy () const { Expr_SequenceOfGeneralExpression ops; - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = NbOperands(); for (i=1; i <= max; i++) { ops.Append(Expr::CopyShare(Operand(i))); @@ -111,7 +111,7 @@ Standard_Boolean Expr_Sum::IsLinear () const Handle(Expr_GeneralExpression) Expr_Sum::Derivative (const Handle(Expr_NamedUnknown)& X) const { Expr_SequenceOfGeneralExpression opsder; - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = NbOperands(); for (i=1; i<= max; i++) { opsder.Append(Operand(i)->Derivative(X)); @@ -126,7 +126,7 @@ Handle(Expr_GeneralExpression) Expr_Sum::NDerivative (const Handle(Expr_NamedUnk throw Standard_OutOfRange(); } Expr_SequenceOfGeneralExpression opsder; - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = NbOperands(); for (i=1; i<= max; i++) { opsder.Append(Operand(i)->NDerivative(X,N)); @@ -137,7 +137,7 @@ Handle(Expr_GeneralExpression) Expr_Sum::NDerivative (const Handle(Expr_NamedUnk Handle(Expr_GeneralExpression) Expr_Sum::ShallowSimplified () const { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer max = NbOperands(); Standard_Integer nbvals =0; Handle(Expr_GeneralExpression) op; @@ -150,7 +150,7 @@ Handle(Expr_GeneralExpression) Expr_Sum::ShallowSimplified () const if (subsum) { Handle(Expr_GeneralExpression) other; Handle(Expr_Sum) sumop; - Standard_Integer nbssumop; + Standard_Integer nbssumop = 0; for (i=1; i<= max; i++) { op = Operand(i); if (op->IsKind(STANDARD_TYPE(Expr_Sum))) { diff --git a/src/Expr/Expr_UnknownIterator.cxx b/src/Expr/Expr_UnknownIterator.cxx index d66cbce9e4..ae06827ff4 100644 --- a/src/Expr/Expr_UnknownIterator.cxx +++ b/src/Expr/Expr_UnknownIterator.cxx @@ -19,10 +19,10 @@ #include #include -Expr_UnknownIterator::Expr_UnknownIterator (const Handle(Expr_GeneralExpression)& exp) +Expr_UnknownIterator::Expr_UnknownIterator (const Handle(Expr_GeneralExpression)& exp) : myCurrent(1) { Perform(exp); - myCurrent = 1; + } void Expr_UnknownIterator::Perform(const Handle(Expr_GeneralExpression)& exp) diff --git a/src/ExprIntrp/ExprIntrp_GenExp.cxx b/src/ExprIntrp/ExprIntrp_GenExp.cxx index c747a1ef90..02bd57970c 100644 --- a/src/ExprIntrp/ExprIntrp_GenExp.cxx +++ b/src/ExprIntrp/ExprIntrp_GenExp.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ExprIntrp_GenExp,ExprIntrp_Generator) -ExprIntrp_GenExp::ExprIntrp_GenExp () +ExprIntrp_GenExp::ExprIntrp_GenExp () : done(Standard_False) { - done = Standard_False; + } Handle( ExprIntrp_GenExp ) ExprIntrp_GenExp::Create() diff --git a/src/ExprIntrp/ExprIntrp_GenFct.cxx b/src/ExprIntrp/ExprIntrp_GenFct.cxx index 410482294f..6c2b86d62c 100644 --- a/src/ExprIntrp/ExprIntrp_GenFct.cxx +++ b/src/ExprIntrp/ExprIntrp_GenFct.cxx @@ -23,9 +23,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ExprIntrp_GenFct,ExprIntrp_Generator) -ExprIntrp_GenFct::ExprIntrp_GenFct () +ExprIntrp_GenFct::ExprIntrp_GenFct () : done(Standard_False) { - done = Standard_False; + } Handle( ExprIntrp_GenFct ) ExprIntrp_GenFct::Create() diff --git a/src/ExprIntrp/ExprIntrp_GenRel.cxx b/src/ExprIntrp/ExprIntrp_GenRel.cxx index 5a207ecde3..fd872ba68c 100644 --- a/src/ExprIntrp/ExprIntrp_GenRel.cxx +++ b/src/ExprIntrp/ExprIntrp_GenRel.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ExprIntrp_GenRel,ExprIntrp_Generator) -ExprIntrp_GenRel::ExprIntrp_GenRel () +ExprIntrp_GenRel::ExprIntrp_GenRel () : done(Standard_False) { - done = Standard_False; + } Handle( ExprIntrp_GenRel ) ExprIntrp_GenRel::Create() diff --git a/src/ExprIntrp/ExprIntrp_yaccintrf.cxx b/src/ExprIntrp/ExprIntrp_yaccintrf.cxx index 2511894316..cbc005c16f 100644 --- a/src/ExprIntrp/ExprIntrp_yaccintrf.cxx +++ b/src/ExprIntrp/ExprIntrp_yaccintrf.cxx @@ -71,7 +71,7 @@ extern "C" void ExprIntrp_StartDerivate() extern "C" void ExprIntrp_EndDerivate() { - int degree; + int degree = 0; degree = ExprIntrp_GetDegree(); ExprIntrp_Recept.PushValue(degree); } @@ -156,7 +156,7 @@ extern "C" void ExprIntrp_EndDifferential() if (thefunc.IsNull()) { throw ExprIntrp_SyntaxError(); } - Standard_Integer rank,degree; + Standard_Integer rank = 0,degree = 0; Handle(Expr_NamedUnknown) thediff; Standard_Integer nbvars = thefunc->NbOfVariables(); @@ -548,7 +548,7 @@ extern "C" void ExprIntrp_EndOfFuncDef() Standard_Integer nbargs = ExprIntrp_Recept.PopValue(); Expr_Array1OfNamedUnknown vars(1,nbargs); Expr_Array1OfNamedUnknown internvars(1,nbargs); - Standard_Integer i; + Standard_Integer i = 0; for (i=nbargs; i > 0; i--) { vars(i) = Handle(Expr_NamedUnknown)::DownCast(ExprIntrp_Recept.Pop()); internvars(i) = Handle(Expr_NamedUnknown)::DownCast(vars(i)->Copy()); diff --git a/src/Express/Express_ComplexType.cxx b/src/Express/Express_ComplexType.cxx index db93859444..2657371a54 100644 --- a/src/Express/Express_ComplexType.cxx +++ b/src/Express/Express_ComplexType.cxx @@ -26,11 +26,11 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_ComplexType, Express_Type) Express_ComplexType::Express_ComplexType (const Standard_Integer theImin, const Standard_Integer theImax, - const Handle(Express_Type)& theType) + const Handle(Express_Type)& theType) : myMin(theImin), myMax(theImax), myType(theType) { - myMin = theImin; - myMax = theImax; - myType = theType; + + + } //======================================================================= diff --git a/src/Express/Express_Entity.cxx b/src/Express/Express_Entity.cxx index 96a3bfcc5a..b94115f9ed 100644 --- a/src/Express/Express_Entity.cxx +++ b/src/Express/Express_Entity.cxx @@ -47,10 +47,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Entity, Express_Item) Express_Entity::Express_Entity (const Standard_CString theName, const Handle(TColStd_HSequenceOfHAsciiString)& theInherit, const Handle(Express_HSequenceOfField)& theFields) -: Express_Item (theName), mySupers (theInherit), myFields (theFields) +: Express_Item (theName), mySupers (theInherit), myInherit(new Express_HSequenceOfEntity), myFields (theFields) { // make empty lists to avoid checking every time - myInherit = new Express_HSequenceOfEntity; + if (mySupers.IsNull()) { mySupers = new TColStd_HSequenceOfHAsciiString; diff --git a/src/Express/Express_Field.cxx b/src/Express/Express_Field.cxx index b8b2204dac..c691f9df84 100644 --- a/src/Express/Express_Field.cxx +++ b/src/Express/Express_Field.cxx @@ -27,11 +27,11 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Field, Standard_Transient) Express_Field::Express_Field (const Standard_CString theName, const Handle(Express_Type)& theType, - const Standard_Boolean theOpt) + const Standard_Boolean theOpt) : myName(new TCollection_HAsciiString (theName)), myType(theType), myOpt(theOpt) { - myName = new TCollection_HAsciiString (theName); - myType = theType; - myOpt = theOpt; + + + } //======================================================================= @@ -41,11 +41,11 @@ Express_Field::Express_Field (const Standard_CString theName, Express_Field::Express_Field (const Handle(TCollection_HAsciiString)& theName, const Handle(Express_Type)& theType, - const Standard_Boolean theOpt) + const Standard_Boolean theOpt) : myName(theName), myType(theType), myOpt(theOpt) { - myName = theName; - myType = theType; - myOpt = theOpt; + + + } //======================================================================= diff --git a/src/Express/Express_Item.cxx b/src/Express/Express_Item.cxx index 2e78e9e172..75feb4b100 100644 --- a/src/Express/Express_Item.cxx +++ b/src/Express/Express_Item.cxx @@ -28,15 +28,15 @@ Standard_Integer Express_Item::myIndex = -1; // purpose : //======================================================================= -Express_Item::Express_Item (const Standard_CString theName) +Express_Item::Express_Item (const Standard_CString theName) : myName(new TCollection_HAsciiString (theName)), myGenMode(GM_Undefined), myShortName(new TCollection_HAsciiString), myCategory(new TCollection_HAsciiString), myhasCheck(Standard_False), myhasFillShared(Standard_False), myLoopFlag(Standard_False) { - myName = new TCollection_HAsciiString (theName); - myGenMode = GM_Undefined; - myShortName = new TCollection_HAsciiString; - myCategory = new TCollection_HAsciiString; - myhasCheck = Standard_False; - myhasFillShared = Standard_False; - myLoopFlag = Standard_False; + + + + + + + } //======================================================================= @@ -44,15 +44,15 @@ Express_Item::Express_Item (const Standard_CString theName) // purpose : //======================================================================= -Express_Item::Express_Item (const Handle(TCollection_HAsciiString)& theName) +Express_Item::Express_Item (const Handle(TCollection_HAsciiString)& theName) : myName(theName), myGenMode(GM_Undefined), myShortName(new TCollection_HAsciiString), myCategory(new TCollection_HAsciiString), myhasCheck(Standard_False), myhasFillShared(Standard_False), myLoopFlag(Standard_False) { - myName = theName; - myGenMode = GM_Undefined; - myShortName = new TCollection_HAsciiString; - myCategory = new TCollection_HAsciiString; - myhasCheck = Standard_False; - myhasFillShared = Standard_False; - myLoopFlag = Standard_False; + + + + + + + } //======================================================================= diff --git a/src/Express/Express_NamedType.cxx b/src/Express/Express_NamedType.cxx index fc86d5a71e..639c9928d4 100644 --- a/src/Express/Express_NamedType.cxx +++ b/src/Express/Express_NamedType.cxx @@ -28,9 +28,9 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_NamedType, Express_Type) // purpose : //======================================================================= -Express_NamedType::Express_NamedType (const Standard_CString theName) +Express_NamedType::Express_NamedType (const Standard_CString theName) : myName(new TCollection_HAsciiString (theName)) { - myName = new TCollection_HAsciiString (theName); + } //======================================================================= @@ -38,9 +38,9 @@ Express_NamedType::Express_NamedType (const Standard_CString theName) // purpose : //======================================================================= -Express_NamedType::Express_NamedType (const Handle(TCollection_HAsciiString)& theName) +Express_NamedType::Express_NamedType (const Handle(TCollection_HAsciiString)& theName) : myName(theName) { - myName = theName; + } //======================================================================= diff --git a/src/Express/Express_Reference.cxx b/src/Express/Express_Reference.cxx index 9620cd8c0f..54af67bded 100644 --- a/src/Express/Express_Reference.cxx +++ b/src/Express/Express_Reference.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Reference, Express_Item) Express_Reference::Express_Reference (const Standard_CString theName, const Handle(TColStd_HSequenceOfHAsciiString)& theTypes) -: Express_Item (theName) +: Express_Item (theName), myTypes(theTypes) { - myTypes = theTypes; + } //======================================================================= diff --git a/src/Express/Express_Schema.cxx b/src/Express/Express_Schema.cxx index ae08c4e2a0..053ba2b3c3 100644 --- a/src/Express/Express_Schema.cxx +++ b/src/Express/Express_Schema.cxx @@ -35,10 +35,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Schema, Standard_Transient) //======================================================================= Express_Schema::Express_Schema (const Standard_CString theName, - const Handle(Express_HSequenceOfItem)& theItems) + const Handle(Express_HSequenceOfItem)& theItems) : myName(new TCollection_HAsciiString (theName)), myItems(theItems) { - myName = new TCollection_HAsciiString (theName); - myItems = theItems; + + Prepare(); } @@ -48,10 +48,10 @@ Express_Schema::Express_Schema (const Standard_CString theName, //======================================================================= Express_Schema::Express_Schema (const Handle(TCollection_HAsciiString)& theName, - const Handle(Express_HSequenceOfItem)& theItems) + const Handle(Express_HSequenceOfItem)& theItems) : myName(theName), myItems(theItems) { - myName = theName; - myItems = theItems; + + Prepare(); } diff --git a/src/Express/Express_Select.cxx b/src/Express/Express_Select.cxx index bcfa50e761..58f5d70f9a 100644 --- a/src/Express/Express_Select.cxx +++ b/src/Express/Express_Select.cxx @@ -38,9 +38,9 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Select, Express_Item) Express_Select::Express_Select ( const Standard_CString theName, const Handle(TColStd_HSequenceOfHAsciiString)& theNames) -: Express_Item (theName), myNames (theNames) +: Express_Item (theName), myNames (theNames), myItems(new Express_HSequenceOfItem) { - myItems = new Express_HSequenceOfItem; + } //======================================================================= diff --git a/src/Extrema/Extrema_Curve2dTool.cxx b/src/Extrema/Extrema_Curve2dTool.cxx index aae64823bd..1eaa2cfe5c 100644 --- a/src/Extrema/Extrema_Curve2dTool.cxx +++ b/src/Extrema/Extrema_Curve2dTool.cxx @@ -31,7 +31,7 @@ Handle(TColStd_HArray1OfReal) const Standard_Real maxdefl = 1.e3; const Standard_Real mindefl = 1.e-3; Handle(TColStd_HArray1OfReal) Intervals; - Standard_Integer nbpnts = 23, i; + Standard_Integer nbpnts = 23, i = 0; Standard_Real L = 0.; Standard_Real tf = C.FirstParameter(), tl = C.LastParameter(); gp_Pnt2d aP = C.Value(tf); diff --git a/src/Extrema/Extrema_CurveTool.cxx b/src/Extrema/Extrema_CurveTool.cxx index 0f3dd23a02..a3f87b0a23 100644 --- a/src/Extrema/Extrema_CurveTool.cxx +++ b/src/Extrema/Extrema_CurveTool.cxx @@ -47,7 +47,7 @@ Extrema_CurveTool::DeflCurvIntervals(const Adaptor3d_Curve& C) const Standard_Real maxdefl = 1.e3; const Standard_Real mindefl = 1.e-3; Handle(TColStd_HArray1OfReal) Intervals; - Standard_Integer nbpnts = 23, i; + Standard_Integer nbpnts = 23, i = 0; Standard_Real L = 0.; Standard_Real tf = C.FirstParameter(), tl = C.LastParameter(); gp_Pnt aP = C.Value(tf); diff --git a/src/Extrema/Extrema_ExtCC.cxx b/src/Extrema/Extrema_ExtCC.cxx index 06481b5539..9d6d714c49 100644 --- a/src/Extrema/Extrema_ExtCC.cxx +++ b/src/Extrema/Extrema_ExtCC.cxx @@ -19,6 +19,8 @@ // tri des solutions pour eviter de rendre plusieurs // fois la meme solution +#include + #include #include #include @@ -213,7 +215,7 @@ void Extrema_ExtCC::Perform() GeomAbs_CurveType type1 = myC[0]->GetType(); GeomAbs_CurveType type2 = myC[1]->GetType(); - Standard_Real U11, U12, U21, U22, Tol = Min(myTol[0], myTol[1]); + Standard_Real U11 = NAN, U12 = NAN, U21 = NAN, U22 = NAN, Tol = Min(myTol[0], myTol[1]); U11 = myInf[0]; U12 = mySup[0]; @@ -282,7 +284,7 @@ void Extrema_ExtCC::Perform() } } else if (type1 == GeomAbs_Circle && type2 == GeomAbs_Circle) { //analytical case - two circles - Standard_Boolean bIsDone; + Standard_Boolean bIsDone = 0; Extrema_ExtElC CCXtrem (myC[0]->Circle(), myC[1]->Circle()); bIsDone = CCXtrem.IsDone(); if(bIsDone) { @@ -541,10 +543,10 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11, // *********** aLin2 // //Take minimal trimmed distance - Standard_Real aDmin, aDists[4] = {mydist11, mydist12, mydist21, mydist22}; + Standard_Real aDmin = NAN, aDists[4] = {mydist11, mydist12, mydist21, mydist22}; Extrema_POnCurv aP1, aP2; aDmin = aDists[0]; - Standard_Integer i, imin = 0; + Standard_Integer i = 0, imin = 0; for (i = 1; i < 4; ++i) { if (aDmin > aDists[i]) @@ -772,10 +774,10 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11, // //Take minimal trimmed distance myIsParallel = Standard_False; - Standard_Real aDmin, aDists[4] = { mydist11, mydist12, mydist21, mydist22 }; + Standard_Real aDmin = NAN, aDists[4] = { mydist11, mydist12, mydist21, mydist22 }; Extrema_POnCurv aP1, aP2; aDmin = aDists[0]; - Standard_Integer k, imin = 0; + Standard_Integer k = 0, imin = 0; for (k = 1; k < 4; ++k) { if (aDmin > aDists[k]) @@ -830,8 +832,8 @@ void Extrema_ExtCC::PrepareResults(const Extrema_ExtElC& AlgExt, const Standard_Real Ut21, const Standard_Real Ut22) { - Standard_Integer i, NbExt; - Standard_Real Val, U, U2; + Standard_Integer i = 0, NbExt = 0; + Standard_Real Val = NAN, U = NAN, U2 = NAN; Extrema_POnCurv P1, P2; myDone = AlgExt.IsDone(); @@ -902,8 +904,8 @@ void Extrema_ExtCC::PrepareResults(const Extrema_ECC& AlgExt, const Standard_Real Ut21, const Standard_Real Ut22) { - Standard_Integer i, NbExt; - Standard_Real Val, U, U2; + Standard_Integer i = 0, NbExt = 0; + Standard_Real Val = NAN, U = NAN, U2 = NAN; Extrema_POnCurv P1, P2; myDone = AlgExt.IsDone(); diff --git a/src/Extrema/Extrema_ExtCC.hxx b/src/Extrema/Extrema_ExtCC.hxx index e5d2d77306..b2092d2ea7 100644 --- a/src/Extrema/Extrema_ExtCC.hxx +++ b/src/Extrema/Extrema_ExtCC.hxx @@ -169,13 +169,13 @@ private: Standard_Boolean myIsFindSingleSolution; // Default value is false. Extrema_ECC myECC; Standard_Boolean myDone; - Standard_Boolean myIsParallel; + Standard_Boolean myIsParallel{}; Extrema_SequenceOfPOnCurv mypoints; TColStd_SequenceOfReal mySqDist; - const Adaptor3d_Curve* myC[2]; - Standard_Real myInf[2]; - Standard_Real mySup[2]; - Standard_Real myTol[2]; + const Adaptor3d_Curve* myC[2]{}; + Standard_Real myInf[2]{}; + Standard_Real mySup[2]{}; + Standard_Real myTol[2]{}; gp_Pnt myP1f; gp_Pnt myP1l; gp_Pnt myP2f; diff --git a/src/Extrema/Extrema_ExtCC2d.cxx b/src/Extrema/Extrema_ExtCC2d.cxx index bc232fac52..f33ff61fda 100644 --- a/src/Extrema/Extrema_ExtCC2d.cxx +++ b/src/Extrema/Extrema_ExtCC2d.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -95,7 +97,7 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1, mypoints.Clear(); mySqDist.Clear(); GeomAbs_CurveType type1 = Extrema_Curve2dTool::GetType(C1), type2 = Extrema_Curve2dTool::GetType (*myC); - Standard_Real U11, U12, U21, U22, Tol = Min(mytolc1, mytolc2); + Standard_Real U11 = NAN, U12 = NAN, U21 = NAN, U22 = NAN, Tol = Min(mytolc1, mytolc2); // Extrema_POnCurv2d P1, P2; mynbext = 0; inverse = Standard_False; @@ -451,8 +453,8 @@ void Extrema_ExtCC2d::Results(const Extrema_ExtElC2d& AlgExt, const Standard_Real Period1, const Standard_Real Period2) { - Standard_Integer i, NbExt; - Standard_Real Val, U, U2; + Standard_Integer i = 0, NbExt = 0; + Standard_Real Val = NAN, U = NAN, U2 = NAN; Extrema_POnCurv2d P1, P2; myDone = AlgExt.IsDone(); @@ -514,8 +516,8 @@ void Extrema_ExtCC2d::Results(const Extrema_ECC2d& AlgExt, const Standard_Real Period1, const Standard_Real Period2) { - Standard_Integer i, NbExt; - Standard_Real Val, U, U2; + Standard_Integer i = 0, NbExt = 0; + Standard_Real Val = NAN, U = NAN, U2 = NAN; Extrema_POnCurv2d P1, P2; myDone = AlgExt.IsDone(); diff --git a/src/Extrema/Extrema_ExtCC2d.hxx b/src/Extrema/Extrema_ExtCC2d.hxx index c69a189d72..f8ec643481 100644 --- a/src/Extrema/Extrema_ExtCC2d.hxx +++ b/src/Extrema/Extrema_ExtCC2d.hxx @@ -96,25 +96,25 @@ private: Standard_Boolean myIsFindSingleSolution; // Default value is false. - Standard_Boolean myDone; - Standard_Boolean myIsPar; + Standard_Boolean myDone{}; + Standard_Boolean myIsPar{}; Extrema_SequenceOfPOnCurv2d mypoints; TColStd_SequenceOfReal mySqDist; - Standard_Integer mynbext; - Standard_Boolean inverse; - const Adaptor2d_Curve2d* myC; - Standard_Real myv1; - Standard_Real myv2; - Standard_Real mytolc1; - Standard_Real mytolc2; + Standard_Integer mynbext{}; + Standard_Boolean inverse{}; + const Adaptor2d_Curve2d* myC{}; + Standard_Real myv1{}; + Standard_Real myv2{}; + Standard_Real mytolc1{}; + Standard_Real mytolc2{}; gp_Pnt2d P1f; gp_Pnt2d P1l; gp_Pnt2d P2f; gp_Pnt2d P2l; - Standard_Real mydist11; - Standard_Real mydist12; - Standard_Real mydist21; - Standard_Real mydist22; + Standard_Real mydist11{}; + Standard_Real mydist12{}; + Standard_Real mydist21{}; + Standard_Real mydist22{}; }; diff --git a/src/Extrema/Extrema_ExtCS.cxx b/src/Extrema/Extrema_ExtCS.cxx index 0f5a233988..943a2716ac 100644 --- a/src/Extrema/Extrema_ExtCS.cxx +++ b/src/Extrema/Extrema_ExtCS.cxx @@ -16,6 +16,8 @@ // Modified by skv - Thu Jul 7 12:29:34 2005 OCC9134 +#include + #include #include #include @@ -112,8 +114,8 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, myPOnS.Clear(); myPOnC.Clear(); mySqDist.Clear(); - Standard_Integer i, j; - Standard_Integer NbT, NbU, NbV; + Standard_Integer i = 0, j = 0; + Standard_Integer NbT = 0, NbU = 0, NbV = 0; NbT = 12; NbU = NbV = 10; GeomAbs_CurveType myCtype = C.GetType(); @@ -155,12 +157,12 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, Precision::IsInfinite(vfirst) || Precision::IsInfinite(vlast))) { Standard_Real tmin = Precision::Infinite(), tmax = -tmin; - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; Bnd_Box aSurfBox; BndLib_AddSurface::Add(*myS, ufirst, ulast, vfirst, vlast, Precision::Confusion(), aSurfBox); aSurfBox.Get(xmin, ymin, zmin, xmax, ymax, zmax); gp_Lin aLin = C.Line(); - Standard_Real aParOnLin; + Standard_Real aParOnLin = NAN; gp_Pnt aLimPntArray[8]; aLimPntArray[0].SetCoord(xmin, ymin, zmin); @@ -195,7 +197,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, myDone = anExtPS.IsDone(); if (myDone) { Standard_Integer NbExt = anExtPS.NbExt(); - Standard_Real T = aCPar, U, V; + Standard_Real T = aCPar, U = NAN, V = NAN; Extrema_POnCurv PC; Extrema_POnSurf PS; for (i = 1; i <= NbExt; i++) { @@ -213,7 +215,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, myDone = Ext.IsDone(); if (myDone) { Standard_Integer NbExt = Ext.NbExt(); - Standard_Real T,U,V; + Standard_Real T = NAN,U = NAN,V = NAN; Extrema_POnCurv PC; Extrema_POnSurf PS; for (i = 1; i <= NbExt; i++) { @@ -283,7 +285,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, Extrema_POnSurf PS; myExtElCS.Points(i, PC, PS); Standard_Real Ucurve = PC.Parameter(); - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; PS.Parameter(U, V); AddSolution(C, Ucurve, U, V, PC.Value(), PS.Value(), myExtElCS.SquareDistance(i)); } @@ -395,7 +397,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, myDone = Ext.IsDone(); if (myDone) { Standard_Integer NbExt = Ext.NbExt(); - Standard_Real T, U, V; + Standard_Real T = NAN, U = NAN, V = NAN; Extrema_POnCurv PC; Extrema_POnSurf PS; for (i = 1; i <= NbExt; i++) { @@ -564,7 +566,7 @@ Standard_Boolean Extrema_ExtCS::AddSolution(const Adaptor3d_Curve& theCurve, aPC = myPOnC(j); aPS = myPOnS(j); Standard_Real Tj = aPC.Parameter(); - Standard_Real Uj, Vj; + Standard_Real Uj = NAN, Vj = NAN; aPS.Parameter(Uj, Vj); if (Abs(T - Tj) <= mytolC && Abs(U - Uj) <= mytolS && diff --git a/src/Extrema/Extrema_ExtCS.hxx b/src/Extrema/Extrema_ExtCS.hxx index d9110ec5a1..333398463a 100644 --- a/src/Extrema/Extrema_ExtCS.hxx +++ b/src/Extrema/Extrema_ExtCS.hxx @@ -91,20 +91,20 @@ private: private: - const Adaptor3d_Surface* myS; - Standard_Boolean myDone; - Standard_Boolean myIsPar; + const Adaptor3d_Surface* myS{}; + Standard_Boolean myDone{}; + Standard_Boolean myIsPar{}; Extrema_ExtElCS myExtElCS; Extrema_SequenceOfPOnSurf myPOnS; Extrema_SequenceOfPOnCurv myPOnC; - Standard_Real myuinf; - Standard_Real myusup; - Standard_Real myvinf; - Standard_Real myvsup; - Standard_Real mytolC; - Standard_Real mytolS; - Standard_Real myucinf; - Standard_Real myucsup; + Standard_Real myuinf{}; + Standard_Real myusup{}; + Standard_Real myvinf{}; + Standard_Real myvsup{}; + Standard_Real mytolC{}; + Standard_Real mytolS{}; + Standard_Real myucinf{}; + Standard_Real myucsup{}; TColStd_SequenceOfReal mySqDist; GeomAbs_SurfaceType myStype; diff --git a/src/Extrema/Extrema_ExtElC.cxx b/src/Extrema/Extrema_ExtElC.cxx index 2da4bf009b..94522dec9c 100644 --- a/src/Extrema/Extrema_ExtElC.cxx +++ b/src/Extrema/Extrema_ExtElC.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -49,7 +51,7 @@ static //======================================================================= class ExtremaExtElC_TrigonometricRoots { private: - Standard_Real Roots[4]; + Standard_Real Roots[4]{}; Standard_Boolean done; Standard_Integer NbRoots; Standard_Boolean infinite_roots; @@ -67,7 +69,7 @@ class ExtremaExtElC_TrigonometricRoots { } // Standard_Boolean IsARoot(Standard_Real u) { - Standard_Real PIpPI, aEps; + Standard_Real PIpPI = NAN, aEps = NAN; // aEps=RealEpsilon(); PIpPI = M_PI + M_PI; @@ -115,11 +117,11 @@ ExtremaExtElC_TrigonometricRoots:: const Standard_Real Cte, const Standard_Real Binf, const Standard_Real Bsup) -: NbRoots(0), +: done(Standard_False), NbRoots(0), infinite_roots(Standard_False) { - Standard_Integer i, nbessai; - Standard_Real cc ,sc, c, s, cte; + Standard_Integer i = 0, nbessai = 0; + Standard_Real cc = NAN ,sc = NAN, c = NAN, s = NAN, cte = NAN; // nbessai = 1; cc = CC; @@ -127,7 +129,7 @@ ExtremaExtElC_TrigonometricRoots:: c = C; s = S; cte = Cte; - done=Standard_False; + while (nbessai<=2 && !done) { //-- F= AA*CN*CN+2*BB*CN*SN+CC*CN+DD*SN+EE; math_TrigonometricFunctionRoots MTFR(cc,sc,c,s,cte,Binf,Bsup); @@ -138,9 +140,9 @@ ExtremaExtElC_TrigonometricRoots:: infinite_roots=Standard_True; } else { //else #1 - Standard_Boolean Triee; - Standard_Integer j, SvNbRoots; - Standard_Real aTwoPI, aMaxCoef, aPrecision; + Standard_Boolean Triee = 0; + Standard_Integer j = 0, SvNbRoots = 0; + Standard_Real aTwoPI = NAN, aMaxCoef = NAN, aPrecision = NAN; // aTwoPI=M_PI+M_PI; NbRoots=MTFR.NbSolutions(); @@ -163,7 +165,7 @@ ExtremaExtElC_TrigonometricRoots:: SvNbRoots=NbRoots; for(i=0; i + #include #include #include @@ -32,11 +34,11 @@ //function : Extrema_ExtElC2d //purpose : //======================================================================= -Extrema_ExtElC2d::Extrema_ExtElC2d() +Extrema_ExtElC2d::Extrema_ExtElC2d() : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) { - myDone = Standard_False; - myIsPar = Standard_False; - myNbExt = 0; + + + for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); @@ -49,7 +51,7 @@ Extrema_ExtElC2d::Extrema_ExtElC2d() //======================================================================= Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Lin2d& C2, - const Standard_Real) + const Standard_Real) : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) /*----------------------------------------------------------------------------- Function: Find min distance between 2 straight lines. @@ -64,9 +66,9 @@ Method: -----------------------------------------------------------------------------*/ { - myDone = Standard_False; - myIsPar = Standard_False; - myNbExt = 0; + + + for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); @@ -110,7 +112,7 @@ Method: Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Circ2d& C2, - const Standard_Real) + const Standard_Real) : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) /*----------------------------------------------------------------------------- Function: Find extreme distances between straight line C1 and circle C2. @@ -123,9 +125,9 @@ Method: ( P1P2.T = 0. (2) -----------------------------------------------------------------------------*/ { - myIsPar = Standard_False; - myDone = Standard_False; - myNbExt = 0; + + + for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); @@ -139,7 +141,7 @@ Method: Standard_Real Dx = D.Dot(x2); Standard_Real Dy = D.Dot(y2); - Standard_Real U1, teta[2]; + Standard_Real U1 = NAN, teta[2]; gp_Pnt2d O1=C1.Location(); gp_Pnt2d P1, P2; @@ -171,12 +173,8 @@ Method: // ============================================================================= Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, - const gp_Elips2d& C2) + const gp_Elips2d& C2) : myDone(Standard_True), myIsPar(Standard_False), myNbExt(0) { - myDone = Standard_True; - myIsPar = Standard_False; - myDone = Standard_False; - myNbExt = 0; for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); @@ -190,7 +188,7 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, Standard_Real Dx = D.Dot(x2); Standard_Real Dy = D.Dot(y2); - Standard_Real U1, teta[2], r1 = C2.MajorRadius(), r2 = C2.MinorRadius(); + Standard_Real U1 = NAN, teta[2], r1 = C2.MajorRadius(), r2 = C2.MinorRadius(); gp_Pnt2d O1=C1.Location(), P1, P2; if (Abs(Dy) <= RealEpsilon()) { @@ -216,18 +214,17 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, myPoint[myNbExt][0] = Extrema_POnCurv2d(U1,P1); myPoint[myNbExt][1] = Extrema_POnCurv2d(teta[1],P2); myNbExt++; - myDone = Standard_True; } //============================================================================= -Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Hypr2d& C2) +Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Hypr2d& C2) : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) { - myIsPar = Standard_False; - myDone = Standard_False; - myNbExt = 0; + + + for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); @@ -241,7 +238,7 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Hypr2d& C2) Standard_Real Dx = D.Dot(x2); Standard_Real Dy = D.Dot(y2); - Standard_Real U1, v2, U2=0, R = C2.MajorRadius(), r = C2.MinorRadius(); + Standard_Real U1 = NAN, v2 = NAN, U2=0, R = C2.MajorRadius(), r = C2.MinorRadius(); gp_Pnt2d P1, P2; if (Abs(Dy) < RealEpsilon()) { return;} if (Abs(R - r*Dx/Dy) < RealEpsilon()) return; @@ -263,11 +260,11 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Hypr2d& C2) //============================================================================ -Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Parab2d& C2) +Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Parab2d& C2) : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) { - myIsPar = Standard_False; - myDone = Standard_False; - myNbExt = 0; + + + for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); @@ -281,7 +278,7 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Parab2d& C2) Standard_Real Dx = D.Dot(x2); Standard_Real Dy = D.Dot(y2); - Standard_Real U1, U2, P = C2.Parameter(); + Standard_Real U1 = NAN, U2 = NAN, P = C2.Parameter(); gp_Pnt2d P1, P2; if (Abs(Dy) < RealEpsilon()) { return; } U2 = Dx*P/Dy; @@ -300,12 +297,8 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Lin2d& C1, const gp_Parab2d& C2) //============================================================================ -Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Circ2d& C2) +Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Circ2d& C2) : myDone(Standard_True), myIsPar(Standard_False), myNbExt(0) { - myIsPar = Standard_False; - myDone = Standard_False; - myNbExt = 0; - myDone = Standard_True; for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); @@ -325,8 +318,8 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Circ2d& C2) return; } - Standard_Integer NoSol, kk; - Standard_Real U1, U2; + Standard_Integer NoSol = 0, kk = 0; + Standard_Real U1 = NAN, U2 = NAN; Standard_Real r1 = C1.Radius(), r2 = C2.Radius(); Standard_Real Usol2[2], Usol1[2]; gp_Pnt2d P1[2], P2[2]; @@ -355,17 +348,17 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Circ2d& C2) } //=========================================================================== -Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Elips2d& C2) +Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Elips2d& C2) : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) { - myIsPar = Standard_False; - myDone = Standard_False; - myNbExt = 0; + + + for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); } - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Extrema_ExtPElC2d ExtElip(C1.Location(), C2, Precision::Confusion(), 0.0, 2.0*M_PI); @@ -388,17 +381,17 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Elips2d& C2) } //============================================================================ -Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Hypr2d& C2) +Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Hypr2d& C2) : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) { - myIsPar = Standard_False; - myDone = Standard_False; - myNbExt = 0; + + + for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); } - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Extrema_ExtPElC2d ExtHyp(C1.Location(), C2, Precision::Confusion(), RealFirst(), RealLast()); @@ -421,17 +414,17 @@ Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Hypr2d& C2) } //============================================================================ -Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Parab2d& C2) +Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Circ2d& C1, const gp_Parab2d& C2) : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) { - myIsPar = Standard_False; - myDone = Standard_False; - myNbExt = 0; + + + for (size_t anIdx = 0; anIdx < sizeof (mySqDist) / sizeof (mySqDist[0]); anIdx++) { mySqDist[anIdx] = RealLast(); } - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Extrema_ExtPElC2d ExtParab(C1.Location(), C2, Precision::Confusion(), RealFirst(), RealLast()); diff --git a/src/Extrema/Extrema_ExtElC2d.hxx b/src/Extrema/Extrema_ExtElC2d.hxx index a9a5bda7fe..a255fc5db9 100644 --- a/src/Extrema/Extrema_ExtElC2d.hxx +++ b/src/Extrema/Extrema_ExtElC2d.hxx @@ -111,7 +111,7 @@ private: Standard_Boolean myDone; Standard_Boolean myIsPar; Standard_Integer myNbExt; - Standard_Real mySqDist[8]; + Standard_Real mySqDist[8]{}; Extrema_POnCurv2d myPoint[8][2]; diff --git a/src/Extrema/Extrema_ExtElCS.cxx b/src/Extrema/Extrema_ExtElCS.cxx index 937f7c3bad..1ef7efa9b3 100644 --- a/src/Extrema/Extrema_ExtElCS.cxx +++ b/src/Extrema/Extrema_ExtElCS.cxx @@ -14,6 +14,8 @@ // Modified by skv - Thu Jul 7 14:37:05 2005 OCC9134 +#include + #include #include #include @@ -40,11 +42,11 @@ #include #include -Extrema_ExtElCS::Extrema_ExtElCS() +Extrema_ExtElCS::Extrema_ExtElCS() : myDone(Standard_False), myNbExt(0), myIsPar(Standard_False) { - myDone = Standard_False; - myIsPar = Standard_False; - myNbExt = 0; + + + } @@ -101,7 +103,7 @@ void Extrema_ExtElCS::Perform(const gp_Lin& C, } else { - Standard_Integer i, aStartIdx = 0; + Standard_Integer i = 0, aStartIdx = 0; Extrema_POnCurv myPOnC1, myPOnC2; Extrem.Points(1, myPOnC1, myPOnC2); @@ -127,7 +129,7 @@ void Extrema_ExtElCS::Perform(const gp_Lin& C, mySqDist = new TColStd_HArray1OfReal(1, myNbExt + 2); myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt + 2); myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt + 2); - Standard_Real u, v, w; + Standard_Real u = NAN, v = NAN, w = NAN; for (i = 1; i <= myNbExt; i++) { mySqDist->SetValue(i, 0.); @@ -242,7 +244,7 @@ void Extrema_ExtElCS::Perform(const gp_Lin& C, Extrema_ExtPElC Extrem(aCenter, C, Precision::Angular(), RealFirst(), RealLast()); - Standard_Integer i; + Standard_Integer i = 0; if (Extrem.IsDone() && Extrem.NbExt() > 0) { @@ -263,7 +265,7 @@ void Extrema_ExtElCS::Perform(const gp_Lin& C, { Extrema_POnCurv aCPnt(aLinSphere.ParamOnConic(i), aLinSphere.Point(i)); - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; ElSLib::Parameters(S, aLinSphere.Point(i), u, v); Extrema_POnSurf aSPnt(u, v, aLinSphere.Point(i)); @@ -380,9 +382,9 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C, mySqDist = new TColStd_HArray1OfReal(1, myNbExt); myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt); - Standard_Integer i; + Standard_Integer i = 0; gp_Pnt PC, PP; - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; Extrema_POnCurv POnC; Extrema_POnSurf POnS; for (i = 0; i < 2; ++i) @@ -457,7 +459,7 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C, isParallel = Standard_True; } else { Standard_Integer aNbExt = anExtC.NbExt(); - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer aCurI = 1; Standard_Real aTolConf = Precision::Confusion(); Standard_Real aCylRad = S.Radius(); @@ -498,7 +500,7 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C, gp_Dir aDir(aPOnAxis.Value().XYZ().Subtracted(aPOnCirc.Value().XYZ())); Standard_Real aShift[2] = {aDist + aCylRad, aDist - aCylRad}; - Standard_Integer j; + Standard_Integer j = 0; for (j = 0; j < 2; j++) { gp_Vec aVec(aDir); @@ -507,8 +509,8 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C, aVec.Multiply(aShift[j]); aPntOnCyl = aPOnCirc.Value().Translated(aVec); - Standard_Real aU; - Standard_Real aV; + Standard_Real aU = NAN; + Standard_Real aV = NAN; ElSLib::Parameters(S, aPntOnCyl, aU, aV); @@ -523,8 +525,8 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C, // Adding intersection points to the list of extremas for (i=1; i<=aNbInter; i++) { - Standard_Real aU; - Standard_Real aV; + Standard_Real aU = NAN; + Standard_Real aV = NAN; gp_Pnt aInterPnt = aCircCylInter.Point(i); @@ -653,7 +655,7 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C, gp_Pnt aPOnC = ElCLib::Value(aT, C); // Compute parameters on sphere - Standard_Real aU, aV; + Standard_Real aU = NAN, aV = NAN; ElSLib::Parameters(S, aPOnC, aU, aV); // Compute point on sphere gp_Pnt aPOnS = ElSLib::Value(aU, aV, S); @@ -715,7 +717,7 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C, anExtC.Points(it.Value(), P1, P2); // Compute parameters on sphere - Standard_Real aU, aV; + Standard_Real aU = NAN, aV = NAN; ElSLib::Parameters(S, P1.Value(), aU, aV); // Compute point on sphere gp_Pnt aPOnS = ElSLib::Value(aU, aV, S); @@ -786,7 +788,7 @@ void Extrema_ExtElCS::Perform(const gp_Hypr& C, mySqDist = new TColStd_HArray1OfReal(1, 1); mySqDist->SetValue(1, S.SquareDistance(Ph)); - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; ElSLib::PlaneParameters(S.Position(), Ph, U, V); gp_Pnt Pp = ElSLib::PlaneValue(U, V, S.Position()); Extrema_POnSurf PS(U, V, Pp); diff --git a/src/Extrema/Extrema_ExtElCS.hxx b/src/Extrema/Extrema_ExtElCS.hxx index 65bd8619f4..6ea2b3b5d6 100644 --- a/src/Extrema/Extrema_ExtElCS.hxx +++ b/src/Extrema/Extrema_ExtElCS.hxx @@ -145,9 +145,9 @@ private: - Standard_Boolean myDone; - Standard_Integer myNbExt; - Standard_Boolean myIsPar; + Standard_Boolean myDone{}; + Standard_Integer myNbExt{}; + Standard_Boolean myIsPar{}; Handle(TColStd_HArray1OfReal) mySqDist; Handle(Extrema_HArray1OfPOnCurv) myPoint1; Handle(Extrema_HArray1OfPOnSurf) myPoint2; diff --git a/src/Extrema/Extrema_ExtElSS.cxx b/src/Extrema/Extrema_ExtElSS.cxx index e4fe6b1170..278aa47c51 100644 --- a/src/Extrema/Extrema_ExtElSS.cxx +++ b/src/Extrema/Extrema_ExtElSS.cxx @@ -26,11 +26,11 @@ #include #include -Extrema_ExtElSS::Extrema_ExtElSS() +Extrema_ExtElSS::Extrema_ExtElSS() : myDone(Standard_False), myIsPar(Standard_False), myNbExt(0) { - myDone = Standard_False; - myIsPar = Standard_False; - myNbExt = 0; + + + } diff --git a/src/Extrema/Extrema_ExtElSS.hxx b/src/Extrema/Extrema_ExtElSS.hxx index 2cb990eeaa..ee090c1a80 100644 --- a/src/Extrema/Extrema_ExtElSS.hxx +++ b/src/Extrema/Extrema_ExtElSS.hxx @@ -112,9 +112,9 @@ private: - Standard_Boolean myDone; - Standard_Boolean myIsPar; - Standard_Integer myNbExt; + Standard_Boolean myDone{}; + Standard_Boolean myIsPar{}; + Standard_Integer myNbExt{}; Handle(TColStd_HArray1OfReal) mySqDist; Handle(Extrema_HArray1OfPOnSurf) myPOnS1; Handle(Extrema_HArray1OfPOnSurf) myPOnS2; diff --git a/src/Extrema/Extrema_ExtPElC.cxx b/src/Extrema/Extrema_ExtPElC.cxx index 53514f594b..6a7dc81ad8 100644 --- a/src/Extrema/Extrema_ExtPElC.cxx +++ b/src/Extrema/Extrema_ExtPElC.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -33,10 +35,10 @@ //function : Extrema_ExtPElC //purpose : //======================================================================= -Extrema_ExtPElC::Extrema_ExtPElC() +Extrema_ExtPElC::Extrema_ExtPElC() : myDone(Standard_False), myNbExt(0) { - myDone = Standard_False; - myNbExt = 0; + + for (Standard_Integer i = 0; i < 4; i++) { @@ -153,7 +155,7 @@ Method: Standard_Real myuinf = Uinf; //Standard_Real TolU = Tol*C.Radius(); - Standard_Real TolU, aR; + Standard_Real TolU = NAN, aR = NAN; aR=C.Radius(); TolU=Precision::Infinite(); if (aR > gp::Resolution()) { @@ -169,7 +171,7 @@ Method: // 3- Calculate extrema in [Umin,Umax] ... gp_Pnt Cu; - Standard_Real Us; + Standard_Real Us = NAN; for (Standard_Integer NoSol = 0; NoSol <= 1; NoSol++) { Us = Usol[NoSol]; if (((Uinf-Us) < TolU) && ((Us-Usup) < TolU)) { @@ -231,7 +233,7 @@ Method: // 2- Calculation of solutions ... - Standard_Integer NoSol, NbSol; + Standard_Integer NoSol = 0, NbSol = 0; Standard_Real A = C.MajorRadius(); Standard_Real B = C.MinorRadius(); gp_Vec OPp (O,Pp); @@ -249,7 +251,7 @@ Method: if (!Sol.IsDone()) { return; } gp_Pnt Cu; - Standard_Real Us; + Standard_Real Us = NAN; NbSol = Sol.NbSolutions(); for (NoSol = 1; NoSol <= NbSol; NoSol++) { Us = Sol.Value(NoSol); @@ -331,10 +333,10 @@ Method: math_DirectPolynomialRoots Sol(C1,-(X*R+Y*r)/2.,0.,(X*R-Y*r)/2.,-C1); if (!Sol.IsDone()) { return; } gp_Pnt Cu; - Standard_Real Us, Vs; + Standard_Real Us = NAN, Vs = NAN; Standard_Integer NbSol = Sol.NbSolutions(); - Standard_Boolean DejaEnr; - Standard_Integer NoExt; + Standard_Boolean DejaEnr = 0; + Standard_Integer NoExt = 0; gp_Pnt TbExt[4]; for (Standard_Integer NoSol = 1; NoSol <= NbSol; NoSol++) { Vs = Sol.Value(NoSol); @@ -418,10 +420,10 @@ Method: math_DirectPolynomialRoots Sol(1./(4.*F),0.,2.*F-X,-2.*F*Y); if (!Sol.IsDone()) { return; } gp_Pnt Cu; - Standard_Real Us; + Standard_Real Us = NAN; Standard_Integer NbSol = Sol.NbSolutions(); - Standard_Boolean DejaEnr; - Standard_Integer NoExt; + Standard_Boolean DejaEnr = 0; + Standard_Integer NoExt = 0; gp_Pnt TbExt[3]; for (Standard_Integer NoSol = 1; NoSol <= NbSol; NoSol++) { Us = Sol.Value(NoSol); diff --git a/src/Extrema/Extrema_ExtPElC.hxx b/src/Extrema/Extrema_ExtPElC.hxx index a597b084bb..d3ecb32910 100644 --- a/src/Extrema/Extrema_ExtPElC.hxx +++ b/src/Extrema/Extrema_ExtPElC.hxx @@ -128,10 +128,10 @@ private: - Standard_Boolean myDone; - Standard_Integer myNbExt; - Standard_Real mySqDist[4]; - Standard_Boolean myIsMin[4]; + Standard_Boolean myDone{}; + Standard_Integer myNbExt{}; + Standard_Real mySqDist[4]{}; + Standard_Boolean myIsMin[4]{}; Extrema_POnCurv myPoint[4]; diff --git a/src/Extrema/Extrema_ExtPElC2d.cxx b/src/Extrema/Extrema_ExtPElC2d.cxx index 460c59569d..93a783ceb2 100644 --- a/src/Extrema/Extrema_ExtPElC2d.cxx +++ b/src/Extrema/Extrema_ExtPElC2d.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -32,10 +34,10 @@ #include //============================================================================= -Extrema_ExtPElC2d::Extrema_ExtPElC2d() +Extrema_ExtPElC2d::Extrema_ExtPElC2d() : myDone(Standard_False), myNbExt(0) { - myDone = Standard_False; - myNbExt = 0; + + for (Standard_Integer i = 0; i < 4; i++) { @@ -108,7 +110,7 @@ void Extrema_ExtPElC2d::Perform(const gp_Pnt2d& P, } else { - Standard_Real radius, U1, U2; + Standard_Real radius = NAN, U1 = NAN, U2 = NAN; gp_Pnt2d P1, P2; myDone = Standard_True; @@ -179,7 +181,7 @@ void Extrema_ExtPElC2d::Perform (const gp_Pnt2d& P, gp_Pnt2d OR; OR = E.Location(); - Standard_Integer NoSol, NbSol; + Standard_Integer NoSol = 0, NbSol = 0; Standard_Real A = E.MajorRadius(); Standard_Real B = E.MinorRadius(); gp_Vec2d V(OR,P); @@ -196,7 +198,7 @@ void Extrema_ExtPElC2d::Perform (const gp_Pnt2d& P, if (!Sol.IsDone()) { return; } gp_Pnt2d Cu; - Standard_Real Us; + Standard_Real Us = NAN; NbSol = Sol.NbSolutions(); myNbExt = 0; for (NoSol = 1; NoSol <= NbSol; NoSol++) { @@ -242,10 +244,10 @@ void Extrema_ExtPElC2d::Perform(const gp_Pnt2d& P, math_DirectPolynomialRoots Sol(C1,-(X*R+Y*r)/2.,0.,(X*R-Y*r)/2.,-C1); if (!Sol.IsDone()) { return; } gp_Pnt2d Cu; - Standard_Real Us, Vs; + Standard_Real Us = NAN, Vs = NAN; Standard_Integer NbSol = Sol.NbSolutions(); - Standard_Boolean DejaEnr; - Standard_Integer NoExt; + Standard_Boolean DejaEnr = 0; + Standard_Integer NoExt = 0; gp_Pnt2d TbExt[4]; for (Standard_Integer NoSol = 1; NoSol <= NbSol; NoSol++) { Vs = Sol.Value(NoSol); @@ -304,10 +306,10 @@ void Extrema_ExtPElC2d::Perform(const gp_Pnt2d& P, math_DirectPolynomialRoots Sol(1./(4.*F),0.,2.*F-X,-2.*F*Y); if (!Sol.IsDone()) { return; } gp_Pnt2d Cu; - Standard_Real Us; + Standard_Real Us = NAN; Standard_Integer NbSol = Sol.NbSolutions(); - Standard_Boolean DejaEnr; - Standard_Integer NoExt; + Standard_Boolean DejaEnr = 0; + Standard_Integer NoExt = 0; gp_Pnt2d TbExt[3]; for (Standard_Integer NoSol = 1; NoSol <= NbSol; NoSol++) { Us = Sol.Value(NoSol); diff --git a/src/Extrema/Extrema_ExtPElC2d.hxx b/src/Extrema/Extrema_ExtPElC2d.hxx index bba9efbd23..208fad0908 100644 --- a/src/Extrema/Extrema_ExtPElC2d.hxx +++ b/src/Extrema/Extrema_ExtPElC2d.hxx @@ -128,10 +128,10 @@ private: - Standard_Boolean myDone; - Standard_Integer myNbExt; - Standard_Real mySqDist[4]; - Standard_Boolean myIsMin[4]; + Standard_Boolean myDone{}; + Standard_Integer myNbExt{}; + Standard_Real mySqDist[4]{}; + Standard_Boolean myIsMin[4]{}; Extrema_POnCurv2d myPoint[4]; diff --git a/src/Extrema/Extrema_ExtPElS.cxx b/src/Extrema/Extrema_ExtPElS.cxx index 6b74541a1b..c8f4cde240 100644 --- a/src/Extrema/Extrema_ExtPElS.cxx +++ b/src/Extrema/Extrema_ExtPElS.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -29,10 +31,10 @@ static const Standard_Real ExtPElS_MyEps = Epsilon(2. * M_PI); //============================================================================= -Extrema_ExtPElS::Extrema_ExtPElS() +Extrema_ExtPElS::Extrema_ExtPElS() : myDone(Standard_False), myNbExt(0) { - myDone = Standard_False; - myNbExt = 0; + + for (Standard_Integer i = 0; i < 4; i++) { mySqDist[i] = RealLast(); @@ -176,7 +178,7 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, gp_Pnt Pp = P.Translated(OZ.Multiplied(-Zp)); gp_Vec OPp(O, Pp); if (OPp.SquareMagnitude() < Tol * Tol) return; - Standard_Real B, U1, V1, U2, V2; + Standard_Real B = NAN, U1 = NAN, V1 = NAN, U2 = NAN, V2 = NAN; Standard_Boolean Same = DirZ.Dot(MP) >= 0.0; U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); //-M_PI -ExtPElS_MyEps && U1 < ExtPElS_MyEps) { U1 = 0.; } @@ -263,7 +265,7 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, // Calculation of extrema ... gp_Vec OPp (O,Pp); - Standard_Real U1, U2, V; + Standard_Real U1 = NAN, U2 = NAN, V = NAN; if (OPp.SquareMagnitude() < Tol * Tol) { U1 = 0.; U2 = 0.; @@ -400,7 +402,7 @@ void Extrema_ExtPElS::Perform (const gp_Pnt& P, // Projection of point P in plane XOY of the cylinder ... gp_Pnt O = S.Location(); gp_Vec OZ (S.Axis().Direction()); - Standard_Real U, V = gp_Vec(O,P).Dot(OZ); + Standard_Real U = NAN, V = gp_Vec(O,P).Dot(OZ); gp_Pnt Pp = P.Translated(OZ.Multiplied(-V)); ElSLib::Parameters(S, P, U, V); diff --git a/src/Extrema/Extrema_ExtPElS.hxx b/src/Extrema/Extrema_ExtPElS.hxx index b3aae2b99a..2d94a28996 100644 --- a/src/Extrema/Extrema_ExtPElS.hxx +++ b/src/Extrema/Extrema_ExtPElS.hxx @@ -103,9 +103,9 @@ private: - Standard_Boolean myDone; - Standard_Integer myNbExt; - Standard_Real mySqDist[4]; + Standard_Boolean myDone{}; + Standard_Integer myNbExt{}; + Standard_Real mySqDist[4]{}; Extrema_POnSurf myPoint[4]; diff --git a/src/Extrema/Extrema_ExtPExtS.cxx b/src/Extrema/Extrema_ExtPExtS.cxx index 1173a5efdb..e491cb4c07 100644 --- a/src/Extrema/Extrema_ExtPExtS.cxx +++ b/src/Extrema/Extrema_ExtPExtS.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -99,7 +101,7 @@ void Extrema_ExtPExtS::MakePreciser (Standard_Real& U, U = myuinf; } else { - Standard_Real step = (myusup - myuinf) / 30, D2e, D2next ,D2prev; + Standard_Real step = (myusup - myuinf) / 30, D2e = NAN, D2next = NAN ,D2prev = NAN; gp_Pnt Pe = ProjectPnt (OrtogSection, myDirection, GetValue(U,myC)), Pprev = ProjectPnt (OrtogSection, myDirection, GetValue(U-step, myC)), @@ -107,7 +109,7 @@ void Extrema_ExtPExtS::MakePreciser (Standard_Real& U, D2e = P.SquareDistance(Pe), D2next = P.SquareDistance(Pnext), D2prev = P.SquareDistance(Pprev); - Standard_Boolean notFound; + Standard_Boolean notFound = 0; if (isMin) notFound = (D2e > D2prev || D2e > D2next); else @@ -303,12 +305,12 @@ void Extrema_ExtPExtS::Perform (const gp_Pnt& P) if (!anExt.IsDone()) return; gp_Ax2 anOrtogSection (P, myDirection); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; Standard_Boolean - isMin, + isMin = 0, isSimpleCase = myDirection.IsParallel(myPosition.Direction(),Precision::Angular()); - Standard_Integer i, aNbExt = anExt.NbExt(); + Standard_Integer i = 0, aNbExt = anExt.NbExt(); math_Vector UV(1,2), Tol(1,2), UVinf(1,2), UVsup(1,2); Tol(1) = mytolu; Tol(2) = mytolv; UVinf(1) = myuinf; UVinf(2) = myvinf; @@ -354,7 +356,7 @@ void Extrema_ExtPExtS::Perform (const gp_Pnt& P) math_FunctionSetRoot aFSR (myF, Tol); aFSR.Perform(myF, UV, UVinf, UVsup); // for (Standard_Integer k=1 ; k <= myF.NbExt(); - Standard_Integer k; + Standard_Integer k = 0; for ( k=1 ; k <= myF.NbExt(); k++) { if (IsOriginalPnt(myF.Point(k).Value(), myPoint, myNbExt)) { // modified by NIZHNY-MKK Thu Sep 18 14:46:41 2003.BEGIN @@ -393,7 +395,7 @@ void Extrema_ExtPExtS::Perform (const gp_Pnt& P) Standard_Real dist = Sqrt(myF.SquareDistance(k)); math_Vector Vals(1, 2); const Extrema_POnSurf& PonS=myF.Point(k); - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; PonS.Parameter(u, v); UV(1) = u; UV(2) = v; diff --git a/src/Extrema/Extrema_ExtPExtS.hxx b/src/Extrema/Extrema_ExtPExtS.hxx index 5701ee1ed3..22cb25f257 100644 --- a/src/Extrema/Extrema_ExtPExtS.hxx +++ b/src/Extrema/Extrema_ExtPExtS.hxx @@ -92,7 +92,7 @@ private: Standard_Boolean myIsAnalyticallyComputable; Standard_Boolean myDone; Standard_Integer myNbExt; - Standard_Real mySqDist[4]; + Standard_Real mySqDist[4]{}; Extrema_POnSurf myPoint[4]; diff --git a/src/Extrema/Extrema_ExtPRevS.cxx b/src/Extrema/Extrema_ExtPRevS.cxx index 29764f4c03..f72418f49a 100644 --- a/src/Extrema/Extrema_ExtPRevS.cxx +++ b/src/Extrema/Extrema_ExtPRevS.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -207,13 +209,13 @@ static Standard_Boolean IsExtremum (const Standard_Real U, const Standard_Real V //purpose : //======================================================================= -Extrema_ExtPRevS::Extrema_ExtPRevS() +Extrema_ExtPRevS::Extrema_ExtPRevS() : mytolv(Precision::Confusion()), myIsAnalyticallyComputable(Standard_False), myDone(Standard_False), myNbExt(0) { myvinf = myvsup = 0.0; - mytolv = Precision::Confusion(); - myDone = Standard_False; - myNbExt = 0; - myIsAnalyticallyComputable = Standard_False; + + + + for (Standard_Integer i = 0; i < 8; i++) { @@ -344,7 +346,7 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) if (O.IsEqual(Pp,Precision::Confusion())) // P is on the AxeOfRevolution return; - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; gp_Pnt P1, Ppp; Standard_Real OPpz = gp_Vec(O,Pp).Dot(Z); if (Abs(OPpz) <= gp::Resolution()) { @@ -373,8 +375,8 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) P1 = P.Transformed(T); gp_Pnt E; - Standard_Real Dist2; - Standard_Integer i; + Standard_Real Dist2 = NAN; + Standard_Integer i = 0; Extrema_ExtPElC anExt; PerformExtPElC(anExt, P1, anACurve, mytolv); diff --git a/src/Extrema/Extrema_ExtPRevS.hxx b/src/Extrema/Extrema_ExtPRevS.hxx index 405436cfeb..b6c059290f 100644 --- a/src/Extrema/Extrema_ExtPRevS.hxx +++ b/src/Extrema/Extrema_ExtPRevS.hxx @@ -73,15 +73,15 @@ private: Handle(GeomAdaptor_SurfaceOfRevolution) myS; - Standard_Real myvinf; - Standard_Real myvsup; - Standard_Real mytolv; + Standard_Real myvinf{}; + Standard_Real myvsup{}; + Standard_Real mytolv{}; gp_Ax2 myPosition; Extrema_GenExtPS myExtPS; - Standard_Boolean myIsAnalyticallyComputable; - Standard_Boolean myDone; - Standard_Integer myNbExt; - Standard_Real mySqDist[8]; + Standard_Boolean myIsAnalyticallyComputable{}; + Standard_Boolean myDone{}; + Standard_Integer myNbExt{}; + Standard_Real mySqDist[8]{}; Extrema_POnSurf myPoint[8]; diff --git a/src/Extrema/Extrema_ExtPS.cxx b/src/Extrema/Extrema_ExtPS.cxx index 7a09e25bf9..fc60ad9b36 100644 --- a/src/Extrema/Extrema_ExtPS.cxx +++ b/src/Extrema/Extrema_ExtPS.cxx @@ -14,6 +14,8 @@ //----------------------------------------------------------------- +#include + #include #include #include @@ -37,7 +39,7 @@ static Standard_Boolean IsoIsDeg (const Adaptor3d_Surface& S, const Standard_Real TolMin, const Standard_Real TolMax) { - Standard_Real U1=0.,U2=0.,V1=0.,V2=0.,T; + Standard_Real U1=0.,U2=0.,V1=0.,V2=0.,T = NAN; Standard_Boolean Along = Standard_True; U1 = S.FirstUParameter(); U2 = S.LastUParameter(); @@ -45,7 +47,7 @@ static Standard_Boolean IsoIsDeg (const Adaptor3d_Surface& S, V2 = S.LastVParameter(); gp_Vec D1U,D1V; gp_Pnt P; - Standard_Real Step,D1NormMax; + Standard_Real Step = NAN,D1NormMax = NAN; if (IT == GeomAbs_IsoV) { if( !Precision::IsInfinite(U1) && !Precision::IsInfinite(U2) ) @@ -99,7 +101,7 @@ static Standard_Boolean IsoIsDeg (const Adaptor3d_Surface& S, void Extrema_ExtPS::TreatSolution (const Extrema_POnSurf& PS, const Standard_Real Val) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; PS.Parameter(U, V); if (myS->IsUPeriodic()) { U = ElCLib::InPeriod(U, myuinf, myuinf + myS->UPeriod()); diff --git a/src/Extrema/Extrema_ExtPS.hxx b/src/Extrema/Extrema_ExtPS.hxx index 60c9aadade..5fbf0f00f4 100644 --- a/src/Extrema/Extrema_ExtPS.hxx +++ b/src/Extrema/Extrema_ExtPS.hxx @@ -109,21 +109,21 @@ private: private: - const Adaptor3d_Surface* myS; - Standard_Boolean myDone; + const Adaptor3d_Surface* myS{}; + Standard_Boolean myDone{}; Extrema_ExtPElS myExtPElS; Extrema_GenExtPS myExtPS; Extrema_SequenceOfPOnSurf myPoints; - Standard_Real myuinf; - Standard_Real myusup; - Standard_Real myvinf; - Standard_Real myvsup; - Standard_Real mytolu; - Standard_Real mytolv; - Standard_Real d11; - Standard_Real d12; - Standard_Real d21; - Standard_Real d22; + Standard_Real myuinf{}; + Standard_Real myusup{}; + Standard_Real myvinf{}; + Standard_Real myvsup{}; + Standard_Real mytolu{}; + Standard_Real mytolv{}; + Standard_Real d11{}; + Standard_Real d12{}; + Standard_Real d21{}; + Standard_Real d22{}; gp_Pnt P11; gp_Pnt P12; gp_Pnt P21; diff --git a/src/Extrema/Extrema_ExtSS.cxx b/src/Extrema/Extrema_ExtSS.cxx index 0d0162fa35..f987a61104 100644 --- a/src/Extrema/Extrema_ExtSS.cxx +++ b/src/Extrema/Extrema_ExtSS.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -111,7 +113,7 @@ void Extrema_ExtSS::Perform(const Adaptor3d_Surface& S1, myPOnS1.Clear(); myPOnS2.Clear(); mySqDist.Clear(); - Standard_Integer i; + Standard_Integer i = 0; GeomAbs_SurfaceType myS1type = S1.GetType(); const Standard_Integer NbU = 20, NbV = 20; @@ -132,7 +134,7 @@ void Extrema_ExtSS::Perform(const Adaptor3d_Surface& S1, myDone = Ext.IsDone(); if (myDone) { Standard_Integer NbExt = Ext.NbExt(); - Standard_Real U1, V1,U2,V2; + Standard_Real U1 = NAN, V1 = NAN,U2 = NAN,V2 = NAN; Extrema_POnSurf PS1; Extrema_POnSurf PS2; for (i = 1; i <= NbExt; i++) { @@ -172,7 +174,7 @@ void Extrema_ExtSS::Perform(const Adaptor3d_Surface& S1, myDone = Ext.IsDone(); if (myDone) { Standard_Integer NbExt = Ext.NbExt(); - Standard_Real U1, V1,U2,V2; + Standard_Real U1 = NAN, V1 = NAN,U2 = NAN,V2 = NAN; Extrema_POnSurf PS1; Extrema_POnSurf PS2; for (i = 1; i <= NbExt; i++) { @@ -213,7 +215,7 @@ void Extrema_ExtSS::Perform(const Adaptor3d_Surface& S1, } else { Standard_Integer NbExt = myExtElSS.NbExt(); - Standard_Real U1, V1, U2, V2; + Standard_Real U1 = NAN, V1 = NAN, U2 = NAN, V2 = NAN; Extrema_POnSurf PS1; Extrema_POnSurf PS2; for (i = 1; i <= NbExt; i++) { diff --git a/src/Extrema/Extrema_ExtSS.hxx b/src/Extrema/Extrema_ExtSS.hxx index 5ec6f7c5fe..380ecee129 100644 --- a/src/Extrema/Extrema_ExtSS.hxx +++ b/src/Extrema/Extrema_ExtSS.hxx @@ -72,22 +72,22 @@ public: private: - const Adaptor3d_Surface* myS2; - Standard_Boolean myDone; - Standard_Boolean myIsPar; + const Adaptor3d_Surface* myS2{}; + Standard_Boolean myDone{}; + Standard_Boolean myIsPar{}; Extrema_ExtElSS myExtElSS; Extrema_SequenceOfPOnSurf myPOnS1; Extrema_SequenceOfPOnSurf myPOnS2; - Standard_Real myuinf1; - Standard_Real myusup1; - Standard_Real myvinf1; - Standard_Real myvsup1; - Standard_Real myuinf2; - Standard_Real myusup2; - Standard_Real myvinf2; - Standard_Real myvsup2; - Standard_Real mytolS1; - Standard_Real mytolS2; + Standard_Real myuinf1{}; + Standard_Real myusup1{}; + Standard_Real myvinf1{}; + Standard_Real myvsup1{}; + Standard_Real myuinf2{}; + Standard_Real myusup2{}; + Standard_Real myvinf2{}; + Standard_Real myvsup2{}; + Standard_Real mytolS1{}; + Standard_Real mytolS2{}; TColStd_SequenceOfReal mySqDist; GeomAbs_SurfaceType myStype; diff --git a/src/Extrema/Extrema_FuncExtCS.cxx b/src/Extrema/Extrema_FuncExtCS.cxx index 78b2146d63..f235fe72c1 100644 --- a/src/Extrema/Extrema_FuncExtCS.cxx +++ b/src/Extrema/Extrema_FuncExtCS.cxx @@ -53,10 +53,10 @@ les algorithmes math_FunctionRoot et math_FunctionRoots. myS(NULL), myt(0.0), myU(0.0), - myV(0.0) + myV(0.0), myCinit(Standard_False), mySinit(Standard_False) { - myCinit = Standard_False; - mySinit = Standard_False; + + } //======================================================================= diff --git a/src/Extrema/Extrema_FuncExtCS.hxx b/src/Extrema/Extrema_FuncExtCS.hxx index ef37ca6278..8a2abe2b9f 100644 --- a/src/Extrema/Extrema_FuncExtCS.hxx +++ b/src/Extrema/Extrema_FuncExtCS.hxx @@ -95,18 +95,18 @@ public: private: - const Adaptor3d_Curve* myC; - const Adaptor3d_Surface* myS; + const Adaptor3d_Curve* myC{}; + const Adaptor3d_Surface* myS{}; gp_Pnt myP1; gp_Pnt myP2; - Standard_Real myt; - Standard_Real myU; - Standard_Real myV; + Standard_Real myt{}; + Standard_Real myU{}; + Standard_Real myV{}; TColStd_SequenceOfReal mySqDist; Extrema_SequenceOfPOnCurv myPoint1; Extrema_SequenceOfPOnSurf myPoint2; - Standard_Boolean myCinit; - Standard_Boolean mySinit; + Standard_Boolean myCinit{}; + Standard_Boolean mySinit{}; }; diff --git a/src/Extrema/Extrema_FuncExtSS.cxx b/src/Extrema/Extrema_FuncExtSS.cxx index 1657e169e4..92763a196c 100644 --- a/src/Extrema/Extrema_FuncExtSS.cxx +++ b/src/Extrema/Extrema_FuncExtSS.cxx @@ -60,10 +60,10 @@ Extrema_FuncExtSS::Extrema_FuncExtSS () myU1(0.0), myV1(0.0), myU2(0.0), - myV2(0.0) + myV2(0.0), myS1init(Standard_False), myS2init(Standard_False) { - myS1init = Standard_False; - myS2init = Standard_False; + + } //======================================================================= @@ -73,15 +73,15 @@ Extrema_FuncExtSS::Extrema_FuncExtSS () Extrema_FuncExtSS::Extrema_FuncExtSS (const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2) -: myU1(0.0), +: myS1(&S1), myS2(&S2), myU1(0.0), myV1(0.0), myU2(0.0), - myV2(0.0) + myV2(0.0), myS1init(Standard_True), myS2init(Standard_True) { - myS1 = &S1; - myS2 = &S2; - myS1init = Standard_True; - myS2init = Standard_True; + + + + } //======================================================================= diff --git a/src/Extrema/Extrema_FuncPSNorm.cxx b/src/Extrema/Extrema_FuncPSNorm.cxx index 649d5da027..5f10bd723a 100644 --- a/src/Extrema/Extrema_FuncPSNorm.cxx +++ b/src/Extrema/Extrema_FuncPSNorm.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -27,22 +29,22 @@ Extrema_FuncPSNorm::Extrema_FuncPSNorm () : myS(NULL), myU(0.0), - myV(0.0) + myV(0.0), myPinit(Standard_False), mySinit(Standard_False) { - myPinit = Standard_False; - mySinit = Standard_False; + + } //============================================================================= Extrema_FuncPSNorm::Extrema_FuncPSNorm (const gp_Pnt& P, const Adaptor3d_Surface& S) -: myU(0.0), - myV(0.0) +: myP(P), myS(&S), myU(0.0), + myV(0.0), myPinit(Standard_True), mySinit(Standard_True) { - myP = P; - myS = &S; - myPinit = Standard_True; - mySinit = Standard_True; + + + + } //============================================================================= @@ -134,7 +136,7 @@ Standard_Integer Extrema_FuncPSNorm::GetStateNumber () for( ; i <= nbSol; i++) { - Standard_Real aU, aV; + Standard_Real aU = NAN, aV = NAN; myPoint(i).Parameter(aU, aV); if( ((myU - aU ) * (myU - aU ) + (myV - aV ) * (myV - aV )) <= tol2d ) break; diff --git a/src/Extrema/Extrema_GenExtCS.cxx b/src/Extrema/Extrema_GenExtCS.cxx index c6a8f5089b..bfed5ab877 100644 --- a/src/Extrema/Extrema_GenExtCS.cxx +++ b/src/Extrema/Extrema_GenExtCS.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -206,7 +208,7 @@ void Extrema_GenExtCS::Initialize (const Adaptor3d_Surface& S, myvsup = Vsup; mytol2 = Tol2; - Standard_Real umaxpar, vmaxpar; + Standard_Real umaxpar = NAN, vmaxpar = NAN; GetSurfMaxParamVals(*myS, umaxpar, vmaxpar); if(Precision::IsInfinite (myusup)) @@ -323,7 +325,7 @@ void Extrema_GenExtCS::Perform (const Adaptor3d_Curve& C, } } - Standard_Integer anInt; + Standard_Integer anInt = 0; Standard_Real dT = (mytsup - mytmin) / aNbIntC; for (anInt = 1; anInt <= aNbIntC; anInt++) { @@ -363,7 +365,7 @@ void Extrema_GenExtCS::Perform (const Adaptor3d_Curve& C, Extrema_SequenceOfPOnSurf aPntsOnSurf1(aPntsOnSurf); Standard_Real aMinDist = aSqDists(1); - Standard_Integer i; + Standard_Integer i = 0; for (i = 2; i <= aSqDists.Length(); ++i) { Standard_Real aDist = aSqDists(i); @@ -478,7 +480,7 @@ void Extrema_GenExtCS::GlobMinGenCS(const Adaptor3d_Curve& theC, aStep(3) = aStepSV; // Find min approximation - Standard_Real aValue; + Standard_Real aValue = NAN; Extrema_GlobOptFuncCS aFunc(&theC, myS); math_PSO aPSO(&aFunc, theTUVinf, theTUVsup, aStep); aPSO.Perform(aParticles, theNbParticles, aValue, theTUV); @@ -496,7 +498,7 @@ void Extrema_GenExtCS::GlobMinConicS(const Adaptor3d_Curve& theC, { Standard_Integer aNbVar = 2; math_Vector anUVinf(1, aNbVar), anUVsup(1, aNbVar), anUV(1, aNbVar); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= aNbVar; ++i) { anUVinf(i) = theTUVinf(i + 1); @@ -535,7 +537,7 @@ void Extrema_GenExtCS::GlobMinConicS(const Adaptor3d_Curve& theC, for (Standard_Integer aSVI = 0; aSVI <= aVsample; aSVI++, aSV += aStepSV) { anUV(2) = aSV; - Standard_Real aSqDist; + Standard_Real aSqDist = NAN; if (!aFunc.Value(anUV, aSqDist)) { aSqDist = Precision::Infinite(); @@ -562,7 +564,7 @@ void Extrema_GenExtCS::GlobMinConicS(const Adaptor3d_Curve& theC, aStep(2) = aStepSV; // Find min approximation - Standard_Real aValue; + Standard_Real aValue = NAN; math_PSO aPSO(&aFunc, anUVinf, anUVsup, aStep); aPSO.Perform(aParticles, theNbParticles, aValue, anUV); // @@ -603,7 +605,7 @@ void Extrema_GenExtCS::GlobMinConicS(const Adaptor3d_Curve& theC, // PcPs is perpendicular to surface normal, it means that // aPOnC can be on surface, but far from aPOnS isBadSol = Standard_True; - Standard_Integer iu, iv; + Standard_Integer iu = 0, iv = 0; for (iu = -1; iu <= 1; ++iu) { Standard_Real u = anUV(1) + iu * aStepSU; @@ -736,7 +738,7 @@ void Extrema_GenExtCS::GlobMinCQuadric(const Adaptor3d_Curve& theC, for (Standard_Integer aCUI = 0; aCUI <= aNewCsample; aCUI++, aCT += aStepCT) { aT(1) = aCT; - Standard_Real aSqDist; + Standard_Real aSqDist = NAN; if (!aFunc.Value(aT, aSqDist)) { aSqDist = Precision::Infinite(); @@ -759,7 +761,7 @@ void Extrema_GenExtCS::GlobMinCQuadric(const Adaptor3d_Curve& theC, aStep(1) = aStepCT; // Find min approximation - Standard_Real aValue; + Standard_Real aValue = NAN; math_PSO aPSO(&aFunc, aTinf, aTsup, aStep); aPSO.Perform(aParticles, theNbParticles, aValue, aT); // diff --git a/src/Extrema/Extrema_GenExtCS.hxx b/src/Extrema/Extrema_GenExtCS.hxx index cd460ba7f2..e071c70159 100644 --- a/src/Extrema/Extrema_GenExtCS.hxx +++ b/src/Extrema/Extrema_GenExtCS.hxx @@ -116,20 +116,20 @@ private: private: - Standard_Boolean myDone; - Standard_Real mytmin; - Standard_Real mytsup; - Standard_Real myumin; - Standard_Real myusup; - Standard_Real myvmin; - Standard_Real myvsup; - Standard_Integer mytsample; - Standard_Integer myusample; - Standard_Integer myvsample; - Standard_Real mytol1; - Standard_Real mytol2; + Standard_Boolean myDone{}; + Standard_Real mytmin{}; + Standard_Real mytsup{}; + Standard_Real myumin{}; + Standard_Real myusup{}; + Standard_Real myvmin{}; + Standard_Real myvsup{}; + Standard_Integer mytsample{}; + Standard_Integer myusample{}; + Standard_Integer myvsample{}; + Standard_Real mytol1{}; + Standard_Real mytol2{}; Extrema_FuncExtCS myF; - const Adaptor3d_Surface* myS; + const Adaptor3d_Surface* myS{}; Handle(TColgp_HArray2OfPnt) mySurfPnts; }; diff --git a/src/Extrema/Extrema_GenExtPS.cxx b/src/Extrema/Extrema_GenExtPS.cxx index ed2b6373bc..1a8d57145e 100644 --- a/src/Extrema/Extrema_GenExtPS.cxx +++ b/src/Extrema/Extrema_GenExtPS.cxx @@ -16,6 +16,8 @@ // Modified by skv - Thu Sep 30 15:21:07 2004 OCC593 +#include + #include #include @@ -56,9 +58,9 @@ Bnd_Sphere& theSol) Bnd_Sphere& Sphere() const { return mySol; } - virtual Standard_Boolean Reject( const Bnd_Sphere &theBnd ) const = 0; + Standard_Boolean Reject( const Bnd_Sphere &theBnd ) const override = 0; - virtual Standard_Boolean Accept(const Standard_Integer& theObj) = 0; + Standard_Boolean Accept(const Standard_Integer& theObj) override = 0; protected: gp_Pnt myXYZ; const Handle(Bnd_HArray1OfSphere)& mySphereArray; @@ -83,7 +85,7 @@ public: Standard_Real MinDist() const { return myMinDist; } - Standard_Boolean Reject( const Bnd_Sphere &theBnd ) const + Standard_Boolean Reject( const Bnd_Sphere &theBnd ) const override { Bnd_SphereUBTreeSelectorMin* me = const_cast(this); @@ -91,7 +93,7 @@ public: return theBnd.IsOut( myXYZ.XYZ(), me->myMinDist ); } - Standard_Boolean Accept(const Standard_Integer&); + Standard_Boolean Accept(const Standard_Integer&) override; private: Standard_Real myMinDist; @@ -100,7 +102,7 @@ private: Standard_Boolean Bnd_SphereUBTreeSelectorMin::Accept(const Standard_Integer& theInd) { const Bnd_Sphere& aSph = mySphereArray->Value(theInd); - Standard_Real aCurDist; + Standard_Real aCurDist = NAN; // if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) < mySol.SquareDistance(myXYZ.XYZ()) ) if ( (aCurDist = aSph.Distance(myXYZ.XYZ())) < mySol.Distance(myXYZ.XYZ()) ) @@ -130,7 +132,7 @@ public: Standard_Real MaxDist() const { return myMaxDist; } - Standard_Boolean Reject( const Bnd_Sphere &theBnd ) const + Standard_Boolean Reject( const Bnd_Sphere &theBnd ) const override { Bnd_SphereUBTreeSelectorMax* me = const_cast(this); @@ -138,7 +140,7 @@ public: return theBnd.IsOut( myXYZ.XYZ(), me->myMaxDist ); } - Standard_Boolean Accept(const Standard_Integer&); + Standard_Boolean Accept(const Standard_Integer&) override; private: Standard_Real myMaxDist; @@ -147,7 +149,7 @@ private: Standard_Boolean Bnd_SphereUBTreeSelectorMax::Accept(const Standard_Integer& theInd) { const Bnd_Sphere& aSph = mySphereArray->Value(theInd); - Standard_Real aCurDist; + Standard_Real aCurDist = NAN; // if ( (aCurDist = aSph.SquareDistance(myXYZ.XYZ())) > mySol.SquareDistance(myXYZ.XYZ()) ) if ( (aCurDist = aSph.Distance(myXYZ.XYZ())) > mySol.Distance(myXYZ.XYZ()) ) @@ -208,7 +210,7 @@ Processing: -----------------------------------------------------------------------------*/ Extrema_GenExtPS::Extrema_GenExtPS() -: myumin(0.0), +: myDone(Standard_False), myInit(Standard_False), myumin(0.0), myusup(0.0), myvmin(0.0), myvsup(0.0), @@ -216,12 +218,12 @@ Extrema_GenExtPS::Extrema_GenExtPS() myvsample(0), mytolu(0.0), mytolv(0.0), - myS(NULL) + myS(NULL), myFlag(Extrema_ExtFlag_MINMAX), myAlgo(Extrema_ExtAlgo_Grad) { - myDone = Standard_False; - myInit = Standard_False; - myFlag = Extrema_ExtFlag_MINMAX; - myAlgo = Extrema_ExtAlgo_Grad; + + + + } // ======================================================================= @@ -518,7 +520,7 @@ const Extrema_POnSurfParams& Extrema_GenExtPS::ComputeEdgeParameters void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint) { - Standard_Integer NoU, NoV; + Standard_Integer NoU = 0, NoV = 0; //if grid was already built skip its creation if (!myInit) { @@ -638,9 +640,9 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint) // { Point(i, j); Point(i + 1, j); Point(i + 1, j + 1); Point(i, j + 1) } // Or // { UEdge(i, j); VEdge(i + 1, j); UEdge(i, j + 1); VEdge(i, j) } - Standard_Real aSqrDist01; - Standard_Real aDiffDist; - Standard_Boolean isOut; + Standard_Real aSqrDist01 = NAN; + Standard_Real aDiffDist = NAN; + Standard_Boolean isOut = 0; for ( NoU = 1 ; NoU < myusample; NoU++ ) { for ( NoV = 1 ; NoV < myvsample; NoV++) { @@ -680,8 +682,8 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint) // Find closest point inside the face. Standard_Real aU[2]; Standard_Real aV[2]; - Standard_Real aUPar; - Standard_Real aVPar; + Standard_Real aUPar = NAN; + Standard_Real aVPar = NAN; // Compute U parameter. aUE0.Parameter(aU[0], aV[0]); @@ -720,7 +722,7 @@ static Standard_Real LengthOfIso(const Adaptor3d_Surface& theS, const GeomAbs_Is const Standard_Integer theNbPnts, const Standard_Real thePar) { Standard_Real aLen = 0.; - Standard_Integer i; + Standard_Integer i = 0; Standard_Real dPar = (thePar2 - thePar1) / (theNbPnts - 1); gp_Pnt aP1, aP2; Standard_Real aPar = thePar1 + dPar; @@ -836,7 +838,7 @@ void Extrema_GenExtPS::BuildTree() //build grid of parametric points myUParams = new TColStd_HArray1OfReal(1,myusample ); myVParams = new TColStd_HArray1OfReal(1,myvsample ); - Standard_Integer NoU, NoV; + Standard_Integer NoU = 0, NoV = 0; Standard_Real U = U0, V = V0; for ( NoU = 1 ; NoU <= myusample; NoU++, U += PasU) myUParams->SetValue(NoU, U); @@ -905,17 +907,17 @@ void Extrema_GenExtPS::Perform(const gp_Pnt& P) if(myAlgo == Extrema_ExtAlgo_Grad) { BuildGrid(P); - Standard_Integer NoU,NoV; + Standard_Integer NoU = 0,NoV = 0; if(myFlag == Extrema_ExtFlag_MIN || myFlag == Extrema_ExtFlag_MINMAX) { Extrema_ElementType anElemType; - Standard_Integer iU; - Standard_Integer iV; - Standard_Integer iU2; - Standard_Integer iV2; - Standard_Boolean isMin; - Standard_Integer i; + Standard_Integer iU = 0; + Standard_Integer iV = 0; + Standard_Integer iU2 = 0; + Standard_Integer iV2 = 0; + Standard_Boolean isMin = 0; + Standard_Integer i = 0; for (NoU = 1; NoU < myusample; NoU++) { for (NoV = 1; NoV < myvsample; NoV++) { @@ -993,7 +995,7 @@ void Extrema_GenExtPS::Perform(const gp_Pnt& P) if(myFlag == Extrema_ExtFlag_MAX || myFlag == Extrema_ExtFlag_MINMAX) { - Standard_Real Dist; + Standard_Real Dist = NAN; for (NoU = 1; NoU <= myusample; NoU++) { diff --git a/src/Extrema/Extrema_GenExtPS.hxx b/src/Extrema/Extrema_GenExtPS.hxx index 61d3b8c769..d2aad5f1f6 100644 --- a/src/Extrema/Extrema_GenExtPS.hxx +++ b/src/Extrema/Extrema_GenExtPS.hxx @@ -119,22 +119,22 @@ private: private: - Standard_Boolean myDone; - Standard_Boolean myInit; - Standard_Real myumin; - Standard_Real myusup; - Standard_Real myvmin; - Standard_Real myvsup; - Standard_Integer myusample; - Standard_Integer myvsample; - Standard_Real mytolu; - Standard_Real mytolv; + Standard_Boolean myDone{}; + Standard_Boolean myInit{}; + Standard_Real myumin{}; + Standard_Real myusup{}; + Standard_Real myvmin{}; + Standard_Real myvsup{}; + Standard_Integer myusample{}; + Standard_Integer myvsample{}; + Standard_Real mytolu{}; + Standard_Real mytolv{}; Extrema_Array2OfPOnSurfParams myPoints; Extrema_HUBTreeOfSphere mySphereUBTree; Handle(Bnd_HArray1OfSphere) mySphereArray; Extrema_FuncPSNorm myF; - const Adaptor3d_Surface* myS; + const Adaptor3d_Surface* myS{}; Extrema_ExtFlag myFlag; Extrema_ExtAlgo myAlgo; Handle(TColStd_HArray1OfReal) myUParams; diff --git a/src/Extrema/Extrema_GenExtSS.cxx b/src/Extrema/Extrema_GenExtSS.cxx index b56eca7397..0b34eb5c2f 100644 --- a/src/Extrema/Extrema_GenExtSS.cxx +++ b/src/Extrema/Extrema_GenExtSS.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -38,18 +40,18 @@ public: { } - Standard_EXPORT Standard_Integer NbVariables() const + Standard_EXPORT Standard_Integer NbVariables() const override { return 4; } - Standard_EXPORT virtual Standard_Boolean Value(const math_Vector& X,Standard_Real& F) + Standard_EXPORT Standard_Boolean Value(const math_Vector& X,Standard_Real& F) override { F = myS1->Value(X(1), X(2)).SquareDistance(myS2->Value(X(3), X(4))); return true; } - Standard_EXPORT Standard_Boolean Gradient(const math_Vector& X,math_Vector& G) + Standard_EXPORT Standard_Boolean Gradient(const math_Vector& X,math_Vector& G) override { gp_Pnt P1, P2; gp_Vec Du1s1, Dv1s1; @@ -67,7 +69,7 @@ public: return true; } - Standard_EXPORT virtual Standard_Boolean Values(const math_Vector& X,Standard_Real& F,math_Vector& G) + Standard_EXPORT Standard_Boolean Values(const math_Vector& X,Standard_Real& F,math_Vector& G) override { F = myS1->Value(X(1), X(2)).SquareDistance(myS2->Value(X(3), X(4))); @@ -100,7 +102,7 @@ private: //purpose : //======================================================================= Extrema_GenExtSS::Extrema_GenExtSS() -: myu1min(0.0), +: myDone(Standard_False), myInit(Standard_False), myu1min(0.0), myu1sup(0.0), myv1min(0.0), myv1sup(0.0), @@ -114,8 +116,8 @@ Extrema_GenExtSS::Extrema_GenExtSS() mytol2(0.0), myS2(NULL) { - myDone = Standard_False; - myInit = Standard_False; + + } // ======================================================================= @@ -223,8 +225,8 @@ void Extrema_GenExtSS::Initialize(const Adaptor3d_Surface& S2, // Calcul des distances - Standard_Integer NoU, NoV; - Standard_Real U, V; + Standard_Integer NoU = 0, NoV = 0; + Standard_Real U = NAN, V = NAN; for ( NoU = 1, U = U0; NoU <= myusample; NoU++, U += PasU) { for ( NoV = 1, V = V0; NoV <= myvsample; NoV++, V += PasV) { P1 = myS2->Value(U, V); @@ -267,8 +269,8 @@ void Extrema_GenExtSS::Perform(const Adaptor3d_Surface& S1, myv1sup = V1sup; mytol1 = Tol1; - Standard_Real U1, V1, U2, V2; - Standard_Integer NoU1, NoV1, NoU2, NoV2; + Standard_Real U1 = NAN, V1 = NAN, U2 = NAN, V2 = NAN; + Standard_Integer NoU1 = 0, NoV1 = 0, NoU2 = 0, NoV2 = 0; gp_Pnt P1, P2; // Parametrage de l echantillon sur S1 @@ -322,7 +324,7 @@ b- Calcul des minima: UVsup(4) = myv2sup; - Standard_Real distmin = RealLast(), distmax = 0.0, TheDist; + Standard_Real distmin = RealLast(), distmax = 0.0, TheDist = NAN; Standard_Integer N1Umin=0,N1Vmin=0,N2Umin=0,N2Vmin=0; gp_Pnt PP1min, PP2min; diff --git a/src/Extrema/Extrema_GenExtSS.hxx b/src/Extrema/Extrema_GenExtSS.hxx index d02f5c2575..a14306c634 100644 --- a/src/Extrema/Extrema_GenExtSS.hxx +++ b/src/Extrema/Extrema_GenExtSS.hxx @@ -97,24 +97,24 @@ private: private: - Standard_Boolean myDone; - Standard_Boolean myInit; - Standard_Real myu1min; - Standard_Real myu1sup; - Standard_Real myv1min; - Standard_Real myv1sup; - Standard_Real myu2min; - Standard_Real myu2sup; - Standard_Real myv2min; - Standard_Real myv2sup; - Standard_Integer myusample; - Standard_Integer myvsample; + Standard_Boolean myDone{}; + Standard_Boolean myInit{}; + Standard_Real myu1min{}; + Standard_Real myu1sup{}; + Standard_Real myv1min{}; + Standard_Real myv1sup{}; + Standard_Real myu2min{}; + Standard_Real myu2sup{}; + Standard_Real myv2min{}; + Standard_Real myv2sup{}; + Standard_Integer myusample{}; + Standard_Integer myvsample{}; Handle(TColgp_HArray2OfPnt) mypoints1; Handle(TColgp_HArray2OfPnt) mypoints2; - Standard_Real mytol1; - Standard_Real mytol2; + Standard_Real mytol1{}; + Standard_Real mytol2{}; Extrema_FuncExtSS myF; - const Adaptor3d_Surface* myS2; + const Adaptor3d_Surface* myS2{}; }; diff --git a/src/Extrema/Extrema_GenLocateExtCS.cxx b/src/Extrema/Extrema_GenLocateExtCS.cxx index 16e38a32a8..48407c799a 100644 --- a/src/Extrema/Extrema_GenLocateExtCS.cxx +++ b/src/Extrema/Extrema_GenLocateExtCS.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -66,11 +68,11 @@ void Extrema_GenLocateExtCS::Perform(const Adaptor3d_Curve& C, { myDone = Standard_False; - Standard_Real Tinf, Tsup; + Standard_Real Tinf = NAN, Tsup = NAN; Tinf = C.FirstParameter(); Tsup = C.LastParameter(); - Standard_Real Uinf, Usup, Vinf, Vsup; + Standard_Real Uinf = NAN, Usup = NAN, Vinf = NAN, Vsup = NAN; Uinf = S.FirstUParameter(); Usup = S.LastUParameter(); Vinf = S.FirstVParameter(); diff --git a/src/Extrema/Extrema_GenLocateExtCS.hxx b/src/Extrema/Extrema_GenLocateExtCS.hxx index 35b1373a56..d51e54e657 100644 --- a/src/Extrema/Extrema_GenLocateExtCS.hxx +++ b/src/Extrema/Extrema_GenLocateExtCS.hxx @@ -73,8 +73,8 @@ private: - Standard_Boolean myDone; - Standard_Real mySqDist; + Standard_Boolean myDone{}; + Standard_Real mySqDist{}; Extrema_POnCurv myPoint1; Extrema_POnSurf myPoint2; diff --git a/src/Extrema/Extrema_GenLocateExtPS.cxx b/src/Extrema/Extrema_GenLocateExtPS.cxx index fc2035b87c..12699dcaab 100644 --- a/src/Extrema/Extrema_GenLocateExtPS.cxx +++ b/src/Extrema/Extrema_GenLocateExtPS.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -38,7 +40,7 @@ static void CorrectTol(const Standard_Real theU0, const Standard_Real theV0, if (epsu > anEpsRef) { Standard_Integer n = RealToInt(tolog10 * Log(epsu / anEpsRef) + 1) + 1; - Standard_Integer i; + Standard_Integer i = 0; Standard_Real tol = aTolRef; for (i = 1; i <= n; ++i) { @@ -50,7 +52,7 @@ static void CorrectTol(const Standard_Real theU0, const Standard_Real theV0, if (epsv > anEpsRef) { Standard_Integer n = RealToInt(tolog10 * Log(epsv / anEpsRef) + 1) + 1; - Standard_Integer i; + Standard_Integer i = 0; Standard_Real tol = aTolRef; for (i = 1; i <= n; ++i) { @@ -69,10 +71,10 @@ Standard_Boolean Extrema_GenLocateExtPS::IsMinDist(const gp_Pnt& theP, const Ada { Standard_Real du = Max(theS.UResolution(10.*Precision::Confusion()), 10.*Precision::PConfusion()); Standard_Real dv = Max(theS.VResolution(10.*Precision::Confusion()), 10.*Precision::PConfusion()); - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; gp_Pnt aP0 = theS.Value(theU0, theV0); Standard_Real d0 = theP.SquareDistance(aP0); - Standard_Integer iu, iv; + Standard_Integer iu = 0, iv = 0; for (iu = -1; iu <= 1; ++iu) { u = theU0 + iu * du; @@ -207,7 +209,7 @@ void Extrema_GenLocateExtPS::Perform(const gp_Pnt& theP, Standard_Real aNbExt = F.NbExt(); mySqDist = F.SquareDistance(1); myPoint = F.Point(1); - Standard_Integer i; + Standard_Integer i = 0; for (i = 2; i <= aNbExt; ++i) { if (F.SquareDistance(i) < mySqDist) diff --git a/src/Extrema/Extrema_GenLocateExtSS.cxx b/src/Extrema/Extrema_GenLocateExtSS.cxx index 48a1441f43..4639d2dc1d 100644 --- a/src/Extrema/Extrema_GenLocateExtSS.cxx +++ b/src/Extrema/Extrema_GenLocateExtSS.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -67,13 +69,13 @@ void Extrema_GenLocateExtSS::Perform(const Adaptor3d_Surface& S1, { myDone = Standard_False; - Standard_Real Uinf1, Usup1, Vinf1, Vsup1; + Standard_Real Uinf1 = NAN, Usup1 = NAN, Vinf1 = NAN, Vsup1 = NAN; Uinf1 = S1.FirstUParameter(); Usup1 = S1.LastUParameter(); Vinf1 = S1.FirstVParameter(); Vsup1 = S1.LastVParameter(); - Standard_Real Uinf2, Usup2, Vinf2, Vsup2; + Standard_Real Uinf2 = NAN, Usup2 = NAN, Vinf2 = NAN, Vsup2 = NAN; Uinf2 = S2.FirstUParameter(); Usup2 = S2.LastUParameter(); Vinf2 = S2.FirstVParameter(); diff --git a/src/Extrema/Extrema_GenLocateExtSS.hxx b/src/Extrema/Extrema_GenLocateExtSS.hxx index c8ee0429b5..898fa7f0b4 100644 --- a/src/Extrema/Extrema_GenLocateExtSS.hxx +++ b/src/Extrema/Extrema_GenLocateExtSS.hxx @@ -71,8 +71,8 @@ private: - Standard_Boolean myDone; - Standard_Real mySqDist; + Standard_Boolean myDone{}; + Standard_Real mySqDist{}; Extrema_POnSurf myPoint1; Extrema_POnSurf myPoint2; diff --git a/src/Extrema/Extrema_GlobOptFuncCC.cxx b/src/Extrema/Extrema_GlobOptFuncCC.cxx index 93b5fd60b0..19a384b915 100644 --- a/src/Extrema/Extrema_GlobOptFuncCC.cxx +++ b/src/Extrema/Extrema_GlobOptFuncCC.cxx @@ -224,9 +224,9 @@ Extrema_GlobOptFuncCCC0::Extrema_GlobOptFuncCCC0(const Adaptor3d_Curve& C1, : myC1_3d(&C1), myC2_3d(&C2), myC1_2d(NULL), - myC2_2d(NULL) + myC2_2d(NULL), myType(1) { - myType = 1; + } //======================================================================= @@ -238,9 +238,9 @@ Extrema_GlobOptFuncCCC0::Extrema_GlobOptFuncCCC0(const Adaptor2d_Curve2d& C1, : myC1_3d(NULL), myC2_3d(NULL), myC1_2d(&C1), - myC2_2d(&C2) + myC2_2d(&C2), myType(2) { - myType = 2; + } @@ -276,9 +276,9 @@ Extrema_GlobOptFuncCCC1::Extrema_GlobOptFuncCCC1(const Adaptor3d_Curve& C1, : myC1_3d(&C1), myC2_3d(&C2), myC1_2d(NULL), - myC2_2d(NULL) + myC2_2d(NULL), myType(1) { - myType = 1; + } //======================================================================= @@ -290,9 +290,9 @@ Extrema_GlobOptFuncCCC1::Extrema_GlobOptFuncCCC1(const Adaptor2d_Curve2d& C1, : myC1_3d(NULL), myC2_3d(NULL), myC1_2d(&C1), - myC2_2d(&C2) + myC2_2d(&C2), myType(2) { - myType = 2; + } //======================================================================= @@ -348,9 +348,9 @@ Extrema_GlobOptFuncCCC2::Extrema_GlobOptFuncCCC2(const Adaptor3d_Curve& C1, : myC1_3d(&C1), myC2_3d(&C2), myC1_2d(NULL), - myC2_2d(NULL) + myC2_2d(NULL), myType(1) { - myType = 1; + } //======================================================================= @@ -362,9 +362,9 @@ Extrema_GlobOptFuncCCC2::Extrema_GlobOptFuncCCC2(const Adaptor2d_Curve2d& C1, : myC1_3d(NULL), myC2_3d(NULL), myC1_2d(&C1), - myC2_2d(&C2) + myC2_2d(&C2), myType(2) { - myType = 2; + } //======================================================================= diff --git a/src/Extrema/Extrema_GlobOptFuncCQuadric.cxx b/src/Extrema/Extrema_GlobOptFuncCQuadric.cxx index 26250f8474..eb256d4331 100644 --- a/src/Extrema/Extrema_GlobOptFuncCQuadric.cxx +++ b/src/Extrema/Extrema_GlobOptFuncCQuadric.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement +#include + #include #include @@ -25,7 +27,7 @@ void Extrema_GlobOptFuncCQuadric::value(Standard_Real ct, Standard_Real &F) { - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; // gp_Pnt aCP = myC->Value(ct); switch (mySType) @@ -71,7 +73,7 @@ void Extrema_GlobOptFuncCQuadric::value(Standard_Real ct, gp_Pnt aPS = myS->Value(u, v); F = Min(F, aCP.SquareDistance(aPS)); } - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i < 4; ++i) { F = Min(F, aCP.SquareDistance(myPTrim[i])); @@ -101,10 +103,10 @@ Standard_Boolean Extrema_GlobOptFuncCQuadric::checkInputData(const math_Vector //======================================================================= Extrema_GlobOptFuncCQuadric::Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C, const Adaptor3d_Surface *S) -: myC(C) +: myC(C), myTf(myC->FirstParameter()), myTl(myC->LastParameter()) { - myTf = myC->FirstParameter(); - myTl = myC->LastParameter(); + + Standard_Real anUf = S->FirstUParameter(), anUl = S->LastUParameter(); Standard_Real aVf = S->FirstVParameter(), aVl = S->LastVParameter(); LoadQuad(S, anUf, anUl, aVf, aVl); @@ -114,10 +116,10 @@ Extrema_GlobOptFuncCQuadric::Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve //purpose : Constructor //======================================================================= Extrema_GlobOptFuncCQuadric::Extrema_GlobOptFuncCQuadric(const Adaptor3d_Curve *C) - : myC(C) + : myC(C), myTf(myC->FirstParameter()), myTl(myC->LastParameter()) { - myTf = myC->FirstParameter(); - myTl = myC->LastParameter(); + + } //======================================================================= //function : Extrema_GlobOptFuncCQuadric @@ -209,7 +211,7 @@ Standard_Integer Extrema_GlobOptFuncCQuadric::NbVariables() const Standard_Boolean Extrema_GlobOptFuncCQuadric::Value(const math_Vector &X, Standard_Real &F) { - Standard_Real ct; + Standard_Real ct = NAN; if (!checkInputData(X, ct)) return Standard_False; @@ -228,7 +230,7 @@ Standard_Boolean Extrema_GlobOptFuncCQuadric::Value(const math_Vector &X, void Extrema_GlobOptFuncCQuadric::QuadricParameters(const math_Vector& theCT, math_Vector& theUV ) const { - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; // //Arrays of extremity points parameters correspond to array of corner //points myPTrim[] @@ -279,7 +281,7 @@ void Extrema_GlobOptFuncCQuadric::QuadricParameters(const math_Vector& theCT, gp_Pnt aPS = myS->Value(u, v); F = aCP.SquareDistance(aPS); } - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i < 4; ++i) { Standard_Real Fi = aCP.SquareDistance(myPTrim[i]); diff --git a/src/Extrema/Extrema_GlobOptFuncCQuadric.hxx b/src/Extrema/Extrema_GlobOptFuncCQuadric.hxx index cb32bbed1b..5d9505eb42 100644 --- a/src/Extrema/Extrema_GlobOptFuncCQuadric.hxx +++ b/src/Extrema/Extrema_GlobOptFuncCQuadric.hxx @@ -64,7 +64,7 @@ private: const Adaptor3d_Curve *myC; - const Adaptor3d_Surface *myS; + const Adaptor3d_Surface *myS{}; GeomAbs_SurfaceType mySType; gp_Pln myPln; gp_Cone myCone; @@ -75,10 +75,10 @@ private: // Boundaries Standard_Real myTf; Standard_Real myTl; - Standard_Real myUf; - Standard_Real myUl; - Standard_Real myVf; - Standard_Real myVl; + Standard_Real myUf{}; + Standard_Real myUl{}; + Standard_Real myVf{}; + Standard_Real myVl{}; }; diff --git a/src/Extrema/Extrema_GlobOptFuncCS.cxx b/src/Extrema/Extrema_GlobOptFuncCS.cxx index 8c3ba28287..64d7b54a15 100644 --- a/src/Extrema/Extrema_GlobOptFuncCS.cxx +++ b/src/Extrema/Extrema_GlobOptFuncCS.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement +#include + #include #include @@ -173,7 +175,7 @@ Standard_Integer Extrema_GlobOptFuncCS::NbVariables() const Standard_Boolean Extrema_GlobOptFuncCS::Value(const math_Vector &X, Standard_Real &F) { - Standard_Real cu, su, sv; + Standard_Real cu = NAN, su = NAN, sv = NAN; if (!checkInputData(X, cu, su, sv)) return Standard_False; @@ -188,7 +190,7 @@ Standard_Boolean Extrema_GlobOptFuncCS::Value(const math_Vector &X, Standard_Boolean Extrema_GlobOptFuncCS::Gradient(const math_Vector &X, math_Vector &G) { - Standard_Real cu, su, sv; + Standard_Real cu = NAN, su = NAN, sv = NAN; if (!checkInputData(X, cu, su, sv)) return Standard_False; @@ -204,7 +206,7 @@ Standard_Boolean Extrema_GlobOptFuncCS::Values(const math_Vector &X, Standard_Real &F, math_Vector &G) { - Standard_Real cu, su, sv; + Standard_Real cu = NAN, su = NAN, sv = NAN; if (!checkInputData(X, cu, su, sv)) return Standard_False; @@ -222,7 +224,7 @@ Standard_Boolean Extrema_GlobOptFuncCS::Values(const math_Vector &X, math_Vector &G, math_Matrix &H) { - Standard_Real cu, su, sv; + Standard_Real cu = NAN, su = NAN, sv = NAN; if (!checkInputData(X, cu, su, sv)) return Standard_False; diff --git a/src/Extrema/Extrema_GlobOptFuncConicS.cxx b/src/Extrema/Extrema_GlobOptFuncConicS.cxx index 8ea81b15be..7a6bebbcc1 100644 --- a/src/Extrema/Extrema_GlobOptFuncConicS.cxx +++ b/src/Extrema/Extrema_GlobOptFuncConicS.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement +#include + #include #include @@ -26,7 +28,7 @@ void Extrema_GlobOptFuncConicS::value(Standard_Real su, Standard_Real sv, Standard_Real &F) { - Standard_Real ct; + Standard_Real ct = NAN; gp_Pnt aPS = myS->Value(su, sv); switch (myCType) { @@ -188,7 +190,7 @@ Standard_Integer Extrema_GlobOptFuncConicS::NbVariables() const Standard_Boolean Extrema_GlobOptFuncConicS::Value(const math_Vector &X, Standard_Real &F) { - Standard_Real su, sv; + Standard_Real su = NAN, sv = NAN; if (!checkInputData(X, su, sv)) return Standard_False; @@ -206,7 +208,7 @@ Standard_Boolean Extrema_GlobOptFuncConicS::Value(const math_Vector &X, //======================================================================= Standard_Real Extrema_GlobOptFuncConicS::ConicParameter(const math_Vector& theUV) const { - Standard_Real ct; + Standard_Real ct = NAN; gp_Pnt aPS = myS->Value(theUV(1), theUV(2)); switch (myCType) { diff --git a/src/Extrema/Extrema_GlobOptFuncConicS.hxx b/src/Extrema/Extrema_GlobOptFuncConicS.hxx index 8329a0f699..e2e899af6f 100644 --- a/src/Extrema/Extrema_GlobOptFuncConicS.hxx +++ b/src/Extrema/Extrema_GlobOptFuncConicS.hxx @@ -64,7 +64,7 @@ private: Standard_Real &F); - const Adaptor3d_Curve *myC; + const Adaptor3d_Curve *myC{}; const Adaptor3d_Surface *myS; GeomAbs_CurveType myCType; gp_Lin myLin; @@ -75,8 +75,8 @@ private: gp_Pnt myCPf; gp_Pnt myCPl; //Boundaries - Standard_Real myTf; - Standard_Real myTl; + Standard_Real myTf{}; + Standard_Real myTl{}; Standard_Real myUf; Standard_Real myUl; Standard_Real myVf; diff --git a/src/FEmTool/FEmTool_Assembly.cxx b/src/FEmTool/FEmTool_Assembly.cxx index 699698212f..6cc7e48ba2 100644 --- a/src/FEmTool/FEmTool_Assembly.cxx +++ b/src/FEmTool/FEmTool_Assembly.cxx @@ -28,9 +28,9 @@ //---------------------------------------------------------------------------- static Standard_Integer MinIndex(const Handle(FEmTool_HAssemblyTable)& Table) { - Standard_Integer dim, el, nvar, Imin; + Standard_Integer dim = 0, el = 0, nvar = 0, Imin = 0; Standard_Integer diml = Table->LowerRow(), dimu = Table->UpperRow(), - ell = Table->LowerCol(), elu = Table->UpperCol(), nvarl, nvaru; + ell = Table->LowerCol(), elu = Table->UpperCol(), nvarl = 0, nvaru = 0; Handle(TColStd_HArray1OfInteger) T = Table->Value(diml, ell); @@ -54,9 +54,9 @@ static Standard_Integer MinIndex(const Handle(FEmTool_HAssemblyTable)& Table) //---------------------------------------------------------------------------- static Standard_Integer MaxIndex(const Handle(FEmTool_HAssemblyTable)& Table) { - Standard_Integer dim, el, nvar, Imax; + Standard_Integer dim = 0, el = 0, nvar = 0, Imax = 0; Standard_Integer diml = Table->LowerRow(), dimu = Table->UpperRow(), - ell = Table->LowerCol(), elu = Table->UpperCol(), nvarl, nvaru; + ell = Table->LowerCol(), elu = Table->UpperCol(), nvarl = 0, nvaru = 0; Handle(TColStd_HArray1OfInteger) T = Table->Value(diml, ell); @@ -83,20 +83,17 @@ static Standard_Integer MaxIndex(const Handle(FEmTool_HAssemblyTable)& Table) //======================================================================= FEmTool_Assembly::FEmTool_Assembly(const TColStd_Array2OfInteger& Dependence, const Handle(FEmTool_HAssemblyTable)& Table): - myDepTable(1, Dependence.ColLength(), 1, Dependence.RowLength()), + myDepTable(Dependence), + myRefTable(Table), + IsSolved(Standard_False), B(MinIndex(Table), MaxIndex(Table)) - { - IsSolved = Standard_False; - myDepTable = Dependence; - myRefTable = Table; - TColStd_Array1OfInteger FirstIndexes(1, B.Length()); FirstIndexes.Init(B.Length()); - Standard_Integer dim, el, nvar, Imin, I0 = 1 - B.Lower(), i; + Standard_Integer dim = 0, el = 0, nvar = 0, Imin = 0, I0 = 1 - B.Lower(), i = 0; Standard_Integer diml = Table->LowerRow(), dimu = Table->UpperRow(), - ell = Table->LowerCol(), elu = Table->UpperCol(), nvarl, nvaru; + ell = Table->LowerCol(), elu = Table->UpperCol(), nvarl = 0, nvaru = 0; Handle(TColStd_HArray1OfInteger) T; for(dim = diml; dim <= dimu; dim++) @@ -148,7 +145,7 @@ void FEmTool_Assembly::AddMatrix(const Standard_Integer Element, Standard_Integer nvarl = T1.Lower(), nvaru = Min(T1.Upper(), nvarl + Mat.RowNumber() - 1); - Standard_Integer I, J, I0 = 1 - B.Lower(), i, ii, j, + Standard_Integer I = 0, J = 0, I0 = 1 - B.Lower(), i = 0, ii = 0, j = 0, i0 = Mat.LowerRow() - nvarl, j0 = Mat.LowerCol() - nvarl; @@ -187,7 +184,7 @@ void FEmTool_Assembly::AddVector(const Standard_Integer Element, i0 = Vec.Lower() - nvarl; // Standard_Integer I, i; - Standard_Integer i; + Standard_Integer i = 0; for(i = nvarl; i <= nvaru; i++) B(T(i)) += Vec(i0 + i); @@ -230,8 +227,8 @@ Standard_Boolean FEmTool_Assembly::Solve() TColStd_Array1OfInteger FirstIndexes(1, G.Length()); //----------------------------------------------------------------- TColStd_Array2OfInteger H1(1, NbGlobVar(), 1, NbGlobVar()); H1.Init(1); - Standard_Integer i, j, k, l, BlockBeg = 1, BlockEnd; - Standard_Boolean Block, Zero; + Standard_Integer i = 0, j = 0, k = 0, l = 0, BlockBeg = 1, BlockEnd = 0; + Standard_Boolean Block = 0, Zero = 0; for(i = 2; i <= NbGlobVar(); i++) { BlockEnd = i - 1; if(!H->IsInProfile(i, BlockEnd)) { @@ -293,7 +290,7 @@ Standard_Boolean FEmTool_Assembly::Solve() } GHGt->Init(0.); - Standard_Integer i, j, k; + Standard_Integer i = 0, j = 0, k = 0; FEmTool_ListIteratorOfListOfVectors Iter; for(i = 1; i <= G.Length(); i++) { @@ -369,7 +366,7 @@ void FEmTool_Assembly::Solution(math_Vector& Solution) const H->Solve(B, v1); math_Vector l(1, G.Length()), v2(1, G.Length()); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; FEmTool_ListIteratorOfListOfVectors Iter; for(i = 1; i <= G.Length(); i++) { @@ -434,7 +431,7 @@ void FEmTool_Assembly::ResetConstraint() void FEmTool_Assembly::NullifyConstraint() { FEmTool_ListIteratorOfListOfVectors Iter; - Standard_Integer i; + Standard_Integer i = 0; for(i = 1; i <= G.Length(); i++) { @@ -468,7 +465,7 @@ void FEmTool_Assembly::AddConstraint(const Standard_Integer IndexofConstraint, FEmTool_ListOfVectors& L = G.ChangeValue(IndexofConstraint); Handle(TColStd_HArray1OfInteger) Indexes = myRefTable->Value(Dimension,Element); - Standard_Integer i, Imax = 0, Imin = NbGlobVar(); + Standard_Integer i = 0, Imax = 0, Imin = NbGlobVar(); for(i = Indexes->Lower(); i <= Indexes->Upper(); i++) { Imin = Min(Imin, Indexes->Value(i)); diff --git a/src/FEmTool/FEmTool_Curve.cxx b/src/FEmTool/FEmTool_Curve.cxx index 4f6d668231..3e0f952c16 100644 --- a/src/FEmTool/FEmTool_Curve.cxx +++ b/src/FEmTool/FEmTool_Curve.cxx @@ -18,6 +18,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -35,7 +37,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, const Handle(PLib_Base)& TheBase, const Standard_Real) : myNbElements(NbElements), myDimension(Dimension), - myBase(TheBase), myDegree(1, myNbElements), + myBase(TheBase), myKnots(new TColStd_HArray1OfReal(1, myNbElements + 1)), myDegree(1, myNbElements), myCoeff(1, myDimension*myNbElements*(myBase->WorkDegree() + 1)), myPoly(1, myDimension*myNbElements*(myBase->WorkDegree() + 1)), myDeri(1, myDimension*myNbElements*(myBase->WorkDegree())), @@ -44,7 +46,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, HasSecn(1, myNbElements), myLength(1, myNbElements), myIndex(0) { - myKnots = new TColStd_HArray1OfReal(1, myNbElements + 1); + myDegree.Init(myBase->WorkDegree()); HasPoly.Init(0); HasDeri.Init(0); @@ -66,7 +68,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, void FEmTool_Curve::SetElement(const Standard_Integer IndexOfElement, const TColStd_Array2OfReal& Coeffs) { - Standard_Integer i, j, degBase, deg; + Standard_Integer i = 0, j = 0, degBase = 0, deg = 0; if (IndexOfElement > myNbElements || IndexOfElement < 1) throw Standard_OutOfRange(); degBase = myBase->WorkDegree(); deg = myDegree(IndexOfElement); @@ -80,7 +82,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, } Standard_Real stenor = (myKnots->Value(IndexOfElement + 1) - myKnots->Value(IndexOfElement)) / 2., - mfact; + mfact = NAN; Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase); i1 = iBase; @@ -105,7 +107,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, //======================================================================= void FEmTool_Curve::GetElement(const Standard_Integer IndexOfElement, TColStd_Array2OfReal& Coeffs) { - Standard_Integer i, j, degBase, deg; + Standard_Integer i = 0, j = 0, degBase = 0, deg = 0; if (IndexOfElement > myNbElements || IndexOfElement < 1) throw Standard_OutOfRange(); degBase = myBase->WorkDegree(); deg = myDegree(IndexOfElement); @@ -119,7 +121,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, } Standard_Real stenor = 2. / (myKnots->Value(IndexOfElement + 1) - myKnots->Value(IndexOfElement)), - mfact; + mfact = NAN; Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase); @@ -143,7 +145,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, void FEmTool_Curve::GetPolynom(TColStd_Array1OfReal& Coeffs) { - Standard_Integer IndexOfElement, i, di = Coeffs.Lower() - myPoly.Lower(); + Standard_Integer IndexOfElement = 0, i = 0, di = Coeffs.Lower() - myPoly.Lower(); for(IndexOfElement = 1; IndexOfElement <= myNbElements; IndexOfElement++) @@ -161,8 +163,8 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, //======================================================================= void FEmTool_Curve::D0(const Standard_Real U, TColStd_Array1OfReal& Pnt) { - Standard_Integer deg; - Standard_Real S; + Standard_Integer deg = 0; + Standard_Real S = NAN; if (!myIndex || (UUl) || (myKnots->Value(myIndex)!=Uf) || @@ -197,8 +199,8 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, //======================================================================= void FEmTool_Curve::D1(const Standard_Real U, TColStd_Array1OfReal& Vec) { - Standard_Integer deg, i; - Standard_Real S; + Standard_Integer deg = 0, i = 0; + Standard_Real S = NAN; if (!myIndex || (UUl) || (myKnots->Value(myIndex)!=Uf) || @@ -239,8 +241,8 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, //======================================================================= void FEmTool_Curve::D2(const Standard_Real U, TColStd_Array1OfReal& Vec) { - Standard_Integer deg, i; - Standard_Real S; + Standard_Integer deg = 0, i = 0; + Standard_Real S = NAN; if (!myIndex || (UUl) || (myKnots->Value(myIndex)!=Uf) || @@ -283,7 +285,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, const Standard_Real LastU, Standard_Real& Length) { - Standard_Integer Low, High, deg, degBase, i, Ptr; + Standard_Integer Low = 0, High = 0, deg = 0, degBase = 0, i = 0, Ptr = 0; if(FirstU > LastU) throw Standard_OutOfRange("FEmTool_Curve::Length"); if(myKnots->Value(1) > FirstU) Low = 1; @@ -298,11 +300,11 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, if(LastU >= myKnots->Value(High) && LastU <= myKnots->Value(High+1)) break; if(myKnots->Value(myNbElements + 1) < LastU) High = myNbElements; - Standard_Real Li; + Standard_Real Li = NAN; degBase = myBase->WorkDegree(); Length = 0; - Standard_Real FirstS, LastS; + Standard_Real FirstS = NAN, LastS = NAN; FirstS = (2*FirstU - myKnots->Value(Low) - myKnots->Value(Low + 1))/ (myKnots->Value(Low + 1) - myKnots->Value(Low)); LastS = (2*LastU - myKnots->Value(High) - myKnots->Value(High + 1))/ @@ -454,7 +456,7 @@ FEmTool_Curve::FEmTool_Curve(const Standard_Integer Dimension, if (Order >=1) { Standard_Integer i1 = (Index - 1)*(degBase)*myDimension - myDimension, i2 = (Index - 1)*(degBase + 1)*myDimension; - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; if (!HasDeri.Value(Index)) { for(i = 1; i <= deg; i++) { i1 += myDimension; i2 += myDimension; diff --git a/src/FEmTool/FEmTool_Curve.hxx b/src/FEmTool/FEmTool_Curve.hxx index ae2e8b50d7..24b309e95b 100644 --- a/src/FEmTool/FEmTool_Curve.hxx +++ b/src/FEmTool/FEmTool_Curve.hxx @@ -99,12 +99,12 @@ private: TColStd_Array1OfInteger HasDeri; TColStd_Array1OfInteger HasSecn; TColStd_Array1OfReal myLength; - Standard_Real Uf; - Standard_Real Ul; - Standard_Real Denom; - Standard_Real USum; + Standard_Real Uf{}; + Standard_Real Ul{}; + Standard_Real Denom{}; + Standard_Real USum{}; Standard_Integer myIndex; - Standard_Integer myPtr; + Standard_Integer myPtr{}; }; diff --git a/src/FEmTool/FEmTool_ElementsOfRefMatrix.cxx b/src/FEmTool/FEmTool_ElementsOfRefMatrix.cxx index 500c2991ff..1e2f0bc14d 100644 --- a/src/FEmTool/FEmTool_ElementsOfRefMatrix.cxx +++ b/src/FEmTool/FEmTool_ElementsOfRefMatrix.cxx @@ -64,7 +64,7 @@ Standard_Boolean FEmTool_ElementsOfRefMatrix::Value(const math_Vector& X, math_V break; } - Standard_Integer i, j, ii = 0; + Standard_Integer i = 0, j = 0, ii = 0; for(i = 0; i<=myBase->WorkDegree(); i++) for(j = i; j<=myBase->WorkDegree(); j++) { F(F.Lower()+ii) = Basis(i)*Basis(j); ii++; diff --git a/src/FEmTool/FEmTool_LinearFlexion.cxx b/src/FEmTool/FEmTool_LinearFlexion.cxx index 48e99903df..558433e92d 100644 --- a/src/FEmTool/FEmTool_LinearFlexion.cxx +++ b/src/FEmTool/FEmTool_LinearFlexion.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -39,12 +41,12 @@ IMPLEMENT_STANDARD_RTTIEXT(FEmTool_LinearFlexion,FEmTool_ElementaryCriterion) //======================================================================= FEmTool_LinearFlexion::FEmTool_LinearFlexion(const Standard_Integer WorkDegree, const GeomAbs_Shape ConstraintOrder) - : RefMatrix(0,WorkDegree,0,WorkDegree) + : RefMatrix(0,WorkDegree,0,WorkDegree), myOrder(PLib::NivConstr(ConstraintOrder)) { static Standard_Integer Order = -333, WDeg = 14; static math_Vector MatrixElemts(0, ((WDeg+2)*(WDeg+1))/2 -1 ); - myOrder = PLib::NivConstr(ConstraintOrder); + if (myOrder != Order) { //Calculating RefMatrix @@ -61,7 +63,7 @@ FEmTool_LinearFlexion::FEmTool_LinearFlexion(const Standard_Integer WorkDegree, MatrixElemts = anInt.Value(); } - Standard_Integer i, j, ii, jj; + Standard_Integer i = 0, j = 0, ii = 0, jj = 0; for(ii = i = 0; i <= WorkDegree; i++) { RefMatrix(i, i) = MatrixElemts(ii); for(j = i+1, jj = ii+1; j <= WorkDegree; j++, jj++) { @@ -82,7 +84,7 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearFlexion::DependenceTable() const Handle(TColStd_HArray2OfInteger) DepTab = new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(), myCoeff->LowerCol(), myCoeff->UpperCol(),0); - Standard_Integer i; + Standard_Integer i = 0; for(i = myCoeff->LowerCol(); i <= myCoeff->UpperCol(); i++) DepTab->SetValue(i,i,1); return DepTab; @@ -97,15 +99,15 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearFlexion::DependenceTable() const Standard_Real FEmTool_LinearFlexion::Value() { Standard_Integer deg = Min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), - i, j, j0 = myCoeff->LowerRow(), degH = Min(2*myOrder+1, deg), - NbDim = myCoeff->RowLength(), dim; + i = 0, j = 0, j0 = myCoeff->LowerRow(), degH = Min(2*myOrder+1, deg), + NbDim = myCoeff->RowLength(), dim = 0; TColStd_Array2OfReal NewCoeff( 1, NbDim, 0, deg); Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./Pow(coeff,3), - mfact, Jline; + mfact = NAN, Jline = NAN; - Standard_Integer k1; + Standard_Integer k1 = 0; Standard_Real J = 0.; @@ -155,8 +157,8 @@ void FEmTool_LinearFlexion::Hessian(const Standard_Integer Dimension1, Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg); - Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./Pow(coeff,3), mfact; - Standard_Integer k1, k2, i, j; + Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./Pow(coeff,3), mfact = NAN; + Standard_Integer k1 = 0, k2 = 0, i = 0, j = 0; H.Init(0.); @@ -198,7 +200,7 @@ void FEmTool_LinearFlexion::Gradient(const Standard_Integer Dimension,math_Vecto math_Vector X(0,deg); math_Matrix H(0,deg,0,deg); - Standard_Integer i, i1 = myCoeff->LowerRow(); + Standard_Integer i = 0, i1 = myCoeff->LowerRow(); for(i = 0; i <= deg; i++) X(i) = myCoeff->Value(i1+i, Dimension); Hessian(Dimension, Dimension, H); diff --git a/src/FEmTool/FEmTool_LinearJerk.cxx b/src/FEmTool/FEmTool_LinearJerk.cxx index 6d19603443..fe089bf236 100644 --- a/src/FEmTool/FEmTool_LinearJerk.cxx +++ b/src/FEmTool/FEmTool_LinearJerk.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -35,12 +37,12 @@ IMPLEMENT_STANDARD_RTTIEXT(FEmTool_LinearJerk,FEmTool_ElementaryCriterion) FEmTool_LinearJerk::FEmTool_LinearJerk(const Standard_Integer WorkDegree, const GeomAbs_Shape ConstraintOrder): - RefMatrix(0,WorkDegree,0,WorkDegree) + RefMatrix(0,WorkDegree,0,WorkDegree), myOrder(PLib::NivConstr(ConstraintOrder)) { static Standard_Integer Order = -333, WDeg = 14; static math_Vector MatrixElemts(0, ((WDeg+2)*(WDeg+1))/2 -1 ); - myOrder = PLib::NivConstr(ConstraintOrder); + //Calculating RefMatrix @@ -63,7 +65,7 @@ FEmTool_LinearJerk::FEmTool_LinearJerk(const Standard_Integer WorkDegree, MatrixElemts = anInt.Value(); } - Standard_Integer i, j, ii, jj; + Standard_Integer i = 0, j = 0, ii = 0, jj = 0; for(ii=i = 0; i <= WorkDegree; i++) { RefMatrix(i, i) = MatrixElemts(ii); for(j = i+1, jj = ii+1; j <= WorkDegree; j++, jj++) { @@ -80,7 +82,7 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearJerk::DependenceTable() const Handle(TColStd_HArray2OfInteger) DepTab = new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(), myCoeff->LowerCol(), myCoeff->UpperCol(),0); - Standard_Integer i; + Standard_Integer i = 0; for(i = myCoeff->LowerCol(); i <= myCoeff->UpperCol(); i++) DepTab->SetValue(i,i,1); return DepTab; @@ -89,15 +91,15 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearJerk::DependenceTable() const Standard_Real FEmTool_LinearJerk::Value() { Standard_Integer deg = Min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), - i, j, j0 = myCoeff->LowerRow(), degH = Min(2*myOrder+1, deg), - NbDim = myCoeff->RowLength(), dim; + i = 0, j = 0, j0 = myCoeff->LowerRow(), degH = Min(2*myOrder+1, deg), + NbDim = myCoeff->RowLength(), dim = 0; TColStd_Array2OfReal NewCoeff( 1, NbDim, 0, deg); Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./Pow(coeff,5), - mfact, Jline; + mfact = NAN, Jline = NAN; - Standard_Integer k1; + Standard_Integer k1 = 0; Standard_Real J = 0.; @@ -147,8 +149,8 @@ void FEmTool_LinearJerk::Hessian(const Standard_Integer Dimension1, Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg); - Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./Pow(coeff,5), mfact; - Standard_Integer k1, k2, i, j, i0 = H.LowerRow(), j0 = H.LowerCol(), i1, j1; + Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./Pow(coeff,5), mfact = NAN; + Standard_Integer k1 = 0, k2 = 0, i = 0, j = 0, i0 = H.LowerRow(), j0 = H.LowerCol(), i1 = 0, j1 = 0; H.Init(0.); @@ -197,7 +199,7 @@ void FEmTool_LinearJerk::Gradient(const Standard_Integer Dimension,math_Vector& Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1); math_Vector X(0,deg); - Standard_Integer i, i1 = myCoeff->LowerRow(); + Standard_Integer i = 0, i1 = myCoeff->LowerRow(); for(i = 0; i <= deg; i++) X(i) = myCoeff->Value(i1+i, Dimension); math_Matrix H(0,deg,0,deg); diff --git a/src/FEmTool/FEmTool_LinearTension.cxx b/src/FEmTool/FEmTool_LinearTension.cxx index 62d60082a5..bdb5e7b105 100644 --- a/src/FEmTool/FEmTool_LinearTension.cxx +++ b/src/FEmTool/FEmTool_LinearTension.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -35,13 +37,13 @@ IMPLEMENT_STANDARD_RTTIEXT(FEmTool_LinearTension,FEmTool_ElementaryCriterion) FEmTool_LinearTension::FEmTool_LinearTension(const Standard_Integer WorkDegree, const GeomAbs_Shape ConstraintOrder): - RefMatrix(0,WorkDegree,0,WorkDegree) + RefMatrix(0,WorkDegree,0,WorkDegree), myOrder(PLib::NivConstr(ConstraintOrder)) { static Standard_Integer Order = -333, WDeg = 14; static math_Vector MatrixElemts(0, ((WDeg+2)*(WDeg+1))/2 -1 ); - myOrder = PLib::NivConstr(ConstraintOrder); + if (myOrder != Order) { //Calculating RefMatrix @@ -59,7 +61,7 @@ FEmTool_LinearTension::FEmTool_LinearTension(const Standard_Integer WorkDegree, MatrixElemts = anInt.Value(); } - Standard_Integer i, j, ii, jj; + Standard_Integer i = 0, j = 0, ii = 0, jj = 0; for(ii = i = 0; i <= WorkDegree; i++) { RefMatrix(i, i) = MatrixElemts(ii); for(j = i+1, jj = ii+1; j <= WorkDegree; j++, jj++) { @@ -76,7 +78,7 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearTension::DependenceTable() const Handle(TColStd_HArray2OfInteger) DepTab = new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(), myCoeff->LowerCol(), myCoeff->UpperCol(),0); - Standard_Integer i; + Standard_Integer i = 0; for(i=1; i<=myCoeff->RowLength(); i++) DepTab->SetValue(i,i,1); return DepTab; @@ -85,15 +87,15 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearTension::DependenceTable() const Standard_Real FEmTool_LinearTension::Value() { Standard_Integer deg = Min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), - i, j, j0 = myCoeff->LowerRow(), degH = Min(2*myOrder+1, deg), - NbDim = myCoeff->RowLength(), dim; + i = 0, j = 0, j0 = myCoeff->LowerRow(), degH = Min(2*myOrder+1, deg), + NbDim = myCoeff->RowLength(), dim = 0; TColStd_Array2OfReal NewCoeff( 1, NbDim, 0, deg); Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./coeff, - mfact, Jline; + mfact = NAN, Jline = NAN; - Standard_Integer k1; + Standard_Integer k1 = 0; Standard_Real J = 0.; @@ -145,8 +147,8 @@ void FEmTool_LinearTension::Hessian(const Standard_Integer Dimension1, Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg); - Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./coeff, mfact; - Standard_Integer k1, k2, i, j, i0 = H.LowerRow(), j0 = H.LowerCol(), i1, j1; + Standard_Real coeff = (myLast - myFirst)/2., cteh3 = 2./coeff, mfact = NAN; + Standard_Integer k1 = 0, k2 = 0, i = 0, j = 0, i0 = H.LowerRow(), j0 = H.LowerCol(), i1 = 0, j1 = 0; H.Init(0.); @@ -195,7 +197,7 @@ void FEmTool_LinearTension::Hessian(const Standard_Integer Dimension1, Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1); math_Vector X(0,deg); - Standard_Integer i, i1 = myCoeff->LowerRow(); + Standard_Integer i = 0, i1 = myCoeff->LowerRow(); for(i = 0; i <= deg; i++) X(i) = myCoeff->Value(i1+i, Dimension); math_Matrix H(0,deg,0,deg); diff --git a/src/FEmTool/FEmTool_ProfileMatrix.cxx b/src/FEmTool/FEmTool_ProfileMatrix.cxx index 1f4e900454..9afe6c49d7 100644 --- a/src/FEmTool/FEmTool_ProfileMatrix.cxx +++ b/src/FEmTool/FEmTool_ProfileMatrix.cxx @@ -19,6 +19,8 @@ #define No_Standard_DimensionError +#include + #include #include #include @@ -35,7 +37,7 @@ IMPLEMENT_STANDARD_RTTIEXT(FEmTool_ProfileMatrix,FEmTool_SparseMatrix) FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& FirstIndexes) : profile(1, 2, 1, FirstIndexes.Length()) { - Standard_Integer i, j, k, l; + Standard_Integer i = 0, j = 0, k = 0, l = 0; profile(1, 1) = 0; profile(2, 1) = 1; for(i = 2; i <= FirstIndexes.Length(); i++) { @@ -78,7 +80,7 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs Standard_Real& FEmTool_ProfileMatrix::ChangeValue(const Standard_Integer I, const Standard_Integer J) { - Standard_Integer Ind; + Standard_Integer Ind = 0; Ind = I-J; if (Ind < 0) { Ind = -Ind; @@ -100,8 +102,8 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs //======================================================================= Standard_Boolean FEmTool_ProfileMatrix::Decompose() { - Standard_Integer i, j, k, ik, jk, DiagAddr, CurrAddr, Kmin, Kj; - Standard_Real Sum, a, Eps = 1.e-32; + Standard_Integer i = 0, j = 0, k = 0, ik = 0, jk = 0, DiagAddr = 0, CurrAddr = 0, Kmin = 0, Kj = 0; + Standard_Real Sum = NAN, a = NAN, Eps = 1.e-32; SMatrix->Init(0.); Standard_Real * SMA = &SMatrix->ChangeValue(1); @@ -150,8 +152,8 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs { if (!IsDecomp) throw StdFail_NotDone("Decomposition must be done"); - Standard_Integer i, j, jj,DiagAddr, CurrAddr; - Standard_Real Sum; + Standard_Integer i = 0, j = 0, jj = 0,DiagAddr = 0, CurrAddr = 0; + Standard_Real Sum = NAN; Standard_Real * x = &X(X.Lower()); x--; @@ -204,7 +206,7 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs //======================================================================= void FEmTool_ProfileMatrix::Multiplied(const math_Vector& X,math_Vector& MX) const { - Standard_Integer i, j, jj, DiagAddr, CurrAddr; + Standard_Integer i = 0, j = 0, jj = 0, DiagAddr = 0, CurrAddr = 0; Standard_Real * m = &MX(MX.Lower()); m--; const Standard_Real * x = &X(X.Lower()); @@ -253,7 +255,7 @@ Standard_Boolean FEmTool_ProfileMatrix::IsInProfile(const Standard_Integer i, void FEmTool_ProfileMatrix::OutM() const { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; std::cout<<"Matrix A"< 0) { - Standard_ExtString anExtStr; + Standard_ExtString anExtStr = nullptr; #if OCCT_BINARY_FILE_DO_INVERSE TCollection_ExtendedString aCopy = aString; anExtStr = aCopy.ToExtString(); @@ -1550,7 +1550,7 @@ Standard_Integer FSD_BinaryFile::WriteExtendedString (Standard_OStream& const TCollection_ExtendedString& theString, const Standard_Boolean theOnlyCount) { - Standard_Integer aNumAndStrLen, anExtStrLen; + Standard_Integer aNumAndStrLen = 0, anExtStrLen = 0; anExtStrLen = theString.Length(); aNumAndStrLen = anExtStrLen * sizeof(Standard_ExtCharacter); @@ -1558,7 +1558,7 @@ Standard_Integer FSD_BinaryFile::WriteExtendedString (Standard_OStream& if (anExtStrLen > 0 && !theOnlyCount) { - Standard_ExtString anExtStr; + Standard_ExtString anExtStr = nullptr; #if OCCT_BINARY_FILE_DO_INVERSE TCollection_ExtendedString aCopy = theString; anExtStr = aCopy.ToExtString(); @@ -1759,7 +1759,7 @@ void FSD_BinaryFile::ReadHeaderData( Standard_IStream& theIStream, const Handle( TCollection_AsciiString uinfo,mStorageVersion,mDate,mSchemaName,mSchemaVersion,mApplicationVersion; TCollection_ExtendedString mApplicationName,mDataType; TColStd_SequenceOfAsciiString mUserInfo; - Standard_Integer mNBObj; + Standard_Integer mNBObj = 0; FSD_BinaryFile::GetInteger (theIStream, mNBObj); FSD_BinaryFile::ReadString (theIStream, mStorageVersion); @@ -1816,7 +1816,7 @@ Standard_Real FSD_BinaryFile::InverseReal (const Standard_Real theValue) union { Standard_Integer i[2]; Standard_Real aValue; - } aWrapUnion; + } aWrapUnion{}; aWrapUnion.aValue = theValue; @@ -1838,7 +1838,7 @@ Standard_ShortReal FSD_BinaryFile::InverseShortReal (const Standard_ShortReal th union { Standard_ShortReal aValue; Standard_Integer aResult; - } aWrapUnion; + } aWrapUnion{}; aWrapUnion.aValue = theValue; aWrapUnion.aResult = InverseInt (aWrapUnion.aResult); @@ -1866,7 +1866,7 @@ inline uint64_t OCCT_InverseSizeSpecialized <8> (const uint64_t theValue, int) union { Standard_Integer i[2]; uint64_t aValue; - } aWrapUnion; + } aWrapUnion{}; aWrapUnion.aValue = theValue; diff --git a/src/FSD/FSD_BinaryFile.hxx b/src/FSD/FSD_BinaryFile.hxx index 504aaa19b9..eec55076ba 100644 --- a/src/FSD/FSD_BinaryFile.hxx +++ b/src/FSD/FSD_BinaryFile.hxx @@ -357,7 +357,7 @@ private: private: FSD_BStream myStream; - FSD_FileHeader myHeader; + FSD_FileHeader myHeader{}; }; #endif // _FSD_BinaryFile_HeaderFile diff --git a/src/FSD/FSD_CmpFile.cxx b/src/FSD/FSD_CmpFile.cxx index 85d76117f1..f34924ec80 100644 --- a/src/FSD/FSD_CmpFile.cxx +++ b/src/FSD/FSD_CmpFile.cxx @@ -173,8 +173,8 @@ void FSD_CmpFile::WriteExtendedLine(const TCollection_ExtendedString& buffer) myStream << (char)0 << "\n"; #endif - Standard_ExtString extBuffer; - Standard_Integer i; + Standard_ExtString extBuffer = nullptr; + Standard_Integer i = 0; extBuffer = buffer.ToExtString(); PutInteger(buffer.Length()); @@ -192,8 +192,8 @@ void FSD_CmpFile::WriteExtendedLine(const TCollection_ExtendedString& buffer) void FSD_CmpFile::ReadExtendedLine(TCollection_ExtendedString& buffer) { - Standard_ExtCharacter c; - Standard_Integer i; + Standard_ExtCharacter c = 0; + Standard_Integer i = 0; GetInteger(i); diff --git a/src/FSD/FSD_File.cxx b/src/FSD/FSD_File.cxx index 8ee7e2066d..2ce96b7771 100644 --- a/src/FSD/FSD_File.cxx +++ b/src/FSD/FSD_File.cxx @@ -214,8 +214,8 @@ void FSD_File::ReadLine(TCollection_AsciiString& buffer) void FSD_File::WriteExtendedLine(const TCollection_ExtendedString& buffer) { - Standard_ExtString extBuffer; - Standard_Integer i,c,d; + Standard_ExtString extBuffer = nullptr; + Standard_Integer i = 0,c = 0,d = 0; extBuffer = buffer.ToExtString(); @@ -237,7 +237,7 @@ void FSD_File::WriteExtendedLine(const TCollection_ExtendedString& buffer) void FSD_File::ReadExtendedLine(TCollection_ExtendedString& buffer) { char c = '\0'; - Standard_ExtCharacter i = 0,j,count = 0; + Standard_ExtCharacter i = 0,j = 0,count = 0; Standard_Boolean fin = Standard_False; Standard_CString tg = ENDOFNORMALEXTENDEDSECTION; @@ -302,7 +302,7 @@ void FSD_File::ReadChar(TCollection_AsciiString& buffer, const Standard_Size rsi void FSD_File::ReadString(TCollection_AsciiString& buffer) { char Buffer[8193]; - char *bpos; + char *bpos = nullptr; Standard_Boolean IsEnd = Standard_False,isFirstTime = Standard_True; buffer.Clear(); @@ -339,9 +339,9 @@ void FSD_File::ReadString(TCollection_AsciiString& buffer) void FSD_File::ReadWord(TCollection_AsciiString& buffer) { char c = '\0'; - char b[8193],*tmpb; + char b[8193],*tmpb = nullptr; Standard_Boolean IsEnd = Standard_False; - Standard_Integer i; + Standard_Integer i = 0; tmpb = b; memset(b,'\0',8193); @@ -423,7 +423,7 @@ Storage_BaseDriver& FSD_File::PutReference(const Standard_Integer aValue) Storage_BaseDriver& FSD_File::PutCharacter(const Standard_Character aValue) { - unsigned short i; + unsigned short i = 0; i = aValue; myStream << i << " "; @@ -647,7 +647,7 @@ void FSD_File::WriteInfo(const Standard_Integer nbObj, const TCollection_ExtendedString& dataType, const TColStd_SequenceOfAsciiString& userInfo) { - Standard_Integer i; + Standard_Integer i = 0; myStream << nbObj; myStream << "\n"; @@ -730,7 +730,7 @@ void FSD_File::ReadInfo(Standard_Integer& nbObj, ReadLine(appVersion); ReadExtendedLine(dataType); - Standard_Integer i,len = 0; + Standard_Integer i = 0,len = 0; if (!(myStream >> len)) throw Storage_StreamTypeMismatchError(); @@ -785,7 +785,7 @@ Storage_Error FSD_File::BeginWriteCommentSection() void FSD_File::WriteComment(const TColStd_SequenceOfExtendedString& aCom) { - Standard_Integer i,aSize; + Standard_Integer i = 0,aSize = 0; aSize = aCom.Length(); myStream << aSize << "\n"; @@ -827,7 +827,7 @@ Storage_Error FSD_File::BeginReadCommentSection() void FSD_File::ReadComment(TColStd_SequenceOfExtendedString& aCom) { TCollection_ExtendedString line; - Standard_Integer len,i; + Standard_Integer len = 0,i = 0; if (!(myStream >> len)) throw Storage_StreamTypeMismatchError(); @@ -914,7 +914,7 @@ Storage_Error FSD_File::BeginReadTypeSection() Standard_Integer FSD_File::TypeSectionSize() { - Standard_Integer i; + Standard_Integer i = 0; if (!(myStream >> i)) throw Storage_StreamTypeMismatchError(); @@ -1010,7 +1010,7 @@ Storage_Error FSD_File::BeginReadRootSection() Standard_Integer FSD_File::RootSectionSize() { - Standard_Integer i; + Standard_Integer i = 0; if (!(myStream >> i)) throw Storage_StreamTypeMismatchError(); @@ -1106,7 +1106,7 @@ Storage_Error FSD_File::BeginReadRefSection() Standard_Integer FSD_File::RefSectionSize() { - Standard_Integer i; + Standard_Integer i = 0; if (!(myStream >> i)) throw Storage_StreamTypeMismatchError(); FlushEndOfLine(); diff --git a/src/FairCurve/FairCurve_Batten.cxx b/src/FairCurve/FairCurve_Batten.cxx index 0685b6c89d..efcea0168f 100644 --- a/src/FairCurve/FairCurve_Batten.cxx +++ b/src/FairCurve/FairCurve_Batten.cxx @@ -20,6 +20,8 @@ #endif +#include + #include #include #include @@ -159,8 +161,8 @@ Standard_Boolean FairCurve_Batten::Compute(FairCurve_AnalysisCode& ACode, Standard_Real AngleMax = 0.7; // parameter ruling the function of increment ( 40 degrees ) Standard_Real AngleMin = 2*M_PI/100; // parameter ruling the function of increment // full passage should not cost more than 100 steps. - Standard_Real DAngle1, DAngle2, Ratio, Fraction, Toler; - Standard_Real OldDist, NewDist; + Standard_Real DAngle1 = NAN, DAngle2 = NAN, Ratio = NAN, Fraction = NAN, Toler = NAN; + Standard_Real OldDist = NAN, NewDist = NAN; // Loop of Homotopy : calculation of the step and optimisation @@ -219,11 +221,11 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1, const Standard_Real Tolerance) // ============================================================================= { - Standard_Boolean Ok, OkCompute=Standard_True; + Standard_Boolean Ok = 0, OkCompute=Standard_True; ACode = FairCurve_OK; // Deformation of the curve by adding a polynom of interpolation - Standard_Integer L = 2 + NewConstraintOrder1 + NewConstraintOrder2, kk, ii; + Standard_Integer L = 2 + NewConstraintOrder1 + NewConstraintOrder2, kk = 0, ii = 0; TColStd_Array1OfReal knots (1,2); knots(1) = 0; knots(2) = 1; @@ -293,7 +295,7 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1, // Intermediary data - Standard_Real Angle1, Angle2, SlidingLength, + Standard_Real Angle1 = NAN, Angle2 = NAN, SlidingLength = NAN, Alph1 = OldAngle1 + DeltaAngle1, Alph2 = OldAngle2 + DeltaAngle2, Dist = NPoles->Value(NPoles->Upper()) @@ -376,7 +378,7 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1, OldHeight = NewHeight; } else { - Standard_Real V; + Standard_Real V = NAN; ACode = EBatten.Status(); if (!LBatten.Value(0, V) || !LBatten.Value(1, V)) { ACode = FairCurve_NullHeight; @@ -458,7 +460,7 @@ Standard_Real FairCurve_Batten::SlidingOfReference(const Standard_Real Dist, const Standard_Real Angle2) const // ================================================================== { - Standard_Real a1, a2; + Standard_Real a1 = NAN, a2 = NAN; // case of angle without constraints if ( (NewConstraintOrder1 == 0) && (NewConstraintOrder2 == 0)) return Dist; @@ -493,7 +495,7 @@ Standard_Real FairCurve_Batten::Compute(const Standard_Real Dist, // ================================================================== { Standard_Real L1 = Compute(Dist, Angle1); - Standard_Real L2 = Compute(Dist, Angle2), Aux; + Standard_Real L2 = Compute(Dist, Angle2), Aux = NAN; if (L1 < L2) { Aux = L2; L2 = L1; diff --git a/src/FairCurve/FairCurve_DistributionOfEnergy.cxx b/src/FairCurve/FairCurve_DistributionOfEnergy.cxx index 2e4733e1db..da7e9a166a 100644 --- a/src/FairCurve/FairCurve_DistributionOfEnergy.cxx +++ b/src/FairCurve/FairCurve_DistributionOfEnergy.cxx @@ -36,9 +36,9 @@ Standard_Integer FairCurve_DistributionOfEnergy::NbEquations() const MyFlatKnots (FlatKnots), MyPoles (Poles), MyDerivativeOrder (DerivativeOrder), - MyNbValAux (NbValAux) + MyNbVar(1), MyNbValAux (NbValAux) { - MyNbVar = 1; + SetDerivativeOrder( DerivativeOrder); } diff --git a/src/FairCurve/FairCurve_DistributionOfEnergy.hxx b/src/FairCurve/FairCurve_DistributionOfEnergy.hxx index a18996ec68..ce2f0704fb 100644 --- a/src/FairCurve/FairCurve_DistributionOfEnergy.hxx +++ b/src/FairCurve/FairCurve_DistributionOfEnergy.hxx @@ -57,7 +57,7 @@ protected: Handle(TColgp_HArray1OfPnt2d) MyPoles; Standard_Integer MyDerivativeOrder; Standard_Integer MyNbVar; - Standard_Integer MyNbEqua; + Standard_Integer MyNbEqua{}; Standard_Integer MyNbValAux; diff --git a/src/FairCurve/FairCurve_DistributionOfJerk.cxx b/src/FairCurve/FairCurve_DistributionOfJerk.cxx index 9e20c93d6a..a664bd84fd 100644 --- a/src/FairCurve/FairCurve_DistributionOfJerk.cxx +++ b/src/FairCurve/FairCurve_DistributionOfJerk.cxx @@ -22,6 +22,8 @@ #endif +#include + #include #include #include @@ -49,9 +51,9 @@ Standard_Boolean FairCurve_DistributionOfJerk::Value(const math_Vector& TParam, math_Vector& Jerk) { Standard_Boolean Ok = Standard_True; - Standard_Integer ier, ii, jj, kk; + Standard_Integer ier = 0, ii = 0, jj = 0, kk = 0; gp_XY CPrim (0., 0.), CSecn (0., 0.), CTroi(0., 0.); - Standard_Integer LastGradientIndex, FirstNonZero, LastZero; + Standard_Integer LastGradientIndex = 0, FirstNonZero = 0, LastZero = 0; // (0.0) initialisations generales Jerk.Init(0.0); @@ -81,7 +83,7 @@ Standard_Boolean FairCurve_DistributionOfJerk::Value(const math_Vector& TParam, Standard_Real ProduitC1C2 = CPrim*CSecn; Standard_Real DeriveNormeCPrim = ProduitC1C2 * InvNormeCPrim2; - Standard_Real Hauteur, WVal, Mesure; + Standard_Real Hauteur = NAN, WVal = NAN, Mesure = NAN; Standard_Real NumRho = CPrim ^ CSecn; Standard_Real Numerateur = (CPrim ^ CTroi) - 3 * NumRho * DeriveNormeCPrim; Standard_Real Denominateur = pow ( NormeCPrim, 2.5); @@ -105,7 +107,7 @@ Standard_Boolean FairCurve_DistributionOfJerk::Value(const math_Vector& TParam, GradDeriveNormeCPrim(1, 2*MyBSplOrder), GradNumRho(1, 2*MyBSplOrder), NumduGrad(1, 2*MyBSplOrder); - Standard_Real Facteur; + Standard_Real Facteur = NAN; Standard_Real XPrim = CPrim.X(); Standard_Real YPrim = CPrim.Y(); Standard_Real XSecn = CSecn.X(); @@ -113,7 +115,7 @@ Standard_Boolean FairCurve_DistributionOfJerk::Value(const math_Vector& TParam, Standard_Real XTroi = CTroi.X(); Standard_Real YTroi = CTroi.Y(); Standard_Real InvDenominateur = 1 / Denominateur; - Standard_Real Aux, AuxBis; + Standard_Real Aux = NAN, AuxBis = NAN; Facteur = 2 * Mesure * WVal; Aux = 2.5 * Numerateur * InvNormeCPrim; @@ -179,10 +181,10 @@ Standard_Boolean FairCurve_DistributionOfJerk::Value(const math_Vector& TParam, * (YPrim*InvNormeCPrim) * InvNormeCPrim; Standard_Real FacteurW = WVal * InvNormeCPrim; - Standard_Real Produit, Produit2, ProduitV, HNumRho, DSeconde, NSeconde, - HDeriveNormeCPrim, Aux1, DeriveAuxBis; - Standard_Real VIntermed; - Standard_Integer k1, k2, II, JJ; + Standard_Real Produit = NAN, Produit2 = NAN, ProduitV = NAN, HNumRho = NAN, DSeconde = NAN, NSeconde = NAN, + HDeriveNormeCPrim = NAN, Aux1 = NAN, DeriveAuxBis = NAN; + Standard_Real VIntermed = NAN; + Standard_Integer k1 = 0, k2 = 0, II = 0, JJ = 0; Facteur = 2 * Mesure; diff --git a/src/FairCurve/FairCurve_DistributionOfSagging.cxx b/src/FairCurve/FairCurve_DistributionOfSagging.cxx index 7f33c9563f..4828a387ce 100644 --- a/src/FairCurve/FairCurve_DistributionOfSagging.cxx +++ b/src/FairCurve/FairCurve_DistributionOfSagging.cxx @@ -19,6 +19,8 @@ #endif +#include + #include #include #include @@ -44,9 +46,9 @@ Standard_Boolean FairCurve_DistributionOfSagging::Value(const math_Vector& TParam, math_Vector& Flexion) { Standard_Boolean Ok = Standard_True; - Standard_Integer ier, ii, jj, kk; + Standard_Integer ier = 0, ii = 0, jj = 0, kk = 0; gp_XY CPrim (0., 0.), CSecn (0., 0.); - Standard_Integer LastGradientIndex, FirstNonZero, LastZero; + Standard_Integer LastGradientIndex = 0, FirstNonZero = 0, LastZero = 0; // (0.0) initialisations generales Flexion.Init(0.0); @@ -71,7 +73,7 @@ Standard_Boolean FairCurve_DistributionOfSagging::Value(const math_Vector& TPara // (1) Evaluation de la flexion locale = W*W Standard_Real NormeCPrim = CPrim.Modulus(); Standard_Real InvNormeCPrim = 1 / NormeCPrim; - Standard_Real Hauteur, WVal, Mesure; + Standard_Real Hauteur = NAN, WVal = NAN, Mesure = NAN; Standard_Real Numerateur = CPrim ^ CSecn; Standard_Real Denominateur = pow ( NormeCPrim, 2.5); @@ -89,13 +91,13 @@ Standard_Boolean FairCurve_DistributionOfSagging::Value(const math_Vector& TPara NumGrad(1, 2*MyBSplOrder+MyNbValAux), GradNormeCPrim(1, 2*MyBSplOrder+MyNbValAux), NumduGrad(1, 2*MyBSplOrder+MyNbValAux); - Standard_Real Facteur; + Standard_Real Facteur = NAN; Standard_Real XPrim = CPrim.X(); Standard_Real YPrim = CPrim.Y(); Standard_Real XSecn = CSecn.X(); Standard_Real YSecn = CSecn.Y(); Standard_Real InvDenominateur = 1 / Denominateur; - Standard_Real Aux; + Standard_Real Aux = NAN; Facteur = 2 * Mesure * WVal; Aux = 2.5 * Numerateur * InvNormeCPrim; @@ -141,9 +143,9 @@ Standard_Boolean FairCurve_DistributionOfSagging::Value(const math_Vector& TPara * (YPrim*InvNormeCPrim) * InvNormeCPrim; Standard_Real FacteurW = WVal * InvNormeCPrim; - Standard_Real Produit, DSeconde, NSeconde; - Standard_Real VIntermed; - Standard_Integer k1, k2, II, JJ; + Standard_Real Produit = NAN, DSeconde = NAN, NSeconde = NAN; + Standard_Real VIntermed = NAN; + Standard_Integer k1 = 0, k2 = 0, II = 0, JJ = 0; Facteur = 2 * Mesure; diff --git a/src/FairCurve/FairCurve_DistributionOfTension.cxx b/src/FairCurve/FairCurve_DistributionOfTension.cxx index 20c0626c1e..3fdb312169 100644 --- a/src/FairCurve/FairCurve_DistributionOfTension.cxx +++ b/src/FairCurve/FairCurve_DistributionOfTension.cxx @@ -19,6 +19,8 @@ #endif +#include + #include #include #include @@ -51,9 +53,9 @@ Standard_Boolean FairCurve_DistributionOfTension::Value(const math_Vector& TParam, math_Vector& FTension) { Standard_Boolean Ok = Standard_True; - Standard_Integer ier, ii, jj, kk; + Standard_Integer ier = 0, ii = 0, jj = 0, kk = 0; gp_XY CPrim (0., 0.); - Standard_Integer LastGradientIndex, FirstNonZero, LastZero; + Standard_Integer LastGradientIndex = 0, FirstNonZero = 0, LastZero = 0; // (0.0) initialisations generales FTension.Init(0.0); @@ -75,7 +77,7 @@ Standard_Boolean FairCurve_DistributionOfTension::Value(const math_Vector& TPara // (1) Evaluation de la tension locale -------------------------------- Standard_Real NormeCPrim = CPrim.Modulus(); - Standard_Real Hauteur, Difference; + Standard_Real Hauteur = NAN, Difference = NAN; if (MyHeight > 0) {Hauteur = MyHeight;} // it used in MVC to avoid Parametrization Problemes else { @@ -89,7 +91,7 @@ Standard_Boolean FairCurve_DistributionOfTension::Value(const math_Vector& TPara if (MyDerivativeOrder >= 1) { // (2) Evaluation du gradient de la tension locale ---------------------- math_Vector GradDifference (1, 2*MyBSplOrder+MyNbValAux); - Standard_Real Xaux, Yaux, Facteur; + Standard_Real Xaux = NAN, Yaux = NAN, Facteur = NAN; Xaux = CPrim.X() / NormeCPrim; Yaux = CPrim.Y() / NormeCPrim; @@ -122,8 +124,8 @@ Standard_Boolean FairCurve_DistributionOfTension::Value(const math_Vector& TPara Standard_Real FacteurX = Difference * (1-pow(Xaux,2)) / NormeCPrim; Standard_Real FacteurY = Difference * (1-pow(Yaux,2)) / NormeCPrim; Standard_Real FacteurXY = - Difference * Xaux*Yaux / NormeCPrim; - Standard_Real Produit; - Standard_Integer k1, k2; + Standard_Real Produit = NAN; + Standard_Integer k1 = 0, k2 = 0; Facteur = 2 * Hauteur / MyLengthSliding; diff --git a/src/FairCurve/FairCurve_Energy.cxx b/src/FairCurve/FairCurve_Energy.cxx index f31b4380c8..3b54446cac 100644 --- a/src/FairCurve/FairCurve_Energy.cxx +++ b/src/FairCurve/FairCurve_Energy.cxx @@ -20,6 +20,8 @@ #endif +#include + #include #include #include @@ -62,7 +64,7 @@ Standard_Boolean FairCurve_Energy::Value(const math_Vector& X, Standard_Real& E) //======================================================================= { - Standard_Boolean IsDone; + Standard_Boolean IsDone = 0; math_Vector Energie(0,0); ComputePoles(X); IsDone = Compute(0, Energie); @@ -75,8 +77,8 @@ Standard_Boolean FairCurve_Energy::Gradient(const math_Vector& X, math_Vector& G) //======================================================================= { - Standard_Boolean IsDone; - Standard_Real E; + Standard_Boolean IsDone = 0; + Standard_Real E = NAN; IsDone = Values(X, E, G); return IsDone; @@ -87,7 +89,7 @@ void FairCurve_Energy::Gradient1(const math_Vector& Vect, math_Vector& Grad) //======================================================================= { - Standard_Integer ii, + Standard_Integer ii = 0, DebG = Grad.Lower(), FinG = Grad.Upper(); Standard_Integer Vdeb = 3, Vfin = 2*MyPoles->Length()-2; @@ -138,7 +140,7 @@ Standard_Boolean FairCurve_Energy::Values(const math_Vector& X, math_Vector& G) //======================================================================= { - Standard_Boolean IsDone; + Standard_Boolean IsDone = 0; ComputePoles(X); IsDone = Compute(1, MyGradient); @@ -156,7 +158,7 @@ Standard_Boolean FairCurve_Energy::Values(const math_Vector& X, math_Matrix& H) //======================================================================= { - Standard_Boolean IsDone; + Standard_Boolean IsDone = 0; ComputePoles(X); IsDone = Compute(2, MyHessian); @@ -175,7 +177,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect, //======================================================================= { - Standard_Integer ii, jj, kk, Vk; + Standard_Integer ii = 0, jj = 0, kk = 0, Vk = 0; Standard_Integer Vdeb = 3 + 2*MyContrOrder1, Vfin = 2*MyPoles->Length() - 2*(MyContrOrder2+1), Vup = 2*MyPoles->Length()+MyWithAuxValue; @@ -386,7 +388,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect, Standard_Boolean FairCurve_Energy::Variable(math_Vector& X) const //======================================================================= { - Standard_Integer ii, + Standard_Integer ii = 0, IndexDeb1 = MyPoles->Lower()+1, IndexDeb2 = X.Lower(), IndexFin1 = MyPoles->Upper()-1, @@ -436,7 +438,7 @@ Standard_Boolean FairCurve_Energy::Variable(math_Vector& X) const void FairCurve_Energy::ComputePoles(const math_Vector& X) //======================================================================= { - Standard_Integer ii, + Standard_Integer ii = 0, IndexDeb1 = MyPoles->Lower()+1, IndexDeb2 = X.Lower(), IndexFin1 = MyPoles->Upper()-1, diff --git a/src/FairCurve/FairCurve_EnergyOfBatten.cxx b/src/FairCurve/FairCurve_EnergyOfBatten.cxx index 2ccce31225..cbe68901f0 100644 --- a/src/FairCurve/FairCurve_EnergyOfBatten.cxx +++ b/src/FairCurve/FairCurve_EnergyOfBatten.cxx @@ -52,7 +52,7 @@ FairCurve_EnergyOfBatten::FairCurve_EnergyOfBatten(const Standard_Integer BSplOr Standard_Boolean FairCurve_EnergyOfBatten::Variable(math_Vector& X) const //======================================================================= { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; Ok = FairCurve_Energy::Variable(X); if (MyWithAuxValue) { X(X.Upper()) = MyLengthSliding; } return Ok; @@ -97,7 +97,7 @@ Standard_Boolean FairCurve_EnergyOfBatten::Compute(const Standard_Integer Deriva // on decoupe afin d'avoir au moins 2 points d'integration par poles // 24 points de Gauss => 12 poles maximum. - Standard_Integer NbInterv = (MyPoles->Length()-1) / 12 + 1, ii; + Standard_Integer NbInterv = (MyPoles->Length()-1) / 12 + 1, ii = 0; Standard_Real Delta = 1./ NbInterv; Result.Init(0); diff --git a/src/FairCurve/FairCurve_EnergyOfMVC.cxx b/src/FairCurve/FairCurve_EnergyOfMVC.cxx index 0957591e14..a1510f673d 100644 --- a/src/FairCurve/FairCurve_EnergyOfMVC.cxx +++ b/src/FairCurve/FairCurve_EnergyOfMVC.cxx @@ -67,7 +67,7 @@ void FairCurve_EnergyOfMVC::ComputePoles(const math_Vector& X) Standard_Boolean FairCurve_EnergyOfMVC::Variable(math_Vector& X) const //===================================================================================== { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; Ok = FairCurve_Energy::Variable(X); if (MyWithAuxValue) { X(X.Upper()) = MyLengthSliding; } return Ok; @@ -105,7 +105,7 @@ Standard_Boolean FairCurve_EnergyOfMVC::Compute(const Standard_Integer Derivativ // on decoupe afin d'avoir au moins 2 points d'integration par poles // 24 points de Gauss => 12 poles maximum. - Standard_Integer NbInterv = (MyPoles->Length()-1) / 12 + 1, ii; + Standard_Integer NbInterv = (MyPoles->Length()-1) / 12 + 1, ii = 0; Standard_Real Delta = 1./ NbInterv; Result.Init(0); diff --git a/src/FairCurve/FairCurve_MinimalVariation.cxx b/src/FairCurve/FairCurve_MinimalVariation.cxx index 2d12de07f3..fb9ab61444 100644 --- a/src/FairCurve/FairCurve_MinimalVariation.cxx +++ b/src/FairCurve/FairCurve_MinimalVariation.cxx @@ -20,6 +20,8 @@ #endif +#include + #include #include #include @@ -59,8 +61,8 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(FairCurve_AnalysisCode& ACo Standard_Real AngleMax = 0.7; // parameter regulating the function of increment ( 40 degrees ) Standard_Real AngleMin = 2*M_PI/100; // parameter regulating the function of increment // full passage should not contain more than 100 steps. - Standard_Real DAngle1, DAngle2, DRho1, DRho2, Ratio, Fraction, Toler; - Standard_Real OldDist, NewDist; + Standard_Real DAngle1 = NAN, DAngle2 = NAN, DRho1 = NAN, DRho2 = NAN, Ratio = NAN, Fraction = NAN, Toler = NAN; + Standard_Real OldDist = NAN, NewDist = NAN; // Loop of Homotopy : calculation of the step and optimisation @@ -140,12 +142,12 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1, const Standard_Real Tolerance) //====================================================================================== { - Standard_Boolean Ok, OkCompute=Standard_True; + Standard_Boolean Ok = 0, OkCompute=Standard_True; ACode = FairCurve_OK; // Deformation of the curve by adding a polynom of interpolation Standard_Integer L = 2 + NewConstraintOrder1 + NewConstraintOrder2, - kk, ii; + kk = 0, ii = 0; // NbP1 = Poles->Length()-1, kk, ii; #ifdef OCCT_DEBUG Standard_Integer NbP1 = @@ -251,7 +253,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1, // Intermediaires - Standard_Real Angle1, Angle2, SlidingLength, + Standard_Real Angle1 = NAN, Angle2 = NAN, SlidingLength = NAN, Alph1 = OldAngle1 + DeltaAngle1, Alph2 = OldAngle2 + DeltaAngle2, Rho1 = OldCurvature1 + DeltaCurvature1, @@ -356,7 +358,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1, OldPhysicalRatio = NewPhysicalRatio; } else { - Standard_Real V; + Standard_Real V = NAN; ACode = EMVC.Status(); if (!LBatten.Value(0, V) || !LBatten.Value(1, V)) { ACode = FairCurve_NullHeight; diff --git a/src/Font/Font_FTFont.cxx b/src/Font/Font_FTFont.cxx old mode 100755 new mode 100644 index aeecf5c74a..ef3c8ae517 --- a/src/Font/Font_FTFont.cxx +++ b/src/Font/Font_FTFont.cxx @@ -708,7 +708,7 @@ Font_Rect Font_FTFont::BoundingBox (const NCollection_String& theS aFormatter.Append (theString, *this); aFormatter.Format(); - Font_Rect aBndBox; + Font_Rect aBndBox{}; aFormatter.BndBox (aBndBox); return aBndBox; } diff --git a/src/Font/Font_FontMgr.cxx b/src/Font/Font_FontMgr.cxx index 4bceb727a0..78683a3d88 100644 --- a/src/Font/Font_FontMgr.cxx +++ b/src/Font/Font_FontMgr.cxx @@ -150,7 +150,7 @@ static bool checkFont (NCollection_Sequence& theFonts, { #ifdef HAVE_FREETYPE const FT_Long aFaceId = theFaceId != -1 ? theFaceId : 0; - FT_Face aFontFace; + FT_Face aFontFace = nullptr; FT_Error aFaceError = FT_New_Face (theFTLib->Instance(), theFontPath.ToCString(), aFaceId, &aFontFace); if (aFaceError != FT_Err_Ok) { @@ -761,7 +761,7 @@ void Font_FontMgr::InitFontDataBase() } Standard_Integer aNByte = 256; - Standard_Integer aNbyteRead; + Standard_Integer aNbyteRead = 0; TCollection_AsciiString aStr; // read string with information while (!aFile.IsAtEnd()) { @@ -850,7 +850,7 @@ void Font_FontMgr::InitFontDataBase() continue; // invalid fonts directory } - Standard_Integer aNbyteRead, aNByte = 256; + Standard_Integer aNbyteRead = 0, aNByte = 256; TCollection_AsciiString aLine (aNByte); Standard_Boolean isFirstLine = Standard_True; const TCollection_AsciiString anEncoding ("iso8859-1\n"); diff --git a/src/Font/Font_SystemFont.hxx b/src/Font/Font_SystemFont.hxx index ac3c6fca8b..9ab34c0fbb 100644 --- a/src/Font/Font_SystemFont.hxx +++ b/src/Font/Font_SystemFont.hxx @@ -142,7 +142,7 @@ public: private: TCollection_AsciiString myFilePaths[Font_FontAspect_NB]; //!< paths to the font file - Standard_Integer myFaceIds [Font_FontAspect_NB]; //!< face ids per font file + Standard_Integer myFaceIds [Font_FontAspect_NB]{}; //!< face ids per font file TCollection_AsciiString myFontKey; //!< font family name, lower cased TCollection_AsciiString myFontName; //!< font family name Standard_Boolean myIsSingleLine; //!< single stroke font flag, FALSE by default diff --git a/src/Font/Font_TextFormatter.cxx b/src/Font/Font_TextFormatter.cxx index e8d2d6b2f4..2f77bdb600 100644 --- a/src/Font/Font_TextFormatter.cxx +++ b/src/Font/Font_TextFormatter.cxx @@ -183,7 +183,7 @@ void Font_TextFormatter::newLine (const Standard_Integer theLastRect, } Standard_ShortReal aXMin = BottomLeft (aFirstCornerId).x(); - Font_Rect aBndBox; + Font_Rect aBndBox{}; GlyphBoundingBox (aLastCornerId, aBndBox); Standard_ShortReal aXMax = aBndBox.Right; @@ -268,7 +268,7 @@ void Font_TextFormatter::Format() { Standard_Integer aFirstCornerId = myRectLineStart; - Font_Rect aBndBox; + Font_Rect aBndBox{}; GlyphBoundingBox (aRectIter, aBndBox); const Standard_ShortReal aNextXPos = aBndBox.Right - BottomLeft (aFirstCornerId).x(); Standard_Boolean isCurWordFits = true; @@ -372,7 +372,7 @@ Standard_Boolean Font_TextFormatter::GlyphBoundingBox (const Standard_Integer th // ======================================================================= Standard_Boolean Font_TextFormatter::IsLFSymbol (const Standard_Integer theIndex) const { - Font_Rect aBndBox; + Font_Rect aBndBox{}; if (!GlyphBoundingBox (theIndex, aBndBox)) { return Standard_False; diff --git a/src/GC/GC_MakeArcOfCircle.cxx b/src/GC/GC_MakeArcOfCircle.cxx index 7e2b2f58fd..f3cb3dcc29 100644 --- a/src/GC/GC_MakeArcOfCircle.cxx +++ b/src/GC/GC_MakeArcOfCircle.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -34,14 +36,14 @@ //======================================================================= GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Pnt& P1 , const gp_Pnt& P2 , - const gp_Pnt& P3 ) + const gp_Pnt& P3 ) : GC_Root() { - Standard_Boolean sense; + Standard_Boolean sense = 0; // gce_MakeCirc Cir(P1, P2, P3); TheError = Cir.Status(); if (TheError == gce_Done) { - Standard_Real Alpha1, Alpha3;//,Alpha2 + Standard_Real Alpha1 = NAN, Alpha3 = NAN;//,Alpha2 gp_Circ C(Cir.Value()); //modified by NIZNHY-PKV Thu Mar 3 10:53:02 2005f //Alpha1 is always =0. @@ -69,7 +71,7 @@ GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Pnt& P1 , //======================================================================= GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Pnt& P1 , const gp_Vec& V , - const gp_Pnt& P2 ) + const gp_Pnt& P2 ) : GC_Root() { gp_Circ cir; gce_MakeLin Corde(P1,P2); @@ -122,7 +124,7 @@ GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Pnt& P1 , GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Circ& Circ , const gp_Pnt& P1 , const gp_Pnt& P2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Standard_Real Alpha1 = ElCLib::Parameter(Circ,P1); Standard_Real Alpha2 = ElCLib::Parameter(Circ,P2); @@ -137,7 +139,7 @@ GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Circ& Circ , GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Circ& Circ , const gp_Pnt& P , const Standard_Real Alpha , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Standard_Real Alphafirst = ElCLib::Parameter(Circ,P); Handle(Geom_Circle) C = new Geom_Circle(Circ); @@ -151,7 +153,7 @@ GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Circ& Circ , GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Circ& Circ , const Standard_Real Alpha1 , const Standard_Real Alpha2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Handle(Geom_Circle) C = new Geom_Circle(Circ); TheArc= new Geom_TrimmedCurve(C,Alpha1,Alpha2,Sense); diff --git a/src/GC/GC_MakeArcOfEllipse.cxx b/src/GC/GC_MakeArcOfEllipse.cxx index 92a1961765..ccf1f83311 100644 --- a/src/GC/GC_MakeArcOfEllipse.cxx +++ b/src/GC/GC_MakeArcOfEllipse.cxx @@ -26,7 +26,7 @@ GC_MakeArcOfEllipse::GC_MakeArcOfEllipse(const gp_Elips& Elips , const gp_Pnt& P1 , const gp_Pnt& P2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Standard_Real Alpha1 = ElCLib::Parameter(Elips,P1); Standard_Real Alpha2 = ElCLib::Parameter(Elips,P2); @@ -38,7 +38,7 @@ GC_MakeArcOfEllipse::GC_MakeArcOfEllipse(const gp_Elips& Elips , GC_MakeArcOfEllipse::GC_MakeArcOfEllipse(const gp_Elips& Elips , const gp_Pnt& P , const Standard_Real Alpha , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Standard_Real Alphafirst = ElCLib::Parameter(Elips,P); Handle(Geom_Ellipse) E = new Geom_Ellipse(Elips); @@ -49,7 +49,7 @@ GC_MakeArcOfEllipse::GC_MakeArcOfEllipse(const gp_Elips& Elips , GC_MakeArcOfEllipse::GC_MakeArcOfEllipse(const gp_Elips& Elips , const Standard_Real Alpha1 , const Standard_Real Alpha2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Handle(Geom_Ellipse) E = new Geom_Ellipse(Elips); TheArc = new Geom_TrimmedCurve(E,Alpha1,Alpha2,Sense); diff --git a/src/GC/GC_MakeArcOfHyperbola.cxx b/src/GC/GC_MakeArcOfHyperbola.cxx index 8cabadf1db..734af274e2 100644 --- a/src/GC/GC_MakeArcOfHyperbola.cxx +++ b/src/GC/GC_MakeArcOfHyperbola.cxx @@ -27,7 +27,7 @@ GC_MakeArcOfHyperbola:: GC_MakeArcOfHyperbola(const gp_Hypr& Hypr , const gp_Pnt& P1 , const gp_Pnt& P2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Standard_Real Alpha1 = ElCLib::Parameter(Hypr,P1); Standard_Real Alpha2 = ElCLib::Parameter(Hypr,P2); @@ -39,7 +39,7 @@ GC_MakeArcOfHyperbola:: GC_MakeArcOfHyperbola::GC_MakeArcOfHyperbola(const gp_Hypr& Hypr , const gp_Pnt& P , const Standard_Real Alpha , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Standard_Real Alphafirst = ElCLib::Parameter(Hypr,P); Handle(Geom_Hyperbola) H = new Geom_Hyperbola(Hypr); @@ -50,7 +50,7 @@ GC_MakeArcOfHyperbola::GC_MakeArcOfHyperbola(const gp_Hypr& Hypr , GC_MakeArcOfHyperbola::GC_MakeArcOfHyperbola(const gp_Hypr& Hypr , const Standard_Real Alpha1 , const Standard_Real Alpha2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Handle(Geom_Hyperbola) H = new Geom_Hyperbola(Hypr); TheArc = new Geom_TrimmedCurve(H,Alpha1,Alpha2,Sense); diff --git a/src/GC/GC_MakeArcOfParabola.cxx b/src/GC/GC_MakeArcOfParabola.cxx index bc0c7a239e..e3baf111fa 100644 --- a/src/GC/GC_MakeArcOfParabola.cxx +++ b/src/GC/GC_MakeArcOfParabola.cxx @@ -26,7 +26,7 @@ GC_MakeArcOfParabola::GC_MakeArcOfParabola(const gp_Parab& Parab , const gp_Pnt& P1 , const gp_Pnt& P2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Standard_Real Alpha1 = ElCLib::Parameter(Parab,P1); Standard_Real Alpha2 = ElCLib::Parameter(Parab,P2); @@ -38,7 +38,7 @@ GC_MakeArcOfParabola::GC_MakeArcOfParabola(const gp_Parab& Parab , GC_MakeArcOfParabola::GC_MakeArcOfParabola(const gp_Parab& Parab , const gp_Pnt& P , const Standard_Real Alpha , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Standard_Real Alphafirst = ElCLib::Parameter(Parab,P); Handle(Geom_Parabola) Parabola = new Geom_Parabola(Parab); @@ -49,7 +49,7 @@ GC_MakeArcOfParabola::GC_MakeArcOfParabola(const gp_Parab& Parab , GC_MakeArcOfParabola::GC_MakeArcOfParabola(const gp_Parab& Parab , const Standard_Real Alpha1 , const Standard_Real Alpha2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GC_Root() { Handle(Geom_Parabola) P = new Geom_Parabola(Parab); TheArc = new Geom_TrimmedCurve(P,Alpha1,Alpha2,Sense); diff --git a/src/GC/GC_MakeCircle.cxx b/src/GC/GC_MakeCircle.cxx index 1895305601..8b83daf89e 100644 --- a/src/GC/GC_MakeCircle.cxx +++ b/src/GC/GC_MakeCircle.cxx @@ -25,14 +25,14 @@ #include #include -GC_MakeCircle::GC_MakeCircle(const gp_Circ& C) +GC_MakeCircle::GC_MakeCircle(const gp_Circ& C) : GC_Root(), TheCircle(new Geom_Circle(C)) { TheError = gce_Done; - TheCircle = new Geom_Circle(C); + } GC_MakeCircle::GC_MakeCircle(const gp_Ax2& A2 , - const Standard_Real Radius) + const Standard_Real Radius) : GC_Root() { if (Radius < 0.) { TheError = gce_NegativeRadius; } else { @@ -42,7 +42,7 @@ GC_MakeCircle::GC_MakeCircle(const gp_Ax2& A2 , } GC_MakeCircle::GC_MakeCircle(const gp_Circ& Circ , - const gp_Pnt& Point ) + const gp_Pnt& Point ) : GC_Root() { gp_Circ C = gce_MakeCirc(Circ,Point); TheCircle = new Geom_Circle(C); @@ -50,7 +50,7 @@ GC_MakeCircle::GC_MakeCircle(const gp_Circ& Circ , } GC_MakeCircle::GC_MakeCircle(const gp_Circ& Circ , - const Standard_Real Dist ) + const Standard_Real Dist ) : GC_Root() { gce_MakeCirc C = gce_MakeCirc(Circ,Dist); TheError = C.Status(); @@ -61,7 +61,7 @@ GC_MakeCircle::GC_MakeCircle(const gp_Circ& Circ , GC_MakeCircle::GC_MakeCircle(const gp_Pnt& P1 , const gp_Pnt& P2 , - const gp_Pnt& P3 ) + const gp_Pnt& P3 ) : GC_Root() { gce_MakeCirc C = gce_MakeCirc(P1,P2,P3); TheError = C.Status(); @@ -72,7 +72,7 @@ GC_MakeCircle::GC_MakeCircle(const gp_Pnt& P1 , GC_MakeCircle::GC_MakeCircle(const gp_Pnt& Point , const gp_Dir& Norm , - const Standard_Real Radius ) + const Standard_Real Radius ) : GC_Root() { gce_MakeCirc C = gce_MakeCirc(Point,Norm,Radius); TheError = C.Status(); @@ -83,7 +83,7 @@ GC_MakeCircle::GC_MakeCircle(const gp_Pnt& Point , GC_MakeCircle::GC_MakeCircle(const gp_Pnt& Point , const gp_Pnt& PtAxis , - const Standard_Real Radius ) + const Standard_Real Radius ) : GC_Root() { gce_MakeCirc C = gce_MakeCirc(Point,PtAxis,Radius); TheError = C.Status(); @@ -93,7 +93,7 @@ GC_MakeCircle::GC_MakeCircle(const gp_Pnt& Point , } GC_MakeCircle::GC_MakeCircle(const gp_Ax1& Axis , - const Standard_Real Radius ) + const Standard_Real Radius ) : GC_Root() { gce_MakeCirc C = gce_MakeCirc(Axis,Radius); TheError = C.Status(); diff --git a/src/GC/GC_MakeConicalSurface.cxx b/src/GC/GC_MakeConicalSurface.cxx index 45b77e30a3..85c71fc046 100644 --- a/src/GC/GC_MakeConicalSurface.cxx +++ b/src/GC/GC_MakeConicalSurface.cxx @@ -28,7 +28,7 @@ GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Ax2& A2 , const Standard_Real Ang , - const Standard_Real Radius) + const Standard_Real Radius) : GC_Root() { if (Radius < 0.) { TheError = gce_NegativeRadius; } else if (Ang <= gp::Resolution() || Ang >= M_PI/2. - gp::Resolution()) { @@ -40,10 +40,10 @@ GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Ax2& A2 , } } -GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Cone& C) +GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Cone& C) : GC_Root(), TheCone(new Geom_ConicalSurface(C)) { TheError = gce_Done; - TheCone = new Geom_ConicalSurface(C); + } //========================================================================= @@ -56,7 +56,7 @@ GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Cone& C) GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Pnt& P1 , const gp_Pnt& P2 , const gp_Pnt& P3 , - const gp_Pnt& P4 ) + const gp_Pnt& P4 ) : GC_Root() { gce_MakeCone C = gce_MakeCone(P1,P2,P3,P4); TheError = C.Status(); @@ -72,7 +72,7 @@ GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Pnt& P1 , GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Pnt& P1 , const gp_Pnt& P2 , const Standard_Real R1 , - const Standard_Real R2 ) + const Standard_Real R2 ) : GC_Root() { gce_MakeCone C = gce_MakeCone(P1,P2,R1,R2); TheError = C.Status(); diff --git a/src/GC/GC_MakeCylindricalSurface.cxx b/src/GC/GC_MakeCylindricalSurface.cxx index b364bae0af..1bf2e4d4e2 100644 --- a/src/GC/GC_MakeCylindricalSurface.cxx +++ b/src/GC/GC_MakeCylindricalSurface.cxx @@ -26,14 +26,14 @@ #include #include -GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Cylinder& C) +GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Cylinder& C) : GC_Root(), TheCylinder(new Geom_CylindricalSurface(C)) { TheError = gce_Done; - TheCylinder = new Geom_CylindricalSurface(C); + } GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Ax2& A2 , - const Standard_Real Radius) + const Standard_Real Radius) : GC_Root() { if (Radius < 0.0) { TheError = gce_NegativeRadius; } else { @@ -47,7 +47,7 @@ GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Ax2& A2 , //========================================================================= GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Ax1& A1 , - const Standard_Real Radius ) + const Standard_Real Radius ) : GC_Root() { gce_MakeCylinder Cyl = gce_MakeCylinder(A1,Radius); TheError = Cyl.Status(); @@ -60,7 +60,7 @@ GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Ax1& A1 , // Construction of a cylinder by a circle . + //========================================================================= -GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Circ& Circ ) { +GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Circ& Circ ) : GC_Root() { gp_Cylinder Cyl = gce_MakeCylinder(Circ); TheCylinder=new Geom_CylindricalSurface(Cyl); TheError = gce_Done; @@ -74,7 +74,7 @@ GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Circ& Circ ) { GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Pnt& P1 , const gp_Pnt& P2 , - const gp_Pnt& P3 ) { + const gp_Pnt& P3 ) : GC_Root() { gce_MakeCylinder Cyl = gce_MakeCylinder(P1,P2,P3); TheError = Cyl.Status(); if (TheError == gce_Done) { @@ -83,16 +83,16 @@ GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Pnt& P1 , } GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Cylinder& Cyl , - const Standard_Real Dist) + const Standard_Real Dist) : GC_Root(), TheCylinder(new Geom_CylindricalSurface(Cyl)) { TheError = gce_Done; Standard_Real R = Abs(Cyl.Radius()-Dist); - TheCylinder = new Geom_CylindricalSurface(Cyl); + TheCylinder->SetRadius(R); } GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Cylinder& Cyl , - const gp_Pnt& Point) + const gp_Pnt& Point) : GC_Root() { TheError = gce_Done; gp_Cylinder C(Cyl); diff --git a/src/GC/GC_MakeEllipse.cxx b/src/GC/GC_MakeEllipse.cxx index c97a7005ab..a5a412b05c 100644 --- a/src/GC/GC_MakeEllipse.cxx +++ b/src/GC/GC_MakeEllipse.cxx @@ -23,15 +23,15 @@ #include #include -GC_MakeEllipse::GC_MakeEllipse(const gp_Elips& E) +GC_MakeEllipse::GC_MakeEllipse(const gp_Elips& E) : GC_Root(), TheEllipse(new Geom_Ellipse(E)) { TheError = gce_Done; - TheEllipse = new Geom_Ellipse(E); + } GC_MakeEllipse::GC_MakeEllipse(const gp_Ax2& A2 , const Standard_Real MajorRadius, - const Standard_Real MinorRadius) + const Standard_Real MinorRadius) : GC_Root() { if ( MinorRadius < 0.0) { TheError = gce_NegativeRadius; } else if ( MajorRadius < MinorRadius) { TheError = gce_InvertAxis; } @@ -43,7 +43,7 @@ GC_MakeEllipse::GC_MakeEllipse(const gp_Ax2& A2 , GC_MakeEllipse::GC_MakeEllipse(const gp_Pnt& S1 , const gp_Pnt& S2 , - const gp_Pnt& Center ) { + const gp_Pnt& Center ) : GC_Root() { gce_MakeElips E = gce_MakeElips(S1,S2,Center); TheError = E.Status(); if (TheError == gce_Done) { diff --git a/src/GC/GC_MakeHyperbola.cxx b/src/GC/GC_MakeHyperbola.cxx index da621ab680..1b3065ff5d 100644 --- a/src/GC/GC_MakeHyperbola.cxx +++ b/src/GC/GC_MakeHyperbola.cxx @@ -23,15 +23,15 @@ #include #include -GC_MakeHyperbola::GC_MakeHyperbola(const gp_Hypr& H) +GC_MakeHyperbola::GC_MakeHyperbola(const gp_Hypr& H) : GC_Root(), TheHyperbola(new Geom_Hyperbola(H)) { TheError = gce_Done; - TheHyperbola = new Geom_Hyperbola(H); + } GC_MakeHyperbola::GC_MakeHyperbola(const gp_Ax2& A2 , const Standard_Real MajorRadius, - const Standard_Real MinorRadius) + const Standard_Real MinorRadius) : GC_Root() { if (MajorRadius < 0. || MinorRadius < 0.0) { TheError = gce_NegativeRadius; } else { @@ -42,7 +42,7 @@ GC_MakeHyperbola::GC_MakeHyperbola(const gp_Ax2& A2 , GC_MakeHyperbola::GC_MakeHyperbola(const gp_Pnt& S1 , const gp_Pnt& S2 , - const gp_Pnt& Center ) { + const gp_Pnt& Center ) : GC_Root() { gce_MakeHypr H = gce_MakeHypr(S1,S2,Center); TheError = H.Status(); if (TheError == gce_Done) { diff --git a/src/GC/GC_MakeLine.cxx b/src/GC/GC_MakeLine.cxx index 05ab8e0288..ee0d3a44a6 100644 --- a/src/GC/GC_MakeLine.cxx +++ b/src/GC/GC_MakeLine.cxx @@ -28,26 +28,26 @@ // Constructions of 3d geometrical elements from Geom. //========================================================================= GC_MakeLine::GC_MakeLine(const gp_Pnt& P , - const gp_Dir& V ) + const gp_Dir& V ) : GC_Root(), TheLine(new Geom_Line(P,V)) { TheError = gce_Done; - TheLine = new Geom_Line(P,V); + } -GC_MakeLine::GC_MakeLine(const gp_Ax1& A1 ) +GC_MakeLine::GC_MakeLine(const gp_Ax1& A1 ) : GC_Root(), TheLine(new Geom_Line(A1)) { TheError = gce_Done; - TheLine = new Geom_Line(A1); + } -GC_MakeLine::GC_MakeLine(const gp_Lin& L ) +GC_MakeLine::GC_MakeLine(const gp_Lin& L ) : GC_Root(), TheLine(new Geom_Line(L)) { TheError = gce_Done; - TheLine = new Geom_Line(L); + } GC_MakeLine::GC_MakeLine(const gp_Pnt& P1 , - const gp_Pnt& P2 ) + const gp_Pnt& P2 ) : GC_Root() { gce_MakeLin L(P1,P2); TheError = L.Status(); @@ -57,7 +57,7 @@ GC_MakeLine::GC_MakeLine(const gp_Pnt& P1 , } GC_MakeLine::GC_MakeLine(const gp_Lin& Lin , - const gp_Pnt& Point ) + const gp_Pnt& Point ) : GC_Root() { gce_MakeLin L(Lin,Point); TheError = L.Status(); diff --git a/src/GC/GC_MakeMirror.cxx b/src/GC/GC_MakeMirror.cxx index c7809b4a01..e689bf3f3c 100644 --- a/src/GC/GC_MakeMirror.cxx +++ b/src/GC/GC_MakeMirror.cxx @@ -25,8 +25,8 @@ //========================================================================= // Creation d une symetrie de Geom par rapport a un point. + //========================================================================= -GC_MakeMirror::GC_MakeMirror(const gp_Pnt& Point ) { - TheMirror = new Geom_Transformation(); +GC_MakeMirror::GC_MakeMirror(const gp_Pnt& Point ) : TheMirror(new Geom_Transformation()) { + TheMirror->SetMirror(Point); } @@ -34,8 +34,8 @@ GC_MakeMirror::GC_MakeMirror(const gp_Pnt& Point ) { // Creation d une symetrie de Geom par rapport a une droite. + //========================================================================= -GC_MakeMirror::GC_MakeMirror(const gp_Ax1& Axis ) { - TheMirror = new Geom_Transformation(); +GC_MakeMirror::GC_MakeMirror(const gp_Ax1& Axis ) : TheMirror(new Geom_Transformation()) { + TheMirror->SetMirror(Axis); } @@ -43,8 +43,8 @@ GC_MakeMirror::GC_MakeMirror(const gp_Ax1& Axis ) { // Creation d une symetrie de Geom par rapport a une droite. + //========================================================================= -GC_MakeMirror::GC_MakeMirror(const gp_Lin& Line ) { - TheMirror = new Geom_Transformation(); +GC_MakeMirror::GC_MakeMirror(const gp_Lin& Line ) : TheMirror(new Geom_Transformation()) { + TheMirror->SetMirror(gp_Ax1(Line.Location(),Line.Direction())); } @@ -54,8 +54,8 @@ GC_MakeMirror::GC_MakeMirror(const gp_Lin& Line ) { //========================================================================= GC_MakeMirror::GC_MakeMirror(const gp_Pnt& Point , - const gp_Dir& Direc ) { - TheMirror = new Geom_Transformation(); + const gp_Dir& Direc ) : TheMirror(new Geom_Transformation()) { + TheMirror->SetMirror(gp_Ax1(Point,Direc)); } @@ -64,8 +64,8 @@ GC_MakeMirror::GC_MakeMirror(const gp_Pnt& Point , // un Ax2 (Normale au plan et axe x du plan). + //========================================================================= -GC_MakeMirror::GC_MakeMirror(const gp_Ax2& Plane ) { - TheMirror = new Geom_Transformation(); +GC_MakeMirror::GC_MakeMirror(const gp_Ax2& Plane ) : TheMirror(new Geom_Transformation()) { + TheMirror->SetMirror(Plane); } @@ -73,8 +73,8 @@ GC_MakeMirror::GC_MakeMirror(const gp_Ax2& Plane ) { // Creation d une symetrie 3d de gp par rapport a un plan Plane. + //========================================================================= -GC_MakeMirror::GC_MakeMirror(const gp_Pln& Plane ) { - TheMirror = new Geom_Transformation(); +GC_MakeMirror::GC_MakeMirror(const gp_Pln& Plane ) : TheMirror(new Geom_Transformation()) { + TheMirror->SetMirror(Plane.Position().Ax2()); } diff --git a/src/GC/GC_MakePlane.cxx b/src/GC/GC_MakePlane.cxx index 9b35311500..5798c36045 100644 --- a/src/GC/GC_MakePlane.cxx +++ b/src/GC/GC_MakePlane.cxx @@ -27,23 +27,23 @@ #include #include -GC_MakePlane::GC_MakePlane(const gp_Pln& Pl) +GC_MakePlane::GC_MakePlane(const gp_Pln& Pl) : GC_Root(), ThePlane(new Geom_Plane(Pl)) { TheError = gce_Done; - ThePlane = new Geom_Plane(Pl); + } GC_MakePlane::GC_MakePlane(const gp_Pnt& P, - const gp_Dir& V) + const gp_Dir& V) : GC_Root(), ThePlane(new Geom_Plane(P,V)) { TheError = gce_Done; - ThePlane = new Geom_Plane(P,V); + } GC_MakePlane::GC_MakePlane(const Standard_Real A, const Standard_Real B, const Standard_Real C, - const Standard_Real D) + const Standard_Real D) : GC_Root() { if (Sqrt(A*A + B*B +C*C) <= gp::Resolution()) { TheError = gce_BadEquation; @@ -60,7 +60,7 @@ GC_MakePlane::GC_MakePlane(const Standard_Real A, GC_MakePlane::GC_MakePlane(const gp_Pnt& P1 , const gp_Pnt& P2 , - const gp_Pnt& P3 ) { + const gp_Pnt& P3 ) : GC_Root() { gce_MakePln Pl(P1,P2,P3); TheError = Pl.Status(); if (TheError == gce_Done) { @@ -73,7 +73,7 @@ GC_MakePlane::GC_MakePlane(const gp_Pnt& P1 , //========================================================================= GC_MakePlane::GC_MakePlane(const gp_Pln& Pl , - const Standard_Real Dist ) { + const Standard_Real Dist ) : GC_Root() { gp_Pln Pln = gce_MakePln(Pl,Dist); TheError = gce_Done; ThePlane = new Geom_Plane(Pln); @@ -85,7 +85,7 @@ GC_MakePlane::GC_MakePlane(const gp_Pln& Pl , //========================================================================= GC_MakePlane::GC_MakePlane(const gp_Pln& Pl , - const gp_Pnt& Point ) { + const gp_Pnt& Point ) : GC_Root() { gp_Pln Pln= gce_MakePln(Pl,Point); TheError = gce_Done; ThePlane = new Geom_Plane(Pln); @@ -95,7 +95,7 @@ GC_MakePlane::GC_MakePlane(const gp_Pln& Pl , // Creation d un Geom_Plane a partir d un Ax1 (Point + Normale). + //========================================================================= -GC_MakePlane::GC_MakePlane(const gp_Ax1& Axis ) { +GC_MakePlane::GC_MakePlane(const gp_Ax1& Axis ) : GC_Root() { gp_Pln Pln = gce_MakePln(Axis); TheError = gce_Done; ThePlane = new Geom_Plane(Pln); diff --git a/src/GC/GC_MakeRotation.cxx b/src/GC/GC_MakeRotation.cxx index a896954b37..fef9997e46 100644 --- a/src/GC/GC_MakeRotation.cxx +++ b/src/GC/GC_MakeRotation.cxx @@ -27,8 +27,8 @@ // droite Line. + //========================================================================= GC_MakeRotation::GC_MakeRotation(const gp_Lin& Line , - const Standard_Real Angle ) { - TheRotation = new Geom_Transformation(); + const Standard_Real Angle ) : TheRotation(new Geom_Transformation()) { + TheRotation->SetRotation(gp_Ax1(Line.Location(),Line.Direction()),Angle); } @@ -38,8 +38,8 @@ GC_MakeRotation::GC_MakeRotation(const gp_Lin& Line , //========================================================================= GC_MakeRotation::GC_MakeRotation(const gp_Ax1& Axis , - const Standard_Real Angle ) { - TheRotation = new Geom_Transformation(); + const Standard_Real Angle ) : TheRotation(new Geom_Transformation()) { + TheRotation->SetRotation(Axis,Angle); } @@ -50,8 +50,8 @@ GC_MakeRotation::GC_MakeRotation(const gp_Ax1& Axis , GC_MakeRotation::GC_MakeRotation(const gp_Pnt& Point , const gp_Dir& Direc , - const Standard_Real Angle ) { - TheRotation = new Geom_Transformation(); + const Standard_Real Angle ) : TheRotation(new Geom_Transformation()) { + TheRotation->SetRotation(gp_Ax1(Point,Direc),Angle); } diff --git a/src/GC/GC_MakeScale.cxx b/src/GC/GC_MakeScale.cxx index 4b728185df..f9d3c87035 100644 --- a/src/GC/GC_MakeScale.cxx +++ b/src/GC/GC_MakeScale.cxx @@ -24,8 +24,8 @@ // Creation d un homothetie de gp de centre Point et de rapport Scale. + //========================================================================= GC_MakeScale::GC_MakeScale(const gp_Pnt& Point , - const Standard_Real Scale ) { - TheScale = new Geom_Transformation(); + const Standard_Real Scale ) : TheScale(new Geom_Transformation()) { + TheScale->SetScale(Point,Scale); } diff --git a/src/GC/GC_MakeSegment.cxx b/src/GC/GC_MakeSegment.cxx index 7b0c93f0aa..d62a00cb1b 100644 --- a/src/GC/GC_MakeSegment.cxx +++ b/src/GC/GC_MakeSegment.cxx @@ -25,7 +25,7 @@ #include GC_MakeSegment::GC_MakeSegment(const gp_Pnt& P1 , - const gp_Pnt& P2 ) + const gp_Pnt& P2 ) : GC_Root() { Standard_Real dist = P1.Distance(P2); Handle(Geom_Line) L = GC_MakeLine(P1,P2); @@ -35,7 +35,7 @@ GC_MakeSegment::GC_MakeSegment(const gp_Pnt& P1 , GC_MakeSegment::GC_MakeSegment(const gp_Lin& Line , const gp_Pnt& Point , - const Standard_Real U ) + const Standard_Real U ) : GC_Root() { Standard_Real Ufirst = ElCLib::Parameter(Line,Point); Handle(Geom_Line) L = new Geom_Line(Line); @@ -45,7 +45,7 @@ GC_MakeSegment::GC_MakeSegment(const gp_Lin& Line , GC_MakeSegment::GC_MakeSegment(const gp_Lin& Line , const gp_Pnt& P1 , - const gp_Pnt& P2 ) + const gp_Pnt& P2 ) : GC_Root() { Standard_Real Ufirst = ElCLib::Parameter(Line,P1); Standard_Real Ulast = ElCLib::Parameter(Line,P2); @@ -56,7 +56,7 @@ GC_MakeSegment::GC_MakeSegment(const gp_Lin& Line , GC_MakeSegment::GC_MakeSegment(const gp_Lin& Line , const Standard_Real U1 , - const Standard_Real U2 ) + const Standard_Real U2 ) : GC_Root() { Handle(Geom_Line) L = new Geom_Line(Line); TheSegment = new Geom_TrimmedCurve(L,U1,U2,Standard_True); diff --git a/src/GC/GC_MakeTranslation.cxx b/src/GC/GC_MakeTranslation.cxx index 2fccd58727..b724092213 100644 --- a/src/GC/GC_MakeTranslation.cxx +++ b/src/GC/GC_MakeTranslation.cxx @@ -24,8 +24,8 @@ //========================================================================= // Creation of a 3D Geom translation of translation vector Vec. + //========================================================================= -GC_MakeTranslation::GC_MakeTranslation(const gp_Vec& Vec ) { - TheTranslation = new Geom_Transformation(); +GC_MakeTranslation::GC_MakeTranslation(const gp_Vec& Vec ) : TheTranslation(new Geom_Transformation()) { + TheTranslation->SetTranslation(Vec); } @@ -35,8 +35,8 @@ GC_MakeTranslation::GC_MakeTranslation(const gp_Vec& Vec ) { //========================================================================= GC_MakeTranslation::GC_MakeTranslation(const gp_Pnt& Point1 , - const gp_Pnt& Point2 ) { - TheTranslation = new Geom_Transformation(); + const gp_Pnt& Point2 ) : TheTranslation(new Geom_Transformation()) { + TheTranslation->SetTranslation(Point1,Point2); } diff --git a/src/GC/GC_MakeTrimmedCone.cxx b/src/GC/GC_MakeTrimmedCone.cxx index 3b7d326aee..4af12fb04a 100644 --- a/src/GC/GC_MakeTrimmedCone.cxx +++ b/src/GC/GC_MakeTrimmedCone.cxx @@ -34,7 +34,7 @@ GC_MakeTrimmedCone::GC_MakeTrimmedCone(const gp_Pnt& P1 , const gp_Pnt& P2 , const gp_Pnt& P3 , - const gp_Pnt& P4 ) + const gp_Pnt& P4 ) : GC_Root() { GC_MakeConicalSurface Cone(P1,P2,P3,P4); TheError = Cone.Status(); @@ -56,7 +56,7 @@ GC_MakeTrimmedCone::GC_MakeTrimmedCone(const gp_Pnt& P1 , GC_MakeTrimmedCone::GC_MakeTrimmedCone(const gp_Pnt& P1 , const gp_Pnt& P2 , const Standard_Real R1 , - const Standard_Real R2 ) + const Standard_Real R2 ) : GC_Root() { GC_MakeConicalSurface Cone(P1,P2,R1,R2); TheError = Cone.Status(); diff --git a/src/GC/GC_MakeTrimmedCylinder.cxx b/src/GC/GC_MakeTrimmedCylinder.cxx index a70485281e..bc7bd07a6f 100644 --- a/src/GC/GC_MakeTrimmedCylinder.cxx +++ b/src/GC/GC_MakeTrimmedCylinder.cxx @@ -32,7 +32,7 @@ //========================================================================= GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Pnt& P1 , const gp_Pnt& P2 , - const gp_Pnt& P3 ) + const gp_Pnt& P3 ) : GC_Root() { GC_MakeCylindricalSurface Cyl(P1,P2,P3); TheError = Cyl.Status(); @@ -47,7 +47,7 @@ GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Pnt& P1 , //========================================================================= GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Circ& Circ , - const Standard_Real Height ) { + const Standard_Real Height ) : GC_Root() { GC_MakeCylindricalSurface Cyl(Circ); TheError = Cyl.Status(); if (TheError == gce_Done) { @@ -61,7 +61,7 @@ GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Circ& Circ , GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Ax1& A1 , const Standard_Real Radius , - const Standard_Real Height ) { + const Standard_Real Height ) : GC_Root() { GC_MakeCylindricalSurface Cyl(A1,Radius); TheError = Cyl.Status(); if (TheError == gce_Done) { diff --git a/src/GCE2d/GCE2d_MakeArcOfCircle.cxx b/src/GCE2d/GCE2d_MakeArcOfCircle.cxx index 9a68d6796e..6e2c831dbf 100644 --- a/src/GCE2d/GCE2d_MakeArcOfCircle.cxx +++ b/src/GCE2d/GCE2d_MakeArcOfCircle.cxx @@ -29,7 +29,7 @@ GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1 , const gp_Pnt2d& P2 , - const gp_Pnt2d& P3 ) + const gp_Pnt2d& P3 ) : GCE2d_Root() { gce_MakeCirc2d Cir = gce_MakeCirc2d(P1,P2,P3); TheError = Cir.Status(); @@ -44,9 +44,9 @@ GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1 , GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1 , const gp_Vec2d& V , - const gp_Pnt2d& P2 ) + const gp_Pnt2d& P2 ) : GCE2d_Root() { - Standard_Boolean Sense; + Standard_Boolean Sense = 0; gp_Circ2d cir; gp_Lin2d corde = gce_MakeLin2d(P1,P2); gp_Dir2d dir(corde.Direction()); @@ -82,7 +82,7 @@ GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1 , GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ , const gp_Pnt2d& P1 , const gp_Pnt2d& P2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Standard_Real Alpha1 = ElCLib::Parameter(Circ,P1); Standard_Real Alpha2 = ElCLib::Parameter(Circ,P2); @@ -94,7 +94,7 @@ GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ , GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ , const gp_Pnt2d& P , const Standard_Real Alpha , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Standard_Real Alphafirst = ElCLib::Parameter(Circ,P); Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ); @@ -105,7 +105,7 @@ GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ , GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ , const Standard_Real Alpha1 , const Standard_Real Alpha2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ); TheArc= new Geom2d_TrimmedCurve(C,Alpha1,Alpha2,Sense); diff --git a/src/GCE2d/GCE2d_MakeArcOfEllipse.cxx b/src/GCE2d/GCE2d_MakeArcOfEllipse.cxx index 4621bd50cd..c9e25ca33e 100644 --- a/src/GCE2d/GCE2d_MakeArcOfEllipse.cxx +++ b/src/GCE2d/GCE2d_MakeArcOfEllipse.cxx @@ -26,7 +26,7 @@ GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips , const gp_Pnt2d& P1 , const gp_Pnt2d& P2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Standard_Real Alpha1 = ElCLib::Parameter(Elips,P1); Standard_Real Alpha2 = ElCLib::Parameter(Elips,P2); @@ -38,7 +38,7 @@ GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips , GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips , const gp_Pnt2d& P , const Standard_Real Alpha , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Standard_Real Alphafirst = ElCLib::Parameter(Elips,P); Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips); @@ -49,7 +49,7 @@ GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips , GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips , const Standard_Real Alpha1 , const Standard_Real Alpha2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips); TheArc = new Geom2d_TrimmedCurve(E,Alpha1,Alpha2,Sense); diff --git a/src/GCE2d/GCE2d_MakeArcOfHyperbola.cxx b/src/GCE2d/GCE2d_MakeArcOfHyperbola.cxx index b9fc62b3cb..fc6c2560b6 100644 --- a/src/GCE2d/GCE2d_MakeArcOfHyperbola.cxx +++ b/src/GCE2d/GCE2d_MakeArcOfHyperbola.cxx @@ -26,7 +26,7 @@ GCE2d_MakeArcOfHyperbola::GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr , const gp_Pnt2d& P1 , const gp_Pnt2d& P2 , - const Standard_Boolean Sense) + const Standard_Boolean Sense) : GCE2d_Root() { Standard_Real Alpha1 = ElCLib::Parameter(Hypr,P1); Standard_Real Alpha2 = ElCLib::Parameter(Hypr,P2); @@ -39,7 +39,7 @@ GCE2d_MakeArcOfHyperbola:: GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr , const gp_Pnt2d& P , const Standard_Real Alpha , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Standard_Real Alphafirst = ElCLib::Parameter(Hypr,P); Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr); @@ -51,7 +51,7 @@ GCE2d_MakeArcOfHyperbola:: GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr , const Standard_Real Alpha1, const Standard_Real Alpha2, - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr); TheArc = new Geom2d_TrimmedCurve(H,Alpha1,Alpha2,Sense); diff --git a/src/GCE2d/GCE2d_MakeArcOfParabola.cxx b/src/GCE2d/GCE2d_MakeArcOfParabola.cxx index ac36dd5966..bb93215fe6 100644 --- a/src/GCE2d/GCE2d_MakeArcOfParabola.cxx +++ b/src/GCE2d/GCE2d_MakeArcOfParabola.cxx @@ -27,7 +27,7 @@ GCE2d_MakeArcOfParabola:: GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab , const gp_Pnt2d& P1 , const gp_Pnt2d& P2 , - const Standard_Boolean Sense ) { + const Standard_Boolean Sense ) : GCE2d_Root() { Standard_Real Alpha1 = ElCLib::Parameter(Parab,P1); Standard_Real Alpha2 = ElCLib::Parameter(Parab,P2); Handle(Geom2d_Parabola) P = new Geom2d_Parabola(Parab); @@ -39,7 +39,7 @@ GCE2d_MakeArcOfParabola:: GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab , const gp_Pnt2d& P , const Standard_Real Alpha , - const Standard_Boolean Sense ) { + const Standard_Boolean Sense ) : GCE2d_Root() { Standard_Real Alphafirst = ElCLib::Parameter(Parab,P); Handle(Geom2d_Parabola) Parabola = new Geom2d_Parabola(Parab); TheArc = new Geom2d_TrimmedCurve(Parabola,Alphafirst,Alpha,Sense); @@ -50,7 +50,7 @@ GCE2d_MakeArcOfParabola:: GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab , const Standard_Real Alpha1 , const Standard_Real Alpha2 , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { Handle(Geom2d_Parabola) P = new Geom2d_Parabola(Parab); TheArc = new Geom2d_TrimmedCurve(P,Alpha1,Alpha2,Sense); diff --git a/src/GCE2d/GCE2d_MakeCircle.cxx b/src/GCE2d/GCE2d_MakeCircle.cxx index f94b4a2585..155ae02402 100644 --- a/src/GCE2d/GCE2d_MakeCircle.cxx +++ b/src/GCE2d/GCE2d_MakeCircle.cxx @@ -24,15 +24,15 @@ #include #include -GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& C) +GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& C) : GCE2d_Root(), TheCircle(new Geom2d_Circle(C)) { TheError = gce_Done; - TheCircle = new Geom2d_Circle(C); + } GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax2d& A , const Standard_Real Radius, - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { if (Radius < 0.0) { TheError = gce_NegativeRadius; } else { @@ -42,7 +42,7 @@ GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax2d& A , } GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax22d& A , - const Standard_Real Radius) + const Standard_Real Radius) : GCE2d_Root() { if (Radius < 0.0) { TheError = gce_NegativeRadius; } else { @@ -52,7 +52,7 @@ GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax22d& A , } GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ , - const gp_Pnt2d& Point ) + const gp_Pnt2d& Point ) : GCE2d_Root() { gp_Circ2d C = gce_MakeCirc2d(Circ,Point); TheCircle = new Geom2d_Circle(C); @@ -60,7 +60,7 @@ GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ , } GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ , - const Standard_Real Dist ) + const Standard_Real Dist ) : GCE2d_Root() { gce_MakeCirc2d C = gce_MakeCirc2d(Circ,Dist); TheError = C.Status(); @@ -71,7 +71,7 @@ GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ , GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& P1 , const gp_Pnt2d& P2 , - const gp_Pnt2d& P3 ) + const gp_Pnt2d& P3 ) : GCE2d_Root() { gce_MakeCirc2d C = gce_MakeCirc2d(P1,P2,P3); TheError = C.Status(); @@ -83,7 +83,7 @@ GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& P1 , GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Point , const Standard_Real Radius , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { gce_MakeCirc2d C = gce_MakeCirc2d(Point,Radius,Sense); TheError = C.Status(); @@ -94,7 +94,7 @@ GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Point , GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Center , const gp_Pnt2d& Point , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { gce_MakeCirc2d C = gce_MakeCirc2d(Center,Point,Sense); TheError = C.Status(); diff --git a/src/GCE2d/GCE2d_MakeEllipse.cxx b/src/GCE2d/GCE2d_MakeEllipse.cxx index 77ef40cce0..bcda4823f3 100644 --- a/src/GCE2d/GCE2d_MakeEllipse.cxx +++ b/src/GCE2d/GCE2d_MakeEllipse.cxx @@ -24,15 +24,15 @@ #include #include -GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Elips2d& E) +GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Elips2d& E) : GCE2d_Root(), TheEllipse(new Geom2d_Ellipse(E)) { TheError = gce_Done; - TheEllipse = new Geom2d_Ellipse(E); + } GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax22d& Axis , const Standard_Real MajorRadius , - const Standard_Real MinorRadius ) + const Standard_Real MinorRadius ) : GCE2d_Root() { gce_MakeElips2d E = gce_MakeElips2d(Axis,MajorRadius,MinorRadius); TheError = E.Status(); @@ -44,7 +44,7 @@ GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax22d& Axis , GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis , const Standard_Real MajorRadius , const Standard_Real MinorRadius , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { gce_MakeElips2d E = gce_MakeElips2d(MajorAxis,MajorRadius,MinorRadius,Sense); TheError = E.Status(); @@ -55,7 +55,7 @@ GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis , GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Pnt2d& S1 , const gp_Pnt2d& S2 , - const gp_Pnt2d& Center ) { + const gp_Pnt2d& Center ) : GCE2d_Root() { gce_MakeElips2d E = gce_MakeElips2d(S1,S2,Center); TheError = E.Status(); if (TheError == gce_Done) { diff --git a/src/GCE2d/GCE2d_MakeHyperbola.cxx b/src/GCE2d/GCE2d_MakeHyperbola.cxx index 5d9e94536e..83c8e02c1a 100644 --- a/src/GCE2d/GCE2d_MakeHyperbola.cxx +++ b/src/GCE2d/GCE2d_MakeHyperbola.cxx @@ -24,16 +24,16 @@ #include #include -GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Hypr2d& H) +GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Hypr2d& H) : GCE2d_Root(), TheHyperbola(new Geom2d_Hyperbola(H)) { TheError = gce_Done; - TheHyperbola = new Geom2d_Hyperbola(H); + } GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax2d& MajorAxis , const Standard_Real MajorRadius, const Standard_Real MinorRadius, - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { gce_MakeHypr2d H = gce_MakeHypr2d(MajorAxis,MajorRadius,MinorRadius,Sense); TheError = H.Status(); @@ -44,7 +44,7 @@ GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax2d& MajorAxis , GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax22d& Axis , const Standard_Real MajorRadius, - const Standard_Real MinorRadius) + const Standard_Real MinorRadius) : GCE2d_Root() { gce_MakeHypr2d H = gce_MakeHypr2d(Axis,MajorRadius,MinorRadius); TheError = H.Status(); @@ -55,7 +55,7 @@ GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax22d& Axis , GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Pnt2d& S1 , const gp_Pnt2d& S2 , - const gp_Pnt2d& Center ) { + const gp_Pnt2d& Center ) : GCE2d_Root() { gce_MakeHypr2d H = gce_MakeHypr2d(S1,S2,Center); TheError = H.Status(); if (TheError == gce_Done) { diff --git a/src/GCE2d/GCE2d_MakeLine.cxx b/src/GCE2d/GCE2d_MakeLine.cxx index c2987dde84..e9f7ac0e7d 100644 --- a/src/GCE2d/GCE2d_MakeLine.cxx +++ b/src/GCE2d/GCE2d_MakeLine.cxx @@ -27,27 +27,27 @@ //========================================================================= // Constructions of 2d geometrical elements from Geom2d. //========================================================================= -GCE2d_MakeLine::GCE2d_MakeLine(const gp_Ax2d& A) +GCE2d_MakeLine::GCE2d_MakeLine(const gp_Ax2d& A) : GCE2d_Root(), TheLine(new Geom2d_Line(A)) { TheError = gce_Done; - TheLine = new Geom2d_Line(A); + } -GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& L) +GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& L) : GCE2d_Root(), TheLine(new Geom2d_Line(L)) { TheError = gce_Done; - TheLine = new Geom2d_Line(L); + } GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P, - const gp_Dir2d& V) + const gp_Dir2d& V) : GCE2d_Root(), TheLine(new Geom2d_Line(P,V)) { TheError = gce_Done; - TheLine = new Geom2d_Line(P,V); + } GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P1 , - const gp_Pnt2d& P2 ) + const gp_Pnt2d& P2 ) : GCE2d_Root() { gce_MakeLin2d L(P1,P2); TheError = L.Status(); @@ -57,7 +57,7 @@ GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P1 , } GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin , - const gp_Pnt2d& Point ) + const gp_Pnt2d& Point ) : GCE2d_Root() { gce_MakeLin2d L(Lin,Point); TheError = L.Status(); @@ -67,7 +67,7 @@ GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin , } GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin , - const Standard_Real Dist ) + const Standard_Real Dist ) : GCE2d_Root() { gce_MakeLin2d L(Lin,Dist); TheError = L.Status(); diff --git a/src/GCE2d/GCE2d_MakeMirror.cxx b/src/GCE2d/GCE2d_MakeMirror.cxx index 9fff3db3cf..5f0d0bdc00 100644 --- a/src/GCE2d/GCE2d_MakeMirror.cxx +++ b/src/GCE2d/GCE2d_MakeMirror.cxx @@ -25,8 +25,8 @@ //========================================================================= // Creation d une symetrie de Geom2d par rapport a un point. + //========================================================================= -GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point ) { - TheMirror = new Geom2d_Transformation(); +GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point ) : TheMirror(new Geom2d_Transformation()) { + TheMirror->SetMirror(Point); } @@ -34,8 +34,8 @@ GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point ) { // Creation d une symetrie de Geom2d par rapport a une droite. + //========================================================================= -GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Ax2d& Axis ) { - TheMirror = new Geom2d_Transformation(); +GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Ax2d& Axis ) : TheMirror(new Geom2d_Transformation()) { + TheMirror->SetMirror(Axis); } @@ -43,8 +43,8 @@ GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Ax2d& Axis ) { // Creation d une symetrie de Geom2d par rapport a une droite. + //========================================================================= -GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Lin2d& Line ) { - TheMirror = new Geom2d_Transformation(); +GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Lin2d& Line ) : TheMirror(new Geom2d_Transformation()) { + TheMirror->SetMirror(gp_Ax2d(Line.Location(),Line.Direction())); } @@ -54,8 +54,8 @@ GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Lin2d& Line ) { //========================================================================= GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point , - const gp_Dir2d& Direc ) { - TheMirror = new Geom2d_Transformation(); + const gp_Dir2d& Direc ) : TheMirror(new Geom2d_Transformation()) { + TheMirror->SetMirror(gp_Ax2d(Point,Direc)); } diff --git a/src/GCE2d/GCE2d_MakeParabola.cxx b/src/GCE2d/GCE2d_MakeParabola.cxx index 54561a2a57..0f1a120e41 100644 --- a/src/GCE2d/GCE2d_MakeParabola.cxx +++ b/src/GCE2d/GCE2d_MakeParabola.cxx @@ -24,15 +24,15 @@ #include #include -GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Parab2d& Prb) +GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Parab2d& Prb) : GCE2d_Root(), TheParabola(new Geom2d_Parabola(Prb)) { TheError = gce_Done; - TheParabola = new Geom2d_Parabola(Prb); + } GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& MirrorAxis, const Standard_Real Focal , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { if (Focal <0.0) { TheError = gce_NullFocusLength; } else { @@ -42,7 +42,7 @@ GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& MirrorAxis, } GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax22d& Axis , - const Standard_Real Focal) + const Standard_Real Focal) : GCE2d_Root() { if (Focal <0.0) { TheError = gce_NullFocusLength; } else { @@ -53,7 +53,7 @@ GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax22d& Axis , GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& D , const gp_Pnt2d& F , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : GCE2d_Root() { TheError = gce_Done; gp_Parab2d para(D,F,Sense); @@ -62,7 +62,7 @@ GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& D , GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Pnt2d& S1 , - const gp_Pnt2d& O ) { + const gp_Pnt2d& O ) : GCE2d_Root() { gce_MakeParab2d P = gce_MakeParab2d(S1,O); TheError = P.Status(); if (TheError == gce_Done) { diff --git a/src/GCE2d/GCE2d_MakeRotation.cxx b/src/GCE2d/GCE2d_MakeRotation.cxx index a3faf5079c..cc4d3a0dd3 100644 --- a/src/GCE2d/GCE2d_MakeRotation.cxx +++ b/src/GCE2d/GCE2d_MakeRotation.cxx @@ -24,8 +24,8 @@ // droite Line. + //========================================================================= GCE2d_MakeRotation::GCE2d_MakeRotation(const gp_Pnt2d& Point , - const Standard_Real Angle ) { - TheRotation = new Geom2d_Transformation(); + const Standard_Real Angle ) : TheRotation(new Geom2d_Transformation()) { + TheRotation->SetRotation(Point,Angle); } diff --git a/src/GCE2d/GCE2d_MakeScale.cxx b/src/GCE2d/GCE2d_MakeScale.cxx index e00ab00c6b..7bf4547884 100644 --- a/src/GCE2d/GCE2d_MakeScale.cxx +++ b/src/GCE2d/GCE2d_MakeScale.cxx @@ -23,8 +23,8 @@ // Creation d un homothetie de gp de centre Point et de rapport Scale. + //========================================================================= GCE2d_MakeScale::GCE2d_MakeScale(const gp_Pnt2d& Point , - const Standard_Real Scale ) { - TheScale = new Geom2d_Transformation(); + const Standard_Real Scale ) : TheScale(new Geom2d_Transformation()) { + TheScale->SetScale(Point,Scale); } diff --git a/src/GCE2d/GCE2d_MakeSegment.cxx b/src/GCE2d/GCE2d_MakeSegment.cxx index 3f4832b95b..8822e8b8b4 100644 --- a/src/GCE2d/GCE2d_MakeSegment.cxx +++ b/src/GCE2d/GCE2d_MakeSegment.cxx @@ -27,7 +27,7 @@ GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1 , const gp_Dir2d& V , - const gp_Pnt2d& P2 ) + const gp_Pnt2d& P2 ) : GCE2d_Root() { gp_Lin2d Line(P1,V); Standard_Real Ulast = ElCLib::Parameter(Line,P2); @@ -40,7 +40,7 @@ GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1 , } GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1 , - const gp_Pnt2d& P2 ) + const gp_Pnt2d& P2 ) : GCE2d_Root() { Standard_Real dist = P1.Distance(P2); if (dist != 0.0) { @@ -52,7 +52,7 @@ GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1 , } GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line , const gp_Pnt2d& Point , - const Standard_Real U ) + const Standard_Real U ) : GCE2d_Root() { Standard_Real Ufirst = ElCLib::Parameter(Line,Point); Handle(Geom2d_Line) L = new Geom2d_Line(Line); @@ -62,7 +62,7 @@ GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line , GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line , const gp_Pnt2d& P1 , - const gp_Pnt2d& P2 ) + const gp_Pnt2d& P2 ) : GCE2d_Root() { Standard_Real Ufirst = ElCLib::Parameter(Line,P1); Standard_Real Ulast = ElCLib::Parameter(Line,P2); @@ -73,7 +73,7 @@ GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line , GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line , const Standard_Real U1 , - const Standard_Real U2 ) + const Standard_Real U2 ) : GCE2d_Root() { Handle(Geom2d_Line) L = new Geom2d_Line(Line); TheSegment = new Geom2d_TrimmedCurve(L,U1,U2,Standard_True); diff --git a/src/GCE2d/GCE2d_MakeTranslation.cxx b/src/GCE2d/GCE2d_MakeTranslation.cxx index 277b64f2fc..7317a43075 100644 --- a/src/GCE2d/GCE2d_MakeTranslation.cxx +++ b/src/GCE2d/GCE2d_MakeTranslation.cxx @@ -23,8 +23,8 @@ //========================================================================= // Creation d une translation 3d de Geom2d de vecteur de translation Vec //========================================================================= -GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Vec2d& Vec ) { - TheTranslation = new Geom2d_Transformation(); +GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Vec2d& Vec ) : TheTranslation(new Geom2d_Transformation()) { + TheTranslation->SetTranslation(Vec); } @@ -34,8 +34,8 @@ GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Vec2d& Vec ) { //========================================================================= GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Pnt2d& Point1 , - const gp_Pnt2d& Point2 ) { - TheTranslation = new Geom2d_Transformation(); + const gp_Pnt2d& Point2 ) : TheTranslation(new Geom2d_Transformation()) { + TheTranslation->SetTranslation(Point1,Point2); } diff --git a/src/GCPnts/GCPnts_TangentialDeflection.cxx b/src/GCPnts/GCPnts_TangentialDeflection.cxx index e13d3095a9..77c812671b 100644 --- a/src/GCPnts/GCPnts_TangentialDeflection.cxx +++ b/src/GCPnts/GCPnts_TangentialDeflection.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -46,7 +48,7 @@ namespace static void D0 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt& PP) { - Standard_Real X, Y; + Standard_Real X = NAN, Y = NAN; gp_Pnt2d P; C.D0 (U, P); P.Coord (X, Y); @@ -56,7 +58,7 @@ namespace static void D2 (const Adaptor2d_Curve2d& C, const Standard_Real U, gp_Pnt& PP, gp_Vec& VV1, gp_Vec& VV2) { - Standard_Real X, Y; + Standard_Real X = NAN, Y = NAN; gp_Pnt2d P; gp_Vec2d V1,V2; C.D2 (U, P, V1, V2); @@ -88,7 +90,7 @@ namespace TColStd_Array1OfReal& theIntervs, const Standard_Integer thePreviousIdx) { - Standard_Integer anIdx; + Standard_Integer anIdx = 0; for(anIdx = thePreviousIdx; anIdx < theIntervs.Upper(); anIdx++) { if (theParam >= theIntervs(anIdx) && @@ -500,10 +502,10 @@ Standard_Real GCPnts_TangentialDeflection::ArcAngularStep( template void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& theC) { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; gp_XYZ V1, V2; gp_Pnt MiddlePoint, CurrentPoint, LastPoint; - Standard_Real Du, Dusave, MiddleU, L1, L2; + Standard_Real Du = NAN, Dusave = NAN, MiddleU = NAN, L1 = NAN, L2 = NAN; Standard_Real U1 = myFirstu; Standard_Real LTol = Precision::Confusion(); // protection longueur nulle @@ -674,7 +676,7 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& theC) } Standard_Real Coef = 0.0, ACoef = 0., FCoef = 0.; - Standard_Boolean Correction, TooLarge, TooSmall; + Standard_Boolean Correction = 0, TooLarge = 0, TooSmall = 0; TooLarge = Standard_False; Correction = Standard_True; TooSmall = Standard_False; diff --git a/src/GProp/GProp_CelGProps.cxx b/src/GProp/GProp_CelGProps.cxx index 25d2e939dd..80a6c85906 100644 --- a/src/GProp/GProp_CelGProps.cxx +++ b/src/GProp/GProp_CelGProps.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -36,7 +38,7 @@ void GProp_CelGProps::Perform(const gp_Circ& C, const Standard_Real U1, const Standard_Real U2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; C.Location().Coord(X0,Y0,Z0); C.XAxis().Direction().Coord(Xa1,Ya1,Za1); C.YAxis().Direction().Coord(Xa2,Ya2,Za2); @@ -92,7 +94,7 @@ void GProp_CelGProps::Perform(const gp_Lin& C, dim =Abs(U2-U1); gp_Pnt P2 = ElCLib::LineValue(U2,Pos); g.SetCoord((P1.X()+P2.X())/2.,(P1.Y()+P2.Y())/2.,(P1.Z()+P2.Z())/2.); - Standard_Real Vx,Vy,Vz,X0,Y0,Z0; + Standard_Real Vx = NAN,Vy = NAN,Vz = NAN,X0 = NAN,Y0 = NAN,Z0 = NAN; Pos.Direction().Coord(Vx,Vy,Vz); Pos.Location().Coord(X0,Y0,Z0); Standard_Real alfa1 = (Vz*Vz+Vy*Vy)/3.; diff --git a/src/GProp/GProp_GProps.cxx b/src/GProp/GProp_GProps.cxx index 27752b18fc..c8388c2031 100644 --- a/src/GProp/GProp_GProps.cxx +++ b/src/GProp/GProp_GProps.cxx @@ -146,7 +146,7 @@ Standard_Real GProp_GProps::RadiusOfGyration (const gp_Ax1& A) const { GProp_PrincipalProps GProp_GProps::PrincipalProperties () const { math_Matrix DiagMat (1, 3, 1, 3); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; gp_Mat AxisInertia = MatrixOfInertia(); for (j = 1; j <= 3; j++) { for (i = 1; i <= 3; i++) { diff --git a/src/GProp/GProp_PEquation.cxx b/src/GProp/GProp_PEquation.cxx index 5bc27e66a7..2cd0f9b998 100644 --- a/src/GProp/GProp_PEquation.cxx +++ b/src/GProp/GProp_PEquation.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -27,19 +29,19 @@ GProp_PEquation::GProp_PEquation(const TColgp_Array1OfPnt& Pnts, { GProp_PGProps Pmat(Pnts); g = Pmat.CentreOfMass(); - Standard_Real Xg,Yg,Zg; + Standard_Real Xg = NAN,Yg = NAN,Zg = NAN; g.Coord(Xg,Yg,Zg); GProp_PrincipalProps Pp = Pmat.PrincipalProperties(); gp_Vec V1 = Pp.FirstAxisOfInertia(); - Standard_Real Xv1,Yv1,Zv1; + Standard_Real Xv1 = NAN,Yv1 = NAN,Zv1 = NAN; V1.Coord(Xv1,Yv1,Zv1); gp_Vec V2 = Pp.SecondAxisOfInertia(); - Standard_Real Xv2,Yv2,Zv2; + Standard_Real Xv2 = NAN,Yv2 = NAN,Zv2 = NAN; V2.Coord(Xv2,Yv2,Zv2); gp_Vec V3 = Pp.ThirdAxisOfInertia(); - Standard_Real Xv3,Yv3,Zv3; + Standard_Real Xv3 = NAN,Yv3 = NAN,Zv3 = NAN; V3.Coord(Xv3,Yv3,Zv3); - Standard_Real D,X,Y,Z; + Standard_Real D = NAN,X = NAN,Y = NAN,Z = NAN; Standard_Real Dmx1 = RealFirst(); Standard_Real Dmn1 = RealLast(); Standard_Real Dmx2 = RealFirst(); diff --git a/src/GProp/GProp_PGProps.cxx b/src/GProp/GProp_PGProps.cxx index 5045926e3c..3af8fa0d65 100644 --- a/src/GProp/GProp_PGProps.cxx +++ b/src/GProp/GProp_PGProps.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,7 +39,7 @@ GProp_PGProps::GProp_PGProps () void GProp_PGProps::AddPoint (const Pnt& P) { - Standard_Real Xp, Yp, Zp; + Standard_Real Xp = NAN, Yp = NAN, Zp = NAN; P.Coord (Xp, Yp, Zp); Standard_Real Ixy = - Xp * Yp; Standard_Real Ixz = - Xp * Zp; @@ -53,7 +55,7 @@ void GProp_PGProps::AddPoint (const Pnt& P) inertia = Mp; } else { - Standard_Real X, Y, Z; + Standard_Real X = NAN, Y = NAN, Z = NAN; g.Coord (X, Y, Z); X = X * dim + Xp; Y = Y * dim + Yp; @@ -70,7 +72,7 @@ void GProp_PGProps::AddPoint (const Pnt& P) void GProp_PGProps::AddPoint (const gp_Pnt& P, const Standard_Real Density) { if (Density <= gp::Resolution()) throw Standard_DomainError(); - Standard_Real Xp, Yp, Zp; + Standard_Real Xp = NAN, Yp = NAN, Zp = NAN; P.Coord (Xp, Yp, Zp); Standard_Real Ixy = - Xp * Yp; Standard_Real Ixz = - Xp * Zp; @@ -85,7 +87,7 @@ void GProp_PGProps::AddPoint (const gp_Pnt& P, const Standard_Real Density) inertia = Mp * Density; } else { - Standard_Real X, Y, Z; + Standard_Real X = NAN, Y = NAN, Z = NAN; g.Coord (X, Y, Z); X = X * dim + Xp * Density; Y = Y * dim + Yp * Density; diff --git a/src/GProp/GProp_SelGProps.cxx b/src/GProp/GProp_SelGProps.cxx index 57356e2afd..37accfb79a 100644 --- a/src/GProp/GProp_SelGProps.cxx +++ b/src/GProp/GProp_SelGProps.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -38,7 +40,7 @@ void GProp_SelGProps::Perform(const gp_Cylinder& S, const Standard_Real Z1, const Standard_Real Z2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; S.Location().Coord(X0,Y0,Z0); Standard_Real R = S.Radius(); S.Position().XDirection().Coord(Xa1,Ya1,Za1); @@ -103,7 +105,7 @@ void GProp_SelGProps::Perform (const gp_Cone& S, const Standard_Real Z2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; S.Location().Coord(X0,Y0,Z0); S.Position().XDirection().Coord(Xa1,Ya1,Za1); S.Position().YDirection().Coord(Xa2,Ya2,Za2); @@ -183,7 +185,7 @@ void GProp_SelGProps::Perform(const gp_Sphere& S, const Standard_Real Alpha1, const Standard_Real Alpha2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; S.Location().Coord(X0,Y0,Z0); S.Position().XDirection().Coord(Xa1,Ya1,Za1); S.Position().YDirection().Coord(Xa2,Ya2,Za2); @@ -262,7 +264,7 @@ void GProp_SelGProps::Perform (const gp_Torus& S, const Standard_Real Alpha1, const Standard_Real Alpha2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; S.Location().Coord(X0,Y0,Z0); S.XAxis().Direction().Coord(Xa1,Ya1,Za1); S.YAxis().Direction().Coord(Xa2,Ya2,Za2); diff --git a/src/GProp/GProp_VelGProps.cxx b/src/GProp/GProp_VelGProps.cxx index efa5962096..0e165b175d 100644 --- a/src/GProp/GProp_VelGProps.cxx +++ b/src/GProp/GProp_VelGProps.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -83,7 +85,7 @@ void GProp_VelGProps::Perform(const gp_Cylinder& S, const Standard_Real Z1, const Standard_Real Z2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; S.Location().Coord(X0,Y0,Z0); Standard_Real Rayon = S.Radius(); S.Position().XDirection().Coord(Xa1,Ya1,Za1); @@ -150,7 +152,7 @@ void GProp_VelGProps::Perform(const gp_Cone& S, const Standard_Real Z1, const Standard_Real Z2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; S.Location().Coord(X0,Y0,Z0); S.Position().XDirection().Coord(Xa1,Ya1,Za1); S.Position().YDirection().Coord(Xa2,Ya2,Za2); @@ -230,7 +232,7 @@ void GProp_VelGProps::Perform(const gp_Sphere& S, const Standard_Real Alpha1, const Standard_Real Alpha2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; S.Location().Coord(X0,Y0,Z0); S.Position().XDirection().Coord(Xa1,Ya1,Za1); S.Position().YDirection().Coord(Xa2,Ya2,Za2); @@ -310,7 +312,7 @@ void GProp_VelGProps::Perform(const gp_Torus& S, const Standard_Real Alpha1, const Standard_Real Alpha2) { - Standard_Real X0,Y0,Z0,Xa1,Ya1,Za1,Xa2,Ya2,Za2,Xa3,Ya3,Za3; + Standard_Real X0 = NAN,Y0 = NAN,Z0 = NAN,Xa1 = NAN,Ya1 = NAN,Za1 = NAN,Xa2 = NAN,Ya2 = NAN,Za2 = NAN,Xa3 = NAN,Ya3 = NAN,Za3 = NAN; S.Location().Coord(X0,Y0,Z0); S.Position().XDirection().Coord(Xa1,Ya1,Za1); S.Position().YDirection().Coord(Xa2,Ya2,Za2); diff --git a/src/GccAna/GccAna_Circ2d2TanOn.cxx b/src/GccAna/GccAna_Circ2d2TanOn.cxx index bb64297cc6..2702609120 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn.cxx @@ -49,7 +49,7 @@ GccAna_Circ2d2TanOn:: const GccEnt_QualifiedCirc& Qualified2 , const gp_Lin2d& OnLine , const Standard_Real Tolerance ): - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4), qualifier2(1,4) , TheSame1(1,4) , @@ -66,8 +66,8 @@ GccAna_Circ2d2TanOn:: TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + Standard_Integer nbsol = 0; Standard_Real Tol = Abs(Tolerance); if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || diff --git a/src/GccAna/GccAna_Circ2d2TanOn_1.cxx b/src/GccAna/GccAna_Circ2d2TanOn_1.cxx index cd00d7991b..282a5e721c 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_1.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_1.cxx @@ -50,7 +50,7 @@ GccAna_Circ2d2TanOn:: const GccEnt_QualifiedLin& Qualified2 , const gp_Lin2d& OnLine , const Standard_Real Tolerance ): - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , qualifier2(1,4), TheSame1(1,4) , @@ -67,8 +67,8 @@ GccAna_Circ2d2TanOn:: TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || diff --git a/src/GccAna/GccAna_Circ2d2TanOn_10.cxx b/src/GccAna/GccAna_Circ2d2TanOn_10.cxx index 8301c13285..962cbb0460 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_10.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_10.cxx @@ -50,7 +50,7 @@ GccAna_Circ2d2TanOn:: const gp_Pnt2d& Point2 , const gp_Circ2d& OnCirc , const Standard_Real Tolerance ): - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , qualifier2(1,4) , TheSame1(1,4) , @@ -67,8 +67,8 @@ GccAna_Circ2d2TanOn:: TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2d2TanOn_11.cxx b/src/GccAna/GccAna_Circ2d2TanOn_11.cxx index af13ab9075..8cb6fd9efd 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_11.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_11.cxx @@ -49,7 +49,7 @@ GccAna_Circ2d2TanOn:: const gp_Pnt2d& Point2 , const gp_Circ2d& OnCirc , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , qualifier2(1,2) , TheSame1(1,2) , @@ -65,8 +65,8 @@ GccAna_Circ2d2TanOn:: { TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + gp_Dir2d dirx(1.,0.); Standard_Real Tol = Abs(Tolerance); Standard_Real dist = Point1.Distance(Point2); diff --git a/src/GccAna/GccAna_Circ2d2TanOn_2.cxx b/src/GccAna/GccAna_Circ2d2TanOn_2.cxx index 1b108a6479..1089dac049 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_2.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_2.cxx @@ -33,7 +33,7 @@ GccAna_Circ2d2TanOn:: const GccEnt_QualifiedLin& Qualified2 , const gp_Lin2d& OnLine , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , qualifier2(1,2) , TheSame1(1,2) , @@ -50,8 +50,8 @@ GccAna_Circ2d2TanOn:: // initialisations TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || diff --git a/src/GccAna/GccAna_Circ2d2TanOn_3.cxx b/src/GccAna/GccAna_Circ2d2TanOn_3.cxx index b3c3b3f6e3..8a5542f91f 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_3.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_3.cxx @@ -51,7 +51,7 @@ GccAna_Circ2d2TanOn:: const gp_Pnt2d& Point2 , const gp_Lin2d& OnLine , const Standard_Real Tolerance ): - cirsol(1,4), + WellDone(Standard_False), NbrSol(0), cirsol(1,4), qualifier1(1,4) , qualifier2(1,4) , TheSame1(1,4) , @@ -68,8 +68,8 @@ GccAna_Circ2d2TanOn:: TheSame1.Init(0); TheSame2.Init(0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2d2TanOn_4.cxx b/src/GccAna/GccAna_Circ2d2TanOn_4.cxx index cfb375ceaf..34365c8e72 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_4.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_4.cxx @@ -54,7 +54,7 @@ GccAna_Circ2d2TanOn:: const gp_Pnt2d& Point2 , const gp_Lin2d& OnLine , const Standard_Real Tolerance ): - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , qualifier2(1,4), TheSame1(1,4) , @@ -70,8 +70,8 @@ GccAna_Circ2d2TanOn:: { TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2d2TanOn_5.cxx b/src/GccAna/GccAna_Circ2d2TanOn_5.cxx index ce0b51c26e..9c4e380244 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_5.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_5.cxx @@ -42,7 +42,7 @@ GccAna_Circ2d2TanOn:: const gp_Pnt2d& Point2 , const gp_Lin2d& OnLine , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , qualifier2(1,2), TheSame1(1,2) , @@ -58,8 +58,8 @@ GccAna_Circ2d2TanOn:: { TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + gp_Dir2d dirx(1.,0.); Standard_Real dist = Point1.Distance(Point2); diff --git a/src/GccAna/GccAna_Circ2d2TanOn_6.cxx b/src/GccAna/GccAna_Circ2d2TanOn_6.cxx index 15f05f1a2b..aa2c2c2633 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_6.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_6.cxx @@ -49,7 +49,7 @@ GccAna_Circ2d2TanOn:: const GccEnt_QualifiedCirc& Qualified2 , const gp_Circ2d& OnCirc , const Standard_Real Tolerance ): - cirsol(1,8) , + WellDone(Standard_False), NbrSol(0), cirsol(1,8) , qualifier1(1,8) , qualifier2(1,8) , TheSame1(1,8) , @@ -65,8 +65,8 @@ GccAna_Circ2d2TanOn:: { TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || diff --git a/src/GccAna/GccAna_Circ2d2TanOn_7.cxx b/src/GccAna/GccAna_Circ2d2TanOn_7.cxx index 1aebb7f3c4..5140db4627 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_7.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_7.cxx @@ -38,7 +38,7 @@ GccAna_Circ2d2TanOn:: const GccEnt_QualifiedLin& Qualified2 , const gp_Circ2d& OnCirc , const Standard_Real Tolerance ): - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , qualifier2(1,4), TheSame1(1,4) , @@ -54,8 +54,8 @@ GccAna_Circ2d2TanOn:: { TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || diff --git a/src/GccAna/GccAna_Circ2d2TanOn_8.cxx b/src/GccAna/GccAna_Circ2d2TanOn_8.cxx index d0202cd17c..26ff3f62c1 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_8.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_8.cxx @@ -44,7 +44,7 @@ GccAna_Circ2d2TanOn:: const gp_Pnt2d& Point2 , const gp_Circ2d& OnCirc , const Standard_Real Tolerance ): - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , qualifier2(1,4), TheSame1(1,4) , @@ -60,8 +60,8 @@ GccAna_Circ2d2TanOn:: { TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2d2TanOn_9.cxx b/src/GccAna/GccAna_Circ2d2TanOn_9.cxx index f6fbd8e694..183e8f40ed 100644 --- a/src/GccAna/GccAna_Circ2d2TanOn_9.cxx +++ b/src/GccAna/GccAna_Circ2d2TanOn_9.cxx @@ -34,7 +34,7 @@ GccAna_Circ2d2TanOn:: const GccEnt_QualifiedLin& Qualified2 , const gp_Circ2d& OnCirc , const Standard_Real ): - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , qualifier2(1,4), TheSame1(1,4) , @@ -50,8 +50,8 @@ GccAna_Circ2d2TanOn:: { TheSame1.Init(0); TheSame2.Init(0); - WellDone = Standard_False; - NbrSol = 0; + + gp_Dir2d dirx(1.,0.); if (!(Qualified1.IsEnclosed() || diff --git a/src/GccAna/GccAna_Circ2d2TanRad.cxx b/src/GccAna/GccAna_Circ2d2TanRad.cxx index 5ae0bbf172..6efd104d50 100644 --- a/src/GccAna/GccAna_Circ2d2TanRad.cxx +++ b/src/GccAna/GccAna_Circ2d2TanRad.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -45,11 +47,11 @@ GccAna_Circ2d2TanRad:: const GccEnt_QualifiedCirc& Qualified2 , const Standard_Real Radius , const Standard_Real Tolerance ): - qualifier1(1,8) , + WellDone(Standard_False), qualifier1(1,8) , qualifier2(1,8), TheSame1(1,8) , TheSame2(1,8) , - cirsol(1,8) , + NbrSol(0), cirsol(1,8) , pnttg1sol(1,8) , pnttg2sol(1,8) , par1sol(1,8) , @@ -60,8 +62,8 @@ GccAna_Circ2d2TanRad:: Standard_Real Tol = Abs(Tolerance); gp_Dir2d dirx(1.,0.); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -76,8 +78,8 @@ GccAna_Circ2d2TanRad:: Standard_Real R2 = C2.Radius(); Standard_Real rbid = 0.; Standard_Integer signe=0; - Standard_Real R3; - Standard_Real dist; + Standard_Real R3 = NAN; + Standard_Real dist = NAN; TColgp_Array1OfCirc2d C(1,8); C(1) = gp_Circ2d(C1); C(2) = gp_Circ2d(C2); diff --git a/src/GccAna/GccAna_Circ2d2TanRad_1.cxx b/src/GccAna/GccAna_Circ2d2TanRad_1.cxx index 2efc85ccf7..423d49a05c 100644 --- a/src/GccAna/GccAna_Circ2d2TanRad_1.cxx +++ b/src/GccAna/GccAna_Circ2d2TanRad_1.cxx @@ -46,11 +46,11 @@ GccAna_Circ2d2TanRad:: const GccEnt_QualifiedLin& Qualified2 , const Standard_Real Radius , const Standard_Real Tolerance ): - qualifier1(1,8) , + WellDone(Standard_False), qualifier1(1,8) , qualifier2(1,8), TheSame1(1,8) , TheSame2(1,8) , - cirsol(1,8) , + NbrSol(0), cirsol(1,8) , pnttg1sol(1,8) , pnttg2sol(1,8) , par1sol(1,8) , @@ -61,8 +61,8 @@ GccAna_Circ2d2TanRad:: Standard_Real Tol = Abs(Tolerance); gp_Dir2d dirx(1.,0.); - NbrSol = 0; - WellDone = Standard_False; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsOutside() || @@ -70,7 +70,7 @@ GccAna_Circ2d2TanRad:: throw GccEnt_BadQualifier(); return; } - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = 1 ; i <= 8 ; i++) { TheSame2(i) = 0; } Standard_Integer ncote1=0; Standard_Integer ncote2=0; diff --git a/src/GccAna/GccAna_Circ2d2TanRad_2.cxx b/src/GccAna/GccAna_Circ2d2TanRad_2.cxx index 58baf5735c..1c4c68884b 100644 --- a/src/GccAna/GccAna_Circ2d2TanRad_2.cxx +++ b/src/GccAna/GccAna_Circ2d2TanRad_2.cxx @@ -45,11 +45,11 @@ GccAna_Circ2d2TanRad:: const gp_Pnt2d& Point2 , const Standard_Real Radius , const Standard_Real Tolerance ): - qualifier1(1,4) , + WellDone(Standard_False), qualifier1(1,4) , qualifier2(1,4), TheSame1(1,4) , TheSame2(1,4) , - cirsol(1,4) , + NbrSol(0), cirsol(1,4) , pnttg1sol(1,4) , pnttg2sol(1,4) , par1sol(1,4) , @@ -60,14 +60,14 @@ GccAna_Circ2d2TanRad:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - NbrSol = 0; - WellDone = Standard_False; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); return; } - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = 1 ; i <= 4 ; i++) { TheSame1(i) = 0; TheSame2(i) = 0; diff --git a/src/GccAna/GccAna_Circ2d2TanRad_3.cxx b/src/GccAna/GccAna_Circ2d2TanRad_3.cxx index 86adbf9a99..cde55828c9 100644 --- a/src/GccAna/GccAna_Circ2d2TanRad_3.cxx +++ b/src/GccAna/GccAna_Circ2d2TanRad_3.cxx @@ -48,11 +48,11 @@ GccAna_Circ2d2TanRad:: const gp_Pnt2d& Point2 , const Standard_Real Radius , const Standard_Real Tolerance ): - qualifier1(1,2) , + WellDone(Standard_False), qualifier1(1,2) , qualifier2(1,2), TheSame1(1,2) , TheSame2(1,2) , - cirsol(1,2) , + NbrSol(0), cirsol(1,2) , pnttg1sol(1,2) , pnttg2sol(1,2) , par1sol(1,2) , @@ -63,8 +63,8 @@ GccAna_Circ2d2TanRad:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - NbrSol = 0; - WellDone = Standard_False; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2d2TanRad_4.cxx b/src/GccAna/GccAna_Circ2d2TanRad_4.cxx index 7457bd1e23..b17b4c95b4 100644 --- a/src/GccAna/GccAna_Circ2d2TanRad_4.cxx +++ b/src/GccAna/GccAna_Circ2d2TanRad_4.cxx @@ -45,11 +45,11 @@ GccAna_Circ2d2TanRad:: const GccEnt_QualifiedLin& Qualified2 , const Standard_Real Radius , const Standard_Real ): - qualifier1(1,4) , + WellDone(Standard_False), qualifier1(1,4) , qualifier2(1,4), TheSame1(1,4) , TheSame2(1,4) , - cirsol(1,4) , + NbrSol(0), cirsol(1,4) , pnttg1sol(1,4) , pnttg2sol(1,4) , par1sol(1,4) , @@ -63,8 +63,8 @@ GccAna_Circ2d2TanRad:: TColStd_Array1OfReal cote2(1,2); Standard_Integer nbrcote1=0; Standard_Integer nbrcote2=0; - NbrSol = 0; - WellDone = Standard_False; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || diff --git a/src/GccAna/GccAna_Circ2d2TanRad_5.cxx b/src/GccAna/GccAna_Circ2d2TanRad_5.cxx index a3e4c2faac..a5311c9175 100644 --- a/src/GccAna/GccAna_Circ2d2TanRad_5.cxx +++ b/src/GccAna/GccAna_Circ2d2TanRad_5.cxx @@ -36,11 +36,11 @@ GccAna_Circ2d2TanRad:: const gp_Pnt2d& Point2 , const Standard_Real Radius , const Standard_Real Tolerance ): - qualifier1(1,2) , + WellDone(Standard_False), qualifier1(1,2) , qualifier2(1,2), TheSame1(1,2) , TheSame2(1,2) , - cirsol(1,2) , + NbrSol(0), cirsol(1,2) , pnttg1sol(1,2) , pnttg2sol(1,2) , par1sol(1,2) , @@ -51,8 +51,8 @@ GccAna_Circ2d2TanRad:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - NbrSol = 0; - WellDone = Standard_False; + + if (Radius < 0.0) { throw Standard_NegativeValue(); } else { if (Point1.Distance(Point2)-Radius*2.0 > Tol) { WellDone = Standard_True; } diff --git a/src/GccAna/GccAna_Circ2d3Tan.cxx b/src/GccAna/GccAna_Circ2d3Tan.cxx index b5aee4627a..eba9de02fa 100644 --- a/src/GccAna/GccAna_Circ2d3Tan.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -39,7 +41,7 @@ GccAna_Circ2d3Tan:: // Initialization of fields. + //========================================================================= - cirsol(1,16) , + WellDone(Standard_False), NbrSol(0), cirsol(1,16) , qualifier1(1,16), qualifier2(1,16), qualifier3(1,16), @@ -59,8 +61,8 @@ GccAna_Circ2d3Tan:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -130,14 +132,14 @@ GccAna_Circ2d3Tan:: TColStd_Array1OfReal A3(1, 8), B3(1, 8), C3(1, 8), D3(1, 8), E3(1, 8), F3(1, 8); TColStd_Array1OfReal Beta2(1, 8), Gamma2(1, 8), Delta2(1, 8); TColStd_Array1OfReal Beta3(1, 8), Gamma3(1, 8), Delta3(1, 8); - Standard_Real a2, b2, c2, d2, e2, f2; - Standard_Real a3, b3, c3, d3, e3, f3; - Standard_Real A, B, C, D, E; - Standard_Boolean IsSame; - Standard_Boolean IsTouch; - Standard_Integer FirstIndex; - - Standard_Integer i, j, k, l; + Standard_Real a2 = NAN, b2 = NAN, c2 = NAN, d2 = NAN, e2 = NAN, f2 = NAN; + Standard_Real a3 = NAN, b3 = NAN, c3 = NAN, d3 = NAN, e3 = NAN, f3 = NAN; + Standard_Real A = NAN, B = NAN, C = NAN, D = NAN, E = NAN; + Standard_Boolean IsSame = 0; + Standard_Boolean IsTouch = 0; + Standard_Integer FirstIndex = 0; + + Standard_Integer i = 0, j = 0, k = 0, l = 0; TColStd_Array1OfReal xSol(1, 64); TColStd_Array1OfReal ySol(1, 64); TColStd_Array1OfReal rSol(1, 16); @@ -146,12 +148,12 @@ GccAna_Circ2d3Tan:: TColStd_Array1OfReal ySol1(1, 32); TColStd_Array1OfReal rSol1(1, 32); TColStd_Array1OfInteger FirstSol1(1, 9); - Standard_Real x, y, r; - Standard_Real m, n, t, s, v; - Standard_Real p, q; - Standard_Real Epsilon; + Standard_Real x = NAN, y = NAN, r = NAN; + Standard_Real m = NAN, n = NAN, t = NAN, s = NAN, v = NAN; + Standard_Real p = NAN, q = NAN; + Standard_Real Epsilon = NAN; - Standard_Integer CurSol; + Standard_Integer CurSol = 0; //********************************************************************************************* //********************************************************************************************* diff --git a/src/GccAna/GccAna_Circ2d3Tan_1.cxx b/src/GccAna/GccAna_Circ2d3Tan_1.cxx index a335d2639c..cfe70ccb9d 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_1.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_1.cxx @@ -44,7 +44,7 @@ GccAna_Circ2d3Tan:: // Initialization of fields. + //========================================================================= - cirsol(1,16) , + WellDone(Standard_False), NbrSol(0), cirsol(1,16) , qualifier1(1,16) , qualifier2(1,16) , qualifier3(1,16), @@ -64,8 +64,8 @@ GccAna_Circ2d3Tan:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || diff --git a/src/GccAna/GccAna_Circ2d3Tan_2.cxx b/src/GccAna/GccAna_Circ2d3Tan_2.cxx index efb7cdb5da..33e496674f 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_2.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_2.cxx @@ -43,7 +43,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan (const GccEnt_QualifiedCirc& Qualified1 , // Initialisation of fields. + //========================================================================= -:cirsol(1,8) , +:WellDone(Standard_False), NbrSol(0), cirsol(1,8) , qualifier1(1,8) , qualifier2(1,8) , qualifier3(1,8) , @@ -65,8 +65,8 @@ pararg3(1,8) gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || diff --git a/src/GccAna/GccAna_Circ2d3Tan_3.cxx b/src/GccAna/GccAna_Circ2d3Tan_3.cxx index 612f395ce3..57667848b5 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_3.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_3.cxx @@ -46,7 +46,7 @@ GccAna_Circ2d3Tan:: // Initialization of fields. + //========================================================================= - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , qualifier2(1,4) , qualifier3(1,4) , @@ -68,8 +68,8 @@ GccAna_Circ2d3Tan:: TheSame2.Init(0); TheSame3.Init(0); gp_Dir2d dirx(1.0,0.0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || diff --git a/src/GccAna/GccAna_Circ2d3Tan_4.cxx b/src/GccAna/GccAna_Circ2d3Tan_4.cxx index 1a94950251..8ce09e84d7 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_4.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_4.cxx @@ -46,7 +46,7 @@ GccAna_Circ2d3Tan:: // Initialization of fields. + //========================================================================= - cirsol(1,MaxSol) , + WellDone(Standard_False), NbrSol(0), cirsol(1,MaxSol) , qualifier1(1,MaxSol) , qualifier2(1,MaxSol) , qualifier3(1,MaxSol) , @@ -66,8 +66,8 @@ GccAna_Circ2d3Tan:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -334,7 +334,7 @@ GccAna_Circ2d3Tan:: // Debug to create the point on the solution circles. - Standard_Integer kk ; + Standard_Integer kk = 0 ; for ( kk = 1; kk <= NbrSol; kk++) { gp_Circ2d CC = cirsol(kk); Standard_Real NR = CC.Location().Distance(Point3); diff --git a/src/GccAna/GccAna_Circ2d3Tan_5.cxx b/src/GccAna/GccAna_Circ2d3Tan_5.cxx index 35d1c4bb82..116a3d421e 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_5.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_5.cxx @@ -45,7 +45,7 @@ GccAna_Circ2d3Tan:: // Initialization of fields. + //========================================================================= - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , qualifier2(1,4) , qualifier3(1,4) , @@ -66,8 +66,8 @@ GccAna_Circ2d3Tan:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); Standard_Real MaxRad = 1e10, MinRad = 1e-6; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || diff --git a/src/GccAna/GccAna_Circ2d3Tan_6.cxx b/src/GccAna/GccAna_Circ2d3Tan_6.cxx index 2e8b628783..b24ecc123a 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_6.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_6.cxx @@ -38,7 +38,7 @@ GccAna_Circ2d3Tan:: const gp_Pnt2d& Point3 , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , qualifier2(1,2) , qualifier3(1,2) , @@ -57,9 +57,9 @@ GccAna_Circ2d3Tan:: { gp_Dir2d dirx(1.0,0.0); - WellDone = Standard_False; + Standard_Real Tol = Abs(Tolerance); - NbrSol = 0; + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || diff --git a/src/GccAna/GccAna_Circ2d3Tan_7.cxx b/src/GccAna/GccAna_Circ2d3Tan_7.cxx index f1c443e8ba..d28219b468 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_7.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_7.cxx @@ -40,7 +40,7 @@ GccAna_Circ2d3Tan:: const gp_Pnt2d& Point3 , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , qualifier2(1,2) , qualifier3(1,2) , @@ -60,8 +60,8 @@ GccAna_Circ2d3Tan:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2d3Tan_8.cxx b/src/GccAna/GccAna_Circ2d3Tan_8.cxx index 3028077dad..b6c271e0b1 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_8.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_8.cxx @@ -39,7 +39,7 @@ GccAna_Circ2d3Tan:: const gp_Pnt2d& Point3 , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , qualifier2(1,2) , qualifier3(1,2) , @@ -57,10 +57,10 @@ GccAna_Circ2d3Tan:: pararg3(1,2) { - WellDone = Standard_False; + Standard_Real Tol = Abs(Tolerance); gp_Dir2d dirx(1.0,0.0); - NbrSol = 0; + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2d3Tan_9.cxx b/src/GccAna/GccAna_Circ2d3Tan_9.cxx index 04da6202d2..4a7f68df6a 100644 --- a/src/GccAna/GccAna_Circ2d3Tan_9.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_9.cxx @@ -48,7 +48,7 @@ GccAna_Circ2d3Tan:: // Initialization of fields. + //========================================================================= - cirsol(1,1) , + WellDone(Standard_False), NbrSol(0), cirsol(1,1) , qualifier1(1,1) , qualifier2(1,1) , qualifier3(1,1) , @@ -67,8 +67,8 @@ GccAna_Circ2d3Tan:: { gp_Dir2d dirx(1.0,0.0); - WellDone = Standard_False; - NbrSol = 0; + + //========================================================================= // Processing. + diff --git a/src/GccAna/GccAna_Circ2dBisec.cxx b/src/GccAna/GccAna_Circ2dBisec.cxx index 6b44e754d0..b955565cb6 100644 --- a/src/GccAna/GccAna_Circ2dBisec.cxx +++ b/src/GccAna/GccAna_Circ2dBisec.cxx @@ -18,6 +18,8 @@ // CREATION of the BISSECTICE between two CIRCLES. + //========================================================================= +#include + #include #include #include @@ -36,7 +38,7 @@ //========================================================================= GccAna_Circ2dBisec:: GccAna_Circ2dBisec (const gp_Circ2d& Circ1 , - const gp_Circ2d& Circ2 ) { + const gp_Circ2d& Circ2 ) : WellDone(Standard_False) { //========================================================================= // Initialization of fields : + @@ -50,7 +52,7 @@ GccAna_Circ2dBisec:: // - WellDone (Boolean showing success or failure of the algo) + //========================================================================= - WellDone = Standard_False; + Standard_Real Tol=Precision::Confusion(); Standard_Real R1 = Circ1.Radius(); @@ -155,7 +157,7 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec:: Standard_Real R2 = circle2.Radius(); if ((NbrSol == 1) && (intersection == 0)) { - Standard_Real R; + Standard_Real R = NAN; if (Index == 1) R = (R1+R2)/2.0; else diff --git a/src/GccAna/GccAna_Circ2dTanCen.cxx b/src/GccAna/GccAna_Circ2dTanCen.cxx index 7930dd2595..bce3bfcec7 100644 --- a/src/GccAna/GccAna_Circ2dTanCen.cxx +++ b/src/GccAna/GccAna_Circ2dTanCen.cxx @@ -16,6 +16,8 @@ // Creation of a circle tangent to an element and having center in a point + //================================================================================ +#include + #include #include #include @@ -48,7 +50,7 @@ GccAna_Circ2dTanCen:: // Initialization of fields. + //======================================================================== - cirsol(1,2) , + NbrSol(0), WellDone(Standard_False), cirsol(1,2) , qualifier1(1,2) , TheSame1(1,2) , pnttg1sol(1,2), @@ -56,9 +58,9 @@ GccAna_Circ2dTanCen:: pararg1(1,2) { - NbrSol = 0; + Standard_Real Radius = 0.0; - WellDone = Standard_False; + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -69,7 +71,7 @@ GccAna_Circ2dTanCen:: gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); gp_Pnt2d center1(C1.Location()); - Standard_Real dist; + Standard_Real dist = NAN; Standard_Integer signe = 0; Standard_Integer signe1 = 0; @@ -221,7 +223,7 @@ GccAna_Circ2dTanCen:: // Initialisation of fields. + //========================================================================= - cirsol(1,1) , + NbrSol(1), WellDone(Standard_True), cirsol(1,1) , qualifier1(1,1), TheSame1(1,1) , pnttg1sol(1,1), @@ -238,8 +240,8 @@ GccAna_Circ2dTanCen:: pnttg1sol(1) = Point1; par1sol(1)=ElCLib::Parameter(cirsol(1),pnttg1sol(1)); pararg1(1) = 0.0; - NbrSol = 1; - WellDone = Standard_True; + + } //========================================================================= diff --git a/src/GccAna/GccAna_Circ2dTanOnRad.cxx b/src/GccAna/GccAna_Circ2dTanOnRad.cxx index 584b6bbd9d..3fc6ebb90e 100644 --- a/src/GccAna/GccAna_Circ2dTanOnRad.cxx +++ b/src/GccAna/GccAna_Circ2dTanOnRad.cxx @@ -22,6 +22,8 @@ // of given radius : Radius. + //======================================================================== +#include + #include #include #include @@ -58,7 +60,7 @@ GccAna_Circ2dTanOnRad:: const gp_Lin2d& OnLine , const Standard_Real Radius , const Standard_Real Tolerance ) : - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , TheSame1(1,4) , pnttg1sol(1,4) , @@ -71,8 +73,8 @@ GccAna_Circ2dTanOnRad:: TheSame1.Init(0); gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -86,8 +88,8 @@ GccAna_Circ2dTanOnRad:: Standard_Integer nbsol = 0; Standard_Integer signe = 0; gp_Pnt2d Center; - Standard_Real xc; - Standard_Real yc; + Standard_Real xc = NAN; + Standard_Real yc = NAN; Standard_Real R1 = C1.Radius(); Standard_Real dist = OnLine.Distance(C1.Location()); Standard_Real xdir = (OnLine.Direction()).X(); @@ -189,10 +191,10 @@ GccAna_Circ2dTanOnRad:: } else if (nbsol > 0) { for (Standard_Integer j = 1 ; j <= nbsol ; j++) { - Standard_Real A,B,C; + Standard_Real A = NAN,B = NAN,C = NAN; OnLine.Coefficients(A,B,C); Standard_Real D = A; - Standard_Real x0,y0; + Standard_Real x0 = NAN,y0 = NAN; if ( Abs(D) <= Tol ) { A = B; B = D; diff --git a/src/GccAna/GccAna_Circ2dTanOnRad_1.cxx b/src/GccAna/GccAna_Circ2dTanOnRad_1.cxx index 325db04ed2..6c30485578 100644 --- a/src/GccAna/GccAna_Circ2dTanOnRad_1.cxx +++ b/src/GccAna/GccAna_Circ2dTanOnRad_1.cxx @@ -45,7 +45,7 @@ GccAna_Circ2dTanOnRad:: const gp_Lin2d& OnLine , const Standard_Real Radius , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , TheSame1(1,2) , pnttg1sol(1,2) , @@ -57,8 +57,8 @@ GccAna_Circ2dTanOnRad:: Standard_Real Tol =Abs(Tolerance); gp_Dir2d dirx(1.0,0.0); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2dTanOnRad_2.cxx b/src/GccAna/GccAna_Circ2dTanOnRad_2.cxx index 46cead1237..8be2baaa78 100644 --- a/src/GccAna/GccAna_Circ2dTanOnRad_2.cxx +++ b/src/GccAna/GccAna_Circ2dTanOnRad_2.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ GccAna_Circ2dTanOnRad:: const gp_Lin2d& OnLine , const Standard_Real Radius , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , TheSame1(1,2) , pnttg1sol(1,2), @@ -59,15 +61,15 @@ GccAna_Circ2dTanOnRad:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + Standard_Real dp1lin = OnLine.Distance(Point1); if (Radius < 0.0) { throw Standard_NegativeValue(); } else { if (dp1lin > Radius+Tol) { WellDone = Standard_True; } - Standard_Real xc; - Standard_Real yc; + Standard_Real xc = NAN; + Standard_Real yc = NAN; Standard_Real x1 = Point1.X(); Standard_Real y1 = Point1.Y(); Standard_Real xbid = 0; @@ -119,7 +121,7 @@ GccAna_Circ2dTanOnRad:: NbrSol = 2; } else { - Standard_Real A,B,C; + Standard_Real A = NAN,B = NAN,C = NAN; OnLine.Coefficients(A,B,C); Standard_Real D = A; if (A == 0.0) { diff --git a/src/GccAna/GccAna_Circ2dTanOnRad_3.cxx b/src/GccAna/GccAna_Circ2dTanOnRad_3.cxx index 1257b06dd9..c7d391ed4d 100644 --- a/src/GccAna/GccAna_Circ2dTanOnRad_3.cxx +++ b/src/GccAna/GccAna_Circ2dTanOnRad_3.cxx @@ -43,7 +43,7 @@ GccAna_Circ2dTanOnRad:: const gp_Circ2d& OnCirc , const Standard_Real Radius , const Standard_Real Tolerance ): - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , TheSame1(1,4) , pnttg1sol(1,4), @@ -65,8 +65,8 @@ GccAna_Circ2dTanOnRad:: Standard_Real disparal[2]; Standard_Integer nparal = 0; Standard_Integer sign = 0; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2dTanOnRad_4.cxx b/src/GccAna/GccAna_Circ2dTanOnRad_4.cxx index 9b4b8cef02..1d2905712e 100644 --- a/src/GccAna/GccAna_Circ2dTanOnRad_4.cxx +++ b/src/GccAna/GccAna_Circ2dTanOnRad_4.cxx @@ -47,7 +47,7 @@ GccAna_Circ2dTanOnRad:: // Initialization of fields. + //========================================================================= - cirsol(1,4) , + WellDone(Standard_False), NbrSol(0), cirsol(1,4) , qualifier1(1,4) , TheSame1(1,4) , pnttg1sol(1,4), @@ -60,8 +60,8 @@ GccAna_Circ2dTanOnRad:: TheSame1.Init(0); gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Circ2dTanOnRad_5.cxx b/src/GccAna/GccAna_Circ2dTanOnRad_5.cxx index 76191c16b4..807c3e8c7e 100644 --- a/src/GccAna/GccAna_Circ2dTanOnRad_5.cxx +++ b/src/GccAna/GccAna_Circ2dTanOnRad_5.cxx @@ -41,7 +41,7 @@ GccAna_Circ2dTanOnRad:: const gp_Circ2d& OnCirc , const Standard_Real Radius , const Standard_Real Tolerance ): - cirsol(1,2) , + WellDone(Standard_False), NbrSol(0), cirsol(1,2) , qualifier1(1,2) , TheSame1(1,2) , pnttg1sol(1,2), @@ -53,8 +53,8 @@ GccAna_Circ2dTanOnRad:: gp_Dir2d dirx(1.0,0.0); Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + Standard_Real Roncirc = OnCirc.Radius(); Standard_Real dist1 = Point1.Distance(OnCirc.Location())-Roncirc; Standard_Real dist2 = Point1.Distance(OnCirc.Location())+Roncirc; diff --git a/src/GccAna/GccAna_CircLin2dBisec.cxx b/src/GccAna/GccAna_CircLin2dBisec.cxx index dfa5f6736b..3ee3e104e6 100644 --- a/src/GccAna/GccAna_CircLin2dBisec.cxx +++ b/src/GccAna/GccAna_CircLin2dBisec.cxx @@ -35,7 +35,7 @@ GccAna_CircLin2dBisec:: GccAna_CircLin2dBisec (const gp_Circ2d& Circle , const gp_Lin2d& Line ): - circle(Circle), + NbrSol(2), WellDone(Standard_True), circle(Circle), line(Line) { @@ -47,8 +47,8 @@ GccAna_CircLin2dBisec:: // - WellDone (Boolean showing success or failure of algorithm)+ //========================================================================= - NbrSol = 2; - WellDone = Standard_True; + + } //========================================================================= @@ -87,7 +87,7 @@ Handle(GccInt_Bisec) GccAna_CircLin2dBisec:: // ========================================================== } else { - Standard_Integer signe; + Standard_Integer signe = 0; if ((-ydir*(xcencir-xloc)+xdir*(ycencir-yloc)) > 0.0) { signe = 1; } diff --git a/src/GccAna/GccAna_CircPnt2dBisec.cxx b/src/GccAna/GccAna_CircPnt2dBisec.cxx index cbcb635f34..27ef06bf22 100644 --- a/src/GccAna/GccAna_CircPnt2dBisec.cxx +++ b/src/GccAna/GccAna_CircPnt2dBisec.cxx @@ -34,22 +34,22 @@ //========================================================================= GccAna_CircPnt2dBisec:: GccAna_CircPnt2dBisec (const gp_Circ2d& Circle , - const gp_Pnt2d& Point ) + const gp_Pnt2d& Point ) : circle(Circle), point(Point), myTolerance(1.e-10) { - circle = Circle; - point = Point; - myTolerance = 1.e-10; + + + DefineSolutions(); } GccAna_CircPnt2dBisec:: GccAna_CircPnt2dBisec (const gp_Circ2d& Circle , const gp_Pnt2d& Point, - const Standard_Real Tolerance) + const Standard_Real Tolerance) : circle(Circle), point(Point), myTolerance(1.e-10) { - circle = Circle; - point = Point; - myTolerance = 1.e-10; + + + if (myTolerance < Tolerance) myTolerance = Tolerance; diff --git a/src/GccAna/GccAna_CircPnt2dBisec.hxx b/src/GccAna/GccAna_CircPnt2dBisec.hxx index e2a00d53bf..e63c895087 100644 --- a/src/GccAna/GccAna_CircPnt2dBisec.hxx +++ b/src/GccAna/GccAna_CircPnt2dBisec.hxx @@ -85,11 +85,11 @@ private: Standard_EXPORT void DefineSolutions(); - Standard_Boolean WellDone; - Standard_Integer NbrSol; + Standard_Boolean WellDone{}; + Standard_Integer NbrSol{}; gp_Circ2d circle; gp_Pnt2d point; - Standard_Integer theposition; + Standard_Integer theposition{}; Standard_Real myTolerance; diff --git a/src/GccAna/GccAna_Lin2d2Tan.cxx b/src/GccAna/GccAna_Lin2d2Tan.cxx index 3ea196c8ce..a541d7a643 100644 --- a/src/GccAna/GccAna_Lin2d2Tan.cxx +++ b/src/GccAna/GccAna_Lin2d2Tan.cxx @@ -38,7 +38,7 @@ GccAna_Lin2d2Tan:: GccAna_Lin2d2Tan (const gp_Pnt2d& ThePoint1, const gp_Pnt2d& ThePoint2 , const Standard_Real Tolerance ): - linsol(1,1), + WellDone(Standard_False), NbrSol(0), linsol(1,1), qualifier1(1,1), qualifier2(1,1) , pnttg1sol(1,1), @@ -50,8 +50,8 @@ GccAna_Lin2d2Tan:: { Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + Standard_Real dist = ThePoint1.Distance(ThePoint2); qualifier1(1) = GccEnt_noqualifier; qualifier2(1) = GccEnt_noqualifier; @@ -84,7 +84,7 @@ GccAna_Lin2d2Tan:: GccAna_Lin2d2Tan (const GccEnt_QualifiedCirc& Qualified1, const gp_Pnt2d& ThePoint , const Standard_Real Tolerance ): - linsol(1,2), + WellDone(Standard_False), NbrSol(0), linsol(1,2), qualifier1(1,2), qualifier2(1,2), pnttg1sol(1,2), @@ -96,8 +96,8 @@ GccAna_Lin2d2Tan:: { Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -185,7 +185,7 @@ GccAna_Lin2d2Tan:: GccAna_Lin2d2Tan (const GccEnt_QualifiedCirc& Qualified1, const GccEnt_QualifiedCirc& Qualified2, const Standard_Real Tolerance ): - linsol(1,4), + WellDone(Standard_False), NbrSol(0), linsol(1,4), qualifier1(1,4), qualifier2(1,4) , pnttg1sol(1,4), @@ -197,8 +197,8 @@ GccAna_Lin2d2Tan:: { Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || diff --git a/src/GccAna/GccAna_Lin2dBisec.cxx b/src/GccAna/GccAna_Lin2dBisec.cxx index c79118a629..c810a55d4d 100644 --- a/src/GccAna/GccAna_Lin2dBisec.cxx +++ b/src/GccAna/GccAna_Lin2dBisec.cxx @@ -39,7 +39,7 @@ GccAna_Lin2dBisec:: GccAna_Lin2dBisec (const gp_Lin2d& Lin1, const gp_Lin2d& Lin2): - linsol(1,2) , + WellDone(Standard_False), NbrSol(0), linsol(1,2) , pntint1sol(1,2), pntint2sol(1,2), par1sol(1,2), @@ -47,8 +47,8 @@ GccAna_Lin2dBisec:: pararg1(1,2), pararg2(1,2) { - WellDone = Standard_False; - NbrSol = 0; + + IntAna2d_AnaIntersection Intp(Lin1,Lin2); if (Intp.IsDone()) { diff --git a/src/GccAna/GccAna_Lin2dTanObl.cxx b/src/GccAna/GccAna_Lin2dTanObl.cxx index 6fc1e64c0c..89148f3883 100644 --- a/src/GccAna/GccAna_Lin2dTanObl.cxx +++ b/src/GccAna/GccAna_Lin2dTanObl.cxx @@ -96,7 +96,7 @@ GccAna_Lin2dTanObl:: GccAna_Lin2dTanObl (const GccEnt_QualifiedCirc& Qualified1 , const gp_Lin2d& TheLine , const Standard_Real TheAngle ): - linsol(1,2) , + WellDone(Standard_False), NbrSol(0), linsol(1,2) , qualifier1(1,2) , pnttg1sol(1,2), pntint2sol(1,2), @@ -106,8 +106,8 @@ GccAna_Lin2dTanObl:: pararg2(1,2) { - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Lin2dTanPar.cxx b/src/GccAna/GccAna_Lin2dTanPar.cxx index cedf004aab..563b968c93 100644 --- a/src/GccAna/GccAna_Lin2dTanPar.cxx +++ b/src/GccAna/GccAna_Lin2dTanPar.cxx @@ -37,7 +37,7 @@ GccAna_Lin2dTanPar:: GccAna_Lin2dTanPar (const gp_Pnt2d& ThePoint , const gp_Lin2d& Lin1 ): - linsol(1,1), + NbrSol(1), WellDone(Standard_True), linsol(1,1), qualifier1(1,1) , pnttg1sol(1,1), par1sol(1,1), @@ -50,8 +50,8 @@ GccAna_Lin2dTanPar:: pnttg1sol(1) = ThePoint; par1sol(1) = 0.; pararg1(1) = 0.; - NbrSol = 1; - WellDone = Standard_True; + + } //======================================================================== @@ -68,17 +68,17 @@ GccAna_Lin2dTanPar:: GccAna_Lin2dTanPar:: GccAna_Lin2dTanPar (const GccEnt_QualifiedCirc& Qualified1, const gp_Lin2d& Lin1 ): - linsol(1,2), + WellDone(Standard_False), NbrSol(0), linsol(1,2), qualifier1(1,2) , pnttg1sol(1,2), par1sol(1,2), pararg1(1,2) { - WellDone = Standard_False; + Standard_Integer signe = 0; Standard_Integer nbsol = 0; - NbrSol = 0; + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/GccAna/GccAna_Lin2dTanPer.cxx b/src/GccAna/GccAna_Lin2dTanPer.cxx index fc30993b7d..b6c110234b 100644 --- a/src/GccAna/GccAna_Lin2dTanPer.cxx +++ b/src/GccAna/GccAna_Lin2dTanPer.cxx @@ -125,7 +125,7 @@ GccAna_Lin2dTanPer:: GccAna_Lin2dTanPer:: GccAna_Lin2dTanPer (const GccEnt_QualifiedCirc& Qualified1, const gp_Lin2d& TheLin ): - linsol(1,2), + WellDone(Standard_False), NbrSol(0), linsol(1,2), qualifier1(1,2) , pnttg1sol(1,2), pntint2sol(1,2), @@ -135,10 +135,10 @@ GccAna_Lin2dTanPer:: pararg2(1,2) { - WellDone = Standard_False; + Standard_Integer nbsol = 0; Standard_Integer signe = 0; - NbrSol = 0; + gp_Circ2d C1 = Qualified1.Qualified(); if (Qualified1.IsEnclosed()) { @@ -196,7 +196,7 @@ GccAna_Lin2dTanPer:: GccAna_Lin2dTanPer:: GccAna_Lin2dTanPer (const GccEnt_QualifiedCirc& Qualified1, const gp_Circ2d& TheCircle ): - linsol(1,2), + WellDone(Standard_False), NbrSol(0), linsol(1,2), qualifier1(1,2) , pnttg1sol(1,2), pntint2sol(1,2), @@ -206,8 +206,8 @@ GccAna_Lin2dTanPer:: pararg2(1,2) { - WellDone = Standard_False; - NbrSol = 0; + + Standard_Integer signe = 0; gp_Circ2d C1 = Qualified1.Qualified(); diff --git a/src/GccAna/GccAna_LinPnt2dBisec.cxx b/src/GccAna/GccAna_LinPnt2dBisec.cxx index c16390be45..b128f89924 100644 --- a/src/GccAna/GccAna_LinPnt2dBisec.cxx +++ b/src/GccAna/GccAna_LinPnt2dBisec.cxx @@ -31,9 +31,9 @@ //========================================================================= GccAna_LinPnt2dBisec:: GccAna_LinPnt2dBisec (const gp_Lin2d& Line1 , - const gp_Pnt2d& Point2) { + const gp_Pnt2d& Point2) : WellDone(Standard_False) { - WellDone = Standard_False; + Standard_Real xdir = Line1.Direction().X(); Standard_Real ydir = Line1.Direction().Y(); diff --git a/src/GccAna/GccAna_Pnt2dBisec.cxx b/src/GccAna/GccAna_Pnt2dBisec.cxx index 74d0cf1dce..8f40d5e060 100644 --- a/src/GccAna/GccAna_Pnt2dBisec.cxx +++ b/src/GccAna/GccAna_Pnt2dBisec.cxx @@ -29,9 +29,9 @@ //========================================================================= GccAna_Pnt2dBisec:: GccAna_Pnt2dBisec (const gp_Pnt2d& Point1, - const gp_Pnt2d& Point2) { + const gp_Pnt2d& Point2) : WellDone(Standard_False) { - WellDone = Standard_False; + // if (Point1.Distance(Point2) > gp::Resolution()) { if (Point1.Distance(Point2) > 1.e-10) { gp_Dir2d dir1(Point2.XY()-Point1.XY()); diff --git a/src/GccEnt/GccEnt_QualifiedLin.cxx b/src/GccEnt/GccEnt_QualifiedLin.cxx index 4d2e02bd1d..c1d6ece1ba 100644 --- a/src/GccEnt/GccEnt_QualifiedLin.cxx +++ b/src/GccEnt/GccEnt_QualifiedLin.cxx @@ -42,9 +42,9 @@ Standard_Boolean GccEnt_QualifiedLin:: GccEnt_QualifiedLin:: GccEnt_QualifiedLin (const gp_Lin2d& Qualified, - const GccEnt_Position Qualifier) { - TheQualified = Qualified; - TheQualifier = Qualifier; + const GccEnt_Position Qualifier) : TheQualified(Qualified), TheQualifier(Qualifier) { + + } diff --git a/src/Geom/Geom_Axis2Placement.cxx b/src/Geom/Geom_Axis2Placement.cxx index 081862e4c4..cb924940bd 100644 --- a/src/Geom/Geom_Axis2Placement.cxx +++ b/src/Geom/Geom_Axis2Placement.cxx @@ -51,10 +51,10 @@ Handle(Geom_Geometry) Geom_Axis2Placement::Copy() const { //purpose : //======================================================================= -Geom_Axis2Placement::Geom_Axis2Placement (const gp_Ax2& A2) { +Geom_Axis2Placement::Geom_Axis2Placement (const gp_Ax2& A2) : vxdir(A2. XDirection()), vydir(A2. YDirection()) { - vxdir = A2. XDirection(); - vydir = A2. YDirection(); + + axis = A2.Axis(); } diff --git a/src/Geom/Geom_BSplineCurve.cxx b/src/Geom/Geom_BSplineCurve.cxx index 83cd011545..bed0cf8875 100644 --- a/src/Geom/Geom_BSplineCurve.cxx +++ b/src/Geom/Geom_BSplineCurve.cxx @@ -30,6 +30,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -126,7 +128,7 @@ Geom_BSplineCurve::Geom_BSplineCurve rational(Standard_False), periodic(Periodic), deg(Degree), - maxderivinvok(Standard_False) + poles(new TColgp_HArray1OfPnt(1,Poles.Length())), knots(new TColStd_HArray1OfReal(1,Knots.Length())), mults(new TColStd_HArray1OfInteger(1,Mults.Length())), maxderivinvok(Standard_False) { // check @@ -138,14 +140,14 @@ Geom_BSplineCurve::Geom_BSplineCurve // copy arrays - poles = new TColgp_HArray1OfPnt(1,Poles.Length()); + poles->ChangeArray1() = Poles; - knots = new TColStd_HArray1OfReal(1,Knots.Length()); + knots->ChangeArray1() = Knots; - mults = new TColStd_HArray1OfInteger(1,Mults.Length()); + mults->ChangeArray1() = Mults; UpdateKnots(); @@ -182,7 +184,7 @@ Geom_BSplineCurve::Geom_BSplineCurve if (Weights.Length() != Poles.Length()) throw Standard_ConstructionError("Geom_BSplineCurve: Weights and Poles array size mismatch"); - Standard_Integer i; + Standard_Integer i = 0; for (i = Weights.Lower(); i <= Weights.Upper(); i++) { if (Weights(i) <= gp::Resolution()) throw Standard_ConstructionError("Geom_BSplineCurve: Weights values too small"); @@ -294,7 +296,7 @@ void Geom_BSplineCurve::IncreaseMultiplicity (const Standard_Integer I1, Handle(TColStd_HArray1OfReal) tk = knots; TColStd_Array1OfReal k((knots->Array1())(I1),I1,I2); TColStd_Array1OfInteger m(I1,I2); - Standard_Integer i; + Standard_Integer i = 0; for (i = I1; i <= I2; i++) m(i) = M - mults->Value(i); InsertKnots(k,m,Epsilon(1.),Standard_True); @@ -346,7 +348,7 @@ void Geom_BSplineCurve::InsertKnots(const TColStd_Array1OfReal& Knots, const Standard_Boolean Add) { // Check and compute new sizes - Standard_Integer nbpoles,nbknots; + Standard_Integer nbpoles = 0,nbknots = 0; if (!BSplCLib::PrepareInsertKnots(deg,periodic, knots->Array1(),mults->Array1(), @@ -456,7 +458,7 @@ void Geom_BSplineCurve::Reverse () { BSplCLib::Reverse(knots->ChangeArray1()); BSplCLib::Reverse(mults->ChangeArray1()); - Standard_Integer last; + Standard_Integer last = 0; if (periodic) last = flatknots->Upper() - deg - 1; else @@ -490,9 +492,9 @@ void Geom_BSplineCurve::Segment(const Standard_Real U1, if (U2 < U1) throw Standard_DomainError("Geom_BSplineCurve::Segment"); - Standard_Real NewU1, NewU2; - Standard_Real U,DU=0,aDDU=0; - Standard_Integer index; + Standard_Real NewU1 = NAN, NewU2 = NAN; + Standard_Real U = NAN,DU=0,aDDU=0; + Standard_Integer index = 0; Standard_Boolean wasPeriodic = periodic; TColStd_Array1OfReal Knots(1,2); @@ -575,7 +577,7 @@ void Geom_BSplineCurve::Segment(const Standard_Real U1, if (DU > 0) // if was periodic DU = NewU1 - U1; - Standard_Integer i , k = 1; + Standard_Integer i = 0 , k = 1; for ( i = index1; i<= index2; i++) { nknots->SetValue(k, knots->Value(i) - DU); nmults->SetValue(k, mults->Value(i)); @@ -748,7 +750,7 @@ void Geom_BSplineCurve::SetOrigin(const Standard_Integer Index) if (!periodic) throw Standard_NoSuchObject("Geom_BSplineCurve::SetOrigin"); - Standard_Integer i,k; + Standard_Integer i = 0,k = 0; Standard_Integer first = FirstUKnotIndex(); Standard_Integer last = LastUKnotIndex(); @@ -881,7 +883,7 @@ void Geom_BSplineCurve::SetOrigin(const Standard_Real U, void Geom_BSplineCurve::SetNotPeriodic () { if ( periodic) { - Standard_Integer NbKnots, NbPoles; + Standard_Integer NbKnots = 0, NbPoles = 0; BSplCLib::PrepareUnperiodize( deg, mults->Array1(),NbKnots,NbPoles); Handle(TColgp_HArray1OfPnt) npoles @@ -1019,7 +1021,7 @@ void Geom_BSplineCurve::MovePointAndTangent(const Standard_Real U, const Standard_Integer EndingCondition, Standard_Integer& ErrorStatus) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; if (IsPeriodic()) { // // for the time being do not deal with periodic curves @@ -1103,7 +1105,7 @@ void Geom_BSplineCurve::UpdateKnots() void Geom_BSplineCurve::PeriodicNormalization(Standard_Real& Parameter) const { - Standard_Real Period ; + Standard_Real Period = NAN ; if (periodic) { Period = flatknots->Value(flatknots->Upper() - deg) - flatknots->Value (deg + 1) ; diff --git a/src/Geom/Geom_BSplineCurve.hxx b/src/Geom/Geom_BSplineCurve.hxx index 7648d32b36..3db1d7d0d7 100644 --- a/src/Geom/Geom_BSplineCurve.hxx +++ b/src/Geom/Geom_BSplineCurve.hxx @@ -806,7 +806,7 @@ private: Handle(TColStd_HArray1OfReal) flatknots; Handle(TColStd_HArray1OfReal) knots; Handle(TColStd_HArray1OfInteger) mults; - Standard_Real maxderivinv; + Standard_Real maxderivinv{}; Standard_Boolean maxderivinvok; diff --git a/src/Geom/Geom_BSplineCurve_1.cxx b/src/Geom/Geom_BSplineCurve_1.cxx index f6ce2327d3..3a55e5d180 100644 --- a/src/Geom/Geom_BSplineCurve_1.cxx +++ b/src/Geom/Geom_BSplineCurve_1.cxx @@ -642,7 +642,7 @@ void Geom_BSplineCurve::Weights if (IsRational()) W = weights->Array1(); else { - Standard_Integer i; + Standard_Integer i = 0; for (i = W.Lower(); i <= W.Upper(); i++) W(i) = 1.; @@ -747,7 +747,7 @@ void Geom_BSplineCurve::Resolution (const Standard_Real Tolerance3D, { if (periodic) { - Standard_Integer NbKnots, NbPoles; + Standard_Integer NbKnots = 0, NbPoles = 0; BSplCLib::PrepareUnperiodize (deg, mults->Array1(), NbKnots, NbPoles); TColgp_Array1OfPnt new_poles (1, NbPoles); TColStd_Array1OfReal new_weights(1, NbPoles); diff --git a/src/Geom/Geom_BSplineSurface.cxx b/src/Geom/Geom_BSplineSurface.cxx index 8b9c07b093..fc15303346 100644 --- a/src/Geom/Geom_BSplineSurface.cxx +++ b/src/Geom/Geom_BSplineSurface.cxx @@ -23,6 +23,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -68,7 +70,7 @@ static void CheckSurfaceData throw Standard_ConstructionError("Geom_BSplineSurface: Knot and Mult array size mismatch"); } - Standard_Integer i; + Standard_Integer i = 0; for (i = SUKnots.Lower(); i < SUKnots.Upper(); i++) { if (SUKnots(i+1) - SUKnots(i) <= Epsilon(Abs(SUKnots(i)))) { throw Standard_ConstructionError("Geom_BSplineSurface: UKnots interval values too close"); @@ -97,7 +99,7 @@ static void Rational(const TColStd_Array2OfReal& Weights, Standard_Boolean& Urational, Standard_Boolean& Vrational) { - Standard_Integer I,J; + Standard_Integer I = 0,J = 0; J = Weights.LowerCol (); Vrational = Standard_False; while (!Vrational && J <= Weights.UpperCol()) { @@ -168,7 +170,8 @@ Geom_BSplineSurface::Geom_BSplineSurface vperiodic(VPeriodic), udeg(UDegree), vdeg(VDegree), - maxderivinvok(0) + poles(new TColgp_HArray2OfPnt(1,Poles.ColLength(), + 1,Poles.RowLength())), uknots(new TColStd_HArray1OfReal (1,UKnots.Length())), umults(new TColStd_HArray1OfInteger (1,UMults.Length())), vknots(new TColStd_HArray1OfReal (1,VKnots.Length())), vmults(new TColStd_HArray1OfInteger (1,VMults.Length())), maxderivinvok(0) { @@ -182,23 +185,22 @@ Geom_BSplineSurface::Geom_BSplineSurface // copy arrays - poles = new TColgp_HArray2OfPnt(1,Poles.ColLength(), - 1,Poles.RowLength()); + poles->ChangeArray2() = Poles; weights = new TColStd_HArray2OfReal (1,Poles.ColLength(), 1,Poles.RowLength(), 1.0); - uknots = new TColStd_HArray1OfReal (1,UKnots.Length()); + uknots->ChangeArray1() = UKnots; - umults = new TColStd_HArray1OfInteger (1,UMults.Length()); + umults->ChangeArray1() = UMults; - vknots = new TColStd_HArray1OfReal (1,VKnots.Length()); + vknots->ChangeArray1() = VKnots; - vmults = new TColStd_HArray1OfInteger (1,VMults.Length()); + vmults->ChangeArray1() = VMults; UpdateUKnots(); @@ -237,7 +239,7 @@ Geom_BSplineSurface::Geom_BSplineSurface if (Weights.RowLength() != Poles.RowLength()) throw Standard_ConstructionError("Geom_BSplineSurface: V Weights and Poles array size mismatch"); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for (i = Weights.LowerRow(); i <= Weights.UpperRow(); i++) { for (j = Weights.LowerCol(); j <= Weights.UpperCol(); j++) { if (Weights(i,j) <= gp::Resolution()) @@ -544,9 +546,9 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, deltaV = aVPeriod; } - Standard_Real NewU1, NewU2, NewV1, NewV2; - Standard_Real U, V; - Standard_Integer indexU, indexV; + Standard_Real NewU1 = NAN, NewU2 = NAN, NewV1 = NAN, NewV2 = NAN; + Standard_Real U = NAN, V = NAN; + Standard_Integer indexU = 0, indexV = 0; indexU = 0; BSplCLib::LocateParameter(udeg, uknots->Array1(), umults->Array1(), @@ -617,7 +619,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, Handle(TColStd_HArray1OfInteger) numults = new TColStd_HArray1OfInteger(1, nbuknots); - Standard_Integer i, k = 1; + Standard_Integer i = 0, k = 1; for (i = index1U; i <= index2U; i++) { nuknots->SetValue(k, uknots->Value(i)); numults->SetValue(k, umults->Value(i)); @@ -699,7 +701,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, Handle(TColgp_HArray2OfPnt) npoles = new TColgp_HArray2OfPnt(1, nbupoles, 1, nbvpoles); k = 1; - Standard_Integer j, l; + Standard_Integer j = 0, l = 0; if (urational || vrational) { nweights = new TColStd_HArray2OfReal(1, nbupoles, 1, nbvpoles); for (i = pindex1U; i <= pindex2U; i++) { @@ -1132,7 +1134,7 @@ void Geom_BSplineSurface::PeriodicNormalization (Standard_Real& Uparameter, Standard_Real& Vparameter) const { - Standard_Real Period, aMaxVal, aMinVal; + Standard_Real Period = NAN, aMaxVal = NAN, aMinVal = NAN; if (uperiodic) { aMaxVal = ufknots->Value(ufknots->Upper() - udeg); @@ -1143,11 +1145,11 @@ void Geom_BSplineSurface::PeriodicNormalization if(Period <= eps) throw Standard_OutOfRange("Geom_BSplineSurface::PeriodicNormalization: Uparameter is too great number"); - Standard_Boolean isLess, isGreater; + Standard_Boolean isLess = 0, isGreater = 0; isLess = aMinVal - Uparameter > 0; isGreater = Uparameter - aMaxVal > 0; if (isLess || isGreater) { - Standard_Real aDPar, aNbPer; + Standard_Real aDPar = NAN, aNbPer = NAN; aDPar = (isLess) ? (aMaxVal - Uparameter) : (aMinVal - Uparameter); modf(aDPar / Period, &aNbPer); Uparameter += aNbPer * Period; @@ -1162,11 +1164,11 @@ void Geom_BSplineSurface::PeriodicNormalization if(Period <= eps) throw Standard_OutOfRange("Geom_BSplineSurface::PeriodicNormalization: Vparameter is too great number"); - Standard_Boolean isLess, isGreater; + Standard_Boolean isLess = 0, isGreater = 0; isLess = aMinVal - Vparameter > 0; isGreater = Vparameter - aMaxVal > 0; if (isLess || isGreater) { - Standard_Real aDPar, aNbPer; + Standard_Real aDPar = NAN, aNbPer = NAN; aDPar = (isLess) ? (aMaxVal - Vparameter) : (aMinVal - Vparameter); modf(aDPar / Period, &aNbPer); Vparameter += aNbPer * Period; diff --git a/src/Geom/Geom_BSplineSurface.hxx b/src/Geom/Geom_BSplineSurface.hxx index 81382433c2..b163a5f48a 100644 --- a/src/Geom/Geom_BSplineSurface.hxx +++ b/src/Geom/Geom_BSplineSurface.hxx @@ -1231,8 +1231,8 @@ private: Handle(TColStd_HArray1OfReal) vknots; Handle(TColStd_HArray1OfInteger) umults; Handle(TColStd_HArray1OfInteger) vmults; - Standard_Real umaxderivinv; - Standard_Real vmaxderivinv; + Standard_Real umaxderivinv{}; + Standard_Real vmaxderivinv{}; Standard_Boolean maxderivinvok; diff --git a/src/Geom/Geom_BSplineSurface_1.cxx b/src/Geom/Geom_BSplineSurface_1.cxx index 8e49da6c3c..d3d3c87ef2 100644 --- a/src/Geom/Geom_BSplineSurface_1.cxx +++ b/src/Geom/Geom_BSplineSurface_1.cxx @@ -23,6 +23,8 @@ // + bon appel a LocateParameter (PRO6973). // RBD : 15/10/98 ; Le cache est desormais defini sur [-1,1] (pro15537). +#include + #include #include #include @@ -790,7 +792,7 @@ void Geom_BSplineSurface::Transform (const gp_Trsf& T) void Geom_BSplineSurface::SetUPeriodic () { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Standard_Integer first = FirstUKnotIndex(); Standard_Integer last = LastUKnotIndex(); @@ -856,7 +858,7 @@ void Geom_BSplineSurface::SetUPeriodic () void Geom_BSplineSurface::SetVPeriodic () { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Standard_Integer first = FirstVKnotIndex(); Standard_Integer last = LastVKnotIndex(); @@ -918,7 +920,7 @@ void Geom_BSplineSurface::SetUOrigin(const Standard_Integer Index) if (!uperiodic) throw Standard_NoSuchObject("Geom_BSplineSurface::SetUOrigin: surface is not U periodic"); - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; Standard_Integer first = FirstUKnotIndex(); Standard_Integer last = LastUKnotIndex(); @@ -1016,7 +1018,7 @@ void Geom_BSplineSurface::SetVOrigin(const Standard_Integer Index) if (!vperiodic) throw Standard_NoSuchObject("Geom_BSplineSurface::SetVOrigin: surface is not V periodic"); - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; Standard_Integer first = FirstVKnotIndex(); Standard_Integer last = LastVKnotIndex(); @@ -1112,7 +1114,7 @@ void Geom_BSplineSurface::SetVOrigin(const Standard_Integer Index) void Geom_BSplineSurface::SetUNotPeriodic () { if ( uperiodic) { - Standard_Integer NbKnots, NbPoles; + Standard_Integer NbKnots = 0, NbPoles = 0; BSplCLib::PrepareUnperiodize( udeg, umults->Array1(), NbKnots, NbPoles); Handle(TColgp_HArray2OfPnt) npoles = @@ -1164,7 +1166,7 @@ void Geom_BSplineSurface::SetUNotPeriodic () void Geom_BSplineSurface::SetVNotPeriodic () { if ( vperiodic) { - Standard_Integer NbKnots, NbPoles; + Standard_Integer NbKnots = 0, NbPoles = 0; BSplCLib::PrepareUnperiodize( vdeg, vmults->Array1(), NbKnots, NbPoles); Handle(TColgp_HArray2OfPnt) npoles = @@ -1218,7 +1220,7 @@ Standard_Boolean Geom_BSplineSurface::IsUClosed () const if (uperiodic) return Standard_True; - Standard_Real aU1, aU2, aV1, aV2; + Standard_Real aU1 = NAN, aU2 = NAN, aV1 = NAN, aV2 = NAN; Bounds( aU1, aU2, aV1, aV2 ); Handle(Geom_Curve) aCUF = UIso( aU1 ); Handle(Geom_Curve) aCUL = UIso( aU2 ); @@ -1239,7 +1241,7 @@ Standard_Boolean Geom_BSplineSurface::IsVClosed () const if (vperiodic) return Standard_True; - Standard_Real aU1, aU2, aV1, aV2; + Standard_Real aU1 = NAN, aU2 = NAN, aV1 = NAN, aV2 = NAN; Bounds( aU1, aU2, aV1, aV2 ); Handle(Geom_Curve) aCVF = VIso( aV1 ); Handle(Geom_Curve) aCVL = VIso( aV2 ); @@ -1431,7 +1433,7 @@ void Geom_BSplineSurface::UReverse () { BSplCLib::Reverse(umults->ChangeArray1()); BSplCLib::Reverse(uknots->ChangeArray1()); - Standard_Integer last; + Standard_Integer last = 0; if (uperiodic) last = ufknots->Upper() - udeg -1; else @@ -1462,7 +1464,7 @@ void Geom_BSplineSurface::VReverse () { BSplCLib::Reverse(vmults->ChangeArray1()); BSplCLib::Reverse(vknots->ChangeArray1()); - Standard_Integer last; + Standard_Integer last = 0; if (vperiodic) last = vfknots->Upper() - vdeg -1; else @@ -1777,7 +1779,7 @@ void Geom_BSplineSurface::InsertUKnots const Standard_Boolean Add) { // Check and compute new sizes - Standard_Integer nbpoles, nbknots; + Standard_Integer nbpoles = 0, nbknots = 0; if ( !BSplCLib::PrepareInsertKnots(udeg,uperiodic, uknots->Array1(),umults->Array1(), @@ -1844,7 +1846,7 @@ void Geom_BSplineSurface::InsertVKnots const Standard_Boolean Add) { // Check and compute new sizes - Standard_Integer nbpoles, nbknots; + Standard_Integer nbpoles = 0, nbknots = 0; if ( !BSplCLib::PrepareInsertKnots(vdeg,vperiodic, vknots->Array1(),vmults->Array1(), diff --git a/src/Geom/Geom_BezierCurve.cxx b/src/Geom/Geom_BezierCurve.cxx index dcc5881a46..3b035db08a 100644 --- a/src/Geom/Geom_BezierCurve.cxx +++ b/src/Geom/Geom_BezierCurve.cxx @@ -27,6 +27,8 @@ #define No_Standard_DimensionError +#include + #include #include #include @@ -51,7 +53,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Geom_BezierCurve,Geom_BoundedCurve) //======================================================================= static Standard_Boolean Rational(const TColStd_Array1OfReal& W) { - Standard_Integer i, n = W.Length(); + Standard_Integer i = 0, n = W.Length(); Standard_Boolean rat = Standard_False; for (i = 1; i < n; i++) { rat = Abs(W(i) - W(i+1)) > gp::Resolution(); @@ -105,7 +107,7 @@ Geom_BezierCurve::Geom_BezierCurve(const TColgp_Array1OfPnt& Poles, if (Weights.Length() != nbpoles) throw Standard_ConstructionError(); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= nbpoles; i++) { if (Weights(i) <= gp::Resolution()) { throw Standard_ConstructionError(); @@ -211,7 +213,7 @@ void Geom_BezierCurve::InsertPoleAfter if(Index < 0 || Index > nbpoles) throw Standard_OutOfRange("Geom_BezierCurve::InsertPoleAfter"); - Standard_Integer i; + Standard_Integer i = 0; // Insert the pole Handle(TColgp_HArray1OfPnt) npoles = @@ -297,7 +299,7 @@ void Geom_BezierCurve::RemovePole if(Index < 1 || Index > nbpoles) throw Standard_OutOfRange("Geom_BezierCurve::RemovePole"); - Standard_Integer i; + Standard_Integer i = 0; // Remove the pole Handle(TColgp_HArray1OfPnt) npoles = @@ -339,7 +341,7 @@ void Geom_BezierCurve::RemovePole void Geom_BezierCurve::Reverse () { gp_Pnt P; - Standard_Integer i, nbpoles = NbPoles(); + Standard_Integer i = 0, nbpoles = NbPoles(); TColgp_Array1OfPnt & cpoles = poles->ChangeArray1(); // reverse poles @@ -352,7 +354,7 @@ void Geom_BezierCurve::Reverse () // reverse weights if (IsRational()) { TColStd_Array1OfReal & cweights = weights->ChangeArray1(); - Standard_Real w; + Standard_Real w = NAN; for (i = 1; i <= nbpoles / 2; i++) { w = cweights(i); cweights(i) = cweights(nbpoles-i+1); @@ -716,7 +718,7 @@ void Geom_BezierCurve::Weights if (IsRational()) W = weights->Array1(); else { - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= nbpoles; i++) W(i) = 1.; } diff --git a/src/Geom/Geom_BezierCurve.hxx b/src/Geom/Geom_BezierCurve.hxx index 9ca5b83e8b..bbbb6bf7a5 100644 --- a/src/Geom/Geom_BezierCurve.hxx +++ b/src/Geom/Geom_BezierCurve.hxx @@ -351,12 +351,12 @@ private: //! if nbpoles < 2 or nbboles > MaDegree + 1 void Init (const Handle(TColgp_HArray1OfPnt)& Poles, const Handle(TColStd_HArray1OfReal)& Weights); - Standard_Boolean rational; - Standard_Boolean closed; + Standard_Boolean rational{}; + Standard_Boolean closed{}; Handle(TColgp_HArray1OfPnt) poles; Handle(TColStd_HArray1OfReal) weights; - Standard_Real maxderivinv; - Standard_Boolean maxderivinvok; + Standard_Real maxderivinv{}; + Standard_Boolean maxderivinvok{}; }; diff --git a/src/Geom/Geom_BezierSurface.cxx b/src/Geom/Geom_BezierSurface.cxx index 976c141e68..6a4c739f1f 100644 --- a/src/Geom/Geom_BezierSurface.cxx +++ b/src/Geom/Geom_BezierSurface.cxx @@ -27,6 +27,8 @@ #define No_Standard_DimensionError +#include + #include #include #include @@ -56,7 +58,7 @@ static void Rational(const TColStd_Array2OfReal& Weights, Standard_Boolean& Urational, Standard_Boolean& Vrational) { - Standard_Integer I,J; + Standard_Integer I = 0,J = 0; J = Weights.LowerCol (); Vrational = Standard_False; while (!Vrational && J <= Weights.UpperCol()) { @@ -96,7 +98,7 @@ static void AddPoleCol Standard_Integer InsertIndex = AfterIndex + NewPoles.LowerCol(); Standard_Integer Offset = NewPoles.LowerRow() - PoleCol.Lower(); Standard_Integer ColIndex = NewPoles.LowerCol(); - Standard_Integer RowIndex; + Standard_Integer RowIndex = 0; while (ColIndex < InsertIndex) { RowIndex = NewPoles.LowerRow(); while (RowIndex <= NewPoles.UpperRow()){ @@ -140,7 +142,7 @@ static void AddRatPoleCol Standard_Integer OffsetW = NewWeights.LowerRow() - PoleWeightCol.Lower(); Standard_Integer ColIndex = NewPoles.LowerCol(); - Standard_Integer RowIndex; + Standard_Integer RowIndex = 0; while (ColIndex < InsertIndex) { RowIndex = NewPoles.LowerRow(); while (RowIndex <= NewPoles.UpperRow()){ @@ -182,7 +184,7 @@ static void AddPoleRow Standard_Integer InsertIndex = AfterIndex + NewPoles.LowerRow(); Standard_Integer Offset = NewPoles.LowerCol() - PoleRow.Lower(); Standard_Integer RowIndex = NewPoles.LowerRow(); - Standard_Integer ColIndex; + Standard_Integer ColIndex = 0; while (RowIndex < InsertIndex) { ColIndex = NewPoles.LowerCol(); while (ColIndex <= NewPoles.UpperCol()){ @@ -225,7 +227,7 @@ static void AddRatPoleRow Standard_Integer OffsetPol = NewPoles.LowerCol() - PoleRow.Lower(); Standard_Integer OffsetW = NewWeights.LowerCol() - PoleWeightRow.Lower(); - Standard_Integer ColIndex; + Standard_Integer ColIndex = 0; Standard_Integer RowIndex = NewPoles.LowerRow(); while (RowIndex < InsertIndex) { ColIndex = NewPoles.LowerCol(); @@ -265,7 +267,7 @@ static void DeletePoleCol TColgp_Array2OfPnt& NewPoles) { Standard_Integer Offset = 0; - Standard_Integer RowIndex; + Standard_Integer RowIndex = 0; Standard_Integer ColIndex = NewPoles.LowerCol(); while (ColIndex <= NewPoles.UpperCol()) { RowIndex = NewPoles.LowerRow(); @@ -291,7 +293,7 @@ static void DeleteRatPoleCol TColStd_Array2OfReal& NewWeights) { Standard_Integer Offset = 0; - Standard_Integer RowIndex; + Standard_Integer RowIndex = 0; Standard_Integer ColIndex = NewPoles.LowerCol(); while (ColIndex <= NewPoles.UpperCol()) { RowIndex = NewPoles.LowerRow(); @@ -316,7 +318,7 @@ static void DeletePoleRow TColgp_Array2OfPnt& NewPoles) { Standard_Integer Offset = 0; - Standard_Integer ColIndex; + Standard_Integer ColIndex = 0; Standard_Integer RowIndex = NewPoles.LowerRow(); while (RowIndex <= NewPoles.UpperRow()) { ColIndex = NewPoles.LowerCol(); @@ -342,7 +344,7 @@ static void DeleteRatPoleRow TColStd_Array2OfReal& NewWeights) { Standard_Integer Offset = 0; - Standard_Integer ColIndex; + Standard_Integer ColIndex = 0; Standard_Integer RowIndex = NewPoles.LowerRow(); while (RowIndex <= NewPoles.UpperRow()) { ColIndex = NewPoles.LowerCol(); @@ -421,7 +423,7 @@ Geom_BezierSurface::Geom_BezierSurface npoles = new TColgp_HArray2OfPnt (1, NbUPoles, 1, NbVPoles); npoles->ChangeArray2() = SurfacePoles; - Standard_Integer I, J; + Standard_Integer I = 0, J = 0; urational = Standard_False; vrational = Standard_False; J = PoleWeights.LowerCol (); @@ -466,10 +468,10 @@ Geom_BezierSurface::Geom_BezierSurface const Handle(TColStd_HArray2OfReal)& PoleWeights, const Standard_Boolean IsURational, const Standard_Boolean IsVRational) -:maxderivinvok(Standard_False) +:urational(IsURational), vrational(IsVRational), maxderivinvok(Standard_False) { - urational = IsURational; - vrational = IsVRational; + + Standard_Integer NbUPoles = SurfacePoles->ColLength(); Standard_Integer NbVPoles = SurfacePoles->RowLength(); @@ -949,7 +951,7 @@ void Geom_BezierSurface::Segment if(UDegree() <= VDegree()) { Handle(TColgp_HArray2OfPnt) coeffs = Coefs; Handle(TColStd_HArray2OfReal) wcoeffs = WCoefs; - Standard_Integer ii, jj; + Standard_Integer ii = 0, jj = 0; Coefs = new (TColgp_HArray2OfPnt)(1,UDegree()+1,1,VDegree()+1); if (rat) { WCoefs = new (TColStd_HArray2OfReal)(1,UDegree()+1,1,VDegree()+1); @@ -1052,7 +1054,7 @@ void Geom_BezierSurface::SetPoleCol throw Standard_ConstructionError(); } - Standard_Integer I; + Standard_Integer I = 0; for (I = CPoles.Lower(); I <= CPoles.Upper(); I++) { Poles (I, VIndex) = CPoles (I); } @@ -1124,7 +1126,7 @@ void Geom_BezierSurface::SetPoleRow throw Standard_ConstructionError(); } - Standard_Integer I; + Standard_Integer I = 0; for (I = CPoles.Lower(); I <= CPoles.Upper(); I++) { Poles (UIndex, I) = CPoles (I); @@ -1182,7 +1184,7 @@ void Geom_BezierSurface::SetWeightCol (const Standard_Integer VIndex, const TColStd_Array1OfReal& CPoleWeights) { - Standard_Integer I; + Standard_Integer I = 0; // compute new rationality Standard_Boolean wasrat = (urational||vrational); if (!wasrat) { @@ -1223,7 +1225,7 @@ void Geom_BezierSurface::SetWeightRow (const Standard_Integer UIndex, const TColStd_Array1OfReal& CPoleWeights) { - Standard_Integer I; + Standard_Integer I = 0; // compute new rationality Standard_Boolean wasrat = (urational||vrational); if (!wasrat) { @@ -1266,11 +1268,11 @@ void Geom_BezierSurface::SetWeightRow void Geom_BezierSurface::UReverse () { gp_Pnt Pol; - Standard_Integer Row,Col; + Standard_Integer Row = 0,Col = 0; TColgp_Array2OfPnt & Poles = poles->ChangeArray2(); if (urational || vrational) { TColStd_Array2OfReal & Weights = weights->ChangeArray2(); - Standard_Real W; + Standard_Real W = NAN; for (Col = 1; Col <= Poles.RowLength(); Col++) { for (Row = 1; Row <= IntegerPart (Poles.ColLength() / 2); Row++) { W = Weights (Row, Col); @@ -1312,11 +1314,11 @@ Standard_Real Geom_BezierSurface::UReversedParameter void Geom_BezierSurface::VReverse () { gp_Pnt Pol; - Standard_Integer Row,Col; + Standard_Integer Row = 0,Col = 0; TColgp_Array2OfPnt & Poles = poles->ChangeArray2(); if (urational || vrational) { TColStd_Array2OfReal & Weights = weights->ChangeArray2(); - Standard_Real W; + Standard_Real W = NAN; for (Row = 1; Row <= Poles.ColLength(); Row++) { for (Col = 1; Col <= IntegerPart (Poles.RowLength()/2); Col++) { W = Weights (Row, Col); diff --git a/src/Geom/Geom_BezierSurface.hxx b/src/Geom/Geom_BezierSurface.hxx index 244078d86d..968a3371b3 100644 --- a/src/Geom/Geom_BezierSurface.hxx +++ b/src/Geom/Geom_BezierSurface.hxx @@ -609,8 +609,8 @@ private: Standard_Boolean vrational; Handle(TColgp_HArray2OfPnt) poles; Handle(TColStd_HArray2OfReal) weights; - Standard_Real umaxderivinv; - Standard_Real vmaxderivinv; + Standard_Real umaxderivinv{}; + Standard_Real vmaxderivinv{}; Standard_Boolean maxderivinvok; diff --git a/src/Geom/Geom_Ellipse.cxx b/src/Geom/Geom_Ellipse.cxx index 8e4c7cccbd..378f072d78 100644 --- a/src/Geom/Geom_Ellipse.cxx +++ b/src/Geom/Geom_Ellipse.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -298,7 +300,7 @@ Standard_Real Geom_Ellipse::Focal () const { Pnt Geom_Ellipse::Focus1 () const { Standard_Real C = Sqrt (majorRadius * majorRadius - minorRadius * minorRadius); - Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; + Standard_Real Xp = NAN, Yp = NAN, Zp = NAN, Xd = NAN, Yd = NAN, Zd = NAN; pos.Location().Coord (Xp, Yp, Zp); pos.XDirection().Coord (Xd, Yd, Zd); return Pnt (Xp + C * Xd, Yp + C * Yd, Zp + C * Zd); @@ -313,7 +315,7 @@ Pnt Geom_Ellipse::Focus1 () const { Pnt Geom_Ellipse::Focus2 () const { Standard_Real C = Sqrt (majorRadius * majorRadius - minorRadius * minorRadius); - Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; + Standard_Real Xp = NAN, Yp = NAN, Zp = NAN, Xd = NAN, Yd = NAN, Zd = NAN; pos.Location().Coord (Xp, Yp, Zp); pos.XDirection().Coord (Xd, Yd, Zd); return Pnt (Xp - C * Xd, Yp - C * Yd, Zp - C * Zd); diff --git a/src/Geom/Geom_Hyperbola.cxx b/src/Geom/Geom_Hyperbola.cxx index 486979a410..d73f433255 100644 --- a/src/Geom/Geom_Hyperbola.cxx +++ b/src/Geom/Geom_Hyperbola.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -334,7 +336,7 @@ Standard_Real Geom_Hyperbola::Focal () const { Pnt Geom_Hyperbola::Focus1 () const { Standard_Real C = Sqrt(majorRadius * majorRadius + minorRadius * minorRadius); - Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; + Standard_Real Xp = NAN, Yp = NAN, Zp = NAN, Xd = NAN, Yd = NAN, Zd = NAN; pos.Location().Coord (Xp, Yp, Zp); pos.XDirection().Coord (Xd, Yd, Zd); return Pnt (Xp + C * Xd, Yp + C * Yd, Zp + C * Zd); @@ -348,7 +350,7 @@ Pnt Geom_Hyperbola::Focus1 () const { Pnt Geom_Hyperbola::Focus2 () const { Standard_Real C = Sqrt(majorRadius * majorRadius + minorRadius * minorRadius); - Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; + Standard_Real Xp = NAN, Yp = NAN, Zp = NAN, Xd = NAN, Yd = NAN, Zd = NAN; pos.Location().Coord (Xp, Yp, Zp); pos.XDirection().Coord (Xd, Yd, Zd); return Pnt (Xp - C * Xd, Yp - C * Yd, Zp - C * Zd); diff --git a/src/Geom/Geom_OffsetSurface.cxx b/src/Geom/Geom_OffsetSurface.cxx index 19c62e901c..e306888847 100644 --- a/src/Geom/Geom_OffsetSurface.cxx +++ b/src/Geom/Geom_OffsetSurface.cxx @@ -19,6 +19,8 @@ // Modified 15/11/96 : JPI : ajout equivalent surface pour les surfaces canoniques et modif des methodes D0 D1, ... UIso,VIso // Modified 18/11/96 : JPI : inversion de l'offsetValue dans UReverse et Vreverse +#include + #include #include #include @@ -99,7 +101,7 @@ Geom_OffsetSurface::Geom_OffsetSurface (const Handle(Geom_Surface)& theSurf, void Geom_OffsetSurface::SetBasisSurface (const Handle(Geom_Surface)& S, const Standard_Boolean isNotCheckC0) { - Standard_Real aUf, aUl, aVf, aVl; + Standard_Real aUf = NAN, aUl = NAN, aVf = NAN, aVl = NAN; S->Bounds(aUf, aUl, aVf, aVl); Handle(Geom_Surface) aCheckingSurf = Handle(Geom_Surface)::DownCast(S->Copy()); @@ -437,12 +439,12 @@ public: Geom_OffsetSurface_UIsoEvaluator (const Handle(Geom_Surface)& theSurface, const Standard_Real theU) : CurrentSurface(theSurface), IsoPar(theU) {} - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: GeomAdaptor_Surface CurrentSurface; @@ -479,12 +481,12 @@ public: Geom_OffsetSurface_VIsoEvaluator (const Handle(Geom_Surface)& theSurface, const Standard_Real theV) : CurrentSurface(theSurface), IsoPar(theV) {} - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Geom_Surface) CurrentSurface; @@ -542,7 +544,7 @@ Handle(Geom_Curve) Geom_OffsetSurface::UIso (const Standard_Real UU) const const Standard_Integer Num1 = 0, Num2 = 0, Num3 = 1; Handle(TColStd_HArray1OfReal) T1, T2, T3 = new TColStd_HArray1OfReal(1,Num3); T3->Init(Precision::Approximation()); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; Bounds(U1,U2,V1,V2); const GeomAbs_Shape Cont = GeomAbs_C1; const Standard_Integer MaxSeg = 100, MaxDeg = 14; @@ -583,7 +585,7 @@ Handle(Geom_Curve) Geom_OffsetSurface::VIso (const Standard_Real VV) const const Standard_Integer Num1 = 0, Num2 = 0, Num3 = 1; Handle(TColStd_HArray1OfReal) T1, T2, T3 = new TColStd_HArray1OfReal(1,Num3); T3->Init(Precision::Approximation()); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; Bounds(U1,U2,V1,V2); const GeomAbs_Shape Cont = GeomAbs_C1; const Standard_Integer MaxSeg = 100, MaxDeg = 14; @@ -680,7 +682,7 @@ Standard_Real Geom_OffsetSurface::VPeriod() const Standard_Boolean Geom_OffsetSurface::IsUClosed () const { - Standard_Boolean UClosed; + Standard_Boolean UClosed = 0; Handle(Geom_Surface) SBasis = BasisSurface(); if (SBasis->IsKind (STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { @@ -732,7 +734,7 @@ Standard_Boolean Geom_OffsetSurface::IsUClosed () const Standard_Boolean Geom_OffsetSurface::IsVClosed () const { - Standard_Boolean VClosed; + Standard_Boolean VClosed = 0; Handle(Geom_Surface) SBasis = BasisSurface(); if (SBasis->IsKind (STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { @@ -806,7 +808,7 @@ Handle(Geom_Surface) Geom_OffsetSurface::Surface() const Handle(Geom_Surface) Result, Base; Result.Nullify(); Handle(Standard_Type) TheType = basisSurf->DynamicType(); - Standard_Boolean IsTrimmed; + Standard_Boolean IsTrimmed = 0; Standard_Real U1 = 0., V1 = 0., U2 = 0., V2 = 0.; // Preambule pour les surface trimmes @@ -862,7 +864,7 @@ Handle(Geom_Surface) Geom_OffsetSurface::Surface() const gp_Ax3 anAxis = C->Position(); Standard_Boolean isDirect = anAxis.Direct(); Standard_Real anAlpha = C->SemiAngle(); - Standard_Real aRadius; + Standard_Real aRadius = NAN; if (isDirect) { aRadius = C->RefRadius() + offsetValue * Cos (anAlpha); diff --git a/src/Geom/Geom_OsculatingSurface.cxx b/src/Geom/Geom_OsculatingSurface.cxx index e0c7cb701d..e32a646872 100644 --- a/src/Geom/Geom_OsculatingSurface.cxx +++ b/src/Geom/Geom_OsculatingSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -122,8 +124,8 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS, { myKdeg = new TColStd_HSequenceOfInteger(); Standard_Integer k=0; - Standard_Boolean IsQPunc; - Standard_Integer UKnot,VKnot; + Standard_Boolean IsQPunc = 0; + Standard_Integer UKnot = 0,VKnot = 0; if (myAlong(1) || myAlong(2)) { for (i=1;iNbUKnots();i++) @@ -332,10 +334,10 @@ Standard_Boolean Geom_OsculatingSurface::UOscSurf if (myAlong(1) || myAlong(2)) { Standard_Integer NU = 1, NV = 1; - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; t = Standard_False; myBasisSurf->Bounds(u1,u2,v1,v2); - Standard_Integer NbUK,NbVK; + Standard_Integer NbUK = 0,NbVK = 0; Standard_Boolean isToSkipSecond = Standard_False; if (myBasisSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) { @@ -391,10 +393,10 @@ Standard_Boolean Geom_OsculatingSurface::VOscSurf if (myAlong(3) || myAlong(4)) { Standard_Integer NU = 1, NV = 1; - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; t = Standard_False; myBasisSurf->Bounds(u1,u2,v1,v2); - Standard_Integer NbUK,NbVK; + Standard_Integer NbUK = 0,NbVK = 0; Standard_Boolean isToSkipSecond = Standard_False; if (myBasisSurf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) { @@ -451,9 +453,9 @@ Standard_Boolean Geom_OsculatingSurface::BuildOsculatingSurface #endif // for cache - Standard_Integer MinDegree, - MaxDegree ; - Standard_Real udeg, vdeg; + Standard_Integer MinDegree = 0, + MaxDegree = 0 ; + Standard_Real udeg = NAN, vdeg = NAN; udeg = BS->UDegree(); vdeg = BS->VDegree(); if( (IsAlongU() && vdeg <=1) || (IsAlongV() && udeg <=1)) @@ -473,8 +475,8 @@ Standard_Boolean Geom_OsculatingSurface::BuildOsculatingSurface // end for cache // for polynomial grid - Standard_Integer MaxUDegree, MaxVDegree; - Standard_Integer UContinuity, VContinuity; + Standard_Integer MaxUDegree = 0, MaxVDegree = 0; + Standard_Integer UContinuity = 0, VContinuity = 0; Handle(TColStd_HArray2OfInteger) NumCoeffPerSurface = new TColStd_HArray2OfInteger(1, 1, 1, 2); @@ -528,8 +530,8 @@ Standard_Boolean Geom_OsculatingSurface::BuildOsculatingSurface // end for polynomial grid // building the cache - Standard_Integer ULocalIndex, VLocalIndex; - Standard_Real ucacheparameter, vcacheparameter,uspanlength, vspanlength; + Standard_Integer ULocalIndex = 0, VLocalIndex = 0; + Standard_Real ucacheparameter = NAN, vcacheparameter = NAN,uspanlength = NAN, vspanlength = NAN; TColgp_Array2OfPnt NewPoles(1, BS->NbUPoles(), 1, BS->NbVPoles()); Standard_Integer aUfKnotsLength = BS->NbUPoles() + BS->UDegree() + 1; @@ -589,7 +591,7 @@ Standard_Boolean Geom_OsculatingSurface::BuildOsculatingSurface BSplSLib::NoWeights(), cachepoles, BSplSLib::NoWeights()); - Standard_Integer m, n, index; + Standard_Integer m = 0, n = 0, index = 0; TColgp_Array2OfPnt OscCoeff(1,OscUNumCoeff , 1, OscVNumCoeff); if (IsAlongU()) @@ -690,12 +692,12 @@ Standard_Boolean Geom_OsculatingSurface::IsQPunctual const Standard_Real TolMin, const Standard_Real TolMax) const { - Standard_Real U1=0,U2=0,V1=0,V2=0,T; + Standard_Real U1=0,U2=0,V1=0,V2=0,T = NAN; Standard_Boolean Along = Standard_True; S->Bounds(U1,U2,V1,V2); gp_Vec D1U,D1V; gp_Pnt P; - Standard_Real Step,D1NormMax; + Standard_Real Step = NAN,D1NormMax = NAN; if (IT == GeomAbs_IsoV) { Step = (U2 - U1)/10; diff --git a/src/Geom/Geom_OsculatingSurface.hxx b/src/Geom/Geom_OsculatingSurface.hxx index 81fe316741..1add1b28c6 100644 --- a/src/Geom/Geom_OsculatingSurface.hxx +++ b/src/Geom/Geom_OsculatingSurface.hxx @@ -100,7 +100,7 @@ private: Handle(Geom_Surface) myBasisSurf; - Standard_Real myTol; + Standard_Real myTol{}; Handle(Geom_HSequenceOfBSplineSurface) myOsculSurf1; Handle(Geom_HSequenceOfBSplineSurface) myOsculSurf2; Handle(TColStd_HSequenceOfInteger) myKdeg; diff --git a/src/Geom/Geom_Parabola.cxx b/src/Geom/Geom_Parabola.cxx index 7f0f269069..c911c5a01d 100644 --- a/src/Geom/Geom_Parabola.cxx +++ b/src/Geom/Geom_Parabola.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -251,7 +253,7 @@ Vec Geom_Parabola::DN (const Standard_Real U, const Standard_Integer N) const { Pnt Geom_Parabola::Focus () const { - Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; + Standard_Real Xp = NAN, Yp = NAN, Zp = NAN, Xd = NAN, Yd = NAN, Zd = NAN; pos.Location().Coord (Xp, Yp, Zp); pos.XDirection().Coord (Xd, Yd, Zd); return Pnt (Xp + focalLength*Xd, Yp + focalLength*Yd, Zp + focalLength*Zd); diff --git a/src/Geom/Geom_RectangularTrimmedSurface.cxx b/src/Geom/Geom_RectangularTrimmedSurface.cxx index 096b8e02d2..1e0db88916 100644 --- a/src/Geom/Geom_RectangularTrimmedSurface.cxx +++ b/src/Geom/Geom_RectangularTrimmedSurface.cxx @@ -17,6 +17,8 @@ // ******************************************************************* // ******************************************************************* +#include + #include #include #include @@ -246,7 +248,7 @@ void Geom_RectangularTrimmedSurface::SetTrim(const Standard_Real U1, Standard_Boolean UsameSense = Standard_True; Standard_Boolean VsameSense = Standard_True; - Standard_Real Udeb, Ufin, Vdeb, Vfin; + Standard_Real Udeb = NAN, Ufin = NAN, Vdeb = NAN, Vfin = NAN; basisSurf->Bounds(Udeb, Ufin, Vdeb, Vfin); diff --git a/src/Geom/Geom_RectangularTrimmedSurface.hxx b/src/Geom/Geom_RectangularTrimmedSurface.hxx index 940efe4a60..4811fdfb5d 100644 --- a/src/Geom/Geom_RectangularTrimmedSurface.hxx +++ b/src/Geom/Geom_RectangularTrimmedSurface.hxx @@ -300,12 +300,12 @@ private: Standard_EXPORT void SetTrim (const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2, const Standard_Boolean UTrim, const Standard_Boolean VTrim, const Standard_Boolean USense, const Standard_Boolean VSense); Handle(Geom_Surface) basisSurf; - Standard_Real utrim1; - Standard_Real vtrim1; - Standard_Real utrim2; - Standard_Real vtrim2; - Standard_Boolean isutrimmed; - Standard_Boolean isvtrimmed; + Standard_Real utrim1{}; + Standard_Real vtrim1{}; + Standard_Real utrim2{}; + Standard_Real vtrim2{}; + Standard_Boolean isutrimmed{}; + Standard_Boolean isvtrimmed{}; }; diff --git a/src/Geom/Geom_Surface.cxx b/src/Geom/Geom_Surface.cxx index b85f0db838..967dc94e88 100644 --- a/src/Geom/Geom_Surface.cxx +++ b/src/Geom/Geom_Surface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -87,7 +89,7 @@ Standard_Real Geom_Surface::UPeriod() const Standard_NoSuchObject_Raise_if ( !IsUPeriodic(),"Geom_Surface::UPeriod"); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; Bounds(U1,U2,V1,V2); return ( U2 - U1); } @@ -103,7 +105,7 @@ Standard_Real Geom_Surface::VPeriod() const Standard_NoSuchObject_Raise_if ( !IsVPeriodic(),"Geom_Surface::VPeriod"); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; Bounds(U1,U2,V1,V2); return ( V2 - V1); } diff --git a/src/Geom/Geom_SurfaceOfLinearExtrusion.cxx b/src/Geom/Geom_SurfaceOfLinearExtrusion.cxx index a6c708b463..8fcfeea359 100644 --- a/src/Geom/Geom_SurfaceOfLinearExtrusion.cxx +++ b/src/Geom/Geom_SurfaceOfLinearExtrusion.cxx @@ -77,12 +77,12 @@ Handle(Geom_Geometry) Geom_SurfaceOfLinearExtrusion::Copy () const Geom_SurfaceOfLinearExtrusion::Geom_SurfaceOfLinearExtrusion ( const Handle(Geom_Curve)& C, - const Dir& V) { + const Dir& V) : myEvaluator(new GeomEvaluator_SurfaceOfExtrusion(basisCurve, direction)) { basisCurve = Handle(Geom_Curve)::DownCast(C->Copy()); // Copy 10-03-93 direction = V; smooth = C->Continuity(); - myEvaluator = new GeomEvaluator_SurfaceOfExtrusion(basisCurve, direction); + } diff --git a/src/Geom2d/Geom2d_AxisPlacement.cxx b/src/Geom2d/Geom2d_AxisPlacement.cxx index b48ef685e3..96b4e561dc 100644 --- a/src/Geom2d/Geom2d_AxisPlacement.cxx +++ b/src/Geom2d/Geom2d_AxisPlacement.cxx @@ -46,7 +46,7 @@ Handle(Geom2d_Geometry) Geom2d_AxisPlacement::Copy() const { -Geom2d_AxisPlacement::Geom2d_AxisPlacement (const gp_Ax2d& A) { axis = A; } +Geom2d_AxisPlacement::Geom2d_AxisPlacement (const gp_Ax2d& A) : axis(A) { } Geom2d_AxisPlacement::Geom2d_AxisPlacement (const Pnt2d& P, const Dir2d& V) { diff --git a/src/Geom2d/Geom2d_BSplineCurve.cxx b/src/Geom2d/Geom2d_BSplineCurve.cxx index 9a16ecda5e..2676b21788 100644 --- a/src/Geom2d/Geom2d_BSplineCurve.cxx +++ b/src/Geom2d/Geom2d_BSplineCurve.cxx @@ -29,6 +29,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -123,7 +125,7 @@ Geom2d_BSplineCurve::Geom2d_BSplineCurve rational(Standard_False), periodic(Periodic), deg(Degree), - maxderivinvok(Standard_False) + poles(new TColgp_HArray1OfPnt2d(1,Poles.Length())), knots(new TColStd_HArray1OfReal(1,Knots.Length())), mults(new TColStd_HArray1OfInteger(1,Mults.Length())), maxderivinvok(Standard_False) { // check @@ -135,13 +137,13 @@ Geom2d_BSplineCurve::Geom2d_BSplineCurve // copy arrays - poles = new TColgp_HArray1OfPnt2d(1,Poles.Length()); + poles->ChangeArray1() = Poles; - knots = new TColStd_HArray1OfReal(1,Knots.Length()); + knots->ChangeArray1() = Knots; - mults = new TColStd_HArray1OfInteger(1,Mults.Length()); + mults->ChangeArray1() = Mults; UpdateKnots(); @@ -177,7 +179,7 @@ Geom2d_BSplineCurve::Geom2d_BSplineCurve if (Weights.Length() != Poles.Length()) throw Standard_ConstructionError("Geom2d_BSplineCurve: Weights and Poles array size mismatch"); - Standard_Integer i; + Standard_Integer i = 0; for (i = Weights.Lower(); i <= Weights.Upper(); i++) { if (Weights(i) <= gp::Resolution()) { throw Standard_ConstructionError("Geom2d_BSplineCurve: Weights values too small"); @@ -295,7 +297,7 @@ void Geom2d_BSplineCurve::IncreaseMultiplicity Handle(TColStd_HArray1OfReal) tk = knots; TColStd_Array1OfReal k((knots->Array1())(I1),I1,I2); TColStd_Array1OfInteger m(I1,I2); - Standard_Integer i; + Standard_Integer i = 0; for (i = I1; i <= I2; i++) m(i) = M - mults->Value(i); InsertKnots(k,m,Epsilon(1.),Standard_True); @@ -345,7 +347,7 @@ void Geom2d_BSplineCurve::InsertKnots(const TColStd_Array1OfReal& Knots, const Standard_Boolean Add) { // Check and compute new sizes - Standard_Integer nbpoles,nbknots; + Standard_Integer nbpoles = 0,nbknots = 0; if (!BSplCLib::PrepareInsertKnots(deg,periodic, knots->Array1(),mults->Array1(), @@ -470,7 +472,7 @@ void Geom2d_BSplineCurve::InsertPoleAfter TColStd_Array1OfReal& newknots = nknots->ChangeArray1(); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i < nbknots; i++) { newknots (i) = cknots(i); } @@ -563,7 +565,7 @@ void Geom2d_BSplineCurve::RemovePole if (knotSet == GeomAbs_NonUniform || knotSet == GeomAbs_PiecewiseBezier) throw Standard_ConstructionError("BSpline curve: RemovePole: bad knotSet type"); - Standard_Integer i; + Standard_Integer i = 0; Handle(TColStd_HArray1OfReal) nknots = new TColStd_HArray1OfReal(1,knots->Length()-1); TColStd_Array1OfReal& newknots = nknots->ChangeArray1(); @@ -616,7 +618,7 @@ void Geom2d_BSplineCurve::Reverse () { BSplCLib::Reverse(knots->ChangeArray1()); BSplCLib::Reverse(mults->ChangeArray1()); - Standard_Integer last; + Standard_Integer last = 0; if (periodic) last = flatknots->Upper() - deg - 1; else @@ -650,9 +652,9 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1, // Standard_Real AbsUMax = Max(Abs(FirstParameter()),Abs(LastParameter())); Standard_Real Eps = Max (Epsilon(AbsUMax), theTolerance); - Standard_Real NewU1, NewU2; - Standard_Real U, DU=0; - Standard_Integer i, k, index; + Standard_Real NewU1 = NAN, NewU2 = NAN; + Standard_Real U = NAN, DU=0; + Standard_Integer i = 0, k = 0, index = 0; // //f Standard_Real U1 = aU1, U2 = aU2; @@ -891,7 +893,7 @@ void Geom2d_BSplineCurve::SetOrigin(const Standard_Integer Index) { if (!periodic) throw Standard_NoSuchObject("Geom2d_BSplineCurve::SetOrigin"); - Standard_Integer i,k; + Standard_Integer i = 0,k = 0; Standard_Integer first = FirstUKnotIndex(); Standard_Integer last = LastUKnotIndex(); @@ -978,7 +980,7 @@ void Geom2d_BSplineCurve::SetOrigin(const Standard_Integer Index) void Geom2d_BSplineCurve::SetNotPeriodic () { if (periodic) { - Standard_Integer NbKnots, NbPoles; + Standard_Integer NbKnots = 0, NbPoles = 0; BSplCLib::PrepareUnperiodize( deg, mults->Array1(),NbKnots,NbPoles); Handle(TColgp_HArray1OfPnt2d) npoles @@ -1117,7 +1119,7 @@ MovePointAndTangent(const Standard_Real U, const Standard_Integer EndingCondition, Standard_Integer& ErrorStatus) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; if (IsPeriodic()) { // // for the time being do not deal with periodic curves @@ -1204,7 +1206,7 @@ void Geom2d_BSplineCurve::UpdateKnots() void Geom2d_BSplineCurve::PeriodicNormalization(Standard_Real& Parameter) const { - Standard_Real Period ; + Standard_Real Period = NAN ; if (periodic) { Period = flatknots->Value(flatknots->Upper() - deg) - flatknots->Value (deg + 1) ; diff --git a/src/Geom2d/Geom2d_BSplineCurve.hxx b/src/Geom2d/Geom2d_BSplineCurve.hxx index e186a653f3..baaf89671a 100644 --- a/src/Geom2d/Geom2d_BSplineCurve.hxx +++ b/src/Geom2d/Geom2d_BSplineCurve.hxx @@ -837,7 +837,7 @@ private: Handle(TColStd_HArray1OfReal) flatknots; Handle(TColStd_HArray1OfReal) knots; Handle(TColStd_HArray1OfInteger) mults; - Standard_Real maxderivinv; + Standard_Real maxderivinv{}; Standard_Boolean maxderivinvok; diff --git a/src/Geom2d/Geom2d_BSplineCurve_1.cxx b/src/Geom2d/Geom2d_BSplineCurve_1.cxx index 0f2dffc95c..c542eafccd 100644 --- a/src/Geom2d/Geom2d_BSplineCurve_1.cxx +++ b/src/Geom2d/Geom2d_BSplineCurve_1.cxx @@ -653,7 +653,7 @@ void Geom2d_BSplineCurve::Weights if (IsRational()) W = weights->Array1(); else { - Standard_Integer i; + Standard_Integer i = 0; for (i = W.Lower(); i <= W.Upper(); i++) W(i) = 1.; } @@ -756,7 +756,7 @@ void Geom2d_BSplineCurve::Resolution (const Standard_Real ToleranceUV, { if (periodic) { - Standard_Integer NbKnots, NbPoles; + Standard_Integer NbKnots = 0, NbPoles = 0; BSplCLib::PrepareUnperiodize (deg, mults->Array1(), NbKnots, NbPoles); TColgp_Array1OfPnt2d new_poles (1, NbPoles); TColStd_Array1OfReal new_weights (1, NbPoles); diff --git a/src/Geom2d/Geom2d_BezierCurve.cxx b/src/Geom2d/Geom2d_BezierCurve.cxx index 8e64d899cc..d5a06090c5 100644 --- a/src/Geom2d/Geom2d_BezierCurve.cxx +++ b/src/Geom2d/Geom2d_BezierCurve.cxx @@ -28,6 +28,8 @@ #define No_Standard_DimensionError +#include + #include #include #include @@ -51,7 +53,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Geom2d_BezierCurve,Geom2d_BoundedCurve) //======================================================================= static Standard_Boolean Rational(const TColStd_Array1OfReal& W) { - Standard_Integer i, n = W.Length(); + Standard_Integer i = 0, n = W.Length(); Standard_Boolean rat = Standard_False; for (i = 1; i < n; i++) { rat = Abs(W(i) - W(i+1)) > gp::Resolution(); @@ -107,7 +109,7 @@ Geom2d_BezierCurve::Geom2d_BezierCurve if (Weights.Length() != nbpoles) throw Standard_ConstructionError(); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= nbpoles; i++) { if (Weights(i) <= gp::Resolution()) { throw Standard_ConstructionError(); @@ -204,7 +206,7 @@ void Geom2d_BezierCurve::InsertPoleAfter (Index < 0 || Index > nbpoles, "Geom2d_BezierCurve::InsertPoleAfter"); - Standard_Integer i; + Standard_Integer i = 0; // Insert the pole Handle(TColgp_HArray1OfPnt2d) npoles = @@ -281,7 +283,7 @@ void Geom2d_BezierCurve::RemovePole (Index < 1 || Index > nbpoles, "Geom2d_BezierCurve::RemovePole"); - Standard_Integer i; + Standard_Integer i = 0; // Remove the pole Handle(TColgp_HArray1OfPnt2d) npoles = @@ -324,7 +326,7 @@ void Geom2d_BezierCurve::RemovePole void Geom2d_BezierCurve::Reverse () { gp_Pnt2d P; - Standard_Integer i, nbpoles = NbPoles(); + Standard_Integer i = 0, nbpoles = NbPoles(); TColgp_Array1OfPnt2d & cpoles = poles->ChangeArray1(); // reverse poles @@ -337,7 +339,7 @@ void Geom2d_BezierCurve::Reverse () // reverse weights if (IsRational()) { TColStd_Array1OfReal & cweights = weights->ChangeArray1(); - Standard_Real w; + Standard_Real w = NAN; for (i = 1; i <= nbpoles / 2; i++) { w = cweights(i); cweights(i) = cweights(nbpoles-i+1); @@ -719,7 +721,7 @@ void Geom2d_BezierCurve::Weights if (IsRational()) W = weights->Array1(); else { - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= nbpoles; i++) W(i) = 1.; } diff --git a/src/Geom2d/Geom2d_BezierCurve.hxx b/src/Geom2d/Geom2d_BezierCurve.hxx index 5a1b0b51ef..7e2c170bac 100644 --- a/src/Geom2d/Geom2d_BezierCurve.hxx +++ b/src/Geom2d/Geom2d_BezierCurve.hxx @@ -340,12 +340,12 @@ private: void Init (const Handle(TColgp_HArray1OfPnt2d)& Poles, const Handle(TColStd_HArray1OfReal)& Weights); - Standard_Boolean rational; - Standard_Boolean closed; + Standard_Boolean rational{}; + Standard_Boolean closed{}; Handle(TColgp_HArray1OfPnt2d) poles; Handle(TColStd_HArray1OfReal) weights; - Standard_Real maxderivinv; - Standard_Boolean maxderivinvok; + Standard_Real maxderivinv{}; + Standard_Boolean maxderivinvok{}; }; diff --git a/src/Geom2d/Geom2d_Ellipse.cxx b/src/Geom2d/Geom2d_Ellipse.cxx index 3ea205600d..055d89aa9f 100644 --- a/src/Geom2d/Geom2d_Ellipse.cxx +++ b/src/Geom2d/Geom2d_Ellipse.cxx @@ -58,10 +58,10 @@ Handle(Geom2d_Geometry) Geom2d_Ellipse::Copy() const //purpose : //======================================================================= -Geom2d_Ellipse::Geom2d_Ellipse (const gp_Elips2d& E) { +Geom2d_Ellipse::Geom2d_Ellipse (const gp_Elips2d& E) : majorRadius(E.MajorRadius()), minorRadius(E.MinorRadius()) { - majorRadius = E.MajorRadius(); - minorRadius = E.MinorRadius(); + + pos = E.Axis(); } diff --git a/src/Geom2d/Geom2d_Hyperbola.cxx b/src/Geom2d/Geom2d_Hyperbola.cxx index 24b818a58a..ea3d8e7829 100644 --- a/src/Geom2d/Geom2d_Hyperbola.cxx +++ b/src/Geom2d/Geom2d_Hyperbola.cxx @@ -60,10 +60,10 @@ Handle(Geom2d_Geometry) Geom2d_Hyperbola::Copy() const //purpose : //======================================================================= -Geom2d_Hyperbola::Geom2d_Hyperbola (const gp_Hypr2d& H) +Geom2d_Hyperbola::Geom2d_Hyperbola (const gp_Hypr2d& H) : majorRadius(H.MajorRadius()), minorRadius(H.MinorRadius()) { - majorRadius = H.MajorRadius(); - minorRadius = H.MinorRadius(); + + pos = H.Axis(); } diff --git a/src/Geom2d/Geom2d_Parabola.cxx b/src/Geom2d/Geom2d_Parabola.cxx index 2e143a4e24..b81d84f22c 100644 --- a/src/Geom2d/Geom2d_Parabola.cxx +++ b/src/Geom2d/Geom2d_Parabola.cxx @@ -59,9 +59,9 @@ Handle(Geom2d_Geometry) Geom2d_Parabola::Copy() const //purpose : //======================================================================= -Geom2d_Parabola::Geom2d_Parabola (const gp_Parab2d& Prb) +Geom2d_Parabola::Geom2d_Parabola (const gp_Parab2d& Prb) : focalLength(Prb.Focal ()) { - focalLength = Prb.Focal (); + pos = Prb.Axis(); } diff --git a/src/Geom2dAPI/Geom2dAPI_ExtremaCurveCurve.cxx b/src/Geom2dAPI/Geom2dAPI_ExtremaCurveCurve.cxx index 683f2d4bd5..0bf299bddf 100644 --- a/src/Geom2dAPI/Geom2dAPI_ExtremaCurveCurve.cxx +++ b/src/Geom2dAPI/Geom2dAPI_ExtremaCurveCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -53,7 +55,7 @@ Geom2dAPI_ExtremaCurveCurve::Geom2dAPI_ExtremaCurveCurve if ( myIsDone ) { // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtCC.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtCC.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtCC.NbExt(); i++) { diff --git a/src/Geom2dAPI/Geom2dAPI_InterCurveCurve.cxx b/src/Geom2dAPI/Geom2dAPI_InterCurveCurve.cxx index 537a1ebb0a..f808cf5274 100644 --- a/src/Geom2dAPI/Geom2dAPI_InterCurveCurve.cxx +++ b/src/Geom2dAPI/Geom2dAPI_InterCurveCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -31,9 +33,9 @@ //function : Geom2dAPI_InterCurveCurve //purpose : //======================================================================= -Geom2dAPI_InterCurveCurve::Geom2dAPI_InterCurveCurve() +Geom2dAPI_InterCurveCurve::Geom2dAPI_InterCurveCurve() : myIsDone(Standard_False) { - myIsDone = Standard_False; + } @@ -183,7 +185,7 @@ void Geom2dAPI_InterCurveCurve::Segment Standard_NullObject_Raise_if(myCurve1.IsNull(), "Geom2dAPI_InterCurveCurve::Segment"); - Standard_Real aU1, aU2, aV1, aV2; + Standard_Real aU1 = NAN, aU2 = NAN, aV1 = NAN, aV2 = NAN; aU1 = myCurve1->FirstParameter(); aU2 = myCurve1->LastParameter(); if (myCurve2.IsNull()) diff --git a/src/Geom2dAPI/Geom2dAPI_InterCurveCurve.hxx b/src/Geom2dAPI/Geom2dAPI_InterCurveCurve.hxx index e5ab9e572c..1d8ff31faf 100644 --- a/src/Geom2dAPI/Geom2dAPI_InterCurveCurve.hxx +++ b/src/Geom2dAPI/Geom2dAPI_InterCurveCurve.hxx @@ -130,7 +130,7 @@ private: - Standard_Boolean myIsDone; + Standard_Boolean myIsDone{}; Handle(Geom2d_Curve) myCurve1; Handle(Geom2d_Curve) myCurve2; Geom2dInt_GInter myIntersector; diff --git a/src/Geom2dAPI/Geom2dAPI_Interpolate.cxx b/src/Geom2dAPI/Geom2dAPI_Interpolate.cxx index 106600b900..fe73d22a7d 100644 --- a/src/Geom2dAPI/Geom2dAPI_Interpolate.cxx +++ b/src/Geom2dAPI/Geom2dAPI_Interpolate.cxx @@ -16,6 +16,8 @@ // 8-Aug-95 : xab : interpolation uses BSplCLib::Interpolate +#include + #include #include #include @@ -36,9 +38,9 @@ static Standard_Boolean CheckPoints(const TColgp_Array1OfPnt2d& PointArray, const Standard_Real Tolerance) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Standard_Real tolerance_squared = Tolerance * Tolerance, - distance_squared ; + distance_squared = NAN ; Standard_Boolean result = Standard_True ; for (ii = PointArray.Lower() ; result && ii < PointArray.Upper() ; ii++) { distance_squared = @@ -57,10 +59,10 @@ static Standard_Boolean CheckTangents( const TColStd_Array1OfBoolean& TangentFlags, const Standard_Real Tolerance) { - Standard_Integer ii, - index ; + Standard_Integer ii = 0, + index = 0 ; Standard_Real tolerance_squared = Tolerance * Tolerance, - distance_squared ; + distance_squared = NAN ; Standard_Boolean result = Standard_True ; index = TangentFlags.Lower() ; for (ii = Tangents.Lower(); result && ii <= Tangents.Upper() ; ii++) { @@ -81,8 +83,8 @@ static Standard_Boolean CheckTangents( static Standard_Boolean CheckParameters(const TColStd_Array1OfReal& Parameters) { - Standard_Integer ii ; - Standard_Real distance ; + Standard_Integer ii = 0 ; + Standard_Real distance = NAN ; Standard_Boolean result = Standard_True ; for (ii = Parameters.Lower() ; result && ii < Parameters.Upper() ; ii++) { distance = @@ -99,9 +101,9 @@ static void BuildParameters(const Standard_Boolean PeriodicFlag, const TColgp_Array1OfPnt2d& PointsArray, Handle(TColStd_HArray1OfReal)& ParametersPtr) { - Standard_Integer ii, - index ; - Standard_Real distance ; + Standard_Integer ii = 0, + index = 0 ; + Standard_Real distance = NAN ; Standard_Integer num_parameters = PointsArray.Length() ; if (PeriodicFlag) { @@ -139,10 +141,10 @@ static void BuildPeriodicTangent( const TColStd_Array1OfReal& ParametersArray) { Standard_Integer - ii, - degree ; - Standard_Real *point_array, - *parameter_array, + ii = 0, + degree = 0 ; + Standard_Real *point_array = nullptr, + *parameter_array = nullptr, eval_result[2][2] ; gp_Vec2d a_vector ; @@ -183,10 +185,10 @@ static void BuildTangents(const TColgp_Array1OfPnt2d& PointsArray, TColStd_Array1OfBoolean& TangentFlags, const TColStd_Array1OfReal& ParametersArray) { - Standard_Integer ii, - degree ; - Standard_Real *point_array, - *parameter_array, + Standard_Integer ii = 0, + degree = 0 ; + Standard_Real *point_array = nullptr, + *parameter_array = nullptr, eval_result[2][2] ; gp_Vec2d a_vector ; @@ -246,16 +248,16 @@ static void ScaleTangents(const TColgp_Array1OfPnt2d& PointsArray, const TColStd_Array1OfBoolean& TangentFlags, const TColStd_Array1OfReal& ParametersArray) { - Standard_Integer ii, - jj, + Standard_Integer ii = 0, + jj = 0, degree=0, - index, - num_points ; + index = 0, + num_points = 0 ; - Standard_Real *point_array, - *parameter_array, + Standard_Real *point_array = nullptr, + *parameter_array = nullptr, value[2], - ratio, + ratio = NAN, eval_result[2][2] ; gp_Vec2d a_vector ; @@ -317,20 +319,18 @@ Geom2dAPI_Interpolate::Geom2dAPI_Interpolate myTolerance(Tolerance), myPoints(PointsPtr), myIsDone(Standard_False), -myPeriodic(PeriodicFlag), +myTangents(new TColgp_HArray1OfVec2d(myPoints->Lower(), + myPoints->Upper())), myTangentFlags(new TColStd_HArray1OfBoolean(myPoints->Lower(), + myPoints->Upper())), myPeriodic(PeriodicFlag), myTangentRequest(Standard_False) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Standard_Boolean result = CheckPoints(PointsPtr->Array1(), Tolerance) ; - myTangents = - new TColgp_HArray1OfVec2d(myPoints->Lower(), - myPoints->Upper()) ; - myTangentFlags = - new TColStd_HArray1OfBoolean(myPoints->Lower(), - myPoints->Upper()) ; + + if (!result) { throw Standard_ConstructionError(); @@ -364,7 +364,7 @@ myParameters(ParametersPtr), myPeriodic(PeriodicFlag), myTangentRequest(Standard_False) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Standard_Boolean result = @@ -409,8 +409,8 @@ void Geom2dAPI_Interpolate::Load( const Standard_Boolean Scale) { - Standard_Boolean result ; - Standard_Integer ii ; + Standard_Boolean result = 0 ; + Standard_Integer ii = 0 ; myTangentRequest = Standard_True ; myTangentFlags = TangentFlagsPtr ; if (Tangents.Length() != myPoints->Length() || @@ -450,7 +450,7 @@ void Geom2dAPI_Interpolate::Load(const gp_Vec2d& InitialTangent, const gp_Vec2d& FinalTangent, const Standard_Boolean Scale) { - Standard_Boolean result ; + Standard_Boolean result = 0 ; myTangentRequest = Standard_True ; myTangentFlags->SetValue(1,Standard_True) ; myTangentFlags->SetValue(myPoints->Length(),Standard_True) ; @@ -492,20 +492,20 @@ void Geom2dAPI_Interpolate::Perform() void Geom2dAPI_Interpolate::PerformPeriodic() { - Standard_Integer degree, - ii, - jj, - index, - index1, + Standard_Integer degree = 0, + ii = 0, + jj = 0, + index = 0, + index1 = 0, // index2, - mult_index, - half_order, - inversion_problem, - num_points, - num_distinct_knots, - num_poles ; + mult_index = 0, + half_order = 0, + inversion_problem = 0, + num_points = 0, + num_distinct_knots = 0, + num_poles = 0 ; - Standard_Real period ; + Standard_Real period = NAN ; gp_Pnt2d a_point ; @@ -690,18 +690,18 @@ void Geom2dAPI_Interpolate::PerformPeriodic() void Geom2dAPI_Interpolate::PerformNonPeriodic() { - Standard_Integer degree, - ii, - jj, - index, - index1, - index2, - index3, - mult_index, - inversion_problem, - num_points, - num_distinct_knots, - num_poles ; + Standard_Integer degree = 0, + ii = 0, + jj = 0, + index = 0, + index1 = 0, + index2 = 0, + index3 = 0, + mult_index = 0, + inversion_problem = 0, + num_points = 0, + num_distinct_knots = 0, + num_poles = 0 ; gp_Pnt2d a_point ; diff --git a/src/Geom2dAPI/Geom2dAPI_PointsToBSpline.cxx b/src/Geom2dAPI/Geom2dAPI_PointsToBSpline.cxx index 6c3f7c90f2..37f882483d 100644 --- a/src/Geom2dAPI/Geom2dAPI_PointsToBSpline.cxx +++ b/src/Geom2dAPI/Geom2dAPI_PointsToBSpline.cxx @@ -34,9 +34,9 @@ //function : Geom2dAPI_PointsToBSpline //purpose : //======================================================================= -Geom2dAPI_PointsToBSpline::Geom2dAPI_PointsToBSpline() +Geom2dAPI_PointsToBSpline::Geom2dAPI_PointsToBSpline() : myIsDone(Standard_False) { - myIsDone = Standard_False; + } @@ -84,9 +84,9 @@ Geom2dAPI_PointsToBSpline::Geom2dAPI_PointsToBSpline const Standard_Integer DegMin, const Standard_Integer DegMax, const GeomAbs_Shape Continuity, - const Standard_Real Tol2D) + const Standard_Real Tol2D) : myIsDone(Standard_False) { - myIsDone = Standard_False; + Init(Points,ParType,DegMin,DegMax,Continuity,Tol2D); } @@ -101,9 +101,9 @@ Geom2dAPI_PointsToBSpline::Geom2dAPI_PointsToBSpline const Standard_Integer DegMin, const Standard_Integer DegMax, const GeomAbs_Shape Continuity, - const Standard_Real Tol2D) + const Standard_Real Tol2D) : myIsDone(Standard_False) { - myIsDone = Standard_False; + Init(Points,Params,DegMin,DegMax,Continuity,Tol2D); } @@ -120,9 +120,9 @@ Geom2dAPI_PointsToBSpline::Geom2dAPI_PointsToBSpline const Standard_Real W3, const Standard_Integer DegMax, const GeomAbs_Shape Continuity, - const Standard_Real Tol2D) + const Standard_Real Tol2D) : myIsDone(Standard_False) { - myIsDone = Standard_False; + Init(Points,W1,W2,W3,DegMax,Continuity,Tol2D); } @@ -201,7 +201,7 @@ void Geom2dAPI_PointsToBSpline::Init TColgp_Array1OfPnt2d Points(YValues.Lower(),YValues.Upper()); math_Vector Param(YValues.Lower(),YValues.Upper()); Standard_Real length = DX * (YValues.Upper() - YValues.Lower()); - Standard_Integer i; + Standard_Integer i = 0; for (i = YValues.Lower(); i <= YValues.Upper(); i++) { Param(i) = (X0+(i-1)*DX)/(X0+length); @@ -383,7 +383,7 @@ void Geom2dAPI_PointsToBSpline::Init const GeomAbs_Shape Continuity, const Standard_Real Tol2D) { - Standard_Integer NbPoint = Points.Length(), i; + Standard_Integer NbPoint = Points.Length(), i = 0; Standard_Integer nbit = 2; diff --git a/src/Geom2dAPI/Geom2dAPI_PointsToBSpline.hxx b/src/Geom2dAPI/Geom2dAPI_PointsToBSpline.hxx index 1538278620..f555b39ac4 100644 --- a/src/Geom2dAPI/Geom2dAPI_PointsToBSpline.hxx +++ b/src/Geom2dAPI/Geom2dAPI_PointsToBSpline.hxx @@ -180,7 +180,7 @@ private: - Standard_Boolean myIsDone; + Standard_Boolean myIsDone{}; Handle(Geom2d_BSplineCurve) myCurve; diff --git a/src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.cxx b/src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.cxx index 1e9703b676..a38a2dbd7e 100644 --- a/src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.cxx +++ b/src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -26,9 +28,9 @@ //purpose : //======================================================================= Geom2dAPI_ProjectPointOnCurve::Geom2dAPI_ProjectPointOnCurve() -: myIndex(-1) +: myIsDone(Standard_False), myIndex(-1) { - myIsDone = Standard_False; + } @@ -96,7 +98,7 @@ void Geom2dAPI_ProjectPointOnCurve::Init // evaluate the lower distance and its index; if ( myIsDone) { - Standard_Real Dist2, Dist2Min = myExtPC.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtPC.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtPC.NbExt(); i++) { diff --git a/src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.hxx b/src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.hxx index a3f00ad3fa..1c3c903b4f 100644 --- a/src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.hxx +++ b/src/Geom2dAPI/Geom2dAPI_ProjectPointOnCurve.hxx @@ -122,8 +122,8 @@ Standard_EXPORT operator Standard_Real() const; private: - Standard_Boolean myIsDone; - Standard_Integer myIndex; + Standard_Boolean myIsDone{}; + Standard_Integer myIndex{}; Extrema_ExtPC2d myExtPC; Geom2dAdaptor_Curve myC; diff --git a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx index 10b014ae43..91337b78d8 100644 --- a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx +++ b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx @@ -21,6 +21,8 @@ #define No_Standard_RangeError #define No_Standard_OutOfRange +#include + #include #include @@ -96,7 +98,7 @@ GeomAbs_Shape Geom2dAdaptor_Curve::LocalContinuity(const Standard_Real U1, Standard_Integer Nb = myBSplineCurve->NbKnots(); Standard_Integer Index1 = 0; Standard_Integer Index2 = 0; - Standard_Real newFirst, newLast; + Standard_Real newFirst = NAN, newLast = NAN; TColStd_Array1OfReal TK(1,Nb); TColStd_Array1OfInteger TM(1,Nb); myBSplineCurve->Knots(TK); @@ -110,7 +112,7 @@ GeomAbs_Shape Geom2dAdaptor_Curve::LocalContinuity(const Standard_Real U1, } if ( Abs(newLast-TK(Index2))IsPeriodic() && Index1 == Nb ) Index1 = 1; @@ -310,7 +312,7 @@ Standard_Integer Geom2dAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const } Standard_Integer aDegree = myBSplineCurve->Degree(); - Standard_Integer aCont; + Standard_Integer aCont = 0; switch (S) { @@ -384,7 +386,7 @@ void Geom2dAdaptor_Curve::Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shap } Standard_Integer aDegree = myBSplineCurve->Degree(); - Standard_Integer aCont; + Standard_Integer aCont = 0; switch (S) { @@ -770,12 +772,12 @@ Standard_Real Geom2dAdaptor_Curve::Resolution(const Standard_Real Ruv) const { return Ruv / Handle(Geom2d_Ellipse)::DownCast (myCurve)->MajorRadius(); } case GeomAbs_BezierCurve: { - Standard_Real res; + Standard_Real res = NAN; Handle(Geom2d_BezierCurve)::DownCast (myCurve)->Resolution(Ruv,res); return res; } case GeomAbs_BSplineCurve: { - Standard_Real res; + Standard_Real res = NAN; Handle(Geom2d_BSplineCurve)::DownCast (myCurve)->Resolution(Ruv,res); return res; } diff --git a/src/Geom2dConvert/Geom2dConvert.cxx b/src/Geom2dConvert/Geom2dConvert.cxx index a120df013b..24e9b15a2b 100644 --- a/src/Geom2dConvert/Geom2dConvert.cxx +++ b/src/Geom2dConvert/Geom2dConvert.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -85,7 +87,7 @@ const Convert_ConicToBSplineCurve& Convert Array1OfReal Weights (1, NbPoles); Array1OfReal Knots (1, NbKnots); Array1OfInteger Mults (1, NbKnots); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= NbPoles; i++) { Poles (i) = Convert.Pole (i); Weights (i) = Convert.Weight (i); @@ -467,11 +469,11 @@ public: Geom2dConvert_law_evaluator (const Handle(Geom2d_BSplineCurve)& theAncore) : myAncore (theAncore) {} - virtual void Evaluate (const Standard_Integer theDerivativeRequest, + void Evaluate (const Standard_Integer theDerivativeRequest, const Standard_Real* theStartEnd, const Standard_Real theParameter, Standard_Real& theResult, - Standard_Integer& theErrorCode) const + Standard_Integer& theErrorCode) const override { theErrorCode = 0; if (!myAncore.IsNull() && @@ -514,10 +516,10 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu Handle(Geom2d_BSplineCurve) res; Handle(TColStd_HArray1OfReal) resKnots; Handle(TColStd_HArray1OfInteger) resMults; - Standard_Real start_value,end_value; - Standard_Integer resNbPoles,degree, - ii,jj, - aStatus; + Standard_Real start_value = NAN,end_value = NAN; + Standard_Integer resNbPoles = 0,degree = 0, + ii = 0,jj = 0, + aStatus = 0; BS->Knots(BSKnots); BS->Multiplicities(BSMults); @@ -580,8 +582,8 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu static void Pretreatment(TColGeom2d_Array1OfBSplineCurve& tab) -{Standard_Integer i,j; - Standard_Real a; +{Standard_Integer i = 0,j = 0; + Standard_Real a = NAN; for (i=0;i<=(tab.Length()-1);i++){ if (tab(i)->IsRational()) { @@ -634,7 +636,7 @@ static Standard_Boolean NeedToBeTreated(const Handle(Geom2d_BSplineCurve)& BS) static Standard_Boolean Need2DegRepara(const TColGeom2d_Array1OfBSplineCurve& tab) -{Standard_Integer i; +{Standard_Integer i = 0; gp_Vec2d Vec1,Vec2; gp_Pnt2d Pint; Standard_Real Rapport=1.0e0; @@ -657,7 +659,7 @@ static Standard_Boolean Need2DegRepara(const TColGeom2d_Array1OfBSplineCurve& ta static Standard_Integer Indexmin(const TColGeom2d_Array1OfBSplineCurve& tab) { - Standard_Integer i,index=0,degree; + Standard_Integer i = 0,index=0,degree = 0; degree=tab(0)->Degree(); for (i=0;i<=tab.Length()-1;i++) @@ -679,7 +681,7 @@ static void ReorderArrayOfG1(TColGeom2d_Array1OfBSplineCurve& ArrayOfCurves, const Standard_Integer StartIndex, const Standard_Real ClosedTolerance) -{Standard_Integer i; +{Standard_Integer i = 0; TColGeom2d_Array1OfBSplineCurve ArraybisOfCurves(0,ArrayOfCurves.Length()-1); TColStd_Array1OfReal ArraybisOfToler(0,ArrayOfToler.Length()-1); TColStd_Array1OfBoolean tabbisG1(0,tabG1.Length()-1); @@ -764,14 +766,14 @@ static GeomAbs_Shape Continuity(const Handle(Geom2d_Curve)& C1, const Standard_Real ta) { GeomAbs_Shape cont = GeomAbs_C0; - Standard_Integer index1, - index2 ; - Standard_Real tolerance,value ; + Standard_Integer index1 = 0, + index2 = 0 ; + Standard_Real tolerance = NAN,value = NAN ; // Standard_Boolean fini = Standard_False; gp_Vec2d d1,d2; // gp_Dir2d dir1,dir2; gp_Pnt2d point1, point2 ; - Standard_Integer cont1, cont2 ; + Standard_Integer cont1 = 0, cont2 = 0 ; GeomAbs_Shape gcont1 = C1->Continuity(), gcont2 = C2->Continuity(); cont1 = GeomAbsToInteger(gcont1) ; cont2 = GeomAbsToInteger(gcont2) ; @@ -890,11 +892,11 @@ public: memcpy(myPolynomialCoefficient, thePolynomialCoefficient, sizeof(myPolynomialCoefficient)); } - virtual void Evaluate (const Standard_Integer theDerivativeRequest, + void Evaluate (const Standard_Integer theDerivativeRequest, const Standard_Real* /*theStartEnd*/, const Standard_Real theParameter, Standard_Real& theResult, - Standard_Integer& theErrorCode) const + Standard_Integer& theErrorCode) const override { theErrorCode = 0; PLib::EvalPolynomial (theParameter, @@ -907,7 +909,7 @@ public: private: - Standard_Real myPolynomialCoefficient[3]; + Standard_Real myPolynomialCoefficient[3]{}; }; @@ -923,13 +925,13 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf const Standard_Real ClosedTolerance) {Standard_Integer nb_curve=ArrayOfCurves.Length(), - nb_vertexG1, + nb_vertexG1 = 0, nb_group=0, - index=0,i,ii,j,jj, - indexmin, + index=0,i = 0,ii = 0,j = 0,jj = 0, + indexmin = 0, nb_vertex_group0=0; - Standard_Real lambda, //coeff de raccord G1 - First,PreLast=0; + Standard_Real lambda = NAN, //coeff de raccord G1 + First = NAN,PreLast=0; gp_Vec2d Vec1,Vec2; //vecteurs tangents consecutifs gp_Pnt2d Pint; Handle(Geom2d_BSplineCurve) Curve1,Curve2; @@ -986,7 +988,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf ArrayOfConcatenated = new TColGeom2d_HArray1OfBSplineCurve(0,nb_group-1); - Standard_Boolean fusion; + Standard_Boolean fusion = 0; // Standard_Integer k=0; index=0; Pretreatment(ArrayOfCurves); @@ -1022,7 +1024,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf Curve1->D1(Curve1->LastParameter(),Pint,Vec2); ArrayOfCurves(0)->D1(ArrayOfCurves(0)->FirstParameter(),Pint,Vec1); Standard_Real lambda2=Vec1.Magnitude()/Vec2.Magnitude(); - Standard_Real tmax,a,b,c, + Standard_Real tmax = NAN,a = NAN,b = NAN,c = NAN, umin=Curve1->FirstParameter(),umax=Curve1->LastParameter(); tmax=2*lambda*(umax-umin)/(1+lambda*lambda2); a=(lambda*lambda2-1)/(2*lambda*tmax); @@ -1050,7 +1052,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf BSplCLib::KnotSequence(KnotC1,KnotC1Mults,FlatKnots); TColgp_Array1OfPnt2d NewPoles(1,FlatKnots.Length()-(2*Curve1->Degree()+1)); - Standard_Integer aStatus; + Standard_Integer aStatus = 0; TColStd_Array1OfReal Curve1Weights(1,Curve1->NbPoles()); Curve1->Weights(Curve1Weights); for (ii=1;ii<=Curve1->NbPoles();ii++) @@ -1172,13 +1174,13 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf const Standard_Real AngularTolerance) {Standard_Integer nb_curve=ArrayOfCurves.Length(), - nb_vertexG1, + nb_vertexG1 = 0, nb_group=0, - index=0,i,ii,j,jj, - indexmin, + index=0,i = 0,ii = 0,j = 0,jj = 0, + indexmin = 0, nb_vertex_group0=0; - Standard_Real lambda, //coeff de raccord G1 - First,PreLast=0; + Standard_Real lambda = NAN, //coeff de raccord G1 + First = NAN,PreLast=0; gp_Vec2d Vec1,Vec2; //vecteurs tangents consecutifs gp_Pnt2d Pint; Handle(Geom2d_BSplineCurve) Curve1,Curve2; @@ -1242,7 +1244,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf ArrayOfIndices = new TColStd_HArray1OfInteger(0,nb_group); ArrayOfConcatenated = new TColGeom2d_HArray1OfBSplineCurve(0,nb_group-1); - Standard_Boolean fusion; + Standard_Boolean fusion = 0; Standard_Integer k=0; index=0; Pretreatment(ArrayOfCurves); @@ -1287,7 +1289,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf Curve1->D1(Curve1->LastParameter(),Pint,Vec2); ArrayOfCurves(0)->D1(ArrayOfCurves(0)->FirstParameter(),Pint,Vec1); Standard_Real lambda2=Vec1.Magnitude()/Vec2.Magnitude(); - Standard_Real tmax,a,b,c, + Standard_Real tmax = NAN,a = NAN,b = NAN,c = NAN, umin=Curve1->FirstParameter(),umax=Curve1->LastParameter(); tmax=2*lambda*(umax-umin)/(1+lambda*lambda2); a=(lambda*lambda2-1)/(2*lambda*tmax); @@ -1315,7 +1317,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf BSplCLib::KnotSequence(KnotC1,KnotC1Mults,FlatKnots); TColgp_Array1OfPnt2d NewPoles(1, FlatKnots.Length() - (aNewCurveDegree + 1)); - Standard_Integer aStatus; + Standard_Integer aStatus = 0; TColStd_Array1OfReal Curve1Weights(1,Curve1->NbPoles()); Curve1->Weights(Curve1Weights); for (ii=1;ii<=Curve1->NbPoles();ii++) @@ -1414,12 +1416,12 @@ void Geom2dConvert::C0BSplineToC1BSplineCurve(Handle(Geom2d_BSplineCurve)& BS, { TColStd_Array1OfInteger BSMults(1,BS->NbKnots()); TColStd_Array1OfReal BSKnots(1,BS->NbKnots()); - Standard_Integer i,j,nbcurveC1=1; - Standard_Real U1,U2; + Standard_Integer i = 0,j = 0,nbcurveC1=1; + Standard_Real U1 = NAN,U2 = NAN; Standard_Boolean closed_flag = Standard_False ; gp_Pnt2d point1, point2; gp_Vec2d V1,V2; - Standard_Boolean fusion; + Standard_Boolean fusion = 0; BS->Knots(BSKnots); BS->Multiplicities(BSMults); @@ -1509,8 +1511,8 @@ void Geom2dConvert::C0BSplineToArrayOfC1BSplineCurve(const Handle(Geom2d_BSpline { TColStd_Array1OfInteger BSMults(1,BS->NbKnots()); TColStd_Array1OfReal BSKnots(1,BS->NbKnots()); - Standard_Integer i,j,nbcurveC1=1; - Standard_Real U1,U2; + Standard_Integer i = 0,j = 0,nbcurveC1=1; + Standard_Real U1 = NAN,U2 = NAN; Standard_Boolean closed_flag = Standard_False ; gp_Pnt2d point1, point2; gp_Vec2d V1,V2; diff --git a/src/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx b/src/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx index 4dd6dfc96d..01576259b0 100644 --- a/src/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx +++ b/src/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx @@ -14,6 +14,8 @@ // performance of this software, and specifically disclaims any responsibility // for any damages, special or consequential, connected with its use. +#include + #include #include @@ -182,7 +184,7 @@ Standard_Boolean Geom2dConvert_ApproxArcsSegments::makeArc const Handle(Geom2d_Circle) Circ = new Geom2d_Circle(aCir); //calculation parameters first and last points of arc. - Standard_Real anAlpha1, anAlpha2; + Standard_Real anAlpha1 = NAN, anAlpha2 = NAN; if (isFirst) { anAlpha1 = ElCLib::Parameter(aCir, aP1); anAlpha2 = ElCLib::Parameter(aCir, aP2); @@ -290,7 +292,7 @@ Standard_Boolean Geom2dConvert_ApproxArcsSegments::makeFreeform() TColGeom2d_SequenceOfCurve aSeqLinearParts; Standard_Boolean isDone (Standard_True); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i < seqParamPoints.Length(); i += 2) { Handle(Geom2d_Curve) aLineCurve; @@ -372,7 +374,7 @@ Standard_Boolean Geom2dConvert_ApproxArcsSegments::makeFreeform() void Geom2dConvert_ApproxArcsSegments::getLinearParts (Geom2dConvert_SequenceOfPPoint& theSeqPar) { - Standard_Integer i; + Standard_Integer i = 0; // Fill the sequences with values along the curve mySeqParams.Clear(); Adaptor2d_Curve2d& myCurveMut = const_cast(myCurve); diff --git a/src/Geom2dConvert/Geom2dConvert_ApproxCurve.cxx b/src/Geom2dConvert/Geom2dConvert_ApproxCurve.cxx index 54831879a2..a3f1f4d3c1 100644 --- a/src/Geom2dConvert/Geom2dConvert_ApproxCurve.cxx +++ b/src/Geom2dConvert/Geom2dConvert_ApproxCurve.cxx @@ -39,16 +39,16 @@ class Geom2dConvert_ApproxCurve_Eval : public AdvApprox_EvaluatorFunction Standard_Real First, Standard_Real Last) : fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Adaptor2d_Curve2d) fonct; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void Geom2dConvert_ApproxCurve_Eval::Evaluate (Standard_Integer *Dimension, diff --git a/src/Geom2dConvert/Geom2dConvert_ApproxCurve.hxx b/src/Geom2dConvert/Geom2dConvert_ApproxCurve.hxx index 7d51b860ae..3f7b7bd03f 100644 --- a/src/Geom2dConvert/Geom2dConvert_ApproxCurve.hxx +++ b/src/Geom2dConvert/Geom2dConvert_ApproxCurve.hxx @@ -88,10 +88,10 @@ private: Standard_EXPORT void Approximate (const Handle(Adaptor2d_Curve2d)& theCurve, const Standard_Real theTol3d, const GeomAbs_Shape theOrder, const Standard_Integer theMaxSegments, const Standard_Integer theMaxDegree); - Standard_Boolean myIsDone; - Standard_Boolean myHasResult; + Standard_Boolean myIsDone{}; + Standard_Boolean myHasResult{}; Handle(Geom2d_BSplineCurve) myBSplCurve; - Standard_Real myMaxError; + Standard_Real myMaxError{}; }; diff --git a/src/Geom2dConvert/Geom2dConvert_BSplineCurveToBezierCurve.cxx b/src/Geom2dConvert/Geom2dConvert_BSplineCurveToBezierCurve.cxx index 4c9a94e089..ab226ef593 100644 --- a/src/Geom2dConvert/Geom2dConvert_BSplineCurveToBezierCurve.cxx +++ b/src/Geom2dConvert/Geom2dConvert_BSplineCurveToBezierCurve.cxx @@ -60,7 +60,7 @@ Geom2dConvert_BSplineCurveToBezierCurve::Geom2dConvert_BSplineCurveToBezierCurve Standard_Real Uf = U1, Ul = U2; Standard_Real PTol = ParametricTolerance/2 ; - Standard_Integer I1, I2; + Standard_Integer I1 = 0, I2 = 0; myCurve = Handle(Geom2d_BSplineCurve)::DownCast(BasisCurve->Copy()); if(myCurve->IsPeriodic()) myCurve->SetNotPeriodic(); @@ -138,7 +138,7 @@ void Geom2dConvert_BSplineCurveToBezierCurve::Arcs void Geom2dConvert_BSplineCurveToBezierCurve::Knots (TColStd_Array1OfReal& TKnots) const { - Standard_Integer ii, kk; + Standard_Integer ii = 0, kk = 0; for (ii = 1, kk = TKnots.Lower(); ii <=myCurve->NbKnots(); ii++, kk++) TKnots(kk) = myCurve->Knot(ii); diff --git a/src/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx b/src/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx index f70189dd0c..4988460355 100644 --- a/src/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx +++ b/src/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -150,9 +152,9 @@ void Geom2dConvert_CompCurveToBSplineCurve::Add( if (SecondCurve->Degree() < Deg) { SecondCurve->IncreaseDegree(Deg); } // Declarationd - Standard_Real L1, L2, U_de_raccord; - Standard_Integer ii, jj; - Standard_Real Ratio=1, Ratio1, Ratio2, Delta1, Delta2; + Standard_Real L1 = NAN, L2 = NAN, U_de_raccord = NAN; + Standard_Integer ii = 0, jj = 0; + Standard_Real Ratio=1, Ratio1 = NAN, Ratio2 = NAN, Delta1 = NAN, Delta2 = NAN; Standard_Integer NbP1 = FirstCurve->NbPoles(), NbP2 = SecondCurve->NbPoles(); Standard_Integer NbK1 = FirstCurve->NbKnots(), NbK2 = SecondCurve->NbKnots(); TColStd_Array1OfReal Noeuds (1, NbK1+NbK2-1); diff --git a/src/Geom2dEvaluator/Geom2dEvaluator_OffsetCurve.cxx b/src/Geom2dEvaluator/Geom2dEvaluator_OffsetCurve.cxx index 6cbe24e2f4..d9ea697e98 100644 --- a/src/Geom2dEvaluator/Geom2dEvaluator_OffsetCurve.cxx +++ b/src/Geom2dEvaluator/Geom2dEvaluator_OffsetCurve.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -211,8 +213,8 @@ Standard_Boolean Geom2dEvaluator_OffsetCurve::AdjustDerivative( static const Standard_Integer aMaxDerivOrder = 3; Standard_Boolean isDirectionChange = Standard_False; - Standard_Real anUinfium; - Standard_Real anUsupremum; + Standard_Real anUinfium = NAN; + Standard_Real anUsupremum = NAN; if (!myBaseAdaptor.IsNull()) { anUinfium = myBaseAdaptor->FirstParameter(); @@ -225,7 +227,7 @@ Standard_Boolean Geom2dEvaluator_OffsetCurve::AdjustDerivative( } static const Standard_Real DivisionFactor = 1.e-3; - Standard_Real du; + Standard_Real du = NAN; if ((anUsupremum >= RealLast()) || (anUinfium <= RealFirst())) du = 0.0; else @@ -242,7 +244,7 @@ Standard_Boolean Geom2dEvaluator_OffsetCurve::AdjustDerivative( V = BaseDN(theU, ++anIndex); } while ((V.SquareMagnitude() <= aTol) && anIndex < aMaxDerivOrder); - Standard_Real u; + Standard_Real u = NAN; if (theU - anUinfium < aDelta) u = theU + aDelta; diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx index de5dc5f3a7..179e7f8e61 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOn.cxx @@ -42,7 +42,7 @@ Geom2dGcc_Circ2d2TanOn:: const Standard_Real ParamOn ): WellDone(Standard_False), cirsol(1,8) , - qualifier1(1,8), + NbrSol(0), qualifier1(1,8), qualifier2(1,8), TheSame1(1,8) , TheSame2(1,8) , @@ -53,23 +53,23 @@ Geom2dGcc_Circ2d2TanOn:: par2sol(1,8) , pararg1(1,8) , pararg2(1,8) , - parcen3(1,8) + parcen3(1,8), Invert(Standard_False) { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); Geom2dAdaptor_Curve C2 = Qualified2.Qualified(); GeomAbs_CurveType Type1 = C1.GetType(); GeomAbs_CurveType Type2 = C2.GetType(); GeomAbs_CurveType Type3 = OnCurve.GetType(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); - Handle(Geom2d_Curve) CC2 = C2.Curve(); - Handle(Geom2d_Curve) Con = OnCurve.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC2 = C2.Curve(); + const Handle(Geom2d_Curve)& Con = OnCurve.Curve(); //============================================================================= // Appel a GccAna. + //============================================================================= - Invert = Standard_False; - NbrSol = 0; + + if ((Type1 == GeomAbs_Line || Type1 == GeomAbs_Circle) && (Type2 == GeomAbs_Line || Type2 == GeomAbs_Circle)) { if (Type3 == GeomAbs_Line || Type3 == GeomAbs_Circle) { @@ -376,7 +376,7 @@ Geom2dGcc_Circ2d2TanOn:: const Standard_Real ParamOn ): WellDone(Standard_False), cirsol(1,8) , - qualifier1(1,8), + NbrSol(0), qualifier1(1,8), qualifier2(1,8), TheSame1(1,8) , TheSame2(1,8) , @@ -387,20 +387,20 @@ Geom2dGcc_Circ2d2TanOn:: par2sol(1,8) , pararg1(1,8) , pararg2(1,8) , - parcen3(1,8) + parcen3(1,8), Invert(Standard_False) { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); GeomAbs_CurveType Type1 = C1.GetType(); GeomAbs_CurveType Type3 = OnCurve.GetType(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); - Handle(Geom2d_Curve) Con = OnCurve.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& Con = OnCurve.Curve(); //============================================================================= // Appel a GccAna. + //============================================================================= - Invert = Standard_False; - NbrSol = 0; + + if (Type1 == GeomAbs_Line || Type1 == GeomAbs_Circle) { if (Type3 == GeomAbs_Line || Type3 == GeomAbs_Circle) { gp_Pnt2d pnt(Point->Pnt2d()); @@ -567,7 +567,7 @@ Geom2dGcc_Circ2d2TanOn:: const Standard_Real Tolerance ): WellDone(Standard_False), cirsol(1,8) , - qualifier1(1,8), + NbrSol(0), qualifier1(1,8), qualifier2(1,8), TheSame1(1,8) , TheSame2(1,8) , @@ -578,17 +578,17 @@ Geom2dGcc_Circ2d2TanOn:: par2sol(1,8) , pararg1(1,8) , pararg2(1,8) , - parcen3(1,8) + parcen3(1,8), Invert(Standard_False) { GeomAbs_CurveType Type3 = OnCurve.GetType(); - Handle(Geom2d_Curve) Con = OnCurve.Curve(); + const Handle(Geom2d_Curve)& Con = OnCurve.Curve(); //============================================================================= // Appel a GccAna. + //============================================================================= - Invert = Standard_False; - NbrSol = 0; + + if (Type3 == GeomAbs_Line || Type3 == GeomAbs_Circle) { gp_Pnt2d pnt1(Point1->Pnt2d()); gp_Pnt2d pnt2(Point2->Pnt2d()); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx index d42931436e..5f47869261 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx @@ -24,6 +24,8 @@ // Courbes. + //========================================================================= +#include + #include #include #include @@ -52,7 +54,7 @@ Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedCirc& Qualified1 , const GccEnt_QualifiedCirc& Qualified2 , const Geom2dAdaptor_Curve& OnCurv , const Standard_Real Tolerance ): - cirsol(1, aNbSolMAX) , + WellDone(Standard_False), NbrSol(0), cirsol(1, aNbSolMAX) , qualifier1(1, aNbSolMAX), qualifier2(1, aNbSolMAX), TheSame1(1, aNbSolMAX) , @@ -66,13 +68,13 @@ Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedCirc& Qualified1 , pararg2(1, aNbSolMAX) , parcen3(1, aNbSolMAX) { - WellDone = Standard_False; + Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; Standard_Real Tol = Abs(Tolerance); - NbrSol = 0; + TColStd_Array1OfReal Rbid(1,2); TColStd_Array1OfReal RBid(1,2); TColStd_Array1OfReal Radius(1,2); @@ -277,7 +279,7 @@ Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedCirc& Qualified1 , const GccEnt_QualifiedLin& Qualified2 , const Geom2dAdaptor_Curve& OnCurv , const Standard_Real Tolerance ): -cirsol(1, aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1, aNbSolMAX) , qualifier1(1, aNbSolMAX), qualifier2(1, aNbSolMAX), TheSame1(1, aNbSolMAX) , @@ -292,14 +294,14 @@ pararg2(1, aNbSolMAX) , parcen3(1, aNbSolMAX) { - WellDone = Standard_False; + Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; - NbrSol = 0; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; + Standard_Real Tol = Abs(Tolerance); - Standard_Real Radius; + Standard_Real Radius = NAN; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || @@ -455,7 +457,7 @@ Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedLin& Qualified1 , const GccEnt_QualifiedLin& Qualified2 , const Geom2dAdaptor_Curve& OnCurv , const Standard_Real Tolerance ): -cirsol(1, aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1, aNbSolMAX) , qualifier1(1, aNbSolMAX), qualifier2(1, aNbSolMAX), TheSame1(1, aNbSolMAX) , @@ -470,12 +472,12 @@ pararg2(1, aNbSolMAX) , parcen3(1, aNbSolMAX) { - WellDone = Standard_False; + Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; - NbrSol = 0; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || @@ -610,7 +612,7 @@ Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedCirc& Qualified1 , const gp_Pnt2d& Point2 , const Geom2dAdaptor_Curve& OnCurv , const Standard_Real Tolerance ): -cirsol(1, aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1, aNbSolMAX) , qualifier1(1, aNbSolMAX), qualifier2(1, aNbSolMAX), TheSame1(1, aNbSolMAX) , @@ -625,19 +627,19 @@ pararg2(1, aNbSolMAX) , parcen3(1, aNbSolMAX) { - WellDone = Standard_False; + Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; - NbrSol = 0; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); return; } Standard_Real Tol = Abs(Tolerance); - Standard_Real Radius; + Standard_Real Radius = NAN; gp_Dir2d dirx(1.,0.); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); @@ -772,7 +774,7 @@ Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedLin& Qualified1 , const gp_Pnt2d& Point2 , const Geom2dAdaptor_Curve& OnCurv , const Standard_Real Tolerance ): -cirsol(1, aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1, aNbSolMAX) , qualifier1(1, aNbSolMAX), qualifier2(1, aNbSolMAX), TheSame1(1, aNbSolMAX) , @@ -787,13 +789,13 @@ pararg2(1, aNbSolMAX) , parcen3(1, aNbSolMAX) { - WellDone = Standard_False; + Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; Standard_Real Tol = Abs(Tolerance); - NbrSol = 0; + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -909,7 +911,7 @@ Geom2dGcc_Circ2d2TanOnGeo (const gp_Pnt2d& Point1 , const gp_Pnt2d& Point2 , const Geom2dAdaptor_Curve& OnCurv , const Standard_Real Tolerance ): -cirsol(1, aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1, aNbSolMAX) , qualifier1(1, aNbSolMAX), qualifier2(1, aNbSolMAX), TheSame1(1, aNbSolMAX) , @@ -924,13 +926,13 @@ pararg2(1, aNbSolMAX) , parcen3(1, aNbSolMAX) { - WellDone = Standard_False; + Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; Standard_Real Tol = Abs(Tolerance); - NbrSol = 0; + gp_Dir2d dirx(1.,0.); GccAna_Pnt2dBisec Bis(Point1,Point2); if (Bis.IsDone()) { diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx index 2b608c7575..70762e1c16 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx @@ -24,6 +24,8 @@ // Courbes. + //========================================================================= +#include + #include #include #include @@ -48,20 +50,20 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedLin& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolang ) { + const Standard_Real Tolang ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + + + + + + + - WellDone = Standard_False; + Standard_Real Tol = Abs(Tolang); - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -115,7 +117,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedLin& Qualified1 , gp_Vec2d Vec1(point1,point3new); gp_Vec2d Vec2(point2,point3new); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle2; + Standard_Real angle2 = NAN; if (normevec2 >= gp::Resolution() && normetan2 >= gp::Resolution()) { angle2 = Vec2.Angle(Tan2); } @@ -153,18 +155,18 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -224,7 +226,7 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , gp_Vec2d Vec2(point2,point3new); Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle1,angle2; + Standard_Real angle1 = NAN,angle2 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { angle1 = Vec1.Angle(Tan1); } @@ -264,18 +266,18 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , const gp_Lin2d& OnLine , const Standard_Real Param1 , const Standard_Real Param2 , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -319,7 +321,7 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , Standard_Real normetan1 = Tan1.Magnitude(); gp_Vec2d Vec1(point1new,point3new); Standard_Real normevec1 = Vec1.Magnitude(); - Standard_Real angle1; + Standard_Real angle1 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { angle1 = Vec1.Angle(Tan1); } @@ -351,18 +353,18 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedCirc& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -422,7 +424,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedCirc& Qualified1 , gp_Vec2d Vec1(point1,point3); gp_Vec2d Vec2(point2,point3); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle2; + Standard_Real angle2 = NAN; if (normevec2 >= gp::Resolution() && normetan2 >= gp::Resolution()) { angle2 = Vec2.Angle(Tan2); } @@ -461,18 +463,18 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedCirc& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -530,7 +532,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedCirc& Qualified1 , gp_Vec2d Vec1(point1,point3); gp_Vec2d Vec2(point2,point3); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle2; + Standard_Real angle2 = NAN; if (normevec2 >= gp::Resolution() && normetan2 >= gp::Resolution()) { angle2 = Vec2.Angle(Tan2); } @@ -569,18 +571,18 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedLin& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -637,7 +639,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedLin& Qualified1 , gp_Vec2d Vec1(point1new,point3); gp_Vec2d Vec2(point2new,point3); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle2; + Standard_Real angle2 = NAN; if (normevec2 >= gp::Resolution() && normetan2 >= gp::Resolution()) { angle2 = Vec2.Angle(Tan2); } @@ -675,18 +677,18 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -747,7 +749,7 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , gp_Vec2d Vec2(point2,point3); Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle1,angle2; + Standard_Real angle1 = NAN,angle2 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { angle1 = Vec1.Angle(Tan1); } @@ -787,18 +789,18 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , const gp_Circ2d& OnCirc , const Standard_Real Param1 , const Standard_Real Param2 , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -842,7 +844,7 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , Standard_Real normetan1 = Tan1.Magnitude(); gp_Vec2d Vec1(point1new,point3new); Standard_Real normevec1 = Vec1.Magnitude(); - Standard_Real angle1; + Standard_Real angle1 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { angle1 = Vec1.Angle(Tan1); } @@ -874,19 +876,19 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; + Standard_Real Tol = Abs(Tolerance); - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -940,7 +942,7 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , gp_Vec2d Vec2(point2,point3); Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle1,angle2; + Standard_Real angle1 = NAN,angle2 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { angle1 = Vec1.Angle(Tan1); } @@ -981,19 +983,19 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedCirc& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real ParamOn , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -1047,7 +1049,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedCirc& Qualified1 , gp_Vec2d Vec1(point1.XY(),point3.XY()); gp_Vec2d Vec2(point2.XY(),point3.XY()); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle2; + Standard_Real angle2 = NAN; if (normevec2 >= gp::Resolution() && normetan2 >= gp::Resolution()) { angle2 = Vec2.Angle(Tan2); } @@ -1086,18 +1088,18 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedLin& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real ParamOn , - const Standard_Real Tolerance ) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -1150,7 +1152,7 @@ Geom2dGcc_Circ2d2TanOnIter (const GccEnt_QualifiedLin& Qualified1 , gp_Vec2d Vec1(point1,point3); gp_Vec2d Vec2(point2,point3); Standard_Real normevec2 = Vec2.Magnitude(); - Standard_Real angle2; + Standard_Real angle2 = NAN; if (normevec2 >= gp::Resolution() && normetan2 >= gp::Resolution()) { angle2 = Vec2.Angle(Tan2); } @@ -1187,19 +1189,19 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , const Geom2dAdaptor_Curve& OnCurv , const Standard_Real Param1 , const Standard_Real ParamOn , - const Standard_Real Tolerance ) + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), par1sol(0.), par2sol(0.), pararg1(0.), pararg2(0.), parcen3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - par1sol = 0.; - par2sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - parcen3 = 0.; + + + + + + + - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -1243,7 +1245,7 @@ Geom2dGcc_Circ2d2TanOnIter (const Geom2dGcc_QCurve& Qualified1 , Standard_Real normetan1 = Tan1.Magnitude(); gp_Vec2d Vec1(point1,point3); Standard_Real normevec1 = Vec1.Magnitude(); - Standard_Real angle1; + Standard_Real angle1 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { angle1 = Vec1.Angle(Tan1); } diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx index 55336cd687..961914a5a1 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx @@ -70,8 +70,8 @@ Geom2dGcc_Circ2d2TanRad:: else { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); Geom2dAdaptor_Curve C2 = Qualified2.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); - Handle(Geom2d_Curve) CC2 = C2.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC2 = C2.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); GeomAbs_CurveType Type2 = C2.GetType(); @@ -276,7 +276,7 @@ Geom2dGcc_Circ2d2TanRad:: if (Radius < 0.) { throw Standard_NegativeValue(); } else { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); //============================================================================= diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx index 379a9d767d..61595f9965 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -59,7 +61,7 @@ Geom2dGcc_Circ2d2TanRadGeo (const GccEnt_QualifiedLin& Qualified1, // initialisation des champs. + //======================================================================== -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX), qualifier2(1,aNbSolMAX), TheSame1(1,aNbSolMAX) , @@ -79,15 +81,15 @@ pararg2(1,aNbSolMAX) Standard_Real Tol = Abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; gp_Dir2d dirx(1.,0.); TColStd_Array1OfReal cote1(1,2); TColStd_Array1OfReal cote2(1,2); Standard_Integer nbrcote1=0; Standard_Integer nbrcote2=0; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -248,7 +250,7 @@ Geom2dGcc_Circ2d2TanRadGeo (const GccEnt_QualifiedCirc& Qualified1, // initialisation des champs. + //======================================================================== -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX), qualifier2(1,aNbSolMAX), TheSame1(1,aNbSolMAX) , @@ -268,15 +270,15 @@ pararg2(1,aNbSolMAX) Standard_Real Tol = Abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; gp_Dir2d dirx(1.,0.); TColStd_Array1OfReal cote1(1,2); TColStd_Array1OfReal cote2(1,2); Standard_Integer nbrcote1=0; Standard_Integer nbrcote2=0; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -442,7 +444,7 @@ Geom2dGcc_Circ2d2TanRadGeo (const Geom2dGcc_QCurve& Qualified1, // initialisation des champs. + //======================================================================== -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX), qualifier2(1,aNbSolMAX), TheSame1(1,aNbSolMAX) , @@ -462,13 +464,13 @@ pararg2(1,aNbSolMAX) Standard_Real Tol = Abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; gp_Dir2d dirx(1.,0.); TColStd_Array1OfReal cote1(1,2); Standard_Integer nbrcote1=0; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -722,7 +724,7 @@ Geom2dGcc_Circ2d2TanRadGeo (const Geom2dGcc_QCurve& Qualified1, // initialisation des champs. + //======================================================================== -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX), qualifier2(1,aNbSolMAX), TheSame1(1,aNbSolMAX) , @@ -749,8 +751,8 @@ pararg2(1,aNbSolMAX) TColStd_Array1OfReal cote2(1,2); Standard_Integer nbrcote1=0; Standard_Integer nbrcote2=0; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d3Tan.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d3Tan.cxx index 666a977b0c..8a91bb4b1b 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d3Tan.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d3Tan.cxx @@ -39,7 +39,7 @@ Geom2dGcc_Circ2d3Tan:: const Standard_Real Param2 , const Standard_Real Param3 ): cirsol(1,16) , - qualifier1(1,16), + NbrSol(0), qualifier1(1,16), qualifier2(1,16), qualifier3(1,16), TheSame1(1,16) , @@ -58,9 +58,9 @@ Geom2dGcc_Circ2d3Tan:: Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); Geom2dAdaptor_Curve C2 = Qualified2.Qualified(); Geom2dAdaptor_Curve C3 = Qualified3.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); - Handle(Geom2d_Curve) CC2 = C2.Curve(); - Handle(Geom2d_Curve) CC3 = C3.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC2 = C2.Curve(); + const Handle(Geom2d_Curve)& CC3 = C3.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); GeomAbs_CurveType Type2 = C2.GetType(); GeomAbs_CurveType Type3 = C3.GetType(); @@ -69,7 +69,7 @@ Geom2dGcc_Circ2d3Tan:: // Appel a GccAna. + //============================================================================= - NbrSol = 0; + if ((Type1 == GeomAbs_Line || Type1 == GeomAbs_Circle) && (Type2 == GeomAbs_Line || Type2 == GeomAbs_Circle) && (Type3 == GeomAbs_Line || Type3 == GeomAbs_Circle)) { @@ -248,7 +248,7 @@ Geom2dGcc_Circ2d3Tan:: const Standard_Real Param1 , const Standard_Real Param2 ): cirsol(1,20) , - qualifier1(1,20), + NbrSol(0), qualifier1(1,20), qualifier2(1,20), qualifier3(1,20), TheSame1(1,20) , @@ -266,8 +266,8 @@ Geom2dGcc_Circ2d3Tan:: { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); Geom2dAdaptor_Curve C2 = Qualified2.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); - Handle(Geom2d_Curve) CC2 = C2.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC2 = C2.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); GeomAbs_CurveType Type2 = C2.GetType(); @@ -275,7 +275,7 @@ Geom2dGcc_Circ2d3Tan:: // Appel a GccAna. + //============================================================================= - NbrSol = 0; + if ((Type1 == GeomAbs_Line || Type1 == GeomAbs_Circle) && (Type2 == GeomAbs_Line || Type2 == GeomAbs_Circle)) { if (Type1 == GeomAbs_Circle) { @@ -366,7 +366,7 @@ Geom2dGcc_Circ2d3Tan:: const Standard_Real Tolerance , const Standard_Real Param1 ): cirsol(1,16) , - qualifier1(1,16), + NbrSol(0), qualifier1(1,16), qualifier2(1,16), qualifier3(1,16), TheSame1(1,16) , @@ -383,14 +383,14 @@ Geom2dGcc_Circ2d3Tan:: pararg3(1,16) { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); //============================================================================= // Appel a GccAna. + //============================================================================= - NbrSol = 0; + if ((Type1 == GeomAbs_Line || Type1 == GeomAbs_Circle)) { if (Type1 == GeomAbs_Circle) { Handle(Geom2d_Circle) CCC1 = Handle(Geom2d_Circle)::DownCast(CC1); @@ -445,7 +445,7 @@ Geom2dGcc_Circ2d3Tan:: const Handle(Geom2d_Point)& Point3 , const Standard_Real Tolerance ): cirsol(1,2) , - qualifier1(1,2), + NbrSol(0), qualifier1(1,2), qualifier2(1,2), qualifier3(1,2), TheSame1(1,2) , @@ -466,7 +466,7 @@ Geom2dGcc_Circ2d3Tan:: // Appel a GccAna. + //============================================================================= - NbrSol = 0; + GccAna_Circ2d3Tan Circ(Point1->Pnt2d(),Point2->Pnt2d(),Point3->Pnt2d(), Tolerance); WellDone = Circ.IsDone(); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx index e6a575da70..bd1f48e4fb 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx @@ -24,6 +24,8 @@ // Courbes. + //========================================================================= +#include + #include #include #include @@ -48,23 +50,23 @@ Geom2dGcc_Circ2d3TanIter (const Geom2dGcc_QCurve& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -117,7 +119,7 @@ Geom2dGcc_Circ2d3TanIter (const Geom2dGcc_QCurve& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -175,23 +177,23 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedCirc& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -250,7 +252,7 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedCirc& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -307,23 +309,23 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedCirc& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -384,7 +386,7 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedCirc& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -442,23 +444,23 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedLin& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -519,7 +521,7 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedLin& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -577,23 +579,23 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedLin& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ){ + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier){ - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || @@ -655,7 +657,7 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedLin& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -705,23 +707,23 @@ Geom2dGcc_Circ2d3TanIter (const Geom2dGcc_QCurve& Qualified1 , const gp_Pnt2d& Point3 , const Standard_Real Param1 , const Standard_Real Param2 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -773,7 +775,7 @@ Geom2dGcc_Circ2d3TanIter (const Geom2dGcc_QCurve& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -823,23 +825,23 @@ Geom2dGcc_Circ2d3TanIter (const Geom2dGcc_QCurve& Qualified1 , const gp_Pnt2d& Point2 , const gp_Pnt2d& Point3 , const Standard_Real Param1 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -890,7 +892,7 @@ Geom2dGcc_Circ2d3TanIter (const Geom2dGcc_QCurve& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -935,23 +937,23 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedLin& Qualified1 , const gp_Pnt2d& Point3 , const Standard_Real Param1 , const Standard_Real Param2 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -1007,7 +1009,7 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedLin& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -1057,23 +1059,23 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedCirc& Qualified1 , const Standard_Real Param1 , const Standard_Real Param2 , const Standard_Real Param3 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || @@ -1131,7 +1133,7 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedCirc& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } @@ -1189,23 +1191,23 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedCirc& Qualified1 , const gp_Pnt2d& Point3 , const Standard_Real Param1 , const Standard_Real Param2 , - const Standard_Real Tolerance ) { + const Standard_Real Tolerance ) : TheSame1(Standard_False), TheSame2(Standard_False), TheSame3(Standard_False), par1sol(0.), par2sol(0.), par3sol(0.), pararg1(0.), pararg2(0.), pararg3(0.), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier), qualifier3(GccEnt_noqualifier) { - TheSame1 = Standard_False; - TheSame2 = Standard_False; - TheSame3 = Standard_False; - par1sol = 0.; - par2sol = 0.; - par3sol = 0.; - pararg1 = 0.; - pararg2 = 0.; - pararg3 = 0.; + + + + + + + + + Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; - qualifier3 = GccEnt_noqualifier; + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -1259,7 +1261,7 @@ Geom2dGcc_Circ2d3TanIter (const GccEnt_QualifiedCirc& Qualified1 , Standard_Real normevec1 = Vec1.Magnitude(); Standard_Real normevec2 = Vec2.Magnitude(); Standard_Real normevec3 = Vec3.Magnitude(); - Standard_Real dot1,dot2,dot3; + Standard_Real dot1 = NAN,dot2 = NAN,dot3 = NAN; if (normevec1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1); } diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2dTanCen.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2dTanCen.cxx index 5995429e38..58e063afc6 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2dTanCen.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2dTanCen.cxx @@ -34,7 +34,7 @@ Geom2dGcc_Circ2dTanCen:: Geom2dGcc_Circ2dTanCen (const Geom2dGcc_QualifiedCurve& Qualified1 , const Handle(Geom2d_Point)& PCenter , const Standard_Real Tolerance ): - cirsol(1,2) , + NbrSol(0), cirsol(1,2) , qualifier1(1,2), TheSame1(1,2) , pnttg1sol(1,2), @@ -42,7 +42,7 @@ Geom2dGcc_Circ2dTanCen:: pararg1(1,2) { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); //============================================================================= @@ -50,7 +50,7 @@ Geom2dGcc_Circ2dTanCen:: //============================================================================= gp_Pnt2d pcenter(PCenter->Pnt2d()); - NbrSol = 0; + if ((Type1 == GeomAbs_Line || Type1 == GeomAbs_Circle)) { if (Type1 == GeomAbs_Circle) { Handle(Geom2d_Circle) CCC1 = Handle(Geom2d_Circle)::DownCast(CC1); diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx index 44d8700e23..b34755f923 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -59,7 +61,7 @@ Geom2dGcc_Circ2dTanCenGeo (const Geom2dGcc_QCurve& Qualified1, Standard_Integer i = 1; Standard_Integer nbsol = 0; gp_Dir2d dirx(1.0,0.0); - Standard_Real thePar; + Standard_Real thePar = NAN; Geom2dAdaptor_Curve curve = Qualified1.Qualified(); Extrema_ExtPC2d distmin(Pcenter, curve, Geom2dGcc_CurveTool::FirstParameter(curve), Geom2dGcc_CurveTool::LastParameter(curve), Tol); @@ -89,7 +91,7 @@ Geom2dGcc_Circ2dTanCenGeo (const Geom2dGcc_QCurve& Qualified1, Standard_Real normetan1 = Tan1.Magnitude(); gp_Vec2d Vec1(point1,Pcenter); Standard_Real normevec1 = Vec1.Magnitude(); - Standard_Real dot1; + Standard_Real dot1 = NAN; if (normevec1 >= gp::Resolution() && normetan1 >= gp::Resolution()) { dot1 = Vec1.Dot(Tan1)/(normevec1*normetan1); } diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRad.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRad.cxx index a95e2bf171..9b5921f16b 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRad.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRad.cxx @@ -53,8 +53,8 @@ Geom2dGcc_Circ2dTanOnRad:: Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); GeomAbs_CurveType Type1 = C1.GetType(); GeomAbs_CurveType Type2 = OnCurve.GetType(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); - Handle(Geom2d_Curve) Con = OnCurve.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& Con = OnCurve.Curve(); //============================================================================= // Appel a GccAna. + @@ -163,7 +163,7 @@ Geom2dGcc_Circ2dTanOnRad:: else { gp_Pnt2d point1(Point1->Pnt2d()); GeomAbs_CurveType Type2 = OnCurve.GetType(); - Handle(Geom2d_Curve) Con = OnCurve.Curve(); + const Handle(Geom2d_Curve)& Con = OnCurve.Curve(); //============================================================================= // Appel a GccAna. + diff --git a/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx b/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx index cc18fc187d..3146128023 100644 --- a/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx @@ -21,6 +21,8 @@ // de rayon donne : Radius. + //======================================================================== +#include + #include #include #include @@ -69,7 +71,7 @@ Geom2dGcc_Circ2dTanOnRadGeo (const Geom2dGcc_QCurve& Qualified1, // Initialisation des champs. + //========================================================================= -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX) , TheSame1(1,aNbSolMAX) , pnttg1sol(1,aNbSolMAX) , @@ -87,10 +89,10 @@ parcen3(1,aNbSolMAX) Standard_Real Tol = Abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; - WellDone = Standard_False; - NbrSol = 0; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -179,7 +181,7 @@ Geom2dGcc_Circ2dTanOnRadGeo (const Geom2dGcc_QCurve& Qualified1, // Initialisation des champs. + //========================================================================= -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX) , TheSame1(1,aNbSolMAX) , pnttg1sol(1,aNbSolMAX) , @@ -196,12 +198,12 @@ parcen3(1,aNbSolMAX) gp_Dir2d dirx(1.0,0.0); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; Standard_Real Tol = Abs(Tolerance); Standard_Integer nbrcote1=0; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -293,7 +295,7 @@ Geom2dGcc_Circ2dTanOnRadGeo (const GccEnt_QualifiedCirc& Qualified1, // Initialisation des champs. + //========================================================================= -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX) , TheSame1(1,aNbSolMAX) , pnttg1sol(1,aNbSolMAX) , @@ -310,12 +312,12 @@ parcen3(1,aNbSolMAX) gp_Dir2d dirx(1.0,0.0); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; Standard_Real Tol = Abs(Tolerance); Standard_Integer nbrcote1=0; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -417,7 +419,7 @@ Geom2dGcc_Circ2dTanOnRadGeo (const GccEnt_QualifiedLin& Qualified1, // Initialisation des champs. + //========================================================================= -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX) , TheSame1(1,aNbSolMAX) , pnttg1sol(1,aNbSolMAX) , @@ -434,11 +436,11 @@ parcen3(1,aNbSolMAX) gp_Dir2d dirx(1.0,0.0); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -538,7 +540,7 @@ Geom2dGcc_Circ2dTanOnRadGeo (const Geom2dGcc_QCurve& Qualified1, // Initialisation des champs. + //========================================================================= -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX) , TheSame1(1,aNbSolMAX) , pnttg1sol(1,aNbSolMAX) , @@ -555,12 +557,12 @@ parcen3(1,aNbSolMAX) gp_Dir2d dirx(1.0,0.0); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; Standard_Real Tol = Abs(Tolerance); Standard_Integer nbrcote1=0; - WellDone = Standard_False; - NbrSol = 0; + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -655,7 +657,7 @@ Geom2dGcc_Circ2dTanOnRadGeo (const gp_Pnt2d& Point1 , // Initialisation des champs. + //========================================================================= -cirsol(1,aNbSolMAX) , +WellDone(Standard_False), NbrSol(0), cirsol(1,aNbSolMAX) , qualifier1(1,aNbSolMAX) , TheSame1(1,aNbSolMAX) , pnttg1sol(1,aNbSolMAX) , @@ -672,11 +674,11 @@ parcen3(1,aNbSolMAX) gp_Dir2d dirx(1.0,0.0); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; - Standard_Real firstparam; - Standard_Real lastparam; + Standard_Real firstparam = NAN; + Standard_Real lastparam = NAN; Standard_Real Tol = Abs(Tolerance); - WellDone = Standard_False; - NbrSol = 0; + + if (Radius < 0.0) { throw Standard_NegativeValue(); diff --git a/src/Geom2dGcc/Geom2dGcc_FunctionTanCirCu.cxx b/src/Geom2dGcc/Geom2dGcc_FunctionTanCirCu.cxx index 48ff699727..c3c89008c1 100644 --- a/src/Geom2dGcc/Geom2dGcc_FunctionTanCirCu.cxx +++ b/src/Geom2dGcc/Geom2dGcc_FunctionTanCirCu.cxx @@ -50,9 +50,9 @@ //========================================================================= Geom2dGcc_FunctionTanCirCu:: Geom2dGcc_FunctionTanCirCu(const gp_Circ2d& Circ , - const Geom2dAdaptor_Curve& Curv ) { - Curve = Curv; - TheCirc = Circ; + const Geom2dAdaptor_Curve& Curv ) : Curve(Curv), TheCirc(Circ) { + + // Modified by Sergey KHROMOV - Thu Apr 5 09:51:21 2001 Begin Standard_Integer aNbSamp = Geom2dGcc_CurveTool::NbSamples(Curve); diff --git a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCu.cxx b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCu.cxx index 751574095c..49b93f55a4 100644 --- a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCu.cxx +++ b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCu.cxx @@ -54,18 +54,18 @@ InitDerivative(const math_Vector& X, Geom2dGcc_FunctionTanCuCu:: Geom2dGcc_FunctionTanCuCu(const Geom2dAdaptor_Curve& C1 , - const Geom2dAdaptor_Curve& C2 ) { - TheCurve1 = C1; - TheCurve2 = C2; - TheType = Geom2dGcc_CuCu; + const Geom2dAdaptor_Curve& C2 ) : TheCurve1(C1), TheCurve2(C2), TheType(Geom2dGcc_CuCu) { + + + } Geom2dGcc_FunctionTanCuCu:: Geom2dGcc_FunctionTanCuCu(const gp_Circ2d& C1 , - const Geom2dAdaptor_Curve& C2 ) { - TheCirc1 = C1; - TheCurve2 = C2; - TheType = Geom2dGcc_CiCu; + const Geom2dAdaptor_Curve& C2 ) : TheCirc1(C1), TheCurve2(C2), TheType(Geom2dGcc_CiCu) { + + + } diff --git a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCuCu.cxx b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCuCu.cxx index 2f47c8ad9d..c554e587d5 100644 --- a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCuCu.cxx +++ b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCuCu.cxx @@ -94,61 +94,61 @@ InitDerivative(const math_Vector& X, Geom2dGcc_FunctionTanCuCuCu:: Geom2dGcc_FunctionTanCuCuCu(const Geom2dAdaptor_Curve& C1 , const Geom2dAdaptor_Curve& C2 , - const Geom2dAdaptor_Curve& C3 ) { - Curv1 = C1; - Curv2 = C2; - Curv3 = C3; - TheType = Geom2dGcc_CuCuCu; + const Geom2dAdaptor_Curve& C3 ) : Curv1(C1), Curv2(C2), Curv3(C3), TheType(Geom2dGcc_CuCuCu) { + + + + } Geom2dGcc_FunctionTanCuCuCu:: Geom2dGcc_FunctionTanCuCuCu(const gp_Circ2d& C1 , const Geom2dAdaptor_Curve& C2 , - const Geom2dAdaptor_Curve& C3 ) { - Circ1 = C1; - Curv2 = C2; - Curv3 = C3; - TheType = Geom2dGcc_CiCuCu; + const Geom2dAdaptor_Curve& C3 ) : Circ1(C1), Curv2(C2), Curv3(C3), TheType(Geom2dGcc_CiCuCu) { + + + + } Geom2dGcc_FunctionTanCuCuCu:: Geom2dGcc_FunctionTanCuCuCu(const gp_Circ2d& C1 , const gp_Circ2d& C2 , - const Geom2dAdaptor_Curve& C3 ) { - Circ1 = C1; - Circ2 = C2; - Curv3 = C3; - TheType = Geom2dGcc_CiCiCu; + const Geom2dAdaptor_Curve& C3 ) : Circ1(C1), Circ2(C2), Curv3(C3), TheType(Geom2dGcc_CiCiCu) { + + + + } Geom2dGcc_FunctionTanCuCuCu:: Geom2dGcc_FunctionTanCuCuCu(const gp_Circ2d& C1 , const gp_Lin2d& L2 , - const Geom2dAdaptor_Curve& C3 ) { - Circ1 = C1; - Lin2 = L2; - Curv3 = C3; - TheType = Geom2dGcc_CiLiCu; + const Geom2dAdaptor_Curve& C3 ) : Circ1(C1), Lin2(L2), Curv3(C3), TheType(Geom2dGcc_CiLiCu) { + + + + } Geom2dGcc_FunctionTanCuCuCu:: Geom2dGcc_FunctionTanCuCuCu(const gp_Lin2d& L1 , const gp_Lin2d& L2 , - const Geom2dAdaptor_Curve& C3 ) { - Lin1 = L1; - Lin2 = L2; - Curv3 = C3; - TheType = Geom2dGcc_LiLiCu; + const Geom2dAdaptor_Curve& C3 ) : Lin1(L1), Lin2(L2), Curv3(C3), TheType(Geom2dGcc_LiLiCu) { + + + + } Geom2dGcc_FunctionTanCuCuCu:: Geom2dGcc_FunctionTanCuCuCu(const gp_Lin2d& L1 , const Geom2dAdaptor_Curve& C2 , - const Geom2dAdaptor_Curve& C3 ) { - Lin1 = L1; - Curv2 = C2; - Curv3 = C3; - TheType = Geom2dGcc_LiCuCu; + const Geom2dAdaptor_Curve& C3 ) : Lin1(L1), Curv2(C2), Curv3(C3), TheType(Geom2dGcc_LiCuCu) { + + + + } //========================================================================== diff --git a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCuOnCu.cxx b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCuOnCu.cxx index 5559051f77..b2e19ae5ae 100644 --- a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCuOnCu.cxx +++ b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuCuOnCu.cxx @@ -145,144 +145,144 @@ Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const Geom2dAdaptor_Curve& C1 , const Geom2dAdaptor_Curve& C2 , const Geom2dAdaptor_Curve& C3 , - const Standard_Real Rad ) { - Curv1 = C1; - Curv2 = C2; - Curvon = C3; - FirstRad = Rad; - TheType = Geom2dGcc_CuCuOnCu; + const Standard_Real Rad ) : Curv1(C1), Curv2(C2), Curvon(C3), FirstRad(Rad), TheType(Geom2dGcc_CuCuOnCu) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const gp_Circ2d& C1 , const Geom2dAdaptor_Curve& C2 , const Geom2dAdaptor_Curve& C3 , - const Standard_Real Rad ) { - Circ1 = C1; - Curv2 = C2; - Curvon = C3; - FirstRad = Rad; - TheType = Geom2dGcc_CiCuOnCu; + const Standard_Real Rad ) : Circ1(C1), Curv2(C2), Curvon(C3), FirstRad(Rad), TheType(Geom2dGcc_CiCuOnCu) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const gp_Lin2d& L1 , const Geom2dAdaptor_Curve& C2 , const Geom2dAdaptor_Curve& C3 , - const Standard_Real Rad ) { - Lin1 = L1; - Curv2 = C2; - Curvon = C3; - FirstRad = Rad; - TheType = Geom2dGcc_LiCuOnCu; + const Standard_Real Rad ) : Lin1(L1), Curv2(C2), Curvon(C3), FirstRad(Rad), TheType(Geom2dGcc_LiCuOnCu) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const Geom2dAdaptor_Curve& C1 , const gp_Pnt2d& P2 , const Geom2dAdaptor_Curve& C3 , - const Standard_Real Rad ) { - Curv1 = C1; - Pnt2 = P2; - Curvon = C3; - FirstRad = Rad; - TheType = Geom2dGcc_CuPtOnCu; + const Standard_Real Rad ) : Curv1(C1), Pnt2(P2), Curvon(C3), FirstRad(Rad), TheType(Geom2dGcc_CuPtOnCu) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const Geom2dAdaptor_Curve& C1 , const Geom2dAdaptor_Curve& C2 , const gp_Lin2d& OnLi , - const Standard_Real Rad ) { - Curv1 = C1; - Curv2 = C2; - Linon = OnLi; - FirstRad = Rad; - TheType = Geom2dGcc_CuCuOnLi; + const Standard_Real Rad ) : Curv1(C1), Curv2(C2), Linon(OnLi), FirstRad(Rad), TheType(Geom2dGcc_CuCuOnLi) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const gp_Circ2d& C1 , const Geom2dAdaptor_Curve& C2 , const gp_Lin2d& OnLi , - const Standard_Real Rad ) { - Circ1 = C1; - Curv2 = C2; - Linon = OnLi; - FirstRad = Rad; - TheType = Geom2dGcc_CiCuOnLi; + const Standard_Real Rad ) : Circ1(C1), Curv2(C2), Linon(OnLi), FirstRad(Rad), TheType(Geom2dGcc_CiCuOnLi) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const gp_Lin2d& L1 , const Geom2dAdaptor_Curve& C2 , const gp_Lin2d& OnLi , - const Standard_Real Rad ) { - Lin1 = L1; - Curv2 = C2; - Linon = OnLi; - FirstRad = Rad; - TheType = Geom2dGcc_LiCuOnLi; + const Standard_Real Rad ) : Lin1(L1), Curv2(C2), Linon(OnLi), FirstRad(Rad), TheType(Geom2dGcc_LiCuOnLi) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const Geom2dAdaptor_Curve& C1 , const gp_Pnt2d& P2 , const gp_Lin2d& OnLi , - const Standard_Real Rad ) { - Curv1 = C1; - Pnt2 = P2; - Linon = OnLi; - FirstRad = Rad; - TheType = Geom2dGcc_CuPtOnLi; + const Standard_Real Rad ) : Curv1(C1), Pnt2(P2), Linon(OnLi), FirstRad(Rad), TheType(Geom2dGcc_CuPtOnLi) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const Geom2dAdaptor_Curve& C1 , const Geom2dAdaptor_Curve& C2 , const gp_Circ2d& OnCi , - const Standard_Real Rad ) { - Curv1 = C1; - Curv2 = C2; - Circon = OnCi; - FirstRad = Rad; - TheType = Geom2dGcc_CuCuOnCi; + const Standard_Real Rad ) : Curv1(C1), Curv2(C2), Circon(OnCi), FirstRad(Rad), TheType(Geom2dGcc_CuCuOnCi) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const gp_Circ2d& C1 , const Geom2dAdaptor_Curve& C2 , const gp_Circ2d& OnCi , - const Standard_Real Rad ) { - Circ1 = C1; - Curv2 = C2; - Circon = OnCi; - FirstRad = Rad; - TheType = Geom2dGcc_CuCuOnCi; + const Standard_Real Rad ) : Circ1(C1), Curv2(C2), Circon(OnCi), FirstRad(Rad), TheType(Geom2dGcc_CuCuOnCi) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const gp_Lin2d& L1 , const Geom2dAdaptor_Curve& C2 , const gp_Circ2d& OnCi , - const Standard_Real Rad ) { - Lin1 = L1; - Curv2 = C2; - Circon = OnCi; - FirstRad = Rad; - TheType = Geom2dGcc_LiCuOnCi; + const Standard_Real Rad ) : Lin1(L1), Curv2(C2), Circon(OnCi), FirstRad(Rad), TheType(Geom2dGcc_LiCuOnCi) { + + + + + } Geom2dGcc_FunctionTanCuCuOnCu:: Geom2dGcc_FunctionTanCuCuOnCu(const Geom2dAdaptor_Curve& C1 , const gp_Pnt2d& P2 , const gp_Circ2d& OnCi , - const Standard_Real Rad ) { - Curv1 = C1; - Pnt2 = P2; - Circon = OnCi; - FirstRad = Rad; - TheType = Geom2dGcc_CuPtOnCi; + const Standard_Real Rad ) : Curv1(C1), Pnt2(P2), Circon(OnCi), FirstRad(Rad), TheType(Geom2dGcc_CuPtOnCi) { + + + + + } Standard_Integer Geom2dGcc_FunctionTanCuCuOnCu:: diff --git a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuPnt.cxx b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuPnt.cxx index 7e85bcedbb..c44ec36094 100644 --- a/src/Geom2dGcc/Geom2dGcc_FunctionTanCuPnt.cxx +++ b/src/Geom2dGcc/Geom2dGcc_FunctionTanCuPnt.cxx @@ -37,9 +37,9 @@ //========================================================================= Geom2dGcc_FunctionTanCuPnt:: Geom2dGcc_FunctionTanCuPnt(const Geom2dAdaptor_Curve& C , - const gp_Pnt2d& Point ) { - TheCurv = C; - ThePoint = Point; + const gp_Pnt2d& Point ) : TheCurv(C), ThePoint(Point) { + + } diff --git a/src/Geom2dGcc/Geom2dGcc_FunctionTanObl.cxx b/src/Geom2dGcc/Geom2dGcc_FunctionTanObl.cxx index b23d1bdc64..2935d98c0e 100644 --- a/src/Geom2dGcc/Geom2dGcc_FunctionTanObl.cxx +++ b/src/Geom2dGcc/Geom2dGcc_FunctionTanObl.cxx @@ -23,10 +23,10 @@ Geom2dGcc_FunctionTanObl:: Geom2dGcc_FunctionTanObl(const Geom2dAdaptor_Curve& C, - const gp_Dir2d& Dir ) + const gp_Dir2d& Dir ) : TheCurv(C), TheDirection(Dir) { - TheCurv = C; - TheDirection = Dir; + + } diff --git a/src/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx b/src/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx index 14ad20d020..8dc9485350 100644 --- a/src/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -34,7 +36,7 @@ Geom2dGcc_Lin2d2Tan:: Geom2dGcc_Lin2d2Tan (const Geom2dGcc_QualifiedCurve& Qualified1, const Geom2dGcc_QualifiedCurve& Qualified2, const Standard_Real Tolang ): - linsol(1,4) , + NbrSol(0), linsol(1,4) , qualifier1(1,4), qualifier2(1,4), pnttg1sol(1,4) , @@ -46,8 +48,8 @@ Geom2dGcc_Lin2d2Tan:: { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); Geom2dAdaptor_Curve C2 = Qualified2.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); - Handle(Geom2d_Curve) CC2 = C2.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC2 = C2.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); GeomAbs_CurveType Type2 = C2.GetType(); @@ -55,7 +57,7 @@ Geom2dGcc_Lin2d2Tan:: // Appel a GccAna. + //============================================================================= - NbrSol = 0; + if (Type1 == GeomAbs_Circle && Type2 == GeomAbs_Circle ) { Handle(Geom2d_Circle) CCC1 = Handle(Geom2d_Circle)::DownCast(CC1); gp_Circ2d c1(CCC1->Circ2d()); @@ -90,8 +92,8 @@ Geom2dGcc_Lin2d2Tan:: Standard_Integer aNbSamples2 = Geom2dGcc_CurveTool::NbSamples(C2); Standard_Real aStep2 = (a2LPar - a2FPar)/aNbSamples2; Standard_Real Param2 = a2FPar; - Standard_Integer i; - Standard_Integer j; + Standard_Integer i = 0; + Standard_Integer j = 0; for (i = 0; i <= aNbSamples1 && NbrSol < 4; i++) { Param2 = a2FPar; @@ -116,7 +118,7 @@ Geom2dGcc_Lin2d2Tan:: Geom2dGcc_Lin2d2Tan (const Geom2dGcc_QualifiedCurve& Qualified1, const gp_Pnt2d& ThePoint , const Standard_Real Tolang ): - linsol(1,2) , + NbrSol(0), linsol(1,2) , qualifier1(1,2), qualifier2(1,2), pnttg1sol(1,2) , @@ -127,14 +129,14 @@ Geom2dGcc_Lin2d2Tan:: pararg2(1,2) { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); //============================================================================= // Appel a GccAna. + //============================================================================= - NbrSol = 0; + if (Type1 == GeomAbs_Circle) { Handle(Geom2d_Circle) CCC1 = Handle(Geom2d_Circle)::DownCast(CC1); gp_Circ2d c1(CCC1->Circ2d()); @@ -159,7 +161,7 @@ Geom2dGcc_Lin2d2Tan:: Standard_Integer aNbSamples = Geom2dGcc_CurveTool::NbSamples(C1); Standard_Real aStep = (aLastPar - aFirstPar)/aNbSamples; Standard_Real Param1 = aFirstPar; - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i <= aNbSamples && NbrSol < 2; i++) { Geom2dGcc_Lin2d2TanIter Lin(Qc1,ThePoint,Param1,Tolang); @@ -184,7 +186,7 @@ Geom2dGcc_Lin2d2Tan:: const Standard_Real Tolang , const Standard_Real Param1 , const Standard_Real Param2 ): - linsol(1,4) , + NbrSol(0), linsol(1,4) , qualifier1(1,4), qualifier2(1,4), pnttg1sol(1,4) , @@ -196,8 +198,8 @@ Geom2dGcc_Lin2d2Tan:: { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); Geom2dAdaptor_Curve C2 = Qualified2.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); - Handle(Geom2d_Curve) CC2 = C2.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC2 = C2.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); GeomAbs_CurveType Type2 = C2.GetType(); @@ -205,7 +207,7 @@ Geom2dGcc_Lin2d2Tan:: // Appel a GccAna. + //============================================================================= - NbrSol = 0; + if (Type1 == GeomAbs_Circle && Type2 == GeomAbs_Circle ) { Handle(Geom2d_Circle) CCC1 = Handle(Geom2d_Circle)::DownCast(CC1); gp_Circ2d c1(CCC1->Circ2d()); @@ -249,7 +251,7 @@ Geom2dGcc_Lin2d2Tan:: const gp_Pnt2d& ThePoint , const Standard_Real Tolang , const Standard_Real Param1 ): - linsol(1,2) , + NbrSol(0), linsol(1,2) , qualifier1(1,2), qualifier2(1,2), pnttg1sol(1,2) , @@ -260,14 +262,14 @@ Geom2dGcc_Lin2d2Tan:: pararg2(1,2) { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); //============================================================================= // Appel a GccAna. + //============================================================================= - NbrSol = 0; + if (Type1 == GeomAbs_Circle) { Handle(Geom2d_Circle) CCC1 = Handle(Geom2d_Circle)::DownCast(CC1); gp_Circ2d c1(CCC1->Circ2d()); @@ -364,11 +366,11 @@ Standard_Boolean Geom2dGcc_Lin2d2Tan::Add(const Standard_Integer theIndex, const Geom2dAdaptor_Curve &theC1, const Geom2dAdaptor_Curve &theC2) { - Standard_Integer i; - Standard_Real aPar1sol; - Standard_Real aPar2sol; - Standard_Real aPar1arg; - Standard_Real aPar2arg; + Standard_Integer i = 0; + Standard_Real aPar1sol = NAN; + Standard_Real aPar2sol = NAN; + Standard_Real aPar1arg = NAN; + Standard_Real aPar2arg = NAN; gp_Pnt2d aPnt1Sol; gp_Pnt2d aPnt2Sol; gp_Lin2d aLin = theLin.ThisSolution(); diff --git a/src/Geom2dGcc/Geom2dGcc_Lin2d2TanIter.cxx b/src/Geom2dGcc/Geom2dGcc_Lin2d2TanIter.cxx index 980c01b718..01f6fd0956 100644 --- a/src/Geom2dGcc/Geom2dGcc_Lin2d2TanIter.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Lin2d2TanIter.cxx @@ -18,6 +18,8 @@ // CREATION D UNE LIGNE TANGENTE A DEUX COURBES. + //======================================================================== +#include + #include #include #include @@ -41,17 +43,17 @@ Geom2dGcc_Lin2d2TanIter:: Geom2dGcc_Lin2d2TanIter (const GccEnt_QualifiedCirc& Qualified1 , const Geom2dGcc_QCurve& Qualified2 , const Standard_Real Param2 , - const Standard_Real Tolang ) { + const Standard_Real Tolang ) : par1sol(0.), pararg1(0.), par2sol(0.0), pararg2(0.0), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { - par1sol = 0.; - pararg1 = 0.; - par2sol = 0.0; - pararg2 = 0.0; + + + + //Standard_Real Tol = Abs(Tolang); - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + if (Qualified1.IsEnclosed()) { throw GccEnt_BadQualifier(); } gp_Circ2d C1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); @@ -63,7 +65,7 @@ Geom2dGcc_Lin2d2TanIter (const GccEnt_QualifiedCirc& Qualified1 , Standard_Real Usol = sol.Root(); // gp_Pnt2d Origine,Pt; // Modified by Sergey KHROMOV - Thu Apr 5 17:39:47 2001 Begin - Standard_Real Norm; + Standard_Real Norm = NAN; func.Value(Usol, Norm); if (Abs(Norm) < Tolang) { // Modified by Sergey KHROMOV - Thu Apr 5 17:39:48 2001 End @@ -121,14 +123,14 @@ Geom2dGcc_Lin2d2TanIter (const Geom2dGcc_QCurve& Qualified1 , const Geom2dGcc_QCurve& Qualified2 , const Standard_Real Param1 , const Standard_Real Param2 , - const Standard_Real Tolang ) { - par1sol = 0.; - pararg1 = 0.; - par2sol = 0.0; - pararg2 = 0.0; - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + const Standard_Real Tolang ) : par1sol(0.), pararg1(0.), par2sol(0.0), pararg2(0.0), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { + + + + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || @@ -198,15 +200,15 @@ Geom2dGcc_Lin2d2TanIter:: Geom2dGcc_Lin2d2TanIter (const Geom2dGcc_QCurve& Qualified1 , const gp_Pnt2d& ThePoint , const Standard_Real Param1 , - const Standard_Real Tolang ) { + const Standard_Real Tolang ) : par1sol(0.), pararg1(0.), par2sol(0.0), pararg2(0.0), WellDone(Standard_False), qualifier1(GccEnt_noqualifier), qualifier2(GccEnt_noqualifier) { - par1sol = 0.; - pararg1 = 0.; - par2sol = 0.0; - pararg2 = 0.0; - WellDone = Standard_False; - qualifier1 = GccEnt_noqualifier; - qualifier2 = GccEnt_noqualifier; + + + + + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); @@ -220,7 +222,7 @@ Geom2dGcc_Lin2d2TanIter (const Geom2dGcc_QCurve& Qualified1 , if (sol.IsDone()) { Standard_Real Usol = sol.Root(); // Modified by Sergey KHROMOV - Thu Apr 5 17:45:17 2001 Begin - Standard_Real Norm; + Standard_Real Norm = NAN; func.Value(Usol, Norm); if (Abs(Norm) < Tolang) { // Modified by Sergey KHROMOV - Thu Apr 5 17:45:19 2001 End diff --git a/src/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx b/src/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx index 560614e6c7..b7ec055fec 100644 --- a/src/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -34,8 +36,8 @@ Geom2dGcc_Lin2dTanObl:: const gp_Lin2d& TheLine , const Standard_Real TolAng , const Standard_Real Angle ): - Paral2(Standard_False), - linsol(1,2) , + WellDone(Standard_False), Paral2(Standard_False), + NbrSol(0), linsol(1,2) , qualifier1(1,2), pnttg1sol(1,2) , pntint2sol(1,2), @@ -45,15 +47,15 @@ Geom2dGcc_Lin2dTanObl:: pararg2(1,2) { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); //============================================================================= // Appel a GccAna. + //============================================================================= - WellDone = Standard_False; - NbrSol = 0; + + if (Type1 == GeomAbs_Circle ) { Handle(Geom2d_Circle) CCC1 = Handle(Geom2d_Circle)::DownCast(CC1); gp_Circ2d c1(CCC1->Circ2d()); @@ -77,7 +79,7 @@ Geom2dGcc_Lin2dTanObl:: Standard_Integer aNbSamples = Geom2dGcc_CurveTool::NbSamples(C1); Standard_Real aStep = (aLastPar - aFirstPar)/aNbSamples; Standard_Real Param1 = aFirstPar; - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i <= aNbSamples && NbrSol < 2; i++) { Geom2dGcc_Lin2dTanOblIter Lin(Qc1,TheLine,Param1,TolAng,Angle); @@ -100,8 +102,8 @@ Geom2dGcc_Lin2dTanObl:: const Standard_Real TolAng , const Standard_Real Param1 , const Standard_Real Angle ): - Paral2(Standard_False), - linsol(1,2) , + WellDone(Standard_False), Paral2(Standard_False), + NbrSol(0), linsol(1,2) , qualifier1(1,2), pnttg1sol(1,2) , pntint2sol(1,2), @@ -111,15 +113,15 @@ Geom2dGcc_Lin2dTanObl:: pararg2(1,2) { Geom2dAdaptor_Curve C1 = Qualified1.Qualified(); - Handle(Geom2d_Curve) CC1 = C1.Curve(); + const Handle(Geom2d_Curve)& CC1 = C1.Curve(); GeomAbs_CurveType Type1 = C1.GetType(); //============================================================================= // Appel a GccAna. + //============================================================================= - WellDone = Standard_False; - NbrSol = 0; + + if (Type1 == GeomAbs_Circle ) { Handle(Geom2d_Circle) CCC1 = Handle(Geom2d_Circle)::DownCast(CC1); gp_Circ2d c1(CCC1->Circ2d()); @@ -205,11 +207,11 @@ Standard_Boolean Geom2dGcc_Lin2dTanObl::Add const Standard_Real theTol, const Geom2dAdaptor_Curve &theC1) { - Standard_Integer i; - Standard_Real aPar1sol; - Standard_Real aPar2sol; - Standard_Real aPar1arg; - Standard_Real aPar2arg; + Standard_Integer i = 0; + Standard_Real aPar1sol = NAN; + Standard_Real aPar2sol = NAN; + Standard_Real aPar1arg = NAN; + Standard_Real aPar2arg = NAN; gp_Pnt2d aPnt1Sol; gp_Pnt2d aPnt2Sol; gp_Lin2d aLin = theLin.ThisSolution(); diff --git a/src/Geom2dGcc/Geom2dGcc_Lin2dTanOblIter.cxx b/src/Geom2dGcc/Geom2dGcc_Lin2dTanOblIter.cxx index 802c7db4db..f085ab2bd7 100644 --- a/src/Geom2dGcc/Geom2dGcc_Lin2dTanOblIter.cxx +++ b/src/Geom2dGcc/Geom2dGcc_Lin2dTanOblIter.cxx @@ -40,13 +40,13 @@ Geom2dGcc_Lin2dTanOblIter (const Geom2dGcc_QCurve& Qualified1 , const Standard_Real Param1 , const Standard_Real TolAng , const Standard_Real Angle ) -: par2sol(0.0), - pararg2(0.0) +: par1sol(0.), WellDone(Standard_False), par2sol(0.0), + pararg1(0.), pararg2(0.0) { - par1sol = 0.; - pararg1 = 0.; - WellDone = Standard_False; + + + if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { throw GccEnt_BadQualifier(); diff --git a/src/Geom2dGcc/Geom2dGcc_QCurve.cxx b/src/Geom2dGcc/Geom2dGcc_QCurve.cxx index b760d1f80d..35ae302813 100644 --- a/src/Geom2dGcc/Geom2dGcc_QCurve.cxx +++ b/src/Geom2dGcc/Geom2dGcc_QCurve.cxx @@ -48,7 +48,7 @@ Standard_Boolean Geom2dGcc_QCurve:: Geom2dGcc_QCurve:: Geom2dGcc_QCurve (const Geom2dAdaptor_Curve& Curve, - const GccEnt_Position Qualifier) { - TheQualified = Curve; - TheQualifier = Qualifier; + const GccEnt_Position Qualifier) : TheQualified(Curve), TheQualifier(Qualifier) { + + } diff --git a/src/Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx b/src/Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx index 383a63d0f9..2f3359ef49 100644 --- a/src/Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx +++ b/src/Geom2dGcc/Geom2dGcc_QualifiedCurve.cxx @@ -17,9 +17,9 @@ Geom2dGcc_QualifiedCurve:: Geom2dGcc_QualifiedCurve (const Geom2dAdaptor_Curve& Curve , - const GccEnt_Position Qualifier) { - TheQualified = Curve; - TheQualifier = Qualifier; + const GccEnt_Position Qualifier) : TheQualified(Curve), TheQualifier(Qualifier) { + + } Geom2dAdaptor_Curve Geom2dGcc_QualifiedCurve:: diff --git a/src/Geom2dHatch/Geom2dHatch_Elements.cxx b/src/Geom2dHatch/Geom2dHatch_Elements.cxx index 5b4b63235d..d1a86d6ea5 100644 --- a/src/Geom2dHatch/Geom2dHatch_Elements.cxx +++ b/src/Geom2dHatch/Geom2dHatch_Elements.cxx @@ -38,12 +38,12 @@ Geom2dHatch_Elements::Geom2dHatch_Elements(const Geom2dHatch_Elements& ) #endif } -Geom2dHatch_Elements::Geom2dHatch_Elements() +Geom2dHatch_Elements::Geom2dHatch_Elements() : NumWire(0), NumEdge(0), myCurEdge(1), myCurEdgePar(Probing_Start) { - NumWire = 0; - NumEdge = 0; - myCurEdge = 1; - myCurEdgePar = Probing_Start; + + + + } void Geom2dHatch_Elements::Clear() @@ -119,7 +119,7 @@ Standard_Boolean Geom2dHatch_Elements::OtherSegment (const gp_Pnt2d& P, Standard_Real& Par) { Geom2dHatch_DataMapIteratorOfMapOfElements Itertemp; - Standard_Integer i; + Standard_Integer i = 0; for (Itertemp.Initialize (myMap), i = 1; Itertemp.More(); Itertemp.Next(), i++) { diff --git a/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx b/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx index 0f84262502..7111a662fb 100644 --- a/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx +++ b/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -161,7 +163,7 @@ void Geom2dHatch_Hatcher::KeepSegments (const Standard_Boolean Keep) Standard_Integer Geom2dHatch_Hatcher::AddElement (const Geom2dAdaptor_Curve& Curve, const TopAbs_Orientation Orientation) { - Standard_Integer IndE ; + Standard_Integer IndE = 0 ; for (IndE = 1 ; IndE <= myNbElements && myElements.IsBound(IndE) ; IndE++) ; if (IndE > myNbElements) { myNbElements++ ; @@ -244,7 +246,7 @@ void Geom2dHatch_Hatcher::ClrElements () Standard_Integer Geom2dHatch_Hatcher::AddHatching (const Geom2dAdaptor_Curve& Curve) { - Standard_Integer IndH ; + Standard_Integer IndH = 0 ; for (IndH = 1 ; IndH <= myNbHatchings && myHatchings.IsBound(IndH) ; IndH++) ; if (IndH > myNbHatchings) { myNbHatchings++ ; @@ -339,7 +341,7 @@ void Geom2dHatch_Hatcher::Trim (const Standard_Integer IndH) Hatching.ClrPoints() ; - Standard_Boolean OK, AllOK ; + Standard_Boolean OK = 0, AllOK = 0 ; AllOK = Standard_True ; for (Standard_Integer IndE = 1 ; IndE <= myNbElements ; IndE++) { @@ -744,7 +746,7 @@ Standard_Boolean Geom2dHatch_Hatcher::GlobalTransition (HatchGen_PointOnHatching gp_Dir2d Tangente2d, Normale2d ; gp_Dir Tangente, Normale ; - Standard_Real Courbure ; + Standard_Real Courbure = NAN ; const Geom2dAdaptor_Curve& CurveH = HatchingCurve (Point.Index()) ; @@ -777,7 +779,7 @@ Standard_Boolean Geom2dHatch_Hatcher::GlobalTransition (HatchGen_PointOnHatching TopAbs_Orientation ElementOrientation = Element.Orientation() ; Standard_Boolean ToReverse = (ElementOrientation == TopAbs_REVERSED); - Standard_Real Param ; + Standard_Real Param = NAN ; switch (PntE.Position()) { case TopAbs_FORWARD : diff --git a/src/Geom2dHatch/Geom2dHatch_Hatching.cxx b/src/Geom2dHatch/Geom2dHatch_Hatching.cxx index b24291c999..5d772bb273 100644 --- a/src/Geom2dHatch/Geom2dHatch_Hatching.cxx +++ b/src/Geom2dHatch/Geom2dHatch_Hatching.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -165,7 +167,7 @@ void Geom2dHatch_Hatching::AddPoint (const HatchGen_PointOnHatching& Point, { Standard_Integer NbPoints = myPoints.Length () ; //for (Standard_Integer IPntH = 1 ; IPntH <= NbPoints ; IPntH++) { - Standard_Integer IPntH; + Standard_Integer IPntH = 0; for (IPntH = 1 ; IPntH <= NbPoints ; IPntH++) { const HatchGen_PointOnHatching& PntH = myPoints.Value (IPntH) ; if (!PntH.IsLower (Point, Confusion)) break ; @@ -323,7 +325,7 @@ void Geom2dHatch_Hatching::ClrDomains () // Purpose : returns a 2d point on the curve //======================================================================= gp_Pnt2d Geom2dHatch_Hatching::ClassificationPoint () const { - Standard_Real t,a,b; + Standard_Real t = NAN,a = NAN,b = NAN; a = myCurve.FirstParameter(); b = myCurve.LastParameter(); if(b >= Precision::Infinite()) { diff --git a/src/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx b/src/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx index 7bf424e19c..8025efcfe4 100644 --- a/src/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx +++ b/src/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -26,9 +28,9 @@ //============================================================================= Geom2dLProp_FuncCurExt::Geom2dLProp_FuncCurExt(const Handle(Geom2d_Curve)& C, const Standard_Real Tol) - :theCurve(C) + :theCurve(C), epsX(Tol) { - epsX = Tol; + } //============================================================================= @@ -66,7 +68,7 @@ Standard_Boolean Geom2dLProp_FuncCurExt::Value (const Standard_Real X, Standard_Boolean Geom2dLProp_FuncCurExt::Derivative(const Standard_Real X, Standard_Real& D) { - Standard_Real F; + Standard_Real F = NAN; return Values (X,F,D) ; } @@ -78,7 +80,7 @@ Standard_Boolean Geom2dLProp_FuncCurExt::Values (const Standard_Real X, Standard_Real& F, Standard_Real& D) { - Standard_Real F2; + Standard_Real F2 = NAN; Standard_Real Dx= epsX/100.; if (X+Dx > Geom2dLProp_Curve2dTool::LastParameter(theCurve)) {Dx = - Dx;} @@ -101,7 +103,7 @@ Standard_Boolean Geom2dLProp_FuncCurExt::IsMinKC (const Standard_Real X) const gp_Pnt2d P1; gp_Vec2d V1,V2,V3; Standard_Real Dx= epsX; - Standard_Real KC,KP; + Standard_Real KC = NAN,KP = NAN; Geom2dLProp_Curve2dTool::D3(theCurve,X,P1,V1,V2,V3); Standard_Real CPV1V2 = V1.Crossed(V2); diff --git a/src/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx b/src/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx index 40fbe1049c..9f54f719bf 100644 --- a/src/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx +++ b/src/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -36,7 +38,7 @@ Geom2dLProp_FuncCurNul::Geom2dLProp_FuncCurNul(const Handle(Geom2d_Curve)& C) Standard_Boolean Geom2dLProp_FuncCurNul::Value (const Standard_Real X, Standard_Real& F) { - Standard_Real D; + Standard_Real D = NAN; return Values(X,F,D); } @@ -47,7 +49,7 @@ Standard_Boolean Geom2dLProp_FuncCurNul::Value (const Standard_Real X, Standard_Boolean Geom2dLProp_FuncCurNul::Derivative(const Standard_Real X, Standard_Real& D) { - Standard_Real F; + Standard_Real F = NAN; return Values(X,F,D); } diff --git a/src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx b/src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx index bdf591d9ff..93abf22296 100644 --- a/src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx +++ b/src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx @@ -61,7 +61,7 @@ void Geom2dLProp_NumericCurInf2d::PerformCurExt (const Handle(Geom2d_Curve)& C, Geom2dLProp_FuncCurExt F(C,EpsH); Standard_Integer NbSamples = 100; - Standard_Boolean SolType; + Standard_Boolean SolType = 0; math_FunctionRoots SolRoot (F,UMin,UMax,NbSamples,EpsH,EpsH,EpsH); diff --git a/src/GeomAPI/GeomAPI_ExtremaCurveCurve.cxx b/src/GeomAPI/GeomAPI_ExtremaCurveCurve.cxx index b25ebf8667..74969b6991 100644 --- a/src/GeomAPI/GeomAPI_ExtremaCurveCurve.cxx +++ b/src/GeomAPI/GeomAPI_ExtremaCurveCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -93,7 +95,7 @@ void GeomAPI_ExtremaCurveCurve::Init // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtCC.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtCC.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtCC.NbExt(); i++) { @@ -136,7 +138,7 @@ void GeomAPI_ExtremaCurveCurve::Init // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtCC.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtCC.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtCC.NbExt(); i++) { @@ -384,7 +386,7 @@ void GeomAPI_ExtremaCurveCurve::TotalPerform() } gp_Pnt P11, P12, P21, P22; - Standard_Real d11, d12, d21, d22; + Standard_Real d11 = NAN, d12 = NAN, d21 = NAN, d22 = NAN; myExtCC.TrimmedSquareDistances(d11, d12, d21, d22, P11, P12, P21, P22); Standard_Real aTotalDist2 = myTotalDist * myTotalDist; diff --git a/src/GeomAPI/GeomAPI_ExtremaCurveCurve.hxx b/src/GeomAPI/GeomAPI_ExtremaCurveCurve.hxx index d385e637de..f3117fae6b 100644 --- a/src/GeomAPI/GeomAPI_ExtremaCurveCurve.hxx +++ b/src/GeomAPI/GeomAPI_ExtremaCurveCurve.hxx @@ -167,16 +167,16 @@ private: Standard_EXPORT void TotalPerform(); - Standard_Boolean myIsDone; - Standard_Integer myIndex; + Standard_Boolean myIsDone{}; + Standard_Integer myIndex{}; Extrema_ExtCC myExtCC; GeomAdaptor_Curve myC1; GeomAdaptor_Curve myC2; - Standard_Boolean myTotalExt; - Standard_Boolean myIsInfinite; - Standard_Real myTotalDist; + Standard_Boolean myTotalExt{}; + Standard_Boolean myIsInfinite{}; + Standard_Real myTotalDist{}; gp_Pnt myTotalPoints[2]; - Standard_Real myTotalPars[2]; + Standard_Real myTotalPars[2]{}; }; diff --git a/src/GeomAPI/GeomAPI_ExtremaCurveSurface.cxx b/src/GeomAPI/GeomAPI_ExtremaCurveSurface.cxx index c77fdb07a0..fcae59d07c 100644 --- a/src/GeomAPI/GeomAPI_ExtremaCurveSurface.cxx +++ b/src/GeomAPI/GeomAPI_ExtremaCurveSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -90,7 +92,7 @@ void GeomAPI_ExtremaCurveSurface::Init // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtCS.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtCS.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtCS.NbExt(); i++) { @@ -132,7 +134,7 @@ void GeomAPI_ExtremaCurveSurface::Init // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtCS.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtCS.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtCS.NbExt(); i++) { diff --git a/src/GeomAPI/GeomAPI_ExtremaCurveSurface.hxx b/src/GeomAPI/GeomAPI_ExtremaCurveSurface.hxx index c1fbe59061..e05730815c 100644 --- a/src/GeomAPI/GeomAPI_ExtremaCurveSurface.hxx +++ b/src/GeomAPI/GeomAPI_ExtremaCurveSurface.hxx @@ -152,8 +152,8 @@ Standard_EXPORT operator Standard_Real() const; private: - Standard_Boolean myIsDone; - Standard_Integer myIndex; + Standard_Boolean myIsDone{}; + Standard_Integer myIndex{}; Extrema_ExtCS myExtCS; }; diff --git a/src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.cxx b/src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.cxx index 8a844f4491..70c883ba65 100644 --- a/src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.cxx +++ b/src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -92,7 +94,7 @@ void GeomAPI_ExtremaSurfaceSurface::Init // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtSS.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtSS.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtSS.NbExt(); i++) { @@ -139,7 +141,7 @@ void GeomAPI_ExtremaSurfaceSurface::Init // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtSS.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtSS.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtSS.NbExt(); i++) { diff --git a/src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.hxx b/src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.hxx index 4e74c68710..344d793e93 100644 --- a/src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.hxx +++ b/src/GeomAPI/GeomAPI_ExtremaSurfaceSurface.hxx @@ -155,8 +155,8 @@ Standard_EXPORT operator Standard_Real() const; private: - Standard_Boolean myIsDone; - Standard_Integer myIndex; + Standard_Boolean myIsDone{}; + Standard_Integer myIndex{}; Extrema_ExtSS myExtSS; }; diff --git a/src/GeomAPI/GeomAPI_Interpolate.cxx b/src/GeomAPI/GeomAPI_Interpolate.cxx index 4f0ebf5913..60c88b3e34 100644 --- a/src/GeomAPI/GeomAPI_Interpolate.cxx +++ b/src/GeomAPI/GeomAPI_Interpolate.cxx @@ -16,6 +16,8 @@ // 08-Aug-95 : xab : interpolation uses BSplCLib::Interpolate +#include + #include #include #include @@ -35,9 +37,9 @@ static Standard_Boolean CheckPoints(const TColgp_Array1OfPnt& PointArray, const Standard_Real Tolerance) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Standard_Real tolerance_squared = Tolerance * Tolerance, - distance_squared ; + distance_squared = NAN ; Standard_Boolean result = Standard_True ; for (ii = PointArray.Lower() ; result && ii < PointArray.Upper() ; ii++) { distance_squared = @@ -56,10 +58,10 @@ static Standard_Boolean CheckTangents( const TColStd_Array1OfBoolean& TangentFlags, const Standard_Real Tolerance) { - Standard_Integer ii, - index ; + Standard_Integer ii = 0, + index = 0 ; Standard_Real tolerance_squared = Tolerance * Tolerance, - distance_squared ; + distance_squared = NAN ; Standard_Boolean result = Standard_True ; index = TangentFlags.Lower() ; for (ii = Tangents.Lower(); result && ii <= Tangents.Upper() ; ii++) { @@ -80,8 +82,8 @@ static Standard_Boolean CheckTangents( static Standard_Boolean CheckParameters(const TColStd_Array1OfReal& Parameters) { - Standard_Integer ii ; - Standard_Real distance ; + Standard_Integer ii = 0 ; + Standard_Real distance = NAN ; Standard_Boolean result = Standard_True ; for (ii = Parameters.Lower() ; result && ii < Parameters.Upper() ; ii++) { distance = @@ -98,9 +100,9 @@ static void BuildParameters(const Standard_Boolean PeriodicFlag, const TColgp_Array1OfPnt& PointsArray, Handle(TColStd_HArray1OfReal)& ParametersPtr) { - Standard_Integer ii, - index ; - Standard_Real distance ; + Standard_Integer ii = 0, + index = 0 ; + Standard_Real distance = NAN ; Standard_Integer num_parameters = PointsArray.Length() ; if (PeriodicFlag) { @@ -138,10 +140,10 @@ static void BuildPeriodicTangent( const TColStd_Array1OfReal& ParametersArray) { Standard_Integer - ii, - degree ; - Standard_Real *point_array, - *parameter_array, + ii = 0, + degree = 0 ; + Standard_Real *point_array = nullptr, + *parameter_array = nullptr, eval_result[2][3] ; gp_Vec a_vector ; @@ -182,10 +184,10 @@ static void BuildTangents(const TColgp_Array1OfPnt& PointsArray, TColStd_Array1OfBoolean& TangentFlags, const TColStd_Array1OfReal& ParametersArray) { - Standard_Integer ii, - degree ; - Standard_Real *point_array, - *parameter_array, + Standard_Integer ii = 0, + degree = 0 ; + Standard_Real *point_array = nullptr, + *parameter_array = nullptr, eval_result[2][3] ; gp_Vec a_vector ; @@ -245,16 +247,16 @@ static void ScaleTangents(const TColgp_Array1OfPnt& PointsArray, const TColStd_Array1OfBoolean& TangentFlags, const TColStd_Array1OfReal& ParametersArray) { - Standard_Integer ii, - jj, + Standard_Integer ii = 0, + jj = 0, degree=0, - index, - num_points ; + index = 0, + num_points = 0 ; - Standard_Real *point_array, - *parameter_array, + Standard_Real *point_array = nullptr, + *parameter_array = nullptr, value[2], - ratio, + ratio = NAN, eval_result[2][3] ; gp_Vec a_vector ; @@ -316,19 +318,17 @@ GeomAPI_Interpolate::GeomAPI_Interpolate myTolerance(Tolerance), myPoints(PointsPtr), myIsDone(Standard_False), -myPeriodic(PeriodicFlag), +myTangents(new TColgp_HArray1OfVec(myPoints->Lower(), + myPoints->Upper())), myTangentFlags(new TColStd_HArray1OfBoolean(myPoints->Lower(), + myPoints->Upper())), myPeriodic(PeriodicFlag), myTangentRequest(Standard_False) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Standard_Boolean result = CheckPoints(PointsPtr->Array1(), Tolerance) ; - myTangents = - new TColgp_HArray1OfVec(myPoints->Lower(), - myPoints->Upper()) ; - myTangentFlags = - new TColStd_HArray1OfBoolean(myPoints->Lower(), - myPoints->Upper()) ; + + if (!result) { throw Standard_ConstructionError(); @@ -362,7 +362,7 @@ myParameters(ParametersPtr), myPeriodic(PeriodicFlag), myTangentRequest(Standard_False) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Standard_Boolean result = @@ -407,8 +407,8 @@ void GeomAPI_Interpolate::Load( const Standard_Boolean Scale ) { - Standard_Boolean result ; - Standard_Integer ii ; + Standard_Boolean result = 0 ; + Standard_Integer ii = 0 ; myTangentRequest = Standard_True ; myTangentFlags = TangentFlagsPtr ; if (Tangents.Length() != myPoints->Length() || @@ -449,7 +449,7 @@ void GeomAPI_Interpolate::Load(const gp_Vec& InitialTangent, const gp_Vec& FinalTangent, const Standard_Boolean Scale ) { - Standard_Boolean result ; + Standard_Boolean result = 0 ; myTangentRequest = Standard_True ; myTangentFlags->SetValue(1,Standard_True) ; myTangentFlags->SetValue(myPoints->Length(),Standard_True) ; @@ -492,20 +492,20 @@ void GeomAPI_Interpolate::Perform() void GeomAPI_Interpolate::PerformPeriodic() { - Standard_Integer degree, - ii, - jj, - index, - index1, + Standard_Integer degree = 0, + ii = 0, + jj = 0, + index = 0, + index1 = 0, // index2, - mult_index, - half_order, - inversion_problem, - num_points, - num_distinct_knots, - num_poles ; + mult_index = 0, + half_order = 0, + inversion_problem = 0, + num_points = 0, + num_distinct_knots = 0, + num_poles = 0 ; - Standard_Real period ; + Standard_Real period = NAN ; gp_Pnt a_point ; @@ -690,18 +690,18 @@ void GeomAPI_Interpolate::PerformPeriodic() void GeomAPI_Interpolate::PerformNonPeriodic() { - Standard_Integer degree, - ii, - jj, - index, - index1, - index2, - index3, - mult_index, - inversion_problem, - num_points, - num_distinct_knots, - num_poles ; + Standard_Integer degree = 0, + ii = 0, + jj = 0, + index = 0, + index1 = 0, + index2 = 0, + index3 = 0, + mult_index = 0, + inversion_problem = 0, + num_points = 0, + num_distinct_knots = 0, + num_poles = 0 ; gp_Pnt a_point ; diff --git a/src/GeomAPI/GeomAPI_PointsToBSpline.cxx b/src/GeomAPI/GeomAPI_PointsToBSpline.cxx index 5c4bc6161d..21f7c10872 100644 --- a/src/GeomAPI/GeomAPI_PointsToBSpline.cxx +++ b/src/GeomAPI/GeomAPI_PointsToBSpline.cxx @@ -32,9 +32,9 @@ //function : GeomAPI_PointsToBSpline //purpose : //======================================================================= -GeomAPI_PointsToBSpline::GeomAPI_PointsToBSpline() +GeomAPI_PointsToBSpline::GeomAPI_PointsToBSpline() : myIsDone(Standard_False) { - myIsDone = Standard_False; + } @@ -48,9 +48,9 @@ GeomAPI_PointsToBSpline::GeomAPI_PointsToBSpline const Standard_Integer DegMin, const Standard_Integer DegMax, const GeomAbs_Shape Continuity, - const Standard_Real Tol3D) + const Standard_Real Tol3D) : myIsDone(Standard_False) { - myIsDone = Standard_False; + Init(Points,DegMin,DegMax,Continuity,Tol3D); } @@ -65,9 +65,9 @@ GeomAPI_PointsToBSpline::GeomAPI_PointsToBSpline const Standard_Integer DegMin, const Standard_Integer DegMax, const GeomAbs_Shape Continuity, - const Standard_Real Tol3D) + const Standard_Real Tol3D) : myIsDone(Standard_False) { - myIsDone = Standard_False; + Init(Points,ParType,DegMin,DegMax,Continuity,Tol3D); } @@ -83,9 +83,9 @@ GeomAPI_PointsToBSpline::GeomAPI_PointsToBSpline const Standard_Integer DegMin, const Standard_Integer DegMax, const GeomAbs_Shape Continuity, - const Standard_Real Tol3D) + const Standard_Real Tol3D) : myIsDone(Standard_False) { - myIsDone = Standard_False; + Init(Points,Params,DegMin,DegMax,Continuity,Tol3D); } @@ -101,9 +101,9 @@ GeomAPI_PointsToBSpline::GeomAPI_PointsToBSpline const Standard_Real W3, const Standard_Integer DegMax, const GeomAbs_Shape Continuity, - const Standard_Real Tol3D) + const Standard_Real Tol3D) : myIsDone(Standard_False) { - myIsDone = Standard_False; + Init(Points,W1,W2,W3,DegMax,Continuity,Tol3D); } @@ -261,7 +261,7 @@ void GeomAPI_PointsToBSpline::Init const GeomAbs_Shape Continuity, const Standard_Real Tol3D) { - Standard_Integer NbPoint = Points.Length(), i; + Standard_Integer NbPoint = Points.Length(), i = 0; Standard_Integer nbit = 2; diff --git a/src/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx b/src/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx index 90be6e5266..74ebe8a2b3 100644 --- a/src/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx +++ b/src/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,8 +39,8 @@ static void BuildParameters(const AppDef_MultiLine& theLine, const Approx_ParametrizationType theParT, TColStd_Array1OfReal& thePars) { - Standard_Integer i, j, nbP3d = theLine.NbPoints(); - Standard_Real dist; + Standard_Integer i = 0, j = 0, nbP3d = theLine.NbPoints(); + Standard_Real dist = NAN; Standard_Integer firstP = 1, lastP = theLine.NbMultiPoints(); const Standard_Integer aNbp = lastP - firstP + 1; @@ -99,10 +101,10 @@ static void BuildPeriodicTangent(const AppDef_MultiLine& theLine, return; } // - Standard_Integer i, nnpol, nnp = Min(nbpoints, 9); + Standard_Integer i = 0, nnpol = 0, nnp = Min(nbpoints, 9); nnpol = nnp; Standard_Integer lastp = Min(lastpt, firstpt + nnp - 1); - Standard_Real U; + Standard_Real U = NAN; AppParCurves_Constraint Cons = AppParCurves_TangencyPoint; if (nnp <= 4) { @@ -121,7 +123,7 @@ static void BuildPeriodicTangent(const AppDef_MultiLine& theLine, SQ1.Perform(P1); const AppParCurves_MultiCurve& C1 = SQ1.BezierValue(); U = 0.0; - Standard_Integer j, nbP3d = theLine.NbPoints(); + Standard_Integer j = 0, nbP3d = theLine.NbPoints(); gp_Pnt aP; gp_Vec aV; @@ -276,7 +278,7 @@ void GeomAPI_PointsToBSplineSurface::Interpolate(const TColgp_Array2OfPnt& Point const Approx_ParametrizationType ParType, const Standard_Boolean thePeriodic) { - Standard_Integer DegMin, DegMax; + Standard_Integer DegMin = 0, DegMax = 0; DegMin = DegMax = 3; GeomAbs_Shape CC = GeomAbs_C2; Standard_Real Tol3d = -1.0; @@ -324,7 +326,7 @@ void GeomAPI_PointsToBSplineSurface::Init(const TColgp_Array2OfPnt& Points, add = 2; } AppDef_MultiLine Line(Jmax-Jmin+1); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for (j = Jmin; j <= Jmax; j++) { AppDef_MultiPointConstraint MP(Imax-Imin+add, 0); @@ -490,7 +492,7 @@ void GeomAPI_PointsToBSplineSurface::Init(const TColgp_Array2OfPnt& Points, // first approximate the U isos: Standard_Integer NbPointJ = Jmax-Jmin+1; Standard_Integer NbPointI = Imax-Imin+1; - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; AppDef_MultiLine Line(NbPointJ); @@ -643,7 +645,7 @@ void GeomAPI_PointsToBSplineSurface::Interpolate(const TColStd_Array2OfReal& ZPo const Standard_Real Y0, const Standard_Real dY) { - Standard_Integer DegMin, DegMax; + Standard_Integer DegMin = 0, DegMax = 0; DegMin = DegMax = 3; Standard_Real Tol3D = -1.0; GeomAbs_Shape CC = GeomAbs_C2; @@ -669,14 +671,14 @@ void GeomAPI_PointsToBSplineSurface::Init(const TColStd_Array2OfReal& ZPoints, Standard_Integer Imax = ZPoints.UpperRow(); Standard_Integer Jmin = ZPoints.LowerCol(); Standard_Integer Jmax = ZPoints.UpperCol(); - Standard_Real length; + Standard_Real length = NAN; Standard_Real Tol2D = Tol3D; // first approximate the U isos: AppDef_MultiLine Line(Jmax-Jmin+1); math_Vector Param(Jmin, Jmax); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; // Standard_Real X, Y; length = dY * (Jmax-Jmin); diff --git a/src/GeomAPI/GeomAPI_ProjectPointOnCurve.cxx b/src/GeomAPI/GeomAPI_ProjectPointOnCurve.cxx index 1b15896797..c4ac712b2e 100644 --- a/src/GeomAPI/GeomAPI_ProjectPointOnCurve.cxx +++ b/src/GeomAPI/GeomAPI_ProjectPointOnCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -74,7 +76,7 @@ GeomAPI_ProjectPointOnCurve::GeomAPI_ProjectPointOnCurve() // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtPC.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtPC.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtPC.NbExt(); i++) { @@ -109,7 +111,7 @@ GeomAPI_ProjectPointOnCurve::GeomAPI_ProjectPointOnCurve() // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtPC.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtPC.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtPC.NbExt(); i++) { @@ -146,7 +148,7 @@ GeomAPI_ProjectPointOnCurve::GeomAPI_ProjectPointOnCurve() myIsDone=myExtPC.IsDone() && ( myExtPC.NbExt() > 0); if (myIsDone) { // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtPC.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtPC.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtPC.NbExt(); i++) { diff --git a/src/GeomAPI/GeomAPI_ProjectPointOnCurve.hxx b/src/GeomAPI/GeomAPI_ProjectPointOnCurve.hxx index 6f2deabaac..fa6dffff63 100644 --- a/src/GeomAPI/GeomAPI_ProjectPointOnCurve.hxx +++ b/src/GeomAPI/GeomAPI_ProjectPointOnCurve.hxx @@ -123,8 +123,8 @@ Standard_EXPORT operator Standard_Real() const; private: - Standard_Boolean myIsDone; - Standard_Integer myIndex; + Standard_Boolean myIsDone{}; + Standard_Integer myIndex{}; Extrema_ExtPC myExtPC; GeomAdaptor_Curve myC; diff --git a/src/GeomAPI/GeomAPI_ProjectPointOnSurf.cxx b/src/GeomAPI/GeomAPI_ProjectPointOnSurf.cxx index c04bcce8af..a147b95d50 100644 --- a/src/GeomAPI/GeomAPI_ProjectPointOnSurf.cxx +++ b/src/GeomAPI/GeomAPI_ProjectPointOnSurf.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -95,7 +97,7 @@ GeomAPI_ProjectPointOnSurf::GeomAPI_ProjectPointOnSurf() if ( myIsDone) { // evaluate the lower distance and its index; - Standard_Real Dist2, Dist2Min = myExtPS.SquareDistance(1); + Standard_Real Dist2 = NAN, Dist2Min = myExtPS.SquareDistance(1); myIndex = 1; for ( Standard_Integer i = 2; i <= myExtPS.NbExt(); i++) { @@ -133,7 +135,7 @@ GeomAPI_ProjectPointOnSurf::GeomAPI_ProjectPointOnSurf() //myExtPS = Extrema_ExtPS (P, TheSurface, Tolerance, Tolerance); //modified by NIZNHY-PKV Mon Apr 8 11:13:37 2002 f XXX - Standard_Real Umin, Usup, Vmin, Vsup; + Standard_Real Umin = NAN, Usup = NAN, Vmin = NAN, Vsup = NAN; Surface->Bounds(Umin, Usup, Vmin, Vsup); myGeomAdaptor.Load(Surface, Umin, Usup, Vmin, Vsup); // diff --git a/src/GeomAPI/GeomAPI_ProjectPointOnSurf.hxx b/src/GeomAPI/GeomAPI_ProjectPointOnSurf.hxx index 9d08f3762c..335e66bd7c 100644 --- a/src/GeomAPI/GeomAPI_ProjectPointOnSurf.hxx +++ b/src/GeomAPI/GeomAPI_ProjectPointOnSurf.hxx @@ -155,8 +155,8 @@ private: Standard_EXPORT void Init(); - Standard_Boolean myIsDone; - Standard_Integer myIndex; + Standard_Boolean myIsDone{}; + Standard_Integer myIndex{}; Extrema_ExtPS myExtPS; GeomAdaptor_Surface myGeomAdaptor; diff --git a/src/GeomAdaptor/GeomAdaptor.cxx b/src/GeomAdaptor/GeomAdaptor.cxx index 6d6f30d4ae..564f825288 100644 --- a/src/GeomAdaptor/GeomAdaptor.cxx +++ b/src/GeomAdaptor/GeomAdaptor.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -156,7 +158,7 @@ Handle(Geom_Surface) GeomAdaptor::MakeSurface(const Adaptor3d_Surface& HS, return S; // trim the surface if necassary. - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; S->Bounds(U1, U2, V1, V2); if ((HS.FirstUParameter() != U1 ) || (HS.LastUParameter () != U2 ) || diff --git a/src/GeomAdaptor/GeomAdaptor_Curve.cxx b/src/GeomAdaptor/GeomAdaptor_Curve.cxx index a68075eeb0..1e0ddfbc49 100644 --- a/src/GeomAdaptor/GeomAdaptor_Curve.cxx +++ b/src/GeomAdaptor/GeomAdaptor_Curve.cxx @@ -21,6 +21,8 @@ #define No_Standard_RangeError #define No_Standard_OutOfRange +#include + #include #include @@ -97,7 +99,7 @@ GeomAbs_Shape GeomAdaptor_Curve::LocalContinuity(const Standard_Real U1, Standard_Integer Nb = myBSplineCurve->NbKnots(); Standard_Integer Index1 = 0; Standard_Integer Index2 = 0; - Standard_Real newFirst, newLast; + Standard_Real newFirst = NAN, newLast = NAN; const TColStd_Array1OfReal& TK = myBSplineCurve->Knots(); const TColStd_Array1OfInteger& TM = myBSplineCurve->Multiplicities(); BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U1,myBSplineCurve->IsPeriodic(), @@ -109,7 +111,7 @@ GeomAbs_Shape GeomAdaptor_Curve::LocalContinuity(const Standard_Real U1, } if ( Abs(newLast-TK(Index2))IsPeriodic()) && (Index1 == Nb) ) Index1 = 1; @@ -266,7 +268,7 @@ Standard_Integer GeomAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const } Standard_Integer aDegree = myBSplineCurve->Degree(); - Standard_Integer aCont; + Standard_Integer aCont = 0; switch (S) { @@ -316,7 +318,7 @@ Standard_Integer GeomAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const // akm 05/04/02 (OCC278) If our curve is trimmed we must recalculate // the number of intervals obtained from the basis to // vvv reflect parameter bounds - Standard_Integer iNbBasisInt = C.NbIntervals(BaseS), iInt; + Standard_Integer iNbBasisInt = C.NbIntervals(BaseS), iInt = 0; if (iNbBasisInt>1) { TColStd_Array1OfReal rdfInter(1,1+iNbBasisInt); @@ -352,7 +354,7 @@ void GeomAdaptor_Curve::Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape } Standard_Integer aDegree = myBSplineCurve->Degree(); - Standard_Integer aCont; + Standard_Integer aCont = 0; switch (S) { @@ -402,7 +404,7 @@ void GeomAdaptor_Curve::Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape // akm 05/04/02 (OCC278) If our curve is trimmed we must recalculate // the array of intervals obtained from the basis to // vvv reflect parameter bounds - Standard_Integer iNbBasisInt = C.NbIntervals(BaseS), iInt; + Standard_Integer iNbBasisInt = C.NbIntervals(BaseS), iInt = 0; if (iNbBasisInt>1) { TColStd_Array1OfReal rdfInter(1,1+iNbBasisInt); @@ -746,12 +748,12 @@ Standard_Real GeomAdaptor_Curve::Resolution(const Standard_Real R3D) const return R3D / Handle(Geom_Ellipse)::DownCast (myCurve)->MajorRadius(); } case GeomAbs_BezierCurve: { - Standard_Real res; + Standard_Real res = NAN; Handle(Geom_BezierCurve)::DownCast (myCurve)->Resolution(R3D,res); return res; } case GeomAbs_BSplineCurve: { - Standard_Real res; + Standard_Real res = NAN; myBSplineCurve->Resolution(R3D,res); return res; } diff --git a/src/GeomAdaptor/GeomAdaptor_Surface.cxx b/src/GeomAdaptor/GeomAdaptor_Surface.cxx index 816af616f9..a68a45d5fb 100644 --- a/src/GeomAdaptor/GeomAdaptor_Surface.cxx +++ b/src/GeomAdaptor/GeomAdaptor_Surface.cxx @@ -21,6 +21,8 @@ #define No_Standard_RangeError #define No_Standard_OutOfRange +#include + #include #include @@ -80,7 +82,7 @@ GeomAbs_Shape LocalContinuity(Standard_Integer Degree, Standard_DomainError_Raise_if( (TK.Length()!=Nb || TM.Length()!=Nb )," "); Standard_Integer Index1 = 0; Standard_Integer Index2 = 0; - Standard_Real newFirst, newLast; + Standard_Real newFirst = NAN, newLast = NAN; BSplCLib::LocateParameter(Degree,TK,TM,PFirst,IsPeriodic,1,Nb,Index1,newFirst); BSplCLib::LocateParameter(Degree,TK,TM,PLast, IsPeriodic,1,Nb,Index2,newLast ); const Standard_Real EpsKnot = Precision::PConfusion(); @@ -92,7 +94,7 @@ GeomAbs_Shape LocalContinuity(Standard_Integer Degree, if (Index2!=Index1) { - Standard_Integer i, Multmax = TM(Index1+1); + Standard_Integer i = 0, Multmax = TM(Index1+1); for (i = Index1+1; i<=Index2; i++) { if (TM(i)>Multmax) Multmax=TM(i); } @@ -607,7 +609,7 @@ Standard_Boolean GeomAdaptor_Surface::IsUClosed() const if (!mySurface->IsUClosed()) return Standard_False; - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; mySurface->Bounds(U1,U2,V1,V2); if (mySurface->IsUPeriodic()) return (Abs(Abs(U1-U2)-Abs(myUFirst-myULast))IsVClosed()) return Standard_False; - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; mySurface->Bounds(U1,U2,V1,V2); if (mySurface->IsVPeriodic()) return (Abs(Abs(V1-V2)-Abs(myVFirst-myVLast))Resolution(R3d,Ures,Vres); return Ures; } case GeomAbs_BSplineSurface: { - Standard_Real Ures,Vres; + Standard_Real Ures = NAN,Vres = NAN; myBSplineSurface->Resolution(R3d,Ures,Vres); return Ures; } @@ -1079,13 +1081,13 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const } case GeomAbs_BezierSurface: { - Standard_Real Ures,Vres; + Standard_Real Ures = NAN,Vres = NAN; Handle(Geom_BezierSurface)::DownCast (mySurface)->Resolution(R3d,Ures,Vres); return Vres; } case GeomAbs_BSplineSurface: { - Standard_Real Ures,Vres; + Standard_Real Ures = NAN,Vres = NAN; myBSplineSurface->Resolution(R3d,Ures,Vres); return Vres; } @@ -1408,14 +1410,14 @@ Standard_Boolean GeomAdaptor_Surface::IfUVBound(const Standard_Real U, const Standard_Integer USide, const Standard_Integer VSide) const { - Standard_Integer Ideb,Ifin; + Standard_Integer Ideb = 0,Ifin = 0; Standard_Integer anUFKIndx = myBSplineSurface->FirstUKnotIndex(), anULKIndx = myBSplineSurface->LastUKnotIndex(), aVFKIndx = myBSplineSurface->FirstVKnotIndex(), aVLKIndx = myBSplineSurface->LastVKnotIndex(); myBSplineSurface->LocateU(U, PosTol, Ideb, Ifin, Standard_False); Standard_Boolean Local = (Ideb == Ifin); Span(USide,Ideb,Ifin,Ideb,Ifin,anUFKIndx,anULKIndx); - Standard_Integer IVdeb,IVfin; + Standard_Integer IVdeb = 0,IVfin = 0; myBSplineSurface->LocateV(V, PosTol, IVdeb, IVfin, Standard_False); if(IVdeb == IVfin) Local = Standard_True; Span(VSide,IVdeb,IVfin,IVdeb,IVfin,aVFKIndx,aVLKIndx); diff --git a/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx b/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx index 62eb29784e..4c27062dc7 100644 --- a/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx +++ b/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx @@ -18,6 +18,8 @@ #include #include +#include + #include #include #include @@ -159,7 +161,7 @@ void GeomAdaptor_SurfaceOfRevolution::Load(const gp_Ax1& V) Standard_Real First = myBasisCurve->FirstParameter(); Standard_Real Last = myBasisCurve->LastParameter(); Standard_Integer Ratio = 1; - Standard_Real Dist; + Standard_Real Dist = NAN; gp_Pnt PP; do { PP = myBasisCurve->Value(First+(Last-First)/Ratio); @@ -485,7 +487,7 @@ GeomAbs_SurfaceType GeomAdaptor_SurfaceOfRevolution::GetType() const }//case GeomAbs_Line: // case GeomAbs_Circle: { - Standard_Real MajorRadius, aR; + Standard_Real MajorRadius = NAN, aR = NAN; gp_Lin aLin(myAxis); // gp_Circ C = myBasisCurve->Circle(); diff --git a/src/GeomConvert/GeomConvert.cxx b/src/GeomConvert/GeomConvert.cxx index b607fd0b5d..d7659c5ce4 100644 --- a/src/GeomConvert/GeomConvert.cxx +++ b/src/GeomConvert/GeomConvert.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -76,7 +78,7 @@ static Handle(Geom_BSplineCurve) BSplineCurveBuilder TColStd_Array1OfReal Weights (1, NbPoles); TColStd_Array1OfReal Knots (1, NbKnots); TColStd_Array1OfInteger Mults (1, NbKnots); - Standard_Integer i; + Standard_Integer i = 0; gp_Pnt2d P2d; gp_Pnt P3d; for (i = 1; i <= NbPoles; i++) { @@ -482,11 +484,11 @@ public: GeomConvert_law_evaluator (const Handle(Geom2d_BSplineCurve)& theAncore) : myAncore (theAncore) {} - virtual void Evaluate (const Standard_Integer theDerivativeRequest, + void Evaluate (const Standard_Integer theDerivativeRequest, const Standard_Real* theStartEnd, const Standard_Real theParameter, Standard_Real& theResult, - Standard_Integer& theErrorCode) const + Standard_Integer& theErrorCode) const override { theErrorCode = 0; if (!myAncore.IsNull() && @@ -528,11 +530,11 @@ static Handle(Geom_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCurv Handle(Geom_BSplineCurve) res; Handle(TColStd_HArray1OfReal) resKnots; Handle(TColStd_HArray1OfInteger) resMults; - Standard_Real start_value,end_value; + Standard_Real start_value = NAN,end_value = NAN; Standard_Real tolerance=Precision::PConfusion(); - Standard_Integer resNbPoles,degree, - ii,jj, - aStatus; + Standard_Integer resNbPoles = 0,degree = 0, + ii = 0,jj = 0, + aStatus = 0; BS->Knots(BSKnots); //storage of the two BSpline BS->Multiplicities(BSMults); //features @@ -598,8 +600,8 @@ static Handle(Geom_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCurv static void Pretreatment(TColGeom_Array1OfBSplineCurve& tab) -{Standard_Integer i,j; - Standard_Real a; +{Standard_Integer i = 0,j = 0; + Standard_Real a = NAN; for (i=0;i<=(tab.Length()-1);i++){ if (tab(i)->IsRational()) { @@ -652,7 +654,7 @@ static Standard_Boolean NeedToBeTreated(const Handle(Geom_BSplineCurve)& BS) static Standard_Boolean Need2DegRepara(const TColGeom_Array1OfBSplineCurve& tab) -{Standard_Integer i; +{Standard_Integer i = 0; gp_Vec Vec1,Vec2; gp_Pnt Pint; Standard_Real Rapport=1.0e0; @@ -697,7 +699,7 @@ static void ReorderArrayOfG1Curves(TColGeom_Array1OfBSplineCurve& ArrayOfCurv const Standard_Integer StartIndex, const Standard_Real ClosedTolerance) -{Standard_Integer i; +{Standard_Integer i = 0; TColGeom_Array1OfBSplineCurve ArraybisOfCurves(0,ArrayOfCurves.Length()-1); //temporary TColStd_Array1OfReal ArraybisOfToler(0,ArrayOfToler.Length()-1); //arrays TColStd_Array1OfBoolean tabbisG1(0,tabG1.Length()-1); @@ -749,11 +751,11 @@ public: memcpy (myPolynomialCoefficient, thePolynomialCoefficient, sizeof(myPolynomialCoefficient)); } - virtual void Evaluate (const Standard_Integer theDerivativeRequest, + void Evaluate (const Standard_Integer theDerivativeRequest, const Standard_Real* /*theStartEnd*/, const Standard_Real theParameter, Standard_Real& theResult, - Standard_Integer& theErrorCode) const + Standard_Integer& theErrorCode) const override { theErrorCode = 0; PLib::EvalPolynomial (theParameter, @@ -766,7 +768,7 @@ public: private: - Standard_Real myPolynomialCoefficient[3]; + Standard_Real myPolynomialCoefficient[3]{}; }; @@ -784,11 +786,11 @@ private: {Standard_Integer nb_curve=ArrayOfCurves.Length(), nb_vertexG1=0, nb_group=0, - index=0,i,ii,j,jj, - indexmin, + index=0,i = 0,ii = 0,j = 0,jj = 0, + indexmin = 0, nb_vertex_group0=0; - Standard_Real lambda, //G1 coefficient - First; + Standard_Real lambda = NAN, //G1 coefficient + First = NAN; Standard_Real PreLast = 0.; GeomAbs_Shape Cont; gp_Vec Vec1,Vec2; //concecutive tangential vectors @@ -842,7 +844,7 @@ private: } ArrayOfConcatenated = new TColGeom_HArray1OfBSplineCurve(0,nb_group-1); - Standard_Boolean fusion; + Standard_Boolean fusion = 0; index=0; Pretreatment(ArrayOfCurves); @@ -876,7 +878,7 @@ private: Curve1->D1(Curve1->LastParameter(),Pint,Vec2); ArrayOfCurves(0)->D1(ArrayOfCurves(0)->FirstParameter(),Pint,Vec1); Standard_Real lambda2=Vec1.Magnitude()/Vec2.Magnitude(); - Standard_Real tmax,a,b,c, + Standard_Real tmax = NAN,a = NAN,b = NAN,c = NAN, umin=Curve1->FirstParameter(),umax=Curve1->LastParameter(); tmax=2*lambda*(umax-umin)/(1+lambda*lambda2); a=(lambda*lambda2-1)/(2*lambda*tmax); @@ -904,7 +906,7 @@ private: BSplCLib::KnotSequence(KnotC1,KnotC1Mults,FlatKnots); TColgp_Array1OfPnt NewPoles(1,FlatKnots.Length()-(2*Curve1->Degree()+1)); - Standard_Integer aStatus; + Standard_Integer aStatus = 0; TColStd_Array1OfReal Curve1Weights(1,Curve1->NbPoles()); Curve1->Weights(Curve1Weights); for (ii=1;ii<=Curve1->NbPoles();ii++) @@ -1009,13 +1011,13 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv const Standard_Real AngularTolerance) {Standard_Integer nb_curve=ArrayOfCurves.Length(), - nb_vertexG1, + nb_vertexG1 = 0, nb_group=0, - index=0,i,ii,j,jj, - indexmin, + index=0,i = 0,ii = 0,j = 0,jj = 0, + indexmin = 0, nb_vertex_group0=0; - Standard_Real lambda, //G1 coefficient - First; + Standard_Real lambda = NAN, //G1 coefficient + First = NAN; Standard_Real PreLast = 0.; GeomAbs_Shape Cont; @@ -1077,7 +1079,7 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv ArrayOfConcatenated = new TColGeom_HArray1OfBSplineCurve(0,nb_group-1); - Standard_Boolean fusion; + Standard_Boolean fusion = 0; Standard_Integer k=0; index=0; Pretreatment(ArrayOfCurves); @@ -1119,7 +1121,7 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv Curve1->D1(Curve1->LastParameter(),Pint,Vec2); ArrayOfCurves(0)->D1(ArrayOfCurves(0)->FirstParameter(),Pint,Vec1); Standard_Real lambda2=Vec1.Magnitude()/Vec2.Magnitude(); - Standard_Real tmax,a,b,c, + Standard_Real tmax = NAN,a = NAN,b = NAN,c = NAN, umin=Curve1->FirstParameter(),umax=Curve1->LastParameter(); tmax=2*lambda*(umax-umin)/(1+lambda*lambda2); a=(lambda*lambda2-1)/(2*lambda*tmax); @@ -1147,7 +1149,7 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv BSplCLib::KnotSequence(KnotC1,KnotC1Mults,FlatKnots); TColgp_Array1OfPnt NewPoles(1,FlatKnots.Length()-(2*Curve1->Degree()+1)); - Standard_Integer aStatus; + Standard_Integer aStatus = 0; TColStd_Array1OfReal Curve1Weights(1,Curve1->NbPoles()); Curve1->Weights(Curve1Weights); for (ii=1;ii<=Curve1->NbPoles();ii++) @@ -1248,7 +1250,7 @@ void GeomConvert::C0BSplineToC1BSplineCurve(Handle(Geom_BSplineCurve)& BS, const Standard_Real AngularTol) { - Standard_Boolean fusion; + Standard_Boolean fusion = 0; Handle(TColGeom_HArray1OfBSplineCurve) ArrayOfConcatenated; //the array with the resulting curves @@ -1257,7 +1259,7 @@ void GeomConvert::C0BSplineToC1BSplineCurve(Handle(Geom_BSplineCurve)& BS, GeomConvert_CompCurveToBSplineCurve C (ArrayOfConcatenated->Value(0)); if (ArrayOfConcatenated->Length()>=2){ - Standard_Integer i; + Standard_Integer i = 0; for (i=1;iLength();i++){ fusion=C.Add(ArrayOfConcatenated->Value(i),tolerance); if (fusion==Standard_False) @@ -1296,8 +1298,8 @@ void GeomConvert::C0BSplineToArrayOfC1BSplineCurve( {TColStd_Array1OfInteger BSMults(1,BS->NbKnots()); TColStd_Array1OfReal BSKnots(1,BS->NbKnots()); - Standard_Integer i,j,nbcurveC1=1; - Standard_Real U1,U2; + Standard_Integer i = 0,j = 0,nbcurveC1=1; + Standard_Real U1 = NAN,U2 = NAN; Standard_Boolean closed_flag= Standard_False ; gp_Pnt point; gp_Vec V1,V2; diff --git a/src/GeomConvert/GeomConvert_1.cxx b/src/GeomConvert/GeomConvert_1.cxx index c3a6b3a85b..b09a42dc20 100644 --- a/src/GeomConvert/GeomConvert_1.cxx +++ b/src/GeomConvert/GeomConvert_1.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -82,7 +84,7 @@ static Handle(Geom_BSplineSurface) BSplineSurfaceBuilder (const Convert_Elementa Array1OfReal VKnots (1, NbVKnots); Array1OfInteger UMults (1, NbUKnots); Array1OfInteger VMults (1, NbVKnots); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for (j = 1; j <= NbVPoles; j++) { for (i = 1; i <= NbUPoles; i++) { Poles (i, j) = Convert.Pole (i, j); @@ -320,7 +322,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface (const Handle(Geom_Surface)& Sr) { - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; Sr->Bounds (U1, U2, V1, V2); Standard_Real UFirst = Min (U1, U2); Standard_Real ULast = Max (U1, U2); @@ -518,8 +520,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface new Geom_TrimmedCurve( Meridian, VFirst, VLast); C = GeomConvert::CurveToBSplineCurve (CT); } - Standard_Integer NbUPoles, NbUKnots; - Standard_Integer NbVPoles, NbVKnots; + Standard_Integer NbUPoles = 0, NbUKnots = 0; + Standard_Integer NbVPoles = 0, NbVKnots = 0; Standard_Boolean periodic = Standard_False; // Poles of meridian = Vpoles @@ -530,8 +532,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface Weights.Init(1.); if ( C->IsRational()) C->Weights(Weights); - Standard_Integer nbUSpans; - Standard_Real AlfaU; + Standard_Integer nbUSpans = 0; + Standard_Real AlfaU = NAN; if (Strim->IsUPeriodic()) { NbUKnots = 4; nbUSpans = 3; @@ -550,7 +552,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface // Compute Knots and Mults TColStd_Array1OfReal UKnots(1, NbUKnots); TColStd_Array1OfInteger UMults( 1, NbUKnots); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for ( i = 1; i <= NbUKnots; i++) { UKnots(i) = UFirst + (i-1) * 2 * AlfaU; UMults(i) = 2; @@ -683,7 +685,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface else if (Surf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) { Handle(Geom_BSplineSurface) BS = Handle(Geom_BSplineSurface)::DownCast(Surf->Copy()); - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; BS->Bounds(umin, umax, vmin, vmax); if (!BS->IsUPeriodic()) { if (U1 < umin) @@ -707,7 +709,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface else { Standard_Real Tol3d=1.e-4; - Standard_Integer MaxDegree =14, MaxSeg; + Standard_Integer MaxDegree =14, MaxSeg = 0; GeomAbs_Shape cont; GeomAdaptor_Surface AS(Sr); if (AS.NbUIntervals(GeomAbs_C2) > 1 || AS.NbVIntervals(GeomAbs_C2) > 1 ) @@ -752,8 +754,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface Handle(Geom_BSplineCurve) C = GeomConvert::CurveToBSplineCurve (Meridian); - Standard_Integer NbUPoles, NbUKnots; - Standard_Integer NbVPoles, NbVKnots; + Standard_Integer NbUPoles = 0, NbUKnots = 0; + Standard_Integer NbVPoles = 0, NbVKnots = 0; Standard_Boolean periodic = Standard_True; // Poles of meridian = Vpoles @@ -764,7 +766,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface Weights.Init(1.); if ( C->IsRational()) C->Weights(Weights); - Standard_Real AlfaU; + Standard_Real AlfaU = NAN; NbUKnots = 4; AlfaU = M_PI / 3.; NbUPoles = 6; @@ -772,7 +774,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface // Compute Knots and Mults TColStd_Array1OfReal UKnots(1, NbUKnots); TColStd_Array1OfInteger UMults( 1, NbUKnots); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for ( i = 1; i <= NbUKnots; i++) { UKnots(i) = UFirst + (i-1) * 2 * AlfaU; UMults(i) = 2; @@ -862,7 +864,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface else { // In other cases => Approx Standard_Real Tol3d=1.e-4; - Standard_Integer MaxDegree = 14, MaxSeg; + Standard_Integer MaxDegree = 14, MaxSeg = 0; GeomAbs_Shape ucont = GeomAbs_C0, vcont = GeomAbs_C0; GeomAdaptor_Surface AS(Sr); // diff --git a/src/GeomConvert/GeomConvert_ApproxCurve.cxx b/src/GeomConvert/GeomConvert_ApproxCurve.cxx index 3c4da08d27..bac162c3f7 100644 --- a/src/GeomConvert/GeomConvert_ApproxCurve.cxx +++ b/src/GeomConvert/GeomConvert_ApproxCurve.cxx @@ -39,16 +39,16 @@ class GeomConvert_ApproxCurve_Eval : public AdvApprox_EvaluatorFunction Standard_Real First, Standard_Real Last) : fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; } - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Handle(Adaptor3d_Curve) fonct; - Standard_Real StartEndSav[2]; + Standard_Real StartEndSav[2]{}; }; void GeomConvert_ApproxCurve_Eval::Evaluate (Standard_Integer *Dimension, diff --git a/src/GeomConvert/GeomConvert_ApproxCurve.hxx b/src/GeomConvert/GeomConvert_ApproxCurve.hxx index a18c4164ab..1315b83825 100644 --- a/src/GeomConvert/GeomConvert_ApproxCurve.hxx +++ b/src/GeomConvert/GeomConvert_ApproxCurve.hxx @@ -89,10 +89,10 @@ private: Standard_EXPORT void Approximate (const Handle(Adaptor3d_Curve)& theCurve, const Standard_Real theTol3d, const GeomAbs_Shape theOrder, const Standard_Integer theMaxSegments, const Standard_Integer theMaxDegree); - Standard_Boolean myIsDone; - Standard_Boolean myHasResult; + Standard_Boolean myIsDone{}; + Standard_Boolean myHasResult{}; Handle(Geom_BSplineCurve) myBSplCurve; - Standard_Real myMaxError; + Standard_Real myMaxError{}; }; diff --git a/src/GeomConvert/GeomConvert_ApproxSurface.cxx b/src/GeomConvert/GeomConvert_ApproxSurface.cxx index 545c7dd1e3..c61e6ac866 100644 --- a/src/GeomConvert/GeomConvert_ApproxSurface.cxx +++ b/src/GeomConvert/GeomConvert_ApproxSurface.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -33,7 +35,7 @@ public: GeomConvert_ApproxSurface_Eval (const Handle(Adaptor3d_Surface)& theAdaptor) : myAdaptor (theAdaptor) {} - virtual void Evaluate (Standard_Integer* theDimension, + void Evaluate (Standard_Integer* theDimension, Standard_Real* theUStartEnd, Standard_Real* theVStartEnd, Standard_Integer* theFavorIso, @@ -43,7 +45,7 @@ public: Standard_Integer* theUOrder, Standard_Integer* theVOrder, Standard_Real* theResult, - Standard_Integer* theErrorCode) const; + Standard_Integer* theErrorCode) const override; private: @@ -77,8 +79,8 @@ void GeomConvert_ApproxSurface_Eval::Evaluate (Standard_Integer * Dimension, { *ErrorCode = 0; // Standard_Integer idim; - Standard_Integer jpar; - Standard_Real Upar,Vpar; + Standard_Integer jpar = 0; + Standard_Real Upar = NAN,Vpar = NAN; // Dimension incorrecte if (*Dimension!=3) { @@ -346,7 +348,7 @@ void GeomConvert_ApproxSurface::Approximate(const Handle(Adaptor3d_Surface)& the // " Init du type d'iso" GeomAbs_IsoType IsoType = GeomAbs_IsoV; - Standard_Integer NbDec; + Standard_Integer NbDec = 0; NbDec = theSurf->NbUIntervals(GeomAbs_C2); TColStd_Array1OfReal UDec_C2(1, NbDec+1); diff --git a/src/GeomConvert/GeomConvert_ApproxSurface.hxx b/src/GeomConvert/GeomConvert_ApproxSurface.hxx index 30f5c68e35..d6370ebca0 100644 --- a/src/GeomConvert/GeomConvert_ApproxSurface.hxx +++ b/src/GeomConvert/GeomConvert_ApproxSurface.hxx @@ -96,10 +96,10 @@ private: Standard_EXPORT void Approximate (const Handle(Adaptor3d_Surface)& theSurf, const Standard_Real theTol3d, const GeomAbs_Shape theUContinuity, const GeomAbs_Shape theVContinuity, const Standard_Integer theMaxDegU, const Standard_Integer theMaxDegV, const Standard_Integer theMaxSegments, const Standard_Integer thePrecisCode); - Standard_Boolean myIsDone; - Standard_Boolean myHasResult; + Standard_Boolean myIsDone{}; + Standard_Boolean myHasResult{}; Handle(Geom_BSplineSurface) myBSplSurf; - Standard_Real myMaxError; + Standard_Real myMaxError{}; }; diff --git a/src/GeomConvert/GeomConvert_BSplineCurveToBezierCurve.cxx b/src/GeomConvert/GeomConvert_BSplineCurveToBezierCurve.cxx index 93b1c1b492..5cc41d719d 100644 --- a/src/GeomConvert/GeomConvert_BSplineCurveToBezierCurve.cxx +++ b/src/GeomConvert/GeomConvert_BSplineCurveToBezierCurve.cxx @@ -57,7 +57,7 @@ GeomConvert_BSplineCurveToBezierCurve::GeomConvert_BSplineCurveToBezierCurve Standard_Real Uf = U1, Ul = U2; Standard_Real PTol = ParametricTolerance/2 ; - Standard_Integer I1, I2; + Standard_Integer I1 = 0, I2 = 0; myCurve = Handle(Geom_BSplineCurve)::DownCast(BasisCurve->Copy()); myCurve->LocateU(U1, PTol, I1, I2); @@ -133,7 +133,7 @@ void GeomConvert_BSplineCurveToBezierCurve::Arcs void GeomConvert_BSplineCurveToBezierCurve::Knots (TColStd_Array1OfReal& TKnots) const { - Standard_Integer ii, kk; + Standard_Integer ii = 0, kk = 0; for (ii = 1, kk = TKnots.Lower(); ii <=myCurve->NbKnots(); ii++, kk++) TKnots(kk) = myCurve->Knot(ii); diff --git a/src/GeomConvert/GeomConvert_BSplineSurfaceKnotSplitting.cxx b/src/GeomConvert/GeomConvert_BSplineSurfaceKnotSplitting.cxx index 49852e2144..17bd177ced 100644 --- a/src/GeomConvert/GeomConvert_BSplineSurfaceKnotSplitting.cxx +++ b/src/GeomConvert/GeomConvert_BSplineSurfaceKnotSplitting.cxx @@ -43,7 +43,7 @@ const Standard_Integer VContinuityRange Standard_Integer LastVIndex = BasisSurface->LastVKnotIndex (); Standard_Integer UDegree = BasisSurface->UDegree (); Standard_Integer VDegree = BasisSurface->VDegree (); - Standard_Integer i; + Standard_Integer i = 0; @@ -167,7 +167,7 @@ Array1OfInteger& USplit, Array1OfInteger& VSplit ) const { - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = 1; i <= usplitIndexes->Length(); i++){ USplit (i) = usplitIndexes->Value (i); } diff --git a/src/GeomConvert/GeomConvert_BSplineSurfaceToBezierSurface.cxx b/src/GeomConvert/GeomConvert_BSplineSurfaceToBezierSurface.cxx index 917cdb35b5..68160bed38 100644 --- a/src/GeomConvert/GeomConvert_BSplineSurfaceToBezierSurface.cxx +++ b/src/GeomConvert/GeomConvert_BSplineSurfaceToBezierSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -30,7 +32,7 @@ GeomConvert_BSplineSurfaceToBezierSurface::GeomConvert_BSplineSurfaceToBezierSurface(const Handle(Geom_BSplineSurface)& BasisSurface) { mySurface = Handle(Geom_BSplineSurface)::DownCast(BasisSurface->Copy()); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; mySurface->Bounds(U1,U2,V1,V2); mySurface->Segment(U1,U2,V1,V2); mySurface->IncreaseUMultiplicity(mySurface->FirstUKnotIndex(), @@ -60,7 +62,7 @@ GeomConvert_BSplineSurfaceToBezierSurface::GeomConvert_BSplineSurfaceToBezierSur throw Standard_DomainError("GeomConvert_BSplineSurfaceToBezierSurface"); Standard_Real Uf=U1, Ul=U2, Vf=V1, Vl=V2, PTol = ParametricTolerance/2; - Standard_Integer I1, I2; + Standard_Integer I1 = 0, I2 = 0; mySurface = Handle(Geom_BSplineSurface)::DownCast(BasisSurface->Copy()); @@ -162,7 +164,7 @@ void GeomConvert_BSplineSurfaceToBezierSurface::Patches void GeomConvert_BSplineSurfaceToBezierSurface::UKnots (TColStd_Array1OfReal& TKnots) const { - Standard_Integer ii, kk; + Standard_Integer ii = 0, kk = 0; for (ii = 1, kk = TKnots.Lower(); ii <= mySurface->NbUKnots(); ii++, kk++) TKnots(kk) = mySurface->UKnot(ii); @@ -176,7 +178,7 @@ void GeomConvert_BSplineSurfaceToBezierSurface::UKnots void GeomConvert_BSplineSurfaceToBezierSurface::VKnots (TColStd_Array1OfReal& TKnots) const { - Standard_Integer ii, kk; + Standard_Integer ii = 0, kk = 0; for (ii = 1, kk = TKnots.Lower(); ii <= mySurface->NbVKnots(); ii++, kk++) TKnots(kk) = mySurface->VKnot(ii); diff --git a/src/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx b/src/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx index 532c9ed409..8de002e386 100644 --- a/src/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx +++ b/src/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -31,13 +33,13 @@ // ============================================================================ GeomConvert_CompBezierSurfacesToBSplineSurface:: -GeomConvert_CompBezierSurfacesToBSplineSurface(const TColGeom_Array2OfBezierSurface& Beziers) +GeomConvert_CompBezierSurfacesToBSplineSurface(const TColGeom_Array2OfBezierSurface& Beziers) : myDone(Standard_True), myUKnots(new (TColStd_HArray1OfReal) (1, Beziers.ColLength()+1)) // ============================================================================ { - Standard_Integer ii; - myDone = Standard_True; + Standard_Integer ii = 0; + // Choix des noeuds - myUKnots = new (TColStd_HArray1OfReal) (1, Beziers.ColLength()+1); + for (ii=0; iiLength(); ii++) { myUKnots->SetValue(ii+1, ii); } myVKnots = new (TColStd_HArray1OfReal) (1, Beziers.RowLength()+1); @@ -53,22 +55,22 @@ GeomConvert_CompBezierSurfacesToBSplineSurface:: GeomConvert_CompBezierSurfacesToBSplineSurface( const TColGeom_Array2OfBezierSurface& Beziers, const Standard_Real Tolerance, - const Standard_Boolean RemoveKnots) + const Standard_Boolean RemoveKnots) : myDone(Standard_True), myUKnots(new (TColStd_HArray1OfReal) (1, Beziers.ColLength()+1)), myVKnots(new (TColStd_HArray1OfReal) (1, Beziers.RowLength()+1)) // ============================================================================ { - Standard_Integer ii, jj, multU=0, multV, minus; - Standard_Boolean Ok; + Standard_Integer ii = 0, jj = 0, multU=0, multV = 0, minus = 0; + Standard_Boolean Ok = 0; gp_Vec vec; - Standard_Real V1, V2, V3, Ratio, L1, L2, Tol, val; + Standard_Real V1 = NAN, V2 = NAN, V3 = NAN, Ratio = NAN, L1 = NAN, L2 = NAN, Tol = NAN, val = NAN; gp_Pnt P1, P2, P3; Handle(Geom_Curve) FirstCurve, SecondCurve; - myDone = Standard_True; + // Choix des noeuds - myUKnots = new (TColStd_HArray1OfReal) (1, Beziers.ColLength()+1); - myVKnots = new (TColStd_HArray1OfReal) (1, Beziers.RowLength()+1); + + // --> en U myUKnots->SetValue(1, 0); @@ -220,19 +222,19 @@ GeomConvert_CompBezierSurfacesToBSplineSurface( const TColStd_Array1OfReal& VKnots, const GeomAbs_Shape UContinuity, const GeomAbs_Shape VContinuity, - const Standard_Real Tolerance) + const Standard_Real Tolerance) : myDone(Standard_True), myUKnots(new (TColStd_HArray1OfReal) (1, Beziers.ColLength()+1)), myVKnots(new (TColStd_HArray1OfReal) (1, Beziers.RowLength()+1)) // ============================================================================ { Standard_Integer decu=0, decv=0; - Standard_Boolean Ok; + Standard_Boolean Ok = 0; - myDone = Standard_True; + // Recuperation des noeuds - myUKnots = new (TColStd_HArray1OfReal) (1, Beziers.ColLength()+1); + myUKnots->ChangeArray1() = UKnots; - myVKnots = new (TColStd_HArray1OfReal) (1, Beziers.RowLength()+1); + myVKnots->ChangeArray1() = VKnots; // Calcul des Poles @@ -279,7 +281,7 @@ GeomConvert_CompBezierSurfacesToBSplineSurface( if ( (decu>0) || (decv>0) ) { - Standard_Integer ii; + Standard_Integer ii = 0; Standard_Integer multU = myUDegree - decu; Standard_ConstructionError_Raise_if( ((multU <= 0) && (myUKnots->Length()>2)) , @@ -328,7 +330,7 @@ void GeomConvert_CompBezierSurfacesToBSplineSurface::Perform( const TColGeom_Array2OfBezierSurface& Beziers) // ================================================================================ { - Standard_Integer IU, IV; + Standard_Integer IU = 0, IV = 0; // (1) Determination des degrees et si le resultat est rationnel. isrational = Standard_False; @@ -355,8 +357,8 @@ void GeomConvert_CompBezierSurfacesToBSplineSurface::Perform( // (2) Boucle sur les carreaux ----------------------------- Handle(Geom_BezierSurface) Patch; - Standard_Integer UIndex, VIndex, uindex, vindex, udeb, vdeb; - Standard_Integer upol, vpol, ii; + Standard_Integer UIndex = 0, VIndex = 0, uindex = 0, vindex = 0, udeb = 0, vdeb = 0; + Standard_Integer upol = 0, vpol = 0, ii = 0; myPoles = new (TColgp_HArray2OfPnt) diff --git a/src/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.hxx b/src/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.hxx index 95af63b920..f3fb11bc9e 100644 --- a/src/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.hxx +++ b/src/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.hxx @@ -286,14 +286,14 @@ private: Standard_EXPORT void Perform (const TColGeom_Array2OfBezierSurface& Beziers); - Standard_Integer myUDegree; - Standard_Integer myVDegree; + Standard_Integer myUDegree{}; + Standard_Integer myVDegree{}; Handle(TColStd_HArray1OfInteger) myVMults; Handle(TColStd_HArray1OfInteger) myUMults; Handle(TColStd_HArray1OfReal) myUKnots; Handle(TColStd_HArray1OfReal) myVKnots; Handle(TColgp_HArray2OfPnt) myPoles; - Standard_Boolean isrational; + Standard_Boolean isrational{}; Standard_Boolean myDone; diff --git a/src/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx b/src/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx index 93dc628426..b1e9f86572 100644 --- a/src/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx +++ b/src/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx @@ -17,6 +17,8 @@ // Modified: Fri Jul 10 11:23:35 1998 // JCT : Add WithRatio,MinM +#include + #include #include #include @@ -87,7 +89,7 @@ Add(const Handle(Geom_BoundedCurve)& NewCurve, return Standard_True; } - Standard_Boolean avant, apres; + Standard_Boolean avant = 0, apres = 0; myTol = Tolerance; Standard_Integer LBs = Bs->NbPoles(), LCb = myCurve->NbPoles(); @@ -132,9 +134,9 @@ void GeomConvert_CompCurveToBSplineCurve::Add( if (SecondCurve->Degree() < Deg) { SecondCurve->IncreaseDegree(Deg); } // Declarationd - Standard_Real L1, L2; - Standard_Integer ii, jj; - Standard_Real Ratio=1, Ratio1, Ratio2, Delta1, Delta2; + Standard_Real L1 = NAN, L2 = NAN; + Standard_Integer ii = 0, jj = 0; + Standard_Real Ratio=1, Ratio1 = NAN, Ratio2 = NAN, Delta1 = NAN, Delta2 = NAN; Standard_Integer NbP1 = FirstCurve->NbPoles(), NbP2 = SecondCurve->NbPoles(); Standard_Integer NbK1 = FirstCurve->NbKnots(), NbK2 = SecondCurve->NbKnots(); TColStd_Array1OfReal Noeuds (1, NbK1+NbK2-1); @@ -169,7 +171,7 @@ void GeomConvert_CompCurveToBSplineCurve::Add( } // Les Noeuds - Standard_Real eps; + Standard_Real eps = NAN; for (ii=1; ii<=NbK1; ii++) { Noeuds(ii) = Ratio1*FirstCurve->Knot(ii) - Delta1; if(ii > 1) { diff --git a/src/GeomConvert/GeomConvert_CurveToAnaCurve.cxx b/src/GeomConvert/GeomConvert_CurveToAnaCurve.cxx index 3038e88dfa..60efe69c3a 100644 --- a/src/GeomConvert/GeomConvert_CurveToAnaCurve.cxx +++ b/src/GeomConvert/GeomConvert_CurveToAnaCurve.cxx @@ -15,6 +15,8 @@ // for any damages, special or consequential, connected with its use. +#include + #include #include #include @@ -50,11 +52,11 @@ GeomConvert_CurveToAnaCurve::GeomConvert_CurveToAnaCurve(): } GeomConvert_CurveToAnaCurve::GeomConvert_CurveToAnaCurve(const Handle(Geom_Curve)& C) : - myGap(Precision::Infinite()), + myCurve(C), myGap(Precision::Infinite()), myConvType(GeomConvert_MinGap), myTarget(GeomAbs_Line) { - myCurve = C; + } void GeomConvert_CurveToAnaCurve::Init(const Handle(Geom_Curve)& C) @@ -106,7 +108,7 @@ Standard_Boolean GeomConvert_CurveToAnaCurve::IsLinear(const TColgp_Array1OfPnt& Standard_Real dMax = 0; Standard_Integer iMax1=0,iMax2=0; - Standard_Integer i; + Standard_Integer i = 0; for(i = 1; i < nbPoles; i++) for(Standard_Integer j = i+1; j <= nbPoles; j++) { Standard_Real dist = aPoles(i).SquareDistance(aPoles(j)); @@ -177,7 +179,7 @@ Handle(Geom_Line) GeomConvert_CurveToAnaCurve::ComputeLine (const Handle(Geom_Cu cf = c1; cl = c2; Handle(TColgp_HArray1OfPnt) Poles; - Standard_Integer nbPoles; + Standard_Integer nbPoles = 0; Handle(Geom_BSplineCurve) bsc = Handle(Geom_BSplineCurve)::DownCast(curve); if (!bsc.IsNull()) { nbPoles = bsc->NbPoles(); @@ -199,7 +201,7 @@ Handle(Geom_Line) GeomConvert_CurveToAnaCurve::ComputeLine (const Handle(Geom_Cu Standard_Real dt = (c2 - c1) / (nbPoles - 1); Poles->SetValue(1, P1); Poles->SetValue(nbPoles, P2); - Standard_Integer i; + Standard_Integer i = 0; for (i = 2; i < nbPoles; ++i) { Poles->SetValue(i, curve->Value(c1 + (i - 1) * dt)); @@ -274,7 +276,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCircle (const Handle(Geom // Reste a controler que c est bien un cercle : prendre 20 points Standard_Real du = (c2-c1)/20; - Standard_Integer i; + Standard_Integer i = 0; Standard_Real aMax = 0.; for (i = 0; i <= 20; i ++) { Standard_Real u = c1+(du*i); @@ -335,7 +337,7 @@ static Standard_Boolean IsArrayPntPlanar(const Handle(TColgp_HArray1OfPnt)& HAP, return Standard_False; gp_Vec NV = V1.Crossed(V2); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= 3; ++i) { if (Precision::IsInfinite(NV.Coord(i))) @@ -374,7 +376,7 @@ static Standard_Boolean ConicDefinition gp_Pnt& Center, gp_Dir& MainAxis, Standard_Real& Rmin, Standard_Real& Rmax ) { Standard_Real Xcen = 0.,Ycen = 0., Xax = 0.,Yax = 0.; - Standard_Real b,d,e; + Standard_Real b = NAN,d = NAN,e = NAN; // conic : a*x2 + 2*b*x*y + c*y2 + 2*d*x + 2*e*y + f = 0. //Equation (a,b,c,d,e,f); b = b1/2.; d = d1/2.; e = e1/2.; // chgt de variable @@ -399,8 +401,8 @@ static Standard_Boolean ConicDefinition Standard_Real term1 = a-c; Standard_Real term2 = 2*b; - Standard_Real cos2t; - Standard_Real auxil; + Standard_Real cos2t = NAN; + Standard_Real auxil = NAN; if (Abs(term2) <= eps && Abs(term1) <= eps) { cos2t = 1.; @@ -483,8 +485,8 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeEllipse(const Handle(Geom Handle(Geom_Curve) res; Standard_Real prec = Precision::PConfusion(); - Standard_Real AF,BF,CF,DF,EF,Q1,Q2,Q3,c2n; - Standard_Integer i; + Standard_Real AF = NAN,BF = NAN,CF = NAN,DF = NAN,EF = NAN,Q1 = NAN,Q2 = NAN,Q3 = NAN,c2n = NAN; + Standard_Integer i = 0; gp_Pnt PStart = c3d->Value(c1); gp_Pnt PEnd = c3d->Value(c2); @@ -531,7 +533,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeEllipse(const Handle(Geom math_Matrix Dt(1, 5, 1, 5); math_Vector F(1, 5), Sl(1, 5); - Standard_Real XN,YN,ZN = 0.; + Standard_Real XN = NAN,YN = NAN,ZN = 0.; gp_Pnt PT,PP; for(i=1; i<=5; i++) { PT = AP->Value(i).Transformed(Tr); @@ -560,7 +562,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeEllipse(const Handle(Geom Q2=AF*CF-BF*BF/4; Q3=AF+CF; - Standard_Real Rmax, Rmin; + Standard_Real Rmax = NAN, Rmin = NAN; gp_Pnt Center; gp_Dir MainAxis; Standard_Boolean IsParab = Standard_False, IsEllip = Standard_False; @@ -651,7 +653,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCurve(const Handle(Geom_C { cf = c1; cl = c2; Handle(Geom_Curve) c3d, newc3d[3]; - Standard_Integer i, imin = -1; + Standard_Integer i = 0, imin = -1; c3d = theC3d; if (c3d.IsNull()) return newc3d[imin]; gp_Pnt P1 = c3d->Value(c1); diff --git a/src/GeomConvert/GeomConvert_FuncConeLSDist.cxx b/src/GeomConvert/GeomConvert_FuncConeLSDist.cxx index 6fc85d538b..fd190c067d 100644 --- a/src/GeomConvert/GeomConvert_FuncConeLSDist.cxx +++ b/src/GeomConvert/GeomConvert_FuncConeLSDist.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -51,10 +53,10 @@ Standard_Boolean GeomConvert_FuncConeLSDist::Value(const math_Vector& X, Standar gp_Ax3 aPos(aLoc, myDir); F = 0.; - Standard_Integer i; + Standard_Integer i = 0; for (i = myPoints->Lower(); i <= myPoints->Upper(); ++i) { - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; gp_Pnt aPi(myPoints->Value(i)); ElSLib::ConeParameters(aPos, anR, aSemiAngle, aPi, u, v); gp_Pnt aPp; diff --git a/src/GeomConvert/GeomConvert_FuncCylinderLSDist.cxx b/src/GeomConvert/GeomConvert_FuncCylinderLSDist.cxx index af9e83a9a3..bcfbabeef8 100644 --- a/src/GeomConvert/GeomConvert_FuncCylinderLSDist.cxx +++ b/src/GeomConvert/GeomConvert_FuncCylinderLSDist.cxx @@ -48,7 +48,7 @@ Standard_Boolean GeomConvert_FuncCylinderLSDist::Value(const math_Vector& X,Stan Standard_Real anR2 = X(4)*X(4); F = 0.; - Standard_Integer i; + Standard_Integer i = 0; for (i = myPoints->Lower(); i <= myPoints->Upper(); ++i) { gp_Vec aV(myPoints->Value(i) - aLoc); @@ -72,7 +72,7 @@ Standard_Boolean GeomConvert_FuncCylinderLSDist::Gradient(const math_Vector& X,m Standard_Real x = myDir.X(), y = myDir.Y(), z = myDir.Z(); G.Init(0.); - Standard_Integer i; + Standard_Integer i = 0; for (i = myPoints->Lower(); i <= myPoints->Upper(); ++i) { gp_Vec aV(myPoints->Value(i) - aLoc); @@ -110,7 +110,7 @@ Standard_Boolean GeomConvert_FuncCylinderLSDist::Values(const math_Vector& X,Sta F = 0.; G.Init(0.); - Standard_Integer i; + Standard_Integer i = 0; for (i = myPoints->Lower(); i <= myPoints->Upper(); ++i) { gp_Vec aV(myPoints->Value(i) - aLoc); diff --git a/src/GeomConvert/GeomConvert_FuncSphereLSDist.cxx b/src/GeomConvert/GeomConvert_FuncSphereLSDist.cxx index c2a5fe9594..9634bd73f4 100644 --- a/src/GeomConvert/GeomConvert_FuncSphereLSDist.cxx +++ b/src/GeomConvert/GeomConvert_FuncSphereLSDist.cxx @@ -48,7 +48,7 @@ Standard_Boolean GeomConvert_FuncSphereLSDist::Value(const math_Vector& X,Standa Standard_Real anR2 = X(4)*X(4); F = 0.; - Standard_Integer i; + Standard_Integer i = 0; for (i = myPoints->Lower(); i <= myPoints->Upper(); ++i) { Standard_Real d = (myPoints->Value(i) - aLoc).SquareModulus() - anR2; @@ -69,7 +69,7 @@ Standard_Boolean GeomConvert_FuncSphereLSDist::Gradient(const math_Vector& X,mat Standard_Real anR = X(4), anR2 = anR * anR; G.Init(0.); - Standard_Integer i; + Standard_Integer i = 0; for (i = myPoints->Lower(); i <= myPoints->Upper(); ++i) { gp_XYZ dLoc = myPoints->Value(i) - aLoc; @@ -96,7 +96,7 @@ Standard_Boolean GeomConvert_FuncSphereLSDist::Values(const math_Vector& X,Stand G.Init(0.); F = 0.; - Standard_Integer i; + Standard_Integer i = 0; for (i = myPoints->Lower(); i <= myPoints->Upper(); ++i) { gp_XYZ dLoc = myPoints->Value(i) - aLoc; diff --git a/src/GeomConvert/GeomConvert_SurfToAnaSurf.cxx b/src/GeomConvert/GeomConvert_SurfToAnaSurf.cxx index 4a6a8c125a..f3d4ac1356 100644 --- a/src/GeomConvert/GeomConvert_SurfToAnaSurf.cxx +++ b/src/GeomConvert/GeomConvert_SurfToAnaSurf.cxx @@ -17,6 +17,8 @@ //abv 06.01.99 fix of misprint //:p6 abv 26.02.99: make ConvertToPeriodic() return Null if nothing done +#include + #include #include #include @@ -77,7 +79,7 @@ void GeomConvert_SurfToAnaSurf::CheckVTrimForRevSurf(const Handle(Geom_SurfaceOf if (aNbExt == 0) return; - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer imin = 0; for (i = 1; i <= aNbExt; ++i) { @@ -117,7 +119,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinerCone(const Handle(Geom const Standard_Real theToler) { Handle(Geom_Surface) aNewSurf; - Standard_Real param1, param2, cf1, cf2, cl1, cl2, aGap1, aGap2; + Standard_Real param1 = NAN, param2 = NAN, cf1 = NAN, cf2 = NAN, cl1 = NAN, cl2 = NAN, aGap1 = NAN, aGap2 = NAN; Handle(Geom_Curve) firstiso, lastiso; Handle(Geom_Circle) firstisocirc, lastisocirc, midisocirc; gp_Dir isoline; @@ -140,7 +142,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinerCone(const Handle(Geom lastisocirc = Handle(Geom_Circle)::DownCast(GeomConvert_CurveToAnaCurve::ComputeCurve(lastiso, theToler, param1, param2, cf2, cl2, aGap2, GeomConvert_Target, GeomAbs_Circle)); if (!firstisocirc.IsNull() || !lastisocirc.IsNull()) { - Standard_Real R1, R2, R3; + Standard_Real R1 = NAN, R2 = NAN, R3 = NAN; gp_Pnt P1, P2, P3; if (!firstisocirc.IsNull()) { R1 = firstisocirc->Circ().Radius(); @@ -170,7 +172,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinerCone(const Handle(Geom //cone else if ((((Abs(R1)) > (Abs(R2))) && ((Abs(R2)) > (Abs(R3)))) || (((Abs(R3)) > (Abs(R2))) && ((Abs(R2)) > (Abs(R1))))) { - Standard_Real radius; + Standard_Real radius = NAN; gp_Ax3 Axes; Standard_Real semiangle = gp_Vec(isoline).Angle(gp_Vec(P3, P1)); @@ -198,7 +200,7 @@ static void GetLSGap(const Handle(TColgp_HArray1OfXYZ)& thePoints, const gp_Ax3& const Standard_Real theR, Standard_Real& theGap) { theGap = 0.; - Standard_Integer i; + Standard_Integer i = 0; gp_XYZ aLoc = thePos.Location().XYZ(); gp_Dir aDir = thePos.Direction(); for (i = thePoints->Lower(); i <= thePoints->Upper(); ++i) @@ -221,7 +223,7 @@ Standard_Boolean GeomConvert_SurfToAnaSurf::GetCylByLS(const Handle(TColgp_HArra return Standard_True; } - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer aNbVar = 4; @@ -250,7 +252,7 @@ Standard_Boolean GeomConvert_SurfToAnaSurf::GetCylByLS(const Handle(TColgp_HArra // Standard_Real aTol = Precision::Confusion(); - math_MultipleVarFunction* aPFunc; + math_MultipleVarFunction* aPFunc = nullptr; GeomConvert_FuncCylinderLSDist aFuncCyl(thePoints, thePos.Direction()); aPFunc = (math_MultipleVarFunction*)&aFuncCyl; // @@ -261,7 +263,7 @@ Standard_Boolean GeomConvert_SurfToAnaSurf::GetCylByLS(const Handle(TColgp_HArra aSteps(i) = (aLBnd(i) - aFBnd(i)) / aNbInt; } math_PSO aGlobSolver(aPFunc, aFBnd, aLBnd, aSteps); - Standard_Real aLSDist; + Standard_Real aLSDist = NAN; aGlobSolver.Perform(aSteps, aLSDist, aStartPoint); // gp_Pnt aLoc(aStartPoint(1), aStartPoint(2), aStartPoint(3)); @@ -345,8 +347,8 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinderByGaussField(const Ha Standard_Real anAvMaxCurv = 0., anAvMinCurv = 0., anAvR = 0, aSign = 1.; gp_XYZ anAvDir; gp_Dir aMinD, aMaxD; - Standard_Integer i, j, n = 0; - Standard_Real anU, aV; + Standard_Integer i = 0, j = 0, n = 0; + Standard_Real anU = NAN, aV = NAN; for (i = 1, anU = theU1 + du / 2.; i <= theNbU; ++i, anU += du) { for (j = 1, aV = theV1 + dv / 2.; j <= theNbV; ++j, aV += dv) @@ -480,10 +482,10 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryTorusSphere(const Handle(Geom const Standard_Boolean isTryUMajor) { Handle(Geom_Surface) newSurface; - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom_Curve) IsoCrv1; Handle(Geom_Curve) IsoCrv2; - Standard_Real aGap1, aGap2; + Standard_Real aGap1 = NAN, aGap2 = NAN; // initial radius Standard_Real R = circle->Circ().Radius(); // iso lines @@ -558,7 +560,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryTorusSphere(const Handle(Geom Standard_Real GeomConvert_SurfToAnaSurf::ComputeGap(const Handle(Geom_Surface)& theSurf, const Standard_Real theU1, const Standard_Real theU2, const Standard_Real theV1, const Standard_Real theV2, - const Handle(Geom_Surface) theNewSurf, const Standard_Real theTol) + const Handle(Geom_Surface)& theNewSurf, const Standard_Real theTol) { GeomAdaptor_Surface aGAS(theNewSurf); GeomAbs_SurfaceType aSType = aGAS.GetType(); @@ -592,12 +594,12 @@ Standard_Real GeomConvert_SurfToAnaSurf::ComputeGap(const Handle(Geom_Surface)& Standard_Real aGap = 0.; Standard_Boolean onSurface = Standard_True; - Standard_Real S, T; + Standard_Real S = NAN, T = NAN; gp_Pnt P3d, P3d2; const Standard_Integer NP = 21; - Standard_Real DU, DV; - Standard_Integer j, i; + Standard_Real DU = NAN, DV = NAN; + Standard_Integer j = 0, i = 0; DU = (theU2 - theU1) / (NP - 1); DV = (theV2 - theV1) / (NP - 1); Standard_Real DU2 = DU / 2., DV2 = DV / 2.; @@ -697,7 +699,7 @@ void GeomConvert_SurfToAnaSurf::Init (const Handle(Geom_Surface)& S) Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::ConvertToAnalytical (const Standard_Real InitialToler) { - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; mySurf->Bounds(U1, U2, V1, V2); if(Precision::IsInfinite(U1) && Precision::IsInfinite(U2) ) { U1 = -1.; @@ -764,7 +766,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::ConvertToAnalytical(const Standa GeomAbs_Cone, GeomAbs_Sphere, GeomAbs_Torus }; //Check boundaries - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; mySurf->Bounds(U1, U2, V1, V2); Standard_Boolean aDoSegment = Standard_False; Standard_Real aTolBnd = Precision::PConfusion(); @@ -863,7 +865,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::ConvertToAnalytical(const Standa Handle(Geom_Curve) UIso = aTempS->UIso(UMid); Handle(Geom_Curve) VIso = aTempS->VIso(VMid); - Standard_Real cuf, cul, cvf, cvl, aGap1, aGap2; + Standard_Real cuf = NAN, cul = NAN, cvf = NAN, cvl = NAN, aGap1 = NAN, aGap2 = NAN; Standard_Boolean aLineIso = Standard_False; Handle(Geom_Curve) umidiso = GeomConvert_CurveToAnaCurve::ComputeCurve(UIso, toler, V1, V2, cuf, cul, aGap1, GeomConvert_Simplest); diff --git a/src/GeomConvert/GeomConvert_SurfToAnaSurf.hxx b/src/GeomConvert/GeomConvert_SurfToAnaSurf.hxx index ee333f54aa..1ebfa63fd7 100644 --- a/src/GeomConvert/GeomConvert_SurfToAnaSurf.hxx +++ b/src/GeomConvert/GeomConvert_SurfToAnaSurf.hxx @@ -115,7 +115,7 @@ private: static Standard_Real ComputeGap(const Handle(Geom_Surface)& theSurf, const Standard_Real theU1, const Standard_Real theU2, const Standard_Real theV1, const Standard_Real theV2, - const Handle(Geom_Surface) theNewSurf, const Standard_Real theTol = RealLast()); + const Handle(Geom_Surface)& theNewSurf, const Standard_Real theTol = RealLast()); diff --git a/src/GeomEvaluator/GeomEvaluator_OffsetCurve.cxx b/src/GeomEvaluator/GeomEvaluator_OffsetCurve.cxx index 641221b9c5..f1a13a8abc 100644 --- a/src/GeomEvaluator/GeomEvaluator_OffsetCurve.cxx +++ b/src/GeomEvaluator/GeomEvaluator_OffsetCurve.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -408,8 +410,8 @@ Standard_Boolean GeomEvaluator_OffsetCurve::AdjustDerivative( static const Standard_Integer aMaxDerivOrder = 3; Standard_Boolean isDirectionChange = Standard_False; - Standard_Real anUinfium; - Standard_Real anUsupremum; + Standard_Real anUinfium = NAN; + Standard_Real anUsupremum = NAN; if (!myBaseAdaptor.IsNull()) { anUinfium = myBaseAdaptor->FirstParameter(); @@ -422,7 +424,7 @@ Standard_Boolean GeomEvaluator_OffsetCurve::AdjustDerivative( } static const Standard_Real DivisionFactor = 1.e-3; - Standard_Real du; + Standard_Real du = NAN; if ((anUsupremum >= RealLast()) || (anUinfium <= RealFirst())) du = 0.0; else @@ -439,7 +441,7 @@ Standard_Boolean GeomEvaluator_OffsetCurve::AdjustDerivative( V = BaseDN(theU, ++anIndex); } while ((V.SquareMagnitude() <= aTol) && anIndex < aMaxDerivOrder); - Standard_Real u; + Standard_Real u = NAN; if (theU - anUinfium < aDelta) u = theU + aDelta; diff --git a/src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx b/src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx index 6fac3fe0b1..bb52e6432d 100644 --- a/src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx +++ b/src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -47,8 +49,8 @@ static Standard_Boolean shiftPoint (const Standard_Real theUStart, const Standar const gp_Vec& theD1U, const gp_Vec& theD1V) { // Get parametric bounds and closure status - Standard_Real aUMin, aUMax, aVMin, aVMax; - Standard_Boolean isUPeriodic, isVPeriodic; + Standard_Real aUMin = NAN, aUMax = NAN, aVMin = NAN, aVMax = NAN; + Standard_Boolean isUPeriodic = 0, isVPeriodic = 0; if (! theSurf.IsNull()) { theSurf->Bounds (aUMin, aUMax, aVMin, aVMax); @@ -110,7 +112,7 @@ static void derivatives(Standard_Integer theMaxOrder, TColgp_Array2OfVec& theDerNUV, TColgp_Array2OfVec& theDerSurf) { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; gp_Pnt P; gp_Vec DL1U, DL1V, DL2U, DL2V, DL2UV, DL3U, DL3UUV, DL3UVV, DL3V; @@ -508,7 +510,7 @@ void GeomEvaluator_OffsetSurface::CalculateD0( TColgp_Array2OfVec DerNUV(0, MaxOrder, 0, MaxOrder); TColgp_Array2OfVec DerSurf(0, MaxOrder + 1, 0, MaxOrder + 1); - Standard_Integer OrderU, OrderV; + Standard_Integer OrderU = 0, OrderV = 0; Standard_Real Umin = 0, Umax = 0, Vmin = 0, Vmax = 0; Bounds(Umin, Umax, Vmin, Vmax); @@ -614,7 +616,7 @@ void GeomEvaluator_OffsetSurface::CalculateD1( return; } - Standard_Integer OrderU, OrderV; + Standard_Integer OrderU = 0, OrderV = 0; TColgp_Array2OfVec DerNUV(0, MaxOrder + 1, 0, MaxOrder + 1); TColgp_Array2OfVec DerSurf(0, MaxOrder + 2, 0, MaxOrder + 2); Standard_Real Umin = 0, Umax = 0, Vmin = 0, Vmax = 0; @@ -672,7 +674,7 @@ void GeomEvaluator_OffsetSurface::CalculateD2( CSLib::Normal(theD1U, theD1V, the_D1MagTol, NStatus, Normal); const Standard_Integer MaxOrder = (NStatus == CSLib_Defined) ? 0 : 3; - Standard_Integer OrderU, OrderV; + Standard_Integer OrderU = 0, OrderV = 0; TColgp_Array2OfVec DerNUV(0, MaxOrder + 2, 0, MaxOrder + 2); TColgp_Array2OfVec DerSurf(0, MaxOrder + 3, 0, MaxOrder + 3); @@ -745,7 +747,7 @@ void GeomEvaluator_OffsetSurface::CalculateD3( CSLib_NormalStatus NStatus; CSLib::Normal(theD1U, theD1V, the_D1MagTol, NStatus, Normal); const Standard_Integer MaxOrder = (NStatus == CSLib_Defined) ? 0 : 3; - Standard_Integer OrderU, OrderV; + Standard_Integer OrderU = 0, OrderV = 0; TColgp_Array2OfVec DerNUV(0, MaxOrder + 3, 0, MaxOrder + 3); TColgp_Array2OfVec DerSurf(0, MaxOrder + 4, 0, MaxOrder + 4); Standard_Real Umin = 0, Umax = 0, Vmin = 0, Vmax = 0; @@ -829,7 +831,7 @@ gp_Vec GeomEvaluator_OffsetSurface::CalculateDN( CSLib_NormalStatus NStatus; CSLib::Normal(theD1U, theD1V, the_D1MagTol, NStatus, Normal); const Standard_Integer MaxOrder = (NStatus == CSLib_Defined) ? 0 : 3; - Standard_Integer OrderU, OrderV; + Standard_Integer OrderU = 0, OrderV = 0; TColgp_Array2OfVec DerNUV(0, MaxOrder + theNu, 0, MaxOrder + theNv); TColgp_Array2OfVec DerSurf(0, MaxOrder + theNu + 1, 0, MaxOrder + theNv + 1); @@ -905,7 +907,7 @@ Standard_Boolean GeomEvaluator_OffsetSurface::ReplaceDerivative( Bounds(aUMin, aUMax, aVMin, aVMax); // Calculate step along non-zero derivative - Standard_Real aStep; + Standard_Real aStep = NAN; Handle(Adaptor3d_Surface) aSurfAdapt; if (!myBaseAdaptor.IsNull()) aSurfAdapt = myBaseAdaptor; diff --git a/src/GeomFill/GeomFill.cxx b/src/GeomFill/GeomFill.cxx index a972879a86..cd41839d02 100644 --- a/src/GeomFill/GeomFill.cxx +++ b/src/GeomFill/GeomFill.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -278,7 +280,7 @@ void GeomFill::Knots(const Convert_ParameterisationType TConv, { if ((TConv!=Convert_QuasiAngular) && (TConv!=Convert_Polynomial) ) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Real val = 0.; for (i=TKnots.Lower(); i<=TKnots.Upper(); i++) { TKnots(i) = val; @@ -317,7 +319,7 @@ void GeomFill::Mults(const Convert_ParameterisationType TConv, default : { // Cas rational classsique - Standard_Integer i; + Standard_Integer i = 0; TMults(TMults.Lower())=3; for (i=TMults.Lower()+1; i<=TMults.Upper()-1; i++) { TMults(i) = 2; @@ -348,7 +350,7 @@ Standard_Real GeomFill::GetTolerance(const Convert_ParameterisationType TConv, // afin d'eviter des tolerances d'approximation tendant vers 0 ! Handle(Geom_BSplineCurve) CtoBspl = GeomConvert::CurveToBSplineCurve(Sect, TConv); - Standard_Real Dist; + Standard_Real Dist = NAN; Dist = CtoBspl->Pole(1).Distance(CtoBspl->Pole(2)) + SpatialTol; return Dist*AngularTol/2; } @@ -374,8 +376,8 @@ void GeomFill::GetCircle( const Convert_ParameterisationType TConv, { // La classe de convertion - Standard_Integer i, jj; - Standard_Real Cosa,Sina,Angle,Alpha,Cosas2,lambda; + Standard_Integer i = 0, jj = 0; + Standard_Real Cosa = NAN,Sina = NAN,Angle = NAN,Alpha = NAN,Cosas2 = NAN,lambda = NAN; gp_Vec temp, np2; Standard_Integer low = Poles.Lower(); Standard_Integer upp = Poles.Upper(); @@ -459,9 +461,9 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, TColStd_Array1OfReal& Weights, TColStd_Array1OfReal& DWeights) { - Standard_Real Cosa,Sina,Cosas2,Sinas2,Angle,DAngle,Alpha,lambda,Dlambda; + Standard_Real Cosa = NAN,Sina = NAN,Cosas2 = NAN,Sinas2 = NAN,Angle = NAN,DAngle = NAN,Alpha = NAN,lambda = NAN,Dlambda = NAN; gp_Vec temp, np2, dnp2; - Standard_Integer i, jj; + Standard_Integer i = 0, jj = 0; Standard_Integer NbSpan=(Poles.Length()-1)/2; Standard_Integer low = Poles.Lower(); Standard_Integer upp = Poles.Upper(); @@ -597,11 +599,11 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, TColStd_Array1OfReal& DWeights, TColStd_Array1OfReal& D2Weights) { - Standard_Real Cosa,Sina,Cosas2,Sinas2; - Standard_Real Angle, DAngle, D2Angle, Alpha; - Standard_Real lambda, Dlambda, D2lambda, aux; + Standard_Real Cosa = NAN,Sina = NAN,Cosas2 = NAN,Sinas2 = NAN; + Standard_Real Angle = NAN, DAngle = NAN, D2Angle = NAN, Alpha = NAN; + Standard_Real lambda = NAN, Dlambda = NAN, D2lambda = NAN, aux = NAN; gp_Vec temp, dtemp, np2, dnp2, d2np2; - Standard_Integer i, jj; + Standard_Integer i = 0, jj = 0; Standard_Integer NbSpan=(Poles.Length()-1)/2; Standard_Integer low = Poles.Lower(); Standard_Integer upp = Poles.Upper(); diff --git a/src/GeomFill/GeomFill_BSplineCurves.cxx b/src/GeomFill/GeomFill_BSplineCurves.cxx index e0b1eceed5..b02cc5857b 100644 --- a/src/GeomFill/GeomFill_BSplineCurves.cxx +++ b/src/GeomFill/GeomFill_BSplineCurves.cxx @@ -65,8 +65,8 @@ static Standard_Boolean Arrange(const Handle(Geom_BSplineCurve)& C1, GC[2] = Handle(Geom_BSplineCurve)::DownCast(C3->Copy()); GC[3] = Handle(Geom_BSplineCurve)::DownCast(C4->Copy()); - Standard_Integer i,j; - Standard_Boolean Trouve; + Standard_Integer i = 0,j = 0; + Standard_Boolean Trouve = 0; for (i=1; i<=3; i++) { Trouve = Standard_False; @@ -152,7 +152,7 @@ static Standard_Integer SetSameDistribution(Handle(Geom_BSplineCurve)& C1, C2->SetKnots(K2); } - Standard_Integer NP,NK; + Standard_Integer NP = 0,NK = 0; if ( BSplCLib::PrepareInsertKnots(C1->Degree(),Standard_False, K1,M1,K2,&M2,NP,NK,Precision::PConfusion(), Standard_False)) { @@ -463,7 +463,7 @@ void GeomFill_BSplineCurves::Init TColgp_Array1OfPnt P2( 1, NbPoles); CC1->Poles(P1); CC2->Poles(P2); - Standard_Integer i; + Standard_Integer i = 0; for (i=1; i<=NbPoles; i++) { Poles(i, 1) = P1(i); Poles(i, 2) = P2(i); diff --git a/src/GeomFill/GeomFill_BezierCurves.cxx b/src/GeomFill/GeomFill_BezierCurves.cxx index 5c939bc09d..7b5535a251 100644 --- a/src/GeomFill/GeomFill_BezierCurves.cxx +++ b/src/GeomFill/GeomFill_BezierCurves.cxx @@ -55,7 +55,7 @@ static void SetSameWeights(TColStd_Array1OfReal& W1, Standard_Real A = ( W1( 1) * W2( 1)) / ( W1( NU) * W2( NV)); Standard_Real B = ( W3( 1) * W4( 1)) / ( W3( NU) * W4( NV)); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real Alfa = W1( NU) / W2( 1); for ( i=1; i<=NV; i++) { W2(i) *= Alfa; @@ -115,8 +115,8 @@ static Standard_Boolean Arrange(const Handle(Geom_BezierCurve)& C1, GC[2] = Handle(Geom_BezierCurve)::DownCast(C3->Copy()); GC[3] = Handle(Geom_BezierCurve)::DownCast(C4->Copy()); - Standard_Integer i,j; - Standard_Boolean Trouve; + Standard_Integer i = 0,j = 0; + Standard_Boolean Trouve = 0; for (i=1; i<=3; i++) { Trouve = Standard_False; @@ -385,7 +385,7 @@ void GeomFill_BezierCurves::Init(const Handle(Geom_BezierCurve)& C1, CC1->Poles(P1); CC2->Poles(P2); - Standard_Integer i; + Standard_Integer i = 0; for (i=1; i<=DegU+1; i++) { Poles(i, 1) = P1(i); Poles(i, 2) = P2(i); diff --git a/src/GeomFill/GeomFill_BoundWithSurf.cxx b/src/GeomFill/GeomFill_BoundWithSurf.cxx index 0ae0e2af78..1a7973be4c 100644 --- a/src/GeomFill/GeomFill_BoundWithSurf.cxx +++ b/src/GeomFill/GeomFill_BoundWithSurf.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -96,7 +98,7 @@ gp_Vec GeomFill_BoundWithSurf::Norm(const Standard_Real U) const // Handle(Adaptor3d_Surface)& S = myConS.GetSurface(); // Handle(Adaptor2d_Curve2d)& C2d = myConS.GetCurve(); - Standard_Real x,y; + Standard_Real x = NAN,y = NAN; Standard_Real w = U; if(!myPar.IsNull()) w = myPar->Value(U); myConS.GetCurve()->Value(w).Coord(x,y); @@ -124,7 +126,7 @@ void GeomFill_BoundWithSurf::D1Norm(const Standard_Real U, // Handle(Adaptor2d_Curve2d)& C2d = myConS.GetCurve(); gp_Pnt2d P2d; gp_Vec2d V2d; - Standard_Real x,y,dx,dy; + Standard_Real x = NAN,y = NAN,dx = NAN,dy = NAN; Standard_Real w = U, dw = 1.; if(!myPar.IsNull()) myPar->D1(U,w,dw); myConS.GetCurve()->D1(w,P2d,V2d); diff --git a/src/GeomFill/GeomFill_Boundary.cxx b/src/GeomFill/GeomFill_Boundary.cxx index 0dcc3d42f5..596f40a959 100644 --- a/src/GeomFill/GeomFill_Boundary.cxx +++ b/src/GeomFill/GeomFill_Boundary.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -73,7 +75,7 @@ void GeomFill_Boundary::D1Norm(const Standard_Real , gp_Vec& , gp_Vec& ) const void GeomFill_Boundary::Points(gp_Pnt& PFirst, gp_Pnt& PLast) const { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Bounds(f,l); PFirst = Value(f); PLast = Value(l); diff --git a/src/GeomFill/GeomFill_CircularBlendFunc.cxx b/src/GeomFill/GeomFill_CircularBlendFunc.cxx index 9bc250383b..0491a72cf7 100644 --- a/src/GeomFill/GeomFill_CircularBlendFunc.cxx +++ b/src/GeomFill/GeomFill_CircularBlendFunc.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -59,7 +61,7 @@ static void GeomFillFusInt(const TColStd_Array1OfReal& I1, Standard_Integer ind1=1, ind2=1; Standard_Real Epspar = Precision::PConfusion()*0.99; // en suposant que le positionement fonctionne a PConfusion()/2 - Standard_Real v1, v2; + Standard_Real v1 = NAN, v2 = NAN; // Initialisations : les IND1 et IND2 pointent sur le 1er element // de chacune des 2 tables a traiter. @@ -112,7 +114,7 @@ GeomFill_CircularBlendFunc(const Handle(Adaptor3d_Curve)& Path, const Handle(Adaptor3d_Curve)& Curve2, const Standard_Real Radius, const Standard_Boolean Polynomial) - : maxang(RealFirst()), + : myRadius(Radius), maxang(RealFirst()), minang(RealLast()), distmin(RealLast()) { @@ -120,7 +122,7 @@ GeomFill_CircularBlendFunc(const Handle(Adaptor3d_Curve)& Path, myPath = myTPath = Path; myCurve1 = myTCurve1 = Curve1; myCurve2 = myTCurve2 = Curve2; - myRadius = Radius; + // Estimations numeriques Discret(); @@ -141,9 +143,9 @@ GeomFill_CircularBlendFunc(const Handle(Adaptor3d_Curve)& Path, void GeomFill_CircularBlendFunc::Discret() { Standard_Real TFirst = myPath->FirstParameter(); - Standard_Real TLast = myPath->LastParameter(), T; - Standard_Integer ii; - Standard_Real L1, L2, L; + Standard_Real TLast = myPath->LastParameter(), T = NAN; + Standard_Integer ii = 0; + Standard_Real L1 = NAN, L2 = NAN, L = NAN; Handle(Adaptor3d_Curve) C; gp_Pnt P1, P2, P3, Center; gp_Vec DCenter; @@ -168,7 +170,7 @@ void GeomFill_CircularBlendFunc::Discret() } Standard_Real Fleche = 1.e-2 * L; - Standard_Real Angle, Cosa, Percent; + Standard_Real Angle = NAN, Cosa = NAN, Percent = NAN; GCPnts_QuasiUniformDeflection Samp; Samp.Initialize (*C, Fleche); myBary.SetCoord(0.,0.,0.); @@ -305,7 +307,7 @@ Standard_Boolean GeomFill_CircularBlendFunc::D1(const Standard_Real Param, TColStd_Array1OfReal& DWeigths) { gp_Pnt P1, P2, Center; - Standard_Real invnorm1, invnorm2, invnormp; + Standard_Real invnorm1 = NAN, invnorm2 = NAN, invnormp = NAN; // gp_Vec DCenter, D2Center, nplan, dnplan, DP1, DP2; gp_Vec DCenter, nplan, dnplan, DP1, DP2; // gp_Vec ns1, ns2, Dns1, Dns2, vtmp; @@ -392,7 +394,7 @@ Standard_Boolean GeomFill_CircularBlendFunc::D2(const Standard_Real Param, TColStd_Array1OfReal& D2Weigths) { gp_Pnt P1, P2, Center; - Standard_Real invnorm1, invnorm2, invnormp, sc; + Standard_Real invnorm1 = NAN, invnorm2 = NAN, invnormp = NAN, sc = NAN; gp_Vec DCenter, D2Center, DP1, DP2, D2P1, D2P2; gp_Vec nplan, dnplan, d2nplan; gp_Vec ns1, ns2, Dns1, Dns2, D2ns1, D2ns2; @@ -524,7 +526,7 @@ Standard_Boolean GeomFill_CircularBlendFunc::IsRational() const Standard_Integer GeomFill_CircularBlendFunc:: NbIntervals(const GeomAbs_Shape S) const { - Standard_Integer NbI_Center, NbI_Cb1, NbI_Cb2, ii; + Standard_Integer NbI_Center = 0, NbI_Cb1 = 0, NbI_Cb2 = 0, ii = 0; NbI_Center = myPath->NbIntervals(GeomFillNextShape(S)); NbI_Cb1 = myCurve1->NbIntervals(S); NbI_Cb2 = myCurve2->NbIntervals(S); @@ -562,7 +564,7 @@ NbIntervals(const GeomAbs_Shape S) const void GeomFill_CircularBlendFunc:: Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const { - Standard_Integer NbI_Center, NbI_Cb1, NbI_Cb2, ii; + Standard_Integer NbI_Center = 0, NbI_Cb1 = 0, NbI_Cb2 = 0, ii = 0; NbI_Center = myPath->NbIntervals(GeomFillNextShape(S)); NbI_Cb1 = myCurve1->NbIntervals(S); NbI_Cb2 = myCurve2->NbIntervals(S); @@ -604,7 +606,7 @@ void GeomFill_CircularBlendFunc::GetTolerance(const Standard_Real BoundTol, TColStd_Array1OfReal& Tol3d) const { Standard_Integer low = Tol3d.Lower() , up=Tol3d.Upper(); - Standard_Real Tol; + Standard_Real Tol = NAN; Tol= GeomFill::GetTolerance(myTConv, minang, myRadius, AngleTol, SurfTol); diff --git a/src/GeomFill/GeomFill_CircularBlendFunc.hxx b/src/GeomFill/GeomFill_CircularBlendFunc.hxx index 015d3edbeb..bcd02c1e25 100644 --- a/src/GeomFill/GeomFill_CircularBlendFunc.hxx +++ b/src/GeomFill/GeomFill_CircularBlendFunc.hxx @@ -151,11 +151,11 @@ private: Handle(Adaptor3d_Curve) myTPath; Handle(Adaptor3d_Curve) myTCurve1; Handle(Adaptor3d_Curve) myTCurve2; - Standard_Integer myDegree; - Standard_Integer myNbKnots; - Standard_Integer myNbPoles; + Standard_Integer myDegree{}; + Standard_Integer myNbKnots{}; + Standard_Integer myNbPoles{}; Convert_ParameterisationType myTConv; - Standard_Boolean myreverse; + Standard_Boolean myreverse{}; }; diff --git a/src/GeomFill/GeomFill_ConstantBiNormal.cxx b/src/GeomFill/GeomFill_ConstantBiNormal.cxx index 3a1f076c05..3c8f99a1b2 100644 --- a/src/GeomFill/GeomFill_ConstantBiNormal.cxx +++ b/src/GeomFill/GeomFill_ConstantBiNormal.cxx @@ -52,9 +52,9 @@ static gp_Vec DDeriv(const gp_Vec& F, const gp_Vec& DF, const gp_Vec& D2F) return Result; } -GeomFill_ConstantBiNormal::GeomFill_ConstantBiNormal(const gp_Dir& BiNormal) : BN(BiNormal) +GeomFill_ConstantBiNormal::GeomFill_ConstantBiNormal(const gp_Dir& BiNormal) : BN(BiNormal), frenet(new GeomFill_Frenet()) { - frenet = new GeomFill_Frenet(); + } Handle(GeomFill_TrihedronLaw) GeomFill_ConstantBiNormal::Copy() const diff --git a/src/GeomFill/GeomFill_ConstrainedFilling.cxx b/src/GeomFill/GeomFill_ConstrainedFilling.cxx index d48c72cf7a..35c05b4579 100644 --- a/src/GeomFill/GeomFill_ConstrainedFilling.cxx +++ b/src/GeomFill/GeomFill_ConstrainedFilling.cxx @@ -16,6 +16,8 @@ // Modified by skv - Fri Jun 18 12:52:54 2004 OCC6129 +#include + #include #include #include @@ -100,7 +102,7 @@ static Handle(Law_Linear) mklin(const Handle(Law_Function)& func) Handle(Law_Linear) fu = Handle(Law_Linear)::DownCast(func); if(fu.IsNull()) { fu = new Law_Linear(); - Standard_Real d,f; + Standard_Real d = NAN,f = NAN; func->Bounds(d,f); fu->Set(d,func->Value(d),f,func->Value(f)); } @@ -115,7 +117,7 @@ static void sortbounds(const Standard_Integer nb, // trier les bords (facon bourinos), // flaguer ceux a renverser, // flaguer les baillements au coins. - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Handle(GeomFill_Boundary) temp; rev[0] = 0; gp_Pnt pf,pl; @@ -157,7 +159,7 @@ static void sortbounds(const Standard_Integer nb, // coins pour les bords contraints. gp_Pnt pbid; gp_Vec tgi, nori, tgn, norn; - Standard_Real fi, fn, li, ln; + Standard_Real fi = NAN, fn = NAN, li = NAN, ln = NAN; for (i = 0; i < nb; i++){ Standard_Integer next = (i+1)%nb; if(!rev[i]) bound[i]->Bounds(fi,li); @@ -188,7 +190,7 @@ static void coonscnd(const Standard_Integer nb, Standard_Real* mintg) { Standard_Real fact_normalization = 100.; - Standard_Integer i; + Standard_Integer i = 0; // Pour chaque coin contraint, on controle les bounds adjascents. for(i = 0; i < nb; i++){ if(stat[i].HasConstraint()){ @@ -203,7 +205,7 @@ static void coonscnd(const Standard_Integer nb, tolang *= (Min(mintg[ip],mintg[i])*fact*fact_normalization); gp_Vec tgp, dnorp, tgi, dnori, vbid; gp_Pnt pbid; - Standard_Real fp,lp,fi,li; + Standard_Real fp = NAN,lp = NAN,fi = NAN,li = NAN; if(!rev[ip]) bound[ip]->Bounds(fp,lp); else bound[ip]->Bounds(lp,fp); bound[ip]->D1(lp,pbid,tgp); @@ -234,13 +236,13 @@ static void killcorners(const Standard_Integer nb, GeomFill_CornerState* stat, Handle(GeomFill_TgtField)* tga) { - Standard_Integer i; + Standard_Integer i = 0; // Pour chaque bound, on controle l etat des extremites et on flingue // eventuellement le champ tangent et les derivees du bound. for(i = 0; i < nb; i++){ Standard_Integer inext = (i+1)%nb; - Standard_Boolean fnul, lnul; - Standard_Real fscal, lscal; + Standard_Boolean fnul = 0, lnul = 0; + Standard_Real fscal = NAN, lscal = NAN; if(!nrev[i]){ fnul = stat[i].IsToKill(fscal); lnul = stat[inext].IsToKill(lscal); @@ -279,12 +281,12 @@ class GeomFill_ConstrainedFilling_Eval : public AdvApprox_EvaluatorFunction GeomFill_ConstrainedFilling_Eval (GeomFill_ConstrainedFilling& theTool) : curfil(theTool) {} - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: GeomFill_ConstrainedFilling& curfil; @@ -342,7 +344,7 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1, rev[0] = rev[1] = rev[2] = Standard_False; Handle(GeomFill_Boundary) bound[3]; bound[0] = B1; bound[1] = B2; bound[2] = B3; - Standard_Integer i; + Standard_Integer i = 0; sortbounds(3,bound,rev,stcor); // on reoriente. @@ -437,7 +439,7 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1, rev[0] = rev[1] = rev[2] = rev[3] = Standard_False; Handle(GeomFill_Boundary) bound[4]; bound[0] = B1; bound[1] = B2; bound[2] = B3; bound[3] = B4; - Standard_Integer i; + Standard_Integer i = 0; sortbounds(4,bound,rev,stcor); // on reoriente. @@ -559,7 +561,7 @@ void GeomFill_ConstrainedFilling::Build() for (Standard_Integer count = 0; count < 2; count++){ ibound[0] = count; ibound[1] = count+2; ctr[0] = ctr[1] = nbd3 = 0; - Standard_Integer ii ; + Standard_Integer ii = 0 ; for ( ii = 0; ii < 2; ii++){ if (ptch->Bound(ibound[ii])->HasNormals()) { ctr[ii] = 2; @@ -612,7 +614,7 @@ void GeomFill_ConstrainedFilling::Build() void GeomFill_ConstrainedFilling::PerformApprox() { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Handle(TColStd_HArray1OfReal) tol3d, tol2d, tol1d; if(nbd3) tol3d = new TColStd_HArray1OfReal(1,nbd3); Standard_Integer i3d = 0; @@ -622,7 +624,7 @@ void GeomFill_ConstrainedFilling::PerformApprox() tol3d->SetValue(++i3d,0.5* mig[ibound[ii]] * ptch->Bound(ibound[ii])->Tolang()); } } - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; ptch->Bound(ibound[0])->Bounds(f,l); GeomFill_ConstrainedFilling_Eval ev (*this); @@ -675,7 +677,7 @@ void GeomFill_ConstrainedFilling::PerformApprox() void GeomFill_ConstrainedFilling::MatchKnots() { // on n insere rien si les domaines valent 1. - Standard_Integer i, j, l; + Standard_Integer i = 0, j = 0, l = 0; Standard_Integer ind[4]; nm[0] = mults[0]; nm[1] = mults[1]; nk[0] = knots[0]; nk[1] = knots[1]; @@ -692,7 +694,7 @@ void GeomFill_ConstrainedFilling::MatchKnots() if(nbadd){ TColStd_Array1OfReal addk(kadd[0],1,nbadd); TColStd_Array1OfInteger addm(madd[0],1,nbadd); - Standard_Integer nbnp, nbnk; + Standard_Integer nbnp = 0, nbnk = 0; if(BSplCLib::PrepareInsertKnots(degree[1],0, knots[1]->Array1(), mults[1]->Array1(), @@ -759,7 +761,7 @@ void GeomFill_ConstrainedFilling::MatchKnots() if(nbadd){ TColStd_Array1OfReal addk(kadd[0],1,nbadd); TColStd_Array1OfInteger addm(madd[0],1,nbadd); - Standard_Integer nbnp, nbnk; + Standard_Integer nbnp = 0, nbnk = 0; if(BSplCLib::PrepareInsertKnots(degree[0],0, knots[0]->Array1(), mults[0]->Array1(), @@ -877,7 +879,7 @@ void GeomFill_ConstrainedFilling::PerformS0() // - ab[3](i)*ab[0](j)*c[0] - ab[0](j)*ab[1](i)*c[1] // - ab[1](i)*ab[2](j)*c[2] - ab[2](j)*ab[3](i)*c[3] - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Standard_Integer ni = ncpol[0]->Length(); Standard_Integer nj = ncpol[1]->Length(); S0 = new TColgp_HArray2OfPnt(1,ni,1,nj); @@ -931,7 +933,7 @@ void GeomFill_ConstrainedFilling::PerformS1() // sur les bords ou tgte est defini. gp_XYZ* nt[4]; const TColgp_Array2OfPnt& ss0 = S0->Array2(); - Standard_Integer l, i, j, k; + Standard_Integer l = 0, i = 0, j = 0, k = 0; Standard_Integer ni = ss0.ColLength(); Standard_Integer nj = ss0.RowLength(); for(i = 0; i <= 3; i++){ @@ -1119,7 +1121,7 @@ void GeomFill_ConstrainedFilling::PerformS1() void GeomFill_ConstrainedFilling::PerformSurface() { - Standard_Integer ni = S0->ColLength(), nj = S0->RowLength(),i,j; + Standard_Integer ni = S0->ColLength(), nj = S0->RowLength(),i = 0,j = 0; TColgp_Array2OfPnt temp(1,ni,1,nj); const TColgp_Array2OfPnt& t0 = S0->Array2(); const TColgp_Array2OfPnt& t1 = S1->Array2(); @@ -1238,7 +1240,7 @@ Standard_Integer GeomFill_ConstrainedFilling::Eval(const Standard_Real W, void GeomFill_ConstrainedFilling::CheckCoonsAlgPatch(const Standard_Integer I) { Standard_Integer nbp = 30; - Standard_Real uu=0,duu=0,vv=0,dvv=0,ww=0,dww=0,u1,u2,v1,v2; + Standard_Real uu=0,duu=0,vv=0,dvv=0,ww=0,dww=0,u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; surf->Bounds(u1,u2,v1,v2); Standard_Boolean enu = Standard_False; switch(I){ @@ -1304,7 +1306,7 @@ void GeomFill_ConstrainedFilling::CheckTgteField(const Standard_Integer I) #endif gp_Vec d1; Standard_Boolean caplisse = 0; - Standard_Real maxang = 0.,pmix=0,pmixcur; + Standard_Real maxang = 0.,pmix=0,pmixcur = NAN; Handle(GeomFill_Boundary) bou = ptch->Bound(I); for (Standard_Integer iu = 0; iu <= 30; iu++){ Standard_Real uu = iu/30.; @@ -1399,7 +1401,7 @@ void GeomFill_ConstrainedFilling::CheckResult(const Standard_Integer I) { Standard_Boolean donor = !tgalg[I].IsNull(); Standard_Real maxang = 0., maxdist = 0.; - Standard_Real uu=0,duu=0,vv=0,dvv=0,ww=0,dww=0,u1,u2,v1,v2; + Standard_Real uu=0,duu=0,vv=0,dvv=0,ww=0,dww=0,u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; surf->Bounds(u1,u2,v1,v2); switch(I){ case 0: @@ -1434,7 +1436,7 @@ void GeomFill_ConstrainedFilling::CheckResult(const Standard_Integer I) Standard_Boolean hasang[31]; #endif Handle(GeomFill_Boundary) bou = ptch->Bound(I); - Standard_Integer k ; + Standard_Integer k = 0 ; for ( k = 0; k <= 30; k++){ pbound[k] = bou->Value(ww); if(!donor) surf->D0(uu,vv,pres[k]); diff --git a/src/GeomFill/GeomFill_ConstrainedFilling.hxx b/src/GeomFill/GeomFill_ConstrainedFilling.hxx index 1f5305c804..6ab008b207 100644 --- a/src/GeomFill/GeomFill_ConstrainedFilling.hxx +++ b/src/GeomFill/GeomFill_ConstrainedFilling.hxx @@ -176,24 +176,24 @@ private: Standard_Integer segmax; Handle(GeomFill_CoonsAlgPatch) ptch; Handle(GeomFill_TgtField) tgalg[4]; - Standard_Real mig[4]; + Standard_Real mig[4]{}; GeomFill_CornerState stcor[4]; gp_Vec v[4]; Standard_Boolean appdone; - Standard_Integer degree[2]; + Standard_Integer degree[2]{}; Handle(TColgp_HArray1OfPnt) curvpol[4]; Handle(TColgp_HArray1OfPnt) tgtepol[4]; Handle(TColStd_HArray1OfInteger) mults[2]; Handle(TColStd_HArray1OfReal) knots[2]; Handle(TColStd_HArray1OfReal) ab[4]; Handle(TColStd_HArray1OfReal) pq[4]; - Standard_Real dom[4]; + Standard_Real dom[4]{}; Handle(TColgp_HArray1OfPnt) ncpol[4]; Handle(TColgp_HArray1OfPnt) ntpol[4]; Handle(TColStd_HArray1OfInteger) nm[2]; Handle(TColStd_HArray1OfReal) nk[2]; - Standard_Integer ibound[2]; - Standard_Integer ctr[2]; + Standard_Integer ibound[2]{}; + Standard_Integer ctr[2]{}; Standard_Integer nbd3; Handle(TColgp_HArray2OfPnt) S0; Handle(TColgp_HArray2OfPnt) S1; diff --git a/src/GeomFill/GeomFill_Coons.cxx b/src/GeomFill/GeomFill_Coons.cxx index 58186db10c..9fbe24334e 100644 --- a/src/GeomFill/GeomFill_Coons.cxx +++ b/src/GeomFill/GeomFill_Coons.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -83,7 +85,7 @@ void GeomFill_Coons::Init(const TColgp_Array1OfPnt& P1, myPoles = new TColgp_HArray2OfPnt( 1, NPolU, 1, NPolV); // The boundaries are not modified - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; for (i=1; i<=NPolU; i++) { myPoles->SetValue( i, 1 , P1(i)); @@ -123,7 +125,7 @@ void GeomFill_Coons::Init(const TColgp_Array1OfPnt& P1, TColStd_Array1OfReal GU(2,NPolU-1); TColStd_Array1OfReal FV(2,NPolV-1); TColStd_Array1OfReal GV(2,NPolV-1); - Standard_Real Dummy; + Standard_Real Dummy = NAN; for ( i= 2; i< NPolU; i++) { CoefU(i).Coord(FU(i), GU(i), Dummy); } @@ -187,12 +189,12 @@ void GeomFill_Coons::Init(const TColgp_Array1OfPnt& P1, //#endif myWeights = new TColStd_HArray2OfReal( 1, NPolU, 1, NPolV); // The boundaries are not modified - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for ( i=1; i<=NPolU; i++) { myWeights->SetValue( i, 1 , W1(i)); myWeights->SetValue( i, NPolV, W3(i)); } - Standard_Real PU,PU1,PV,PV1; + Standard_Real PU = NAN,PU1 = NAN,PV = NAN,PV1 = NAN; for ( j=2; j<=NPolV-1; j++) { PV = (j-1)/NV; diff --git a/src/GeomFill/GeomFill_CoonsAlgPatch.cxx b/src/GeomFill/GeomFill_CoonsAlgPatch.cxx index da2ba69d55..ccda07b5dc 100644 --- a/src/GeomFill/GeomFill_CoonsAlgPatch.cxx +++ b/src/GeomFill/GeomFill_CoonsAlgPatch.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -36,7 +38,7 @@ GeomFill_CoonsAlgPatch::GeomFill_CoonsAlgPatch const Handle(GeomFill_Boundary)& B4) { bound[0] = B1; bound[1] = B2; bound[2] = B3; bound[3] = B4; - Standard_Real deb0, deb1, fin0, fin1; + Standard_Real deb0 = NAN, deb1 = NAN, fin0 = NAN, fin1 = NAN; B2->Bounds(deb1,fin1); Handle(Law_Linear) aLaw0 = new Law_Linear(); @@ -99,7 +101,7 @@ void GeomFill_CoonsAlgPatch::Func(Handle(Law_Function)& f1, gp_Pnt GeomFill_CoonsAlgPatch::Value(const Standard_Real , const Standard_Real V) const { - Standard_Real a0,a1,a2,a3; + Standard_Real a0 = NAN,a1 = NAN,a2 = NAN,a3 = NAN; a0 = a[0]->Value(V); a1 = a[1]->Value(V); a2 = 1. - a0; @@ -149,7 +151,7 @@ gp_Pnt GeomFill_CoonsAlgPatch::Value(const Standard_Real , gp_Vec GeomFill_CoonsAlgPatch::D1U(const Standard_Real U, const Standard_Real V) const { - Standard_Real a0,a1,a2,a3,bid; + Standard_Real a0 = NAN,a1 = NAN,a2 = NAN,a3 = NAN,bid = NAN; a0 = a[0]->Value(V); a[1]->D1(U,bid,a1); a2 = 1 - a0; @@ -204,7 +206,7 @@ gp_Vec GeomFill_CoonsAlgPatch::D1U(const Standard_Real U, gp_Vec GeomFill_CoonsAlgPatch::D1V(const Standard_Real U, const Standard_Real V) const { - Standard_Real a0,a1,a2,a3,bid; + Standard_Real a0 = NAN,a1 = NAN,a2 = NAN,a3 = NAN,bid = NAN; a[0]->D1(V,bid,a0); a1 = a[1]->Value(U); a2 = -a0; @@ -259,7 +261,7 @@ gp_Vec GeomFill_CoonsAlgPatch::D1V(const Standard_Real U, gp_Vec GeomFill_CoonsAlgPatch::DUV(const Standard_Real U, const Standard_Real V) const { - Standard_Real a0,a1,a2,a3,bid; + Standard_Real a0 = NAN,a1 = NAN,a2 = NAN,a3 = NAN,bid = NAN; a[0]->D1(V,bid,a0); a[1]->D1(U,bid,a1); a2 = -a0; diff --git a/src/GeomFill/GeomFill_CorrectedFrenet.cxx b/src/GeomFill/GeomFill_CorrectedFrenet.cxx index 609d0bb8e2..835d809412 100644 --- a/src/GeomFill/GeomFill_CorrectedFrenet.cxx +++ b/src/GeomFill/GeomFill_CorrectedFrenet.cxx @@ -41,6 +41,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(GeomFill_CorrectedFrenet,GeomFill_TrihedronLaw) @@ -95,7 +96,7 @@ static void draw(const Handle(Law_Function)& law) static Standard_Real ComputeTorsion(const Standard_Real Param, const Handle(Adaptor3d_Curve)& aCurve) { - Standard_Real Torsion; + Standard_Real Torsion = NAN; gp_Pnt aPoint; gp_Vec DC1, DC2, DC3; @@ -124,9 +125,9 @@ static void smoothlaw(Handle(Law_BSpline)& Law, const Handle(TColStd_HArray1OfReal)& Param, const Standard_Real Tol) { - Standard_Real tol, d; - Standard_Integer ii, Nbk; - Standard_Boolean B, Ok; + Standard_Real tol = NAN, d = NAN; + Standard_Integer ii = 0, Nbk = 0; + Standard_Boolean B = 0, Ok = 0; Handle(Law_BSpline) BS = Law->Copy(); Nbk = BS->NbKnots(); @@ -262,8 +263,8 @@ static Standard_Boolean FindPlane ( const Handle(Adaptor3d_Curve)& theC, default: { // On utilise un echantillonage Standard_Integer nbp = 15 + theC->NbIntervals(GeomAbs_C3); - Standard_Real f, l, t, inv; - Standard_Integer ii; + Standard_Real f = NAN, l = NAN, t = NAN, inv = NAN; + Standard_Integer ii = 0; f = theC->FirstParameter(); l = theC->LastParameter(); inv = 1./(nbp-1); @@ -277,7 +278,7 @@ static Standard_Boolean FindPlane ( const Handle(Adaptor3d_Curve)& theC, } if (! TabP.IsNull()) { // Recherche d'un plan moyen et controle - Standard_Boolean issingular; + Standard_Boolean issingular = 0; gp_Ax2 inertia; GeomLib::AxeOfInertia(TabP->Array1(), inertia, issingular); if (issingular) { @@ -290,8 +291,8 @@ static Standard_Boolean FindPlane ( const Handle(Adaptor3d_Curve)& theC, { //control = Controle(TabP->Array1(), P, myTolerance); // Standard_Boolean isOnPlane; - Standard_Real a,b,c,d, dist; - Standard_Integer ii; + Standard_Real a = NAN,b = NAN,c = NAN,d = NAN, dist = NAN; + Standard_Integer ii = 0; theP->Coefficients(a,b,c,d); for (ii=1; ii<=TabP->Length() && found; ii++) { const gp_XYZ& xyz = TabP->Value(ii).XYZ(); @@ -310,10 +311,10 @@ static Standard_Boolean FindPlane ( const Handle(Adaptor3d_Curve)& theC, // Purpose : //=============================================================== GeomFill_CorrectedFrenet::GeomFill_CorrectedFrenet() - : isFrenet(Standard_False) + : frenet(new GeomFill_Frenet()), isFrenet(Standard_False), myForEvaluation(Standard_False) { - frenet = new GeomFill_Frenet(); - myForEvaluation = Standard_False; + + } //=============================================================== @@ -321,10 +322,10 @@ GeomFill_CorrectedFrenet::GeomFill_CorrectedFrenet() // Purpose : //=============================================================== GeomFill_CorrectedFrenet::GeomFill_CorrectedFrenet(const Standard_Boolean ForEvaluation) - : isFrenet(Standard_False) + : frenet(new GeomFill_Frenet()), isFrenet(Standard_False), myForEvaluation(ForEvaluation) { - frenet = new GeomFill_Frenet(); - myForEvaluation = ForEvaluation; + + } Handle(GeomFill_TrihedronLaw) GeomFill_CorrectedFrenet::Copy() const @@ -374,7 +375,7 @@ Standard_Boolean GeomFill_CorrectedFrenet::SetCurve(const Handle(Adaptor3d_Curve void GeomFill_CorrectedFrenet::Init() { EvolAroundT = new Law_Composite(); - Standard_Integer NbI = frenet->NbIntervals(GeomAbs_C0), i; + Standard_Integer NbI = frenet->NbIntervals(GeomAbs_C0), i = 0; TColStd_Array1OfReal T(1, NbI + 1); frenet->Intervals(T, GeomAbs_C0); Handle(Law_Function) Func; @@ -384,9 +385,9 @@ Standard_Boolean GeomFill_CorrectedFrenet::SetCurve(const Handle(Adaptor3d_Curve gp_Vec Tangent, Normal, BN; frenet->D0(myTrimmed->FirstParameter(), Tangent, Normal, BN); - Standard_Integer NbStep; + Standard_Integer NbStep = 0; // Standard_Real StartAng = 0, AvStep, Step, t; - Standard_Real StartAng = 0, AvStep, Step; + Standard_Real StartAng = 0, AvStep = NAN, Step = NAN; #ifdef DRAW Standard_Real t; @@ -478,9 +479,9 @@ Standard_Boolean GeomFill_CorrectedFrenet::SetCurve(const Handle(Adaptor3d_Curve gp_Vec Tangent, Normal, BN, cross; TColStd_SequenceOfReal parameters; TColStd_SequenceOfReal EvolAT; - Standard_Real Param = First, LengthMin, L, norm; + Standard_Real Param = First, LengthMin = NAN, L = NAN, norm = NAN; Standard_Boolean isZero = Standard_True, isConst = Standard_True; - Standard_Integer i; + Standard_Integer i = 0; gp_Pnt PonC; gp_Vec D1; @@ -492,7 +493,7 @@ Standard_Boolean GeomFill_CorrectedFrenet::SetCurve(const Handle(Adaptor3d_Curve aT = gp_Vec(0, 0, 0); aN = gp_Vec(0, 0, 0); - Standard_Real angleAT = 0., currParam, currStep = Step; + Standard_Real angleAT = 0., currParam = NAN, currStep = Step; Handle( Geom_Plane ) aPlane; Standard_Boolean isPlanar = Standard_False; @@ -612,7 +613,7 @@ Standard_Boolean GeomFill_CorrectedFrenet::SetCurve(const Handle(Adaptor3d_Curve Standard_Real GeomFill_CorrectedFrenet::CalcAngleAT(const gp_Vec& Tangent, const gp_Vec& Normal, const gp_Vec& prevTangent, const gp_Vec& prevNormal) const { - Standard_Real angle; + Standard_Real angle = NAN; gp_Vec Normal_rot, cross; angle = Tangent.Angle(prevTangent); if (Abs(angle) > Precision::Angular() && Abs(angle) < M_PI - Precision::Angular()) { @@ -680,7 +681,7 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co frenet->D0(Param, Tangent, Normal, BiNormal); if (isFrenet) return Standard_True; - Standard_Real angleAT; + Standard_Real angleAT = NAN; //angleAT = TLaw->Value(Param); angleAT = GetAngleAT(Param); //OCC78 @@ -711,8 +712,8 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co frenet->D1(Param, Tangent, DTangent, Normal, DNormal, BiNormal, DBiNormal); if (isFrenet) return Standard_True; - Standard_Real angleAT, d_angleAT; - Standard_Real sina, cosa; + Standard_Real angleAT = NAN, d_angleAT = NAN; + Standard_Real sina = NAN, cosa = NAN; TLaw->D1(Param, angleAT, d_angleAT); angleAT = GetAngleAT(Param); //OCC78 @@ -780,8 +781,8 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co BiNormal, DBiNormal, D2BiNormal); if (isFrenet) return Standard_True; - Standard_Real angleAT, d_angleAT, d2_angleAT; - Standard_Real sina, cosa; + Standard_Real angleAT = NAN, d_angleAT = NAN, d2_angleAT = NAN; + Standard_Real sina = NAN, cosa = NAN; TLaw->D2(Param, angleAT, d_angleAT, d2_angleAT); angleAT = GetAngleAT(Param); //OCC78 @@ -871,7 +872,7 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co //=============================================================== Standard_Integer GeomFill_CorrectedFrenet::NbIntervals(const GeomAbs_Shape S) const { - Standard_Integer NbFrenet, NbLaw; + Standard_Integer NbFrenet = 0, NbLaw = 0; NbFrenet = frenet->NbIntervals(S); if (isFrenet) return NbFrenet; @@ -897,7 +898,7 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co void GeomFill_CorrectedFrenet::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const { - Standard_Integer NbFrenet, NbLaw; + Standard_Integer NbFrenet = 0, NbLaw = 0; if (isFrenet) { frenet->Intervals(T, S); return; @@ -947,8 +948,8 @@ GeomFill_Trihedron GeomFill_CorrectedFrenet::EvaluateBestMode() const Standard_Real MaxAngle = 3.*M_PI/4.; const Standard_Real MaxTorsion = 100.; - Standard_Real Step, u, v, tmin, tmax; - Standard_Integer NbInt, i, j, k = 1; + Standard_Real Step = NAN, u = NAN, v = NAN, tmin = NAN, tmax = NAN; + Standard_Integer NbInt = 0, i = 0, j = 0, k = 1; NbInt = EvolAroundT->NbIntervals(GeomAbs_CN); TColStd_Array1OfReal Int(1, NbInt+1); EvolAroundT->Intervals(Int, GeomAbs_CN); diff --git a/src/GeomFill/GeomFill_CurveAndTrihedron.cxx b/src/GeomFill/GeomFill_CurveAndTrihedron.cxx index 6519752729..8415b62e74 100644 --- a/src/GeomFill/GeomFill_CurveAndTrihedron.cxx +++ b/src/GeomFill/GeomFill_CurveAndTrihedron.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -35,12 +37,12 @@ IMPLEMENT_STANDARD_RTTIEXT(GeomFill_CurveAndTrihedron,GeomFill_LocationLaw) //Purpose : //================================================================== GeomFill_CurveAndTrihedron::GeomFill_CurveAndTrihedron( - const Handle(GeomFill_TrihedronLaw)& Trihedron ) + const Handle(GeomFill_TrihedronLaw)& Trihedron ) : myLaw(Trihedron), WithTrans(Standard_False) { - myLaw = Trihedron; + myCurve.Nullify(); Trans.SetIdentity(); - WithTrans = Standard_False; + } //================================================================== @@ -99,7 +101,7 @@ Handle(GeomFill_LocationLaw) GeomFill_CurveAndTrihedron::Copy() const gp_Mat& M, gp_Vec& V) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; myTrimmed->D0(Param, Point); V.SetXYZ(Point.XYZ()); @@ -121,7 +123,7 @@ Handle(GeomFill_LocationLaw) GeomFill_CurveAndTrihedron::Copy() const gp_Vec& V, TColgp_Array1OfPnt2d&) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; myTrimmed->D0(Param, Point); V.SetXYZ(Point.XYZ()); @@ -146,7 +148,7 @@ Handle(GeomFill_LocationLaw) GeomFill_CurveAndTrihedron::Copy() const TColgp_Array1OfPnt2d& , TColgp_Array1OfVec2d& ) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; myTrimmed->D1(Param, Point, DV); V.SetXYZ(Point.XYZ()); @@ -181,7 +183,7 @@ Handle(GeomFill_LocationLaw) GeomFill_CurveAndTrihedron::Copy() const TColgp_Array1OfVec2d&, TColgp_Array1OfVec2d&) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; myTrimmed->D2(Param, Point, DV, D2V); V.SetXYZ(Point.XYZ()); @@ -211,7 +213,7 @@ Handle(GeomFill_LocationLaw) GeomFill_CurveAndTrihedron::Copy() const //================================================================== Standard_Integer GeomFill_CurveAndTrihedron::NbIntervals(const GeomAbs_Shape S) const { - Standard_Integer Nb_Sec, Nb_Law; + Standard_Integer Nb_Sec = 0, Nb_Law = 0; Nb_Sec = myTrimmed->NbIntervals(S); Nb_Law = myLaw->NbIntervals(S); @@ -238,7 +240,7 @@ Handle(GeomFill_LocationLaw) GeomFill_CurveAndTrihedron::Copy() const void GeomFill_CurveAndTrihedron::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const { - Standard_Integer Nb_Sec, Nb_Law; + Standard_Integer Nb_Sec = 0, Nb_Law = 0; Nb_Sec = myTrimmed->NbIntervals(S); Nb_Law = myLaw->NbIntervals(S); @@ -309,8 +311,8 @@ Handle(GeomFill_LocationLaw) GeomFill_CurveAndTrihedron::Copy() const void GeomFill_CurveAndTrihedron::GetAverageLaw(gp_Mat& AM, gp_Vec& AV) { - Standard_Integer ii; - Standard_Real U, delta; + Standard_Integer ii = 0; + Standard_Real U = NAN, delta = NAN; gp_Vec V; myLaw->GetAverageLaw(V1, V2, V3); diff --git a/src/GeomFill/GeomFill_Curved.cxx b/src/GeomFill/GeomFill_Curved.cxx index 9033194bac..ca3c71c695 100644 --- a/src/GeomFill/GeomFill_Curved.cxx +++ b/src/GeomFill/GeomFill_Curved.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -112,12 +114,12 @@ void GeomFill_Curved::Init(const TColgp_Array1OfPnt& P1, myPoles = new TColgp_HArray2OfPnt( 1, NPolU, 1, NPolV); // The boundaries are not modified - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; for ( i=1; i<=NPolU; i++) { myPoles->SetValue( i, 1 , P1(i)); myPoles->SetValue( i, NPolV, P3(i)); } - Standard_Real PU,PU1,PV,PV1; + Standard_Real PU = NAN,PU1 = NAN,PV = NAN,PV1 = NAN; for ( j=2; j<=NPolV-1; j++) { PV = (j-1)/NV; @@ -177,12 +179,12 @@ void GeomFill_Curved::Init(const TColgp_Array1OfPnt& P1, myWeights = new TColStd_HArray2OfReal( 1, NPolU, 1, NPolV); // The boundaries are not modified - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for ( i=1; i<=NPolU; i++) { myWeights->SetValue( i, 1 , W1(i)); myWeights->SetValue( i, NPolV, W3(i)); } - Standard_Real PU,PU1,PV,PV1; + Standard_Real PU = NAN,PU1 = NAN,PV = NAN,PV1 = NAN; for ( j=2; j<=NPolV-1; j++) { PV = (j-1)/NV; @@ -220,7 +222,7 @@ void GeomFill_Curved::Init(const TColgp_Array1OfPnt& P1, myPoles = new TColgp_HArray2OfPnt( 1, NPolU, 1, NPolV); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for ( j=1; j<=NPolV; j++) { gp_Vec Tra(P2(1),P2(j)); diff --git a/src/GeomFill/GeomFill_Darboux.cxx b/src/GeomFill/GeomFill_Darboux.cxx index 7310d3d50a..c35fe2957a 100644 --- a/src/GeomFill/GeomFill_Darboux.cxx +++ b/src/GeomFill/GeomFill_Darboux.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -83,8 +85,8 @@ static void NormalD0(const Standard_Real U, const Standard_Real V, const Handle( Standard_Integer MaxOrder=3; TColgp_Array2OfVec DerNUV(0,MaxOrder,0,MaxOrder); TColgp_Array2OfVec DerSurf(0,MaxOrder+1,0,MaxOrder+1); - Standard_Integer i,j;//OrderU,OrderV; - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Integer i = 0,j = 0;//OrderU,OrderV; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; Umin = Surf->FirstUParameter(); Umax = Surf->LastUParameter(); Vmin = Surf->FirstVParameter(); @@ -142,16 +144,16 @@ static void NormalD1 (const Standard_Real U, const Standard_Real V, Standard_Real MagTol=0.000000001; CSLib_NormalStatus NStatus; CSLib::Normal (D1UNormal, D1VNormal, MagTol, NStatus, Normal); - Standard_Integer MaxOrder; + Standard_Integer MaxOrder = 0; if (NStatus == CSLib_Defined) MaxOrder=0; else MaxOrder=3; - Standard_Integer OrderU,OrderV; + Standard_Integer OrderU = 0,OrderV = 0; TColgp_Array2OfVec DerNUV(0,MaxOrder+1,0,MaxOrder+1); TColgp_Array2OfVec DerSurf(0,MaxOrder+2,0,MaxOrder+2); - Standard_Integer i,j; - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Integer i = 0,j = 0; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; Umin = Surf->FirstUParameter(); Umax = Surf->LastUParameter(); Vmin = Surf->FirstVParameter(); @@ -205,17 +207,17 @@ static void NormalD2 (const Standard_Real U, const Standard_Real V, Standard_Real MagTol=0.000000001; CSLib_NormalStatus NStatus; CSLib::Normal (D1UNormal, D1VNormal, MagTol, NStatus, Normal); - Standard_Integer MaxOrder; + Standard_Integer MaxOrder = 0; if (NStatus == CSLib_Defined) MaxOrder=0; else MaxOrder=3; - Standard_Integer OrderU,OrderV; + Standard_Integer OrderU = 0,OrderV = 0; TColgp_Array2OfVec DerNUV(0,MaxOrder+2,0,MaxOrder+2); TColgp_Array2OfVec DerSurf(0,MaxOrder+3,0,MaxOrder+3); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; Umin = Surf->FirstUParameter(); Umax = Surf->LastUParameter(); Vmin = Surf->FirstVParameter(); @@ -270,9 +272,9 @@ Handle(GeomFill_TrihedronLaw) GeomFill_Darboux::Copy() const gp_Vec2d D2d; gp_Pnt S; gp_Vec dS_du, dS_dv; - Handle(Adaptor2d_Curve2d) myCurve2d = static_cast(myTrimmed.get())->GetCurve(); - Handle(Adaptor3d_Surface) mySupport = static_cast(myTrimmed.get())->GetSurface(); - Standard_Integer OrderU, OrderV; + Handle(Adaptor2d_Curve2d) myCurve2d = dynamic_cast(myTrimmed.get())->GetCurve(); + Handle(Adaptor3d_Surface) mySupport = dynamic_cast(myTrimmed.get())->GetSurface(); + Standard_Integer OrderU = 0, OrderV = 0; myCurve2d->D1(Param, C2d, D2d); // Normal = dS_du.Crossed(dS_dv).Normalized(); @@ -303,8 +305,8 @@ Handle(GeomFill_TrihedronLaw) GeomFill_Darboux::Copy() const gp_Vec2d D2d, D2_2d; gp_Pnt S; gp_Vec dS_du, dS_dv, d2S_du, d2S_dv, d2S_duv, F, DF; - Handle(Adaptor2d_Curve2d) myCurve2d = static_cast(myTrimmed.get())->GetCurve(); - Handle(Adaptor3d_Surface) mySupport = static_cast(myTrimmed.get())->GetSurface(); + Handle(Adaptor2d_Curve2d) myCurve2d = dynamic_cast(myTrimmed.get())->GetCurve(); + Handle(Adaptor3d_Surface) mySupport = dynamic_cast(myTrimmed.get())->GetSurface(); // Standard_Integer Order; myCurve2d->D2(Param, C2d, D2d, D2_2d); mySupport->D2(C2d.X(), C2d.Y(), S, dS_du, dS_dv, @@ -343,8 +345,8 @@ Handle(GeomFill_TrihedronLaw) GeomFill_Darboux::Copy() const gp_Pnt S; gp_Vec dS_du, dS_dv, d2S_du, d2S_dv, d2S_duv, d3S_du, d3S_dv, d3S_duuv, d3S_duvv, F, DF, D2F; - Handle(Adaptor2d_Curve2d) myCurve2d = static_cast(myTrimmed.get())->GetCurve(); - Handle(Adaptor3d_Surface) mySupport = static_cast(myTrimmed.get())->GetSurface(); + Handle(Adaptor2d_Curve2d) myCurve2d = dynamic_cast(myTrimmed.get())->GetCurve(); + Handle(Adaptor3d_Surface) mySupport = dynamic_cast(myTrimmed.get())->GetSurface(); // Standard_Integer Order; myCurve2d->D3(Param, C2d, D2d, D2_2d, D3_2d); mySupport->D3(C2d.X(), C2d.Y(), S, dS_du, dS_dv, @@ -408,7 +410,7 @@ Handle(GeomFill_TrihedronLaw) GeomFill_Darboux::Copy() const ABiNormal = gp_Vec(0, 0, 0); Standard_Real Step = (myTrimmed->LastParameter() - myTrimmed->FirstParameter()) / Num; - Standard_Real Param; + Standard_Real Param = NAN; for (Standard_Integer i = 0; i <= Num; i++) { Param = myTrimmed->FirstParameter() + i*Step; if (Param > myTrimmed->LastParameter()) Param = myTrimmed->LastParameter(); diff --git a/src/GeomFill/GeomFill_DiscreteTrihedron.cxx b/src/GeomFill/GeomFill_DiscreteTrihedron.cxx old mode 100755 new mode 100644 index 9738fec8ee..8fad1f61b9 --- a/src/GeomFill/GeomFill_DiscreteTrihedron.cxx +++ b/src/GeomFill/GeomFill_DiscreteTrihedron.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -36,11 +38,11 @@ static const Standard_Real TolConf = Precision::Confusion(); //======================================================================= GeomFill_DiscreteTrihedron::GeomFill_DiscreteTrihedron() : - myUseFrenet(Standard_False) + myFrenet(new GeomFill_Frenet()), myKnots(new TColStd_HSequenceOfReal()), myTrihedrons(new GeomFill_HSequenceOfAx2()), myUseFrenet(Standard_False) { - myFrenet = new GeomFill_Frenet(); - myKnots = new TColStd_HSequenceOfReal(); - myTrihedrons = new GeomFill_HSequenceOfAx2(); + + + } //======================================================================= @@ -106,7 +108,7 @@ void GeomFill_DiscreteTrihedron::Init() //Standard_Real Tol = Precision::Confusion(); Standard_Integer NbSamples = 10; - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for (i = 1; i <= NbIntervals; i++) { Standard_Real delta = (Knots(i+1) - Knots(i))/NbSamples; @@ -122,7 +124,7 @@ void GeomFill_DiscreteTrihedron::Init() gp_Pnt Origin(0.,0.,0.), Pnt, SubPnt; gp_Vec Tangent; gp_Dir TangDir; - Standard_Real norm; + Standard_Real norm = NAN; for (i = 1; i <= myKnots->Length(); i++) { Standard_Real Param = myKnots->Value(i); @@ -198,11 +200,11 @@ Standard_Boolean GeomFill_DiscreteTrihedron::D0(const Standard_Real Param, Standard_Integer NbSamples = 10; gp_Pnt Origin(0.,0.,0.); - Standard_Integer i; + Standard_Integer i = 0; //gp_Ax2 PrevAxis; //Standard_Real PrevParam; - Standard_Integer I1, I2; + Standard_Integer I1 = 0, I2 = 0; I1 = 1; I2 = myKnots->Length(); for (;;) @@ -358,7 +360,7 @@ void GeomFill_DiscreteTrihedron::Intervals(TColStd_Array1OfReal& T, ABiNormal = gp_Vec(0, 0, 0); Standard_Real Step = (myTrimmed->LastParameter() - myTrimmed->FirstParameter()) / Num; - Standard_Real Param; + Standard_Real Param = NAN; for (Standard_Integer i = 0; i <= Num; i++) { Param = myTrimmed->FirstParameter() + i*Step; if (Param > myTrimmed->LastParameter()) Param = myTrimmed->LastParameter(); diff --git a/src/GeomFill/GeomFill_DraftTrihedron.cxx b/src/GeomFill/GeomFill_DraftTrihedron.cxx index f15c9d59b8..a438bda37b 100644 --- a/src/GeomFill/GeomFill_DraftTrihedron.cxx +++ b/src/GeomFill/GeomFill_DraftTrihedron.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -45,9 +47,9 @@ static gp_Vec DDeriv(const gp_Vec& F, const gp_Vec& DF, const gp_Vec& D2F) //purpose : Constructor //======================================================================= GeomFill_DraftTrihedron::GeomFill_DraftTrihedron(const gp_Vec& BiNormal, - const Standard_Real Angle) + const Standard_Real Angle) : B(BiNormal) { - B = BiNormal; + B.Normalize(); SetAngle(Angle); } @@ -121,7 +123,7 @@ static gp_Vec DDeriv(const gp_Vec& F, const gp_Vec& DF, const gp_Vec& D2F) myTrimmed->D2(Param, P, T, aux); - Standard_Real normT, normb; + Standard_Real normT = NAN, normb = NAN; normT = T.Magnitude(); T /= normT; DT.SetLinearForm(-(T.Dot(aux)), T, aux); @@ -175,11 +177,11 @@ Standard_Boolean GeomFill_DraftTrihedron::D2(const Standard_Real Param, { gp_Pnt P; gp_Vec T, DT, D2T, aux, aux2; - Standard_Real dot; + Standard_Real dot = NAN; myTrimmed->D3(Param, P, T, aux, aux2); - Standard_Real normT, normb; + Standard_Real normT = NAN, normb = NAN; D2T = DDeriv(T, aux, aux2); normT = T.Magnitude(); @@ -205,7 +207,7 @@ Standard_Boolean GeomFill_DraftTrihedron::D2(const Standard_Real Param, gp_Vec d2v = d2b.Crossed(T) + 2*db.Crossed(DT) + b.Crossed(D2T); - Standard_Real mu = myCos, rac; + Standard_Real mu = myCos, rac = NAN; rac = Sqrt(1-mu*mu); Normal .SetLinearForm( rac, b , mu, v); @@ -301,7 +303,7 @@ Standard_Boolean GeomFill_DraftTrihedron::D2(const Standard_Real Param, Standard_Real Step = (myTrimmed->LastParameter() - myTrimmed->FirstParameter()) / Num; - Standard_Real Param; + Standard_Real Param = NAN; for (Standard_Integer i = 0; i <= Num; i++) { Param = myTrimmed->FirstParameter() + i*Step; if (Param > myTrimmed->LastParameter()) Param = myTrimmed->LastParameter(); diff --git a/src/GeomFill/GeomFill_DraftTrihedron.hxx b/src/GeomFill/GeomFill_DraftTrihedron.hxx index 1e51da1002..e66f2ef46d 100644 --- a/src/GeomFill/GeomFill_DraftTrihedron.hxx +++ b/src/GeomFill/GeomFill_DraftTrihedron.hxx @@ -90,8 +90,8 @@ private: gp_Vec B; - Standard_Real myAngle; - Standard_Real myCos; + Standard_Real myAngle{}; + Standard_Real myCos{}; }; diff --git a/src/GeomFill/GeomFill_EvolvedSection.cxx b/src/GeomFill/GeomFill_EvolvedSection.cxx index d9570def03..1879686278 100644 --- a/src/GeomFill/GeomFill_EvolvedSection.cxx +++ b/src/GeomFill/GeomFill_EvolvedSection.cxx @@ -29,6 +29,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(GeomFill_EvolvedSection,GeomFill_SectionLaw) @@ -41,12 +42,12 @@ static Standard_Boolean Affich = 0; #endif GeomFill_EvolvedSection::GeomFill_EvolvedSection(const Handle(Geom_Curve)& C, - const Handle(Law_Function)& L) + const Handle(Law_Function)& L) : TLaw(myLaw) { L->Bounds(First, Last); mySection = Handle(Geom_Curve)::DownCast(C->Copy()); myLaw = L->Trim(First, Last, 1.e-20); - TLaw = myLaw; + myCurve = Handle(Geom_BSplineCurve)::DownCast(C); if (myCurve.IsNull()) { myCurve = GeomConvert::CurveToBSplineCurve(C, Convert_QuasiAngular); @@ -72,8 +73,8 @@ GeomFill_EvolvedSection::GeomFill_EvolvedSection(const Handle(Geom_Curve)& C, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& Weights) { - Standard_Real val; - Standard_Integer ii, L = Poles.Length(); + Standard_Real val = NAN; + Standard_Integer ii = 0, L = Poles.Length(); val= TLaw->Value(U); myCurve->Poles(Poles); for (ii=1; ii<=L; ii++) { @@ -93,8 +94,8 @@ GeomFill_EvolvedSection::GeomFill_EvolvedSection(const Handle(Geom_Curve)& C, TColStd_Array1OfReal& Weights, TColStd_Array1OfReal& DWeights) { - Standard_Real val, dval; - Standard_Integer ii, L = Poles.Length(); + Standard_Real val = NAN, dval = NAN; + Standard_Integer ii = 0, L = Poles.Length(); TLaw->D1(U, val, dval); myCurve->Poles(Poles); @@ -120,8 +121,8 @@ GeomFill_EvolvedSection::GeomFill_EvolvedSection(const Handle(Geom_Curve)& C, TColStd_Array1OfReal& DWeights, TColStd_Array1OfReal& D2Weights) { - Standard_Real val, dval, d2val; - Standard_Integer ii, L = Poles.Length(); + Standard_Real val = NAN, dval = NAN, d2val = NAN; + Standard_Integer ii = 0, L = Poles.Length(); TLaw->D2(U, val, dval, d2val); myCurve->Poles(Poles); myCurve->Weights(Weights); @@ -291,8 +292,8 @@ GeomFill_EvolvedSection::GeomFill_EvolvedSection(const Handle(Geom_Curve)& C, //======================================================= gp_Pnt GeomFill_EvolvedSection::BarycentreOfSurf() const { - Standard_Real U = mySection->FirstParameter(), Delta, b; - Standard_Integer ii; + Standard_Real U = mySection->FirstParameter(), Delta = NAN, b = NAN; + Standard_Integer ii = 0; gp_Pnt P, Bary; Delta = ( myCurve->LastParameter() - U ) / 20; @@ -313,8 +314,8 @@ GeomFill_EvolvedSection::GeomFill_EvolvedSection(const Handle(Geom_Curve)& C, Standard_Real GeomFill_EvolvedSection::MaximalSection() const { - Standard_Real L, val, max, U, Delta; - Standard_Integer ii; + Standard_Real L = NAN, val = NAN, max = NAN, U = NAN, Delta = NAN; + Standard_Integer ii = 0; GeomAdaptor_Curve AC (mySection); L = GCPnts_AbscissaPoint::Length(AC); @@ -346,7 +347,7 @@ void GeomFill_EvolvedSection::GetMinimalWeight(TColStd_Array1OfReal& Weights) co Handle(Geom_Curve) GeomFill_EvolvedSection::ConstantSection() const { - Standard_Real Err, scale; + Standard_Real Err = NAN, scale = NAN; if (!IsConstant(Err)) throw StdFail_NotDone("The Law is not Constant!"); gp_Trsf T; gp_Pnt P(0, 0, 0); diff --git a/src/GeomFill/GeomFill_EvolvedSection.hxx b/src/GeomFill/GeomFill_EvolvedSection.hxx index 71e48bac87..f962b7a053 100644 --- a/src/GeomFill/GeomFill_EvolvedSection.hxx +++ b/src/GeomFill/GeomFill_EvolvedSection.hxx @@ -155,8 +155,8 @@ protected: private: - Standard_Real First; - Standard_Real Last; + Standard_Real First{}; + Standard_Real Last{}; Handle(Geom_Curve) mySection; Handle(Law_Function) myLaw; Handle(Law_Function) TLaw; diff --git a/src/GeomFill/GeomFill_Frenet.cxx b/src/GeomFill/GeomFill_Frenet.cxx index ff4f83319b..effa43b0c1 100644 --- a/src/GeomFill/GeomFill_Frenet.cxx +++ b/src/GeomFill/GeomFill_Frenet.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -150,7 +152,7 @@ Standard_Boolean GeomFill_Frenet::SetCurve(const Handle(Adaptor3d_Curve)& C) void GeomFill_Frenet::Init() { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; GeomFill_SnglrFunc Func(myCurve); Standard_Real TolF = 1.0e-10, Tol = 10*TolF, Tol2 = Tol * Tol, PTol = Precision::PConfusion(); @@ -166,7 +168,7 @@ Standard_Boolean GeomFill_Frenet::SetCurve(const Handle(Adaptor3d_Curve)& C) TColStd_Array1OfReal AveFunc(1, NbIntC2); myCurve->Intervals(myC2Disc->ChangeArray1(), GeomAbs_C2); Standard_Integer NbControl = 10; - Standard_Real Step, Average = 0, modulus; + Standard_Real Step = NAN, Average = 0, modulus = NAN; gp_Pnt C, C1; for(i = 1; i <= NbIntC2; i++) { Step = (myC2Disc->Value(i+1) - myC2Disc->Value(i))/NbControl; @@ -197,7 +199,7 @@ Standard_Boolean GeomFill_Frenet::SetCurve(const Handle(Adaptor3d_Curve)& C) TColStd_SequenceOfReal * SeqArray = new TColStd_SequenceOfReal[ NbIntC2 ]; TColStd_SequenceOfReal SnglSeq; // Standard_Real Value2, preValue=1.e200, t; - Standard_Real Value2, t; + Standard_Real Value2 = NAN, t = NAN; Extrema_ExtPC Ext; gp_Pnt Origin(0, 0, 0); @@ -297,7 +299,7 @@ Standard_Boolean GeomFill_Frenet::SetCurve(const Handle(Adaptor3d_Curve)& C) // computation of length of singular interval mySnglLen = new TColStd_HArray1OfReal(1, mySngl->Length()); gp_Vec SnglDer, SnglDer2; - Standard_Real norm; + Standard_Real norm = NAN; for(i = 1; i <= mySngl->Length(); i++) { Func.D2(mySngl->Value(i), C, SnglDer, SnglDer2); if ((norm = SnglDer.Magnitude()) > gp::Resolution()) @@ -315,7 +317,7 @@ Standard_Boolean GeomFill_Frenet::SetCurve(const Handle(Adaptor3d_Curve)& C) // we have to merge singular points that have common parts of singular intervals TColgp_SequenceOfPnt2d tmpSeq; tmpSeq.Append(gp_Pnt2d(mySngl->Value(1), mySnglLen->Value(1))); - Standard_Real U11, U12, U21, U22; + Standard_Real U11 = NAN, U12 = NAN, U21 = NAN, U22 = NAN; for(i = 2; i<= mySngl->Length(); i++) { U12 = tmpSeq.Last().X() + tmpSeq.Last().Y(); U21 = mySngl->Value(i) - mySnglLen->Value(i); @@ -418,8 +420,8 @@ Standard_Boolean { const Standard_Real aTol = gp::Resolution(); - Standard_Real norm; - Standard_Integer Index; + Standard_Real norm = NAN; + Standard_Integer Index = 0; Standard_Real Delta = 0.; if(IsSingular(theParam, Index)) if (SingularD0(theParam, Index, Tangent, Normal, BiNormal, Delta)) @@ -453,7 +455,7 @@ Standard_Boolean if(isDeriveFound) { - Standard_Real u; + Standard_Real u = NAN; if(theParam-anUinfium < aDelta) u = theParam+aDelta; @@ -476,7 +478,7 @@ Standard_Boolean gp_Pnt Ptemp(0.0,0.0,0.0); //(0,0,0)-coordinate gp_Pnt P1, P2, P3; - Standard_Boolean IsParameterGrown; + Standard_Boolean IsParameterGrown = 0; if(theParam-anUinfium < 2*aDelta) { @@ -560,7 +562,7 @@ Standard_Boolean gp_Vec& BiNormal, gp_Vec& DBiNormal) { - Standard_Integer Index; + Standard_Integer Index = 0; Standard_Real Delta = 0.; if(IsSingular(Param, Index)) if (SingularD1(Param, Index, Tangent, DTangent, Normal, DNormal, BiNormal, DBiNormal, Delta)) @@ -614,7 +616,7 @@ Standard_Boolean gp_Vec& DBiNormal, gp_Vec& D2BiNormal) { - Standard_Integer Index; + Standard_Integer Index = 0; Standard_Real Delta = 0.; if(IsSingular(Param, Index)) if(SingularD2(Param, Index, Tangent, DTangent, D2Tangent, @@ -674,7 +676,7 @@ Standard_Boolean Standard_Integer GeomFill_Frenet::NbIntervals(const GeomAbs_Shape S) const { GeomAbs_Shape tmpS = GeomAbs_C0; - Standard_Integer NbTrimmed; + Standard_Integer NbTrimmed = 0; switch (S) { case GeomAbs_C0: tmpS = GeomAbs_C2; break; case GeomAbs_C1: tmpS = GeomAbs_C3; break; @@ -706,7 +708,7 @@ Standard_Boolean const GeomAbs_Shape S) const { GeomAbs_Shape tmpS = GeomAbs_C0; - Standard_Integer NbTrimmed; + Standard_Integer NbTrimmed = 0; switch (S) { case GeomAbs_C0: tmpS = GeomAbs_C2; break; case GeomAbs_C1: tmpS = GeomAbs_C3; break; @@ -743,7 +745,7 @@ Standard_Boolean ABiNormal = gp_Vec(0, 0, 0); Standard_Real Step = (myTrimmed->LastParameter() - myTrimmed->FirstParameter()) / Num; - Standard_Real Param; + Standard_Real Param = NAN; for (Standard_Integer i = 0; i <= Num; i++) { Param = myTrimmed->FirstParameter() + i*Step; if (Param > myTrimmed->LastParameter()) Param = myTrimmed->LastParameter(); @@ -787,7 +789,7 @@ Standard_Boolean Standard_Boolean GeomFill_Frenet::IsSingular(const Standard_Real U, Standard_Integer& Index) const { - Standard_Integer i; + Standard_Integer i = 0; if(!isSngl) return Standard_False; for(i = 1; i <= mySngl->Length(); i++) { if (Abs(U - mySngl->Value(i)) < mySnglLen->Value(i)) { @@ -813,12 +815,12 @@ Standard_Boolean GeomFill_Frenet::DoSingular(const Standard_Real U, Standard_Integer& BNFlag, Standard_Real& Delta) { - Standard_Integer i, MaxN = 20; + Standard_Integer i = 0, MaxN = 20; Delta = 0.; - Standard_Real h; + Standard_Real h = NAN; h = 2*mySnglLen->Value(Index); - Standard_Real A, B; + Standard_Real A = NAN, B = NAN; gp_Vec T, N, BN; TFlag = 1; BNFlag = 1; @@ -874,7 +876,7 @@ Standard_Boolean GeomFill_Frenet::DoSingular(const Standard_Real U, gp_Vec& BiNormal, Standard_Real& Delta) { - Standard_Integer n, k, TFlag, BNFlag; + Standard_Integer n = 0, k = 0, TFlag = 0, BNFlag = 0; if(!DoSingular(Param, Index, Tangent, BiNormal, n, k, TFlag, BNFlag, Delta)) return Standard_False; @@ -894,7 +896,7 @@ Standard_Boolean GeomFill_Frenet::DoSingular(const Standard_Real U, gp_Vec& BiNormal,gp_Vec& DBiNormal, Standard_Real& Delta) { - Standard_Integer n, k, TFlag, BNFlag; + Standard_Integer n = 0, k = 0, TFlag = 0, BNFlag = 0; if(!DoSingular(Param, Index, Tangent, BiNormal, n, k, TFlag, BNFlag, Delta)) return Standard_False; @@ -937,7 +939,7 @@ Standard_Boolean GeomFill_Frenet::DoSingular(const Standard_Real U, gp_Vec& D2BiNormal, Standard_Real& Delta) { - Standard_Integer n, k, TFlag, BNFlag; + Standard_Integer n = 0, k = 0, TFlag = 0, BNFlag = 0; if(!DoSingular(Param, Index, Tangent, BiNormal, n, k, TFlag, BNFlag, Delta)) return Standard_False; diff --git a/src/GeomFill/GeomFill_FunctionDraft.cxx b/src/GeomFill/GeomFill_FunctionDraft.cxx index 90983835c1..29f3cdb26c 100644 --- a/src/GeomFill/GeomFill_FunctionDraft.cxx +++ b/src/GeomFill/GeomFill_FunctionDraft.cxx @@ -35,10 +35,10 @@ // Purpose : Initialisation de la section et de la surface d'arret //******************************************************* GeomFill_FunctionDraft::GeomFill_FunctionDraft - (const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C) + (const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C) : TheCurve(C), TheSurface(S) { - TheCurve = C ; - TheSurface = S; + + } //******************************************************* @@ -84,7 +84,7 @@ GeomFill_FunctionDraft::GeomFill_FunctionDraft Standard_Boolean GeomFill_FunctionDraft::Derivatives(const math_Vector& X, math_Matrix& D) { - Standard_Integer i; + Standard_Integer i = 0; gp_Pnt P,P1; gp_Vec DP,DP1U,DP1V; TheCurve->D1(X(1),P,DP); @@ -107,7 +107,7 @@ GeomFill_FunctionDraft::GeomFill_FunctionDraft math_Vector& F, math_Matrix& D) { - Standard_Integer i; + Standard_Integer i = 0; gp_Pnt P,P1; gp_Vec DP,DP1U,DP1V; TheCurve->D1(X(1),P,DP); //derivee de la generatrice @@ -183,7 +183,7 @@ GeomFill_FunctionDraft::GeomFill_FunctionDraft // gp_Pnt P; // gp_Vec DP,D2P; - Standard_Integer i; + Standard_Integer i = 0; for (i=1;i<=3;i++) { D(i,1) = dN.Coord(i)*Sin(teta); //derivee / W @@ -204,7 +204,7 @@ GeomFill_FunctionDraft::GeomFill_FunctionDraft gp_Pnt P; gp_Vec DPu,DPv; gp_Vec D2Pu, D2Pv, D2Puv; - Standard_Integer i; + Standard_Integer i = 0; TheSurface->D2(X(2), X(3), P, DPu, DPv, D2Pu, D2Pv, D2Puv); diff --git a/src/GeomFill/GeomFill_FunctionGuide.cxx b/src/GeomFill/GeomFill_FunctionGuide.cxx index 8097e8225a..e9d6632325 100644 --- a/src/GeomFill/GeomFill_FunctionGuide.cxx +++ b/src/GeomFill/GeomFill_FunctionGuide.cxx @@ -97,7 +97,7 @@ GeomFill_FunctionGuide::GeomFill_FunctionGuide First, Last); } else { - Standard_Integer NbPoles, NbKnots, Deg; + Standard_Integer NbPoles = 0, NbKnots = 0, Deg = 0; TheLaw->SectionShape(NbPoles, NbKnots, Deg); TColStd_Array1OfInteger Mult(1,NbKnots); TheLaw->Mults( Mult); @@ -172,7 +172,7 @@ GeomFill_FunctionGuide::GeomFill_FunctionGuide TheGuide->D1(X(1),P,DP); TheSurface->D1(X(2),X(3),P1,DP1U,DP1V); - Standard_Integer i; + Standard_Integer i = 0; for (i=1;i<=3;i++) { D(i,1) = DP.Coord(i); @@ -197,7 +197,7 @@ GeomFill_FunctionGuide::GeomFill_FunctionGuide TheGuide->D1(X(1),P,DP); //derivee de la generatrice TheSurface->D1(X(2),X(3),P1,DP1U,DP1V); //derivee de la new surface - Standard_Integer i; + Standard_Integer i = 0; for (i=1;i<=3;i++) { F(i) = P.Coord(i) - P1.Coord(i); diff --git a/src/GeomFill/GeomFill_Generator.cxx b/src/GeomFill/GeomFill_Generator.cxx index 57ab6e06f5..80f3b8ae69 100644 --- a/src/GeomFill/GeomFill_Generator.cxx +++ b/src/GeomFill/GeomFill_Generator.cxx @@ -46,7 +46,7 @@ void GeomFill_Generator::Perform(const Standard_Real PTol) // Create the surface. - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Standard_Integer NbUPoles = NbPoles(); Standard_Integer NbVPoles = mySequence.Length(); Standard_Integer NbUKnots = NbKnots(); diff --git a/src/GeomFill/GeomFill_GuideTrihedronAC.cxx b/src/GeomFill/GeomFill_GuideTrihedronAC.cxx index 2a519c1ba0..8d7b97e5e8 100644 --- a/src/GeomFill/GeomFill_GuideTrihedronAC.cxx +++ b/src/GeomFill/GeomFill_GuideTrihedronAC.cxx @@ -15,6 +15,8 @@ // Created: Tue Jun 23 15:39:24 1998 +#include + #include #include #include @@ -34,16 +36,16 @@ IMPLEMENT_STANDARD_RTTIEXT(GeomFill_GuideTrihedronAC,GeomFill_TrihedronWithGuide //function : GuideTrihedron //purpose : Constructor //======================================================================= -GeomFill_GuideTrihedronAC::GeomFill_GuideTrihedronAC(const Handle(Adaptor3d_Curve) & guide) +GeomFill_GuideTrihedronAC::GeomFill_GuideTrihedronAC(const Handle(Adaptor3d_Curve) & guide) : myGuideAC(new (Approx_CurvlinFunc) (myGuide,1.e-7)), Lguide(myGuideAC->GetLength()), Orig1(0), Orig2(1) { myCurve.Nullify(); myGuide = guide; myTrimG = guide; - myGuideAC = new (Approx_CurvlinFunc) (myGuide,1.e-7); - Lguide = myGuideAC->GetLength(); + + UTol = STol = Precision::PConfusion(); - Orig1 = 0; // origines pour le cas path multi-edges - Orig2 = 1; + // origines pour le cas path multi-edges + } //======================================================================= @@ -99,7 +101,7 @@ GeomFill_GuideTrihedronAC::GeomFill_GuideTrihedronAC(const Handle(Adaptor3d_Curv gp_Vec& DBiNormal) { //triedre - Standard_Real s, OrigG, tG, dtg; + Standard_Real s = NAN, OrigG = NAN, tG = NAN, dtg = NAN; // abscisse curviligne <=> Param s = myCurveAC->GetSParameter(Param); // parametre <=> s sur theGuide @@ -188,11 +190,11 @@ GeomFill_GuideTrihedronAC::GeomFill_GuideTrihedronAC(const Handle(Adaptor3d_Curv Standard_Real N2To = To.SquareMagnitude(); Standard_Real NTG = TG.Magnitude(); Standard_Real N2Tp = TG.SquareMagnitude(); - Standard_Real d2tp_dt2, dtg_dt; + Standard_Real d2tp_dt2 = NAN, dtg_dt = NAN; dtg_dt = (Orig2-Orig1)*(NTo/NTG)*(Lguide/L); gp_Vec n(P, PG); // vecteur definissant la normale - Standard_Real Norm = n.Magnitude(), ndn; + Standard_Real Norm = n.Magnitude(), ndn = NAN; //derivee de n par rapport a Param gp_Vec dn, d2n; dn.SetLinearForm(dtg_dt, TG, -1, To); @@ -307,7 +309,7 @@ GeomFill_GuideTrihedronAC::GeomFill_GuideTrihedronAC(const Handle(Adaptor3d_Curv //======================================================================= Standard_Integer GeomFill_GuideTrihedronAC::NbIntervals(const GeomAbs_Shape S) const { - Standard_Integer Nb; + Standard_Integer Nb = 0; Nb = myCurveAC->NbIntervals(S); TColStd_Array1OfReal DiscC(1, Nb+1); myCurveAC->Intervals(DiscC, S); @@ -329,7 +331,7 @@ GeomFill_GuideTrihedronAC::GeomFill_GuideTrihedronAC(const Handle(Adaptor3d_Curv void GeomFill_GuideTrihedronAC::Intervals(TColStd_Array1OfReal& TT, const GeomAbs_Shape S) const { - Standard_Integer Nb, ii; + Standard_Integer Nb = 0, ii = 0; Nb = myCurveAC->NbIntervals(S); TColStd_Array1OfReal DiscC(1, Nb+1); myCurveAC->Intervals(DiscC, S); @@ -355,7 +357,7 @@ void GeomFill_GuideTrihedronAC::SetInterval(const Standard_Real First, const Standard_Real Last) { myTrimmed = myCurve->Trim(First, Last, UTol); - Standard_Real Sf, Sl, U; + Standard_Real Sf = NAN, Sl = NAN, U = NAN; Sf = myCurveAC->GetSParameter(First); Sl = myCurveAC->GetSParameter(Last); @@ -379,8 +381,8 @@ void GeomFill_GuideTrihedronAC::SetInterval(const Standard_Real First, gp_Vec& ANormal, gp_Vec& ABiNormal) { - Standard_Integer ii; - Standard_Real t, Delta = (myCurve->LastParameter() - + Standard_Integer ii = 0; + Standard_Real t = NAN, Delta = (myCurve->LastParameter() - myCurve->FirstParameter())/20.001; ATangent.SetCoord(0.,0.,0.); diff --git a/src/GeomFill/GeomFill_GuideTrihedronAC.hxx b/src/GeomFill/GeomFill_GuideTrihedronAC.hxx index 993229397d..169a658cdf 100644 --- a/src/GeomFill/GeomFill_GuideTrihedronAC.hxx +++ b/src/GeomFill/GeomFill_GuideTrihedronAC.hxx @@ -104,7 +104,7 @@ private: Handle(Approx_CurvlinFunc) myGuideAC; Standard_Real Lguide; Handle(Approx_CurvlinFunc) myCurveAC; - Standard_Real L; + Standard_Real L{}; Handle(Adaptor3d_Curve) myCurve; Standard_Real UTol; Standard_Real STol; diff --git a/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx b/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx index 963054a935..6939fe5753 100644 --- a/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx +++ b/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,14 +80,14 @@ GeomFill_GuideTrihedronPlan::GeomFill_GuideTrihedronPlan (const Handle(Adaptor3d X(1,1), XTol(1,1), Inf(1,1), Sup(1,1), - myStatus(GeomFill_PipeOk) + myNbPts(20), frenet(new (GeomFill_Frenet)()), myStatus(GeomFill_PipeOk) { myCurve.Nullify(); myGuide = theGuide; // guide myTrimG = theGuide; - myNbPts = 20; // nb points pour calculs + // nb points pour calculs Pole = new (TColgp_HArray2OfPnt2d)(1,1,1,myNbPts);//tab pr stocker Pprime (pt sur guide) - frenet = new (GeomFill_Frenet)(); + XTol.Init(1.e-6); XTol(1) = myGuide->Resolution(1.e-6); } @@ -101,8 +103,8 @@ GeomFill_GuideTrihedronPlan::GeomFill_GuideTrihedronPlan (const Handle(Adaptor3d // Bnd_Box2d Box; // Box.Update(-0.1, -0.1, 0.1, 0.1); // Taille minimal gp_Vec Tangent,Normal,BiNormal; - Standard_Integer ii; - Standard_Real t, DeltaG, w = 0.; + Standard_Integer ii = 0; + Standard_Real t = NAN, DeltaG = NAN, w = 0.; Standard_Real f = myCurve->FirstParameter(); Standard_Real l = myCurve->LastParameter(); @@ -316,7 +318,7 @@ Standard_Boolean GeomFill_GuideTrihedronPlan::SetCurve(const Handle(Adaptor3d_Cu BiNormal = Tangent.Crossed(Normal); // derivee premiere du triedre - Standard_Real dedx, dedt, dtg_dt; + Standard_Real dedx = NAN, dedt = NAN, dtg_dt = NAN; E.Derivative(Res, dedx); E.DEDT(Res, To, DTangent, dedt); dtg_dt = -dedt/dedx; @@ -487,7 +489,7 @@ Standard_Boolean GeomFill_GuideTrihedronPlan::SetCurve(const Handle(Adaptor3d_Cu //======================================================================= Standard_Integer GeomFill_GuideTrihedronPlan::NbIntervals(const GeomAbs_Shape S)const { - Standard_Integer Nb; + Standard_Integer Nb = 0; GeomAbs_Shape tmpS; switch (S) { case GeomAbs_C0: tmpS = GeomAbs_C1; break; @@ -535,8 +537,8 @@ void GeomFill_GuideTrihedronPlan::SetInterval(const Standard_Real First, gp_Vec& ANormal, gp_Vec& ABiNormal) { - Standard_Integer ii; - Standard_Real t, Delta = (myCurve->LastParameter() - + Standard_Integer ii = 0; + Standard_Real t = NAN, Delta = (myCurve->LastParameter() - myCurve->FirstParameter())/20.001; ATangent.SetCoord(0.,0.,0.); @@ -564,7 +566,7 @@ void GeomFill_GuideTrihedronPlan::SetInterval(const Standard_Real First, { if ((myCurve->GetType() == GeomAbs_Line) && (myGuide->GetType() == GeomAbs_Line)) { - Standard_Real Angle; + Standard_Real Angle = NAN; Angle = myCurve->Line().Angle(myGuide->Line()); if ((Angle<1.e-12) || ((2*M_PI-Angle)<1.e-12) ) return Standard_True; @@ -598,8 +600,8 @@ void GeomFill_GuideTrihedronPlan::Origine(const Standard_Real , void GeomFill_GuideTrihedronPlan::InitX(const Standard_Real Param) { - Standard_Integer Ideb = 1, Ifin = Pole->RowLength(), Idemi; - Standard_Real Valeur, t1, t2; + Standard_Integer Ideb = 1, Ifin = Pole->RowLength(), Idemi = 0; + Standard_Real Valeur = NAN, t1 = NAN, t2 = NAN; Valeur = Pole->Value(1, Ideb).X(); diff --git a/src/GeomFill/GeomFill_Line.cxx b/src/GeomFill/GeomFill_Line.cxx index 487cf36e7c..d2b32c0bcf 100644 --- a/src/GeomFill/GeomFill_Line.cxx +++ b/src/GeomFill/GeomFill_Line.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(GeomFill_Line,Standard_Transient) //function : GeomFill_Line //purpose : //======================================================================= -GeomFill_Line::GeomFill_Line() +GeomFill_Line::GeomFill_Line() : myNbPoints(0) { - myNbPoints = 0; + } diff --git a/src/GeomFill/GeomFill_LocFunction.cxx b/src/GeomFill/GeomFill_LocFunction.cxx index 6a10e7086f..555054858c 100644 --- a/src/GeomFill/GeomFill_LocFunction.cxx +++ b/src/GeomFill/GeomFill_LocFunction.cxx @@ -23,10 +23,10 @@ #include GeomFill_LocFunction::GeomFill_LocFunction(const Handle(GeomFill_LocationLaw)& Law) - :V(1,4), DV(1,4), D2V(1,4) + :myLaw(Law), V(1,4), DV(1,4), D2V(1,4) { - myLaw = Law; + } Standard_Boolean GeomFill_LocFunction::D0(const Standard_Real Param, @@ -36,7 +36,7 @@ GeomFill_LocFunction::GeomFill_LocFunction(const Handle(GeomFill_LocationLaw)& L const Standard_Real ) { gp_Mat aM; - Standard_Boolean B; + Standard_Boolean B = 0; B = myLaw->D0(Param, aM, V.ChangeValue(1)); V(2).SetXYZ(aM.Column(1)); V(3).SetXYZ(aM.Column(2)); @@ -53,7 +53,7 @@ GeomFill_LocFunction::GeomFill_LocFunction(const Handle(GeomFill_LocationLaw)& L TColgp_Array1OfPnt2d T1(1,1); TColgp_Array1OfVec2d T2(1,1); gp_Mat aM, aDM; - Standard_Boolean B; + Standard_Boolean B = 0; B = myLaw->D1(Param, aM, V.ChangeValue(1), aDM, DV.ChangeValue(1), T1, T2); @@ -77,7 +77,7 @@ GeomFill_LocFunction::GeomFill_LocFunction(const Handle(GeomFill_LocationLaw)& L TColgp_Array1OfPnt2d T1(1,1); TColgp_Array1OfVec2d T2(1,1), T3(1,1); gp_Mat aM, aDM, aD2M; - Standard_Boolean B; + Standard_Boolean B = 0; B = myLaw->D2(Param, aM, V.ChangeValue(1), aDM, DV.ChangeValue(1), aD2M, D2V.ChangeValue(1), @@ -105,7 +105,7 @@ GeomFill_LocFunction::GeomFill_LocFunction(const Handle(GeomFill_LocationLaw)& L Standard_Real& Result, Standard_Integer& Ier) { - Standard_Boolean B; + Standard_Boolean B = 0; Standard_Real * AddrResult = &Result; const Standard_Real * LocalResult=NULL; diff --git a/src/GeomFill/GeomFill_LocationDraft.cxx b/src/GeomFill/GeomFill_LocationDraft.cxx index da90acc850..bf6bff6c1f 100644 --- a/src/GeomFill/GeomFill_LocationDraft.cxx +++ b/src/GeomFill/GeomFill_LocationDraft.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -48,18 +50,18 @@ IMPLEMENT_STANDARD_RTTIEXT(GeomFill_LocationDraft,GeomFill_LocationLaw) //================================================================== GeomFill_LocationDraft::GeomFill_LocationDraft (const gp_Dir& Direction, - const Standard_Real Angle) + const Standard_Real Angle) : myDir(Direction), myAngle(Angle), myNbPts(41), Intersec(Standard_False), WithTrans(Standard_False) { - myDir = Direction; // direction de depouille + // direction de depouille - myAngle = Angle; // angle de depouille (teta prime) + // angle de depouille (teta prime) mySurf.Nullify(); myLaw = new (GeomFill_DraftTrihedron)(myDir, Angle); // triedre - myNbPts = 41; // nb de points utilises pour les calculs + // nb de points utilises pour les calculs myPoles2d = new (TColgp_HArray1OfPnt2d)(1, 2*myNbPts); - Intersec = Standard_False; //intersection avec surface d'arret ? - WithTrans = Standard_False; + //intersection avec surface d'arret ? + } @@ -146,8 +148,8 @@ GeomFill_LocationDraft::GeomFill_LocationDraft Intersec = Standard_True; - Standard_Integer ii,jj; - Standard_Real f, l, t; + Standard_Integer ii = 0,jj = 0; + Standard_Real f = NAN, l = NAN, t = NAN; gp_Pnt P; gp_Vec D,T,N,B; Handle(Geom_Line) L; @@ -213,7 +215,7 @@ GeomFill_LocationDraft::GeomFill_LocationDraft gp_Mat& M, gp_Vec& V) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; gp_Vec T,N,B; gp_Pnt P; @@ -240,7 +242,7 @@ GeomFill_LocationDraft::GeomFill_LocationDraft gp_Vec& V, TColgp_Array1OfPnt2d& Poles2d) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; // gp_Vec D,T,N,B,DT,DN,DB; gp_Vec D,T,N,B; gp_Pnt P; @@ -263,7 +265,7 @@ GeomFill_LocationDraft::GeomFill_LocationDraft Handle(Geom_Line) L = new (Geom_Line) (P, D); Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve) (L); - Standard_Real t1,t2,Paramt1,t2Param; + Standard_Real t1 = NAN,t2 = NAN,Paramt1 = NAN,t2Param = NAN; Standard_Real U0=0,V0=0,W0=0; Standard_Integer ii = 1; @@ -349,7 +351,7 @@ GeomFill_LocationDraft::GeomFill_LocationDraft TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; gp_Vec D,T,N,B,DT,DN,DB; gp_Pnt P; @@ -375,7 +377,7 @@ GeomFill_LocationDraft::GeomFill_LocationDraft Handle(Geom_Line) L = new (Geom_Line) (P, D); Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve) (L); - Standard_Real t1,t2,Paramt1,t2Param; + Standard_Real t1 = NAN,t2 = NAN,Paramt1 = NAN,t2Param = NAN; Standard_Real U0=0,V0=0,W0=0; Standard_Integer ii = 1; @@ -485,7 +487,7 @@ GeomFill_LocationDraft::GeomFill_LocationDraft TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; gp_Vec D,T,N,B,DT,DN,DB,D2T,D2N,D2B; gp_Pnt P; @@ -513,7 +515,7 @@ GeomFill_LocationDraft::GeomFill_LocationDraft Handle(Geom_Line) L = new (Geom_Line) (P, D); Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve) (L); - Standard_Real t1,t2,Paramt1,t2Param; + Standard_Real t1 = NAN,t2 = NAN,Paramt1 = NAN,t2Param = NAN; Standard_Real U0=0,V0=0,W0=0; Standard_Integer ii = 1; @@ -752,8 +754,8 @@ void GeomFill_LocationDraft::Resolution (const Standard_Integer Index, void GeomFill_LocationDraft::GetAverageLaw(gp_Mat& AM, gp_Vec& AV) { - Standard_Integer ii; - Standard_Real U, delta; + Standard_Integer ii = 0; + Standard_Real U = NAN, delta = NAN; gp_Vec V1,V2,V3, V; myLaw->GetAverageLaw(V1, V2, V3); diff --git a/src/GeomFill/GeomFill_LocationGuide.cxx b/src/GeomFill/GeomFill_LocationGuide.cxx index ea04ee4ccb..885ccd3f4a 100644 --- a/src/GeomFill/GeomFill_LocationGuide.cxx +++ b/src/GeomFill/GeomFill_LocationGuide.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -160,19 +162,19 @@ static void InGoodPeriod(const Standard_Real Prec, //================================================================== GeomFill_LocationGuide:: GeomFill_LocationGuide (const Handle(GeomFill_TrihedronWithGuide)& Triedre) - : TolRes(1,3), Inf(1,3,0.), Sup(1,3,0.), + : myLaw(Triedre), myNbPts(21), TolRes(1,3), Inf(1,3,0.), Sup(1,3,0.), X(1,3), R(1,3), myStatus(GeomFill_PipeOk) { TolRes.Init(1.e-6); - myLaw = Triedre; // loi de triedre + // loi de triedre mySec.Nullify(); // loi de section myCurve.Nullify(); myFirstS = myLastS = -505e77; - myNbPts = 21; // nb points pour les calculs + // nb points pour les calculs myGuide = myLaw->Guide(); // courbe guide if (!myGuide->IsPeriodic()) { - Standard_Real f, l, delta; + Standard_Real f = NAN, l = NAN, delta = NAN; f = myGuide->FirstParameter(); l = myGuide->LastParameter(); delta = (l-f)/100; @@ -218,10 +220,10 @@ static void InGoodPeriod(const Standard_Real Prec, // gp_Pnt P,P1,P2; gp_Pnt P; gp_Vec T,N,B; - Standard_Integer ii, Deg; - Standard_Boolean isconst, israt=Standard_False; - Standard_Real t, v,w, OldAngle=0, Angle, DeltaG, Diff; - Standard_Real CurAngle = PrecAngle, a1/*, a2*/; + Standard_Integer ii = 0, Deg = 0; + Standard_Boolean isconst = 0, israt=Standard_False; + Standard_Real t = NAN, v = NAN,w = NAN, OldAngle=0, Angle = NAN, DeltaG = NAN, Diff = NAN; + Standard_Real CurAngle = PrecAngle, a1 = NAN/*, a2*/; gp_Pnt2d p1,p2; Handle(Geom_SurfaceOfRevolution) Revol; // surface de revolution Handle(GeomAdaptor_Surface) Pl; // = Revol @@ -235,13 +237,13 @@ static void InGoodPeriod(const Standard_Real Prec, Standard_Real U=0, UPeriod=0; Standard_Real f = myCurve->FirstParameter(); Standard_Real l = myCurve->LastParameter(); - Standard_Boolean Ok, uperiodic = mySec->IsUPeriodic(); + Standard_Boolean Ok = 0, uperiodic = mySec->IsUPeriodic(); DeltaG = (myGuide->LastParameter() - myGuide->FirstParameter())/5; Handle(Geom_Curve) mySection; Standard_Real Tol =1.e-9; - Standard_Integer NbPoles, NbKnots; + Standard_Integer NbPoles = 0, NbKnots = 0; mySec->SectionShape(NbPoles, NbKnots, Deg); @@ -266,7 +268,7 @@ static void InGoodPeriod(const Standard_Real Prec, } // Bornes de calculs - Standard_Real Delta; + Standard_Real Delta = NAN; // Standard_Integer bid1, bid2, NbK; Delta = myGuide->LastParameter() - myGuide->FirstParameter(); Inf(1) = myGuide->FirstParameter() - Delta/10; @@ -511,7 +513,7 @@ static void InGoodPeriod(const Standard_Real Prec, //================================================================== Handle(GeomFill_LocationLaw) GeomFill_LocationGuide::Copy() const { - Standard_Real la; + Standard_Real la = NAN; Handle(GeomFill_TrihedronWithGuide) L; L = Handle(GeomFill_TrihedronWithGuide)::DownCast(myLaw->Copy()); Handle(GeomFill_LocationGuide) copy = new @@ -532,7 +534,7 @@ static void InGoodPeriod(const Standard_Real Prec, //================================================================== Standard_Boolean GeomFill_LocationGuide::SetCurve(const Handle(Adaptor3d_Curve)& C) { - Standard_Real LastAngle; + Standard_Real LastAngle = NAN; myCurve = C; myTrimmed = C; @@ -579,7 +581,7 @@ Standard_Boolean GeomFill_LocationGuide::SetCurve(const Handle(Adaptor3d_Curve)& gp_Mat& M, gp_Vec& V) { - Standard_Boolean Ok; + Standard_Boolean Ok = 0; gp_Vec T,N,B; gp_Pnt P; @@ -653,7 +655,7 @@ Standard_Boolean GeomFill_LocationGuide::SetCurve(const Handle(Adaptor3d_Curve)& { gp_Vec T, N, B; gp_Pnt P; - Standard_Boolean Ok; + Standard_Boolean Ok = 0; myCurve->D0(Param, P); V.SetXYZ(P.XYZ()); @@ -733,7 +735,7 @@ Standard_Boolean GeomFill_LocationGuide::SetCurve(const Handle(Adaptor3d_Curve)& gp_Vec T, N, B, DT, DN, DB; // gp_Pnt P, P0; gp_Pnt P; - Standard_Boolean Ok; + Standard_Boolean Ok = 0; myCurve->D1(Param, P, DV); V.SetXYZ(P.XYZ()); @@ -901,7 +903,7 @@ Standard_Boolean GeomFill_LocationGuide::D2(const Standard_Real Param, // gp_Vec T0, N0, B0, T1, N1, B1; // gp_Pnt P, P0, P1; gp_Pnt P; - Standard_Boolean Ok; + Standard_Boolean Ok = 0; myCurve->D2(Param, P, DV, D2V); V.SetXYZ(P.XYZ()); @@ -1177,7 +1179,7 @@ Standard_Boolean GeomFill_LocationGuide::D2(const Standard_Real Param, Standard_Integer GeomFill_LocationGuide::NbIntervals (const GeomAbs_Shape S) const { - Standard_Integer Nb_Sec, Nb_Law; + Standard_Integer Nb_Sec = 0, Nb_Law = 0; Nb_Sec = myTrimmed->NbIntervals(S); Nb_Law = myLaw->NbIntervals(S); @@ -1206,7 +1208,7 @@ Standard_Boolean GeomFill_LocationGuide::D2(const Standard_Real Param, void GeomFill_LocationGuide::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const { - Standard_Integer Nb_Sec, Nb_Law; + Standard_Integer Nb_Sec = 0, Nb_Law = 0; Nb_Sec = myTrimmed->NbIntervals(S); Nb_Law = myLaw->NbIntervals(S); @@ -1304,8 +1306,8 @@ void GeomFill_LocationGuide::Resolution (const Standard_Integer , void GeomFill_LocationGuide::GetAverageLaw(gp_Mat& AM, gp_Vec& AV) { - Standard_Integer ii; - Standard_Real U, delta; + Standard_Integer ii = 0; + Standard_Real U = NAN, delta = NAN; gp_Vec V, V1, V2, V3; myLaw->GetAverageLaw(V1, V2, V3); @@ -1377,8 +1379,8 @@ void GeomFill_LocationGuide::Resolution (const Standard_Integer , void GeomFill_LocationGuide::InitX(const Standard_Real Param) { - Standard_Integer Ideb = 1, Ifin = myPoles2d->RowLength(), Idemi; - Standard_Real Valeur, t1, t2; + Standard_Integer Ideb = 1, Ifin = myPoles2d->RowLength(), Idemi = 0; + Standard_Real Valeur = NAN, t1 = NAN, t2 = NAN; Valeur = myPoles2d->Value(1, Ideb).X(); @@ -1410,7 +1412,7 @@ void GeomFill_LocationGuide::InitX(const Standard_Real Param) t2 = myPoles2d->Value(1,Ifin).X(); Standard_Real diff = t2-t1; - Standard_Real W1, W2; + Standard_Real W1 = NAN, W2 = NAN; W1 = myPoles2d->Value(1,Ideb).Coord(2); W2 = myPoles2d->Value(1,Ifin).Coord(2); const gp_Pnt2d& P1 = myPoles2d->Value(2, Ideb); @@ -1459,8 +1461,8 @@ GeomFill_PipeError GeomFill_LocationGuide::ComputeAutomaticLaw(Handle(TColgp_HAr { gp_Pnt P; gp_Vec T,N,B; - Standard_Integer ii; - Standard_Real t; + Standard_Integer ii = 0; + Standard_Real t = NAN; GeomFill_PipeError theStatus = GeomFill_PipeOk; diff --git a/src/GeomFill/GeomFill_LocationGuide.hxx b/src/GeomFill/GeomFill_LocationGuide.hxx index 06dceceb2b..4da91f5821 100644 --- a/src/GeomFill/GeomFill_LocationGuide.hxx +++ b/src/GeomFill/GeomFill_LocationGuide.hxx @@ -190,11 +190,11 @@ private: Standard_Boolean rotation; Standard_Real OrigParam1; Standard_Real OrigParam2; - Standard_Real Uf; - Standard_Real Ul; + Standard_Real Uf{}; + Standard_Real Ul{}; Standard_Real myFirstS; Standard_Real myLastS; - Standard_Real ratio; + Standard_Real ratio{}; Standard_Boolean WithTrans; gp_Mat Trans; math_Vector TolRes; diff --git a/src/GeomFill/GeomFill_NSections.cxx b/src/GeomFill/GeomFill_NSections.cxx index 9fd91d3fca..1ff941107a 100644 --- a/src/GeomFill/GeomFill_NSections.cxx +++ b/src/GeomFill/GeomFill_NSections.cxx @@ -43,6 +43,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(GeomFill_NSections,GeomFill_SectionLaw) @@ -164,7 +165,7 @@ static void ResultEval(const Handle(Geom_BSplineSurface)& surf, // les poles Standard_Integer Psize = Cdim * NbP; TColStd_Array1OfReal SPoles(1,Psize); - Standard_Integer ii, jj, ipole=1; + Standard_Integer ii = 0, jj = 0, ipole=1; for (jj=1;jj<=NbP;jj++) { for (ii=1;ii<=surf->NbUPoles();ii++) { SPoles(ipole) = surf->Pole(ii,jj).X(); @@ -200,13 +201,13 @@ static void ResultEval(const Handle(Geom_BSplineSurface)& surf, //purpose : //======================================================================= -GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC) +GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC) : mySections(NC), UFirst(0.), ULast(1.), VFirst(0.), VLast(1.) { - mySections = NC; - UFirst = 0.; - ULast = 1.; - VFirst = 0.; - VLast = 1.; + + + + + myRefSurf.Nullify(); ComputeSurface(); } @@ -217,14 +218,14 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC) //======================================================================= GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, - const TColStd_SequenceOfReal& NP) + const TColStd_SequenceOfReal& NP) : mySections(NC), myParams(NP), UFirst(0.), ULast(1.), VFirst(0.), VLast(1.) { - mySections = NC; - myParams = NP; - UFirst = 0.; - ULast = 1.; - VFirst = 0.; - VLast = 1.; + + + + + + myRefSurf.Nullify(); ComputeSurface(); } @@ -236,14 +237,14 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, GeomFill_NSections::GeomFill_NSections (const TColGeom_SequenceOfCurve& theNC, const TColStd_SequenceOfReal& theNP, const Standard_Real theUF, - const Standard_Real theUL) + const Standard_Real theUL) : mySections(theNC), myParams(theNP), UFirst(theUF), ULast(theUL), VFirst(0.0), VLast(1.0) { - mySections = theNC; - myParams = theNP; - UFirst = theUF; - ULast = theUL; - VFirst = 0.0; - VLast = 1.0; + + + + + + myRefSurf.Nullify(); ComputeSurface(); } @@ -258,14 +259,14 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const Standard_Real UF, const Standard_Real UL, const Standard_Real VF, - const Standard_Real VL) + const Standard_Real VL) : mySections(NC), myParams(NP), UFirst(UF), ULast(UL), VFirst(VF), VLast(VL) { - mySections = NC; - myParams = NP; - UFirst = UF; - ULast = UL; - VFirst = VF; - VLast = VL; + + + + + + myRefSurf.Nullify(); ComputeSurface(); } @@ -282,16 +283,16 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, const Standard_Real UL, const Standard_Real VF, const Standard_Real VL, - const Handle(Geom_BSplineSurface)& Surf) + const Handle(Geom_BSplineSurface)& Surf) : mySections(NC), myTrsfs(Trsfs), myParams(NP), UFirst(UF), ULast(UL), VFirst(VF), VLast(VL), myRefSurf(Surf) { - mySections = NC; - myTrsfs = Trsfs; - myParams = NP; - UFirst = UF; - ULast = UL; - VFirst = VF; - VLast = VL; - myRefSurf = Surf; + + + + + + + + ComputeSurface(); } @@ -312,7 +313,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, TColStd_Array1OfReal weights(1,mySurface->NbUPoles()); Curve->Poles(poles); Curve->Weights(weights); - Standard_Integer ii, L = Poles.Length(); + Standard_Integer ii = 0, L = Poles.Length(); for (ii=1; ii<=L; ii++) { Poles(ii).SetXYZ(poles(ii).XYZ()); Weights(ii) = weights(ii); @@ -356,10 +357,10 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, } - Standard_Real ww, EpsW = 10*Precision::PConfusion(); + Standard_Real ww = NAN, EpsW = 10*Precision::PConfusion(); Standard_Boolean NullWeight = Standard_False; if (!rational) DWeights.Init(0.); - Standard_Integer indice = 1, ii; + Standard_Integer indice = 1, ii = 0; // recopie des poles du resultat sous forme de points 3D et de poids for (ii=1; ii<=L && (!NullWeight) ; ii++) { @@ -449,10 +450,10 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, } - Standard_Real ww, EpsW = 10*Precision::PConfusion(); + Standard_Real ww = NAN, EpsW = 10*Precision::PConfusion(); Standard_Boolean NullWeight = Standard_False; if (!rational) D2Weights.Init(0.); - Standard_Integer indice = 1, ii; + Standard_Integer indice = 1, ii = 0; // recopie des poles du resultat sous forme de points 3D et de poids for (ii=1; ii<=L && (!NullWeight) ; ii++) { @@ -536,7 +537,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, if (myRefSurf.IsNull()) { Standard_Real myPres3d = 1.e-06; - Standard_Integer i,j,jdeb=1,jfin=mySections.Length(); + Standard_Integer i = 0,j = 0,jdeb=1,jfin=mySections.Length(); if (jfin <= jdeb) { @@ -619,11 +620,11 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, else { // segmentation de myRefSurf - Standard_Real Ui1, Ui2, V0, V1; + Standard_Real Ui1 = NAN, Ui2 = NAN, V0 = NAN, V1 = NAN; BS = Handle(Geom_BSplineSurface)::DownCast(myRefSurf->Copy()); Ui1 = UFirst; Ui2 = ULast; - Standard_Integer i1, i2; + Standard_Integer i1 = 0, i2 = 0; myRefSurf->LocateU( Ui1, Precision::PConfusion(), i1, i2 ); if (Abs(Ui1 - myRefSurf->UKnot(i1)) <= Precision::PConfusion()) Ui1 = myRefSurf->UKnot(i1); @@ -808,8 +809,8 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, if (mySurface.IsNull()) return Bary; - Standard_Integer ii,jj; - Standard_Real U0, U1, V0, V1; + Standard_Integer ii = 0,jj = 0; + Standard_Real U0 = NAN, U1 = NAN, V0 = NAN, V1 = NAN; mySurface->Bounds(U0,U1,V0,V1); Standard_Real V = V0, DeltaV = ( V1 - V0 ) / 20; Standard_Real U = U0, DeltaU = ( U1 - U0 ) / 20; @@ -830,8 +831,8 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC, //======================================================= Standard_Real GeomFill_NSections::MaximalSection() const { - Standard_Real L, Lmax=0.; - Standard_Integer ii; + Standard_Real L = NAN, Lmax=0.; + Standard_Integer ii = 0; for (ii=1; ii <=mySections.Length(); ii++) { GeomAdaptor_Curve AC (mySections(ii)); L = GCPnts_AbscissaPoint::Length(AC); @@ -854,7 +855,7 @@ void GeomFill_NSections::GetMinimalWeight(TColStd_Array1OfReal& Weights) const NbV = mySurface->NbVPoles(); TColStd_Array2OfReal WSurf(1,NbU,1,NbV); mySurface->Weights(WSurf); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for (i=1;i<=NbU;i++) { Standard_Real min = WSurf(i,1); for (j=2;j<=NbV;j++) { @@ -891,7 +892,7 @@ void GeomFill_NSections::GetMinimalWeight(TColStd_Array1OfReal& Weights) const gp_Circ C1 = AC1.Circle(); gp_Circ C2 = AC2.Circle(); Standard_Real Tol = 1.e-7; - Standard_Boolean samedir, samerad, samepos; + Standard_Boolean samedir = 0, samerad = 0, samepos = 0; samedir = (C1.Axis().IsParallel(C2.Axis(),1.e-4)); samerad = (Abs(C1.Radius()-C2.Radius()) #include +#include #include #ifdef OCCT_DEBUG static Standard_Boolean Affich = Standard_False; @@ -87,9 +88,9 @@ static Standard_Boolean CheckSense(const TColGeom_SequenceOfCurve& Seq1, Standard_Boolean no_sing = Standard_True; Seq2.Clear(); - Handle(Geom_Curve) C1 = Seq1.Value(1); + const Handle(Geom_Curve)& C1 = Seq1.Value(1); Standard_Real f = C1->FirstParameter(), l = C1->LastParameter(); - Standard_Integer iP, NP = 21; + Standard_Integer iP = 0, NP = 21; TColgp_Array1OfPnt Tab(1,NP); Standard_Real u = f, h = Abs(f-l) / 20.; for (iP=1;iP<=NP;iP++) { @@ -99,14 +100,14 @@ static Standard_Boolean CheckSense(const TColGeom_SequenceOfCurve& Seq1, } gp_Ax2 AxeRef, Axe; gp_Pnt Pos; - Standard_Boolean sing; + Standard_Boolean sing = 0; GeomLib::AxeOfInertia(Tab,AxeRef,sing); // si la section est une droite, ca ne marche pas if (sing) no_sing = Standard_False; Pos = AxeRef.Location(); - Standard_Real alpha1, alpha2, alpha3; + Standard_Real alpha1 = NAN, alpha2 = NAN, alpha3 = NAN; gp_Pnt P1, P2; u = (f+l-h)/2 - h; C1->D0(u,P1); @@ -125,7 +126,7 @@ static Standard_Boolean CheckSense(const TColGeom_SequenceOfCurve& Seq1, for (Standard_Integer iseq=2; iseq<=Seq1.Length(); iseq++) { // discretisation de C2 - Handle(Geom_Curve) C2 = Seq1.Value(iseq); + const Handle(Geom_Curve)& C2 = Seq1.Value(iseq); f = C2->FirstParameter(); l = C2->LastParameter(); u = f; @@ -140,7 +141,7 @@ static Standard_Boolean CheckSense(const TColGeom_SequenceOfCurve& Seq1, if (sing) no_sing = Standard_False; Pos = Axe.Location(); - Standard_Real beta1, beta2, beta3; + Standard_Real beta1 = NAN, beta2 = NAN, beta3 = NAN; u = (f+l-h)/2 - h; C2->D0(u,P1); u += h; @@ -363,7 +364,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path, // rotat : vrai si on veu la rotation false sinon // triedre : AC pour absc. curv. ou P pour plan ortho { - Standard_Real angle; + Standard_Real angle = NAN; myAdpPath = new (GeomAdaptor_Curve) (Handle(Geom_Curve)::DownCast(Path->Copy())); @@ -678,7 +679,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path, TColStd_SequenceOfReal SeqP; SeqC.Clear(); SeqP.Clear(); - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = 1; i<=NSections.Length(); i++) { GeomFill_SectionPlacement Place(myLoc, NSections(i)); Place.Perform(Precision::Confusion()); @@ -713,7 +714,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path, // creation de la NSections Standard_Real first = Path->FirstParameter(), last = Path->LastParameter(); - Standard_Real deb,fin; + Standard_Real deb = NAN,fin = NAN; deb = SeqC.First()->FirstParameter(); fin = SeqC.First()->LastParameter(); mySec = new (GeomFill_NSections) (SeqC,SeqP,deb,fin,first,last); @@ -769,7 +770,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path, if (CheckSense(SeqC, NewSeq)) SeqC = NewSeq; // creation of the NSections - Standard_Real deb, fin; + Standard_Real deb = NAN, fin = NAN; deb = SeqC.First()->FirstParameter(); fin = SeqC.First()->LastParameter(); mySec = new (GeomFill_NSections) (SeqC, SeqP, deb, fin, first, last); @@ -1125,8 +1126,8 @@ void GeomFill_Pipe::ApproxSurf(const Standard_Boolean WithParameters) { //throw StdFail_NotDone("Pipe : App not done"); } else { - Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, - NbVKnots; + Standard_Integer UDegree = 0, VDegree = 0, NbUPoles = 0, NbVPoles = 0, NbUKnots = 0, + NbVKnots = 0; App.SurfShape(UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots); mySurface = new Geom_BSplineSurface(App.SurfPoles(), @@ -1137,7 +1138,7 @@ void GeomFill_Pipe::ApproxSurf(const Standard_Boolean WithParameters) { App.SurfVMults(), App.UDegree(), App.VDegree()); - Standard_Real t2d; + Standard_Real t2d = NAN; App.TolReached(myError, t2d); myStatus = GeomFill_PipeOk; } diff --git a/src/GeomFill/GeomFill_Pipe.hxx b/src/GeomFill/GeomFill_Pipe.hxx index 4a88b3e168..db6867981c 100644 --- a/src/GeomFill/GeomFill_Pipe.hxx +++ b/src/GeomFill/GeomFill_Pipe.hxx @@ -277,18 +277,18 @@ private: Standard_EXPORT Standard_Boolean KPartT4(); GeomFill_PipeError myStatus;//!< Execution status - Standard_Real myRadius; - Standard_Real myError; + Standard_Real myRadius{}; + Standard_Real myError{}; Handle(Adaptor3d_Curve) myAdpPath; Handle(Adaptor3d_Curve) myAdpFirstSect; Handle(Adaptor3d_Curve) myAdpLastSect; Handle(Geom_Surface) mySurface; Handle(GeomFill_LocationLaw) myLoc; Handle(GeomFill_SectionLaw) mySec; - Standard_Integer myType; + Standard_Integer myType{}; Standard_Boolean myExchUV; Standard_Boolean myKPart; - Standard_Boolean myPolynomial; + Standard_Boolean myPolynomial{}; }; diff --git a/src/GeomFill/GeomFill_PlanFunc.cxx b/src/GeomFill/GeomFill_PlanFunc.cxx index 5c854e6d90..1dd9bc9edf 100644 --- a/src/GeomFill/GeomFill_PlanFunc.cxx +++ b/src/GeomFill/GeomFill_PlanFunc.cxx @@ -23,10 +23,10 @@ GeomFill_PlanFunc::GeomFill_PlanFunc(const gp_Pnt& theP, const gp_Vec& theV, const Handle(Adaptor3d_Curve)& theC) : - myCurve(theC) + myPnt(theP.XYZ()), myVec(theV.XYZ()), myCurve(theC) { - myPnt = theP.XYZ(); - myVec = theV.XYZ(); + + } diff --git a/src/GeomFill/GeomFill_PolynomialConvertor.cxx b/src/GeomFill/GeomFill_PolynomialConvertor.cxx index 8bbb524127..b98a8f00bd 100644 --- a/src/GeomFill/GeomFill_PolynomialConvertor.cxx +++ b/src/GeomFill/GeomFill_PolynomialConvertor.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -41,8 +43,8 @@ Standard_Boolean GeomFill_PolynomialConvertor::Initialized() const void GeomFill_PolynomialConvertor::Init() { if (myinit) return; //On n'initialise qu'une fois - Standard_Integer ii, jj; - Standard_Real terme; + Standard_Integer ii = 0, jj = 0; + Standard_Real terme = NAN; math_Matrix H(1,Ordre, 1,Ordre), B(1,Ordre, 1,Ordre); Handle(TColStd_HArray1OfReal) Coeffs = new (TColStd_HArray1OfReal) (1, Ordre*Ordre), @@ -105,9 +107,9 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt, { math_Vector Vx(1, Ordre), Vy(1, Ordre); math_Vector Px(1, Ordre), Py(1, Ordre); - Standard_Integer ii; + Standard_Integer ii = 0; Standard_Real Cos_b = Cos(Angle), Sin_b = Sin(Angle); - Standard_Real beta, beta2, beta3; + Standard_Real beta = NAN, beta2 = NAN, beta3 = NAN; gp_Vec V1(Center, FirstPnt), V2; V2 = Dir^V1; beta = Angle/2; @@ -156,9 +158,9 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt, DVx(1, Ordre), DVy(1, Ordre); math_Vector Px(1, Ordre), Py(1, Ordre), DPx(1, Ordre), DPy(1, Ordre); - Standard_Integer ii; + Standard_Integer ii = 0; Standard_Real Cos_b = Cos(Angle), Sin_b = Sin(Angle); - Standard_Real beta, beta2, beta3, bprim; + Standard_Real beta = NAN, beta2 = NAN, beta3 = NAN, bprim = NAN; gp_Vec V1(Center, FirstPnt), V1Prim, V2; V2 = Dir^V1; beta = Angle/2; @@ -243,9 +245,9 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt, DPx(1, Ordre), DPy(1, Ordre), D2Px(1, Ordre), D2Py(1, Ordre); - Standard_Integer ii; - Standard_Real aux, Cos_b = Cos(Angle), Sin_b = Sin(Angle); - Standard_Real beta, beta2, beta3, bprim, bprim2, bsecn; + Standard_Integer ii = 0; + Standard_Real aux = NAN, Cos_b = Cos(Angle), Sin_b = Sin(Angle); + Standard_Real beta = NAN, beta2 = NAN, beta3 = NAN, bprim = NAN, bprim2 = NAN, bsecn = NAN; gp_Vec V1(Center, FirstPnt), V1Prim, V1Secn, V2; V2 = Dir^V1; beta = Angle/2; diff --git a/src/GeomFill/GeomFill_Profiler.cxx b/src/GeomFill/GeomFill_Profiler.cxx index 8a9c143b6a..0a6551ed44 100644 --- a/src/GeomFill/GeomFill_Profiler.cxx +++ b/src/GeomFill/GeomFill_Profiler.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -35,7 +37,7 @@ static void UnifyByInsertingAllKnots(TColGeom_SequenceOfCurve& theCurves, // inserting in the first curve the knot-vector of all the others. Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(theCurves(1)); - Standard_Integer i; + Standard_Integer i = 0; for ( i = 2; i <= theCurves.Length(); i++) { Handle(Geom_BSplineCurve) Ci = Handle(Geom_BSplineCurve)::DownCast(theCurves(i)); @@ -64,7 +66,7 @@ static void UnifyByInsertingAllKnots(TColGeom_SequenceOfCurve& theCurves, if ( Ci->IsRational() ) { Standard_Integer np = Ci->NbPoles(); Standard_Real sigma = 0.; - Standard_Integer j; + Standard_Integer j = 0; for ( j = 1; j <= np; j++) { sigma += Ci->Weight(j); } @@ -83,7 +85,7 @@ static void UnifyByInsertingAllKnots(TColGeom_SequenceOfCurve& theCurves, //======================================================================= static void UnifyBySettingMiddleKnots(TColGeom_SequenceOfCurve& theCurves) { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(theCurves(1)); @@ -119,10 +121,10 @@ static void UnifyBySettingMiddleKnots(TColGeom_SequenceOfCurve& theCurves) //purpose : //======================================================================= -GeomFill_Profiler::GeomFill_Profiler() +GeomFill_Profiler::GeomFill_Profiler() : myIsDone(Standard_False), myIsPeriodic(Standard_True) { - myIsDone = Standard_False; - myIsPeriodic = Standard_True; + + } @@ -177,11 +179,11 @@ void GeomFill_Profiler::AddCurve(const Handle(Geom_Curve)& Curve) void GeomFill_Profiler::Perform(const Standard_Real PTol) { - Standard_Integer i; + Standard_Integer i = 0; // Standard_Integer myDegree = 0, myNbPoles = 0; Standard_Integer myDegree = 0; Handle(Geom_BSplineCurve) C; - Standard_Real U1, U2, UFirst=0, ULast=0; + Standard_Real U1 = NAN, U2 = NAN, UFirst=0, ULast=0; Standard_Real EcartMax = 0.; for ( i = 1; i <= mySequence.Length(); i++) { diff --git a/src/GeomFill/GeomFill_QuasiAngularConvertor.cxx b/src/GeomFill/GeomFill_QuasiAngularConvertor.cxx index 555cdcb971..9ea4cc3a6e 100644 --- a/src/GeomFill/GeomFill_QuasiAngularConvertor.cxx +++ b/src/GeomFill/GeomFill_QuasiAngularConvertor.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -69,8 +71,8 @@ Standard_Boolean GeomFill_QuasiAngularConvertor::Initialized() const void GeomFill_QuasiAngularConvertor::Init() { if (myinit) return; //On n'initialise qu'une fois - Standard_Integer ii, jj, Ordre=7; - Standard_Real terme; + Standard_Integer ii = 0, jj = 0, Ordre=7; + Standard_Real terme = NAN; TColStd_Array1OfReal Coeffs(1, Ordre*Ordre), TrueInter(1,2), Inter(1,2); Handle(TColStd_HArray2OfReal) Poles1d = new (TColStd_HArray2OfReal) (1, Ordre, 1, Ordre); @@ -118,9 +120,9 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& Weights) { - Standard_Real b, b2, c, c2,tan_b; - Standard_Integer ii; - Standard_Real beta, beta2, beta3, beta4, beta5, beta6, wi; + Standard_Real b = NAN, b2 = NAN, c = NAN, c2 = NAN,tan_b = NAN; + Standard_Integer ii = 0; + Standard_Real beta = NAN, beta2 = NAN, beta3 = NAN, beta4 = NAN, beta5 = NAN, beta6 = NAN, wi = NAN; gp_XYZ aux; gp_Mat Rot; // Calcul de la transformation @@ -208,15 +210,15 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, Standard_Integer Ordre = 7; math_Vector DVx(1, Ordre), DVy(1, Ordre), DVw(1, Ordre), DPx(1, Ordre), DPy(1, Ordre), DW(1, Ordre); - Standard_Real b, b2, c, c2,tan_b; - Standard_Real bpr, dtan_b; - Standard_Integer ii; - Standard_Real beta, beta2, beta3, beta4, beta5, beta6, betaprim; + Standard_Real b = NAN, b2 = NAN, c = NAN, c2 = NAN,tan_b = NAN; + Standard_Real bpr = NAN, dtan_b = NAN; + Standard_Integer ii = 0; + Standard_Real beta = NAN, beta2 = NAN, beta3 = NAN, beta4 = NAN, beta5 = NAN, beta6 = NAN, betaprim = NAN; gp_Vec V1(Center, FirstPnt), V1Prim, V2; // Calcul des transformations gp_XYZ aux; - Standard_Real Sina, Cosa; + Standard_Real Sina = NAN, Cosa = NAN; gp_Mat Rot, RotPrim, D, DPrim; // La rotation s'ecrit I + sin(Ang) * D + (1. - cos(Ang)) * D*D // ou D est l'application x -> Dir ^ x @@ -262,7 +264,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, if (Abs(beta) < NullAngle) { // On calcul b par D.L Standard_Real cf = 2.0/(3*5*7); - Standard_Real Num, Denom; + Standard_Real Num = NAN, Denom = NAN; Num = 0.2 + cf*beta2; Denom = 1+0.2*beta2; b = - Num/Denom; @@ -326,7 +328,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, DW.Multiply(B, DVw); gp_XYZ P, DP; - Standard_Real wi; + Standard_Real wi = NAN; for (ii=1; ii<=Ordre; ii++) { wi = W(ii); @@ -369,13 +371,13 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, math_Vector DPx(1, Ordre), DPy(1, Ordre), DW(1, Ordre), D2Px(1, Ordre), D2Py(1, Ordre), D2W(1, Ordre); - Standard_Integer ii; - Standard_Real daux, b, b2, c, c2, bpr, bsc; + Standard_Integer ii = 0; + Standard_Real daux = NAN, b = NAN, b2 = NAN, c = NAN, c2 = NAN, bpr = NAN, bsc = NAN; gp_Vec V1(Center, FirstPnt), V1Prim, V1Secn, V2; // Calcul des transformations gp_XYZ auxyz; - Standard_Real Sina, Cosa; + Standard_Real Sina = NAN, Cosa = NAN; gp_Mat Rot, RotPrim, RotSecn, D, DPrim, DSecn, DDP, Maux; // La rotation s'ecrit I + sin(Ang) * D + (1. - cos(Ang)) * D*D // ou D est l'application x -> Dir ^ x @@ -442,9 +444,9 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, // Calcul des coeff ----------- - Standard_Real tan_b, dtan_b, d2tan_b; - Standard_Real beta, beta2, beta3, beta4, beta5, beta6, betaprim, betasecn; - Standard_Real betaprim2, bpr2; + Standard_Real tan_b = NAN, dtan_b = NAN, d2tan_b = NAN; + Standard_Real beta = NAN, beta2 = NAN, beta3 = NAN, beta4 = NAN, beta5 = NAN, beta6 = NAN, betaprim = NAN, betasecn = NAN; + Standard_Real betaprim2 = NAN, bpr2 = NAN; beta = Angle/4; betaprim = DAngle/4; betasecn = D2Angle/4; @@ -458,7 +460,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, if (Abs(beta) < NullAngle) { // On calcul b par D.L Standard_Real cf =-2.0/21; - Standard_Real Num, Denom, aux; + Standard_Real Num = NAN, Denom = NAN, aux = NAN; Num = 0.2 + cf*beta2; Denom = 1+0.2*beta2; aux = (cf*Denom - 0.2*Num)/(Denom*Denom); @@ -559,7 +561,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, D2W.Multiply(B, D2Vw); gp_XYZ P, DP, D2P; - Standard_Real wi, dwi; + Standard_Real wi = NAN, dwi = NAN; for (ii=1; ii<=Ordre; ii++) { wi = W(ii); dwi = DW(ii); diff --git a/src/GeomFill/GeomFill_SectionGenerator.cxx b/src/GeomFill/GeomFill_SectionGenerator.cxx index 9c09f281fb..7a4ba8b7a4 100644 --- a/src/GeomFill/GeomFill_SectionGenerator.cxx +++ b/src/GeomFill/GeomFill_SectionGenerator.cxx @@ -42,7 +42,7 @@ GeomFill_SectionGenerator::GeomFill_SectionGenerator() void GeomFill_SectionGenerator::SetParam(const Handle(TColStd_HArray1OfReal) & Params) { - Standard_Integer ii, L = Params->Upper()-Params->Lower()+1; + Standard_Integer ii = 0, L = Params->Upper()-Params->Lower()+1; myParams = Params; for (ii=1; ii<=L; ii++) { myParams->SetValue(ii,Params->Value(Params->Lower()+ii-1)); diff --git a/src/GeomFill/GeomFill_SectionPlacement.cxx b/src/GeomFill/GeomFill_SectionPlacement.cxx index 8d39b1c3cd..3a40d7c509 100644 --- a/src/GeomFill/GeomFill_SectionPlacement.cxx +++ b/src/GeomFill/GeomFill_SectionPlacement.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -74,7 +76,7 @@ static void Tangente(const Adaptor3d_Curve& Path, static Standard_Real Penalite(const Standard_Real angle, const Standard_Real dist) { - Standard_Real penal; + Standard_Real penal = NAN; if (dist < 1) penal = Sqrt(dist); @@ -96,7 +98,7 @@ static Standard_Real Penalite(const Standard_Real angle, static Standard_Real EvalAngle(const gp_Vec& V1, const gp_Vec& V2) { - Standard_Real angle; + Standard_Real angle = NAN; angle = V1.Angle(V2); if (angle > M_PI/2) angle = M_PI - angle; return angle; @@ -111,8 +113,8 @@ static void DistMini(const Extrema_ExtPC& Ext, Standard_Real& Dist, Standard_Real& Param) { - Standard_Real dist1, dist2; - Standard_Integer ii; + Standard_Real dist1 = NAN, dist2 = NAN; + Standard_Integer ii = 0; gp_Pnt P1, P2; Standard_Real Dist2 = RealLast(); @@ -148,14 +150,14 @@ static void DistMini(const Extrema_ExtPC& Ext, GeomFill_SectionPlacement:: GeomFill_SectionPlacement(const Handle(GeomFill_LocationLaw)& L, const Handle(Geom_Geometry)& Section) : - myLaw(L), /* myAdpSection(Section), mySection(Section), */ + done(Standard_False), isplan(Standard_False), myLaw(L), /* myAdpSection(Section), mySection(Section), */ SecParam(0.0), PathParam(0.0), - Dist(RealLast()), AngleMax(0.) + Dist(RealLast()), AngleMax(0.), myIsPoint(Standard_False) { - done = Standard_False; - isplan = Standard_False; - myIsPoint = Standard_False; + + + if (Section->IsInstance(STANDARD_TYPE(Geom_CartesianPoint))) { @@ -170,8 +172,8 @@ GeomFill_SectionPlacement(const Handle(GeomFill_LocationLaw)& L, mySection = CurveSection; } - Standard_Integer i, j, NbPoles=0; - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Integer i = 0, j = 0, NbPoles=0; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; // Boite d'encombrement de la section pour en deduire le gabarit Bnd_Box box; @@ -264,12 +266,12 @@ GeomFill_SectionPlacement(const Handle(GeomFill_LocationLaw)& L, if (Abs(last - U2) <= Precision::PConfusion()) last = U2; } - Standard_Real t, delta; + Standard_Real t = NAN, delta = NAN; if (myAdpSection.GetType() == GeomAbs_BSplineCurve) { Handle(Geom_BSplineCurve) BC = Handle(Geom_BSplineCurve)::DownCast(myAdpSection.Curve()); - Standard_Integer I1, I2, I3, I4; + Standard_Integer I1 = 0, I2 = 0, I3 = 0, I4 = 0; BC->LocateU( first, Precision::Confusion(), I1, I2 ); BC->LocateU( last, Precision::Confusion(), I3, I4 ); Standard_Integer NbKnots = I3 - I2 + 1; @@ -335,7 +337,7 @@ GeomFill_SectionPlacement(const Handle(GeomFill_LocationLaw)& L, Pnts->SetValue( NbPnts, myAdpSection.Value(last) ); } - Standard_Boolean issing; + Standard_Boolean issing = 0; gp_Ax2 axe; GeomLib::AxeOfInertia(Pnts->Array1(), axe, issing, Precision::Confusion()); if (!issing) { @@ -395,7 +397,7 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path, PathParam = Path->FirstParameter(); SecParam = myAdpSection.FirstParameter(); - Standard_Real distaux, taux = 0.0, alpha; + Standard_Real distaux = NAN, taux = 0.0, alpha = NAN; gp_Pnt PonPath, PonSec, P; gp_Vec VRef, dp1; VRef.SetXYZ(TheAxe.Direction().XYZ()); @@ -414,11 +416,11 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path, if (isplan) AngleMax = M_PI/2 - AngleMax; Standard_Boolean Trouve = Standard_False; - Standard_Integer ii; + Standard_Integer ii = 0; if (isplan) { // (1.1) Distances Point-Plan - Standard_Real DistPlan; + Standard_Real DistPlan = NAN; gp_Vec V1 (PonPath, TheAxe.Location()); DistPlan = Abs(V1.Dot(VRef)); if (DistPlan <= IntTol) @@ -447,8 +449,8 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path, Intersector.Perform(Path, adplan); if (Intersector.IsDone()) { - Standard_Real w; - Standard_Real aDist; + Standard_Real w = NAN; + Standard_Real aDist = NAN; for (ii=1; ii<=Intersector.NbPoints(); ii++) { w = Intersector.Point(ii).W(); @@ -782,7 +784,7 @@ void GeomFill_SectionPlacement::Perform(const Standard_Real Param, gp_Trsf Rot; if (WithCorrection && !myIsPoint) { - Standard_Real angle; + Standard_Real angle = NAN; if (!isplan) throw Standard_Failure("Illegal usage: can't rotate non-planar profile"); @@ -919,7 +921,7 @@ void GeomFill_SectionPlacement::Perform(const Standard_Real Param, Standard_Boolean GeomFill_SectionPlacement::Choix(const Standard_Real dist, const Standard_Real angle) const { - Standard_Real evoldist, evolangle; + Standard_Real evoldist = NAN, evolangle = NAN; evoldist = dist - Dist; evolangle = angle - AngleMax; // (1) Si la gain en distance est > que le gabarit, on prend diff --git a/src/GeomFill/GeomFill_Stretch.cxx b/src/GeomFill/GeomFill_Stretch.cxx index b05469a0c9..c89602d32a 100644 --- a/src/GeomFill/GeomFill_Stretch.cxx +++ b/src/GeomFill/GeomFill_Stretch.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -85,12 +87,12 @@ void GeomFill_Stretch::Init(const TColgp_Array1OfPnt& P1, myPoles = new TColgp_HArray2OfPnt( 1, NPolU, 1, NPolV); // The boundaries are not modified - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; for ( i=1; i<=NPolU; i++) { myPoles->SetValue( i, 1 , P1(i)); myPoles->SetValue( i, NPolV, P3(i)); } - Standard_Real PU,PU1,PV,PV1; + Standard_Real PU = NAN,PU1 = NAN,PV = NAN,PV1 = NAN; for ( j=2; j<=NPolV-1; j++) { PV = (j-1)/NV; @@ -151,12 +153,12 @@ void GeomFill_Stretch::Init(const TColgp_Array1OfPnt& P1, myWeights = new TColStd_HArray2OfReal( 1, NPolU, 1, NPolV); // The boundaries are not modified - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for ( i=1; i<=NPolU; i++) { myWeights->SetValue( i, 1 , W1(i)); myWeights->SetValue( i, NPolV, W3(i)); } - Standard_Real PU,PU1,PV,PV1; + Standard_Real PU = NAN,PU1 = NAN,PV = NAN,PV1 = NAN; for ( j=2; j<=NPolV-1; j++) { PV = (j-1)/NV; diff --git a/src/GeomFill/GeomFill_Sweep.cxx b/src/GeomFill/GeomFill_Sweep.cxx index 99611f10c7..f2abe94f56 100644 --- a/src/GeomFill/GeomFill_Sweep.cxx +++ b/src/GeomFill/GeomFill_Sweep.cxx @@ -16,6 +16,8 @@ // Modified by skv - Fri Feb 6 11:44:48 2004 OCC5073 +#include + #include #include #include @@ -77,12 +79,12 @@ public: GeomFill_Sweep_Eval(GeomFill_LocFunction& theTool) : theAncore(theTool) {} - virtual void Evaluate(Standard_Integer *Dimension, + void Evaluate(Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: GeomFill_LocFunction& theAncore; @@ -108,18 +110,18 @@ void GeomFill_Sweep_Eval::Evaluate(Standard_Integer *,/*Dimension*/ // Purpose : //=============================================================== GeomFill_Sweep::GeomFill_Sweep(const Handle(GeomFill_LocationLaw)& Location, - const Standard_Boolean WithKpart) + const Standard_Boolean WithKpart) : done(Standard_False), myLoc(Location), myKPart(WithKpart), myForceApproxC1(Standard_False), SError(RealLast()) { - done = Standard_False; + - myLoc = Location; - myKPart = WithKpart; + + SetTolerance(1.e-4); - myForceApproxC1 = Standard_False; + myLoc->GetDomain(First, Last); SFirst = SLast = 30.081996; - SError = RealLast(); + } //=============================================================== @@ -285,8 +287,8 @@ Standard_Boolean GeomFill_Sweep::BuildAll(const GeomAbs_Shape Continuity, #endif // La surface - Standard_Integer UDegree, VDegree, NbUPoles, - NbVPoles, NbUKnots, NbVKnots; + Standard_Integer UDegree = 0, VDegree = 0, NbUPoles = 0, + NbVPoles = 0, NbUKnots = 0, NbVKnots = 0; Approx.SurfShape(UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots); @@ -353,7 +355,7 @@ Standard_Boolean GeomFill_Sweep::BuildAll(const GeomAbs_Shape Continuity, { myCurve2d = new (TColGeom2d_HArray1OfCurve) (1, 2 + myLoc->TraceNumber()); CError = new (TColStd_HArray2OfReal) (1, 2, 1, 2 + myLoc->TraceNumber()); - Standard_Integer kk, ii, ifin = 1, ideb; + Standard_Integer kk = 0, ii = 0, ifin = 1, ideb = 0; if (myLoc->HasFirstRestriction()) { ideb = 1; @@ -418,7 +420,7 @@ Standard_Boolean GeomFill_Sweep::BuildProduct(const GeomAbs_Shape Continuity, if (BSurf.IsNull()) return Ok; // Ce mode de construction est impossible - Standard_Integer NbIntervalC2, NbIntervalC3; + Standard_Integer NbIntervalC2 = 0, NbIntervalC3 = 0; GeomFill_LocFunction Func(myLoc); NbIntervalC2 = myLoc->NbIntervals(GeomAbs_C2); @@ -501,8 +503,8 @@ static Standard_Boolean IsSweepParallelSpine(const Handle(GeomFill_LocationLaw) const Standard_Real theTol) { // Get the first and last transformations of the location - Standard_Real aFirst; - Standard_Real aLast; + Standard_Real aFirst = NAN; + Standard_Real aLast = NAN; gp_Vec VBegin; gp_Vec VEnd; gp_Mat M; @@ -534,10 +536,10 @@ static Standard_Boolean IsSweepParallelSpine(const Handle(GeomFill_LocationLaw) GTfEnd(3, 1), GTfEnd(3, 2), GTfEnd(3, 3), GTfEnd(3, 4)); Handle(Geom_Surface) aSurf = theSec->BSplineSurface(); - Standard_Real Umin; - Standard_Real Umax; - Standard_Real Vmin; - Standard_Real Vmax; + Standard_Real Umin = NAN; + Standard_Real Umax = NAN; + Standard_Real Vmin = NAN; + Standard_Real Vmax = NAN; aSurf->Bounds(Umin, Umax, Vmin, Vmax); @@ -583,7 +585,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() GeomAbs_CurveType SectionType; gp_Vec V; gp_Mat M; - Standard_Real levier, error = 0; + Standard_Real levier = NAN, error = 0; Standard_Real UFirst = 0, VFirst = First, ULast = 0, VLast = Last; Standard_Real Tol = Min(Tol3d, BoundTol); @@ -658,7 +660,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() (axe, C.Radius()); if (C.Position().Direction(). IsOpposite(axe.Direction(), 0.1)) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; // L'orientation parametrique est inversee l = 2 * M_PI - UFirst; f = 2 * M_PI - ULast; @@ -693,7 +695,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() Handle(Geom_Curve) Section; GeomAdaptor_Curve AC; gp_Circ C; - Standard_Real R1, R2; + Standard_Real R1 = NAN, R2 = NAN; Section = mySec->CirclSection(SLast); @@ -720,7 +722,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() C = AC.Circle(); Centre0 = C.Location(); - Standard_Real Angle; + Standard_Real Angle = NAN; gp_Vec N(Centre1, P1); if (N.Magnitude() < 1.e-9) { gp_Vec Bis(Centre2, P2); @@ -748,7 +750,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() if (diso.Magnitude() > 1.e-9 && dsection.Magnitude() > 1.e-9) isUReversed = diso.IsOpposite(dsection, 0.1); if (isUReversed) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; // L'orientation parametrique est inversee l = 2 * M_PI - UFirst; f = 2 * M_PI - ULast; @@ -768,7 +770,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() // La trajectoire gp_Pnt Centre; isVPeriodic = (Abs(Last - First - 2 * M_PI) < 1.e-15); - Standard_Real RotRadius; + Standard_Real RotRadius = NAN; gp_Vec DP, DS, DN; myLoc->D0(0.1, M, DS); myLoc->D0(0, M, V); @@ -808,7 +810,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() // (2.1) Tore/Sphere ? if ((SectionType == GeomAbs_Circle) && IsTrsf) { gp_Circ C = AC.Circle(); - Standard_Real Radius; + Standard_Real Radius = NAN; Standard_Boolean IsGoodSide = Standard_True; C.Transform(Tf2); gp_Vec DC; @@ -851,7 +853,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() theSection->Transform(Tf2); gp_Pnt FirstPoint = theSection->Value(theSection->FirstParameter()); gp_Pnt LastPoint = theSection->Value(theSection->LastParameter()); - Standard_Real UfirstOnSec, VfirstOnSec, UlastOnSec, VlastOnSec; + Standard_Real UfirstOnSec = NAN, VfirstOnSec = NAN, UlastOnSec = NAN, VlastOnSec = NAN; ElSLib::Parameters(theSphere, FirstPoint, UfirstOnSec, VfirstOnSec); ElSLib::Parameters(theSphere, LastPoint, UlastOnSec, VlastOnSec); if (VfirstOnSec < VlastOnSec) @@ -903,7 +905,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() if (C.Position().Direction(). IsOpposite(axeiso.Direction(), 0.1)) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; // L'orientation parametrique est inversee l = 2 * M_PI - UFirst; f = 2 * M_PI - ULast; @@ -912,7 +914,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() isUReversed = Standard_True; } // On calcul le "glissement" parametrique. - Standard_Real rot; + Standard_Real rot = NAN; rot = C.Position().XDirection().AngleWithRef (axeiso.XDirection(), axeiso.Direction()); UFirst -= rot; @@ -940,9 +942,9 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() // si la line est ortogonale au cercle de rotation SError = error + levier * Abs(DL.Dot(DP)); if (SError <= Tol) { - Standard_Boolean reverse; + Standard_Boolean reverse = 0; gp_Lin Dir(Centre, DN); - Standard_Real aux; + Standard_Real aux = NAN; aux = DL.Dot(DN); reverse = (aux < 0); // On choisit ici le sens de parametrisation @@ -997,7 +999,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() } if (Ok && reverse) { // On reverse le parametre - Standard_Real uf, ul; + Standard_Real uf = NAN, ul = NAN; Handle(Geom_Line) CL = new (Geom_Line)(L); uf = CL->ReversedParameter(ULast); ul = CL->ReversedParameter(UFirst); @@ -1030,9 +1032,9 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() if (Ok) { // On trimme la surface if (myExchUV) { - Standard_Boolean b; + Standard_Boolean b = 0; b = isUPeriodic; isUPeriodic = isVPeriodic; isVPeriodic = b; - Standard_Real r; + Standard_Real r = NAN; r = UFirst; UFirst = VFirst; VFirst = r; r = ULast; ULast = VLast; VLast = r; } @@ -1091,7 +1093,7 @@ void GeomFill_Sweep::ErrorOnRestriction(const Standard_Boolean IsFirst, Standard_Real& UError, Standard_Real& VError) const { - Standard_Integer ind; + Standard_Integer ind = 0; if (IsFirst) ind = 1; else ind = myCurve2d->Length(); diff --git a/src/GeomFill/GeomFill_Sweep.hxx b/src/GeomFill/GeomFill_Sweep.hxx index 4851e5f6ad..bf254171b2 100644 --- a/src/GeomFill/GeomFill_Sweep.hxx +++ b/src/GeomFill/GeomFill_Sweep.hxx @@ -144,14 +144,14 @@ private: Standard_EXPORT Standard_Boolean BuildKPart(); - Standard_Real First; - Standard_Real Last; + Standard_Real First{}; + Standard_Real Last{}; Standard_Real SFirst; Standard_Real SLast; - Standard_Real Tol3d; - Standard_Real BoundTol; - Standard_Real Tol2d; - Standard_Real TolAngular; + Standard_Real Tol3d{}; + Standard_Real BoundTol{}; + Standard_Real Tol2d{}; + Standard_Real TolAngular{}; Standard_Real SError; Standard_Boolean myForceApproxC1; Handle(GeomFill_LocationLaw) myLoc; @@ -160,9 +160,9 @@ private: Handle(TColGeom2d_HArray1OfCurve) myCurve2d; Handle(TColStd_HArray2OfReal) CError; Standard_Boolean done; - Standard_Boolean myExchUV; - Standard_Boolean isUReversed; - Standard_Boolean isVReversed; + Standard_Boolean myExchUV{}; + Standard_Boolean isUReversed{}; + Standard_Boolean isVReversed{}; Standard_Boolean myKPart; diff --git a/src/GeomFill/GeomFill_SweepFunction.cxx b/src/GeomFill/GeomFill_SweepFunction.cxx index 59c2c61365..401b2c0610 100644 --- a/src/GeomFill/GeomFill_SweepFunction.cxx +++ b/src/GeomFill/GeomFill_SweepFunction.cxx @@ -21,6 +21,8 @@ #endif +#include + #include #include #include @@ -41,13 +43,13 @@ GeomFill_SweepFunction(const Handle(GeomFill_SectionLaw)& Section, const Handle(GeomFill_LocationLaw)& Location, const Standard_Real FirstParameter, const Standard_Real FirstParameterOnS, - const Standard_Real RatioParameterOnS) + const Standard_Real RatioParameterOnS) : myLoc(Location), mySec(Section), myf(FirstParameter), myfOnS(FirstParameterOnS), myRatio(RatioParameterOnS) { - myLoc = Location; - mySec = Section; - myf = FirstParameter; - myfOnS = FirstParameterOnS; - myRatio = RatioParameterOnS; + + + + + } //======================================================================= @@ -61,8 +63,8 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) { - Standard_Integer ii, L; - Standard_Boolean Ok; + Standard_Integer ii = 0, L = 0; + Standard_Boolean Ok = 0; Standard_Real T = myfOnS + (Param - myf) * myRatio; L = Poles.Length(); @@ -93,8 +95,8 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) { - Standard_Integer ii, L; - Standard_Boolean Ok; + Standard_Integer ii = 0, L = 0; + Standard_Boolean Ok = 0; Standard_Real T = myfOnS + (Param - myf) * myRatio; gp_XYZ PPrim; L = Poles.Length(); @@ -137,8 +139,8 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths) { - Standard_Integer ii, L; - Standard_Boolean Ok; + Standard_Integer ii = 0, L = 0; + Standard_Boolean Ok = 0; Standard_Real T = myfOnS + (Param - myf) * myRatio; Standard_Real squareratio = myRatio*myRatio; L = Poles.Length(); @@ -229,7 +231,7 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, //======================================================================= Standard_Integer GeomFill_SweepFunction::NbIntervals(const GeomAbs_Shape S) const { - Standard_Integer Nb_Sec, Nb_Loc; + Standard_Integer Nb_Sec = 0, Nb_Loc = 0; Nb_Sec = mySec->NbIntervals(S); Nb_Loc = myLoc->NbIntervals(S); @@ -243,8 +245,8 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, TColStd_Array1OfReal IntS(1, Nb_Sec+1); TColStd_Array1OfReal IntL(1, Nb_Loc+1); TColStd_SequenceOfReal Inter; - Standard_Real T; - Standard_Integer ii; + Standard_Real T = NAN; + Standard_Integer ii = 0; mySec->Intervals(IntS, S); for (ii=1; ii<=Nb_Sec+1; ii++) { T = (IntS(ii) - myfOnS) / myRatio + myf; @@ -262,7 +264,7 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, //======================================================================= void GeomFill_SweepFunction::Intervals(TColStd_Array1OfReal& T,const GeomAbs_Shape S) const { - Standard_Integer Nb_Sec, Nb_Loc, ii; + Standard_Integer Nb_Sec = 0, Nb_Loc = 0, ii = 0; Nb_Sec = mySec->NbIntervals(S); Nb_Loc = myLoc->NbIntervals(S); @@ -271,7 +273,7 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, return; } else if (Nb_Loc==1) { - Standard_Real t; + Standard_Real t = NAN; mySec->Intervals(T, S); for (ii=1; ii<=Nb_Sec+1; ii++) { t = (T(ii) - myfOnS) / myRatio + myf; @@ -283,7 +285,7 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, TColStd_Array1OfReal IntS(1, Nb_Sec+1); TColStd_Array1OfReal IntL(1, Nb_Loc+1); TColStd_SequenceOfReal Inter; - Standard_Real t; + Standard_Real t = NAN; mySec->Intervals(IntS, S); for (ii=1; ii<=Nb_Sec+1; ii++) { @@ -304,7 +306,7 @@ Standard_Boolean GeomFill_SweepFunction::D0(const Standard_Real Param, void GeomFill_SweepFunction::SetInterval(const Standard_Real First, const Standard_Real Last) { - Standard_Real uf, ul; + Standard_Real uf = NAN, ul = NAN; myLoc->SetInterval(First, Last); uf = myf + (First - myf) * myRatio; ul = myf + (Last - myf) * myRatio; diff --git a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx index dfd65583c6..5a53f1bbda 100644 --- a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx +++ b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx @@ -35,6 +35,7 @@ #include #include +#include #include #ifdef DRAW #include @@ -274,7 +275,7 @@ void GeomFill_SweepSectionGenerator::Perform(const Standard_Boolean Polynomial) myNbSections = 21 * NSpans; - Standard_Real U; + Standard_Real U = NAN; Standard_Real U1 = myPath->FirstParameter(); Standard_Real U2 = myPath->LastParameter(); @@ -493,7 +494,7 @@ Standard_Boolean GeomFill_SweepSectionGenerator::Section // calcul du cercle osculateur. - Standard_Real U; + Standard_Real U = NAN; if ( P == 1) { U = myPath->FirstParameter(); } @@ -526,7 +527,7 @@ Standard_Boolean GeomFill_SweepSectionGenerator::Section else { gp_Dir N = D; gp_Pnt Q = Pt.Translated( (1./c) * gp_Vec(N)); - Standard_Real x, y; + Standard_Real x = NAN, y = NAN; gp_Vec V; for ( Standard_Integer i = 1; i <= myFirstSect->NbPoles(); i++) { V = gp_Vec(Q, Poles(i)); @@ -633,7 +634,7 @@ void GeomFill_SweepSectionGenerator::Section gp_Pnt P2 = myAdpLastSect->Value(U2); gp_Ax2 Axis; - Standard_Real Angle; + Standard_Real Angle = NAN; if ( P1.Distance(P2) < Precision::Confusion()) { Angle = 0.; } diff --git a/src/GeomFill/GeomFill_SweepSectionGenerator.hxx b/src/GeomFill/GeomFill_SweepSectionGenerator.hxx index adeba24882..db9b8f5889 100644 --- a/src/GeomFill/GeomFill_SweepSectionGenerator.hxx +++ b/src/GeomFill/GeomFill_SweepSectionGenerator.hxx @@ -115,12 +115,12 @@ private: Handle(Adaptor3d_Curve) myAdpFirstSect; Handle(Adaptor3d_Curve) myAdpLastSect; gp_Ax1 myCircPathAxis; - Standard_Real myRadius; - Standard_Boolean myIsDone; - Standard_Integer myNbSections; + Standard_Real myRadius{}; + Standard_Boolean myIsDone{}; + Standard_Integer myNbSections{}; GeomFill_SequenceOfTrsf myTrsfs; - Standard_Integer myType; - Standard_Boolean myPolynomial; + Standard_Integer myType{}; + Standard_Boolean myPolynomial{}; }; diff --git a/src/GeomFill/GeomFill_Tensor.cxx b/src/GeomFill/GeomFill_Tensor.cxx index 166287161f..e2612bd3cb 100644 --- a/src/GeomFill/GeomFill_Tensor.cxx +++ b/src/GeomFill/GeomFill_Tensor.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -39,8 +41,8 @@ void GeomFill_Tensor::Init(const Standard_Real InitialValue) void GeomFill_Tensor::Multiply(const math_Vector& Right, math_Matrix& M) const { - Standard_Integer i, j, k; - Standard_Real Somme; + Standard_Integer i = 0, j = 0, k = 0; + Standard_Real Somme = NAN; for ( i=1; i<=nbrow; i++) { for ( j=1; j<=nbcol; j++) diff --git a/src/GeomFill/GeomFill_UniformSection.cxx b/src/GeomFill/GeomFill_UniformSection.cxx index 1d153407ed..85a19d5ef2 100644 --- a/src/GeomFill/GeomFill_UniformSection.cxx +++ b/src/GeomFill/GeomFill_UniformSection.cxx @@ -30,6 +30,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(GeomFill_UniformSection,GeomFill_SectionLaw) @@ -124,7 +125,7 @@ GeomFill_UniformSection::GeomFill_UniformSection(const Handle(Geom_Curve)& C, //======================================================= Handle(Geom_BSplineSurface) GeomFill_UniformSection::BSplineSurface() const { - Standard_Integer ii, NbPoles = myCurve->NbPoles(); + Standard_Integer ii = 0, NbPoles = myCurve->NbPoles(); TColgp_Array2OfPnt Poles( 1, NbPoles, 1, 2); TColStd_Array1OfReal UKnots(1,myCurve->NbKnots()), VKnots(1,2); TColStd_Array1OfInteger UMults(1,myCurve->NbKnots()), VMults(1,2); @@ -271,7 +272,7 @@ GeomFill_UniformSection::GeomFill_UniformSection(const Handle(Geom_Curve)& C, //======================================================= gp_Pnt GeomFill_UniformSection::BarycentreOfSurf() const { - Standard_Real U = mySection->FirstParameter(), Delta; + Standard_Real U = mySection->FirstParameter(), Delta = NAN; gp_Pnt P, Bary; Delta = ( myCurve->LastParameter() - U ) / 20; diff --git a/src/GeomInt/GeomInt.cxx b/src/GeomInt/GeomInt.cxx index a788e4352a..5f523206da 100644 --- a/src/GeomInt/GeomInt.cxx +++ b/src/GeomInt/GeomInt.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include //======================================================================= @@ -28,7 +30,7 @@ Standard_Boolean GeomInt::AdjustPeriodic(const Standard_Real thePar, Standard_Real &theOffset, const Standard_Real theEps) { - Standard_Boolean bMin, bMax; + Standard_Boolean bMin = 0, bMax = 0; // theOffset = 0.; theNewPar = thePar; @@ -36,7 +38,7 @@ Standard_Boolean GeomInt::AdjustPeriodic(const Standard_Real thePar, bMax = thePar - theParMax > theEps; // if (bMin || bMax) { - Standard_Real dp, aNbPer; + Standard_Real dp = NAN, aNbPer = NAN; // dp = (bMin) ? (theParMax - thePar) : (theParMin - thePar); modf(dp / thePeriod, &aNbPer); diff --git a/src/GeomInt/GeomInt_IntSS.cxx b/src/GeomInt/GeomInt_IntSS.cxx index 600fb45bb4..e50b2f5fc6 100644 --- a/src/GeomInt/GeomInt_IntSS.cxx +++ b/src/GeomInt/GeomInt_IntSS.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -183,7 +185,7 @@ void GeomInt_IntSS::Perform(const Handle(Geom_Surface)& S1, const Standard_Boolean OnFirst) const { const IntPatch_Point& thept = myIntersector.Point(Index); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; if (OnFirst) thept.ParametersOnS1(U,V); else diff --git a/src/GeomInt/GeomInt_IntSS_1.cxx b/src/GeomInt/GeomInt_IntSS_1.cxx index 9672735301..528f0b5515 100644 --- a/src/GeomInt/GeomInt_IntSS_1.cxx +++ b/src/GeomInt/GeomInt_IntSS_1.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -62,7 +64,7 @@ const Standard_Real aEps=Precision::PConfusion();//1.e-9 const Standard_Real aEpsilon=Epsilon(10.);//1.77e-15 // - Standard_Real umin,umax,vmin,vmax; + Standard_Real umin = NAN,umax = NAN,vmin = NAN,vmax = NAN; aS->Bounds(umin,umax,vmin,vmax); const Standard_Real aPeriod = aS->UPeriod(); @@ -267,8 +269,8 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, const Standard_Boolean ApproxS2) { - Standard_Boolean myApprox1, myApprox2, myApprox; - Standard_Real Tolpc, myTolApprox; + Standard_Boolean myApprox1 = 0, myApprox2 = 0, myApprox = 0; + Standard_Real Tolpc = NAN, myTolApprox = NAN; IntPatch_IType typl; Handle(Geom2d_BSplineCurve) H1; Handle(Geom_Surface) aS1, aS2; @@ -299,9 +301,9 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, return; } // Do the Curve - Standard_Boolean ok; - Standard_Integer i, j, aNbParts; - Standard_Real fprm, lprm; + Standard_Boolean ok = 0; + Standard_Integer i = 0, j = 0, aNbParts = 0; + Standard_Real fprm = NAN, lprm = NAN; Handle(Geom_Curve) newc; switch (typl) { @@ -370,9 +372,9 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, slineS2.Append(H1); continue; } - Standard_Boolean bFNIt, bLPIt; - Standard_Real aTestPrm, dT=100.; - Standard_Real u1, v1, u2, v2, TolX; + Standard_Boolean bFNIt = 0, bLPIt = 0; + Standard_Real aTestPrm = NAN, dT=100.; + Standard_Real u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN, TolX = NAN; // bFNIt=Precision::IsNegativeInfinite(fprm); bLPIt=Precision::IsPositiveInfinite(lprm); @@ -419,7 +421,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, (Handle(IntPatch_GLine)::DownCast(L)->Ellipse()); } // - Standard_Real aPeriod, aRealEpsilon; + Standard_Real aPeriod = NAN, aRealEpsilon = NAN; // aRealEpsilon=RealEpsilon(); aPeriod=M_PI+M_PI; @@ -501,7 +503,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, } } // - Standard_Real aTwoPIdiv17, u1, v1, u2, v2, TolX; + Standard_Real aTwoPIdiv17 = NAN, u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN, TolX = NAN; // aTwoPIdiv17=2.*M_PI/17.; // @@ -568,7 +570,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, #endif // - Standard_Integer ifprm, ilprm; + Standard_Integer ifprm = 0, ilprm = 0; // if (!myApprox) { aNbParts=myLConstruct.NbParts(); @@ -595,11 +597,11 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, } // else { - Standard_Boolean bIsDecomposited; - Standard_Integer nbiter, aNbSeqOfL; + Standard_Boolean bIsDecomposited = 0; + Standard_Integer nbiter = 0, aNbSeqOfL = 0; GeomInt_WLApprox theapp3d; IntPatch_SequenceOfLine aSeqOfL; - Standard_Real tol2d, aTolSS; + Standard_Real tol2d = NAN, aTolSS = NAN; // tol2d = myTolApprox; aTolSS=2.e-7; @@ -705,7 +707,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, myTolReached3d = theapp3d.TolReached3d(); } - Standard_Integer aNbMultiCurves, nbpoles; + Standard_Integer aNbMultiCurves = 0, nbpoles = 0; // aNbMultiCurves=theapp3d.NbMultiCurves(); for (j=1; j<=aNbMultiCurves; j++) { @@ -719,7 +721,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, mbspc.Curve(1,tpoles2d); const gp_Pln& Pln = myHS1->Plane(); // - Standard_Integer ik; + Standard_Integer ik = 0; for(ik = 1; ik<= nbpoles; ik++) { tpoles.SetValue(ik, ElSLib::Value(tpoles2d.Value(ik).X(), @@ -782,7 +784,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, mbspc.Curve((myApprox1==Standard_True)? 2 : 1,tpoles2d); const gp_Pln& Pln = myHS2->Plane(); // - Standard_Integer ik; + Standard_Integer ik = 0; for(ik = 1; ik<= nbpoles; ik++) { tpoles.SetValue(ik, ElSLib::Value(tpoles2d.Value(ik).X(), @@ -916,7 +918,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, Handle(IntPatch_RLine)::DownCast(L); Handle(Geom_Curve) aC3d; Handle(Geom2d_Curve) aC2d1, aC2d2; - Standard_Real aTolReached; + Standard_Real aTolReached = NAN; TreatRLine(RL, myHS1, myHS2, aC3d, aC2d1, aC2d2, aTolReached); @@ -1009,7 +1011,7 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL, { Handle(GeomAdaptor_Surface) aGAHS; Handle(Adaptor2d_Curve2d) anAHC2d; - Standard_Real tf, tl; + Standard_Real tf = NAN, tl = NAN; gp_Lin2d aL; // It is assumed that 2d curve is 2d line (rectangular surface domain) if(theRL->IsArcOnS1()) @@ -1169,8 +1171,8 @@ void GeomInt_IntSS::BuildPCurves (const Standard_Real theFirst, const Standard_R // if (theSurface->IsUPeriodic() && !theCurve2d.IsNull()) { // Recadre dans le domaine UV de la face - Standard_Real aTm, U0, aEps, period, du, U0x; - Standard_Boolean bAdjust; + Standard_Real aTm = NAN, U0 = NAN, aEps = NAN, period = NAN, du = NAN, U0x = NAN; + Standard_Boolean bAdjust = 0; // aEps = Precision::PConfusion(); period = theSurface->UPeriod(); @@ -1205,7 +1207,7 @@ void GeomInt_IntSS::BuildPCurves (const Standard_Real f, return; } // - Standard_Real umin,umax,vmin,vmax; + Standard_Real umin = NAN,umax = NAN,vmin = NAN,vmax = NAN; // S->Bounds(umin, umax, vmin, vmax); @@ -1360,7 +1362,7 @@ Handle(Geom2d_BSplineCurve) GeomInt_IntSS:: Standard_Integer i = 1, ipidebm1 = ideb; for(; i <= nbpnt; ipidebm1++, i++) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; if(onFirst) theWLine->Point(ipidebm1).ParametersOnS1(U, V); else diff --git a/src/GeomInt/GeomInt_LineConstructor.cxx b/src/GeomInt/GeomInt_LineConstructor.cxx index 9862f6fe1b..688c09e8c7 100644 --- a/src/GeomInt/GeomInt_LineConstructor.cxx +++ b/src/GeomInt/GeomInt_LineConstructor.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -122,13 +124,13 @@ static void RejectDuplicates(NCollection_Array1& theVtxArr); //======================================================================= void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) { - Standard_Integer i,nbvtx; - Standard_Real firstp,lastp; + Standard_Integer i = 0,nbvtx = 0; + Standard_Real firstp = NAN,lastp = NAN; const Standard_Real Tol = Precision::PConfusion() * 35.0; const IntPatch_IType typl = L->ArcType(); if(typl == IntPatch_Analytic) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Handle(IntPatch_ALine) ALine (Handle(IntPatch_ALine)::DownCast (L)); seqp.Clear(); nbvtx = GeomInt_LineTool::NbVertex(L); @@ -154,7 +156,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) return; } // if(typl == IntPatch_Analytic) { else if(typl == IntPatch_Walking) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Handle(IntPatch_WLine) WLine (Handle(IntPatch_WLine)::DownCast (L)); seqp.Clear(); nbvtx = GeomInt_LineTool::NbVertex(L); @@ -201,7 +203,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) //more strict check (all two points of WLine are checksed) is //applied in this case. - Standard_Real aU21, aV21, aU22, aV22; + Standard_Real aU21 = NAN, aV21 = NAN, aU22 = NAN, aV22 = NAN; const IntSurf_PntOn2S& aPfirst = WLine->Point((Standard_Integer) (firstp)); const IntSurf_PntOn2S& aPlast = WLine->Point((Standard_Integer) (lastp)); aPfirst.Parameters(u1, v1, u2, v2); @@ -264,11 +266,11 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) // Why -? It is not known yet. // PKV 22.Apr.2002 // - Standard_Integer aNbParts; + Standard_Integer aNbParts = 0; // aNbParts = seqp.Length()/2; if (aNbParts > 1) { - Standard_Boolean bCond; + Standard_Boolean bCond = 0; GeomAbs_SurfaceType aST1, aST2; aST1 = myHS1->GetType(); aST2 = myHS2->GetType(); @@ -288,7 +290,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) } // if (bCond) { - Standard_Integer aNb, anIndex, aNbTmp, jx; + Standard_Integer aNb = 0, anIndex = 0, aNbTmp = 0, jx = 0; TColStd_IndexedMapOfInteger aMap; TColStd_SequenceOfReal aSeqTmp; // @@ -334,8 +336,8 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) return; } //---------------------------- - Standard_Boolean intrvtested; - Standard_Real u1,v1,u2,v2; + Standard_Boolean intrvtested = 0; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; // nbvtx = GeomInt_LineTool::NbVertex(L); intrvtested = Standard_False; @@ -473,7 +475,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) } if (i > nbvtx) { - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; for (i=1; i<=GeomInt_LineTool::NbVertex(L); i++ ) { if (!GeomInt_LineTool::Vertex(L,i).IsOnDomS1() ) { GeomInt_LineTool::Vertex(L,i).ParametersOnS1(U,V); @@ -498,7 +500,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) } if (i > nbvtx) { - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; for (i=1; i<=GeomInt_LineTool::NbVertex(L); i++ ) { if (!GeomInt_LineTool::Vertex(L,i).IsOnDomS2() ) { GeomInt_LineTool::Vertex(L,i).ParametersOnS2(U,V); @@ -620,7 +622,7 @@ void GeomInt_LineConstructor::TreatCircle(const Handle(IntPatch_Line)& theLine, std::sort(aVtxArr.begin(), aVtxArr.end()); - Standard_Real aU1, aV1, aU2, aV2; + Standard_Real aU1 = NAN, aV1 = NAN, aU2 = NAN, aV2 = NAN; gp_Pnt aPmid; gp_Pnt2d aP2D; for (Standard_Integer i = aVtxArr.Lower(); i <= aVtxArr.Upper() - 1; i++) @@ -663,7 +665,7 @@ void AdjustPeriodic(const Handle(GeomAdaptor_Surface)& myHS1, Standard_Real& u2, Standard_Real& v2) { - Standard_Boolean myHS1IsUPeriodic, myHS1IsVPeriodic; + Standard_Boolean myHS1IsUPeriodic = 0, myHS1IsVPeriodic = 0; const GeomAbs_SurfaceType typs1 = myHS1->GetType(); switch (typs1) { @@ -687,7 +689,7 @@ void AdjustPeriodic(const Handle(GeomAdaptor_Surface)& myHS1, break; } } - Standard_Boolean myHS2IsUPeriodic, myHS2IsVPeriodic; + Standard_Boolean myHS2IsUPeriodic = 0, myHS2IsVPeriodic = 0; const GeomAbs_SurfaceType typs2 = myHS2->GetType(); switch (typs2) { @@ -711,7 +713,7 @@ void AdjustPeriodic(const Handle(GeomAdaptor_Surface)& myHS1, break; } } - Standard_Real du, dv; + Standard_Real du = NAN, dv = NAN; // if (myHS1IsUPeriodic) { @@ -832,8 +834,8 @@ Standard_Boolean RejectMicroCircle(const Handle(IntPatch_GLine)& aGLine, const IntPatch_IType aType, const Standard_Real aTol3D) { - Standard_Boolean bRet; - Standard_Real aR; + Standard_Boolean bRet = 0; + Standard_Real aR = NAN; // bRet=Standard_False; // diff --git a/src/GeomInt/GeomInt_LineTool.cxx b/src/GeomInt/GeomInt_LineTool.cxx index f33fedb3f9..d4f1f01022 100644 --- a/src/GeomInt/GeomInt_LineTool.cxx +++ b/src/GeomInt/GeomInt_LineTool.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -233,7 +235,7 @@ static Standard_Boolean FindPoint(const gp_Pnt2d& theFirstPoint, gp_Vec2d acurvec(theLastPoint, acurpoint); // - Standard_Real aDotX, anAngleX, aPC; + Standard_Real aDotX = NAN, anAngleX = NAN, aPC = NAN; // aDotX=aVec.Dot(acurvec); anAngleX=aVec.Angle(acurvec); @@ -311,7 +313,7 @@ Standard_Real GeomInt_LineTool::FirstParameter (const Handle(IntPatch_Line)& L) Handle(IntPatch_ALine) alin = Handle(IntPatch_ALine)::DownCast(L); if (alin->HasFirstPoint()) return alin->FirstPoint().ParameterOnLine(); - Standard_Boolean included; + Standard_Boolean included = 0; Standard_Real firstp = alin->FirstParameter(included); if (!included) firstp += Epsilon(firstp); @@ -363,7 +365,7 @@ Standard_Real GeomInt_LineTool::LastParameter (const Handle(IntPatch_Line)& L) Handle(IntPatch_ALine) alin = Handle(IntPatch_ALine)::DownCast(L); if (alin->HasLastPoint()) return alin->LastPoint().ParameterOnLine(); - Standard_Boolean included; + Standard_Boolean included = 0; Standard_Real lastp = alin->LastParameter(included); if (!included) lastp -=Epsilon(lastp); @@ -421,9 +423,9 @@ Standard_Boolean GeomInt_LineTool:: typedef std::vector > ArrayOfListOfInteger; - Standard_Boolean bIsPrevPointOnBoundary, bIsCurrentPointOnBoundary; - Standard_Integer nblines, aNbPnts, aNbParts, pit, i, j, aNbListOfPointIndex; - Standard_Real aTol, umin, umax, vmin, vmax; + Standard_Boolean bIsPrevPointOnBoundary = 0, bIsCurrentPointOnBoundary = 0; + Standard_Integer nblines = 0, aNbPnts = 0, aNbParts = 0, pit = 0, i = 0, j = 0, aNbListOfPointIndex = 0; + Standard_Real aTol = NAN, umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; //an inc allocator, it will contain wasted space (upon list's Clear()) but it should //still be faster than the standard allocator, and wasted memory should not be @@ -476,16 +478,16 @@ Standard_Boolean GeomInt_LineTool:: aGASurface->Surface()->Bounds(umin, umax, vmin, vmax); // for(j=0; j<2; j++) {// exploration of coordinate U,V - Standard_Boolean isperiodic; + Standard_Boolean isperiodic = 0; // isperiodic = (!j) ? aGASurface->IsUPeriodic() : aGASurface->IsVPeriodic(); if(!isperiodic) { continue; } // - Standard_Real aResolution, aPeriod, alowerboundary, aupperboundary, U, V; - Standard_Real aParameter, anoffset, anAdjustPar; - Standard_Boolean bIsOnFirstBoundary, bIsPointOnBoundary; + Standard_Real aResolution = NAN, aPeriod = NAN, alowerboundary = NAN, aupperboundary = NAN, U = NAN, V = NAN; + Standard_Real aParameter = NAN, anoffset = NAN, anAdjustPar = NAN; + Standard_Boolean bIsOnFirstBoundary = 0, bIsPointOnBoundary = 0; // aResolution = (!j) ? aGASurface->UResolution(aTol) : aGASurface->VResolution(aTol); aPeriod = (!j) ? aGASurface->UPeriod() : aGASurface->VPeriod(); @@ -546,7 +548,7 @@ Standard_Boolean GeomInt_LineTool:: } // // Correct wlines.begin - Standard_Integer aLineType; + Standard_Integer aLineType = 0; TColStd_Array1OfListOfInteger anArrayOfLineEnds(1, nblines); Handle(IntSurf_LineOn2S) aSeqOfPntOn2S = new IntSurf_LineOn2S (new NCollection_IncAllocator()); // @@ -562,7 +564,7 @@ Standard_Boolean GeomInt_LineTool:: } // TColStd_ListOfInteger aListOfFLIndex; - Standard_Integer aneighbourindex, aLineTypeNeib; + Standard_Integer aneighbourindex = 0, aLineTypeNeib = 0; // for(j = 0; j < 2; j++) {// neighbour line choice aneighbourindex = (!j) ? (i-1) : (i+1); @@ -581,7 +583,7 @@ Standard_Boolean GeomInt_LineTool:: // check if need use derivative.begin .end [absence] // IntSurf_PntOn2S aNewP = aPoint; - Standard_Integer surfit, parit; + Standard_Integer surfit = 0, parit = 0; // for(surfit = 0; surfit < 2; ++surfit) { @@ -655,7 +657,7 @@ Standard_Boolean GeomInt_LineTool:: anotherPar += anoffset; Standard_Integer aneighbourpointindex = (j == 0) ? aListOfIndex.First() : aListOfIndex.Last(); const IntSurf_PntOn2S& aNeighbourPoint = theWLine->Point(aneighbourpointindex); - Standard_Real nU1, nV1; + Standard_Real nU1 = NAN, nV1 = NAN; if(surfit == 0) aNeighbourPoint.ParametersOnS1(nU1, nV1); @@ -697,7 +699,7 @@ Standard_Boolean GeomInt_LineTool:: while((anindexother <= aListOfIndex.Last()) && (anindexother >= aListOfIndex.First())) { anindexother = (j == 0) ? (anindexother + 1) : (anindexother - 1); const IntSurf_PntOn2S& aPrevNeighbourPoint = theWLine->Point(anindexother); - Standard_Real nU2, nV2; + Standard_Real nU2 = NAN, nV2 = NAN; if(surfit == 0) aPrevNeighbourPoint.ParametersOnS1(nU2, nV2); @@ -714,7 +716,7 @@ Standard_Boolean GeomInt_LineTool:: if((fabs(anAngle) < (M_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) { if(bCheckAngle1) { - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; IntSurf_PntOn2S atmppoint = aNewP; atmppoint.SetValue((surfit == 0), anewU, anewV); atmppoint.Parameters(U1, V1, U2, V2); @@ -744,7 +746,7 @@ Standard_Boolean GeomInt_LineTool:: if(bComputeLineEnd) { Standard_Integer aneighbourpointindex1 = (j == 0) ? aListOfIndex.First() : aListOfIndex.Last(); const IntSurf_PntOn2S& aNeighbourPoint = theWLine->Point(aneighbourpointindex1); - Standard_Real nU1, nV1; + Standard_Real nU1 = NAN, nV1 = NAN; if(surfit == 0) aNeighbourPoint.ParametersOnS1(nU1, nV1); @@ -757,7 +759,7 @@ Standard_Boolean GeomInt_LineTool:: while((aneighbourpointindex2 <= aListOfIndex.Last()) && (aneighbourpointindex2 >= aListOfIndex.First())) { aneighbourpointindex2 = (j == 0) ? (aneighbourpointindex2 + 1) : (aneighbourpointindex2 - 1); const IntSurf_PntOn2S& aPrevNeighbourPoint = theWLine->Point(aneighbourpointindex2); - Standard_Real nU2, nV2; + Standard_Real nU2 = NAN, nV2 = NAN; if(surfit == 0) aPrevNeighbourPoint.ParametersOnS1(nU2, nV2); @@ -964,8 +966,8 @@ Standard_Boolean GeomInt_LineTool:: // Split wlines.end // // cda002/I3 - Standard_Real fprm, lprm; - Standard_Integer ifprm, ilprm, aNbPoints, aIndex; + Standard_Real fprm = NAN, lprm = NAN; + Standard_Integer ifprm = 0, ilprm = 0, aNbPoints = 0, aIndex = 0; // aNbParts=theLConstructor.NbParts(); // diff --git a/src/GeomLProp/GeomLProp.cxx b/src/GeomLProp/GeomLProp.cxx index 3d48a5ae7d..2b88442e4d 100644 --- a/src/GeomLProp/GeomLProp.cxx +++ b/src/GeomLProp/GeomLProp.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -68,13 +70,13 @@ GeomAbs_Shape GeomLProp::Continuity(const Handle(Geom_Curve)& C1, const Standard_Real ta) { GeomAbs_Shape cont = GeomAbs_C0; - Standard_Integer index1, - index2 ; - Standard_Real tolerance ; + Standard_Integer index1 = 0, + index2 = 0 ; + Standard_Real tolerance = NAN ; Standard_Boolean fini = Standard_False; gp_Vec d1,d2; gp_Dir dir1,dir2; - Standard_Integer cont1, cont2 ; + Standard_Integer cont1 = 0, cont2 = 0 ; GeomAbs_Shape gcont1 = C1->Continuity(), gcont2 = C2->Continuity(); cont1 = GeomAbsToInteger(gcont1) ; cont2 = GeomAbsToInteger(gcont2) ; diff --git a/src/GeomLib/GeomLib.cxx b/src/GeomLib/GeomLib.cxx index fcb2305344..9fd144d906 100644 --- a/src/GeomLib/GeomLib.cxx +++ b/src/GeomLib/GeomLib.cxx @@ -41,6 +41,8 @@ // Purpose: // Declarations: +#include + #include #include @@ -145,7 +147,7 @@ static void ComputeLambda(const math_Matrix& Constraint, { Standard_Integer size = Hermit.RowNumber(); Standard_Integer Continuity = size-2; - Standard_Integer ii, jj, ip, pp; + Standard_Integer ii = 0, jj = 0, ip = 0, pp = 0; //Minimization math_Matrix HDer(1, size-1, 1, size); @@ -165,7 +167,7 @@ static void ComputeLambda(const math_Matrix& Constraint, Standard_Real * valhder = &V(1); Vec2 = Constraint.Col(2); Vec2 /= Length; - Standard_Real t, squared1 = Vec2.Norm2(), GW; + Standard_Real t = NAN, squared1 = Vec2.Norm2(), GW = NAN; // math_Matrix Vec(1, Constraint.RowNumber(), 1, size-1); // gp_Vec Vfirst(p0.XYZ()), Vlast(Point.XYZ()); // TColgp_Array1OfVec Der(2, 4); @@ -233,7 +235,7 @@ static void ComputeLambda(const math_Matrix& Constraint, } } - Standard_Real EMin, E; + Standard_Real EMin = NAN, E = NAN; PLib::NoDerivativeEvalPolynomial(Lambda , pol4.Length()-1, 1, pol4.Length()-1, pol4(1), EMin); @@ -270,14 +272,14 @@ void GeomLib::RemovePointsFromArray(const Standard_Integer NumPoints, const TColStd_Array1OfReal& InParameters, Handle(TColStd_HArray1OfReal)& OutParameters) { - Standard_Integer ii, - jj, - add_one_point, - loc_num_points, - num_points, - index ; - Standard_Real delta, - current_parameter ; + Standard_Integer ii = 0, + jj = 0, + add_one_point = 0, + loc_num_points = 0, + num_points = 0, + index = 0 ; + Standard_Real delta = NAN, + current_parameter = NAN ; loc_num_points = Max(0,NumPoints-2) ; delta = InParameters(InParameters.Upper()) - InParameters(InParameters.Lower()) ; @@ -326,13 +328,13 @@ void GeomLib::DensifyArray1OfReal(const Standard_Integer MinNumPoints, const TColStd_Array1OfReal& InParameters, Handle(TColStd_HArray1OfReal)& OutParameters) { - Standard_Integer ii, - in_order, - num_points, - num_parameters_to_add, - index ; - Standard_Real delta, - current_parameter ; + Standard_Integer ii = 0, + in_order = 0, + num_points = 0, + num_parameters_to_add = 0, + index = 0 ; + Standard_Real delta = NAN, + current_parameter = NAN ; in_order = 1 ; if (MinNumPoints > InParameters.Length()) { @@ -408,7 +410,7 @@ void GeomLib::FuseIntervals(const TColStd_Array1OfReal& I1, const Standard_Boolean IsAdjustToFirstInterval) { Standard_Integer ind1=1, ind2=1; - Standard_Real v1, v2; + Standard_Real v1 = NAN, v2 = NAN; // Initialisations : les IND1 et IND2 pointent sur le 1er element // de chacune des 2 tables a traiter.INDS pointe sur le dernier // element cree de TABSOR @@ -474,11 +476,11 @@ void GeomLib::EvalMaxParametricDistance(const Adaptor3d_Curve& ACurve, const TColStd_Array1OfReal& Parameters, Standard_Real& MaxDistance) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Standard_Real max_squared = 0.0e0, // tolerance_squared, - local_distance_squared ; + local_distance_squared = NAN ; // tolerance_squared = Tolerance * Tolerance ; gp_Pnt Point1 ; @@ -511,12 +513,12 @@ void GeomLib::EvalMaxDistanceAlongParameter(const Adaptor3d_Curve& ACurve, const TColStd_Array1OfReal& Parameters, Standard_Real& MaxDistance) { - Standard_Integer ii ; + Standard_Integer ii = 0 ; Standard_Real max_squared = 0.0e0, tolerance_squared = Tolerance * Tolerance, - other_parameter, - para_tolerance, - local_distance_squared ; + other_parameter = NAN, + para_tolerance = NAN, + local_distance_squared = NAN ; gp_Pnt Point1 ; gp_Pnt Point2 ; @@ -912,7 +914,7 @@ void GeomLib::SameRange(const Standard_Real Tolerance, Handle(Geom2d_Circle) Circ = Handle(Geom2d_Circle)::DownCast(NewCurvePtr); gp_Pnt2d P = Circ->Location(); - Standard_Real dU; + Standard_Real dU = NAN; if (Circ->Circ2d().IsDirect()) { dU = FirstOnCurve - RequestedFirst; } @@ -1017,12 +1019,12 @@ class GeomLib_CurveOnSurfaceEvaluator : public AdvApprox_EvaluatorFunction Standard_Real theFirst, Standard_Real theLast) : CurveOnSurface(theCurveOnSurface), FirstParam(theFirst), LastParam(theLast) {} - virtual void Evaluate (Standard_Integer *Dimension, + void Evaluate (Standard_Integer *Dimension, Standard_Real StartEnd[2], Standard_Real *Parameter, Standard_Integer *DerivativeRequest, Standard_Real *Result, // [Dimension] - Standard_Integer *ErrorCode); + Standard_Integer *ErrorCode) override; private: Adaptor3d_CurveOnSurface& CurveOnSurface; @@ -1125,8 +1127,8 @@ void GeomLib::BuildCurve3d(const Standard_Real Tolerance, Handle(Adaptor2d_Curve2d) TrimmedC2D = geom_adaptor_curve_ptr->Trim (FirstParameter, LastParameter, Precision::PConfusion()); - Standard_Boolean isU, isForward; - Standard_Real aParam; + Standard_Boolean isU = 0, isForward = 0; + Standard_Real aParam = NAN; if (isIsoLine(TrimmedC2D, isU, aParam, isForward)) { NewCurvePtr = buildC3dOnIsoLine (TrimmedC2D, geom_adaptor_surface_ptr, FirstParameter, LastParameter, Tolerance, isU, aParam, isForward); @@ -1204,7 +1206,7 @@ void GeomLib::AdjustExtremity(Handle(Geom_BoundedCurve)& Curve, Handle(Geom_BSplineCurve) aIn, aDef; aIn = GeomConvert::CurveToBSplineCurve(Curve, Convert_QuasiAngular); - Standard_Integer ii, jj; + Standard_Integer ii = 0, jj = 0; gp_Pnt P; gp_Vec V, Vtan, DV; TColgp_Array1OfPnt PolesDef(1,4), Coeffs(1,4); @@ -1289,10 +1291,10 @@ void GeomLib::ExtendCurveToPoint(Handle(Geom_BoundedCurve)& Curve, { if(Continuity < 1 || Continuity > 3) return; Standard_Integer size = Continuity + 2; - Standard_Real Ubord, Tol=1.e-6; + Standard_Real Ubord = NAN, Tol=1.e-6; math_Matrix MatCoefs(1,size, 1,size); - Standard_Real Lambda, L1; - Standard_Integer ii, jj; + Standard_Real Lambda = NAN, L1 = NAN; + Standard_Integer ii = 0, jj = 0; gp_Vec d1, d2, d3; gp_Pnt p0; // il faut Convertir l'entree (en preservant si possible le parametrage) @@ -1326,7 +1328,7 @@ void GeomLib::ExtendCurveToPoint(Handle(Geom_BoundedCurve)& Curve, // a sur la courbe. gp_Vec daux; gp_Pnt pp; - Standard_Real f= Curve->FirstParameter(), t, dt, norm; + Standard_Real f= Curve->FirstParameter(), t = NAN, dt = NAN, norm = NAN; dt = (Curve->LastParameter()-f)/9; norm = d1.Magnitude(); for (ii=1, t=f+dt; ii<=8; ii++, t+=dt) { @@ -1385,7 +1387,7 @@ void GeomLib::ExtendCurveToPoint(Handle(Geom_BoundedCurve)& Curve, Handle(Geom_BezierCurve) Bezier = new (Geom_BezierCurve) (ExtrapPoles); Standard_Real dist = ExtrapPoles(1).Distance(p0); - Standard_Boolean Ok; + Standard_Boolean Ok = 0; Tol += dist; // Concatenation @@ -1410,7 +1412,7 @@ ExtendKPart(Handle(Geom_RectangularTrimmedSurface)& Surface, if (Surface.IsNull()) return Standard_False; Standard_Boolean Ok=Standard_True; - Standard_Real Uf, Ul, Vf, Vl; + Standard_Real Uf = NAN, Ul = NAN, Vf = NAN, Vl = NAN; Handle(Geom_Surface) Support = Surface->BasisSurface(); GeomAbs_SurfaceType Type; @@ -1498,7 +1500,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, // si BS etait periodique dans le sens de l'extension, elle ne le sera plus if ( (InU&&(BS->IsUPeriodic())) || (!InU&&(BS->IsVPeriodic())) ) { - Standard_Real U0,U1,V0,V1; + Standard_Real U0 = NAN,U1 = NAN,V0 = NAN,V1 = NAN; BS->Bounds(U0,U1,V0,V1); BS->Segment(U0,U1,V0,V1); } @@ -1508,7 +1510,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, // Standard_Boolean rational = ( InU && BS->IsURational() ) // || ( !InU && BS->IsVRational() ) ; Standard_Boolean rational = (BS->IsURational() || BS->IsVRational()); - Standard_Boolean NullWeight; + Standard_Boolean NullWeight = 0; Standard_Real EpsW = 10*Precision::PConfusion(); Standard_Integer gap = 3; if ( rational ) gap++; @@ -1516,10 +1518,10 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, Standard_Integer Cdeg = 0, Cdim = 0, NbP = 0, Ksize = 0, Psize = 1; - Standard_Integer ii, jj, ipole, Kount; - Standard_Real Tbord, lambmin=Length; + Standard_Integer ii = 0, jj = 0, ipole = 0, Kount = 0; + Standard_Real Tbord = NAN, lambmin=Length; Standard_Real * Padr = NULL; - Standard_Boolean Ok; + Standard_Boolean Ok = 0; Handle(TColStd_HArray1OfReal) FKnots, Point, lambda, Tgte, Poles; @@ -1614,7 +1616,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, gp_Vec CurT, OldT; - Standard_Real NTgte, val, Tgtol = 1.e-12, OldN = 0.0; + Standard_Real NTgte = NAN, val = NAN, Tgtol = 1.e-12, OldN = 0.0; if (rational) { for (ii=gap;ii<=Cdim;ii+=gap) { tgte(ii) = 0.; @@ -1701,14 +1703,14 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, } // tableaux necessaires pour l'extension - Standard_Integer Ksize2 = Ksize+Cdeg, NbPoles, NbKnots = 0; + Standard_Integer Ksize2 = Ksize+Cdeg, NbPoles = 0, NbKnots = 0; TColStd_Array1OfReal FK(1, Ksize2) ; Standard_Real * FKRadr = &FK(1); Standard_Integer Psize2 = Psize+Cdeg*Cdim; TColStd_Array1OfReal PRes(1, Psize2) ; Standard_Real * PRadr = &PRes(1); - Standard_Real ww; + Standard_Real ww = NAN; Standard_Boolean ExtOk = Standard_False; Handle(TColgp_HArray2OfPnt) NewPoles; Handle(TColStd_HArray2OfReal) NewWeights; @@ -1723,7 +1725,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, NbPoles, NbKnots,*FKRadr, *PRadr); // recopie des poles du resultat sous forme de points 3D et de poids - Standard_Integer NU, NV, indice ; + Standard_Integer NU = 0, NV = 0, indice = 0 ; if (InU) { NU = NbPoles; NV = BS->NbVPoles(); @@ -1801,7 +1803,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, // recopie des noeuds plats sous forme de noeuds avec leurs multiplicites // calcul des degres du resultat - Standard_Integer Usize = BS->NbUKnots(), Vsize = BS->NbVKnots(), UDeg, VDeg; + Standard_Integer Usize = BS->NbUKnots(), Vsize = BS->NbVKnots(), UDeg = 0, VDeg = 0; if (InU) Usize++; else @@ -1860,7 +1862,7 @@ void GeomLib::Inertia(const TColgp_Array1OfPnt& Points, gp_XYZ GB(0., 0., 0.), Diff; // gp_Vec A,B,C,D; - Standard_Integer i,nb=Points.Length(); + Standard_Integer i = 0,nb=Points.Length(); GB.SetCoord(0.,0.,0.); for (i=1; i<=nb; i++) GB += Points(i).XYZ(); @@ -1893,14 +1895,14 @@ void GeomLib::Inertia(const TColgp_Array1OfPnt& Points, #endif } - Standard_Real n1,n2,n3; + Standard_Real n1 = NAN,n2 = NAN,n3 = NAN; n1=J.Value(1); n2=J.Value(2); n3=J.Value(3); - Standard_Real r1 = Min(Min(n1,n2),n3), r2; - Standard_Integer m1, m2, m3; + Standard_Real r1 = Min(Min(n1,n2),n3), r2 = NAN; + Standard_Integer m1 = 0, m2 = 0, m3 = 0; if (r1==n1) { m1 = 1; r2 = Min(n2,n3); @@ -1963,7 +1965,7 @@ void GeomLib::AxeOfInertia(const TColgp_Array1OfPnt& Points, { gp_Pnt Bary; gp_Dir OX,OY,OZ; - Standard_Real gx, gy, gz; + Standard_Real gx = NAN, gy = NAN, gz = NAN; GeomLib::Inertia(Points, Bary, OX, OY, gx, gy, gz); @@ -1990,8 +1992,8 @@ void GeomLib::AxeOfInertia(const TColgp_Array1OfPnt& Points, static Standard_Boolean CanBeTreated(Handle(Geom_BSplineSurface)& BSurf) -{Standard_Integer i; - Standard_Real lambda; //proportionnality coefficient +{Standard_Integer i = 0; + Standard_Real lambda = NAN; //proportionnality coefficient Standard_Boolean AlreadyTreated=Standard_True; if (!BSurf->IsURational()||(BSurf->IsUPeriodic())) @@ -2030,11 +2032,11 @@ public: law_evaluator (const GeomLib_DenominatorMultiplierPtr theDenominatorPtr) : myDenominator (theDenominatorPtr) {} - virtual void Evaluate (const Standard_Integer theDerivativeRequest, + void Evaluate (const Standard_Integer theDerivativeRequest, const Standard_Real theUParameter, const Standard_Real theVParameter, Standard_Real& theResult, - Standard_Integer& theErrorCode) const + Standard_Integer& theErrorCode) const override { if ((myDenominator != NULL) && (theDerivativeRequest == 0)) { @@ -2061,7 +2063,7 @@ private: static Standard_Boolean CheckIfKnotExists(const TColStd_Array1OfReal& surface_knots, const Standard_Real knot) -{Standard_Integer i; +{Standard_Integer i = 0; for (i=1;i<=surface_knots.Length();i++) if ((surface_knots(i)-Precision::Confusion()<=knot)&&(surface_knots(i)+Precision::Confusion()>=knot)) return Standard_True; @@ -2082,7 +2084,7 @@ static void AddAKnot(const TColStd_Array1OfReal& knots, Handle(TColStd_HArray1OfReal) & newknots, Handle(TColStd_HArray1OfInteger) & newmults) -{Standard_Integer i; +{Standard_Integer i = 0; newknots=new TColStd_HArray1OfReal(1,knots.Length()+1); newmults=new TColStd_HArray1OfInteger(1,knots.Length()+1); @@ -2117,7 +2119,7 @@ static void BuildFlatKnot(const TColStd_Array1OfReal& surface_knots, Handle(TColStd_HArray1OfInteger)& ResultMults) { - Standard_Integer i; + Standard_Integer i = 0; if (CheckIfKnotExists(surface_knots,knotmin) && CheckIfKnotExists(surface_knots,knotmax)){ @@ -2168,7 +2170,7 @@ static void FunctionMultiply(Handle(Geom_BSplineSurface)& BSurf, 1,BSurf->NbVPoles()) ; TColStd_Array2OfReal surface_weights(1,BSurf->NbUPoles(), 1,BSurf->NbVPoles()) ; - Standard_Integer i,j,k,status,new_num_u_poles,new_num_v_poles,length=0; + Standard_Integer i = 0,j = 0,k = 0,status = 0,new_num_u_poles = 0,new_num_v_poles = 0,length=0; Handle(TColStd_HArray1OfReal) newuknots,newvknots; Handle(TColStd_HArray1OfInteger) newumults,newvmults; @@ -2274,11 +2276,11 @@ static void FunctionMultiply(Handle(Geom_BSplineSurface)& BSurf, static void CancelDenominatorDerivative1D(Handle(Geom_BSplineSurface) & BSurf) -{Standard_Integer i,j; +{Standard_Integer i = 0,j = 0; Standard_Real uknotmin=1.0,uknotmax=0.0, - x,y, - startu_value, - endu_value; + x = NAN,y = NAN, + startu_value = NAN, + endu_value = NAN; TColStd_Array1OfReal BSurf_u_knots(1,BSurf->NbUKnots()) ; startu_value=BSurf->UKnot(1); @@ -2404,7 +2406,7 @@ Standard_Integer GeomLib::NormEstim (const Handle(Geom_Surface)& theSurf, return aStatus == CSLib_D1NIsNull ? 2 : 3; } - Standard_Real Umin, Umax, Vmin, Vmax; + Standard_Real Umin = NAN, Umax = NAN, Vmin = NAN, Vmax = NAN; Standard_Real step = 1.0e-5; Standard_Real eps = 1.0e-16; Standard_Real sign = -1.0; @@ -2516,7 +2518,7 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S, GeomAdaptor_Surface aGAS(S); GeomAbs_SurfaceType aSType = aGAS.GetType(); // - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; u1 = aGAS.FirstUParameter(); u2 = aGAS.LastUParameter(); v1 = aGAS.FirstVParameter(); @@ -2646,8 +2648,8 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S, nbp = Max(nbp, 2); dt = (v2 - v1) / (nbp - 1); } - Standard_Real t; - Standard_Integer i; + Standard_Real t = NAN; + Standard_Integer i = 0; for(i = 0; i < nbp; ++i) { t = (i == nbp-1 ? v2 : v1 + i * dt); @@ -2816,7 +2818,7 @@ static Standard_Boolean CompareWeightPoles(const TColgp_Array1OfPnt& thePoles1, //function : isIsoLine //purpose : //============================================================================= -Standard_Boolean GeomLib::isIsoLine (const Handle(Adaptor2d_Curve2d) theC2D, +Standard_Boolean GeomLib::isIsoLine (const Handle(Adaptor2d_Curve2d)& theC2D, Standard_Boolean& theIsU, Standard_Real& theParam, Standard_Boolean& theIsForward) @@ -2896,8 +2898,8 @@ Standard_Boolean GeomLib::isIsoLine (const Handle(Adaptor2d_Curve2d) theC2D, //function : buildC3dOnIsoLine //purpose : //============================================================================= -Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine (const Handle(Adaptor2d_Curve2d) theC2D, - const Handle(Adaptor3d_Surface) theSurf, +Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine (const Handle(Adaptor2d_Curve2d)& theC2D, + const Handle(Adaptor3d_Surface)& theSurf, const Standard_Real theFirst, const Standard_Real theLast, const Standard_Real theTolerance, @@ -2921,7 +2923,7 @@ Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine (const Handle(Adaptor2d_Curve2d) t gp_Pnt2d aL2d = theC2D->Value(theC2D->LastParameter()); Standard_Boolean isToTrim = Standard_True; - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; aSurf->Bounds(U1, U2, V1, V2); if (theIsU) diff --git a/src/GeomLib/GeomLib.hxx b/src/GeomLib/GeomLib.hxx index 71e817bb90..a3a13fb96a 100644 --- a/src/GeomLib/GeomLib.hxx +++ b/src/GeomLib/GeomLib.hxx @@ -239,7 +239,7 @@ public: //! @param theParam Line parameter. //! @param theIsForward Flag indicating forward parameterization on a isoline. //! @return Standard_True when 2d curve is a line and Standard_False otherwise. - Standard_EXPORT static Standard_Boolean isIsoLine (const Handle(Adaptor2d_Curve2d) theC2D, + Standard_EXPORT static Standard_Boolean isIsoLine (const Handle(Adaptor2d_Curve2d)& theC2D, Standard_Boolean& theIsU, Standard_Real& theParam, Standard_Boolean& theIsForward); @@ -251,8 +251,8 @@ public: //! @param theParam Line parameter. //! @param theIsForward Flag indicating forward parameterization on a isoline. //! @return Standard_True when 3d curve is built and Standard_False otherwise. - Standard_EXPORT static Handle(Geom_Curve) buildC3dOnIsoLine (const Handle(Adaptor2d_Curve2d) theC2D, - const Handle(Adaptor3d_Surface) theSurf, + Standard_EXPORT static Handle(Geom_Curve) buildC3dOnIsoLine (const Handle(Adaptor2d_Curve2d)& theC2D, + const Handle(Adaptor3d_Surface)& theSurf, const Standard_Real theFirst, const Standard_Real theLast, const Standard_Real theTolerance, diff --git a/src/GeomLib/GeomLib_Check2dBSplineCurve.cxx b/src/GeomLib/GeomLib_Check2dBSplineCurve.cxx index ef25c17506..a1eea68068 100644 --- a/src/GeomLib/GeomLib_Check2dBSplineCurve.cxx +++ b/src/GeomLib/GeomLib_Check2dBSplineCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,11 +39,11 @@ GeomLib_Check2dBSplineCurve::GeomLib_Check2dBSplineCurve(const Handle(Geom2d_BSp myIndSecondPole(-1), myIndPrelastPole(-1) { - Standard_Integer ii, - num_poles ; - Standard_Real tangent_magnitude, - value, - vector_magnitude ; + Standard_Integer ii = 0, + num_poles = 0 ; + Standard_Real tangent_magnitude = NAN, + value = NAN, + vector_magnitude = NAN ; num_poles = myCurve->NbPoles() ; if (( ! myCurve->IsPeriodic() )&& num_poles >= 4) { diff --git a/src/GeomLib/GeomLib_CheckBSplineCurve.cxx b/src/GeomLib/GeomLib_CheckBSplineCurve.cxx index 43cc8992b0..956899a473 100644 --- a/src/GeomLib/GeomLib_CheckBSplineCurve.cxx +++ b/src/GeomLib/GeomLib_CheckBSplineCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,11 +39,11 @@ GeomLib_CheckBSplineCurve::GeomLib_CheckBSplineCurve(const Handle(Geom_BSplineCu myIndSecondPole(-1), myIndPrelastPole(-1) { - Standard_Integer ii, - num_poles ; - Standard_Real tangent_magnitude, - value, - vector_magnitude ; + Standard_Integer ii = 0, + num_poles = 0 ; + Standard_Real tangent_magnitude = NAN, + value = NAN, + vector_magnitude = NAN ; num_poles = myCurve->NbPoles() ; if (( ! myCurve->IsPeriodic() )&& num_poles >= 4) { diff --git a/src/GeomLib/GeomLib_CheckCurveOnSurface.cxx b/src/GeomLib/GeomLib_CheckCurveOnSurface.cxx index 3e5df1ae20..7499b3846a 100644 --- a/src/GeomLib/GeomLib_CheckCurveOnSurface.cxx +++ b/src/GeomLib/GeomLib_CheckCurveOnSurface.cxx @@ -70,13 +70,13 @@ class GeomLib_CheckCurveOnSurface_TargetFunc : //returns the number of parameters of the function //(the function is one-dimension). - virtual Standard_Integer NbVariables() const { + Standard_Integer NbVariables() const override { return 1; } //returns value of the function when parameters are equal to theX - virtual Standard_Boolean Value(const math_Vector& theX, - Standard_Real& theFVal) + Standard_Boolean Value(const math_Vector& theX, + Standard_Real& theFVal) override { return Value(theX(1), theFVal); } @@ -105,15 +105,15 @@ class GeomLib_CheckCurveOnSurface_TargetFunc : } //see analogical method for abstract owner class math_MultipleVarFunction - virtual Standard_Integer GetStateNumber() + Standard_Integer GetStateNumber() override { return 0; } //returns the gradient of the function when parameters are //equal to theX - virtual Standard_Boolean Gradient(const math_Vector& theX, - math_Vector& theGrad) + Standard_Boolean Gradient(const math_Vector& theX, + math_Vector& theGrad) override { return Derive(theX(1), theGrad(1)); } @@ -163,9 +163,9 @@ class GeomLib_CheckCurveOnSurface_TargetFunc : } //returns value and gradient - virtual Standard_Boolean Values(const math_Vector& theX, + Standard_Boolean Values(const math_Vector& theX, Standard_Real& theVal, - math_Vector& theGrad) + math_Vector& theGrad) override { if (!Value(theX, theVal)) { @@ -180,10 +180,10 @@ class GeomLib_CheckCurveOnSurface_TargetFunc : } //returns value, gradient and hessian - virtual Standard_Boolean Values(const math_Vector& theX, + Standard_Boolean Values(const math_Vector& theX, Standard_Real& theVal, math_Vector& theGrad, - math_Matrix& theHessian) + math_Matrix& theHessian) override { if (!Value(theX, theVal)) { @@ -488,10 +488,10 @@ Standard_Integer FillSubIntervals(const Handle(Adaptor3d_Curve)& theCurve3d, } else { - Standard_Integer KnotCount; + Standard_Integer KnotCount = 0; if(isTrimmed3D) { - Standard_Integer i; + Standard_Integer i = 0; KnotCount = 0; const TColStd_Array1OfReal& aKnots = aBS3DCurv->Knots(); for(i = aBS3DCurv->FirstUKnotIndex(); i <= aBS3DCurv->LastUKnotIndex(); ++i) @@ -516,7 +516,7 @@ Standard_Integer FillSubIntervals(const Handle(Adaptor3d_Curve)& theCurve3d, anArrKnots3D = new TColStd_HArray1OfReal(1, aMaxKnots); anArrKnots3D->SetValue(1, theFirst); anArrKnots3D->SetValue(aMaxKnots, theLast); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real dt = (theLast - theFirst) / (aMaxKnots - 1); Standard_Real t = theFirst + dt; for(i = 2; i < aMaxKnots; ++i, t += dt) @@ -538,10 +538,10 @@ Standard_Integer FillSubIntervals(const Handle(Adaptor3d_Curve)& theCurve3d, } else { - Standard_Integer KnotCount; + Standard_Integer KnotCount = 0; if(isTrimmed2D) { - Standard_Integer i; + Standard_Integer i = 0; KnotCount = 0; const TColStd_Array1OfReal& aKnots = aBS2DCurv->Knots(); for(i = aBS2DCurv->FirstUKnotIndex(); i <= aBS2DCurv->LastUKnotIndex(); ++i) @@ -566,7 +566,7 @@ Standard_Integer FillSubIntervals(const Handle(Adaptor3d_Curve)& theCurve3d, anArrKnots2D = new TColStd_HArray1OfReal(1, aMaxKnots); anArrKnots2D->SetValue(1, theFirst); anArrKnots2D->SetValue(aMaxKnots, theLast); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real dt = (theLast - theFirst) / (aMaxKnots - 1); Standard_Real t = theFirst + dt; for(i = 2; i < aMaxKnots; ++i, t += dt) diff --git a/src/GeomLib/GeomLib_DenominatorMultiplier.cxx b/src/GeomLib/GeomLib_DenominatorMultiplier.cxx index 4f56a3d549..60472af175 100644 --- a/src/GeomLib/GeomLib_DenominatorMultiplier.cxx +++ b/src/GeomLib/GeomLib_DenominatorMultiplier.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -34,7 +36,7 @@ GeomLib_DenominatorMultiplier::GeomLib_DenominatorMultiplier (const Handle(Geom_BSplineSurface) & Surface, const TColStd_Array1OfReal & KnotVector):mySurface(Surface), myKnotFlatVector(1,KnotVector.Length()) -{Standard_Integer i; +{Standard_Integer i = 0; for (i=1;i<=KnotVector.Length();i++) myKnotFlatVector.SetValue(i,KnotVector(i)); } @@ -47,8 +49,8 @@ GeomLib_DenominatorMultiplier::GeomLib_DenominatorMultiplier Standard_Real GeomLib_DenominatorMultiplier::Value(const Standard_Real UParameter, const Standard_Real VParameter)const -{Standard_Real Dumaxv,Duminv,dDduumaxv,dDduuminv, - Dv,Buv=0.0; +{Standard_Real Dumaxv = NAN,Duminv = NAN,dDduumaxv = NAN,dDduuminv = NAN, + Dv = NAN,Buv=0.0; // gp_Pnt HermPnt; gp_Pnt N; gp_Vec Nu,Nv; @@ -61,7 +63,7 @@ Standard_Real GeomLib_DenominatorMultiplier::Value(const Standard_Real UParamet TColStd_Array1OfReal surface_v_knots(1,mySurface->NbVKnots()) ; TColStd_Array1OfInteger surface_v_mults(1,mySurface->NbVKnots()) ; - Standard_Integer udegree,vdegree; + Standard_Integer udegree = 0,vdegree = 0; mySurface->UKnots(surface_u_knots) ; mySurface->UMultiplicities(surface_u_mults) ; @@ -100,9 +102,9 @@ Standard_Real GeomLib_DenominatorMultiplier::Value(const Standard_Real UParamet Dv); math_Matrix BSplineBasisDeriv(1,2,1,4,0.0); - Standard_Real B1prim0,Bprelastprim1, + Standard_Real B1prim0 = NAN,Bprelastprim1 = NAN, lambda=(mySurface->Weight(1,1)/mySurface->Weight(mySurface->NbUPoles(),1)); - Standard_Integer index,i; + Standard_Integer index = 0,i = 0; BSplCLib::EvalBsplineBasis(1, 4, diff --git a/src/GeomLib/GeomLib_Interpolate.cxx b/src/GeomLib/GeomLib_Interpolate.cxx index 43c2524e98..981a584ae8 100644 --- a/src/GeomLib/GeomLib_Interpolate.cxx +++ b/src/GeomLib/GeomLib_Interpolate.cxx @@ -34,11 +34,11 @@ GeomLib_Interpolate::GeomLib_Interpolate const TColStd_Array1OfReal& ParametersArray) : myIsDone(Standard_False) { - Standard_Integer ii, - num_knots, - inversion_problem, - num_controls, - jj ; + Standard_Integer ii = 0, + num_knots = 0, + inversion_problem = 0, + num_controls = 0, + jj = 0 ; if (NumPoints < Degree || @@ -54,7 +54,7 @@ GeomLib_Interpolate::GeomLib_Interpolate else { gp_Pnt null_point(0.0e0, 0.0e0, 0.0e0) ; Standard_Integer order = Degree + 1, - half_order ; + half_order = 0 ; if (order % 2) { order -= 1 ; } diff --git a/src/GeomLib/GeomLib_IsPlanarSurface.cxx b/src/GeomLib/GeomLib_IsPlanarSurface.cxx index 16ec51a963..61ff6062a0 100644 --- a/src/GeomLib/GeomLib_IsPlanarSurface.cxx +++ b/src/GeomLib/GeomLib_IsPlanarSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,7 +39,7 @@ static Standard_Boolean Controle(const TColgp_Array1OfPnt& Poles, gp_Pln& Plan) { Standard_Boolean IsPlan = Standard_False; - Standard_Real gx,gy,gz; + Standard_Real gx = NAN,gy = NAN,gz = NAN; gp_Pnt Bary; gp_Dir DX, DY; Standard_Real aTolSingular = Precision::Confusion(); @@ -47,7 +49,7 @@ static Standard_Boolean Controle(const TColgp_Array1OfPnt& Poles, if (gz < Tol && gy > aTolSingular) { gp_Pnt P; gp_Vec DU, DV; - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; S->Bounds(umin, umax, vmin, vmax); S->D1((umin + umax) / 2, (vmin + vmax) / 2, P, DU, DV); // On prend DX le plus proche possible de DU @@ -75,7 +77,7 @@ static Standard_Boolean Controle(const Handle(Geom_Curve)& C, const Standard_Real Tol) { Standard_Boolean B = Standard_True; - Standard_Integer ii, Nb; + Standard_Integer ii = 0, Nb = 0; GeomAbs_CurveType Type; GeomAdaptor_Curve AC(C); Type = AC.GetType(); @@ -115,7 +117,7 @@ static Standard_Boolean Controle(const Handle(Geom_Curve)& C, } } - Standard_Real u, du, f, l, d; + Standard_Real u = NAN, du = NAN, f = NAN, l = NAN, d = NAN; f = AC.FirstParameter(); l = AC.LastParameter(); du = (l - f) / (Nb - 1); @@ -161,7 +163,7 @@ GeomLib_IsPlanarSurface::GeomLib_IsPlanarSurface(const Handle(Geom_Surface)& S, gp_Pnt P; gp_Vec DU, DV, Dn; gp_Dir Dir = AS.AxeOfRevolution().Direction(); - Standard_Real Umin, Umax, Vmin, Vmax; + Standard_Real Umin = NAN, Umax = NAN, Vmin = NAN, Vmax = NAN; S->Bounds(Umin, Umax, Vmin, Vmax); S->D1((Umin+Umax)/2, (Vmin+Vmax)/2, P, DU, DV); if (DU.Magnitude() <= gp::Resolution() || @@ -198,8 +200,8 @@ GeomLib_IsPlanarSurface::GeomLib_IsPlanarSurface(const Handle(Geom_Surface)& S, case GeomAbs_SurfaceOfExtrusion : { Standard_Boolean Essai = Standard_False; - Standard_Real Umin, Umax, Vmin, Vmax; - Standard_Real norm; + Standard_Real Umin = NAN, Umax = NAN, Vmin = NAN, Vmax = NAN; + Standard_Real norm = NAN; gp_Vec Du, Dv, Dn; gp_Pnt P; @@ -235,10 +237,10 @@ GeomLib_IsPlanarSurface::GeomLib_IsPlanarSurface(const Handle(Geom_Surface)& S, default : { - Standard_Integer NbU,NbV, ii, jj, kk; + Standard_Integer NbU = 0,NbV = 0, ii = 0, jj = 0, kk = 0; NbU = 8 + 3*AS.NbUIntervals(GeomAbs_CN); NbV = 8 + 3*AS.NbVIntervals(GeomAbs_CN); - Standard_Real Umin, Umax, Vmin, Vmax, du, dv, U, V; + Standard_Real Umin = NAN, Umax = NAN, Vmin = NAN, Vmax = NAN, du = NAN, dv = NAN, U = NAN, V = NAN; S->Bounds(Umin, Umax, Vmin, Vmax); du = (Umax-Umin)/(NbU-1); dv = (Vmax-Vmin)/(NbV-1); diff --git a/src/GeomLib/GeomLib_LogSample.cxx b/src/GeomLib/GeomLib_LogSample.cxx index 747ea227cb..2ec6e75e9d 100644 --- a/src/GeomLib/GeomLib_LogSample.cxx +++ b/src/GeomLib/GeomLib_LogSample.cxx @@ -15,16 +15,18 @@ // commercial license or contractual agreement. +#include + #include #include GeomLib_LogSample::GeomLib_LogSample(const Standard_Real A, const Standard_Real B, const Standard_Integer N) - :math_FunctionSample(A, B, N) + :math_FunctionSample(A, B, N), myF(A - 1), myexp(Log(B-A)/N) { - myF = A - 1; - myexp = Log(B-A)/N; + + } Standard_Real GeomLib_LogSample::GetParameter(const Standard_Integer Index) const @@ -33,7 +35,7 @@ Standard_Real GeomLib_LogSample::GetParameter(const Standard_Integer Index) cons if ((Index >= aN) || (Index <= 1)) { - Standard_Real aA, aB; + Standard_Real aA = NAN, aB = NAN; Bounds(aA, aB); if (Index == 1) return aA; else if (Index == aN) return aB; diff --git a/src/GeomLib/GeomLib_MakeCurvefromApprox.cxx b/src/GeomLib/GeomLib_MakeCurvefromApprox.cxx index 49aba37513..6557838329 100644 --- a/src/GeomLib/GeomLib_MakeCurvefromApprox.cxx +++ b/src/GeomLib/GeomLib_MakeCurvefromApprox.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -130,7 +132,7 @@ Handle(Geom2d_BSplineCurve) GeomLib_MakeCurvefromApprox::Curve2d Knots = myApprox.Knots()->Array1(); Mults = myApprox.Multiplicities()->Array1(); - Standard_Real X,Y,W; + Standard_Real X = NAN,Y = NAN,W = NAN; for ( Standard_Integer i = 1; i <= myApprox.NbPoles(); i++) { W = Weigths(i); Poles(i).Coord(X,Y); @@ -241,7 +243,7 @@ Handle(Geom_BSplineCurve) GeomLib_MakeCurvefromApprox::Curve Knots = myApprox.Knots()->Array1(); Mults = myApprox.Multiplicities()->Array1(); - Standard_Real X,Y,Z,W; + Standard_Real X = NAN,Y = NAN,Z = NAN,W = NAN; for ( Standard_Integer i = 1; i <= myApprox.NbPoles(); i++) { W = Weigths(i); Poles(i).Coord(X,Y,Z); diff --git a/src/GeomLib/GeomLib_Tool.cxx b/src/GeomLib/GeomLib_Tool.cxx index 2c38aed268..735a2cd0f9 100644 --- a/src/GeomLib/GeomLib_Tool.cxx +++ b/src/GeomLib/GeomLib_Tool.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -192,11 +194,11 @@ public: const gp_XY& thePf, const gp_XY& thePl): myCurve(theCurve), - myPRef(thePf) + myIsValid(mySqMod > Precision::SquarePConfusion()), myPRef(thePf) { myDirRef = thePl - thePf; mySqMod = myDirRef.SquareModulus(); - myIsValid = (mySqMod > Precision::SquarePConfusion()); + } //! Compute additional parameters depending on the argument @@ -231,7 +233,7 @@ public: } //! Returns number of variables - virtual Standard_Integer NbVariables() const Standard_OVERRIDE + Standard_Integer NbVariables() const Standard_OVERRIDE { return 1; } @@ -265,18 +267,18 @@ public: } //! Returns value of *this (square deviation) - virtual Standard_Boolean Value(const math_Vector& thePrm, + Standard_Boolean Value(const math_Vector& thePrm, Standard_Real& theVal) Standard_OVERRIDE { - Standard_Real aD1; - Standard_Real aD2; + Standard_Real aD1 = NAN; + Standard_Real aD2 = NAN; ValueAndDerives(thePrm.Value(thePrm.Lower()), theVal, aD1, aD2); theVal = -theVal; return Standard_True; } //! Always returns 0. It is used for compatibility with the parent class. - virtual Standard_Integer GetStateNumber() Standard_OVERRIDE + Standard_Integer GetStateNumber() Standard_OVERRIDE { return 0; } @@ -350,7 +352,7 @@ Standard_Real GeomLib_Tool::ComputeDeviation(const Geom2dAdaptor_Curve& theCurve Standard_Real aD2 = 0.0; Standard_Real aU0 = theStartParameter; Standard_Real aUmax = theStartParameter; - Standard_Real aSqDefl; + Standard_Real aSqDefl = NAN; aFunc.ValueAndDerives(aU0, aSqDefl, aD1, aD2); for (Standard_Integer anItr = 1; anItr <= theNbIters; anItr++) { diff --git a/src/GeomPlate/GeomPlate_Aij.cxx b/src/GeomPlate/GeomPlate_Aij.cxx index 74540004c3..a7273b2cb4 100644 --- a/src/GeomPlate/GeomPlate_Aij.cxx +++ b/src/GeomPlate/GeomPlate_Aij.cxx @@ -27,9 +27,9 @@ GeomPlate_Aij::GeomPlate_Aij() GeomPlate_Aij::GeomPlate_Aij( const Standard_Integer anInd1, const Standard_Integer anInd2, - const gp_Vec& aVec ) + const gp_Vec& aVec ) : Ind1(anInd1), Ind2(anInd2), Vec(aVec) { - Ind1 = anInd1; - Ind2 = anInd2; - Vec = aVec; + + + } diff --git a/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx b/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx index 557906d138..a6360e6dc8 100644 --- a/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx +++ b/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx @@ -22,6 +22,8 @@ // by: Joelle CHAUVET // correction sur le tri des valeurs propres quand valeurs egales +#include + #include #include #include @@ -72,7 +74,7 @@ myNbBoundPoints(NbBoundPoints) gp_Ax3 triedre(myG,NDir,UDir); myPlane = new Geom_Plane(triedre); } - Standard_Integer i,nb=myPts->Length(); + Standard_Integer i = 0,nb=myPts->Length(); gp_Pln P=myPlane->Pln(); ElSLib::Parameters(P,myG,myUmax,myVmax); myUmin=myUmax; @@ -96,7 +98,7 @@ GeomPlate_BuildAveragePlane::GeomPlate_BuildAveragePlane( const TColgp_SequenceO const Handle( TColgp_HArray1OfPnt )& Pts ) : myPts(Pts) { - Standard_Integer i, j, k, n, m; + Standard_Integer i = 0, j = 0, k = 0, n = 0, m = 0; gp_Vec BestVec; Standard_Integer NN = Normals.Length(); @@ -198,7 +200,7 @@ myPts(Pts) //Making the plane myPlane gp_Ax2 Axe; - Standard_Boolean IsSingular; + Standard_Boolean IsSingular = 0; TColgp_Array1OfPnt PtsArray( 1, myPts->Length() ); for (i = 1; i <= myPts->Length(); i++) PtsArray(i) = myPts->Value(i); @@ -215,7 +217,7 @@ myPts(Pts) ElSLib::Parameters( Pln, Axe.Location(), myUmax, myVmax ); myUmin = myUmax; myVmin = myVmax; - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; for (i = 1; i <= myPts->Length(); i++) { gp_Vec aVec( Pln.Location(), myPts->Value(i) ); @@ -278,7 +280,7 @@ gp_Vec GeomPlate_BuildAveragePlane::DefPlan(const Standard_Integer NOption) gp_Pnt GB; gp_Vec A,B,C,D; gp_Vec OZ; - Standard_Integer i,nb=myPts->Length(); + Standard_Integer i = 0,nb=myPts->Length(); GB.SetCoord(0.,0.,0.); for (i=1; i<=nb; i++) { GB.SetCoord(1,(GB.Coord(1)+myPts->Value(i).Coord(1))); @@ -291,7 +293,7 @@ gp_Vec GeomPlate_BuildAveragePlane::DefPlan(const Standard_Integer NOption) if (NOption==1) { gp_Ax2 Axe; - Standard_Boolean IsSingular; + Standard_Boolean IsSingular = 0; GeomLib::AxeOfInertia( myPts->Array1(), Axe, IsSingular, myTol ); myOX = Axe.XDirection(); @@ -353,8 +355,8 @@ void GeomPlate_BuildAveragePlane::BasePlan(const gp_Vec& OZ) math_Matrix M (1, 3, 1, 3); M.Init(0.); gp_Vec Proj; - Standard_Integer i,nb=myPts->Length(); - Standard_Real scal; + Standard_Integer i = 0,nb=myPts->Length(); + Standard_Real scal = NAN; for (i=1; i<=nb; i++) { Proj.SetCoord(1,myPts->Value(i).Coord(1) - myG.Coord(1)); @@ -380,14 +382,14 @@ void GeomPlate_BuildAveragePlane::BasePlan(const gp_Vec& OZ) M(3,1) = M(1,3) ; M(3,2) = M(2,3) ; math_Jacobi J(M); - Standard_Real n1,n2,n3; + Standard_Real n1 = NAN,n2 = NAN,n3 = NAN; math_Vector V1(1,3),V2(1,3),V3(1,3); n1=J.Value(1); n2=J.Value(2); n3=J.Value(3); - Standard_Real r1 = Min(Min(n1,n2),n3), r2; - Standard_Integer m1, m2, m3; + Standard_Real r1 = Min(Min(n1,n2),n3), r2 = NAN; + Standard_Integer m1 = 0, m2 = 0, m3 = 0; if (r1==n1) { m1 = 1; r2 = Min(n2,n3); @@ -501,7 +503,7 @@ Standard_Boolean GeomPlate_BuildAveragePlane::HalfSpace( const TColgp_SequenceOf gp_Vec Cross, NullVec( 0, 0, 0 ); GeomPlate_SequenceOfAij B1set, B2set; - Standard_Integer i, j, k; + Standard_Integer i = 0, j = 0, k = 0; i = 1; if (Normals.IsEmpty()) @@ -527,7 +529,7 @@ Standard_Boolean GeomPlate_BuildAveragePlane::HalfSpace( const TColgp_SequenceOf for (; i <= NewNormals.Length(); i++) { // 3 - Standard_Real Scal; + Standard_Real Scal = NAN; for (j = 1; j <= Bset.Length(); j++) if ((Scal = Bset(j).Vec * NewNormals(i)) >= -LinTol) B2set.Append( Bset(j) ); diff --git a/src/GeomPlate/GeomPlate_BuildAveragePlane.hxx b/src/GeomPlate/GeomPlate_BuildAveragePlane.hxx index 0a27e51848..d0518ab4fc 100644 --- a/src/GeomPlate/GeomPlate_BuildAveragePlane.hxx +++ b/src/GeomPlate/GeomPlate_BuildAveragePlane.hxx @@ -101,12 +101,12 @@ private: Standard_Real myVmin; Standard_Real myUmin; Handle(Geom_Plane) myPlane; - Standard_Real myTol; + Standard_Real myTol{}; Handle(Geom_Line) myLine; gp_Vec myOX; gp_Vec myOY; gp_Pnt myG; - Standard_Integer myNbBoundPoints; + Standard_Integer myNbBoundPoints{}; }; diff --git a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx index 9f018a8a4d..b6082419c0 100644 --- a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx +++ b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx @@ -64,6 +64,7 @@ #include #include +#include #include #ifdef DRAW @@ -108,18 +109,18 @@ GeomPlate_BuildPlateSurface::GeomPlate_BuildPlateSurface ( const Standard_Real , const Standard_Boolean Anisotropie ) : -myAnisotropie(Anisotropie), +myLinCont(new GeomPlate_HSequenceOfCurveConstraint), myPntCont(new GeomPlate_HSequenceOfPointConstraint), myAnisotropie(Anisotropie), myDegree(Degree), -myNbIter(NbIter), +myNbPtsOnCur(0), myNbIter(NbIter), myProj(), myTol2d(Tol2d), myTol3d(Tol3d), myTolAng(TolAng), myNbBounds(0) { Standard_Integer NTCurve=TabCurve->Length();// Number of linear constraints - myNbPtsOnCur = 0; // Different calculation of the number of points depending on the length - myLinCont = new GeomPlate_HSequenceOfCurveConstraint; - myPntCont = new GeomPlate_HSequenceOfPointConstraint; + // Different calculation of the number of points depending on the length + + if (myNbIter<1) throw Standard_ConstructionError("GeomPlate : Number of iteration must be >= 1"); @@ -128,7 +129,7 @@ myNbBounds(0) if (Tang->Length()==0) throw Standard_ConstructionError("GeomPlate : the constraints Array is null"); Standard_Integer nbp = 0; - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i=1;i<=NTCurve;i++) { nbp+=NPoints->Value(i); } @@ -262,7 +263,7 @@ Handle(Geom2d_Curve) GeomPlate_BuildPlateSurface::ProjectCurve(const Handle(Ada Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve (hsur, Curv, myTol3d/10, myTol3d/10); - Standard_Real UdebCheck, UfinCheck, ProjUdeb, ProjUfin; + Standard_Real UdebCheck = NAN, UfinCheck = NAN, ProjUdeb = NAN, ProjUfin = NAN; UdebCheck = Curv->FirstParameter(); UfinCheck = Curv->LastParameter(); HProjector->Bounds( 1, ProjUdeb, ProjUfin ); @@ -288,8 +289,8 @@ Handle(Geom2d_Curve) GeomPlate_BuildPlateSurface::ProjectCurve(const Handle(Ada } else { GeomAbs_Shape Continuity = GeomAbs_C1; - Standard_Integer MaxDegree = 10, MaxSeg; - Standard_Real Udeb, Ufin; + Standard_Integer MaxDegree = 10, MaxSeg = 0; + Standard_Real Udeb = NAN, Ufin = NAN; HProjector->Bounds(1, Udeb, Ufin); MaxSeg = 20 + HProjector->NbIntervals(GeomAbs_C3); @@ -326,7 +327,7 @@ Handle(Adaptor2d_Curve2d) GeomPlate_BuildPlateSurface::ProjectedCurve( Handle(A } else { - Standard_Real First1,Last1,First2,Last2; + Standard_Real First1 = NAN,Last1 = NAN,First2 = NAN,Last2 = NAN; First1=Curv->FirstParameter(); Last1 =Curv->LastParameter(); HProjector->Bounds(1,First2,Last2); @@ -369,7 +370,7 @@ gp_Pnt2d GeomPlate_BuildPlateSurface::ProjectPoint(const gp_Pnt &p3d) } } P=myProj.Point(nearest); - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; P.Parameter(u,v); gp_Pnt2d p2d; p2d.SetCoord(u,v); @@ -500,7 +501,7 @@ void GeomPlate_BuildPlateSurface::Perform(const Message_ProgressRange& theProgre return; } - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; mySurfInit->Bounds(u1,v1,u2,v2); GeomAdaptor_Surface aSurfInit(mySurfInit); myTolU = aSurfInit.UResolution(myTol3d); @@ -659,7 +660,7 @@ void GeomPlate_BuildPlateSurface::Perform(const Message_ProgressRange& theProgre } myGeomPlateSurface = new GeomPlate_Surface(mySurfInit,myPlate); - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; myPlate.UVBox(Umin,Umax,Vmin,Vmax); myGeomPlateSurface->SetBounds(Umin,Umax,Vmin,Vmax); @@ -673,7 +674,7 @@ void GeomPlate_BuildPlateSurface::Perform(const Message_ProgressRange& theProgre } if ((NTPntCont != 0)&&(Fini)) - { Standard_Real di,an,cu; + { Standard_Real di = NAN,an = NAN,cu = NAN; VerifPoints(di,an,cu); } } @@ -698,11 +699,11 @@ void GeomPlate_BuildPlateSurface::Perform(const Message_ProgressRange& theProgre } myGeomPlateSurface = new GeomPlate_Surface(mySurfInit,myPlate); - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; myPlate.UVBox(Umin,Umax,Vmin,Vmax); myGeomPlateSurface->SetBounds(Umin,Umax,Vmin,Vmax); Fini = Standard_True; - Standard_Real di,an,cu; + Standard_Real di = NAN,an = NAN,cu = NAN; VerifPoints(di,an,cu); } } while (!Fini); // End loop for better surface @@ -734,14 +735,14 @@ EcartContraintesMil ( const Standard_Integer c, Handle(TColStd_HArray1OfReal)& courb) { Standard_Integer NbPt=myParCont->Value(c).Length(); - Standard_Real U; + Standard_Real U = NAN; if (NbPt<3) NbPt=4; else NbPt=myParCont->Value(c).Length(); gp_Vec v1i, v1f, v2i, v2f, v3i, v3f; gp_Pnt Pi, Pf; - gp_Pnt2d P2d;Standard_Integer i; + gp_Pnt2d P2d;Standard_Integer i = 0; Handle(GeomPlate_CurveConstraint) LinCont = myLinCont->Value(c); switch (LinCont->Order()) { case 0 : @@ -836,8 +837,8 @@ void GeomPlate_BuildPlateSurface:: gp_Pnt2d P2d; gp_XY UV; gp_Pnt PP; - Standard_Real u1,v1,u2,v2; - Standard_Integer i ; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; + Standard_Integer i = 0 ; mySurfInit->Bounds(u1,v1,u2,v2); GeomAdaptor_Surface Surf(mySurfInit); @@ -969,7 +970,7 @@ Disc3dContour (const Standard_Integer /*nbp*/, // initialization Seq3d.Clear(); // sampling in "cosine" + 3 points on each interval - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; mySurfInit->Bounds(u1,v1,u2,v2); GeomAdaptor_Surface Surf(mySurfInit); myProj.Initialize(Surf,u1,v1,u2,v2, @@ -981,7 +982,7 @@ Disc3dContour (const Standard_Integer /*nbp*/, gp_Pnt P3d; gp_Vec v1h,v2h,v3h; gp_XYZ Pos; - Standard_Integer i ; + Standard_Integer i = 0 ; for( i=1; i<=NTPntCont; i++) if (myPntCont->Value(i)->Order()!=-1) @@ -1253,10 +1254,10 @@ Handle(GeomPlate_PointConstraint) GeomPlate_BuildPlateSurface::PointConstraint( Standard_Boolean GeomPlate_BuildPlateSurface:: CourbeJointive(const Standard_Real tolerance) { Standard_Integer nbf = myLinCont->Length(); - Standard_Real Ufinal1,Uinit1,Ufinal2,Uinit2; + Standard_Real Ufinal1 = NAN,Uinit1 = NAN,Ufinal2 = NAN,Uinit2 = NAN; mySense = new TColStd_HArray1OfInteger(1,nbf,0); Standard_Boolean result=Standard_True; - Standard_Integer j=1,i; + Standard_Integer j=1,i = 0; gp_Pnt P1,P2; while (j <= (myNbBounds-1)) @@ -1374,9 +1375,9 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t Handle( TColgp_HArray1OfPnt ) Pts = new TColgp_HArray1OfPnt( 1, (NbPoint+1)*NTLinCont+NTPntCont ); TColgp_SequenceOfVec Vecs, NewVecs; GeomPlate_SequenceOfAij Aset; - Standard_Real Uinit, Ufinal, Uif; + Standard_Real Uinit = NAN, Ufinal = NAN, Uif = NAN; gp_Vec LastVec; - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = 1; i <= NTLinCont; i++) { Standard_Integer Order = myLinCont->Value(i)->Order(); @@ -1417,7 +1418,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t if (ToReverse) Normal.Reverse(); Standard_Boolean isNew = Standard_True; - Standard_Integer k ; + Standard_Integer k = 0 ; for ( k = 1; k <= Vecs.Length(); k++) if (Vecs(k).IsEqual( Normal, LinTol, AngTol )) { @@ -1496,7 +1497,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t } } GeomPlate_BuildAveragePlane BAP( Vecs, Pts ); - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; BAP.MinMaxBox(u1,u2,v1,v2); // The space is greater for projections Standard_Real du = u2 - u1; @@ -1533,7 +1534,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t Standard_Real LenT=0; Standard_Integer Npt=0; Standard_Integer NTPoint=20*NTLinCont; - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i=1;i<=NTLinCont;i++) LenT+=myLinCont->Value(i)->Length(); for (i=1;i<=NTLinCont;i++) @@ -1547,7 +1548,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t // Table containing a cloud of points for calculation of the plane Handle(TColgp_HArray1OfPnt) Pts = new TColgp_HArray1OfPnt(1,20*NTLinCont+NTPntCont); Standard_Integer NbPoint=20; - Standard_Real Uinit,Ufinal, Uif; + Standard_Real Uinit = NAN,Ufinal = NAN, Uif = NAN; for ( i=1;i<=NTLinCont;i++) { Uinit=myLinCont->Value(i)->FirstParameter(); Ufinal=myLinCont->Value(i)->LastParameter(); @@ -1581,7 +1582,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t return; } - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; BAP.MinMaxBox(u1,u2,v1,v2); // The space is greater for projections Standard_Real du = u2 - u1; @@ -1657,7 +1658,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t DrawTrSurf::Set(name, mySurfInit); } #endif - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; mySurfInit->Bounds(u1,v1,u2,v2); GeomAdaptor_Surface Surf(mySurfInit); myTolU = Surf.UResolution(myTol3d); @@ -1668,7 +1669,7 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t //====================================================================== // Projection of curves //====================================================================== - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= NTLinCont; i++) if (myLinCont->Value(i)->Curve2dOnSurf().IsNull()) myLinCont->ChangeValue(i)->SetCurve2dOnSurf(ProjectCurve(myLinCont->Value(i)->Curve3d())); @@ -1840,9 +1841,9 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, ||(Abs(ant)>myTol3d/1000)) // Non-compatible ==> remove zone in constraint G1 // corresponding to 3D tolerance of 0.01 - { Standard_Real coin; + { Standard_Real coin = NAN; Standard_Real Tol= 100 * myTol3d; - Standard_Real A1; + Standard_Real A1 = NAN; gp_Pnt2d P1temp,P2temp; gp_Vec2d V1,V2; myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1temp, V1); @@ -1894,9 +1895,9 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, { // Non-compatible ==> one removes zone in constraint G0 and G1 // corresponding to 3D tolerance of 0.01 - Standard_Real coin; + Standard_Real coin = NAN; Standard_Real Tol= 100 * myTol3d; - Standard_Real A1; + Standard_Real A1 = NAN; gp_Pnt2d P1temp,P2temp; gp_Vec2d V1,V2; myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1temp, V1); @@ -1946,7 +1947,7 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, // the point on curve j is preserved. // The length of interval is 2D length // corresponding to the distance of points in 3D to myTol3d - Standard_Real tolint, Dist; + Standard_Real tolint = NAN, Dist = NAN; Dist = P1.Distance(P2); tolint = Ci.Resolution(Dist); PntInter->ChangeValue(i).Append( int2d.ParamOnFirst() - tolint); @@ -1995,7 +1996,7 @@ Discretise(const Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, const Handle(GeomPlate_HArray1OfSequenceOfReal)& PntG1G1) { Standard_Integer NTLinCont = myLinCont->Length(); - Standard_Boolean ACR; + Standard_Boolean ACR = 0; Handle(Geom2d_Curve) C2d; Geom2dAdaptor_Curve AC2d; // Handle(Adaptor_HCurve2d) HC2d; @@ -2007,9 +2008,9 @@ Discretise(const Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, //=========================================================================== // Construction of the table containing parameters of constraint points //=========================================================================== - Standard_Real Uinit, Ufinal, Length2d=0, Inter; - Standard_Real CurLength; - Standard_Integer NbPnt_i, NbPtInter, NbPtG1G1; + Standard_Real Uinit = NAN, Ufinal = NAN, Length2d=0, Inter = NAN; + Standard_Real CurLength = NAN; + Standard_Integer NbPnt_i = 0, NbPtInter = 0, NbPtG1G1 = 0; Handle(GeomPlate_CurveConstraint) LinCont; for (Standard_Integer i=1;i<=NTLinCont;i++) { @@ -2025,8 +2026,8 @@ Discretise(const Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, // Construct a law close to curvilinear abscissa if(!C2d.IsNull()) AC2d.Load(C2d); // AC2d.Load(LinCont->Curve2dOnSurf()); - Standard_Integer ii, Nbint = 20; - Standard_Real U; + Standard_Integer ii = 0, Nbint = 20; + Standard_Real U = NAN; TColgp_Array1OfPnt2d tabP2d(1, Nbint+1); tabP2d(1).SetY(Uinit); tabP2d(1).SetX(0.); @@ -2192,7 +2193,7 @@ void GeomPlate_BuildPlateSurface::CalculNbPtsInit () Standard_Real LenT=0; Standard_Integer NTLinCont=myLinCont->Length(); Standard_Integer NTPoint=(Standard_Integer )( myNbPtsOnCur*NTLinCont); - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i=1;i<=NTLinCont;i++) LenT+=myLinCont->Value(i)->Length(); @@ -2226,8 +2227,8 @@ void GeomPlate_BuildPlateSurface::LoadCurve(const Standard_Integer NbBoucle, { gp_Pnt P3d,Pdif,PP; gp_Pnt2d P2d; - Standard_Integer NTLinCont=myLinCont->Length(), i, j; - Standard_Integer Tang, Nt; + Standard_Integer NTLinCont=myLinCont->Length(), i = 0, j = 0; + Standard_Integer Tang = 0, Nt = 0; for (i=1; i<=NTLinCont; i++){ @@ -2330,7 +2331,7 @@ void GeomPlate_BuildPlateSurface::LoadPoint(const Standard_Integer , gp_Pnt P3d,Pdif,PP; gp_Pnt2d P2d; Standard_Integer NTPntCont=myPntCont->Length(); - Standard_Integer Tang, i; + Standard_Integer Tang = 0, i = 0; // gp_Vec V1,V2,V3,V4,V5,V6,V7,V8,V9,V10; // Loading of points of point constraints @@ -2428,13 +2429,13 @@ VerifSurface(const Standard_Integer NbBoucle) myG1Error=tang->Value(j); if (tcourb->Value(j)>myG2Error) myG2Error=tcourb->Value(j); - Standard_Real U; + Standard_Real U = NAN; if (myParCont->Value(i).Length()>3) U=(myParCont->Value(i).Value(j)+myParCont->Value(i).Value(j+1))/2; else U=LinCont->FirstParameter()+ ( LinCont->LastParameter()-LinCont->FirstParameter())*(j-1)/(NbPts_i-2); - Standard_Real diffDist=tdist->Value(j)-LinCont->G0Criterion(U),diffAng; + Standard_Real diffDist=tdist->Value(j)-LinCont->G0Criterion(U),diffAng = NAN; if (LinCont->Order()>0) diffAng=tang->Value(j)-LinCont->G1Criterion(U); else diffAng=0; @@ -2492,7 +2493,7 @@ VerifSurface(const Standard_Integer NbBoucle) } if (NdiffDist>0) {// at least one point is not acceptable in G0 - Standard_Real Coef; + Standard_Real Coef = NAN; if(LinCont->Order()== 0) Coef = 0.6*Log(diffDistMax+7.4); //7.4 corresponds to the calculation of min. coefficient = 1.2 is e^1.2/0.6 diff --git a/src/GeomPlate/GeomPlate_BuildPlateSurface.hxx b/src/GeomPlate/GeomPlate_BuildPlateSurface.hxx index db8e144d76..5eb12a9b65 100644 --- a/src/GeomPlate/GeomPlate_BuildPlateSurface.hxx +++ b/src/GeomPlate/GeomPlate_BuildPlateSurface.hxx @@ -246,9 +246,9 @@ private: Handle(TColStd_HArray1OfInteger) mySense; Standard_Integer myDegree; Handle(TColStd_HArray1OfInteger) myInitOrder; - Standard_Real myG0Error; - Standard_Real myG1Error; - Standard_Real myG2Error; + Standard_Real myG0Error{}; + Standard_Real myG1Error{}; + Standard_Real myG2Error{}; Standard_Integer myNbPtsOnCur; Standard_Boolean mySurfInitIsGive; Standard_Integer myNbIter; @@ -256,8 +256,8 @@ private: Standard_Real myTol2d; Standard_Real myTol3d; Standard_Real myTolAng; - Standard_Real myTolU; - Standard_Real myTolV; + Standard_Real myTolU{}; + Standard_Real myTolV{}; Standard_Integer myNbBounds; Standard_Boolean myIsLinear; Standard_Boolean myFree; diff --git a/src/GeomPlate/GeomPlate_CurveConstraint.cxx b/src/GeomPlate/GeomPlate_CurveConstraint.cxx index d3a0cbbf29..29b9d323df 100644 --- a/src/GeomPlate/GeomPlate_CurveConstraint.cxx +++ b/src/GeomPlate/GeomPlate_CurveConstraint.cxx @@ -63,12 +63,12 @@ GeomPlate_CurveConstraint :: GeomPlate_CurveConstraint (const Handle(Adaptor3d_C const Standard_Real TolAng, const Standard_Real TolCurv ) : -myLProp(2,TolDist), +myOrder(Tang), myLProp(2,TolDist), myTolDist(TolDist), myTolAng(TolAng), myTolCurv(TolCurv) { - myOrder=Tang; + if ((Tang<-1)||(Tang>2)) throw Standard_Failure("GeomPlate : The continuity is not G0 G1 or G2"); myNbPoints=NPt; diff --git a/src/GeomPlate/GeomPlate_CurveConstraint.hxx b/src/GeomPlate/GeomPlate_CurveConstraint.hxx index 81d6f2e72d..b81cecf513 100644 --- a/src/GeomPlate/GeomPlate_CurveConstraint.hxx +++ b/src/GeomPlate/GeomPlate_CurveConstraint.hxx @@ -149,7 +149,7 @@ protected: Standard_Integer myNbPoints; Standard_Integer myOrder; Handle(Adaptor3d_Curve) my3dCurve; - Standard_Integer myTang; + Standard_Integer myTang{}; Handle(Geom2d_Curve) my2dCurve; Handle(Adaptor2d_Curve2d) myHCurve2d; Handle(Law_Function) myG0Crit; diff --git a/src/GeomPlate/GeomPlate_MakeApprox.cxx b/src/GeomPlate/GeomPlate_MakeApprox.cxx index 5de1d888b9..8e97c9806d 100644 --- a/src/GeomPlate/GeomPlate_MakeApprox.cxx +++ b/src/GeomPlate/GeomPlate_MakeApprox.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -41,7 +43,7 @@ public: GeomPlate_MakeApprox_Eval (const Handle(Geom_Surface)& theSurf) : mySurf (theSurf) {} - virtual void Evaluate (Standard_Integer* theDimension, + void Evaluate (Standard_Integer* theDimension, Standard_Real* theUStartEnd, Standard_Real* theVStartEnd, Standard_Integer* theFavorIso, @@ -51,7 +53,7 @@ public: Standard_Integer* theUOrder, Standard_Integer* theVOrder, Standard_Real* theResult, - Standard_Integer* theErrorCode) const; + Standard_Integer* theErrorCode) const override; private: @@ -83,8 +85,8 @@ void GeomPlate_MakeApprox_Eval::Evaluate (Standard_Integer * Dimension, // Error Code { *ErrorCode = 0; - Standard_Integer idim,jpar; - Standard_Real Upar,Vpar; + Standard_Integer idim = 0,jpar = 0; + Standard_Real Upar = NAN,Vpar = NAN; // Dimension incorrecte if (*Dimension!=3) { @@ -247,9 +249,9 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf const Standard_Integer Nbmax, const Standard_Integer dgmax, const GeomAbs_Shape Continuity, - const Standard_Real EnlargeCoeff) + const Standard_Real EnlargeCoeff) : myPlate(SurfPlate) { - myPlate = SurfPlate; + Standard_Real U0=0., U1=0., V0=0., V1=0.; myPlate->RealBounds(U0, U1, V0, V1); @@ -311,9 +313,9 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf const Standard_Real dmax, const Standard_Integer CritOrder, const GeomAbs_Shape Continuity, - const Standard_Real EnlargeCoeff) + const Standard_Real EnlargeCoeff) : myPlate(SurfPlate) { - myPlate = SurfPlate; + TColgp_SequenceOfXY Seq2d; TColgp_SequenceOfXYZ Seq3d; @@ -324,7 +326,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf myPlate->Constraints(Seq2d); // contraintes 3d correspondantes sur plate - Standard_Integer i,nbp=Seq2d.Length(); + Standard_Integer i = 0,nbp=Seq2d.Length(); for(i=1;i<=nbp;i++){ gp_XY P2d=Seq2d.Value(i); gp_Pnt PP; diff --git a/src/GeomPlate/GeomPlate_PlateG0Criterion.cxx b/src/GeomPlate/GeomPlate_PlateG0Criterion.cxx index d7f8a1bc23..188c4ca9d8 100644 --- a/src/GeomPlate/GeomPlate_PlateG0Criterion.cxx +++ b/src/GeomPlate/GeomPlate_PlateG0Criterion.cxx @@ -20,6 +20,8 @@ // Value (Appel a des distances remplace par le calcul // de la distance au carre) +#include + #include #include #include @@ -39,10 +41,10 @@ GeomPlate_PlateG0Criterion(const TColgp_SequenceOfXY& Data, const TColgp_SequenceOfXYZ& G0Data, const Standard_Real Maximum, const AdvApp2Var_CriterionType Type, - const AdvApp2Var_CriterionRepartition Repart) + const AdvApp2Var_CriterionRepartition Repart) : myData(Data), myXYZ(G0Data) { - myData=Data; - myXYZ=G0Data; + + myMaxValue = Maximum; myType = Type; myRepartition = Repart; @@ -71,7 +73,7 @@ void GeomPlate_PlateG0Criterion::Value(AdvApp2Var_Patch& P, VInt[0] = P.V0(); VInt[1] = P.V1(); - Standard_Real up,vp, dist = 0.; + Standard_Real up = NAN,vp = NAN, dist = 0.; Standard_Integer dimension = 3 * NbCoeff[1]; TColStd_Array1OfReal Patch(1, NbCoeff[0] * dimension); @@ -80,7 +82,7 @@ void GeomPlate_PlateG0Criterion::Value(AdvApp2Var_Patch& P, Standard_Real * Coeffs = (Standard_Real *) &Patch.ChangeValue(1); Standard_Real * Digit = (Standard_Real *) &Point.ChangeValue(1); - Standard_Integer k1, k2, pos, ll=1; + Standard_Integer k1 = 0, k2 = 0, pos = 0, ll=1; for (k1 = 1; k1 <= NbCoeff[0]; k1++) { // JAG 99.04.29 pos = 3*(MaxNbCoeff[0])*(k1-1); pos = 3*(MaxNbCoeff[1])*(k1-1); @@ -92,7 +94,7 @@ void GeomPlate_PlateG0Criterion::Value(AdvApp2Var_Patch& P, } } - Standard_Integer i, NbCtr = myData.Length(); + Standard_Integer i = 0, NbCtr = myData.Length(); for(i=1; i<=NbCtr; i++) { gp_XY P2d = myData.Value(i); // gp_Pnt PP = myXYZ.Value(i); diff --git a/src/GeomPlate/GeomPlate_PlateG1Criterion.cxx b/src/GeomPlate/GeomPlate_PlateG1Criterion.cxx index 324b068e64..9897074d00 100644 --- a/src/GeomPlate/GeomPlate_PlateG1Criterion.cxx +++ b/src/GeomPlate/GeomPlate_PlateG1Criterion.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -35,10 +37,10 @@ GeomPlate_PlateG1Criterion(const TColgp_SequenceOfXY& Data, const TColgp_SequenceOfXYZ& G1Data, const Standard_Real Maximum, const AdvApp2Var_CriterionType Type, - const AdvApp2Var_CriterionRepartition Repart) + const AdvApp2Var_CriterionRepartition Repart) : myData(Data), myXYZ(G1Data) { - myData=Data; - myXYZ=G1Data; + + myMaxValue = Maximum; myType = Type; myRepartition = Repart; @@ -67,7 +69,7 @@ void GeomPlate_PlateG1Criterion::Value(AdvApp2Var_Patch& P, VInt[0] = P.V0(); VInt[1] = P.V1(); - Standard_Real up,vp, ang = 0.; + Standard_Real up = NAN,vp = NAN, ang = 0.; Standard_Integer dimension = 3 * NbCoeff[1]; TColStd_Array1OfReal Patch(1, NbCoeff[0] * dimension); @@ -76,7 +78,7 @@ void GeomPlate_PlateG1Criterion::Value(AdvApp2Var_Patch& P, Standard_Real * Coeffs = (Standard_Real *) &Patch.ChangeValue(1); Standard_Real * Digit = (Standard_Real *) &Point.ChangeValue(1); - Standard_Integer k1, k2, pos, ll=1; + Standard_Integer k1 = 0, k2 = 0, pos = 0, ll=1; for (k1 = 1; k1 <= NbCoeff[0]; k1++) { // JAG 99.04.29 pos = 3*(MaxNbCoeff[0])*(k1-1); pos = 3*(MaxNbCoeff[1])*(k1-1); @@ -88,7 +90,7 @@ void GeomPlate_PlateG1Criterion::Value(AdvApp2Var_Patch& P, } } - Standard_Integer i, NbCtr = myData.Length(); + Standard_Integer i = 0, NbCtr = myData.Length(); for(i=1; i<=NbCtr; i++) { gp_Vec v1s,v2s,v3s; gp_Vec v3h(myXYZ.Value(i).X(),myXYZ.Value(i).Y(),myXYZ.Value(i).Z()); diff --git a/src/GeomProjLib/GeomProjLib.cxx b/src/GeomProjLib/GeomProjLib.cxx index 06ebc0ccb1..32e28ce5b3 100644 --- a/src/GeomProjLib/GeomProjLib.cxx +++ b/src/GeomProjLib/GeomProjLib.cxx @@ -47,6 +47,7 @@ #include #include +#include #include #ifdef DRAW #include @@ -170,10 +171,10 @@ Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S, Standard_Real& Tolerance) { - Standard_Real UFirst, - ULast, - VFirst, - VLast ; + Standard_Real UFirst = NAN, + ULast = NAN, + VFirst = NAN, + VLast = NAN ; S->Bounds(UFirst, ULast, @@ -330,7 +331,7 @@ Handle(Geom_Curve) GeomProjLib::Project( const Handle(Geom_Curve)& C, Standard_Real TolV = Pow(Tol, 2./3); ProjLib_CompProjectedCurve Proj(HS,HC,TolU,TolV,-1.); - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Proj.Bounds(1,f,l); Handle(Adaptor2d_Curve2d) HC2d = Proj.Trim(f,l,TolU); Approx_CurveOnSurface Approx(HC2d, HS, f, l, Tol); diff --git a/src/GeomToStep/GeomToStep_MakeAxis1Placement.cxx b/src/GeomToStep/GeomToStep_MakeAxis1Placement.cxx index b248f2ae77..1a579c427a 100644 --- a/src/GeomToStep/GeomToStep_MakeAxis1Placement.cxx +++ b/src/GeomToStep/GeomToStep_MakeAxis1Placement.cxx @@ -31,7 +31,7 @@ //============================================================================= // Creation d' un axis1_placement de prostep a partir d' un Ax1 de gp //============================================================================= -GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax1& A) +GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax1& A) : GeomToStep_Root() { #include "GeomToStep_MakeAxis1Placement_gen.pxx" } @@ -39,7 +39,7 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax1& A) // Creation d' un axis1_placement de prostep a partir d' un Ax2d de gp //============================================================================= -GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax2d& A) +GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax2d& A) : GeomToStep_Root() { #include "GeomToStep_MakeAxis1Placement_gen.pxx" } @@ -50,7 +50,7 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax2d& A) //============================================================================= GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement - ( const Handle(Geom_Axis1Placement)& Axis1) + ( const Handle(Geom_Axis1Placement)& Axis1) : GeomToStep_Root() { gp_Ax1 A; A = Axis1->Ax1(); @@ -63,7 +63,7 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement //============================================================================= GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement - ( const Handle(Geom2d_AxisPlacement)& Axis1) + ( const Handle(Geom2d_AxisPlacement)& Axis1) : GeomToStep_Root() { gp_Ax2d A; A = Axis1->Ax2d(); diff --git a/src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cxx b/src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cxx index f988c9fdef..b212338bb9 100644 --- a/src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cxx +++ b/src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cxx @@ -30,7 +30,7 @@ // Creation d' un axis2_placement_2d de prostep a partir d' un Ax2 de gp //============================================================================= GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d -( const gp_Ax2& A) +( const gp_Ax2& A) : GeomToStep_Root() { Handle(StepGeom_Axis2Placement2d) Axe; Handle(StepGeom_CartesianPoint) P; @@ -56,7 +56,7 @@ GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d //============================================================================= GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d -( const gp_Ax22d& A) +( const gp_Ax22d& A) : GeomToStep_Root() { Handle(StepGeom_Axis2Placement2d) Axe; Handle(StepGeom_CartesianPoint) P; diff --git a/src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx b/src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx index f0675809a5..53edb64754 100644 --- a/src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx +++ b/src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx @@ -55,7 +55,7 @@ static Handle(StepGeom_Axis2Placement3d) MakeAxis2Placement3d // Creation d' un axis2_placement_3d a l origine //============================================================================= -GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d ( ) +GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d ( ) : GeomToStep_Root() { gp_Ax2 A (gp_Pnt(0.,0.,0.), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.)); // le reste inchange @@ -71,7 +71,7 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d ( ) //============================================================================= GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d( const gp_Ax2& - A) + A) : GeomToStep_Root() { Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d (A.Location(), A.Direction(), A.XDirection(), ""); @@ -84,7 +84,7 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d( const gp_Ax2& //============================================================================= GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d -( const gp_Ax3& A) +( const gp_Ax3& A) : GeomToStep_Root() { Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d (A.Location(), A.Direction(), A.XDirection(), ""); @@ -97,7 +97,7 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d //============================================================================= GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d - ( const gp_Trsf& T) + ( const gp_Trsf& T) : GeomToStep_Root() { gp_Ax2 A (gp_Pnt(0.,0.,0.), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.)); A.Transform (T); @@ -115,7 +115,7 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d //============================================================================= GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d - ( const Handle(Geom_Axis2Placement)& Axis2) + ( const Handle(Geom_Axis2Placement)& Axis2) : GeomToStep_Root() { gp_Ax2 A; A = Axis2->Ax2(); diff --git a/src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cxx b/src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cxx index 37973471c9..ec5ec14ef6 100644 --- a/src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cxx +++ b/src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cxx @@ -37,7 +37,7 @@ //============================================================================= GeomToStep_MakeBSplineCurveWithKnots:: GeomToStep_MakeBSplineCurveWithKnots( const - Handle(Geom_BSplineCurve)& BS ) + Handle(Geom_BSplineCurve)& BS ) : GeomToStep_Root() { #define Array1OfPnt_gen TColgp_Array1OfPnt @@ -51,7 +51,7 @@ GeomToStep_MakeBSplineCurveWithKnots:: GeomToStep_MakeBSplineCurveWithKnots:: GeomToStep_MakeBSplineCurveWithKnots( const - Handle(Geom2d_BSplineCurve)& BS ) + Handle(Geom2d_BSplineCurve)& BS ) : GeomToStep_Root() { #define Array1OfPnt_gen TColgp_Array1OfPnt2d diff --git a/src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.cxx b/src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.cxx index c04d867bbd..0101879d92 100644 --- a/src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.cxx +++ b/src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.cxx @@ -37,7 +37,7 @@ //============================================================================= GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve:: GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve( const - Handle(Geom_BSplineCurve)& BS ) + Handle(Geom_BSplineCurve)& BS ) : GeomToStep_Root() { #define Array1OfPnt_gen TColgp_Array1OfPnt @@ -51,7 +51,7 @@ GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve:: GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve:: GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve( const - Handle(Geom2d_BSplineCurve)& BS ) + Handle(Geom2d_BSplineCurve)& BS ) : GeomToStep_Root() { #define Array1OfPnt_gen TColgp_Array1OfPnt2d diff --git a/src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cxx b/src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cxx index 02cdc589a3..99672b75ee 100644 --- a/src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cxx +++ b/src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -36,12 +38,12 @@ //============================================================================= GeomToStep_MakeBSplineSurfaceWithKnots:: GeomToStep_MakeBSplineSurfaceWithKnots( const - Handle(Geom_BSplineSurface)& BS ) + Handle(Geom_BSplineSurface)& BS ) : GeomToStep_Root() { Handle(StepGeom_BSplineSurfaceWithKnots) BSWK; - Standard_Integer aUDegree, aVDegree, NU, NV, i, j, NUknots, NVknots, itampon; - Standard_Real rtampon; + Standard_Integer aUDegree = 0, aVDegree = 0, NU = 0, NV = 0, i = 0, j = 0, NUknots = 0, NVknots = 0, itampon = 0; + Standard_Real rtampon = NAN; Handle(StepGeom_CartesianPoint) Pt = new StepGeom_CartesianPoint; Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; StepGeom_BSplineSurfaceForm aSurfaceForm; diff --git a/src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx b/src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx index 1e302f7aa2..c49a29e29a 100644 --- a/src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx @@ -16,6 +16,8 @@ // .cxx +#include + #include #include #include @@ -37,12 +39,12 @@ //============================================================================= GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface:: GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface( const - Handle(Geom_BSplineSurface)& BS ) + Handle(Geom_BSplineSurface)& BS ) : GeomToStep_Root() { Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BSWK; - Standard_Integer aUDegree, aVDegree, NU, NV, i, j, NUknots, NVknots, itampon; - Standard_Real rtampon; + Standard_Integer aUDegree = 0, aVDegree = 0, NU = 0, NV = 0, i = 0, j = 0, NUknots = 0, NVknots = 0, itampon = 0; + Standard_Real rtampon = NAN; Handle(StepGeom_CartesianPoint) Pt = new StepGeom_CartesianPoint; Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; StepGeom_BSplineSurfaceForm aSurfaceForm; diff --git a/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx b/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx index 95f49b50a4..2768515825 100644 --- a/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx +++ b/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx @@ -34,7 +34,7 @@ //============================================================================= // Creation d' une BoundedCurve de prostep a partir d' une BoundedCurve de Geom //============================================================================= -GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_BoundedCurve)& C) +GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_BoundedCurve)& C) : GeomToStep_Root() { done = Standard_True; @@ -81,7 +81,7 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou // Geom2d //============================================================================= -GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_BoundedCurve)& C) +GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_BoundedCurve)& C) : GeomToStep_Root() { done = Standard_True; if (C->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve))) diff --git a/src/GeomToStep/GeomToStep_MakeBoundedSurface.cxx b/src/GeomToStep/GeomToStep_MakeBoundedSurface.cxx index 006b8d0f0e..282597ff0d 100644 --- a/src/GeomToStep/GeomToStep_MakeBoundedSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeBoundedSurface.cxx @@ -35,7 +35,7 @@ // de Geom //============================================================================= GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface - ( const Handle(Geom_BoundedSurface)& S) + ( const Handle(Geom_BoundedSurface)& S) : GeomToStep_Root() { done = Standard_True; if (S->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) { diff --git a/src/GeomToStep/GeomToStep_MakeCartesianPoint.cxx b/src/GeomToStep/GeomToStep_MakeCartesianPoint.cxx index 10f3f949c6..9ed9fdd122 100644 --- a/src/GeomToStep/GeomToStep_MakeCartesianPoint.cxx +++ b/src/GeomToStep/GeomToStep_MakeCartesianPoint.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -29,11 +31,11 @@ //============================================================================= // Creation d' un cartesian_point de prostep a partir d' un point3d de gp //============================================================================= -GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P) +GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P) : GeomToStep_Root() { Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint; // Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,3); - Standard_Real X, Y, Z; + Standard_Real X = NAN, Y = NAN, Z = NAN; P.Coord(X, Y, Z); // Acoord->SetValue(1,X); @@ -51,11 +53,11 @@ GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P) // Creation d' un cartesian_point de prostep a partir d' un point 2d de gp //============================================================================= -GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P) +GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P) : GeomToStep_Root() { Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint; // Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,2); - Standard_Real X, Y; + Standard_Real X = NAN, Y = NAN; P.Coord(X, Y); // Acoord->SetValue(1,X); @@ -73,12 +75,12 @@ GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P) //============================================================================= GeomToStep_MakeCartesianPoint:: - GeomToStep_MakeCartesianPoint( const Handle(Geom_CartesianPoint)& P) + GeomToStep_MakeCartesianPoint( const Handle(Geom_CartesianPoint)& P) : GeomToStep_Root() { Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint; // Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,3); - Standard_Real X, Y, Z; + Standard_Real X = NAN, Y = NAN, Z = NAN; P->Coord(X, Y, Z); // Acoord->SetValue(1,X); @@ -98,12 +100,12 @@ GeomToStep_MakeCartesianPoint:: //============================================================================= GeomToStep_MakeCartesianPoint:: - GeomToStep_MakeCartesianPoint( const Handle(Geom2d_CartesianPoint)& P) + GeomToStep_MakeCartesianPoint( const Handle(Geom2d_CartesianPoint)& P) : GeomToStep_Root() { Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint; // Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,2); - Standard_Real X, Y; + Standard_Real X = NAN, Y = NAN; P->Coord(X, Y); // Acoord->SetValue(1,X); diff --git a/src/GeomToStep/GeomToStep_MakeCircle.cxx b/src/GeomToStep/GeomToStep_MakeCircle.cxx index d76adaf3a2..553476ccd3 100644 --- a/src/GeomToStep/GeomToStep_MakeCircle.cxx +++ b/src/GeomToStep/GeomToStep_MakeCircle.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -32,7 +34,7 @@ //============================================================================= // Creation d' un cercle de prostep a partir d' un cercle 3d de gp //============================================================================= -GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C) +GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C) : GeomToStep_Root() { #include "GeomToStep_MakeCircle_gen.pxx" } @@ -43,7 +45,7 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C) // Geom //============================================================================= -GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer) +GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer) : GeomToStep_Root() { gp_Circ C; C = Cer->Circ(); @@ -56,7 +58,7 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer) // Geom2d //============================================================================= -GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer) +GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer) : GeomToStep_Root() { gp_Circ2d C2d; C2d = Cer->Circ2d(); @@ -64,7 +66,7 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer) Handle(StepGeom_Circle) CStep = new StepGeom_Circle; StepGeom_Axis2Placement Ax2; Handle(StepGeom_Axis2Placement2d) Ax2Step; - Standard_Real Rayon; + Standard_Real Rayon = NAN; GeomToStep_MakeAxis2Placement2d MkAxis2(C2d.Position()); Ax2Step = MkAxis2.Value(); diff --git a/src/GeomToStep/GeomToStep_MakeConic.cxx b/src/GeomToStep/GeomToStep_MakeConic.cxx index 5db9c52b52..7ec98088d7 100644 --- a/src/GeomToStep/GeomToStep_MakeConic.cxx +++ b/src/GeomToStep/GeomToStep_MakeConic.cxx @@ -40,7 +40,7 @@ //============================================================================= // Creation d' une Conic de prostep a partir d' une Conic de Geom //============================================================================= -GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C) +GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C) : GeomToStep_Root() { done = Standard_True; if (C->IsKind(STANDARD_TYPE(Geom_Circle))) { @@ -75,7 +75,7 @@ GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C) // Creation d' une Conic2d de prostep a partir d' une Conic de Geom2d //============================================================================= -GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom2d_Conic)& C) +GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom2d_Conic)& C) : GeomToStep_Root() { done = Standard_True; if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) { diff --git a/src/GeomToStep/GeomToStep_MakeConicalSurface.cxx b/src/GeomToStep/GeomToStep_MakeConicalSurface.cxx index a8c42bffaf..7880c7d97b 100644 --- a/src/GeomToStep/GeomToStep_MakeConicalSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeConicalSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -30,12 +32,12 @@ // de Geom //============================================================================= GeomToStep_MakeConicalSurface::GeomToStep_MakeConicalSurface - ( const Handle(Geom_ConicalSurface)& CS ) + ( const Handle(Geom_ConicalSurface)& CS ) : GeomToStep_Root() { Handle(StepGeom_ConicalSurface) CSstep = new StepGeom_ConicalSurface; Handle(StepGeom_Axis2Placement3d) aPosition; - Standard_Real aRadius, aSemiAngle; + Standard_Real aRadius = NAN, aSemiAngle = NAN; GeomToStep_MakeAxis2Placement3d MkAxis(CS->Position()); aPosition = MkAxis.Value(); diff --git a/src/GeomToStep/GeomToStep_MakeCurve.cxx b/src/GeomToStep/GeomToStep_MakeCurve.cxx index 6dfee4c044..d0e2d3ff4a 100644 --- a/src/GeomToStep/GeomToStep_MakeCurve.cxx +++ b/src/GeomToStep/GeomToStep_MakeCurve.cxx @@ -47,7 +47,7 @@ //============================================================================= // Creation d' une Curve de prostep a partir d' une Curve de Geom //============================================================================= -GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C) +GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C) : GeomToStep_Root() { done = Standard_True; if (C->IsKind(STANDARD_TYPE(Geom_Line))) { @@ -98,7 +98,7 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C) // Creation d'une Curve de prostep a partir d' une Curve de Geom2d //============================================================================= -GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C) +GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C) : GeomToStep_Root() { done = Standard_True; if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) { diff --git a/src/GeomToStep/GeomToStep_MakeCylindricalSurface.cxx b/src/GeomToStep/GeomToStep_MakeCylindricalSurface.cxx index 08c4fb0b88..6874d2aa70 100644 --- a/src/GeomToStep/GeomToStep_MakeCylindricalSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeCylindricalSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -29,12 +31,12 @@ // CylindricalSurface de Geom //============================================================================= GeomToStep_MakeCylindricalSurface::GeomToStep_MakeCylindricalSurface - ( const Handle(Geom_CylindricalSurface)& CS ) + ( const Handle(Geom_CylindricalSurface)& CS ) : GeomToStep_Root() { Handle(StepGeom_CylindricalSurface) CSstep; Handle(StepGeom_Axis2Placement3d) aPosition; - Standard_Real aRadius; + Standard_Real aRadius = NAN; GeomToStep_MakeAxis2Placement3d MkAxis2(CS->Position()); aPosition = MkAxis2.Value(); diff --git a/src/GeomToStep/GeomToStep_MakeDirection.cxx b/src/GeomToStep/GeomToStep_MakeDirection.cxx index 8c643ec588..62a4d6bf2b 100644 --- a/src/GeomToStep/GeomToStep_MakeDirection.cxx +++ b/src/GeomToStep/GeomToStep_MakeDirection.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -28,11 +30,11 @@ //============================================================================= // Creation d' une direction de prostep a partir d' une Dir de gp //============================================================================= -GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir& D) +GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir& D) : GeomToStep_Root() { Handle(StepGeom_Direction) Dir = new StepGeom_Direction; Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,3); - Standard_Real X, Y, Z; + Standard_Real X = NAN, Y = NAN, Z = NAN; D.Coord(X, Y, Z); aDirRatios->SetValue(1,X); @@ -47,11 +49,11 @@ GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir& D) // Creation d' une direction de prostep a partir d' une Dir2d de gp //============================================================================= -GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir2d& D) +GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir2d& D) : GeomToStep_Root() { Handle(StepGeom_Direction) Dir = new StepGeom_Direction; Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,2); - Standard_Real X, Y; + Standard_Real X = NAN, Y = NAN; D.Coord(X, Y); aDirRatios->SetValue(1,X); @@ -67,12 +69,12 @@ GeomToStep_MakeDirection::GeomToStep_MakeDirection( const gp_Dir2d& D) //============================================================================= GeomToStep_MakeDirection::GeomToStep_MakeDirection - ( const Handle(Geom_Direction)& Direc) + ( const Handle(Geom_Direction)& Direc) : GeomToStep_Root() { gp_Dir D; Handle(StepGeom_Direction) Dir = new StepGeom_Direction; Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,3); - Standard_Real X, Y, Z; + Standard_Real X = NAN, Y = NAN, Z = NAN; D=Direc->Dir(); D.Coord(X, Y, Z); @@ -90,12 +92,12 @@ GeomToStep_MakeDirection::GeomToStep_MakeDirection //============================================================================= GeomToStep_MakeDirection::GeomToStep_MakeDirection - ( const Handle(Geom2d_Direction)& Direc) + ( const Handle(Geom2d_Direction)& Direc) : GeomToStep_Root() { gp_Dir2d D; Handle(StepGeom_Direction) Dir = new StepGeom_Direction; Handle(TColStd_HArray1OfReal) aDirRatios = new TColStd_HArray1OfReal(1,2); - Standard_Real X, Y; + Standard_Real X = NAN, Y = NAN; D=Direc->Dir2d(); D.Coord(X, Y); diff --git a/src/GeomToStep/GeomToStep_MakeElementarySurface.cxx b/src/GeomToStep/GeomToStep_MakeElementarySurface.cxx index bcfdfb9069..1708cdd161 100644 --- a/src/GeomToStep/GeomToStep_MakeElementarySurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeElementarySurface.cxx @@ -40,7 +40,7 @@ // ElementarySurface de Geom //============================================================================= GeomToStep_MakeElementarySurface::GeomToStep_MakeElementarySurface - ( const Handle(Geom_ElementarySurface)& S) + ( const Handle(Geom_ElementarySurface)& S) : GeomToStep_Root() { done = Standard_True; if (S->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) { diff --git a/src/GeomToStep/GeomToStep_MakeEllipse.cxx b/src/GeomToStep/GeomToStep_MakeEllipse.cxx index 34794facf8..ddbb724ded 100644 --- a/src/GeomToStep/GeomToStep_MakeEllipse.cxx +++ b/src/GeomToStep/GeomToStep_MakeEllipse.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -32,7 +34,7 @@ //============================================================================= // Creation d'une ellipse de prostep a partir d'une ellipse 3d de gp //============================================================================= -GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E) +GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E) : GeomToStep_Root() { #include "GeomToStep_MakeEllipse_gen.pxx" } @@ -43,7 +45,7 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E) // Geom //============================================================================= -GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer) +GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer) : GeomToStep_Root() { gp_Elips E; E = Cer->Elips(); @@ -56,7 +58,7 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer) // Geom2d //============================================================================= -GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Cer) +GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Cer) : GeomToStep_Root() { gp_Elips2d E2d; E2d = Cer->Elips2d(); @@ -64,7 +66,7 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Ce Handle(StepGeom_Ellipse) EStep = new StepGeom_Ellipse; StepGeom_Axis2Placement Ax2; Handle(StepGeom_Axis2Placement2d) Ax2Step; - Standard_Real majorR, minorR; + Standard_Real majorR = NAN, minorR = NAN; GeomToStep_MakeAxis2Placement2d MkAxis2(E2d.Axis()); Ax2Step = MkAxis2.Value(); diff --git a/src/GeomToStep/GeomToStep_MakeHyperbola.cxx b/src/GeomToStep/GeomToStep_MakeHyperbola.cxx index b0247d8a13..925d8d0db9 100644 --- a/src/GeomToStep/GeomToStep_MakeHyperbola.cxx +++ b/src/GeomToStep/GeomToStep_MakeHyperbola.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -30,7 +32,7 @@ // Creation d'une hyperbola de prostep a partir d'une hyperbola de // Geom2d //============================================================================= -GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C) +GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C) : GeomToStep_Root() { gp_Hypr2d gpHyp; gpHyp = C->Hypr2d(); @@ -38,7 +40,7 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola Handle(StepGeom_Hyperbola) HStep = new StepGeom_Hyperbola; StepGeom_Axis2Placement Ax2; Handle(StepGeom_Axis2Placement2d) Ax2Step; - Standard_Real majorR, minorR; + Standard_Real majorR = NAN, minorR = NAN; GeomToStep_MakeAxis2Placement2d MkAxis2(gpHyp.Axis()); Ax2Step = MkAxis2.Value(); @@ -56,7 +58,7 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola // Geom //============================================================================= - GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C) + GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C) : GeomToStep_Root() { gp_Hypr gpHyp; gpHyp = C->Hypr(); @@ -64,7 +66,7 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola Handle(StepGeom_Hyperbola) HStep = new StepGeom_Hyperbola; StepGeom_Axis2Placement Ax2; Handle(StepGeom_Axis2Placement3d) Ax2Step; - Standard_Real majorR, minorR; + Standard_Real majorR = NAN, minorR = NAN; GeomToStep_MakeAxis2Placement3d MkAxis2(gpHyp.Position()); Ax2Step = MkAxis2.Value(); diff --git a/src/GeomToStep/GeomToStep_MakeLine.cxx b/src/GeomToStep/GeomToStep_MakeLine.cxx index f480b372d2..273b77b42c 100644 --- a/src/GeomToStep/GeomToStep_MakeLine.cxx +++ b/src/GeomToStep/GeomToStep_MakeLine.cxx @@ -33,7 +33,7 @@ //============================================================================= // Creation d' une line de prostep a partir d' une Lin de gp //============================================================================= -GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L) +GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L) : GeomToStep_Root() { #define Vec_gen gp_Vec #include "GeomToStep_MakeLine_gen.pxx" @@ -44,7 +44,7 @@ GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L) // Creation d' une line de prostep a partir d' une Lin2d de gp //============================================================================= -GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L) +GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L) : GeomToStep_Root() { #define Vec_gen gp_Vec2d #include "GeomToStep_MakeLine_gen.pxx" @@ -55,7 +55,7 @@ GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L) // Creation d' une line de prostep a partir d' une Line de Geom //============================================================================= -GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline) +GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline) : GeomToStep_Root() { gp_Lin L; L = Gline->Lin(); @@ -68,7 +68,7 @@ GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline) // Creation d' une line de prostep a partir d' une Line de Geom2d //============================================================================= -GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom2d_Line)& Gline) +GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom2d_Line)& Gline) : GeomToStep_Root() { gp_Lin2d L; L = Gline->Lin2d(); diff --git a/src/GeomToStep/GeomToStep_MakeParabola.cxx b/src/GeomToStep/GeomToStep_MakeParabola.cxx index 3650201603..81155099e7 100644 --- a/src/GeomToStep/GeomToStep_MakeParabola.cxx +++ b/src/GeomToStep/GeomToStep_MakeParabola.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -30,7 +32,7 @@ // Creation d'une Parabola de prostep a partir d'une Parabola de // Geom2d //============================================================================= -GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C) +GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C) : GeomToStep_Root() { gp_Parab2d gpPar; gpPar = C->Parab2d(); @@ -38,7 +40,7 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola; StepGeom_Axis2Placement Ax2; Handle(StepGeom_Axis2Placement2d) Ax2Step; - Standard_Real focal; + Standard_Real focal = NAN; GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis()); Ax2Step = MkAxis2.Value(); @@ -55,7 +57,7 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& // Geom //============================================================================= - GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C) + GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C) : GeomToStep_Root() { gp_Parab gpPar; gpPar = C->Parab(); @@ -63,7 +65,7 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& Handle(StepGeom_Parabola) PStep = new StepGeom_Parabola; StepGeom_Axis2Placement Ax2; Handle(StepGeom_Axis2Placement3d) Ax2Step; - Standard_Real focal; + Standard_Real focal = NAN; GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position()); Ax2Step = MkAxis2.Value(); diff --git a/src/GeomToStep/GeomToStep_MakePlane.cxx b/src/GeomToStep/GeomToStep_MakePlane.cxx index 9f4aa34491..b07bd2d3c7 100644 --- a/src/GeomToStep/GeomToStep_MakePlane.cxx +++ b/src/GeomToStep/GeomToStep_MakePlane.cxx @@ -27,7 +27,7 @@ //============================================================================= // Creation d' un plane de prostep a partir d' un Pln de gp //============================================================================= -GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P) +GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P) : GeomToStep_Root() { Handle(StepGeom_Plane) Plan = new StepGeom_Plane; Handle(StepGeom_Axis2Placement3d) aPosition; @@ -45,7 +45,7 @@ GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P) // Creation d' un plane de prostep a partir d' un Plane de Geom //============================================================================= -GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln) +GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln) : GeomToStep_Root() { gp_Pln P; Handle(StepGeom_Plane) Plan = new StepGeom_Plane; diff --git a/src/GeomToStep/GeomToStep_MakePolyline.cxx b/src/GeomToStep/GeomToStep_MakePolyline.cxx index 48afe4d030..06875d761b 100644 --- a/src/GeomToStep/GeomToStep_MakePolyline.cxx +++ b/src/GeomToStep/GeomToStep_MakePolyline.cxx @@ -28,7 +28,7 @@ //============================================================================= // Creation d' une polyline Step a partir d' une Array1OfPnt //============================================================================= -GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P) +GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P) : GeomToStep_Root() { gp_Pnt P1; #include "GeomToStep_MakePolyline_gen.pxx" @@ -38,7 +38,7 @@ GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P) // Creation d' une polyline Step a partir d' une Array1OfPnt2d //============================================================================= -GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt2d& P) +GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt2d& P) : GeomToStep_Root() { gp_Pnt2d P1; #include "GeomToStep_MakePolyline_gen.pxx" diff --git a/src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx b/src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx index 9d7bca0230..aa59b4ed3f 100644 --- a/src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -36,7 +38,7 @@ //============================================================================= GeomToStep_MakeRectangularTrimmedSurface:: GeomToStep_MakeRectangularTrimmedSurface( const - Handle(Geom_RectangularTrimmedSurface)& RTSurf ) + Handle(Geom_RectangularTrimmedSurface)& RTSurf ) : GeomToStep_Root() { @@ -49,9 +51,9 @@ GeomToStep_MakeRectangularTrimmedSurface:: done = Standard_False; return; } - Handle(StepGeom_Surface) StepSurf = mkSurf.Value(); + const Handle(StepGeom_Surface)& StepSurf = mkSurf.Value(); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; RTSurf->Bounds(U1, U2, V1, V2); // ----------------------------------------- diff --git a/src/GeomToStep/GeomToStep_MakeSphericalSurface.cxx b/src/GeomToStep/GeomToStep_MakeSphericalSurface.cxx index 404b5e4b39..383668aa7f 100644 --- a/src/GeomToStep/GeomToStep_MakeSphericalSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeSphericalSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -29,12 +31,12 @@ // de Geom //============================================================================= GeomToStep_MakeSphericalSurface::GeomToStep_MakeSphericalSurface - ( const Handle(Geom_SphericalSurface)& S ) + ( const Handle(Geom_SphericalSurface)& S ) : GeomToStep_Root() { Handle(StepGeom_SphericalSurface) Surf; Handle(StepGeom_Axis2Placement3d) aPosition; - Standard_Real aRadius; + Standard_Real aRadius = NAN; GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position()); aPosition = MkAxis2.Value(); diff --git a/src/GeomToStep/GeomToStep_MakeSurface.cxx b/src/GeomToStep/GeomToStep_MakeSurface.cxx index 30477d77f6..4e97297e2b 100644 --- a/src/GeomToStep/GeomToStep_MakeSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeSurface.cxx @@ -37,7 +37,7 @@ //============================================================================= // Creation d' une Surface de prostep a partir d' une Surface de Geom //============================================================================= -GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S) +GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S) : GeomToStep_Root() { done = Standard_True; if (S->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) { diff --git a/src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cxx b/src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cxx index 2a33ec167b..fbd5ac0b16 100644 --- a/src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cxx +++ b/src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cxx @@ -31,7 +31,7 @@ // SurfaceOfLinearExtrusion de Geom //============================================================================= GeomToStep_MakeSurfaceOfLinearExtrusion::GeomToStep_MakeSurfaceOfLinearExtrusion - ( const Handle(Geom_SurfaceOfLinearExtrusion)& S ) + ( const Handle(Geom_SurfaceOfLinearExtrusion)& S ) : GeomToStep_Root() { Handle(StepGeom_SurfaceOfLinearExtrusion) Surf; diff --git a/src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cxx b/src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cxx index 8f8bc1d59f..27707f1895 100644 --- a/src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cxx +++ b/src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cxx @@ -30,7 +30,7 @@ // SurfaceOfRevolution de Geom //============================================================================= GeomToStep_MakeSurfaceOfRevolution::GeomToStep_MakeSurfaceOfRevolution - ( const Handle(Geom_SurfaceOfRevolution)& S ) + ( const Handle(Geom_SurfaceOfRevolution)& S ) : GeomToStep_Root() { Handle(StepGeom_SurfaceOfRevolution) Surf; diff --git a/src/GeomToStep/GeomToStep_MakeSweptSurface.cxx b/src/GeomToStep/GeomToStep_MakeSweptSurface.cxx index 2020724305..59c7a98f3a 100644 --- a/src/GeomToStep/GeomToStep_MakeSweptSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeSweptSurface.cxx @@ -32,7 +32,7 @@ // SweptSurface de Geom //============================================================================= GeomToStep_MakeSweptSurface::GeomToStep_MakeSweptSurface - ( const Handle(Geom_SweptSurface)& S) + ( const Handle(Geom_SweptSurface)& S) : GeomToStep_Root() { done = Standard_True; if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) { diff --git a/src/GeomToStep/GeomToStep_MakeToroidalSurface.cxx b/src/GeomToStep/GeomToStep_MakeToroidalSurface.cxx index 08d6466e98..0ff55ad93e 100644 --- a/src/GeomToStep/GeomToStep_MakeToroidalSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeToroidalSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -28,12 +30,12 @@ // de Geom //============================================================================= GeomToStep_MakeToroidalSurface::GeomToStep_MakeToroidalSurface - ( const Handle(Geom_ToroidalSurface)& S ) + ( const Handle(Geom_ToroidalSurface)& S ) : GeomToStep_Root() { Handle(StepGeom_ToroidalSurface) Surf; Handle(StepGeom_Axis2Placement3d) aPosition; - Standard_Real aMajorRadius, aMinorRadius; + Standard_Real aMajorRadius = NAN, aMinorRadius = NAN; GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position()); aPosition = MkAxis2.Value(); diff --git a/src/GeomToStep/GeomToStep_MakeVector.cxx b/src/GeomToStep/GeomToStep_MakeVector.cxx index 85729b167e..7e4e66ad87 100644 --- a/src/GeomToStep/GeomToStep_MakeVector.cxx +++ b/src/GeomToStep/GeomToStep_MakeVector.cxx @@ -31,7 +31,7 @@ //============================================================================= // Creation d' un vector de prostep a partir d' un Vec de gp //============================================================================= -GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec& V) +GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec& V) : GeomToStep_Root() { gp_Dir D = gp_Dir(V); Standard_Real lFactor = StepData_GlobalFactors::Intance().LengthFactor(); @@ -41,7 +41,7 @@ GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec& V) // Creation d' un vector de prostep a partir d' un Vec2d de gp //============================================================================= -GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V) +GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V) : GeomToStep_Root() { gp_Dir2d D = gp_Dir2d(V); Standard_Real lFactor = 1.; @@ -53,7 +53,7 @@ GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V) //============================================================================= GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)& - GVector) + GVector) : GeomToStep_Root() { gp_Vec V; V = GVector->Vec(); @@ -67,7 +67,7 @@ GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)& //============================================================================= GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom2d_Vector)& - GVector) + GVector) : GeomToStep_Root() { gp_Vec2d V; V = GVector->Vec2d(); diff --git a/src/GeomTools/GeomTools_Curve2dSet.cxx b/src/GeomTools/GeomTools_Curve2dSet.cxx index b8553f8beb..2222274969 100644 --- a/src/GeomTools/GeomTools_Curve2dSet.cxx +++ b/src/GeomTools/GeomTools_Curve2dSet.cxx @@ -302,7 +302,7 @@ static void Print(const Handle(Geom2d_BezierCurve)& B, } // poles and weights - Standard_Integer i,degree = B->Degree(); + Standard_Integer i = 0,degree = B->Degree(); if (!compact) OS << "\n Degree :"; OS << degree << " "; @@ -350,7 +350,7 @@ static void Print(const Handle(Geom2d_BSplineCurve)& B, } // poles and weights - Standard_Integer i,degree,nbpoles,nbknots; + Standard_Integer i = 0,degree = 0,nbpoles = 0,nbknots = 0; degree = B->Degree(); nbpoles = B->NbPoles(); nbknots = B->NbKnots(); @@ -477,7 +477,7 @@ void GeomTools_Curve2dSet::PrintCurve2d(const Handle(Geom2d_Curve)& C, void GeomTools_Curve2dSet::Dump(Standard_OStream& OS)const { - Standard_Integer i, nbsurf = myMap.Extent(); + Standard_Integer i = 0, nbsurf = myMap.Extent(); OS << "\n -------\n"; OS << "Dump of "<< nbsurf << " Curve2ds "; OS << "\n -------\n\n"; @@ -498,7 +498,7 @@ void GeomTools_Curve2dSet::Write(Standard_OStream& OS, const Message_ProgressRa { std::streamsize prec = OS.precision(17); - Standard_Integer i, nbsurf = myMap.Extent(); + Standard_Integer i = 0, nbsurf = myMap.Extent(); OS << "Curve2ds "<< nbsurf << "\n"; Message_ProgressScope aPS(theProgress, "2D Curves", nbsurf); for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) { @@ -732,7 +732,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Curve) GeomTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS) { - Standard_Integer ctype; + Standard_Integer ctype = 0; Handle(Geom2d_Curve) C; try { @@ -845,7 +845,7 @@ void GeomTools_Curve2dSet::Read(Standard_IStream& IS, const Message_ProgressRan return; } - Standard_Integer i, nbcurve; + Standard_Integer i = 0, nbcurve = 0; IS >> nbcurve; Message_ProgressScope aPS(theProgress, "2D Curves", nbcurve); for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) { diff --git a/src/GeomTools/GeomTools_CurveSet.cxx b/src/GeomTools/GeomTools_CurveSet.cxx index 76f053cfb9..daf8a2fba7 100644 --- a/src/GeomTools/GeomTools_CurveSet.cxx +++ b/src/GeomTools/GeomTools_CurveSet.cxx @@ -316,7 +316,7 @@ static void Print(const Handle(Geom_BezierCurve)& B, } // poles and weights - Standard_Integer i,degree = B->Degree(); + Standard_Integer i = 0,degree = B->Degree(); if (!compact) OS << "\n Degree :"; OS << degree << " "; @@ -364,7 +364,7 @@ static void Print(const Handle(Geom_BSplineCurve)& B, } // poles and weights - Standard_Integer i,degree,nbpoles,nbknots; + Standard_Integer i = 0,degree = 0,nbpoles = 0,nbknots = 0; degree = B->Degree(); nbpoles = B->NbPoles(); nbknots = B->NbKnots(); @@ -494,7 +494,7 @@ void GeomTools_CurveSet::PrintCurve(const Handle(Geom_Curve)& C, void GeomTools_CurveSet::Dump(Standard_OStream& OS)const { - Standard_Integer i, nbsurf = myMap.Extent(); + Standard_Integer i = 0, nbsurf = myMap.Extent(); OS << "\n -------\n"; OS << "Dump of "<< nbsurf << " Curves "; OS << "\n -------\n\n"; @@ -515,7 +515,7 @@ void GeomTools_CurveSet::Write(Standard_OStream& OS, const Message_ProgressRang { std::streamsize prec = OS.precision(17); - Standard_Integer i, nbcurve = myMap.Extent(); + Standard_Integer i = 0, nbcurve = myMap.Extent(); OS << "Curves "<< nbcurve << "\n"; Message_ProgressScope aPS(theProgress, "3D Curves", nbcurve); for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) { @@ -754,7 +754,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Curve) GeomTools_CurveSet::ReadCurve (Standard_IStream& IS) { - Standard_Integer ctype; + Standard_Integer ctype = 0; Handle(Geom_Curve) C; try { @@ -866,7 +866,7 @@ void GeomTools_CurveSet::Read(Standard_IStream& IS, const Message_ProgressRange return; } - Standard_Integer i, nbcurve; + Standard_Integer i = 0, nbcurve = 0; IS >> nbcurve; Message_ProgressScope aPS(theProgress, "3D Curves", nbcurve); for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) { diff --git a/src/GeomTools/GeomTools_SurfaceSet.cxx b/src/GeomTools/GeomTools_SurfaceSet.cxx index 707cfde1d9..5b123b2ef8 100644 --- a/src/GeomTools/GeomTools_SurfaceSet.cxx +++ b/src/GeomTools/GeomTools_SurfaceSet.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -388,7 +390,7 @@ static void Print(const Handle(Geom_BezierSurface)& S, } // poles and weights - Standard_Integer i,j,udegree,vdegree; + Standard_Integer i = 0,j = 0,udegree = 0,vdegree = 0; udegree = S->UDegree(); vdegree = S->VDegree(); if (!compact) OS << "\n Degrees :"; @@ -465,7 +467,7 @@ static void Print(const Handle(Geom_BSplineSurface)& S, // poles and weights - Standard_Integer i,j,udegree,vdegree,nbupoles,nbvpoles,nbuknots,nbvknots; + Standard_Integer i = 0,j = 0,udegree = 0,vdegree = 0,nbupoles = 0,nbvpoles = 0,nbuknots = 0,nbvknots = 0; udegree = S->UDegree(); vdegree = S->VDegree(); nbupoles = S->NbUPoles(); @@ -522,7 +524,7 @@ static void Print(const Handle(Geom_RectangularTrimmedSurface)& S, else OS << "RectangularTrimmedSurface"; - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; S->Bounds(U1,U2,V1,V2); if (!compact) OS << "\nParameters : "; OS << U1 << " " << U2 << " " << V1 << " " << V2 <<"\n"; @@ -612,7 +614,7 @@ void GeomTools_SurfaceSet::PrintSurface(const Handle(Geom_Surface)& S, void GeomTools_SurfaceSet::Dump(Standard_OStream& OS)const { - Standard_Integer i, nbsurf = myMap.Extent(); + Standard_Integer i = 0, nbsurf = myMap.Extent(); OS << "\n -------\n"; OS << "Dump of "<< nbsurf << " surfaces "; OS << "\n -------\n\n"; @@ -633,7 +635,7 @@ void GeomTools_SurfaceSet::Write(Standard_OStream& OS, const Message_ProgressRa { std::streamsize prec = OS.precision(17); - Standard_Integer i, nbsurf = myMap.Extent(); + Standard_Integer i = 0, nbsurf = myMap.Extent(); OS << "Surfaces "<< nbsurf << "\n"; Message_ProgressScope aPS(theProgress, "Surfaces", nbsurf); for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) { @@ -817,7 +819,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, TColgp_Array2OfPnt poles(1,udegree+1,1,vdegree+1); TColStd_Array2OfReal weights(1,udegree+1,1,vdegree+1); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for (i = 1; i <= udegree+1; i++) { for (j = 1; j <= vdegree+1; j++) { IS >> poles(i,j); @@ -853,7 +855,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, TColgp_Array2OfPnt poles(1,nbupoles,1,nbvpoles); TColStd_Array2OfReal weights(1,nbupoles,1,nbvpoles); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; for (i = 1; i <= nbupoles; i++) { for (j = 1; j <= nbvpoles; j++) { IS >> poles(i,j); @@ -926,7 +928,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Surface) GeomTools_SurfaceSet::ReadSurface (Standard_IStream& IS) { - Standard_Integer stype; + Standard_Integer stype = 0; Handle(Geom_Surface) S; try { @@ -1055,7 +1057,7 @@ void GeomTools_SurfaceSet::Read(Standard_IStream& IS, const Message_ProgressRan return; } - Standard_Integer i, nbsurf; + Standard_Integer i = 0, nbsurf = 0; IS >> nbsurf; Message_ProgressScope aPS(theProgress, "Surfaces", nbsurf); for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) { diff --git a/src/Graphic3d/Graphic3d_CStructure.cxx b/src/Graphic3d/Graphic3d_CStructure.cxx index bc9b09ca08..45b31e2011 100644 --- a/src/Graphic3d/Graphic3d_CStructure.cxx +++ b/src/Graphic3d/Graphic3d_CStructure.cxx @@ -26,7 +26,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CStructure,Standard_Transient) //============================================================================= Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureManager)& theManager) : myGraphicDriver (theManager->GraphicDriver()), - myId (-1), + myId(myGraphicDriver->NewIdentification()), myZLayer (Graphic3d_ZLayerId_Default), myPriority (Graphic3d_DisplayPriority_Normal), myPreviousPriority(Graphic3d_DisplayPriority_Normal), @@ -43,7 +43,7 @@ Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureMana IsMutable (Standard_False), Is2dText (Standard_False) { - myId = myGraphicDriver->NewIdentification(); + } //======================================================================= diff --git a/src/Graphic3d/Graphic3d_CView.cxx b/src/Graphic3d/Graphic3d_CView.cxx index 985692f00c..59e0ee75a9 100644 --- a/src/Graphic3d/Graphic3d_CView.cxx +++ b/src/Graphic3d/Graphic3d_CView.cxx @@ -349,7 +349,7 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode) for (Graphic3d_MapOfStructure::Iterator aDispStructIter (myStructsDisplayed); aDispStructIter.More(); aDispStructIter.Next()) { - Handle(Graphic3d_Structure) aStruct = aDispStructIter.Key(); + const Handle(Graphic3d_Structure)& aStruct = aDispStructIter.Key(); const Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (aStruct->Visual()); if (anAnswer != Graphic3d_TOA_COMPUTE) { diff --git a/src/Graphic3d/Graphic3d_Camera.cxx b/src/Graphic3d/Graphic3d_Camera.cxx index ee7204fe8e..41f230d456 100644 --- a/src/Graphic3d/Graphic3d_Camera.cxx +++ b/src/Graphic3d/Graphic3d_Camera.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -782,7 +784,7 @@ gp_XYZ Graphic3d_Camera::ViewDimensions (const Standard_Real theZValue) const { // view plane dimensions Standard_Real aSize = IsOrthographic() ? myScale : (2.0 * theZValue * myFOVyTan); - Standard_Real aSizeX, aSizeY; + Standard_Real aSizeX = NAN, aSizeY = NAN; if (myAspect > 1.0) { aSizeX = aSize * myAspect; diff --git a/src/Graphic3d/Graphic3d_CubeMapOrder.cxx b/src/Graphic3d/Graphic3d_CubeMapOrder.cxx index 52c1c309f5..99fb33025c 100644 --- a/src/Graphic3d/Graphic3d_CubeMapOrder.cxx +++ b/src/Graphic3d/Graphic3d_CubeMapOrder.cxx @@ -54,7 +54,7 @@ Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder (unsigned char thePosXLocation, // function : Graphic3d_CubeMapOrder // purpose : // ======================================================================= -Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder (const Graphic3d_ValidatedCubeMapOrder theOrder) +Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder (const Graphic3d_ValidatedCubeMapOrder& theOrder) : myConvolution (theOrder.Order.myConvolution), myHasOverflows (theOrder.Order.myHasOverflows) @@ -135,7 +135,7 @@ Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::SetDefault() // function : Permute // purpose : // ======================================================================= -Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Permute (Graphic3d_ValidatedCubeMapOrder thePermutation) +Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Permute (const Graphic3d_ValidatedCubeMapOrder& thePermutation) { for (unsigned char i = 0; i < 6; ++i) { @@ -149,7 +149,7 @@ Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Permute (Graphic3d_ValidatedCube // function : Permuted // purpose : // ======================================================================= -Graphic3d_CubeMapOrder Graphic3d_CubeMapOrder::Permuted (Graphic3d_ValidatedCubeMapOrder thePermutation) const +Graphic3d_CubeMapOrder Graphic3d_CubeMapOrder::Permuted (const Graphic3d_ValidatedCubeMapOrder& thePermutation) const { Graphic3d_CubeMapOrder anOrder = *this; anOrder.Permute (thePermutation); diff --git a/src/Graphic3d/Graphic3d_CubeMapOrder.hxx b/src/Graphic3d/Graphic3d_CubeMapOrder.hxx index cbdeafc10d..a5cdeb82e6 100644 --- a/src/Graphic3d/Graphic3d_CubeMapOrder.hxx +++ b/src/Graphic3d/Graphic3d_CubeMapOrder.hxx @@ -42,7 +42,7 @@ public: unsigned char theNegZLocation); //! Creates Graphic3d_CubeMapOrder using Graphic3d_ValidatedCubeMapOrder. - Standard_EXPORT Graphic3d_CubeMapOrder (const Graphic3d_ValidatedCubeMapOrder theOrder); + Standard_EXPORT Graphic3d_CubeMapOrder (const Graphic3d_ValidatedCubeMapOrder& theOrder); //! Alias of 'operator='. Standard_EXPORT Graphic3d_CubeMapOrder& Set (const Graphic3d_CubeMapOrder& theOrder); @@ -61,10 +61,10 @@ public: Standard_EXPORT Graphic3d_CubeMapOrder& SetDefault(); //! Applies another cubemap order as permutation for the current one. - Standard_EXPORT Graphic3d_CubeMapOrder& Permute (Graphic3d_ValidatedCubeMapOrder anOrder); + Standard_EXPORT Graphic3d_CubeMapOrder& Permute (const Graphic3d_ValidatedCubeMapOrder& anOrder); //! Returns permuted by other cubemap order copy of current one. - Standard_EXPORT Graphic3d_CubeMapOrder Permuted (Graphic3d_ValidatedCubeMapOrder anOrder) const; + Standard_EXPORT Graphic3d_CubeMapOrder Permuted (const Graphic3d_ValidatedCubeMapOrder& anOrder) const; //! Swaps values of two cubemap sides. Standard_EXPORT Graphic3d_CubeMapOrder& Swap (Graphic3d_CubeMapSide theFirstSide, diff --git a/src/Graphic3d/Graphic3d_CubeMapPacked.cxx b/src/Graphic3d/Graphic3d_CubeMapPacked.cxx index 2f9e180158..df8e6f71af 100644 --- a/src/Graphic3d/Graphic3d_CubeMapPacked.cxx +++ b/src/Graphic3d/Graphic3d_CubeMapPacked.cxx @@ -24,7 +24,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CubeMapPacked, Graphic3d_CubeMap) // purpose : // ======================================================================= Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked (const TCollection_AsciiString& theFilePath, - const Graphic3d_ValidatedCubeMapOrder theOrder) + const Graphic3d_ValidatedCubeMapOrder& theOrder) : Graphic3d_CubeMap (theFilePath), myOrder (theOrder), @@ -36,7 +36,7 @@ Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked (const TCollection_AsciiString& // purpose : // ======================================================================= Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked (const Handle(Image_PixMap)& theImage, - const Graphic3d_ValidatedCubeMapOrder theOrder) + const Graphic3d_ValidatedCubeMapOrder& theOrder) : Graphic3d_CubeMap (Handle(Image_PixMap)()), myOrder (theOrder), diff --git a/src/Graphic3d/Graphic3d_CubeMapPacked.hxx b/src/Graphic3d/Graphic3d_CubeMapPacked.hxx index 41a4f94d7e..ef7bbd50e5 100644 --- a/src/Graphic3d/Graphic3d_CubeMapPacked.hxx +++ b/src/Graphic3d/Graphic3d_CubeMapPacked.hxx @@ -29,13 +29,13 @@ public: //! @theFileName - path to the cubemap image //! @theOrder - array containing six different indexes of cubemap sides which maps tile grid to cubemap sides Standard_EXPORT Graphic3d_CubeMapPacked (const TCollection_AsciiString& theFileName, - const Graphic3d_ValidatedCubeMapOrder theOrder = Graphic3d_CubeMapOrder::Default()); + const Graphic3d_ValidatedCubeMapOrder& theOrder = Graphic3d_CubeMapOrder::Default()); //! Initialization to set cubemap directly by PixMap. //! @thePixMap - origin PixMap //! @theOrder - array containing six different indexes of cubemap sides which maps tile grid to cubemap sides Standard_EXPORT Graphic3d_CubeMapPacked (const Handle(Image_PixMap)& theImage, - const Graphic3d_ValidatedCubeMapOrder theOrder = Graphic3d_CubeMapOrder::Default()); + const Graphic3d_ValidatedCubeMapOrder& theOrder = Graphic3d_CubeMapOrder::Default()); //! Returns current cubemap side as compressed PixMap. Standard_EXPORT virtual Handle(Image_CompressedPixMap) CompressedValue (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE; diff --git a/src/Graphic3d/Graphic3d_CubeMapSeparate.hxx b/src/Graphic3d/Graphic3d_CubeMapSeparate.hxx index 17504a4241..cefce420f3 100644 --- a/src/Graphic3d/Graphic3d_CubeMapSeparate.hxx +++ b/src/Graphic3d/Graphic3d_CubeMapSeparate.hxx @@ -59,7 +59,7 @@ protected: OSD_Path myPaths[6]; //!< array of paths to cubemap images Handle(Image_PixMap) myImages[6]; //!< array of cubemap images - Standard_Size mySize; //!< size of each side of cubemap + Standard_Size mySize{}; //!< size of each side of cubemap Image_Format myFormat; //!< format each side of cubemap private: diff --git a/src/Graphic3d/Graphic3d_CullingTool.hxx b/src/Graphic3d/Graphic3d_CullingTool.hxx index ce92e0edb0..7c52e728e6 100644 --- a/src/Graphic3d/Graphic3d_CullingTool.hxx +++ b/src/Graphic3d/Graphic3d_CullingTool.hxx @@ -296,21 +296,21 @@ protected: // for caching clip points projections onto viewing area normals once per traverse // ORDER: LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR - Standard_Real myMaxClipProjectionPts[PlanesNB]; //!< Max view volume's vertices projections onto its normals - Standard_Real myMinClipProjectionPts[PlanesNB]; //!< Min view volume's vertices projections onto its normals + Standard_Real myMaxClipProjectionPts[PlanesNB]{}; //!< Max view volume's vertices projections onto its normals + Standard_Real myMinClipProjectionPts[PlanesNB]{}; //!< Min view volume's vertices projections onto its normals // for caching clip points projections onto AABB normals once per traverse // ORDER: E0, E1, E2 - Standard_Real myMaxOrthoProjectionPts[3]; //!< Max view volume's vertices projections onto normalized dimensions of AABB - Standard_Real myMinOrthoProjectionPts[3]; //!< Min view volume's vertices projections onto normalized dimensions of AABB + Standard_Real myMaxOrthoProjectionPts[3]{}; //!< Max view volume's vertices projections onto normalized dimensions of AABB + Standard_Real myMinOrthoProjectionPts[3]{}; //!< Min view volume's vertices projections onto normalized dimensions of AABB Standard_Boolean myIsProjectionParallel; Graphic3d_Mat4d myProjectionMat; Graphic3d_Mat4d myWorldViewMat; - Standard_Integer myViewportWidth; - Standard_Integer myViewportHeight; + Standard_Integer myViewportWidth{}; + Standard_Integer myViewportHeight{}; Graphic3d_WorldViewProjState myWorldViewProjState; //!< State of world view projection matrices. diff --git a/src/Graphic3d/Graphic3d_HatchStyle.cxx b/src/Graphic3d/Graphic3d_HatchStyle.cxx index 2d0985038a..65a6dee73d 100644 --- a/src/Graphic3d/Graphic3d_HatchStyle.cxx +++ b/src/Graphic3d/Graphic3d_HatchStyle.cxx @@ -488,7 +488,7 @@ namespace //function : Graphic3d_HatchStyle //purpose : //======================================================================= -Graphic3d_HatchStyle::Graphic3d_HatchStyle (const Handle(Image_PixMap)& thePattern) +Graphic3d_HatchStyle::Graphic3d_HatchStyle (const Handle(Image_PixMap)& thePattern) : myHatchType(Standard_Atomic_Increment (&THE_HATCH_STYLE_COUNTER)) { Standard_ProgramError_Raise_if (thePattern.IsNull(), "Null pointer to a hatch pattern image"); Standard_ProgramError_Raise_if ( @@ -501,7 +501,7 @@ Graphic3d_HatchStyle::Graphic3d_HatchStyle (const Handle(Image_PixMap)& thePatte myPattern->Allocate (aByteSize); std::memcpy (myPattern->ChangeData(), thePattern->Data(), aByteSize); - myHatchType = Standard_Atomic_Increment (&THE_HATCH_STYLE_COUNTER); + } //======================================================================= diff --git a/src/Graphic3d/Graphic3d_Layer.hxx b/src/Graphic3d/Graphic3d_Layer.hxx index c73419b977..61d8eda824 100644 --- a/src/Graphic3d/Graphic3d_Layer.hxx +++ b/src/Graphic3d/Graphic3d_Layer.hxx @@ -188,7 +188,7 @@ private: mutable Standard_Boolean myIsBVHPrimitivesNeedsReset; //! Defines if the cached bounding box is outdated. - mutable bool myIsBoundingBoxNeedsReset[2]; + mutable bool myIsBoundingBoxNeedsReset[2]{}; //! Cached layer bounding box. mutable Bnd_Box myBoundingBox[2]; diff --git a/src/Graphic3d/Graphic3d_LightSet.hxx b/src/Graphic3d/Graphic3d_LightSet.hxx index 584cb4c3fd..925980f7fe 100644 --- a/src/Graphic3d/Graphic3d_LightSet.hxx +++ b/src/Graphic3d/Graphic3d_LightSet.hxx @@ -188,8 +188,8 @@ protected: Graphic3d_Vec4 myAmbient; //!< cached value of cumulative ambient color TCollection_AsciiString myKeyEnabledLong; //!< key identifying the list of enabled light sources by their type TCollection_AsciiString myKeyEnabledShort; //!< key identifying the list of enabled light sources by the number of sources of each type - Standard_Integer myLightTypes [Graphic3d_TypeOfLightSource_NB]; //!< counters per each light source type defined in the list - Standard_Integer myLightTypesEnabled[Graphic3d_TypeOfLightSource_NB]; //!< counters per each light source type enabled in the list + Standard_Integer myLightTypes [Graphic3d_TypeOfLightSource_NB]{}; //!< counters per each light source type defined in the list + Standard_Integer myLightTypesEnabled[Graphic3d_TypeOfLightSource_NB]{}; //!< counters per each light source type enabled in the list Standard_Integer myNbEnabled; //!< number of enabled light sources, excluding ambient Standard_Integer myNbCastShadows; //!< number of enabled light sources casting shadows Standard_Size myRevision; //!< current revision of light source set diff --git a/src/Graphic3d/Graphic3d_MarkerImage.cxx b/src/Graphic3d/Graphic3d_MarkerImage.cxx old mode 100755 new mode 100644 index e78aa460ff..e3c73976da --- a/src/Graphic3d/Graphic3d_MarkerImage.cxx +++ b/src/Graphic3d/Graphic3d_MarkerImage.cxx @@ -510,7 +510,7 @@ Handle(Graphic3d_MarkerImage) Graphic3d_MarkerImage::StandardMarker (const Aspec anImageA->InitZero (Image_Format_Alpha, aSize, aSize); // we draw a set of circles - Image_ColorRGBA aColor32; + Image_ColorRGBA aColor32{}; aColor32.a() = 255; Standard_Real aHLS[3]; const Standard_ShortReal aDelta = 0.1f; diff --git a/src/Graphic3d/Graphic3d_MaterialAspect.hxx b/src/Graphic3d/Graphic3d_MaterialAspect.hxx index 497d68be40..0847990349 100644 --- a/src/Graphic3d/Graphic3d_MaterialAspect.hxx +++ b/src/Graphic3d/Graphic3d_MaterialAspect.hxx @@ -261,9 +261,9 @@ private: Graphic3d_PBRMaterial myPBRMaterial; TCollection_AsciiString myStringName; Quantity_Color myColors[Graphic3d_TypeOfReflection_NB]; - Standard_ShortReal myTransparencyCoef; - Standard_ShortReal myRefractionIndex; - Standard_ShortReal myShininess; + Standard_ShortReal myTransparencyCoef{}; + Standard_ShortReal myRefractionIndex{}; + Standard_ShortReal myShininess{}; Graphic3d_TypeOfMaterial myMaterialType; Graphic3d_NameOfMaterial myMaterialName; diff --git a/src/Graphic3d/Graphic3d_PBRMaterial.hxx b/src/Graphic3d/Graphic3d_PBRMaterial.hxx index ea91abeecd..26ecfd092f 100644 --- a/src/Graphic3d/Graphic3d_PBRMaterial.hxx +++ b/src/Graphic3d/Graphic3d_PBRMaterial.hxx @@ -190,10 +190,10 @@ private: private: Quantity_ColorRGBA myColor; //!< albedo color with alpha component [0, 1] - Standard_ShortReal myMetallic; //!< metallic coefficient of material [0, 1] - Standard_ShortReal myRoughness; //!< roughness coefficient of material [0, 1] + Standard_ShortReal myMetallic{}; //!< metallic coefficient of material [0, 1] + Standard_ShortReal myRoughness{}; //!< roughness coefficient of material [0, 1] Graphic3d_Vec3 myEmission; //!< light intensity emitted by material [>= 0] - Standard_ShortReal myIOR; //!< index of refraction [1, 3] + Standard_ShortReal myIOR{}; //!< index of refraction [1, 3] }; diff --git a/src/Graphic3d/Graphic3d_ShaderManager.hxx b/src/Graphic3d/Graphic3d_ShaderManager.hxx index 023b574260..fdcf3bb6b4 100644 --- a/src/Graphic3d/Graphic3d_ShaderManager.hxx +++ b/src/Graphic3d/Graphic3d_ShaderManager.hxx @@ -216,7 +216,7 @@ protected: Aspect_GraphicsLibrary myGapi; //!< GAPI name Graphic3d_Vec2i myGapiVersion; //!< GAPI version major/minor number pair - Standard_Boolean myGlslExtensions[Graphic3d_GlslExtension_NB]; + Standard_Boolean myGlslExtensions[Graphic3d_GlslExtension_NB]{}; Standard_Boolean myHasFlatShading; //!< flag indicating flat shading usage Standard_Boolean myToReverseDFdxSign; //!< flag to reverse flat shading normal (workaround) Standard_Boolean mySetPointSize; //!< always set gl_PointSize variable diff --git a/src/Graphic3d/Graphic3d_Structure.cxx b/src/Graphic3d/Graphic3d_Structure.cxx index eace8db06f..b5b3019d94 100644 --- a/src/Graphic3d/Graphic3d_Structure.cxx +++ b/src/Graphic3d/Graphic3d_Structure.cxx @@ -26,6 +26,7 @@ #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Structure,Standard_Transient) @@ -873,7 +874,7 @@ void Graphic3d_Structure::TransformBoundaries (const gp_Trsf& theTrsf, Standard_Real& theYMax, Standard_Real& theZMax) { - Standard_Real aXMin, aYMin, aZMin, aXMax, aYMax, aZMax, anU, aV, aW; + Standard_Real aXMin = NAN, aYMin = NAN, aZMin = NAN, aXMax = NAN, aYMax = NAN, aZMax = NAN, anU = NAN, aV = NAN, aW = NAN; Graphic3d_Structure::Transforms (theTrsf, theXMin, theYMin, theZMin, aXMin, aYMin, aZMin); Graphic3d_Structure::Transforms (theTrsf, theXMax, theYMax, theZMax, aXMax, aYMax, aZMax); diff --git a/src/Graphic3d/Graphic3d_StructureManager.cxx b/src/Graphic3d/Graphic3d_StructureManager.cxx index a4e45a9b01..a5620e7733 100644 --- a/src/Graphic3d/Graphic3d_StructureManager.cxx +++ b/src/Graphic3d/Graphic3d_StructureManager.cxx @@ -137,7 +137,7 @@ Handle(Graphic3d_Structure) Graphic3d_StructureManager::Identification (const St Handle(Graphic3d_Structure) SGfound; for (; it.More() && notfound; it.Next()) { - Handle(Graphic3d_Structure) SG = it.Key(); + const Handle(Graphic3d_Structure)& SG = it.Key(); if ( SG->Identification () == AId) { notfound = Standard_False; SGfound = SG; @@ -165,8 +165,7 @@ void Graphic3d_StructureManager::RecomputeStructures() NCollection_Map aStructNetwork; for (Graphic3d_MapIteratorOfMapOfStructure anIter(myDisplayedStructure); anIter.More(); anIter.Next()) { - Handle(Graphic3d_Structure) aStructure = anIter.Key(); - anIter.Key()->Network (anIter.Key().get(), Graphic3d_TOC_DESCENDANT, aStructNetwork); + anIter.Key()->Network (anIter.Key().get(), Graphic3d_TOC_DESCENDANT, aStructNetwork); } RecomputeStructures (aStructNetwork); diff --git a/src/Graphic3d/Graphic3d_Vertex.cxx b/src/Graphic3d/Graphic3d_Vertex.cxx index d3f9ed7480..15f100e5e5 100644 --- a/src/Graphic3d/Graphic3d_Vertex.cxx +++ b/src/Graphic3d/Graphic3d_Vertex.cxx @@ -15,12 +15,13 @@ #include +#include #include #include Standard_ShortReal Graphic3d_Vertex::Distance(const Graphic3d_Vertex& AOther) const { - return sqrt( (X() - AOther.X()) * (X() - AOther.X()) + return std::sqrt( (X() - AOther.X()) * (X() - AOther.X()) + (Y() - AOther.Y()) * (Y() - AOther.Y()) + (Z() - AOther.Z()) * (Z() - AOther.Z()) ); } diff --git a/src/HLRAlgo/HLRAlgo_EdgeIterator.cxx b/src/HLRAlgo/HLRAlgo_EdgeIterator.cxx index 04a5968f15..91512ffcba 100644 --- a/src/HLRAlgo/HLRAlgo_EdgeIterator.cxx +++ b/src/HLRAlgo/HLRAlgo_EdgeIterator.cxx @@ -19,6 +19,8 @@ #endif +#include + #include #include @@ -56,8 +58,8 @@ void HLRAlgo_EdgeIterator::InitHidden (HLRAlgo_EdgeStatus& status) } else { myNbHid = ((HLRAlgo_EdgeStatus*)EHid)->NbVisiblePart(); - Standard_Real B1; - Standard_ShortReal B2; + Standard_Real B1 = NAN; + Standard_ShortReal B2 = NAN; ((HLRAlgo_EdgeStatus*)EHid)->Bounds (myHidStart,myHidTolStart,B1,B2); ((HLRAlgo_EdgeStatus*)EHid)->VisiblePart @@ -77,8 +79,8 @@ void HLRAlgo_EdgeIterator::NextHidden () { if (iHid >= myNbHid + 1) iHid++; else { - Standard_Real B1; - Standard_ShortReal B2; + Standard_Real B1 = NAN; + Standard_ShortReal B2 = NAN; ((HLRAlgo_EdgeStatus*)EHid)->VisiblePart (iHid,B1,B2,myHidStart,myHidTolStart); iHid++; diff --git a/src/HLRAlgo/HLRAlgo_EdgesBlock.hxx b/src/HLRAlgo/HLRAlgo_EdgesBlock.hxx index ad41eb8e19..84391a154f 100644 --- a/src/HLRAlgo/HLRAlgo_EdgesBlock.hxx +++ b/src/HLRAlgo/HLRAlgo_EdgesBlock.hxx @@ -162,7 +162,7 @@ private: TColStd_Array1OfInteger myEdges; TColStd_Array1OfInteger myFlags; - MinMaxIndices myMinMax; + MinMaxIndices myMinMax{}; }; #endif // _HLRAlgo_EdgesBlock_HeaderFile diff --git a/src/HLRAlgo/HLRAlgo_PolyAlgo.cxx b/src/HLRAlgo/HLRAlgo_PolyAlgo.cxx index 31cd6e4dd7..312352673a 100644 --- a/src/HLRAlgo/HLRAlgo_PolyAlgo.cxx +++ b/src/HLRAlgo/HLRAlgo_PolyAlgo.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -66,16 +68,16 @@ void HLRAlgo_PolyAlgo::Clear() void HLRAlgo_PolyAlgo::Update () { - Standard_Integer j; - Standard_Integer nxMin,nyMin,nzMin,nxMax,nyMax,nzMax; - Standard_Real xShellMin,yShellMin,zShellMin; - Standard_Real xShellMax,yShellMax,zShellMax; - Standard_Real xPolyTMin,yPolyTMin,zPolyTMin; - Standard_Real xPolyTMax,yPolyTMax,zPolyTMax; - Standard_Real xTrianMin,yTrianMin,zTrianMin; - Standard_Real xTrianMax,yTrianMax,zTrianMax; - Standard_Real xSegmnMin,ySegmnMin,zSegmnMin; - Standard_Real xSegmnMax,ySegmnMax,zSegmnMax; + Standard_Integer j = 0; + Standard_Integer nxMin = 0,nyMin = 0,nzMin = 0,nxMax = 0,nyMax = 0,nzMax = 0; + Standard_Real xShellMin = NAN,yShellMin = NAN,zShellMin = NAN; + Standard_Real xShellMax = NAN,yShellMax = NAN,zShellMax = NAN; + Standard_Real xPolyTMin = NAN,yPolyTMin = NAN,zPolyTMin = NAN; + Standard_Real xPolyTMax = NAN,yPolyTMax = NAN,zPolyTMax = NAN; + Standard_Real xTrianMin = NAN,yTrianMin = NAN,zTrianMin = NAN; + Standard_Real xTrianMax = NAN,yTrianMax = NAN,zTrianMax = NAN; + Standard_Real xSegmnMin = NAN,ySegmnMin = NAN,zSegmnMin = NAN; + Standard_Real xSegmnMax = NAN,ySegmnMax = NAN,zSegmnMax = NAN; Standard_Real Big = Precision::Infinite(); HLRAlgo_PolyData::Box aBox(Big, Big, Big, -Big, -Big, -Big); @@ -158,10 +160,10 @@ void HLRAlgo_PolyAlgo::Update () xPolyTMax = -Big; yPolyTMax = -Big; zPolyTMax = -Big; - Standard_Integer otheri,nbHide = 0;//min,max; - Standard_Real X1,X2,X3,Y1,Y2,Y3,Z1,Z2,Z3; - Standard_Real dn,dnx,dny,dnz,dx1,dy1,dz1,dx2,dy2,dz2,dx3,dy3; - Standard_Real adx1,ady1,adx2,ady2,adx3,ady3; + Standard_Integer otheri = 0,nbHide = 0;//min,max; + Standard_Real X1 = NAN,X2 = NAN,X3 = NAN,Y1 = NAN,Y2 = NAN,Y3 = NAN,Z1 = NAN,Z2 = NAN,Z3 = NAN; + Standard_Real dn = NAN,dnx = NAN,dny = NAN,dnz = NAN,dx1 = NAN,dy1 = NAN,dz1 = NAN,dx2 = NAN,dy2 = NAN,dz2 = NAN,dx3 = NAN,dy3 = NAN; + Standard_Real adx1 = NAN,ady1 = NAN,adx2 = NAN,ady2 = NAN,adx3 = NAN,ady3 = NAN; Standard_Real a =0.,b =0.,c =0.,d =0.; HLRAlgo_PolyData::FaceIndices& PolyTIndices = aPd->Indices(); TColgp_Array1OfXYZ & Nodes = aPd->Nodes(); @@ -205,7 +207,7 @@ void HLRAlgo_PolyAlgo::Update () nxMax = (Standard_Integer)((DecaX + xTrianMax) * SurDX); nyMax = (Standard_Integer)((DecaY + yTrianMax) * SurDY); nzMax = (Standard_Integer)((DecaZ + zTrianMax) * SurDZ); - Standard_Integer MinTrian,MaxTrian; + Standard_Integer MinTrian = 0,MaxTrian = 0; MinTrian = nyMin + (nxMin << 11); MinTrian <<= 10; MinTrian += nzMin - 0x00000200; diff --git a/src/HLRAlgo/HLRAlgo_PolyData.cxx b/src/HLRAlgo/HLRAlgo_PolyData.cxx index 81a254a4b9..bf1d4d53ca 100644 --- a/src/HLRAlgo/HLRAlgo_PolyData.cxx +++ b/src/HLRAlgo/HLRAlgo_PolyData.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -66,8 +68,8 @@ void HLRAlgo_PolyData::HPHDat(const Handle(HLRAlgo_HArray1OfPHDat)& HPHDat) void HLRAlgo_PolyData::UpdateGlobalMinMax (Box& theBox) { - Standard_Integer i; - Standard_Real X1,X2,X3,Y1,Y2,Y3,Z1,Z2,Z3; + Standard_Integer i = 0; + Standard_Real X1 = NAN,X2 = NAN,X3 = NAN,Y1 = NAN,Y2 = NAN,Y3 = NAN,Z1 = NAN,Z2 = NAN,Z3 = NAN; const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1(); HLRAlgo_Array1OfTData& TData = myHTData->ChangeArray1(); Standard_Integer nbT = TData.Upper(); @@ -125,12 +127,12 @@ void HLRAlgo_PolyData::HideByPolyData (const HLRAlgo_BiPoint::PointsT& thePoints ((theIndices.MaxSeg - myFaceIndices.Min) & 0x80100000) == 0) { HLRAlgo_Array1OfPHDat& PHDat = myHPHDat->ChangeArray1(); const HLRAlgo_Array1OfTData& TData = myHTData->Array1(); - Standard_Real d1,d2; + Standard_Real d1 = NAN,d2 = NAN; Standard_Boolean NotConnex = Standard_False; Standard_Boolean isCrossing = Standard_False; Standard_Boolean toHideBefore = Standard_False; Standard_Integer TFlag = 0; - Standard_Integer h,h2 = PHDat.Upper(); + Standard_Integer h = 0,h2 = PHDat.Upper(); HLRAlgo_PolyHidingData* PH = &(PHDat(1)); for (h = 1; h <= h2; h++) { @@ -709,7 +711,7 @@ void HLRAlgo_PolyData::hideByOneTriangle (const HLRAlgo_BiPoint::PointsT& thePoi } } - Standard_Boolean total; + Standard_Boolean total = 0; if (psta > 0) total = psta < theTriangle.TolParam; else total = psta > -theTriangle.TolParam; if (total) { diff --git a/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx b/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx index 3eca3e98d6..84168249ea 100644 --- a/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx +++ b/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx @@ -38,15 +38,15 @@ HLRAlgo_PolyInternalData::HLRAlgo_PolyInternalData myNbPISeg(0), myNbPINod(nbNod), myMxTData(nbTri), - myMxPINod(nbNod), + myMxPISeg(2 + (3 * nbTri + nbNod) / 2), myMxPINod(nbNod), myIntOutL(Standard_False), - myPlanar(Standard_False) + myPlanar(Standard_False), myTData(new HLRAlgo_HArray1OfTData(0,myMxTData)), myPISeg(new HLRAlgo_HArray1OfPISeg(0,myMxPISeg)), myPINod(new HLRAlgo_HArray1OfPINod(0,myMxPINod)) { - Standard_Integer i; - myMxPISeg = 2 + (3 * nbTri + nbNod) / 2; - myTData = new HLRAlgo_HArray1OfTData(0,myMxTData); - myPISeg = new HLRAlgo_HArray1OfPISeg(0,myMxPISeg); - myPINod = new HLRAlgo_HArray1OfPINod(0,myMxPINod); + Standard_Integer i = 0; + + + + HLRAlgo_Array1OfPINod& PINod = myPINod->ChangeArray1(); Handle(HLRAlgo_PolyInternalNode)* NN = &(PINod.ChangeValue(1)); @@ -65,8 +65,8 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData, HLRAlgo_Array1OfPISeg& thePISeg, HLRAlgo_Array1OfPINod& thePINod) { - Standard_Integer n1,n2; - Standard_Integer find,iiii,icsv = 0; + Standard_Integer n1 = 0,n2 = 0; + Standard_Integer find = 0,iiii = 0,icsv = 0; HLRAlgo_PolyInternalSegment* aSegIndices = NULL; Standard_Boolean newSeg = Standard_False; @@ -338,7 +338,7 @@ HLRAlgo_PolyInternalData::UpdateLinks (const Standard_Integer ip1, HLRAlgo_Array1OfPINod*& PINod1, HLRAlgo_Array1OfPINod*& ) { - Standard_Integer find,iiii,iisv,icsv,iip2 =0,cnx1 =0,cnx2 =0; + Standard_Integer find = 0,iiii = 0,iisv = 0,icsv = 0,iip2 =0,cnx1 =0,cnx2 =0; HLRAlgo_PolyInternalSegment* aSegIndices = NULL; HLRAlgo_PolyInternalSegment* aSegIndices2 = NULL; find = 0; @@ -420,8 +420,8 @@ HLRAlgo_PolyInternalData::UpdateLinks (const Standard_Integer ip1, aSegIndices2->Conex2 = cnx2; aNodIndices3.NdSg = find; - Standard_Integer iOld,iNew,iTr,skip,ip4,itpk[2]; - Standard_Integer n1,n2,n3,nOld[3],nNew[3],New[4]; + Standard_Integer iOld = 0,iNew = 0,iTr = 0,skip = 0,ip4 = 0,itpk[2]; + Standard_Integer n1 = 0,n2 = 0,n3 = 0,nOld[3],nNew[3],New[4]; New[0] = cnx1; New[2] = myNbTData + 1; if (cnx2 == 0) { @@ -621,7 +621,7 @@ HLRAlgo_PolyInternalData::UpdateLinks (const Standard_Integer ip1, void HLRAlgo_PolyInternalData::Dump () const { - Standard_Integer i;//,i1,i2,i3; + Standard_Integer i = 0;//,i1,i2,i3; HLRAlgo_Array1OfTData* TData = &myTData->ChangeArray1(); HLRAlgo_Array1OfPISeg* PISeg = &myPISeg->ChangeArray1(); HLRAlgo_Array1OfPINod* PINod = &myPINod->ChangeArray1(); @@ -673,7 +673,7 @@ void HLRAlgo_PolyInternalData::IncTData( if (HLRAlgo_PolyInternalData_TRACE) std::cout << "HLRAlgo_PolyInternalData::IncTData : " << myMxTData << std::endl; #endif - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; j = myMxTData; k = 2 * j; @@ -712,7 +712,7 @@ void HLRAlgo_PolyInternalData::IncPISeg( if (HLRAlgo_PolyInternalData_TRACE) std::cout << "HLRAlgo_PolyInternalData::IncPISeg : " << myMxPISeg << std::endl; #endif - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; j = myMxPISeg; k = 2 * j; Handle(HLRAlgo_HArray1OfPISeg) NwPISeg = @@ -750,7 +750,7 @@ void HLRAlgo_PolyInternalData::IncPINod (HLRAlgo_Array1OfPINod*& PINod1, if (HLRAlgo_PolyInternalData_TRACE) std::cout << "HLRAlgo_PolyInternalData::IncPINod : " << myMxPINod << std::endl; #endif - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; j = myMxPINod; k = 2 * j; Handle(HLRAlgo_HArray1OfPINod) NwPINod = new HLRAlgo_HArray1OfPINod(0,k); diff --git a/src/HLRAlgo/HLRAlgo_PolyShellData.hxx b/src/HLRAlgo/HLRAlgo_PolyShellData.hxx index 04bcf21adc..4fddbd39ef 100644 --- a/src/HLRAlgo/HLRAlgo_PolyShellData.hxx +++ b/src/HLRAlgo/HLRAlgo_PolyShellData.hxx @@ -58,7 +58,7 @@ public: private: - ShellIndices myIndices; + ShellIndices myIndices{}; NCollection_Array1 myPolyg; NCollection_Array1 myHPolHi; HLRAlgo_ListOfBPoint mySegList; diff --git a/src/HLRAlgo/HLRAlgo_Projector.cxx b/src/HLRAlgo/HLRAlgo_Projector.cxx index e787c701a6..69cc0725bb 100644 --- a/src/HLRAlgo/HLRAlgo_Projector.cxx +++ b/src/HLRAlgo/HLRAlgo_Projector.cxx @@ -19,6 +19,8 @@ #endif +#include + #include #include #include @@ -196,7 +198,7 @@ void HLRAlgo_Projector::Scaled (const Standard_Boolean On) void HLRAlgo_Projector::Project (const gp_Pnt& P, gp_Pnt2d& Pout) const { if(myType!=-1) { - Standard_Real X,Y; + Standard_Real X = NAN,Y = NAN; switch (myType) { case 0: { //-- axono standard Standard_Real x07 = P.X()*0.7071067811865475; diff --git a/src/HLRAlgo/HLRAlgo_Projector.hxx b/src/HLRAlgo/HLRAlgo_Projector.hxx index baec03ebba..bf3650b7b2 100644 --- a/src/HLRAlgo/HLRAlgo_Projector.hxx +++ b/src/HLRAlgo/HLRAlgo_Projector.hxx @@ -119,7 +119,7 @@ private: Standard_EXPORT void SetDirection(); - Standard_Integer myType; + Standard_Integer myType{}; Standard_Boolean myPersp; Standard_Real myFocus; gp_Trsf myScaledTrsf; diff --git a/src/HLRAppli/HLRAppli_ReflectLines.cxx b/src/HLRAppli/HLRAppli_ReflectLines.cxx index de98a22477..56a759b366 100644 --- a/src/HLRAppli/HLRAppli_ReflectLines.cxx +++ b/src/HLRAppli/HLRAppli_ReflectLines.cxx @@ -26,9 +26,9 @@ //purpose : Constructor //======================================================================= -HLRAppli_ReflectLines::HLRAppli_ReflectLines(const TopoDS_Shape& aShape) +HLRAppli_ReflectLines::HLRAppli_ReflectLines(const TopoDS_Shape& aShape) : myShape(aShape) { - myShape = aShape; + } //======================================================================= diff --git a/src/HLRBRep/HLRBRep.cxx b/src/HLRBRep/HLRBRep.cxx index 6f5fc6356d..10bd4b13f8 100644 --- a/src/HLRBRep/HLRBRep.cxx +++ b/src/HLRBRep/HLRBRep.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -88,7 +90,7 @@ TopoDS_Edge HLRBRep::MakeEdge (const HLRBRep_Curve& ec, Handle(Geom2d_BSplineCurve) ec2d; GeomAdaptor_Curve GAcurve = ec.GetCurve().Curve(); TopoDS_Edge anEdge = ec.GetCurve().Edge(); - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar); if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve(); @@ -179,7 +181,7 @@ TopoDS_Edge HLRBRep::MakeEdge3d(const HLRBRep_Curve& ec, //const Standard_Real end = ec.Parameter2d(U2); TopoDS_Edge anEdge = ec.GetCurve().Edge(); - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; //BRep_Tool::Range(anEdge, fpar, lpar); //Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar); BRepAdaptor_Curve BAcurve(anEdge); diff --git a/src/HLRBRep/HLRBRep_BSurfaceTool.cxx b/src/HLRBRep/HLRBRep_BSurfaceTool.cxx index e4db3314e0..00f652d1d1 100644 --- a/src/HLRBRep/HLRBRep_BSurfaceTool.cxx +++ b/src/HLRBRep/HLRBRep_BSurfaceTool.cxx @@ -24,7 +24,7 @@ Standard_Integer HLRBRep_BSurfaceTool::NbSamplesU(const BRepAdaptor_Surface& S) { - Standard_Integer nbs; + Standard_Integer nbs = 0; GeomAbs_SurfaceType typS = S.GetType(); switch(typS) { case GeomAbs_Plane: @@ -77,7 +77,7 @@ HLRBRep_BSurfaceTool::NbSamplesU(const BRepAdaptor_Surface& S) Standard_Integer HLRBRep_BSurfaceTool::NbSamplesV(const BRepAdaptor_Surface& S) { - Standard_Integer nbs; + Standard_Integer nbs = 0; GeomAbs_SurfaceType typS = S.GetType(); switch(typS) { case GeomAbs_Plane: diff --git a/src/HLRBRep/HLRBRep_Curve.cxx b/src/HLRBRep/HLRBRep_Curve.cxx index ab1869b36f..a98926dd58 100644 --- a/src/HLRBRep/HLRBRep_Curve.cxx +++ b/src/HLRBRep/HLRBRep_Curve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -224,17 +226,17 @@ Standard_Real HLRBRep_Curve::UpdateMinMax( { Standard_Real a = HLRBRep_BCurveTool::FirstParameter(myCurve); Standard_Real b = HLRBRep_BCurveTool::LastParameter(myCurve); - Standard_Real x,y,z,tolMinMax = 0; + Standard_Real x = NAN,y = NAN,z = NAN,tolMinMax = 0; ((HLRAlgo_Projector*) myProj)->Project(Value3D(a),x,y,z); HLRAlgo::UpdateMinMax(x,y,z,TotMin,TotMax); if (myType != GeomAbs_Line) { Standard_Integer nbPnt = 30; - Standard_Integer i; + Standard_Integer i = 0; Standard_Real step = (b-a)/(nbPnt+1); - Standard_Real xa,ya,za,xb =0.,yb =0.,zb =0.; - Standard_Real dx1,dy1,dz1,dd1; - Standard_Real dx2,dy2,dz2,dd2; + Standard_Real xa = NAN,ya = NAN,za = NAN,xb =0.,yb =0.,zb =0.; + Standard_Real dx1 = NAN,dy1 = NAN,dz1 = NAN,dd1 = NAN; + Standard_Real dx2 = NAN,dy2 = NAN,dz2 = NAN,dd2 = NAN; for (i = 1; i <= nbPnt; i++) { a += step; diff --git a/src/HLRBRep/HLRBRep_Curve.hxx b/src/HLRBRep/HLRBRep_Curve.hxx index 81d7a19b22..2b617416cc 100644 --- a/src/HLRBRep/HLRBRep_Curve.hxx +++ b/src/HLRBRep/HLRBRep_Curve.hxx @@ -214,12 +214,12 @@ private: BRepAdaptor_Curve myCurve; GeomAbs_CurveType myType; - const HLRAlgo_Projector* myProj; - Standard_Real myOX; - Standard_Real myOZ; - Standard_Real myVX; - Standard_Real myVZ; - Standard_Real myOF; + const HLRAlgo_Projector* myProj{}; + Standard_Real myOX{}; + Standard_Real myOZ{}; + Standard_Real myVX{}; + Standard_Real myVZ{}; + Standard_Real myOF{}; }; diff --git a/src/HLRBRep/HLRBRep_Data.cxx b/src/HLRBRep/HLRBRep_Data.cxx index 2cebfec692..c71e68283f 100644 --- a/src/HLRBRep/HLRBRep_Data.cxx +++ b/src/HLRBRep/HLRBRep_Data.cxx @@ -41,6 +41,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_Data,Standard_Transient) @@ -96,8 +97,8 @@ private: public: //-- ============================================================ - TableauRejection() { - N=0; nTabBit=0; UV=NULL; nbUV=NULL; IndUV=NULL; TabBit=NULL; + TableauRejection() : UV(NULL), IndUV(NULL), nbUV(NULL), N(0), TabBit(NULL), nTabBit(0) { + #ifdef OCCT_DEBUG StNbLect=StNbEcr=StNbMax=StNbMoy=StNbMoyNonNul=0; #endif @@ -117,7 +118,7 @@ public: IndUV = (Standard_Integer **) malloc(N*sizeof(Standard_Integer *)); nbUV = (Standard_Integer *) malloc(N*sizeof(Standard_Integer)); // for(Standard_Integer i=0;iStatus().Bounds(p,t,p2,t2); if (E->VerAtSta()) p = p + (p2 - p) * CutBig; @@ -411,9 +412,9 @@ HLRBRep_Data::HLRBRep_Data (const Standard_Integer NV, myLLProps(2,Epsilon(1.)), myFLProps(2,Epsilon(1.)), mySLProps(2,Epsilon(1.)), - myHideCount(0) + myHideCount(0), myReject(new TableauRejection()) { - myReject = new TableauRejection(); + ((TableauRejection *)myReject)->SetDim(myNbEdges); } @@ -491,21 +492,21 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P) { myProj = P; const gp_Trsf& T = myProj.Transformation(); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real tolMinMax = 0; - HLRAlgo_EdgesBlock::MinMaxIndices FaceMin, FaceMax; - HLRAlgo_EdgesBlock::MinMaxIndices MinMaxFace; - HLRAlgo_EdgesBlock::MinMaxIndices WireMin, WireMax, MinMaxWire; - HLRAlgo_EdgesBlock::MinMaxIndices EdgeMin, EdgeMax; - HLRAlgo_EdgesBlock::MinMaxIndices MinMaxEdge; + HLRAlgo_EdgesBlock::MinMaxIndices FaceMin{}, FaceMax{}; + HLRAlgo_EdgesBlock::MinMaxIndices MinMaxFace{}; + HLRAlgo_EdgesBlock::MinMaxIndices WireMin{}, WireMax{}, MinMaxWire{}; + HLRAlgo_EdgesBlock::MinMaxIndices EdgeMin{}, EdgeMax{}; + HLRAlgo_EdgesBlock::MinMaxIndices MinMaxEdge{}; Standard_Real TotMin[16],TotMax[16]; HLRAlgo::InitMinMax(Precision::Infinite(), TotMin, TotMax); // compute the global MinMax // ************************* // for (Standard_Integer edge = 1; edge <= myNbEdges; edge++) { - Standard_Integer edge; + Standard_Integer edge = 0; for ( edge = 1; edge <= myNbEdges; edge++) { HLRBRep_EdgeData& ed = myEData.ChangeValue(edge); HLRBRep_Curve& EC = ed.ChangeGeometry(); @@ -531,8 +532,8 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P) for (i = 0; i <= 15; i++) myDeca[i] = - TotMin[i] + precad; - Standard_Real tol; - Standard_Boolean ver1,ver2; + Standard_Real tol = NAN; + Standard_Boolean ver1 = 0,ver2 = 0; // update the edges // **************** @@ -694,7 +695,7 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P) fd.Back(Standard_False); } else if (!fd.WithOutL()) { - Standard_Real p,pu,pv,r; + Standard_Real p = NAN,pu = NAN,pv = NAN,r = NAN; fd.Back(Standard_False); Standard_Boolean found = Standard_False; @@ -1185,7 +1186,7 @@ void HLRBRep_Data::NextInterference () myIntersector.Perform(myLEData,da1,db1); } else { - Standard_Real su,sv; + Standard_Real su = NAN,sv = NAN; ((TableauRejection *)myReject)-> GetSingleIntersection(myLE,myFE,su,sv); if(su!=RealLast()) { @@ -1355,7 +1356,7 @@ void HLRBRep_Data::EdgeState (const Standard_Real p1, // this method should give the states before and after // it should get the parameters on the surface - Standard_Real pu,pv; + Standard_Real pu = NAN,pv = NAN; if (HLRBRep_EdgeFaceTool::UVPoint(p2,myFEGeom,iFaceGeom,pu,pv)) { mySLProps.SetParameters(pu,pv); @@ -1414,13 +1415,13 @@ HLRBRep_Data::HidingStartLevel (const Standard_Integer E, const HLRBRep_EdgeData& ED, const HLRAlgo_InterferenceList& IL) { - Standard_Boolean Loop; + Standard_Boolean Loop = 0; HLRAlgo_ListIteratorOfInterferenceList It; const HLRBRep_Curve& EC = ED.Geometry(); Standard_Real sta = EC.Parameter3d(EC.FirstParameter()); Standard_Real end = EC.Parameter3d(EC.LastParameter()); Standard_Real tolpar = (end - sta) * 0.01; - Standard_Real param; + Standard_Real param = NAN; Loop = Standard_True; It.Initialize(IL); @@ -1498,7 +1499,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer I, HLRBRep_ const Handle(HLRAlgo_WiresBlock)& wb = FD.Wires(); Standard_Integer nw = wb->NbWires(); - Standard_Integer iw1,ie1,ne1; + Standard_Integer iw1 = 0,ie1 = 0,ne1 = 0; const gp_Trsf& T = myProj.Transformation(); const gp_Trsf& TI = myProj.InvertedTransformation(); Standard_Boolean inverted = Standard_False; @@ -1517,7 +1518,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer I, HLRBRep_ else ed1.Used(Standard_False); if ((eb1->OutLine(ie1) || eb1->Internal(ie1)) && !ed1.Vertical()) { - Standard_Real p,pu,pv,r; + Standard_Real p = NAN,pu = NAN,pv = NAN,r = NAN; myFEGeom = &(ed1.ChangeGeometry()); const HLRBRep_Curve& EC = ed1.Geometry(); Standard_Integer vsta = ed1.VSta(); @@ -1605,10 +1606,10 @@ Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer I, HLRBRep_ void HLRBRep_Data::OrientOthEdge (const Standard_Integer I, HLRBRep_FaceData& FD) { - Standard_Real p,pu,pv,r; + Standard_Real p = NAN,pu = NAN,pv = NAN,r = NAN; const Handle(HLRAlgo_WiresBlock)& wb = FD.Wires(); Standard_Integer nw = wb->NbWires(); - Standard_Integer iw1,ie1,ne1; + Standard_Integer iw1 = 0,ie1 = 0,ne1 = 0; const gp_Trsf& T = myProj.Transformation(); for (iw1 = 1; iw1 <= nw; iw1++) { @@ -1721,15 +1722,15 @@ HLRBRep_Data::Classify (const Standard_Integer E, (void)E; // avoid compiler warning nbClassification++; - HLRAlgo_EdgesBlock::MinMaxIndices VertMin, VertMax, MinMaxVert; + HLRAlgo_EdgesBlock::MinMaxIndices VertMin{}, VertMax{}, MinMaxVert{}; Standard_Real TotMin[16],TotMax[16]; - Standard_Integer i; + Standard_Integer i = 0; Level = 0; TopAbs_State state = TopAbs_OUT; // Standard_Boolean rej = Standard_False; const HLRBRep_Curve& EC = ED.Geometry(); - Standard_Real sta,xsta,ysta,zsta,end,xend,yend,zend; + Standard_Real sta = NAN,xsta = NAN,ysta = NAN,zsta = NAN,end = NAN,xend = NAN,yend = NAN,zend = NAN; Standard_Real tol = (Standard_Real)(ED.Tolerance()); if (LevelFlag) { @@ -1916,7 +1917,7 @@ HLRBRep_Data::Classify (const Standard_Integer E, else TolZ = myBigSize * 0.01; } wLim -= TolZ; - Standard_Real PeriodU,PeriodV,UMin =0.,UMax =0.,VMin =0.,VMax =0.; + Standard_Real PeriodU = NAN,PeriodV = NAN,UMin =0.,UMax =0.,VMin =0.,VMax =0.; if (((HLRBRep_Surface*)iFaceGeom)->IsUPeriodic()) { PeriodU = ((HLRBRep_Surface*)iFaceGeom)->UPeriod(); UMin = ((HLRBRep_Surface*)iFaceGeom)->FirstUParameter(); @@ -1932,13 +1933,13 @@ HLRBRep_Data::Classify (const Standard_Integer E, else PeriodV = 0; gp_Pnt PInter; - Standard_Real u,v,w; + Standard_Real u = NAN,v = NAN,w = NAN; IntCurveSurface_TransitionOnCurve Tr; for (i = 1; i <= nbPoints; i++) { myIntersector.CSPoint(i).Values(PInter,u,v,w,Tr); if (w < wLim) { - Standard_Real aDummyShift; + Standard_Real aDummyShift = NAN; if (PeriodU > 0.) GeomInt::AdjustPeriodic(u, UMin, UMax, PeriodU, u, aDummyShift); if (PeriodV > 0.) @@ -1974,14 +1975,14 @@ TopAbs_State HLRBRep_Data::SimplClassify (const Standard_Integer /*E*/, const Standard_Real p2) { nbClassification++; - HLRAlgo_EdgesBlock::MinMaxIndices VertMin, VertMax, MinMaxVert; + HLRAlgo_EdgesBlock::MinMaxIndices VertMin{}, VertMax{}, MinMaxVert{}; Standard_Real TotMin[16],TotMax[16]; - Standard_Integer i; + Standard_Integer i = 0; TopAbs_State state = TopAbs_IN; // Standard_Boolean rej = Standard_False; const HLRBRep_Curve& EC = ED.Geometry(); - Standard_Real sta,xsta,ysta,zsta, dp; + Standard_Real sta = NAN,xsta = NAN,ysta = NAN,zsta = NAN, dp = NAN; Standard_Real tol = (Standard_Real)(ED.Tolerance()); dp = (p2 - p1)/(Nbp+1); @@ -2029,15 +2030,15 @@ HLRBRep_Data::RejectedPoint (const IntRes2d_IntersectionPoint& PInter, const Standard_Integer NumSeg) { Standard_Integer Ind = 0; - Standard_Integer decal; - Standard_Real p1,p2,dz; - Standard_ShortReal t1,t2; + Standard_Integer decal = 0; + Standard_Real p1 = NAN,p2 = NAN,dz = NAN; + Standard_ShortReal t1 = NAN,t2 = NAN; TopAbs_State st; TopAbs_Orientation Orie =TopAbs_FORWARD ; TopAbs_Orientation Or2 = TopAbs_INTERNAL; Standard_Boolean inverted = Standard_False; - const IntRes2d_Transition* Tr1; - const IntRes2d_Transition* Tr2; + const IntRes2d_Transition* Tr1 = nullptr; + const IntRes2d_Transition* Tr2 = nullptr; Standard_Real TolZ = myBigSize * 0.00001; p1 = ((HLRBRep_Curve*)myLEGeom)->Parameter3d(PInter.ParamOnFirst ()); @@ -2230,7 +2231,7 @@ Standard_Boolean HLRBRep_Data::SameVertex (const Standard_Boolean h1, const Standard_Boolean h2) { - Standard_Integer v1,v2; + Standard_Integer v1 = 0,v2 = 0; if (h1) v1 = ((HLRBRep_EdgeData*)myLEData)->VSta(); else v1 = ((HLRBRep_EdgeData*)myLEData)->VEnd(); if (h2) v2 = ((HLRBRep_EdgeData*)myFEData)->VSta(); diff --git a/src/HLRBRep/HLRBRep_Data.hxx b/src/HLRBRep/HLRBRep_Data.hxx index 121ec30824..4b0483bee9 100644 --- a/src/HLRBRep/HLRBRep_Data.hxx +++ b/src/HLRBRep/HLRBRep_Data.hxx @@ -212,51 +212,51 @@ private: HLRBRep_CLProps myLLProps; HLRBRep_CLProps myFLProps; HLRBRep_SLProps mySLProps; - Standard_Real myBigSize; + Standard_Real myBigSize{}; HLRBRep_FaceIterator myFaceItr1; HLRBRep_FaceIterator myFaceItr2; - Standard_Integer iFace; - HLRBRep_FaceData* iFaceData; - Standard_Address iFaceGeom; - HLRAlgo_EdgesBlock::MinMaxIndices* iFaceMinMax; + Standard_Integer iFace{}; + HLRBRep_FaceData* iFaceData{}; + Standard_Address iFaceGeom{}; + HLRAlgo_EdgesBlock::MinMaxIndices* iFaceMinMax{}; GeomAbs_SurfaceType iFaceType; - Standard_Boolean iFaceBack; - Standard_Boolean iFaceSimp; - Standard_Boolean iFaceSmpl; - Standard_Boolean iFaceTest; + Standard_Boolean iFaceBack{}; + Standard_Boolean iFaceSimp{}; + Standard_Boolean iFaceSmpl{}; + Standard_Boolean iFaceTest{}; Standard_Integer myHideCount; - Standard_Real myDeca[16]; - Standard_Real mySurD[16]; - Standard_Integer myCurSortEd; - Standard_Integer myNbrSortEd; - Standard_Integer myLE; - Standard_Boolean myLEOutLine; - Standard_Boolean myLEInternal; - Standard_Boolean myLEDouble; - Standard_Boolean myLEIsoLine; - HLRBRep_EdgeData* myLEData; - const HLRBRep_Curve* myLEGeom; - HLRAlgo_EdgesBlock::MinMaxIndices* myLEMinMax; + Standard_Real myDeca[16]{}; + Standard_Real mySurD[16]{}; + Standard_Integer myCurSortEd{}; + Standard_Integer myNbrSortEd{}; + Standard_Integer myLE{}; + Standard_Boolean myLEOutLine{}; + Standard_Boolean myLEInternal{}; + Standard_Boolean myLEDouble{}; + Standard_Boolean myLEIsoLine{}; + HLRBRep_EdgeData* myLEData{}; + const HLRBRep_Curve* myLEGeom{}; + HLRAlgo_EdgesBlock::MinMaxIndices* myLEMinMax{}; GeomAbs_CurveType myLEType; - Standard_ShortReal myLETol; - Standard_Integer myFE; + Standard_ShortReal myLETol{}; + Standard_Integer myFE{}; TopAbs_Orientation myFEOri; - Standard_Boolean myFEOutLine; - Standard_Boolean myFEInternal; - Standard_Boolean myFEDouble; - HLRBRep_EdgeData* myFEData; - HLRBRep_Curve* myFEGeom; + Standard_Boolean myFEOutLine{}; + Standard_Boolean myFEInternal{}; + Standard_Boolean myFEDouble{}; + HLRBRep_EdgeData* myFEData{}; + HLRBRep_Curve* myFEGeom{}; GeomAbs_CurveType myFEType; - Standard_ShortReal myFETol; + Standard_ShortReal myFETol{}; HLRBRep_Intersector myIntersector; Handle(BRepTopAdaptor_TopolTool) myClassifier; - Standard_Boolean mySameVertex; - Standard_Boolean myIntersected; - Standard_Integer myNbPoints; - Standard_Integer myNbSegments; - Standard_Integer iInterf; + Standard_Boolean mySameVertex{}; + Standard_Boolean myIntersected{}; + Standard_Integer myNbPoints{}; + Standard_Integer myNbSegments{}; + Standard_Integer iInterf{}; HLRAlgo_Interference myIntf; - Standard_Boolean myAboveIntf; + Standard_Boolean myAboveIntf{}; TableauRejection* myReject; }; diff --git a/src/HLRBRep/HLRBRep_EdgeBuilder.hxx b/src/HLRBRep/HLRBRep_EdgeBuilder.hxx index 2ebcec31d2..806c8ec0ea 100644 --- a/src/HLRBRep/HLRBRep_EdgeBuilder.hxx +++ b/src/HLRBRep/HLRBRep_EdgeBuilder.hxx @@ -127,7 +127,7 @@ private: Handle(HLRBRep_AreaLimit) myLimits; Handle(HLRBRep_AreaLimit) left; Handle(HLRBRep_AreaLimit) right; - Standard_Integer current; + Standard_Integer current{}; }; diff --git a/src/HLRBRep/HLRBRep_EdgeFaceTool.cxx b/src/HLRBRep/HLRBRep_EdgeFaceTool.cxx index a2984bcc3e..1d30e4ce0b 100644 --- a/src/HLRBRep/HLRBRep_EdgeFaceTool.cxx +++ b/src/HLRBRep/HLRBRep_EdgeFaceTool.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -70,7 +72,7 @@ Standard_Boolean HLRBRep_EdgeFaceTool::UVPoint(const Standard_Real Par, Standard_Real& U, Standard_Real& V) { - Standard_Real pfbid,plbid; + Standard_Real pfbid = NAN,plbid = NAN; if (BRep_Tool::CurveOnSurface (((HLRBRep_Curve *)E)->Curve().Edge(), ((HLRBRep_Surface*)F)->Surface().Face(),pfbid,plbid).IsNull()) @@ -78,7 +80,7 @@ Standard_Boolean HLRBRep_EdgeFaceTool::UVPoint(const Standard_Real Par, BRepExtrema_ExtPF proj (BRepLib_MakeVertex(((HLRBRep_Curve*)E)->Value3D(Par)), ((HLRBRep_Surface*)F)->Surface().Face()); - Standard_Integer i, index = 0; + Standard_Integer i = 0, index = 0; Standard_Real dist2 = RealLast(); const Standard_Integer n = proj.NbExt(); for (i = 1; i <= n; i++) { diff --git a/src/HLRBRep/HLRBRep_EdgeIList.cxx b/src/HLRBRep/HLRBRep_EdgeIList.cxx index b416ea7fe1..48876aab48 100644 --- a/src/HLRBRep/HLRBRep_EdgeIList.cxx +++ b/src/HLRBRep/HLRBRep_EdgeIList.cxx @@ -19,6 +19,8 @@ #endif +#include + #include #include #include @@ -77,7 +79,7 @@ ProcessComplex(HLRAlgo_InterferenceList& IL, TopCnx_EdgeFaceTransition transTool; gp_Dir TgtE, NormE, TgtI, NormI; const Standard_Real TolAng = 0.0001; - Standard_Real CurvE, CurvI; + Standard_Real CurvE = NAN, CurvI = NAN; HLRAlgo_ListIteratorOfInterferenceList It1(IL); while (It1.More()) { diff --git a/src/HLRBRep/HLRBRep_EdgeInterferenceTool.cxx b/src/HLRBRep/HLRBRep_EdgeInterferenceTool.cxx index f888d8a4f4..ebb031758a 100644 --- a/src/HLRBRep/HLRBRep_EdgeInterferenceTool.cxx +++ b/src/HLRBRep/HLRBRep_EdgeInterferenceTool.cxx @@ -19,6 +19,8 @@ #endif +#include + #include #include @@ -38,8 +40,8 @@ HLRBRep_EdgeInterferenceTool::HLRBRep_EdgeInterferenceTool void HLRBRep_EdgeInterferenceTool::LoadEdge() { - Standard_Real p1,p2; - Standard_ShortReal t1,t2; + Standard_Real p1 = NAN,p2 = NAN; + Standard_ShortReal t1 = NAN,t2 = NAN; HLRBRep_Array1OfEData& ED = myDS->EDataArray(); HLRBRep_EdgeData& ed = ED(myDS->Edge()); ed.Status().Bounds(p1,t1,p2,t2); @@ -108,8 +110,8 @@ void HLRBRep_EdgeInterferenceTool::InterferenceBoundaryGeometry gp_Dir& Norm, Standard_Real& CrFE) const { - Standard_Integer FE; - Standard_Real Param; + Standard_Integer FE = 0; + Standard_Real Param = NAN; gp_Dir2d TgFE,NmFE; I.Boundary().Value2D(FE,Param); myDS->LocalFEGeometry2D(FE,Param,TgFE,NmFE,CrFE); diff --git a/src/HLRBRep/HLRBRep_EdgeInterferenceTool.hxx b/src/HLRBRep/HLRBRep_EdgeInterferenceTool.hxx index 7633bcbed8..37e5c4aefe 100644 --- a/src/HLRBRep/HLRBRep_EdgeInterferenceTool.hxx +++ b/src/HLRBRep/HLRBRep_EdgeInterferenceTool.hxx @@ -92,7 +92,7 @@ private: Handle(HLRBRep_Data) myDS; HLRAlgo_Intersection inter[2]; - Standard_Integer cur; + Standard_Integer cur{}; }; diff --git a/src/HLRBRep/HLRBRep_FaceData.hxx b/src/HLRBRep/HLRBRep_FaceData.hxx index 497772349f..80e32ec152 100644 --- a/src/HLRBRep/HLRBRep_FaceData.hxx +++ b/src/HLRBRep/HLRBRep_FaceData.hxx @@ -143,7 +143,7 @@ private: Handle(HLRAlgo_WiresBlock) myWires; HLRBRep_Surface myGeometry; Standard_Real mySize; - Standard_ShortReal myTolerance; + Standard_ShortReal myTolerance{}; }; diff --git a/src/HLRBRep/HLRBRep_FaceIterator.hxx b/src/HLRBRep/HLRBRep_FaceIterator.hxx index dacea08a9b..937454627e 100644 --- a/src/HLRBRep/HLRBRep_FaceIterator.hxx +++ b/src/HLRBRep/HLRBRep_FaceIterator.hxx @@ -84,10 +84,10 @@ private: - Standard_Integer iWire; - Standard_Integer nbWires; - Standard_Integer iEdge; - Standard_Integer nbEdges; + Standard_Integer iWire{}; + Standard_Integer nbWires{}; + Standard_Integer iEdge{}; + Standard_Integer nbEdges{}; Handle(HLRAlgo_WiresBlock) myWires; Handle(HLRAlgo_EdgesBlock) myEdges; diff --git a/src/HLRBRep/HLRBRep_HLRToShape.cxx b/src/HLRBRep/HLRBRep_HLRToShape.cxx index b9cd3e1ed9..092c829926 100644 --- a/src/HLRBRep/HLRBRep_HLRToShape.cxx +++ b/src/HLRBRep/HLRBRep_HLRToShape.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -60,7 +62,7 @@ HLRBRep_HLRToShape::InternalCompound (const Standard_Integer typ, Standard_Boolean explor = Standard_False; // Standard_Boolean todraw; if (!S.IsNull()) { - Standard_Integer v1,v2; + Standard_Integer v1 = 0,v2 = 0; Standard_Integer index = myAlgo->Index(S); if (index == 0) explor = Standard_True; else myAlgo->ShapeBounds(index).Bounds(v1,v2,e1,e2,f1,f2); @@ -150,7 +152,7 @@ HLRBRep_HLRToShape::DrawFace (const Standard_Boolean visible, Standard_Integer ie = Itf.Edge(); HLRBRep_EdgeData& edf = DS->EDataArray().ChangeValue(ie); if (!edf.Used()) { - Standard_Boolean todraw; + Standard_Boolean todraw = 0; if (typ == 1) todraw = Itf.IsoLine(); else if (typ == 2) //outlines { @@ -213,8 +215,8 @@ HLRBRep_HLRToShape::DrawEdge (const Standard_Boolean visible, else todraw =!ed.Rg1Line(); if (todraw) { - Standard_Real sta,end; - Standard_ShortReal tolsta,tolend; + Standard_Real sta = NAN,end = NAN; + Standard_ShortReal tolsta = NAN,tolend = NAN; BRep_Builder B; TopoDS_Edge E; HLRAlgo_EdgeIterator It; diff --git a/src/HLRBRep/HLRBRep_Hider.cxx b/src/HLRBRep/HLRBRep_Hider.cxx index b97392a3f1..161c4eb268 100644 --- a/src/HLRBRep/HLRBRep_Hider.cxx +++ b/src/HLRBRep/HLRBRep_Hider.cxx @@ -17,6 +17,8 @@ #define No_Standard_OutOfRange +#include + #include #include #include @@ -136,7 +138,7 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI, } //-- ============================================================ - Standard_Boolean Modif; + Standard_Boolean Modif = 0; do { Modif = Standard_False; HLRAlgo_ListIteratorOfInterferenceList ItSegHidden1(ILHidden); @@ -447,7 +449,7 @@ void HLRBRep_Hider::Hide(const Standard_Integer FI, TopAbs_State aBuildIN = TopAbs_IN; Standard_Boolean IsSuspicion = Standard_True; - Standard_Real pmax, pmin; + Standard_Real pmax = NAN, pmin = NAN; Standard_Boolean allInt = Standard_False; Standard_Boolean allFor = Standard_False; Standard_Boolean allRev = Standard_False; diff --git a/src/HLRBRep/HLRBRep_InternalAlgo.cxx b/src/HLRBRep/HLRBRep_InternalAlgo.cxx index d8f2b9d141..56e4751106 100644 --- a/src/HLRBRep/HLRBRep_InternalAlgo.cxx +++ b/src/HLRBRep/HLRBRep_InternalAlgo.cxx @@ -59,12 +59,12 @@ myDebug (Standard_False) //======================================================================= HLRBRep_InternalAlgo:: -HLRBRep_InternalAlgo (const Handle(HLRBRep_InternalAlgo)& A) +HLRBRep_InternalAlgo (const Handle(HLRBRep_InternalAlgo)& A) : myProj(A->Projector()), myShapes(A->SeqOfShapeBounds()), myDebug(A->Debug()) { myDS = A->DataStructure(); - myProj = A->Projector(); - myShapes = A->SeqOfShapeBounds(); - myDebug = A->Debug(); + + + } //======================================================================= @@ -96,7 +96,7 @@ void HLRBRep_InternalAlgo::Update () Standard_Integer n = myShapes.Length(); Handle(HLRBRep_Data) *DS = new Handle(HLRBRep_Data) [n]; - Standard_Integer i,dv,de,df,nv=0,ne=0,nf=0; + Standard_Integer i = 0,dv = 0,de = 0,df = 0,nv=0,ne=0,nf=0; for (i = 1; i <= n; i++) { HLRBRep_ShapeBounds& SB = myShapes(i); @@ -152,15 +152,15 @@ void HLRBRep_InternalAlgo::Update () myDS->Update(myProj); - HLRAlgo_EdgesBlock::MinMaxIndices ShapMin, ShapMax, MinMaxShap; - HLRAlgo_EdgesBlock::MinMaxIndices TheMin, TheMax; + HLRAlgo_EdgesBlock::MinMaxIndices ShapMin{}, ShapMax{}, MinMaxShap{}; + HLRAlgo_EdgesBlock::MinMaxIndices TheMin{}, TheMax{}; HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray(); HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray(); for (i = 1; i <= n; i++) { Standard_Boolean FirstTime = Standard_True; HLRBRep_ShapeBounds& SB = myShapes(i); - Standard_Integer v1,v2,e1,e2,f1,f2; + Standard_Integer v1 = 0,v2 = 0,e1 = 0,e2 = 0,f1 = 0,f2 = 0; SB.Bounds(v1,v2,e1,e2,f1,f2); for (Standard_Integer e = e1; e <= e2; e++) { @@ -297,7 +297,7 @@ ShapeBounds (const Standard_Integer I) void HLRBRep_InternalAlgo::InitEdgeStatus () { - Standard_Boolean visible; + Standard_Boolean visible = 0; HLRBRep_FaceIterator faceIt; HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray(); @@ -310,7 +310,7 @@ void HLRBRep_InternalAlgo::InitEdgeStatus () if (ed.Selected()) ed.Status().ShowAll(); } // for (Standard_Integer f = 1; f <= nf; f++) { - Standard_Integer f; + Standard_Integer f = 0; for ( f = 1; f <= nf; f++) { HLRBRep_FaceData& fd = aFDataArray.ChangeValue(f); if (fd.Selected()) { @@ -390,7 +390,7 @@ void HLRBRep_InternalAlgo::Select (const Standard_Integer I) (I == 0 || I > myShapes.Length(), "HLRBRep_InternalAlgo::Select : unknown Shape"); - Standard_Integer v1,v2,e1,e2,f1,f2; + Standard_Integer v1 = 0,v2 = 0,e1 = 0,e2 = 0,f1 = 0,f2 = 0; myShapes(I).Bounds(v1,v2,e1,e2,f1,f2); HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray(); @@ -422,7 +422,7 @@ void HLRBRep_InternalAlgo::SelectEdge (const Standard_Integer I) (I == 0 || I > myShapes.Length(), "HLRBRep_InternalAlgo::SelectEdge : unknown Shape"); - Standard_Integer v1,v2,e1,e2,f1,f2; + Standard_Integer v1 = 0,v2 = 0,e1 = 0,e2 = 0,f1 = 0,f2 = 0; myShapes(I).Bounds(v1,v2,e1,e2,f1,f2); HLRBRep_Array1OfEData& aEDataArray = myDS->EDataArray(); @@ -447,7 +447,7 @@ void HLRBRep_InternalAlgo::SelectFace (const Standard_Integer I) (I == 0 || I > myShapes.Length(), "HLRBRep_InternalAlgo::SelectFace : unknown Shape"); - Standard_Integer v1,v2,e1,e2,f1,f2; + Standard_Integer v1 = 0,v2 = 0,e1 = 0,e2 = 0,f1 = 0,f2 = 0; myShapes(I).Bounds(v1,v2,e1,e2,f1,f2); HLRBRep_Array1OfFData& aFDataArray = myDS->FDataArray(); @@ -552,7 +552,7 @@ void HLRBRep_InternalAlgo::HideAll (const Standard_Integer I) void HLRBRep_InternalAlgo::PartialHide () { if (!myDS.IsNull()) { - Standard_Integer i,n = myShapes.Length(); + Standard_Integer i = 0,n = myShapes.Length(); if (myDebug) std::cout << " Partial hiding" << std::endl << std::endl; @@ -572,7 +572,7 @@ void HLRBRep_InternalAlgo::PartialHide () void HLRBRep_InternalAlgo::Hide () { if (!myDS.IsNull()) { - Standard_Integer i,j,n = myShapes.Length(); + Standard_Integer i = 0,j = 0,n = myShapes.Length(); if (myDebug) std::cout << " Total hiding" << std::endl; @@ -661,8 +661,8 @@ void HLRBRep_InternalAlgo::Hide (const Standard_Integer I, void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I, const Standard_Boolean SideFace) { - Standard_Integer e,f,j,nbVisEdges,nbSelEdges,nbSelFaces,nbCache; - Standard_Integer nbFSide,nbFSimp; + Standard_Integer e = 0,f = 0,j = 0,nbVisEdges = 0,nbSelEdges = 0,nbSelFaces = 0,nbCache = 0; + Standard_Integer nbFSide = 0,nbFSimp = 0; #ifdef OCCT_DEBUG if (myDebug) { @@ -677,7 +677,7 @@ void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I, #endif HLRBRep_ShapeBounds& SB = myShapes(I); - Standard_Integer v1,v2,e1,e2,f1,f2; + Standard_Integer v1 = 0,v2 = 0,e1 = 0,e2 = 0,f1 = 0,f2 = 0; SB.Bounds(v1,v2,e1,e2,f1,f2); if (e2 >= e1) { @@ -733,7 +733,7 @@ void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I, if (nf == 0) return; - Standard_Integer QWE=0,QWEQWE; + Standard_Integer QWE=0,QWEQWE = 0; QWEQWE=nf/10; if (SideFace) { @@ -810,8 +810,8 @@ void HLRBRep_InternalAlgo::HideSelected (const Standard_Integer I, */ //-- ====================================================================== if(nf>2) { - Standard_Integer i,ir,k,l; - Standard_Integer rra; + Standard_Integer i = 0,ir = 0,k = 0,l = 0; + Standard_Integer rra = 0; l=(nf>>1)+1; ir=nf; for(;;) { diff --git a/src/HLRBRep/HLRBRep_Intersector.cxx b/src/HLRBRep/HLRBRep_Intersector.cxx index e4a95f5037..3bda047dc6 100644 --- a/src/HLRBRep/HLRBRep_Intersector.cxx +++ b/src/HLRBRep/HLRBRep_Intersector.cxx @@ -19,6 +19,8 @@ #endif +#include + #include #include #include @@ -106,8 +108,8 @@ void HLRBRep_Intersector::Perform (const Standard_Address A1, myTypePerform = 1; gp_Pnt2d pa,pb;//,pa1,pb1; - Standard_Real a,b,d,tol; - Standard_ShortReal ta,tb; + Standard_Real a = NAN,b = NAN,d = NAN,tol = NAN; + Standard_ShortReal ta = NAN,tb = NAN; ((HLRBRep_EdgeData*) A1)->Status().Bounds(a,ta,b,tb); d = b - a; @@ -156,8 +158,8 @@ void HLRBRep_Intersector::Perform (const Standard_Integer /*nA*/, gp_Pnt2d pa1,pb1,pa2,pb2; gp_Vec2d va1,vb1,va2,vb2; - Standard_Real a1,b1,a2,b2,d,dd,tol,tol1,tol2; - Standard_ShortReal ta,tb; + Standard_Real a1 = NAN,b1 = NAN,a2 = NAN,b2 = NAN,d = NAN,dd = NAN,tol = NAN,tol1 = NAN,tol2 = NAN; + Standard_ShortReal ta = NAN,tb = NAN; //modified by jgv, 18.04.2016 for OCC27341 //tol1 = (Standard_Real)(((HLRBRep_EdgeData*) A1)->Tolerance()); @@ -169,7 +171,7 @@ void HLRBRep_Intersector::Perform (const Standard_Integer /*nA*/, else tol = tol2; - Standard_Boolean PasBon; + Standard_Boolean PasBon = 0; Standard_Real decalagea1=100.0; Standard_Real decalagea2=100.0; Standard_Real decalageb1=100.0; @@ -458,8 +460,8 @@ void HLRBRep_Intersector::Perform (const gp_Lin& L, default : { if (myPolyhedron == NULL) { - Standard_Integer nbsu,nbsv; - Standard_Real u1,v1,u2,v2; + Standard_Integer nbsu = 0,nbsv = 0; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; u1 = HLRBRep_SurfaceTool::FirstUParameter(mySurface); v1 = HLRBRep_SurfaceTool::FirstVParameter(mySurface); u2 = HLRBRep_SurfaceTool::LastUParameter(mySurface); @@ -469,7 +471,7 @@ void HLRBRep_Intersector::Perform (const gp_Lin& L, myPolyhedron = new HLRBRep_ThePolyhedronOfInterCSurf(mySurface,nbsu,nbsv,u1,v1,u2,v2); } - Standard_Real x0,y0,z0,x1,y1,z1,pmin,pmax;//,pp; + Standard_Real x0 = NAN,y0 = NAN,z0 = NAN,x1 = NAN,y1 = NAN,z1 = NAN,pmin = NAN,pmax = NAN;//,pp; myPolyhedron->Bounding().Get(x0,y0,z0,x1,y1,z1); #if 0 pmax = pmin = ElCLib::Parameter(L, gp_Pnt((x1+x0)*0.5, @@ -487,7 +489,7 @@ void HLRBRep_Intersector::Perform (const gp_Lin& L, break; #else //-- On va rejeter tous les points de parametres > P - Standard_Real p; + Standard_Real p = NAN; p = ElCLib::Parameter(L, gp_Pnt(x0,y0,z0)); pmin=pmax=p; p = ElCLib::Parameter(L, gp_Pnt(x0,y0,z1)); if(pmin>p) pmin=p; if(pmax + #include #include @@ -68,26 +70,26 @@ static Standard_Integer DoError = Standard_False; //purpose : //======================================================================= HLRBRep_PolyAlgo::HLRBRep_PolyAlgo() -: myDebug (Standard_False), +: myAlgo(new HLRAlgo_PolyAlgo()), myDebug (Standard_False), myTolSta (0.1), myTolEnd (0.9), myTolAngular(0.001) { - myAlgo = new HLRAlgo_PolyAlgo(); + } //======================================================================= //function : HLRBRep_PolyAlgo //purpose : //======================================================================= -HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const Handle(HLRBRep_PolyAlgo)& theOther) +HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const Handle(HLRBRep_PolyAlgo)& theOther) : myDebug(theOther->Debug()), myTolAngular(theOther->TolAngular()), myTolSta(theOther->TolCoef()), myTolEnd(1.0 - myTolSta), myAlgo(theOther->Algo()), myProj(theOther->Projector()) { - myDebug = theOther->Debug(); - myTolAngular = theOther->TolAngular(); - myTolSta = theOther->TolCoef(); - myTolEnd = 1.0 - myTolSta; - myAlgo = theOther->Algo(); - myProj = theOther->Projector(); + + + + + + const Standard_Integer aNbShapes = theOther->NbShapes(); for (Standard_Integer i = 1; i <= aNbShapes; ++i) @@ -101,13 +103,13 @@ HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const Handle(HLRBRep_PolyAlgo)& theOther) //purpose : //======================================================================= HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const TopoDS_Shape& theShape) -: myDebug (Standard_False), +: myAlgo(new HLRAlgo_PolyAlgo()), myDebug (Standard_False), myTolSta (0.1), myTolEnd (0.9), myTolAngular(0.001) { myShapes.Append (theShape); - myAlgo = new HLRAlgo_PolyAlgo(); + } //======================================================================= @@ -716,7 +718,7 @@ Standard_Boolean HLRBRep_PolyAlgo::AverageNormal (const Standard_Integer iNode, Standard_Real& theZ) const { Standard_Boolean isOK = Standard_False; - Standard_Integer jNode = 0, kNode, iiii; + Standard_Integer jNode = 0, kNode = 0, iiii = 0; theX = 0; theY = 0; theZ = 0; @@ -832,8 +834,8 @@ void HLRBRep_PolyAlgo::InitBiPointsWithConnexity (const Standard_Integer theIEdg TopTools_ListOfShape& theLS, const Standard_Boolean theIsConnex) { - Standard_Real X1 , Y1 , Z1 , X2 , Y2 , Z2 ; - Standard_Real XTI1, YTI1, ZTI1, XTI2, YTI2, ZTI2; + Standard_Real X1 = NAN , Y1 = NAN , Z1 = NAN , X2 = NAN , Y2 = NAN , Z2 = NAN ; + Standard_Real XTI1 = NAN, YTI1 = NAN, ZTI1 = NAN, XTI2 = NAN, YTI2 = NAN, ZTI2 = NAN; Standard_Real U1 = 0.0, U2 = 0.0; Handle(Poly_PolygonOnTriangulation) aHPol[2]; TopLoc_Location aLoc; @@ -2087,7 +2089,7 @@ void HLRBRep_PolyAlgo::InsertOnOutLine (NCollection_Array1& thePID) { Standard_Real X1 =0.,Y1 =0.,X2 =0.,Y2 =0.,X3 =0.,Y3 =0.; - Standard_Real D1,D2,D3; - Standard_Real dd,dX,dY,nX,nY; + Standard_Real D1 = NAN,D2 = NAN,D3 = NAN; + Standard_Real dd = NAN,dX = NAN,dY = NAN,nX = NAN,nY = NAN; HLRAlgo_Array1OfTData* aTData1 = NULL; HLRAlgo_Array1OfPISeg* aPISeg1 = NULL; @@ -2862,7 +2864,7 @@ void HLRBRep_PolyAlgo::OrientTriangle (const Standard_Integer theITri, } else { - Standard_Real o; + Standard_Real o = NAN; if (myProj.Perspective()) { aD *= 1 / aDNorm; @@ -3022,8 +3024,8 @@ void HLRBRep_PolyAlgo::CheckDegeneratedSegment (HLRAlgo_PolyInternalNode::NodeIn void HLRBRep_PolyAlgo::UpdateOutLines (HLRAlgo_ListOfBPoint& theList, NCollection_Array1& thePID) { - Standard_Real X1 ,Y1 ,Z1 ,X2 ,Y2 ,Z2; - Standard_Real XTI1,YTI1,ZTI1,XTI2,YTI2,ZTI2; + Standard_Real X1 = NAN ,Y1 = NAN ,Z1 = NAN ,X2 = NAN ,Y2 = NAN ,Z2 = NAN; + Standard_Real XTI1 = NAN,YTI1 = NAN,ZTI1 = NAN,XTI2 = NAN,YTI2 = NAN,ZTI2 = NAN; const Standard_Integer aNbFaces = myFMap.Extent(); for (Standard_Integer aFaceIter = 1; aFaceIter <= aNbFaces; ++aFaceIter) { @@ -3041,7 +3043,7 @@ void HLRBRep_PolyAlgo::UpdateOutLines (HLRAlgo_ListOfBPoint& theList, HLRAlgo_Array1OfTData& aTData = aPid->TData(); HLRAlgo_Array1OfPISeg& aPISeg = aPid->PISeg(); HLRAlgo_Array1OfPINod& aPINod = aPid->PINod(); - Standard_Integer j,it1,it2,tn1,tn2,tn3,pd,pf; + Standard_Integer j = 0,it1 = 0,it2 = 0,tn1 = 0,tn2 = 0,tn3 = 0,pd = 0,pf = 0; Standard_Boolean isOutl = false; const Standard_Integer aNbSegs = aPid->NbPISeg(); for (Standard_Integer aSegIter = 1; aSegIter <= aNbSegs; ++aSegIter) @@ -3157,7 +3159,7 @@ void HLRBRep_PolyAlgo::UpdateEdgesBiPoints (HLRAlgo_ListOfBPoint& theList, const NCollection_Array1& thePID, const Standard_Boolean theIsClosed) { - Standard_Integer itri1, itri2, tbid; + Standard_Integer itri1 = 0, itri2 = 0, tbid = 0; for (HLRAlgo_ListIteratorOfListOfBPoint aBPntIter (theList); aBPntIter.More(); aBPntIter.Next()) { HLRAlgo_BiPoint& aBP = aBPntIter.ChangeValue(); @@ -3192,7 +3194,7 @@ void HLRBRep_PolyAlgo::UpdateEdgesBiPoints (HLRAlgo_ListOfBPoint& theList, } } - Standard_Boolean isOutl; + Standard_Boolean isOutl = 0; if (!(aTriangle.Flags & HLRAlgo_PolyMask_FMskSide) && !(aTriangle2.Flags & HLRAlgo_PolyMask_FMskSide)) { isOutl = (aTriangle.Flags & HLRAlgo_PolyMask_FMskBack) != (aTriangle2.Flags & HLRAlgo_PolyMask_FMskBack); diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.hxx b/src/HLRBRep/HLRBRep_PolyAlgo.hxx index dfa696e161..8c97b0950a 100644 --- a/src/HLRBRep/HLRBRep_PolyAlgo.hxx +++ b/src/HLRBRep/HLRBRep_PolyAlgo.hxx @@ -329,12 +329,12 @@ private: private: HLRAlgo_Projector myProj; - Standard_Real TMat[3][3]; - Standard_Real TLoc[3]; - Standard_Real TTMa[3][3]; - Standard_Real TTLo[3]; - Standard_Real TIMa[3][3]; - Standard_Real TILo[3]; + Standard_Real TMat[3][3]{}; + Standard_Real TLoc[3]{}; + Standard_Real TTMa[3][3]{}; + Standard_Real TTLo[3]{}; + Standard_Real TIMa[3][3]{}; + Standard_Real TILo[3]{}; TopTools_SequenceOfShape myShapes; TopTools_IndexedMapOfShape myEMap; TopTools_IndexedMapOfShape myFMap; diff --git a/src/HLRBRep/HLRBRep_PolyHLRToShape.cxx b/src/HLRBRep/HLRBRep_PolyHLRToShape.cxx index e064eaab37..867d58ca2c 100644 --- a/src/HLRBRep/HLRBRep_PolyHLRToShape.cxx +++ b/src/HLRBRep/HLRBRep_PolyHLRToShape.cxx @@ -16,6 +16,8 @@ // Modified by cma, Fri Nov 10 17:36:13 1995 +#include + #include #include #include @@ -44,13 +46,13 @@ void HLRBRep_PolyHLRToShape::Update (const Handle(HLRBRep_PolyAlgo)& A) { myAlgo = A; myHideMode = Standard_True; - Standard_Real sta,end; - Standard_ShortReal tolsta,tolend; + Standard_Real sta = NAN,end = NAN; + Standard_ShortReal tolsta = NAN,tolend = NAN; HLRAlgo_EdgeIterator It; myBiPntVis.Clear(); myBiPntHid.Clear(); TopoDS_Shape S; - Standard_Boolean reg1,regn,outl,intl; + Standard_Boolean reg1 = 0,regn = 0,outl = 0,intl = 0; const gp_Trsf& T = myAlgo->Projector().Transformation(); HLRAlgo_EdgeStatus status; @@ -106,7 +108,7 @@ HLRBRep_PolyHLRToShape::InternalCompound (const Standard_Integer typ, for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) Map.Add(ex.Current()); } - Standard_Boolean todraw,reg1,regn,outl,intl; + Standard_Boolean todraw = 0,reg1 = 0,regn = 0,outl = 0,intl = 0; Standard_Boolean added = Standard_False; TopoDS_Shape Result; BRep_Builder B; diff --git a/src/HLRBRep/HLRBRep_PolyHLRToShape.hxx b/src/HLRBRep/HLRBRep_PolyHLRToShape.hxx index 806a4b379d..3db2bc8f1a 100644 --- a/src/HLRBRep/HLRBRep_PolyHLRToShape.hxx +++ b/src/HLRBRep/HLRBRep_PolyHLRToShape.hxx @@ -131,7 +131,7 @@ private: Handle(HLRBRep_PolyAlgo) myAlgo; HLRBRep_ListOfBPnt2D myBiPntVis; HLRBRep_ListOfBPnt2D myBiPntHid; - Standard_Boolean myHideMode; + Standard_Boolean myHideMode{}; }; diff --git a/src/HLRBRep/HLRBRep_ShapeToHLR.cxx b/src/HLRBRep/HLRBRep_ShapeToHLR.cxx index 84e00fff85..d83520f3e5 100644 --- a/src/HLRBRep/HLRBRep_ShapeToHLR.cxx +++ b/src/HLRBRep/HLRBRep_ShapeToHLR.cxx @@ -19,6 +19,8 @@ #endif +#include + #include #include #include @@ -75,7 +77,7 @@ HLRBRep_ShapeToHLR::Load(const Handle(HLRTopoBRep_OutLiner)& S, TopExp::MapShapes(S->OutLinedShape(),TopAbs_EDGE,EM); - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer nbEdge = EM.Extent (); for (i = 1; i <= nbEdge; i++) // vertices back to edges @@ -87,11 +89,11 @@ HLRBRep_ShapeToHLR::Load(const Handle(HLRTopoBRep_OutLiner)& S, TopoDS_Vertex VF, VL; TopTools_ListIteratorOfListOfShape itn; - Standard_Integer i1, i2; - Standard_Boolean o1, o2; - Standard_Boolean c1, c2; - Standard_Real pf, pl; - Standard_ShortReal tf, tl; + Standard_Integer i1 = 0, i2 = 0; + Standard_Boolean o1 = 0, o2 = 0; + Standard_Boolean c1 = 0, c2 = 0; + Standard_Real pf = NAN, pl = NAN; + Standard_ShortReal tf = NAN, tl = NAN; // Create the data structure Handle(HLRBRep_Data) DS = new HLRBRep_Data (nbVert, nbEdge, nbFace); @@ -245,7 +247,7 @@ HLRBRep_ShapeToHLR::ExploreShape (const Handle(HLRTopoBRep_OutLiner)& S, Standard_Boolean closed = exshell.Current().Closed(); if (!closed) { - Standard_Integer ie; + Standard_Integer ie = 0; Standard_Integer nbEdge = EM.Extent (); Standard_Integer *flag = new Standard_Integer[nbEdge + 1]; diff --git a/src/HLRBRep/HLRBRep_Surface.cxx b/src/HLRBRep/HLRBRep_Surface.cxx index 7022dd87d0..3ded8750c4 100644 --- a/src/HLRBRep/HLRBRep_Surface.cxx +++ b/src/HLRBRep/HLRBRep_Surface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -80,9 +82,9 @@ HLRBRep_Surface::SideRowsOfPoles (const Standard_Real tol, const Standard_Integer nbvPoles, TColgp_Array2OfPnt& Pnt) const { - Standard_Integer iu,iv; - Standard_Real x0,y0,x,y,z; - Standard_Boolean result; + Standard_Integer iu = 0,iv = 0; + Standard_Real x0 = NAN,y0 = NAN,x = NAN,y = NAN,z = NAN; + Standard_Boolean result = 0; Standard_Real tole = (Standard_Real)tol; const gp_Trsf& T = myProj->Transformation(); @@ -144,7 +146,7 @@ HLRBRep_Surface::IsSide (const Standard_Real tolF, { gp_Pnt Pt; gp_Vec D; - Standard_Real r; + Standard_Real r = NAN; if (myType == GeomAbs_Plane) { gp_Pln Pl = Plane(); @@ -211,9 +213,9 @@ HLRBRep_Surface::IsAbove (const Standard_Boolean back, Standard_Boolean planar = (myType == GeomAbs_Plane); if (planar) { gp_Pln Pl = Plane(); - Standard_Real a,b,c,d; + Standard_Real a = NAN,b = NAN,c = NAN,d = NAN; Pl.Coefficients(a,b,c,d); - Standard_Real u,u1,u2,dd,x,y,z; + Standard_Real u = NAN,u1 = NAN,u2 = NAN,dd = NAN,x = NAN,y = NAN,z = NAN; gp_Pnt P; u1 = A->Parameter3d(A->FirstParameter()); u2 = A->Parameter3d(A->LastParameter()); diff --git a/src/HLRBRep/HLRBRep_SurfaceTool.cxx b/src/HLRBRep/HLRBRep_SurfaceTool.cxx index 7b3158059c..655b8a88eb 100644 --- a/src/HLRBRep/HLRBRep_SurfaceTool.cxx +++ b/src/HLRBRep/HLRBRep_SurfaceTool.cxx @@ -18,7 +18,7 @@ #include Standard_Integer HLRBRep_SurfaceTool::NbSamplesU(const Standard_Address S) { - Standard_Integer nbs; + Standard_Integer nbs = 0; GeomAbs_SurfaceType typS = ((BRepAdaptor_Surface *)S)->GetType(); switch(typS) { case GeomAbs_Plane: @@ -64,7 +64,7 @@ Standard_Integer HLRBRep_SurfaceTool::NbSamplesU(const Standard_Address S) { } Standard_Integer HLRBRep_SurfaceTool::NbSamplesV(const Standard_Address S) { - Standard_Integer nbs; + Standard_Integer nbs = 0; GeomAbs_SurfaceType typS = ((BRepAdaptor_Surface *)S)->GetType(); switch(typS) { case GeomAbs_Plane: diff --git a/src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx b/src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx index 2f01a26096..d8e1db30d7 100644 --- a/src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx +++ b/src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -135,16 +137,16 @@ void HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/, */ const Standard_Integer NbLines = FO.NbLines(); - Standard_Integer CurLine; + Standard_Integer CurLine = 0; for (CurLine = 1; CurLine <= NbLines; CurLine++) { const Contap_Line& Line = FO.Line(CurLine); const Standard_Integer NbPoints = Line.NbVertex(); - Standard_Integer CurPoint; + Standard_Integer CurPoint = 0; if (Line.TypeContour() == Contap_Restriction) { // OutLine on restriction - TopoDS_Edge E = (*(BRepAdaptor_Curve2d*)(Line.Arc().get())).Edge(); + TopoDS_Edge E = (*dynamic_cast(Line.Arc().get())).Edge(); OutL.Append(E); TopExp::Vertices(E,VF,VL); // insert the Internal points. @@ -311,7 +313,7 @@ void HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/, if(withPCurve) { TColgp_Array1OfPnt2d Points2d(1,nbp); for(Standard_Integer i=1;i<=nbp;i++) { - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; Line.Point(i+ipF-1).ParametersOnS2(u,v); Points2d.SetValue(i,gp_Pnt2d(u,v)); } @@ -326,8 +328,8 @@ void HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/, TColStd_Array1OfInteger mults(1,nbp); TColgp_Array1OfPnt Points(1,nbp); - Standard_Real Maxx,Maxy,Maxz,Maxu,Maxv; - Standard_Real Minx,Miny,Minz,Minu,Minv; + Standard_Real Maxx = NAN,Maxy = NAN,Maxz = NAN,Maxu = NAN,Maxv = NAN; + Standard_Real Minx = NAN,Miny = NAN,Minz = NAN,Minu = NAN,Minv = NAN; Maxx=Maxy=Maxz=Maxu=Maxv=-RealLast(); Minx=Miny=Minz=Minu=Minv=RealLast(); @@ -351,7 +353,7 @@ void HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/, if(withPCurve) { TColgp_Array1OfPnt2d Points2d(1,nbp); for(Standard_Integer i=1;i<=nbp;i++) { - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; Line.Point(i+ipF-1).ParametersOnS2(u,v); if(u(P.Arc().get())).Edge(); Standard_Real Par = P.ParameterOnArc(); const gp_Pnt& P3d = P.Value(); @@ -592,7 +594,7 @@ void HLRTopoBRep_DSFiller::ProcessEdges (HLRTopoBRep_Data& DS) BRep_Builder B; TopoDS_Edge newE; TopoDS_Vertex VF,VL,VI; - Standard_Real PF,PL,PI; + Standard_Real PF = NAN,PL = NAN,PI = NAN; for (DS.InitEdge(); DS.MoreEdge(); DS.NextEdge()) { TopoDS_Edge E = DS.Edge(); diff --git a/src/HLRTopoBRep/HLRTopoBRep_Data.hxx b/src/HLRTopoBRep/HLRTopoBRep_Data.hxx index 77f8cca7fe..a0b7eeb806 100644 --- a/src/HLRTopoBRep/HLRTopoBRep_Data.hxx +++ b/src/HLRTopoBRep/HLRTopoBRep_Data.hxx @@ -153,7 +153,7 @@ private: HLRTopoBRep_MapOfShapeListOfVData myEdgesVertices; HLRTopoBRep_DataMapIteratorOfMapOfShapeListOfVData myEIterator; HLRTopoBRep_ListIteratorOfListOfVData myVIterator; - HLRTopoBRep_ListOfVData* myVList; + HLRTopoBRep_ListOfVData* myVList{}; }; diff --git a/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx b/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx index 6151e40bc4..3d11272796 100644 --- a/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx +++ b/src/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -59,7 +61,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI, { (void)FI; // avoid compiler warning - Standard_Real UMin, UMax, VMin, VMax, U1, U2; + Standard_Real UMin = NAN, UMax = NAN, VMin = NAN, VMax = NAN, U1 = NAN, U2 = NAN; Standard_Integer ne = 0; //BRep_Builder Builder; TopoDS_Edge Edge; @@ -118,7 +120,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI, for (ExpEdges.Init (TF, TopAbs_EDGE); ExpEdges.More(); ExpEdges.Next()) { - Standard_Integer IndE; + Standard_Integer IndE = 0; const TopoDS_Edge& newE = TopoDS::Edge(ExpEdges.Current()); const Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface (newE, TF, U1, U2); @@ -142,7 +144,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI, for(itE.Initialize(DS.FaceIntL(TF)); itE.More(); itE.Next()) { - Standard_Integer IndE; + Standard_Integer IndE = 0; const TopoDS_Edge& newE = TopoDS::Edge(itE.Value()); const Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface (newE, TF, U1, U2); @@ -168,7 +170,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform (const Standard_Integer FI, BRepAdaptor_Surface Surface (TF); Standard_Real Tolerance = BRep_Tool::Tolerance (TF); - Standard_Integer IIso; + Standard_Integer IIso = 0; Standard_Real DeltaU = Abs (UMax - UMin); Standard_Real DeltaV = Abs (VMax - VMin); Standard_Real Confusion = Min (DeltaU, DeltaV) * HatcherConfusion3d; diff --git a/src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx b/src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx index e6b0880098..a7d6c97a55 100644 --- a/src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx +++ b/src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx @@ -194,7 +194,7 @@ void HLRTopoBRep_OutLiner::ProcessFace(const TopoDS_Face& F, Standard_Integer aNe = anExt.NbExt(); if(aNe > 0) { Standard_Real dist = RealLast(); - Standard_Integer ec; + Standard_Integer ec = 0; for(ec = 1; ec <= aNe; ++ec) { // dist = Min(dist, anExt.Value(ec)); dist = Min(dist, anExt.SquareDistance(ec)); diff --git a/src/Hatch/Hatch_Hatcher.cxx b/src/Hatch/Hatch_Hatcher.cxx index 830f318caf..4a8c877c64 100644 --- a/src/Hatch/Hatch_Hatcher.cxx +++ b/src/Hatch/Hatch_Hatcher.cxx @@ -113,7 +113,7 @@ void Hatch_Hatcher::Trim { IntAna2d_IntPoint Pinter; IntAna2d_AnaIntersection Inters; - Standard_Integer iLine; + Standard_Integer iLine = 0; for (iLine = 1; iLine <= myLines.Length(); iLine++) { Inters.Perform(myLines(iLine).myLin,L); if (Inters.IsDone()) { @@ -174,7 +174,7 @@ void Hatch_Hatcher::Trim Standard_Integer Hatch_Hatcher::NbIntervals() const { - Standard_Integer i, nb = 0; + Standard_Integer i = 0, nb = 0; for (i = 1; i <= myLines.Length(); i++) nb += NbIntervals(i); return nb; diff --git a/src/Hatch/Hatch_Line.cxx b/src/Hatch/Hatch_Line.cxx index 8a4d90448c..737650e093 100644 --- a/src/Hatch/Hatch_Line.cxx +++ b/src/Hatch/Hatch_Line.cxx @@ -53,7 +53,7 @@ void Hatch_Line::AddIntersection const Standard_Real theToler) { Hatch_Parameter P(Par1,Start,Index,Par2); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= myInters.Length(); i++) { Standard_Real dfIntPar1 = myInters(i).myPar1; // akm OCC109 vvv : Two intersections too close diff --git a/src/HatchGen/HatchGen_PointOnHatching.cxx b/src/HatchGen/HatchGen_PointOnHatching.cxx index 3afd2bb334..a06fac839e 100644 --- a/src/HatchGen/HatchGen_PointOnHatching.cxx +++ b/src/HatchGen/HatchGen_PointOnHatching.cxx @@ -63,7 +63,7 @@ void HatchGen_PointOnHatching::AddPoint (const HatchGen_PointOnElement& Point, { Standard_Integer NbPnt = myPoints.Length() ; // for (Standard_Integer IPnt = 1 ; - Standard_Integer IPnt; + Standard_Integer IPnt = 0; for ( IPnt = 1 ; IPnt <= NbPnt && myPoints(IPnt).IsDifferent (Point, Confusion) ; IPnt++) ; diff --git a/src/Hermit/Hermit.cxx b/src/Hermit/Hermit.cxx index eeb22232ee..6b51694e72 100644 --- a/src/Hermit/Hermit.cxx +++ b/src/Hermit/Hermit.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -41,10 +43,10 @@ static void HermiteCoeff(const Handle(Geom_BSplineCurve)& BS, TColStd_Array1OfReal Knots(1,BS->NbKnots()); TColStd_Array1OfReal Weights(1,BS->NbPoles()); TColStd_Array1OfInteger Mults(1,BS->NbKnots()); - Standard_Integer Degree,Index0,Index1; // denominateur value for u=0 & u=1 - Standard_Real Denom0,Denom1, // denominator value for u=0 & u=1 - Deriv0,Deriv1 ; // derivative denominator value for u=0 & 1 - Standard_Boolean Periodic; + Standard_Integer Degree = 0,Index0 = 0,Index1 = 0; // denominateur value for u=0 & u=1 + Standard_Real Denom0 = NAN,Denom1 = NAN, // denominator value for u=0 & u=1 + Deriv0 = NAN,Deriv1 = NAN ; // derivative denominator value for u=0 & 1 + Standard_Boolean Periodic = 0; BS->Knots(Knots); BSplCLib::Reparametrize(0.0,1.0,Knots); //affinity on the nodal vector @@ -77,10 +79,10 @@ static void HermiteCoeff(const Handle(Geom2d_BSplineCurve)& BS, TColStd_Array1OfReal Knots(1,BS->NbKnots()); TColStd_Array1OfReal Weights(1,BS->NbPoles()); TColStd_Array1OfInteger Mults(1,BS->NbKnots()); - Standard_Integer Degree,Index0,Index1; - Standard_Real Denom0,Denom1, // denominateur value for u=0 & u=1 - Deriv0,Deriv1 ; // denominator value for u=0 & u=1 - Standard_Boolean Periodic; // derivative denominatur value for u=0 & 1 + Standard_Integer Degree = 0,Index0 = 0,Index1 = 0; + Standard_Real Denom0 = NAN,Denom1 = NAN, // denominateur value for u=0 & u=1 + Deriv0 = NAN,Deriv1 = NAN ; // denominator value for u=0 & u=1 + Standard_Boolean Periodic = 0; // derivative denominatur value for u=0 & 1 BS->Knots(Knots); BSplCLib::Reparametrize(0.0,1.0,Knots); //affinity on the nodal vector @@ -108,7 +110,7 @@ static void HermiteCoeff(const Handle(Geom2d_BSplineCurve)& BS, static Standard_Boolean SignDenom(const TColgp_Array1OfPnt2d& Poles) { - Standard_Boolean Result; + Standard_Boolean Result = 0; if (Poles(0).Y()<0) Result=Standard_False; @@ -128,8 +130,8 @@ static void Polemax(const TColgp_Array1OfPnt2d& Poles, { // Standard_Integer i,index=0; - Standard_Integer i; - Standard_Real Max,Min; //intermediate value of max and min ordinates + Standard_Integer i = 0; + Standard_Real Max = NAN,Min = NAN; //intermediate value of max and min ordinates min=0;max=0; //initialisation of the indices Min=Poles(0).Y(); //initialisation of the intermediate value @@ -164,13 +166,13 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, const Standard_Real Uy) { - Standard_Integer index,i, + Standard_Integer index = 0,i = 0, I1=0,I2=0,I3=0,I4=0; //knots index TColgp_Array1OfPnt2d Polesinit(0,3) ; Handle(TColStd_HArray1OfReal) Knots; //array of the BSpline knots + the ones inserted Standard_Integer cas=0,mark=0,dercas=0, //loop marks - min,max; //Pole min and max indices - Standard_Real Us1,Us2,a; //boundaries value of the knots to be inserted + min = 0,max = 0; //Pole min and max indices + Standard_Real Us1 = NAN,Us2 = NAN,a = NAN; //boundaries value of the knots to be inserted U4=0.0;U5=1.0; //default value if (Ux!=1.0){ @@ -249,7 +251,7 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, mark=1; } if (mark==0){ - Standard_Real Pole0,Pole3; + Standard_Real Pole0 = NAN,Pole3 = NAN; Pole0=Polesinit(0).Y(); Pole3=Polesinit(3).Y(); if (Pole0<3){ @@ -385,13 +387,13 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, const Standard_Real Uy) { - Standard_Integer index,i, + Standard_Integer index = 0,i = 0, I1=0,I2=0,I3=0,I4=0; //knots index TColgp_Array1OfPnt2d Polesinit(0,3) ; Handle(TColStd_HArray1OfReal) Knots; //array of the BSpline knots + the ones inserted Standard_Integer cas=0,mark=0,dercas=0, //loop marks - min,max; //Pole min and max indices - Standard_Real Us1,Us2,a; //boundaries value of the knots to be inserted + min = 0,max = 0; //Pole min and max indices + Standard_Real Us1 = NAN,Us2 = NAN,a = NAN; //boundaries value of the knots to be inserted U4=0.0;U5=1.0; //default value if (Ux!=1.0){ @@ -481,7 +483,7 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, } if (mark==0) { - Standard_Real Pole0,Pole3; + Standard_Real Pole0 = NAN,Pole3 = NAN; Pole0=Polesinit(0).Y(); Pole3=Polesinit(3).Y(); if (Pole0<3) @@ -627,7 +629,7 @@ static void MovePoles(Handle(Geom2d_BSplineCurve)& BS) { gp_Pnt2d P ; // Standard_Integer i,index; - Standard_Integer i; + Standard_Integer i = 0; for (i=3;i<=(BS->NbPoles()-2);i++){ P.SetCoord(1,(BS->Pole(i).Coord(1))); //raising of the no constrained poles to diff --git a/src/IFGraph/IFGraph_Articulations.cxx b/src/IFGraph/IFGraph_Articulations.cxx index f185c25b0f..06664da2e3 100644 --- a/src/IFGraph/IFGraph_Articulations.cxx +++ b/src/IFGraph/IFGraph_Articulations.cxx @@ -64,7 +64,7 @@ IFGraph_Articulations::IFGraph_Articulations for (Interface_EntityIterator iter = thegraph.Shareds(thegraph.Entity(num)); iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); + const Handle(Standard_Transient)& ent = iter.Value(); Standard_Integer nument = thegraph.EntityNumber(ent); if (!thegraph.IsPresent(num)) { thegraph.GetFromEntity(ent,Standard_False); diff --git a/src/IFGraph/IFGraph_Articulations.hxx b/src/IFGraph/IFGraph_Articulations.hxx index 94480c158e..e5ee4acf9b 100644 --- a/src/IFGraph/IFGraph_Articulations.hxx +++ b/src/IFGraph/IFGraph_Articulations.hxx @@ -67,7 +67,7 @@ private: private: Interface_Graph thegraph; - Standard_Integer thenow; + Standard_Integer thenow{}; Handle(TColStd_HSequenceOfInteger) thelist; }; diff --git a/src/IFGraph/IFGraph_ConnectedComponants.cxx b/src/IFGraph/IFGraph_ConnectedComponants.cxx index 519e3b2ff4..6b75fdf301 100644 --- a/src/IFGraph/IFGraph_ConnectedComponants.cxx +++ b/src/IFGraph/IFGraph_ConnectedComponants.cxx @@ -35,7 +35,7 @@ IFGraph_ConnectedComponants::IFGraph_ConnectedComponants Interface_EntityIterator loaded = Loaded(); Reset(); for (loaded.Start(); loaded.More(); loaded.Next()) { - Handle(Standard_Transient) ent = loaded.Value(); + const Handle(Standard_Transient)& ent = loaded.Value(); if (IsInPart(ent)) continue; IFGraph_AllConnected connect(Model(),ent); AddPart(); diff --git a/src/IFGraph/IFGraph_SubPartsIterator.cxx b/src/IFGraph/IFGraph_SubPartsIterator.cxx index 52ee0f2e6b..c6ce81aa12 100644 --- a/src/IFGraph/IFGraph_SubPartsIterator.cxx +++ b/src/IFGraph/IFGraph_SubPartsIterator.cxx @@ -38,11 +38,11 @@ IFGraph_SubPartsIterator::IFGraph_SubPartsIterator IFGraph_SubPartsIterator::IFGraph_SubPartsIterator (IFGraph_SubPartsIterator& other) - : thegraph (other.Graph()) + : thegraph (other.Graph()), theparts(new TColStd_HSequenceOfInteger()), thepart(0) { Standard_Integer nb = thegraph.Size(); - theparts = new TColStd_HSequenceOfInteger(); - thepart = 0; + + for (other.Start(); other.More(); other.Next()) { thepart ++; Standard_Integer nbent = 0; diff --git a/src/IFSelect/IFSelect_Activator.cxx b/src/IFSelect/IFSelect_Activator.cxx index 52f268a78d..84299ae247 100644 --- a/src/IFSelect/IFSelect_Activator.cxx +++ b/src/IFSelect/IFSelect_Activator.cxx @@ -63,7 +63,7 @@ static TColStd_SequenceOfTransient theacts; (const Standard_CString command, Standard_Integer& number, Handle(IFSelect_Activator)& actor) { - Standard_Integer num; + Standard_Integer num = 0; if (!thedico.Find(command, num)) return Standard_False; number = thenums(num); actor = Handle(IFSelect_Activator)::DownCast(theacts(num)); @@ -73,7 +73,7 @@ static TColStd_SequenceOfTransient theacts; Standard_Integer IFSelect_Activator::Mode (const Standard_CString command) { - Standard_Integer num; + Standard_Integer num = 0; if (!thedico.Find(command, num)) return -1; return themodes(num); } @@ -82,7 +82,7 @@ static TColStd_SequenceOfTransient theacts; Handle(TColStd_HSequenceOfAsciiString) IFSelect_Activator::Commands (const Standard_Integer mode, const Standard_CString command) { - Standard_Integer num; + Standard_Integer num = 0; NCollection_DataMap::Iterator iter(thedico); Handle(TColStd_HSequenceOfAsciiString) list = new TColStd_HSequenceOfAsciiString(); diff --git a/src/IFSelect/IFSelect_AppliedModifiers.cxx b/src/IFSelect/IFSelect_AppliedModifiers.cxx index 76e4bd40b6..79a5269c3a 100644 --- a/src/IFSelect/IFSelect_AppliedModifiers.cxx +++ b/src/IFSelect/IFSelect_AppliedModifiers.cxx @@ -20,9 +20,9 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_AppliedModifiers,Standard_Transient) IFSelect_AppliedModifiers::IFSelect_AppliedModifiers (const Standard_Integer nbmax, const Standard_Integer nbent) - : thelists (nbmax+1) + : thelists (nbmax+1), thenbent(nbent), theentcnt(0) { - thenbent = nbent; theentcnt = 0; + } Standard_Boolean IFSelect_AppliedModifiers::AddModif @@ -65,7 +65,7 @@ IFSelect_AppliedModifiers::IFSelect_AppliedModifiers Handle(TColStd_HSequenceOfInteger) IFSelect_AppliedModifiers::ItemList () const { Handle(TColStd_HSequenceOfInteger) list = new TColStd_HSequenceOfInteger(); - Standard_Integer i, nb = (theentcnt > 0 ? theentcnt : thenbent); + Standard_Integer i = 0, nb = (theentcnt > 0 ? theentcnt : thenbent); for (i = 1; i <= nb; i ++) list->Append (ItemNum(i)); return list; } diff --git a/src/IFSelect/IFSelect_BasicDumper.cxx b/src/IFSelect/IFSelect_BasicDumper.cxx index 26a04db161..35ffe4cdcd 100644 --- a/src/IFSelect/IFSelect_BasicDumper.cxx +++ b/src/IFSelect/IFSelect_BasicDumper.cxx @@ -142,7 +142,7 @@ IFSelect_BasicDumper::IFSelect_BasicDumper () { } return Standard_True; } if (type.IsEqual("IFSelect_SelectTextType")) { - const TCollection_AsciiString exname = file.ParamValue(1); + const TCollection_AsciiString& exname = file.ParamValue(1); if (exname.Length() < FIRSTCHAR) return Standard_False; if (exname.Value(FIRSTCHAR) == 'e') {} else if (exname.Value(FIRSTCHAR) == 'c') {} @@ -167,8 +167,8 @@ IFSelect_BasicDumper::IFSelect_BasicDumper () { } } if (type.IsEqual("IFSelect_TransformStandard")) { - Standard_Boolean copyoption; - const TCollection_AsciiString copyname = file.ParamValue(1); + Standard_Boolean copyoption = 0; + const TCollection_AsciiString& copyname = file.ParamValue(1); if (copyname.Length() < FIRSTCHAR) return Standard_False; if (copyname.Value(FIRSTCHAR) == 'c') copyoption = Standard_True; else if (copyname.Value(FIRSTCHAR) == 'o') copyoption = Standard_False; diff --git a/src/IFSelect/IFSelect_CheckCounter.cxx b/src/IFSelect/IFSelect_CheckCounter.cxx index 6c3802c4e5..702541e329 100644 --- a/src/IFSelect/IFSelect_CheckCounter.cxx +++ b/src/IFSelect/IFSelect_CheckCounter.cxx @@ -65,14 +65,14 @@ void IFSelect_CheckCounter::Analyse(const Interface_CheckIterator& list, const Standard_Boolean original, const Standard_Boolean failsonly) { - Standard_Integer i,nb,num, nbe = (model.IsNull() ? 0 : model->NbEntities()); + Standard_Integer i = 0,nb = 0,num = 0, nbe = (model.IsNull() ? 0 : model->NbEntities()); char mess[300]; sprintf (mess,"Check %s",list.Name()); SetName (mess); for (list.Start(); list.More(); list.Next()) { num = list.Number(); Handle(Standard_Transient) ent; - const Handle(Interface_Check) check = list.Value(); + const Handle(Interface_Check)& check = list.Value(); ent = check->Entity(); if (ent.IsNull() && num > 0 && num <= nbe) ent = model->Value(num); nb = check->NbFails(); diff --git a/src/IFSelect/IFSelect_ContextModif.cxx b/src/IFSelect/IFSelect_ContextModif.cxx index c69ad559be..1bcfaf6e50 100644 --- a/src/IFSelect/IFSelect_ContextModif.cxx +++ b/src/IFSelect/IFSelect_ContextModif.cxx @@ -36,9 +36,9 @@ IFSelect_ContextModif::IFSelect_ContextModif(const Interface_Graph& graph, const Interface_CopyTool& TC, const Standard_CString filename) : thegraf (graph,Standard_False) , thefile (filename) , - thelist (graph.Size(),' ') + thelist (graph.Size(),' '), thesel(Standard_False) { - themap = TC.Control(); thesel = Standard_False; thecurr = thecurt = 0; + themap = TC.Control(); thecurr = thecurt = 0; Standard_Integer nb = thelist.Length(); Handle(Standard_Transient) newent; for (Standard_Integer i = 1; i <= nb; i ++) { @@ -55,9 +55,9 @@ IFSelect_ContextModif::IFSelect_ContextModif(const Interface_Graph& graph, IFSelect_ContextModif::IFSelect_ContextModif(const Interface_Graph& graph, const Standard_CString filename) : thegraf (graph,Standard_False) , thefile (filename) , - thelist (graph.Size(),' ') + thelist (graph.Size(),' '), thesel(Standard_False) { - thesel = Standard_False; thecurr = thecurt = 0; + thecurr = thecurt = 0; Standard_Integer nb = thelist.Length(); Handle(Standard_Transient) newent; for (Standard_Integer i = 1; i <= nb; i ++) thelist.SetValue(i,'1'); diff --git a/src/IFSelect/IFSelect_DispPerSignature.cxx b/src/IFSelect/IFSelect_DispPerSignature.cxx index fda05474fd..54bc638104 100644 --- a/src/IFSelect/IFSelect_DispPerSignature.cxx +++ b/src/IFSelect/IFSelect_DispPerSignature.cxx @@ -65,7 +65,7 @@ IFSelect_DispPerSignature::IFSelect_DispPerSignature () { } thesign->Clear(); thesign->AddList (FinalSelection()->RootResult(G).Content(),G.Model()); Handle(TColStd_HSequenceOfHAsciiString) list = thesign->List(); - Standard_Integer i,nb,is,nbs = list->Length(); + Standard_Integer i = 0,nb = 0,is = 0,nbs = list->Length(); Handle(TCollection_HAsciiString) asign; Handle(TColStd_HSequenceOfTransient) ents; for (is = 1; is <= nbs; is ++) { diff --git a/src/IFSelect/IFSelect_EditForm.cxx b/src/IFSelect/IFSelect_EditForm.cxx index 7065164e56..09262fbd20 100644 --- a/src/IFSelect/IFSelect_EditForm.cxx +++ b/src/IFSelect/IFSelect_EditForm.cxx @@ -56,7 +56,7 @@ IFSelect_EditForm::IFSelect_EditForm theeditor (editor) , thetouched (0) { - Standard_Integer i,nb = nums.Length(); + Standard_Integer i = 0,nb = nums.Length(); for (i = 1; i <= nb; i ++) thenums.SetValue (i,nums.Value(i)); } @@ -116,7 +116,7 @@ IFSelect_EditForm::IFSelect_EditForm (const Standard_Integer num) const { if (thecomplete) return num; - Standard_Integer i, n = thenums.Upper(); + Standard_Integer i = 0, n = thenums.Upper(); for (i = 1; i <= n; i ++) { if (thenums.Value(i) == num) return i; } @@ -129,7 +129,7 @@ IFSelect_EditForm::IFSelect_EditForm Standard_Integer res = theeditor->NameNumber(name); if (thecomplete || res == 0) return res; // Sinon, chercher res dans thenums - Standard_Integer i, nb = thenums.Length(); + Standard_Integer i = 0, nb = thenums.Length(); for (i = 1; i <= nb; i ++) { if (res == thenums.Value(i)) return res; } @@ -142,7 +142,7 @@ IFSelect_EditForm::IFSelect_EditForm Standard_Integer res = theeditor->NameNumber(name); if (thecomplete || res == 0) return res; // Sinon, chercher res dans thenums - Standard_Integer i, nb = thenums.Length(); + Standard_Integer i = 0, nb = thenums.Length(); for (i = 1; i <= nb; i ++) { if (res == thenums.Value(i)) return i; } @@ -154,7 +154,7 @@ IFSelect_EditForm::IFSelect_EditForm { theloaded = Standard_True; thetouched = 0; - Standard_Integer i,nb = theorigs.Upper(); + Standard_Integer i = 0,nb = theorigs.Upper(); if (nb == 0) return; for (i = 1; i <= nb; i ++) { Standard_Integer num = NumberFromRank(i); @@ -393,7 +393,7 @@ IFSelect_EditForm::IFSelect_EditForm void IFSelect_EditForm::ClearEdit (const Standard_Integer num) { - Standard_Integer i, nb = thestatus.Upper(); + Standard_Integer i = 0, nb = thestatus.Upper(); if (num == 0) { for (i = 1; i <= nb; i ++) thestatus.SetValue (i,0); } else { @@ -405,7 +405,7 @@ IFSelect_EditForm::IFSelect_EditForm void IFSelect_EditForm::PrintDefs (Standard_OStream& S) const { - Standard_Integer iv, nbv = NbValues(Standard_True); + Standard_Integer iv = 0, nbv = NbValues(Standard_True); S<<"***** EditForm, Label : "<Length(); + Standard_Integer i = 0,nb = list->Length(); S<<"(List : "<HasModel()) { sout<<"No loaded model, abandon"<Model(); - Standard_Integer i, cnt = 0; + Standard_Integer i = 0, cnt = 0; Standard_Boolean exact = Standard_False; sout<<" ** Search Entity Number for Label : "<NextNumberForLabel (arg1, 0, exact) ; i != 0; @@ -304,7 +304,7 @@ static IFSelect_ReturnStatus funcount // Ajout : si Selection, on applique un GraphCounter // Et en ce cas, on peut en avoir plusieurs : la limite est le mot-cle "on" Standard_Integer onflag = 0; - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 2; i < argc; i ++) { if (!strcmp (pilot->Arg(i),"on")) { onflag = i; break; } } @@ -388,7 +388,7 @@ static IFSelect_ReturnStatus funsigncase Message_Messenger::StreamBuffer sout = Message::SendInfo(); if (signcase.IsNull()) sout<<"Not a Signature : "<IsIntCase(hasmin,valmin,hasmax,valmax)) { sout<<"Signature "<CaseList(); if (caselist.IsNull()) sout<<"Signature "<Length(); + Standard_Integer i = 0, nb = caselist->Length(); sout<<"Signature "<Value(i); sout<NbWords(); const Standard_CString arg1 = pilot->Arg(1); // **** Entity Status **** - Standard_Integer i,nb; + Standard_Integer i = 0,nb = 0; Message_Messenger::StreamBuffer sout = Message::SendInfo(); if (argc < 2) { nb = Interface_Category::NbCategories(); @@ -479,7 +479,7 @@ static IFSelect_ReturnStatus fundumpent Handle(IFSelect_WorkSession) WS = pilot->Session(); Standard_Integer argc = pilot->NbWords(); Handle(IFSelect_WorkLibrary) WL = WS->WorkLibrary(); - Standard_Integer levdef=0,levmax=10,level; + Standard_Integer levdef=0,levmax=10,level = 0; WL->DumpLevels (levdef,levmax); Message_Messenger::StreamBuffer sout = Message::SendInfo(); if (argc < 2 || (argc == 2 && levmax < 0)) { @@ -788,7 +788,7 @@ static IFSelect_ReturnStatus fun24 if (i < argc-1) label.AssignCat(" "); } for (int mode = 0; mode <= 2; mode ++) { - int nbitems = 0; int id; + int nbitems = 0; int id = 0; sout<<"Searching label : "<Length(), aPatternNb = 0; + Standard_Integer i = 0,nb = li->Length(), aPatternNb = 0; size_t aPatternLen = strlen(arg2); if (argc == 3) { @@ -913,7 +913,7 @@ static IFSelect_ReturnStatus fun29 Message_Messenger::StreamBuffer sout = Message::SendInfo(); if (list.IsNull()) { sout<<"List of Sent Files not enabled"<Length(); + Standard_Integer i = 0, nb = list->Length(); sout<<" Sent Files : "<Value(i)->ToCString()<NamedItem(arg1)); if (sel.IsNull()) { sout<<"Pas de Selection de Nom : "<NamedItem(pilot->Arg(i))); if (disp.IsNull()) @@ -2136,7 +2136,7 @@ static IFSelect_ReturnStatus fun_editvalue listr = edf->EditedList(num); if (listr.IsNull()) sout<<"(NULL LIST)"<Length(); + Standard_Integer ilist = 0,nblist = listr->Length(); sout<<"(List : "<Value(ilist); diff --git a/src/IFSelect/IFSelect_GeneralModifier.cxx b/src/IFSelect/IFSelect_GeneralModifier.cxx index 5e2e5de29f..6a65214935 100644 --- a/src/IFSelect/IFSelect_GeneralModifier.cxx +++ b/src/IFSelect/IFSelect_GeneralModifier.cxx @@ -21,7 +21,7 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_GeneralModifier,Standard_Transient) IFSelect_GeneralModifier::IFSelect_GeneralModifier - (const Standard_Boolean maychangegraph) { thechgr = maychangegraph; } + (const Standard_Boolean maychangegraph) : thechgr(maychangegraph) { } Standard_Boolean IFSelect_GeneralModifier::MayChangeGraph () const { return thechgr; } diff --git a/src/IFSelect/IFSelect_GraphCounter.cxx b/src/IFSelect/IFSelect_GraphCounter.cxx index 36a7300621..16ad36108a 100644 --- a/src/IFSelect/IFSelect_GraphCounter.cxx +++ b/src/IFSelect/IFSelect_GraphCounter.cxx @@ -39,7 +39,7 @@ IFSelect_GraphCounter::IFSelect_GraphCounter { if (theapplied.IsNull()) { AddList (list,graph.Model()); return; } if (list.IsNull()) return; - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); for (i = 1; i <= nb; i ++) { char val[12]; Handle(Standard_Transient) ent = list->Value(i); diff --git a/src/IFSelect/IFSelect_IntParam.cxx b/src/IFSelect/IFSelect_IntParam.cxx index 67d13bb7c8..df4b302b3c 100644 --- a/src/IFSelect/IFSelect_IntParam.cxx +++ b/src/IFSelect/IFSelect_IntParam.cxx @@ -18,8 +18,8 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_IntParam,Standard_Transient) -IFSelect_IntParam::IFSelect_IntParam () - { theval = 0; } +IFSelect_IntParam::IFSelect_IntParam () : theval(0) + { } void IFSelect_IntParam::SetStaticName (const Standard_CString statname) { thestn.Clear(); thestn.AssignCat (statname); } diff --git a/src/IFSelect/IFSelect_ListEditor.cxx b/src/IFSelect/IFSelect_ListEditor.cxx index d0ee3cb389..be3803b79a 100644 --- a/src/IFSelect/IFSelect_ListEditor.cxx +++ b/src/IFSelect/IFSelect_ListEditor.cxx @@ -46,7 +46,7 @@ void IFSelect_ListEditor::ClearEdit () theedit = new TColStd_HSequenceOfHAsciiString(); thestat = new TColStd_HSequenceOfInteger(); if (theorig.IsNull()) return; - Standard_Integer i,nb = theorig->Length(); + Standard_Integer i = 0,nb = theorig->Length(); for (i = 1; i <= nb; i ++) { theedit->Append (theorig->Value(i)); thestat->Append (0); @@ -78,7 +78,7 @@ Standard_Boolean IFSelect_ListEditor::LoadEdited (const Handle(TColStd_HSequenceOfHAsciiString)& list) { if (list.IsNull()) return Standard_False; - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); if (nb > themax) return Standard_False; // check values diff --git a/src/IFSelect/IFSelect_ModelCopier.cxx b/src/IFSelect/IFSelect_ModelCopier.cxx index 79ddb58d50..fac1edfab4 100644 --- a/src/IFSelect/IFSelect_ModelCopier.cxx +++ b/src/IFSelect/IFSelect_ModelCopier.cxx @@ -141,7 +141,7 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { } Handle(Interface_InterfaceModel) model; TCollection_AsciiString filename = eval.FileName(); Standard_Integer dispnum = eval.DispatchRank(); - Standard_Integer numod, nbmod; + Standard_Integer numod = 0, nbmod = 0; eval.PacketsInDispatch (numod,nbmod); Handle(IFSelect_AppliedModifiers) curapp; CopiedModel (G, WL,protocol, eval.PacketRoot(), filename,dispnum,numod, TC, @@ -220,7 +220,7 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { } Handle(Interface_InterfaceModel) model; TCollection_AsciiString filename = eval.FileName(); Standard_Integer dispnum = eval.DispatchRank(); - Standard_Integer numod, nbmod; + Standard_Integer numod = 0, nbmod = 0; eval.PacketsInDispatch (numod,nbmod); Handle(IFSelect_AppliedModifiers) curapp; CopiedModel (G, WL,protocol, eval.PacketRoot(), filename,dispnum,numod, TC, @@ -259,11 +259,11 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { } Interface_CheckIterator checks; checks.SetName ("X-STEP WorkSession : Send All"); Message::SendInfo() << "** WorkSession : Sending all data"<NbEntities(); + Standard_Integer i = 0, nb = model->NbEntities(); for (i = 1; i <= nb; i ++) TC.Bind (model->Value(i),model->Value(i)); Interface_EntityIterator pipo; @@ -298,7 +298,7 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { } Interface_CheckIterator checks; checks.SetName ("X-STEP WorkSession : Send Selected"); Message::SendInfo() << "** WorkSession : Sending selected data"<NewEmptyModel(); Interface_CopyTool TC (original, protocol); @@ -309,7 +309,7 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { } for (list.Start(); list.More(); list.Next()) { newmod->AddWithRefs (list.Value(),lib); } - Standard_Integer i, nb = newmod->NbEntities(); + Standard_Integer i = 0, nb = newmod->NbEntities(); for (i = 1; i <= nb; i ++) TC.Bind (newmod->Value(i),newmod->Value(i)); if (theremain.IsNull()) { theremain = new TColStd_HArray1OfInteger(0,G.Size()); theremain->Init(0); } @@ -361,7 +361,7 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { } // et aussi : pas de Dispatch (envoi en bloc) applied.Nullify(); - Handle(Interface_InterfaceModel) original = G.Model(); + const Handle(Interface_InterfaceModel)& original = G.Model(); if (dispnum > 0) { newmod = original->NewEmptyModel(); TC.Clear(); @@ -380,7 +380,7 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { } // ... Ensuite : On prend en compte les Model Modifiers ... Standard_Integer nbmod = 0; if (!theshareout.IsNull()) nbmod = theshareout->NbModifiers(Standard_True); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <= nbmod; i ++) { Handle(IFSelect_Modifier) unmod = theshareout->ModelModifier(i); @@ -441,7 +441,7 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { } (const Interface_Graph& G, const Handle(IFSelect_WorkLibrary)& WL, Interface_CopyTool& TC, Handle(Interface_InterfaceModel)& newmod) { - Handle(Interface_InterfaceModel) original = G.Model(); + const Handle(Interface_InterfaceModel)& original = G.Model(); // Interface_CopyTool TC(original,protocol); newmod = original->NewEmptyModel(); TC.Clear(); diff --git a/src/IFSelect/IFSelect_ModifEditForm.cxx b/src/IFSelect/IFSelect_ModifEditForm.cxx index 8a731b33bb..07c51b46b7 100644 --- a/src/IFSelect/IFSelect_ModifEditForm.cxx +++ b/src/IFSelect/IFSelect_ModifEditForm.cxx @@ -25,7 +25,7 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ModifEditForm,IFSelect_Modifier) IFSelect_ModifEditForm::IFSelect_ModifEditForm (const Handle(IFSelect_EditForm)& editform) - : IFSelect_Modifier (Standard_False) { theedit = editform; } + : IFSelect_Modifier (Standard_False), theedit(editform) { } Handle(IFSelect_EditForm) IFSelect_ModifEditForm::EditForm () const { return theedit; } diff --git a/src/IFSelect/IFSelect_ModifReorder.cxx b/src/IFSelect/IFSelect_ModifReorder.cxx index 76f675e7ea..416ad34529 100644 --- a/src/IFSelect/IFSelect_ModifReorder.cxx +++ b/src/IFSelect/IFSelect_ModifReorder.cxx @@ -25,7 +25,7 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ModifReorder,IFSelect_Modifier) IFSelect_ModifReorder::IFSelect_ModifReorder (const Standard_Boolean rootlast) - : IFSelect_Modifier (Standard_True) { thertl = rootlast; } + : IFSelect_Modifier (Standard_True), thertl(rootlast) { } void IFSelect_ModifReorder::Perform (IFSelect_ContextModif& ctx, const Handle(Interface_InterfaceModel)& target, diff --git a/src/IFSelect/IFSelect_PacketList.cxx b/src/IFSelect/IFSelect_PacketList.cxx index 64a974412c..5cb0fa3b4b 100644 --- a/src/IFSelect/IFSelect_PacketList.cxx +++ b/src/IFSelect/IFSelect_PacketList.cxx @@ -27,12 +27,12 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_PacketList,Standard_Transient) IFSelect_PacketList::IFSelect_PacketList (const Handle(Interface_InterfaceModel)& model) - : thedupls (0,model->NbEntities()) , + : themodel(model), thedupls (0,model->NbEntities()) , thepacks (100) , theflags (0,model->NbEntities()) , - thename ("Packets") + thelast(0), thebegin(Standard_False), thename ("Packets") { - themodel = model; thelast = 0; thebegin = Standard_False; // begin-begin + // begin-begin thedupls.Init(0); theflags.Init(0); } @@ -76,7 +76,7 @@ IFSelect_PacketList::IFSelect_PacketList (const Handle(TColStd_HSequenceOfTransient)& list) { if (list.IsNull()) return; - Standard_Integer i , nb = list->Length(); + Standard_Integer i = 0 , nb = list->Length(); thepacks.Reservate (nb+1); for (i = 1; i <= nb; i ++) Add (list->Value(i)); } @@ -99,7 +99,7 @@ IFSelect_PacketList::IFSelect_PacketList Interface_EntityIterator list; if (numpack <= 0 || numpack > NbPackets()) return list; Interface_IntList lisi(thepacks,Standard_False); lisi.SetNumber (numpack); - Standard_Integer i , nb = lisi.Length(); + Standard_Integer i = 0 , nb = lisi.Length(); for (i = 1; i <= nb; i ++) list.AddItem(themodel->Value(lisi.Value(i))); return list; @@ -107,7 +107,7 @@ IFSelect_PacketList::IFSelect_PacketList Standard_Integer IFSelect_PacketList::HighestDuplicationCount () const { - Standard_Integer i , nb = themodel->NbEntities(); + Standard_Integer i = 0 , nb = themodel->NbEntities(); Standard_Integer high = 0; for (i = 1; i <= nb; i ++) { Standard_Integer j = thedupls.Value(i); @@ -119,7 +119,7 @@ IFSelect_PacketList::IFSelect_PacketList Standard_Integer IFSelect_PacketList::NbDuplicated (const Standard_Integer newcount, const Standard_Boolean andmore) const { - Standard_Integer i, nb = themodel->NbEntities(); + Standard_Integer i = 0, nb = themodel->NbEntities(); Standard_Integer nbdu = 0; for (i = 1; i <= nb; i ++) { @@ -135,7 +135,7 @@ IFSelect_PacketList::IFSelect_PacketList Standard_Integer nb = themodel->NbEntities(); Interface_EntityIterator list; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= nb; i ++) { Standard_Integer j = thedupls.Value(i); if (j == newcount || (j > newcount && andmore)) list.AddItem(themodel->Value(i)); diff --git a/src/IFSelect/IFSelect_ParamEditor.cxx b/src/IFSelect/IFSelect_ParamEditor.cxx index 3380692fb0..ae04331f1a 100644 --- a/src/IFSelect/IFSelect_ParamEditor.cxx +++ b/src/IFSelect/IFSelect_ParamEditor.cxx @@ -68,7 +68,7 @@ Standard_Boolean IFSelect_ParamEditor::Load const Handle(Standard_Transient)& /*ent*/, const Handle(Interface_InterfaceModel)& /*model*/) const { - Standard_Integer i, nb = NbValues(); + Standard_Integer i = 0, nb = NbValues(); for (i = 1; i <= nb; i ++) form->LoadValue (i,TypedValue(i)->HStringValue()); return Standard_True; @@ -80,7 +80,7 @@ Standard_Boolean IFSelect_ParamEditor::Apply const Handle(Standard_Transient)& /*ent*/, const Handle(Interface_InterfaceModel)& /*model*/) const { - Standard_Integer i, nb = NbValues(); + Standard_Integer i = 0, nb = NbValues(); for (i = 1; i <= nb; i ++) if (form->IsModified(i)) TypedValue (i)->SetHStringValue (form->EditedValue(i)); @@ -94,7 +94,7 @@ Handle(IFSelect_ParamEditor) IFSelect_ParamEditor::StaticEditor { Handle(IFSelect_ParamEditor) editor; if (list.IsNull()) return editor; - Standard_Integer i,nb = list->Length(); + Standard_Integer i = 0,nb = list->Length(); // if (nb == 0) return editor; editor = new IFSelect_ParamEditor (nb+10,label); for (i = 1; i <= nb; i ++) { diff --git a/src/IFSelect/IFSelect_SelectAnyList.cxx b/src/IFSelect/IFSelect_SelectAnyList.cxx index c9686867dd..8e5f9a5e6f 100644 --- a/src/IFSelect/IFSelect_SelectAnyList.cxx +++ b/src/IFSelect/IFSelect_SelectAnyList.cxx @@ -80,7 +80,7 @@ void IFSelect_SelectAnyList::SetRange Standard_Integer rankmax = NbItems(ent); Standard_Integer rankfrom = 1; if (!thelower.IsNull()) rankfrom = thelower->Value(); - Standard_Integer rankto; + Standard_Integer rankto = 0; if (!theupper.IsNull()) rankto = theupper->Value(); else rankto = rankmax; if (rankfrom < 1) rankfrom = 1; diff --git a/src/IFSelect/IFSelect_SelectCombine.cxx b/src/IFSelect/IFSelect_SelectCombine.cxx index f72253bfd2..5b6ef77b53 100644 --- a/src/IFSelect/IFSelect_SelectCombine.cxx +++ b/src/IFSelect/IFSelect_SelectCombine.cxx @@ -34,7 +34,7 @@ IFSelect_SelectCombine::IFSelect_SelectCombine () { } (const Handle(IFSelect_Selection)& sel) const { if (sel.IsNull()) return 0; - Standard_Integer i, nb = thelist.Length(); + Standard_Integer i = 0, nb = thelist.Length(); for (i = 1; i <= nb; i ++) if (sel == thelist.Value(i)) return i; return 0; diff --git a/src/IFSelect/IFSelect_SelectExplore.cxx b/src/IFSelect/IFSelect_SelectExplore.cxx index 477780bdbd..8b8c2c875d 100644 --- a/src/IFSelect/IFSelect_SelectExplore.cxx +++ b/src/IFSelect/IFSelect_SelectExplore.cxx @@ -50,7 +50,7 @@ IFSelect_SelectExplore::IFSelect_SelectExplore (const Standard_Integer level) TColStd_IndexedMapOfTransient entrees (nb); TColStd_IndexedMapOfTransient result (nb); // Initialisation - Standard_Integer i, j, level = 1, ilev = 0; + Standard_Integer i = 0, j = 0, level = 1, ilev = 0; Interface_EntityIterator input; input = InputResult(G); for (input.Start(); input.More(); input.Next()) i = entrees.Add (input.Value()); diff --git a/src/IFSelect/IFSelect_SelectExtract.cxx b/src/IFSelect/IFSelect_SelectExtract.cxx index 2985948be7..bed75475b2 100644 --- a/src/IFSelect/IFSelect_SelectExtract.cxx +++ b/src/IFSelect/IFSelect_SelectExtract.cxx @@ -22,8 +22,8 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectExtract,IFSelect_SelectDeduct) -IFSelect_SelectExtract::IFSelect_SelectExtract () - { thesort = Standard_True; } +IFSelect_SelectExtract::IFSelect_SelectExtract () : thesort(Standard_True) + { } Standard_Boolean IFSelect_SelectExtract::IsDirect () const { return thesort; } @@ -37,10 +37,9 @@ IFSelect_SelectExtract::IFSelect_SelectExtract () { Interface_EntityIterator iter; Interface_EntityIterator inputer = InputResult(G); // tient compte de tout - Handle(Interface_InterfaceModel) model = G.Model(); - Standard_Integer rank = 0; + Standard_Integer rank = 0; for (inputer.Start(); inputer.More(); inputer.Next()) { - Handle(Standard_Transient) ent = inputer.Value(); + const Handle(Standard_Transient)& ent = inputer.Value(); rank ++; if (SortInGraph(rank,ent,G) == thesort) iter.GetOneItem(ent); } diff --git a/src/IFSelect/IFSelect_SelectPointed.cxx b/src/IFSelect/IFSelect_SelectPointed.cxx index 7524af418a..31d4b4d3fc 100644 --- a/src/IFSelect/IFSelect_SelectPointed.cxx +++ b/src/IFSelect/IFSelect_SelectPointed.cxx @@ -48,7 +48,7 @@ IFSelect_SelectPointed::IFSelect_SelectPointed () theitems.Clear(); theset = Standard_True; if (list.IsNull()) return; - Standard_Integer i,nb = list->Length(); + Standard_Integer i = 0,nb = list->Length(); for (i = 1; i <= nb; i ++) theitems.Append (list->Value(i)); } @@ -92,7 +92,7 @@ IFSelect_SelectPointed::IFSelect_SelectPointed () // Optimise avec une Map Standard_Boolean res = Standard_False; if (list.IsNull()) return res; - Standard_Integer i, nb = theitems.Length(), nl = list->Length(); + Standard_Integer i = 0, nb = theitems.Length(), nl = list->Length(); TColStd_MapOfTransient deja (nb+nl+1); for (i = 1; i <= nb; i ++) deja.Add (theitems.Value(i)); @@ -108,7 +108,7 @@ IFSelect_SelectPointed::IFSelect_SelectPointed () { Standard_Boolean res = Standard_False; if (list.IsNull()) return res; - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); for (i = 1; i <= nb; i ++) res |= Remove (list->Value(i)); return res; } @@ -118,7 +118,7 @@ IFSelect_SelectPointed::IFSelect_SelectPointed () { Standard_Boolean res = Standard_True; if (list.IsNull()) return res; - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); for (i = 1; i <= nb; i ++) res |= Toggle (list->Value(i)); return res; } diff --git a/src/IFSelect/IFSelect_SelectRootComps.cxx b/src/IFSelect/IFSelect_SelectRootComps.cxx index 368a82bf0c..8b59c52a20 100644 --- a/src/IFSelect/IFSelect_SelectRootComps.cxx +++ b/src/IFSelect/IFSelect_SelectRootComps.cxx @@ -55,7 +55,7 @@ IFSelect_SelectRootComps::IFSelect_SelectRootComps () { } // A present, on retient, parmi les inputs, celles comptees une seule fois // (N.B.: on prend inp1, qui donne UNE entite par composant, simple ou cycle) for (inp1.Start(); inp1.More(); inp1.Next()) { - Handle(Standard_Transient) ent = inp1.Value(); + const Handle(Standard_Transient)& ent = inp1.Value(); if ((GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent); } return iter; diff --git a/src/IFSelect/IFSelect_SelectRoots.cxx b/src/IFSelect/IFSelect_SelectRoots.cxx index a60c4e6653..32e517b437 100644 --- a/src/IFSelect/IFSelect_SelectRoots.cxx +++ b/src/IFSelect/IFSelect_SelectRoots.cxx @@ -38,12 +38,12 @@ IFSelect_SelectRoots::IFSelect_SelectRoots () { } // On note dans le graphe : le cumul de chaque ensemble (Entite + Shared tous // niveaux). Les Roots initiales comptees une seule fois sont bonnes for (input.Start(); input.More(); input.Next()) { - Handle(Standard_Transient) ent = input.Value(); + const Handle(Standard_Transient)& ent = input.Value(); GC.GetFromEntity(ent); } // A present, on retient, parmi les inputs, celles comptees une seule fois for (input.Start(); input.More(); input.Next()) { - Handle(Standard_Transient) ent = input.Value(); + const Handle(Standard_Transient)& ent = input.Value(); if ((GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent); } return iter; diff --git a/src/IFSelect/IFSelect_SelectSent.cxx b/src/IFSelect/IFSelect_SelectSent.cxx index e97dad4ee0..6f8a739ed5 100644 --- a/src/IFSelect/IFSelect_SelectSent.cxx +++ b/src/IFSelect/IFSelect_SelectSent.cxx @@ -24,8 +24,8 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectSent,IFSelect_SelectExtract) IFSelect_SelectSent::IFSelect_SelectSent - (const Standard_Integer sentcount, const Standard_Boolean atleast) - { thecnt = sentcount; thelst = atleast; } + (const Standard_Integer sentcount, const Standard_Boolean atleast) : thecnt(sentcount), thelst(atleast) + { } Standard_Integer IFSelect_SelectSent::SentCount () const { return thecnt; } @@ -44,7 +44,7 @@ IFSelect_SelectSent::IFSelect_SelectSent Standard_Integer num = G.EntityNumber(inp.Value()); if (num == 0) continue; Standard_Integer nb = G.Status(num); // nb sent - Standard_Boolean ok; + Standard_Boolean ok = 0; if (thecnt == 0) ok = (nb == 0); else if (thelst) ok = (nb >= thecnt); else ok = (nb == thecnt); diff --git a/src/IFSelect/IFSelect_SelectSignature.cxx b/src/IFSelect/IFSelect_SelectSignature.cxx index c19bc5d320..8af4238069 100644 --- a/src/IFSelect/IFSelect_SelectSignature.cxx +++ b/src/IFSelect/IFSelect_SelectSignature.cxx @@ -32,7 +32,7 @@ static Standard_Integer multsign TColStd_SequenceOfAsciiString& signlist, TColStd_SequenceOfInteger& signmode) { - Standard_Integer i, nb = signtext.Length(), mode = 0; + Standard_Integer i = 0, nb = signtext.Length(), mode = 0; for (i = 1; i <= nb; i ++) { char unsign = signtext.Value(i); if (unsign == '|' || unsign == '!' || unsign == '=') { mode = 1; break; } @@ -96,9 +96,9 @@ static Standard_Integer multsign (const Standard_Integer , const Handle(Standard_Transient)& ent, const Interface_Graph& G) const { - Standard_Boolean res; - Standard_CString txt; - Handle(Interface_InterfaceModel) model = G.Model(); + Standard_Boolean res = 0; + Standard_CString txt = nullptr; + const Handle(Interface_InterfaceModel)& model = G.Model(); if (theexact <= 0) { if (!thematcher.IsNull()) return thematcher->Matches (ent,model,thesigntext, (theexact < 0)); txt = thecounter->ComputedSign(ent,G); @@ -121,7 +121,7 @@ static Standard_Integer multsign hmod = thesignmode.Value(i); jmod = hmod/8; imod = hmod - (jmod*8); - Standard_Boolean quid; + Standard_Boolean quid = 0; if (jmod == 0) { if (!thematcher.IsNull()) quid = thematcher->Matches (ent,model,signtext,(imod > 2)); else quid = IFSelect_Signature::MatchValue diff --git a/src/IFSelect/IFSelect_SelectSuite.cxx b/src/IFSelect/IFSelect_SelectSuite.cxx index 81a4e94ab3..04d9bb112c 100644 --- a/src/IFSelect/IFSelect_SelectSuite.cxx +++ b/src/IFSelect/IFSelect_SelectSuite.cxx @@ -64,7 +64,7 @@ IFSelect_SelectSuite::IFSelect_SelectSuite () { } // Demarrage : on prend l Input/Alternate SI un des 2 est mis // Sinon, on demarre sur la definition de base de la premiere selection - Standard_Integer i, nb = NbItems(); + Standard_Integer i = 0, nb = NbItems(); for (i = 1; i <= nb; i ++) { Handle(IFSelect_SelectDeduct) anitem = Item(i); if (firstin) anitem->Alternate()->SetList (iter.Content()); diff --git a/src/IFSelect/IFSelect_SelectType.cxx b/src/IFSelect/IFSelect_SelectType.cxx index 337bf7634a..0207276b51 100644 --- a/src/IFSelect/IFSelect_SelectType.cxx +++ b/src/IFSelect/IFSelect_SelectType.cxx @@ -19,11 +19,11 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectType,IFSelect_SelectAnyType) -IFSelect_SelectType::IFSelect_SelectType () - { thetype = STANDARD_TYPE(Standard_Transient); } +IFSelect_SelectType::IFSelect_SelectType () : thetype(STANDARD_TYPE(Standard_Transient)) + { } - IFSelect_SelectType::IFSelect_SelectType (const Handle(Standard_Type)& atype) - { thetype = atype; } + IFSelect_SelectType::IFSelect_SelectType (const Handle(Standard_Type)& atype) : thetype(atype) + { } void IFSelect_SelectType::SetType (const Handle(Standard_Type)& atype) { thetype = atype; } diff --git a/src/IFSelect/IFSelect_Selection.cxx b/src/IFSelect/IFSelect_Selection.cxx index 0fcc5ef743..e777c9f371 100644 --- a/src/IFSelect/IFSelect_Selection.cxx +++ b/src/IFSelect/IFSelect_Selection.cxx @@ -46,7 +46,7 @@ Standard_Boolean IFSelect_Selection::HasUniqueResult () const // On peut utiliser le Graphe a present Interface_Graph GG(G); for (iter.Start(); iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); + const Handle(Standard_Transient)& ent = iter.Value(); GG.GetFromEntity(ent,Standard_True); // et voila } return Interface_GraphContent(GG); // EntityIterator specialise (meme taille) diff --git a/src/IFSelect/IFSelect_SelectionIterator.cxx b/src/IFSelect/IFSelect_SelectionIterator.cxx index 50a2d93f58..b5d9504b19 100644 --- a/src/IFSelect/IFSelect_SelectionIterator.cxx +++ b/src/IFSelect/IFSelect_SelectionIterator.cxx @@ -16,17 +16,17 @@ #include #include -IFSelect_SelectionIterator::IFSelect_SelectionIterator () +IFSelect_SelectionIterator::IFSelect_SelectionIterator () : thecurr(1), thelist(new IFSelect_HSeqOfSelection()) { - thecurr = 1; - thelist = new IFSelect_HSeqOfSelection(); + + } IFSelect_SelectionIterator::IFSelect_SelectionIterator - (const Handle(IFSelect_Selection)& sel) + (const Handle(IFSelect_Selection)& sel) : thecurr(1), thelist(new IFSelect_HSeqOfSelection()) { - thecurr = 1; - thelist = new IFSelect_HSeqOfSelection(); + + sel->FillIterator(*this); } diff --git a/src/IFSelect/IFSelect_SessionFile.cxx b/src/IFSelect/IFSelect_SessionFile.cxx index 0f60292faf..2fb4d6f4bf 100644 --- a/src/IFSelect/IFSelect_SessionFile.cxx +++ b/src/IFSelect/IFSelect_SessionFile.cxx @@ -39,10 +39,10 @@ static int deja = 0; IFSelect_SessionFile::IFSelect_SessionFile - (const Handle(IFSelect_WorkSession)& WS) + (const Handle(IFSelect_WorkSession)& WS) : themode(Standard_False) { ClearLines(); - themode = Standard_False; + if (!deja) { // au moins celui-la : Handle(IFSelect_BasicDumper) basedumper = new IFSelect_BasicDumper; deja = 1; @@ -53,10 +53,10 @@ static int deja = 0; } IFSelect_SessionFile::IFSelect_SessionFile - (const Handle(IFSelect_WorkSession)& WS, const Standard_CString filename) + (const Handle(IFSelect_WorkSession)& WS, const Standard_CString filename) : themode(Standard_True) { ClearLines(); - themode = Standard_True; + if (!deja) { // au moins celui-la : Handle(IFSelect_BasicDumper) basedumper = new IFSelect_BasicDumper; deja = 1; @@ -181,7 +181,7 @@ static int deja = 0; thenames.Clear(); Standard_Integer nbidents = thesess->MaxIdent(); thenums = new TColStd_HArray1OfInteger (0,nbidents); thenums->Init(0); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for ( i = 1; i <= nbidents; i ++) { Handle(Standard_Transient) item = thesess->Item(i); if (!item.IsNull()) thenums->SetValue(i,-1); @@ -195,13 +195,13 @@ static int deja = 0; sprintf (laligne,"ErrorHandle %d", (thesess->ErrorHandle() ? 1 : 0)); WriteLine(laligne,'\n'); Handle(TColStd_HSequenceOfInteger) idents; - Standard_Integer nb; + Standard_Integer nb = 0; Handle(TCollection_HAsciiString) name; idents = thesess->ItemIdents(STANDARD_TYPE(IFSelect_IntParam)); nb = idents->Length(); if (nb > 0) WriteLine ("!INTEGERS",'\n'); - Standard_Integer j; // svv Jan11 2000 : porting on DEC + Standard_Integer j = 0; // svv Jan11 2000 : porting on DEC for (j = 1; j <= nb; j ++) { i = idents->Value(j); Handle(IFSelect_IntParam) P = thesess->IntParam(i); @@ -866,7 +866,7 @@ static int deja = 0; Handle(Standard_Transient) res; Standard_Integer nm = num + thelastgen; if (nm <= 0 || nm > theline.Length()) return res; - Standard_Integer id; + Standard_Integer id = 0; TCollection_AsciiString name = theline.Value(nm); if (name.Value(1) == ':') name.Remove(1); if (name.IsEqual("$")) return res; // item non-defini justement diff --git a/src/IFSelect/IFSelect_SessionFile.hxx b/src/IFSelect/IFSelect_SessionFile.hxx index 930efc0859..efe19fa442 100644 --- a/src/IFSelect/IFSelect_SessionFile.hxx +++ b/src/IFSelect/IFSelect_SessionFile.hxx @@ -270,7 +270,7 @@ protected: Handle(IFSelect_WorkSession) thesess; Handle(TColStd_HArray1OfInteger) thenums; NCollection_DataMap thenames; - Standard_Integer thenl; + Standard_Integer thenl{}; TColStd_SequenceOfAsciiString theline; private: @@ -280,8 +280,8 @@ private: TCollection_AsciiString thebuff; Standard_Integer thelastgen; Standard_Boolean thedone; - Standard_Boolean theownflag; - Standard_Integer thenewnum; + Standard_Boolean theownflag{}; + Standard_Integer thenewnum{}; }; diff --git a/src/IFSelect/IFSelect_SessionPilot.cxx b/src/IFSelect/IFSelect_SessionPilot.cxx index acf782e10e..b50e19141f 100644 --- a/src/IFSelect/IFSelect_SessionPilot.cxx +++ b/src/IFSelect/IFSelect_SessionPilot.cxx @@ -97,7 +97,7 @@ IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt) thecommand = command; if (thecommand.Value(lc) <= ' ') { thecommand.Remove(lc); lc --; } thenbwords = 0; - Standard_Integer i, nc = 0; + Standard_Integer i = 0, nc = 0; char unarg[MAXCARS]; for (i = 1; i <= lc; i ++) { char val = command.Value(i); @@ -189,7 +189,7 @@ IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt) (const Standard_Integer num) { if (num < 0 || num > thenbwords) return Standard_False; - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = num; i < thenbwords; i ++) { thewords(i).Clear(); thewords(i).AssignCat(thewords(i+1).ToCString()); @@ -240,7 +240,7 @@ IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt) IFSelect_ReturnStatus IFSelect_SessionPilot::ReadScript (const Standard_CString file) { - FILE* fic; int lefic = 0; + FILE* fic = nullptr; int lefic = 0; if (file != NULL && file[0] != '\0') { fic = OSD_OpenFile (file,"r"); if (fic) lefic = 1; @@ -288,7 +288,7 @@ IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt) // Est-ce un nom ? // Commande pour un Acteur - Handle(IFSelect_Activator) actor; Standard_Integer num; + Handle(IFSelect_Activator) actor; Standard_Integer num = 0; if (IFSelect_Activator::Select(thewords(0).ToCString(),num,actor)) { stat = actor->Do(num,this); // Prise en compte des commandes a resultat @@ -405,7 +405,7 @@ IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt) Standard_Integer nb = list->Length(); for (Standard_Integer i = 1; i <= nb; i ++) { - Handle(IFSelect_Activator) actor; Standard_Integer num; + Handle(IFSelect_Activator) actor; Standard_Integer num = 0; if (IFSelect_Activator::Select (list->Value(i).ToCString(),num,actor)) { if (IFSelect_Activator::Mode (list->Value(i).ToCString()) == 1) @@ -502,7 +502,7 @@ IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt) RemoveWord(0); RemoveWord(0); // Commande pour un Acteur - Handle(IFSelect_Activator) actor; Standard_Integer num; + Handle(IFSelect_Activator) actor; Standard_Integer num = 0; if (IFSelect_Activator::Select(thewords(0).ToCString(),num,actor)) { theobjrec.Nullify(); stat = actor->Do(num,this); diff --git a/src/IFSelect/IFSelect_SessionPilot.hxx b/src/IFSelect/IFSelect_SessionPilot.hxx index 34d4849a83..d65e989c74 100644 --- a/src/IFSelect/IFSelect_SessionPilot.hxx +++ b/src/IFSelect/IFSelect_SessionPilot.hxx @@ -212,7 +212,7 @@ private: TColStd_Array1OfAsciiString thewords; TColStd_Array1OfInteger thewordeb; Standard_Boolean therecord; - Standard_Integer thenumrec; + Standard_Integer thenumrec{}; Handle(Standard_Transient) theobjrec; TColStd_SequenceOfAsciiString thecomlist; diff --git a/src/IFSelect/IFSelect_ShareOut.cxx b/src/IFSelect/IFSelect_ShareOut.cxx index 3b979ee5d8..c1c5983765 100644 --- a/src/IFSelect/IFSelect_ShareOut.cxx +++ b/src/IFSelect/IFSelect_ShareOut.cxx @@ -23,9 +23,9 @@ #include IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ShareOut,Standard_Transient) -IFSelect_ShareOut::IFSelect_ShareOut () +IFSelect_ShareOut::IFSelect_ShareOut () : thedefrt(new TCollection_HAsciiString ("Default")) { - thedefrt = new TCollection_HAsciiString ("Default"); + thenbdefs = thelastrun = 0; } @@ -166,7 +166,7 @@ IFSelect_ShareOut::IFSelect_ShareOut () Standard_Integer IFSelect_ShareOut::ModifierRank (const Handle(IFSelect_GeneralModifier)& modifier) const { - Standard_Integer i; + Standard_Integer i = 0; Standard_Boolean formodel = modifier->IsKind(STANDARD_TYPE(IFSelect_Modifier)); if (formodel) { for (i = themodelmodifiers.Length(); i >= 1; i --) @@ -200,7 +200,7 @@ IFSelect_ShareOut::IFSelect_ShareOut () (const Standard_Boolean formodel, const Standard_Integer before, const Standard_Integer after) { - Standard_Integer nb; + Standard_Integer nb = 0; if (before <= 0 || after <= 0) return Standard_False; if (before == after) return Standard_True; if (formodel) { diff --git a/src/IFSelect/IFSelect_ShareOutResult.cxx b/src/IFSelect/IFSelect_ShareOutResult.cxx index e1159e3f18..7737fbcaea 100644 --- a/src/IFSelect/IFSelect_ShareOutResult.cxx +++ b/src/IFSelect/IFSelect_ShareOutResult.cxx @@ -25,38 +25,38 @@ IFSelect_ShareOutResult::IFSelect_ShareOutResult (const Handle(IFSelect_ShareOut)& sho, const Handle(Interface_InterfaceModel)& amodel) - : thegraph(amodel) , thedispres(amodel,Standard_False) + : thegraph(amodel) , thedispres(amodel,Standard_False), theshareout(sho), theeval(Standard_False) { - theshareout = sho; - theeval = Standard_False; + + // thedisplist = new TColStd_SequenceOfInteger(); } IFSelect_ShareOutResult::IFSelect_ShareOutResult (const Handle(IFSelect_ShareOut)& sho, const Interface_Graph& G) - : thegraph(G) , thedispres(G,Standard_False) + : thegraph(G) , thedispres(G,Standard_False), theshareout(sho), theeval(Standard_False) { - theshareout = sho; - theeval = Standard_False; + + // thedisplist = new TColStd_SequenceOfInteger(); } IFSelect_ShareOutResult::IFSelect_ShareOutResult (const Handle(IFSelect_Dispatch)& disp, const Handle(Interface_InterfaceModel)& amodel) - : thegraph(amodel) , thedispres(amodel,Standard_False) + : thegraph(amodel) , thedispres(amodel,Standard_False), thedispatch(disp), theeval(Standard_False) { - thedispatch = disp; - theeval = Standard_False; + + // thedisplist = new TColStd_SequenceOfInteger(); } IFSelect_ShareOutResult::IFSelect_ShareOutResult (const Handle(IFSelect_Dispatch)& disp, const Interface_Graph& G) - : thegraph(G) , thedispres(G,Standard_False) + : thegraph(G) , thedispres(G,Standard_False), thedispatch(disp), theeval(Standard_False) { - thedispatch = disp; - theeval = Standard_False; + + // thedisplist = new TColStd_SequenceOfInteger(); } @@ -108,7 +108,7 @@ IFSelect_ShareOutResult::IFSelect_ShareOutResult nb = theshareout->NbDispatches(); first = theshareout->LastRun() + 1; } - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = first; i <= nb; i ++) { if (!theshareout.IsNull()) disp = theshareout->Dispatch(i); if (disp->FinalSelection().IsNull()) continue; // Dispatch neutralise @@ -140,7 +140,7 @@ IFSelect_ShareOutResult::IFSelect_ShareOutResult { thedispres.Next(); thepacknum ++; - Standard_Integer dispnum; + Standard_Integer dispnum = 0; if (thepacknum <= thedisplist.Length()) dispnum = thedisplist.Value(thepacknum); else { @@ -212,7 +212,7 @@ IFSelect_ShareOutResult::IFSelect_ShareOutResult TCollection_AsciiString IFSelect_ShareOutResult::FileName () const { Standard_Integer nd = DispatchRank(); - Standard_Integer np,nbp; + Standard_Integer np = 0,nbp = 0; PacketsInDispatch(np,nbp); return theshareout->FileName(nd,np,nbp); } diff --git a/src/IFSelect/IFSelect_ShareOutResult.hxx b/src/IFSelect/IFSelect_ShareOutResult.hxx index 59c1efff44..600fbcc31b 100644 --- a/src/IFSelect/IFSelect_ShareOutResult.hxx +++ b/src/IFSelect/IFSelect_ShareOutResult.hxx @@ -155,10 +155,10 @@ private: Handle(IFSelect_ShareOut) theshareout; Handle(IFSelect_Dispatch) thedispatch; Standard_Boolean theeval; - Standard_Integer thedispnum; - Standard_Integer thepacknum; - Standard_Integer thepackdisp; - Standard_Integer thenbindisp; + Standard_Integer thedispnum{}; + Standard_Integer thepacknum{}; + Standard_Integer thepackdisp{}; + Standard_Integer thenbindisp{}; TColStd_SequenceOfInteger thedisplist; }; diff --git a/src/IFSelect/IFSelect_SignCategory.cxx b/src/IFSelect/IFSelect_SignCategory.cxx index c7d7988bb4..e4971e4ac8 100644 --- a/src/IFSelect/IFSelect_SignCategory.cxx +++ b/src/IFSelect/IFSelect_SignCategory.cxx @@ -27,7 +27,7 @@ static Standard_CString nulsign = ""; : IFSelect_Signature ("Category") { Interface_Category::Init(); // si pas deja fait - Standard_Integer i, nb = Interface_Category::NbCategories(); + Standard_Integer i = 0, nb = Interface_Category::NbCategories(); for (i = 1; i <= nb; i ++) AddCase (Interface_Category::Name(i)); } diff --git a/src/IFSelect/IFSelect_SignCounter.cxx b/src/IFSelect/IFSelect_SignCounter.cxx index d0833fb65f..f55428e19a 100644 --- a/src/IFSelect/IFSelect_SignCounter.cxx +++ b/src/IFSelect/IFSelect_SignCounter.cxx @@ -26,17 +26,17 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SignCounter,IFSelect_SignatureList) IFSelect_SignCounter::IFSelect_SignCounter (const Standard_Boolean withmap, const Standard_Boolean withlist) - : IFSelect_SignatureList (withlist) + : IFSelect_SignatureList (withlist), themapstat(withmap) { - themapstat = withmap; thenbcomp1 = thenbcomp2 = theselmode = 0; + thenbcomp1 = thenbcomp2 = theselmode = 0; } IFSelect_SignCounter::IFSelect_SignCounter (const Handle(IFSelect_Signature)& matcher, const Standard_Boolean withmap, const Standard_Boolean withlist) - : IFSelect_SignatureList (withlist) , thematcher (matcher) + : IFSelect_SignatureList (withlist) , themapstat(withmap), thematcher (matcher) { - themapstat = withmap; thenbcomp1 = thenbcomp2 = theselmode = 0; + thenbcomp1 = thenbcomp2 = theselmode = 0; TCollection_AsciiString sign = thematcher->Name(); SetName (sign.ToCString()); } diff --git a/src/IFSelect/IFSelect_SignMultiple.cxx b/src/IFSelect/IFSelect_SignMultiple.cxx index 3b5c691eb4..a7b8817396 100644 --- a/src/IFSelect/IFSelect_SignMultiple.cxx +++ b/src/IFSelect/IFSelect_SignMultiple.cxx @@ -39,7 +39,7 @@ static TCollection_AsciiString theval; // temporaire pour construire Value const Handle(Interface_InterfaceModel)& model) const { theval.Clear(); - Standard_Integer i, nb = thesubs.Length(); + Standard_Integer i = 0, nb = thesubs.Length(); for (i = 1; i <= nb; i ++) { Standard_Integer tabul = thetabs.Value(i); Standard_Boolean maxi = (tabul < 0); @@ -66,7 +66,7 @@ static TCollection_AsciiString theval; // temporaire pour construire Value const TCollection_AsciiString& text, const Standard_Boolean exact) const { if (exact) return IFSelect_Signature::Matches (ent,model,text,exact); - Standard_Integer i, nb = thesubs.Length(); + Standard_Integer i = 0, nb = thesubs.Length(); for (i = 1; i <= nb; i ++) { Handle(IFSelect_Signature) sign = Handle(IFSelect_Signature)::DownCast(thesubs.Value(i)); diff --git a/src/IFSelect/IFSelect_Signature.cxx b/src/IFSelect/IFSelect_Signature.cxx index 29a846078f..2b4beddf5a 100644 --- a/src/IFSelect/IFSelect_Signature.cxx +++ b/src/IFSelect/IFSelect_Signature.cxx @@ -87,7 +87,7 @@ static char intval[20]; if (exact) return text.IsEqual (val); // NB: no regexp char cardeb = text.Value(1); - Standard_Integer ln,lnt,i,j; + Standard_Integer ln = 0,lnt = 0,i = 0,j = 0; ln = text.Length(); lnt = (Standard_Integer)(strlen(val) - ln); for (i = 0; i <= lnt; i ++) { diff --git a/src/IFSelect/IFSelect_Signature.hxx b/src/IFSelect/IFSelect_Signature.hxx index e99b7cbc7e..239cf5e305 100644 --- a/src/IFSelect/IFSelect_Signature.hxx +++ b/src/IFSelect/IFSelect_Signature.hxx @@ -111,7 +111,7 @@ protected: private: - Standard_Integer thecasi[3]; + Standard_Integer thecasi[3]{}; Handle(TColStd_HSequenceOfAsciiString) thecasl; diff --git a/src/IFSelect/IFSelect_SignatureList.cxx b/src/IFSelect/IFSelect_SignatureList.cxx index a56ab4a48f..ca7b4ec2e0 100644 --- a/src/IFSelect/IFSelect_SignatureList.cxx +++ b/src/IFSelect/IFSelect_SignatureList.cxx @@ -24,11 +24,11 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SignatureList,Standard_Transient) IFSelect_SignatureList::IFSelect_SignatureList - (const Standard_Boolean withlist) + (const Standard_Boolean withlist) : thesignonly(Standard_False), thelistat(withlist), thenbnuls(0) { - thesignonly = Standard_False; - thelistat = withlist; - thenbnuls = 0; + + + SetName("..."); } @@ -212,9 +212,9 @@ IFSelect_SignatureList::IFSelect_SignatureList nbtot += nbent; nbsign ++; if (nbent > maxent) maxent = nbent; - TCollection_AsciiString name = iter.Key(); + const TCollection_AsciiString& name = iter.Key(); // if (!name.IsIntegerValue()) continue; pas bien fiable - Standard_Integer ic, nc = name.Length(); + Standard_Integer ic = 0, nc = name.Length(); Standard_Boolean iaint = Standard_True; for (ic = 1; ic <= nc; ic ++) { char unc = name.Value(ic); @@ -239,7 +239,7 @@ IFSelect_SignatureList::IFSelect_SignatureList S<<" For Nb Entities : "< IMPLEMENT_STANDARD_RTTIEXT(IFSelect_TransformStandard,IFSelect_Transformer) -IFSelect_TransformStandard::IFSelect_TransformStandard () - { thecopy = Standard_True; } +IFSelect_TransformStandard::IFSelect_TransformStandard () : thecopy(Standard_True) + { } void IFSelect_TransformStandard::SetCopyOption (const Standard_Boolean option) @@ -118,7 +118,7 @@ IFSelect_TransformStandard::IFSelect_TransformStandard () (const Interface_Graph& G, Interface_CopyTool& TC, Handle(Interface_InterfaceModel)& newmod) const { - Handle(Interface_InterfaceModel) original = G.Model(); + const Handle(Interface_InterfaceModel)& original = G.Model(); newmod = original->NewEmptyModel(); TC.Clear(); Standard_Integer nb = G.Size(); @@ -150,7 +150,7 @@ IFSelect_TransformStandard::IFSelect_TransformStandard () Standard_Boolean res = Standard_True; Standard_Boolean chg = Standard_False; Standard_Integer nb = NbModifiers(); - Handle(Interface_InterfaceModel) original = G.Model(); + const Handle(Interface_InterfaceModel)& original = G.Model(); for (Standard_Integer i = 1; i <= nb; i ++) { Handle(IFSelect_Modifier) unmod = Modifier(i); diff --git a/src/IFSelect/IFSelect_WorkLibrary.cxx b/src/IFSelect/IFSelect_WorkLibrary.cxx index 7ed77b73cc..27336c1ecb 100644 --- a/src/IFSelect/IFSelect_WorkLibrary.cxx +++ b/src/IFSelect/IFSelect_WorkLibrary.cxx @@ -25,7 +25,7 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_WorkLibrary,Standard_Transient) // all deferred but Copy (virtual default) -IFSelect_WorkLibrary::IFSelect_WorkLibrary () { thelevdef = 0; } +IFSelect_WorkLibrary::IFSelect_WorkLibrary () : thelevdef(0) { } Standard_Boolean IFSelect_WorkLibrary::CopyModel (const Handle(Interface_InterfaceModel)& /*original*/, diff --git a/src/IFSelect/IFSelect_WorkSession.cxx b/src/IFSelect/IFSelect_WorkSession.cxx index 0de1d2a60f..a5d7c62c77 100644 --- a/src/IFSelect/IFSelect_WorkSession.cxx +++ b/src/IFSelect/IFSelect_WorkSession.cxx @@ -85,15 +85,15 @@ static TCollection_AsciiString bufstr; //purpose : //======================================================================= -IFSelect_WorkSession::IFSelect_WorkSession () +IFSelect_WorkSession::IFSelect_WorkSession () : theerrhand(errhand = Standard_True), theshareout(new IFSelect_ShareOut), thegtool(new Interface_GTool), thecheckdone(Standard_False), thecopier(new IFSelect_ModelCopier), themodelstat(Standard_False) { - theshareout = new IFSelect_ShareOut; - theerrhand = errhand = Standard_True; - thecopier = new IFSelect_ModelCopier; + + + thecopier->SetShareOut (theshareout); - thecheckdone = Standard_False; - thegtool = new Interface_GTool; - themodelstat = Standard_False; + + + } //======================================================================= @@ -295,7 +295,7 @@ Standard_Integer IFSelect_WorkSession::StartingNumber (const Handle(Standard_Tra Standard_Integer IFSelect_WorkSession::NumberFromLabel (const Standard_CString val, const Standard_Integer afternum) const { - Standard_Integer i, cnt = 0, num = atoi(val); + Standard_Integer i = 0, cnt = 0, num = atoi(val); if (num > 0 || myModel.IsNull()) return num; // un n0 direct : gagne ! // Sinon, on considere que c est un label; a traiter en CaseNonSensitive ... if (num > myModel->NbEntities()) { num = 0; return num; } @@ -336,7 +336,7 @@ Handle(TCollection_HAsciiString) IFSelect_WorkSession::EntityName (const Handle( if (myModel.IsNull() || ent.IsNull()) return 0; Interface_ShareTool sht(thegraph->Graph()); - Standard_Integer CN; + Standard_Integer CN = 0; Handle(Interface_GeneralModule) module; if (!thegtool->Select (ent,module,CN)) return 0; return module->Name (CN,ent,sht); @@ -403,7 +403,7 @@ void IFSelect_WorkSession::ClearData (const Standard_Integer mode) Handle(TColStd_HSequenceOfInteger) list = ItemIdents(STANDARD_TYPE(IFSelect_SelectPointed)); Standard_Integer nb = list->Length(); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for (i = 1; i <= nb; i ++) { DeclareAndCast(IFSelect_SelectPointed,sp,Item(list->Value(i))); if (!sp.IsNull()) sp->Clear(); @@ -452,7 +452,7 @@ Standard_Boolean IFSelect_WorkSession::ComputeGraph Standard_Integer nb = myModel->NbEntities(); if(themodelstat) { - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for (i = 1; i <= nb; i ++) thegraph->CGraph().SetStatus(i,0); Interface_BitMap& bm = thegraph->CGraph().CBitMap(); bm.AddFlag(); @@ -566,9 +566,9 @@ Standard_Boolean IFSelect_WorkSession::ComputeCheck // Et on met a jour le Graphe (BitMap) ! Flag Incorrect (STX + SEM) Interface_BitMap& BM = CG.CBitMap(); BM.Init (Standard_False,Flag_Incorrect); - Standard_Integer num, nb = CG.Size(); + Standard_Integer num = 0, nb = CG.Size(); for (checklist.Start(); checklist.More(); checklist.Next()) { - const Handle(Interface_Check) chk = checklist.Value(); + const Handle(Interface_Check)& chk = checklist.Value(); if (!chk->HasFailed()) continue; num = checklist.Number(); if (num > 0 && num <= nb) BM.SetTrue (num,Flag_Incorrect); @@ -1048,7 +1048,7 @@ Handle(TColStd_HSequenceOfHAsciiString) IFSelect_WorkSession::ItemNamesForLabel { Handle(TColStd_HSequenceOfHAsciiString) list = new TColStd_HSequenceOfHAsciiString(); - Standard_Integer i, nb = MaxIdent(); + Standard_Integer i = 0, nb = MaxIdent(); for (i = 1; i <= nb; i ++) { Handle(TCollection_HAsciiString) lab = ItemLabel(i); Handle(Standard_Transient) item = Item(i); @@ -1339,7 +1339,7 @@ Handle(TColStd_HSequenceOfTransient) IFSelect_WorkSession::SelectionResultFromLi // On va chercher la derniere deduction de la chaine des inputs Handle(IFSelect_Selection) ssel, newinput; ssel = sel; - Standard_Integer i, nb = MaxIdent(); + Standard_Integer i = 0, nb = MaxIdent(); for (i = 1; i <= nb * 2; i ++) { newinput = deduct->Input(); deduct = GetCasted(IFSelect_SelectDeduct,newinput); @@ -1618,7 +1618,7 @@ void IFSelect_WorkSession::ClearFinalModifiers () { Handle(TColStd_HSequenceOfInteger) list = FinalModifierIdents (Standard_True); Standard_Integer nb = list->Length(); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for (i = 1; i <= nb; i ++) RemoveItem(GeneralModifier(list->Value(i))); list = FinalModifierIdents (Standard_False); @@ -1820,7 +1820,7 @@ Standard_Boolean IFSelect_WorkSession::SetModelContent Handle(Interface_InterfaceModel) newmod = myModel->NewEmptyModel(); Interface_CopyTool TC(myModel,theprotocol); - Standard_Integer i, nb = myModel->NbEntities(); + Standard_Integer i = 0, nb = myModel->NbEntities(); if (keep) { for (list.Start(); list.More(); list.Next()) TC.TransferEntity (list.Value()); @@ -1988,7 +1988,7 @@ Standard_CString IFSelect_WorkSession::GiveFileComplete { // ajouter si besoin : Prefix; Extension bufstr.Clear(); bufstr.AssignCat (file); - Standard_Integer i,j = 0,nb = bufstr.Length(); + Standard_Integer i = 0,j = 0,nb = bufstr.Length(); Handle(TCollection_HAsciiString) ext = FileExtension (); if (!ext.IsNull()) { char val0 = '\0'; if (ext->Length() > 0) val0 = ext->Value(1); @@ -2173,7 +2173,7 @@ Standard_Boolean IFSelect_WorkSession::SendSplit () */ // Decomposer if (theshareout.IsNull()) return Standard_False; - Standard_Integer i, nbd = theshareout->NbDispatches(); + Standard_Integer i = 0, nbd = theshareout->NbDispatches(); Standard_Integer nf = 0; Message_Messenger::StreamBuffer sout = Message::SendInfo(); sout<<" SendSplit .. "; @@ -2235,7 +2235,7 @@ Interface_EntityIterator IFSelect_WorkSession::SentList if (!IsLoaded()) return iter; const Interface_Graph& G = thegraph->Graph(); Standard_Integer nb = G.Size(); - Standard_Integer i; + Standard_Integer i = 0; for ( i = 1; i <= nb; i ++) { Standard_Integer stat = G.Status(i); if ( (stat > 0 && newcount < 0) || stat == newcount) @@ -2256,7 +2256,7 @@ Standard_Integer IFSelect_WorkSession::MaxSendingCount () const if (!IsLoaded()) return newcount; const Interface_Graph& G = thegraph->Graph(); Standard_Integer nb = G.Size(); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= nb; i ++) { Standard_Integer stat = G.Status(i); if (stat > newcount) newcount = stat; @@ -2668,7 +2668,7 @@ static void IFSelect_QueryProp (Interface_IntList& list, const Standard_Integer num, const int quoi) { list.SetNumber(num); - Standard_Integer i, nb = list.Length(); + Standard_Integer i = 0, nb = list.Length(); for (i = 1; i <= nb; i ++) { if (i > 1) list.SetNumber(num); // because recursive call + depth first Standard_Integer n = list.Value(i); @@ -2703,11 +2703,11 @@ static void IFSelect_QueryProp (Interface_IntList& list, void IFSelect_WorkSession::QueryCheckList (const Interface_CheckIterator& chl) { if (!IsLoaded()) return; - Standard_Integer i,nb = myModel->NbEntities(); + Standard_Integer i = 0,nb = myModel->NbEntities(); thecheckana = TCollection_AsciiString (nb+1,' '); for (chl.Start(); chl.More(); chl.Next()) { Standard_Integer num = chl.Number(); - const Handle(Interface_Check) ach = chl.Value(); + const Handle(Interface_Check)& ach = chl.Value(); if (ach->HasFailed()) thecheckana.SetValue(num,'2'); else if (ach->HasWarnings()) thecheckana.SetValue(num,'1'); } @@ -2779,7 +2779,7 @@ Standard_Integer IFSelect_WorkSession::QueryParent Handle(TColStd_HSequenceOfTransient) list = thegraph->Graph().Sharings(entson).Content(); if (list.IsNull()) return -1; - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); for (i = 1; i <= nb; i ++) { if (list->Value(i) == entdad) return 1; Standard_Integer stat = QueryParent ( entdad,list->Value(i) ); @@ -2803,7 +2803,7 @@ void IFSelect_WorkSession::SetParams (const NCollection_Vector& params, const NCollection_Vector& uselist) { - Standard_Integer i, nbp = params.Length(), nbu = uselist.Length(); + Standard_Integer i = 0, nbp = params.Length(), nbu = uselist.Length(); Handle(IFSelect_ParamEditor) editor = new IFSelect_ParamEditor (nbp+nbu+50,"Parameter Editor"); for (i = params.Lower(); i <= params.Upper(); i ++) { @@ -3038,7 +3038,7 @@ void IFSelect_WorkSession::DumpSelection IFSelect_SelectionIterator iter; sel->FillIterator(iter); for (; iter.More(); iter.Next()) { nb ++; - Handle(IFSelect_Selection) newsel = iter.Value(); + const Handle(IFSelect_Selection)& newsel = iter.Value(); sout<<" -- "<Label()<NbEntities(); + Standard_Integer i = 0, nb = myModel->NbEntities(); for (i = 1; i <= nb; i ++) list->Append (myModel->Value(i)); } @@ -3181,12 +3181,12 @@ Handle(TColStd_HSequenceOfTransient) IFSelect_WorkSession::GiveListFromList (const Standard_CString selname, const Handle(Standard_Transient)& ent) const { Handle(TColStd_HSequenceOfTransient) list; - Standard_Integer num; + Standard_Integer num = 0; // LISTE DEFINIE D OFFICE (en ce cas, la liste d entree est ignoree) if (selname[0] == '(') { // liste d entites donnees a la queue leu leu : (ID,ID,ID...) - char entid[50]; Standard_Integer i,j = 0; + char entid[50]; Standard_Integer i = 0,j = 0; TColStd_MapOfInteger numap; list = new TColStd_HSequenceOfTransient(); for (i = 1; selname[i] != '\0'; i ++) { @@ -3257,7 +3257,7 @@ Handle(TColStd_HSequenceOfTransient) IFSelect_WorkSession::GiveListCombined // mode < 0 l1-l2 = 0 l1&l2 > 0 l1|l2 (l1+l2) TColStd_MapOfTransient numap; - Standard_Integer i,n = l2->Length(); + Standard_Integer i = 0,n = l2->Length(); for (i = n; i > 0; i --) { Handle(Standard_Transient) ent = l2->Value(i); if (ent.IsNull()) continue; @@ -3429,7 +3429,7 @@ void IFSelect_WorkSession::TraceDumpEntity void IFSelect_WorkSession::PrintEntityStatus (const Handle(Standard_Transient)& ent, Standard_OStream& S) { - Standard_Integer i,nb; + Standard_Integer i = 0,nb = 0; Standard_Integer num = StartingNumber(ent); if (num == 0) { std::cout<<" -- PrintEntityStatus : unknown"<1 && mode != IFSelect_CountSummary); counter->Analyse (chks,myModel,Standard_True,failsonly); @@ -3608,7 +3608,7 @@ void IFSelect_WorkSession::EvaluateDispatch Standard_Integer max = evres->HighestDuplicationCount(); if (max < 2) sout<<" : There are none"<NbDuplicated(newcount,Standard_False) == 0) continue; @@ -3682,7 +3682,7 @@ void IFSelect_WorkSession::EvaluateComplete Standard_Integer max = evres->HighestDuplicationCount(); if (max < 2) sout<<" : There are none"<NbDuplicated(newcount,Standard_False) == 0) continue; @@ -3722,7 +3722,7 @@ void IFSelect_WorkSession::ListEntities if (!titre && mode == 0) sout<<" Keys : R Root ? Unknown * Unloaded"<Number(ent); if (mode == 1) { // n0 id (root?) category validity tracetype diff --git a/src/Image/Image_AlienPixMap.cxx b/src/Image/Image_AlienPixMap.cxx index 99b84acebd..443d50e500 100644 --- a/src/Image/Image_AlienPixMap.cxx +++ b/src/Image/Image_AlienPixMap.cxx @@ -889,7 +889,7 @@ bool Image_AlienPixMap::savePPM (const TCollection_AsciiString& theFileName) con fprintf (aFile, "# Image stored by OpenCASCADE framework in linear RGB colorspace\n"); // Write pixel data - Standard_Byte aByte; + Standard_Byte aByte = 0; for (Standard_Size aRow = 0; aRow < SizeY(); ++aRow) { for (Standard_Size aCol = 0; aCol < SizeX(); ++aCol) diff --git a/src/Image/Image_VideoRecorder.hxx b/src/Image/Image_VideoRecorder.hxx index 42c282c0c2..0370e2e974 100644 --- a/src/Image/Image_VideoRecorder.hxx +++ b/src/Image/Image_VideoRecorder.hxx @@ -138,7 +138,7 @@ protected: SwsContext* myScaleCtx; //!< scale context for conversion from RGBA to YUV Image_PixMap myImgSrcRgba; //!< input RGBA image - VideoRational myFrameRate; //!< video framerate + VideoRational myFrameRate{}; //!< video framerate int64_t myFrameCount; //!< current frame index }; diff --git a/src/IntAna/IntAna_Curve.cxx b/src/IntAna/IntAna_Curve.cxx index 6959f546ea..30f2eaa006 100644 --- a/src/IntAna/IntAna_Curve.cxx +++ b/src/IntAna/IntAna_Curve.cxx @@ -37,6 +37,8 @@ //-- pas etre mene a bien. //---------------------------------------------------------------------- +#include + #include #include @@ -399,7 +401,7 @@ void IntAna_Curve::InternalUVValue(const Standard_Real theta, //======================================================================= gp_Pnt IntAna_Curve::Value(const Standard_Real theta) { - Standard_Real A, B, C, U, V, sint, cost, SigneSqrtDis; + Standard_Real A = NAN, B = NAN, C = NAN, U = NAN, V = NAN, sint = NAN, cost = NAN, SigneSqrtDis = NAN; // A=0.0; B=0.0; C=0.0; U=0.0; V=0.0; @@ -418,7 +420,7 @@ Standard_Boolean IntAna_Curve::D1u(const Standard_Real theta, gp_Vec& Vec) { //-- Pour detecter le cas ou le calcul est impossible - Standard_Real A, B, C, U, V, sint, cost, SigneSqrtDis; + Standard_Real A = NAN, B = NAN, C = NAN, U = NAN, V = NAN, sint = NAN, cost = NAN, SigneSqrtDis = NAN; A=0.0; B=0.0; C=0.0; U=0.0; V=0.0; sint=0.0; cost=0.0; @@ -467,14 +469,14 @@ void IntAna_Curve::FindParameter(const gp_Pnt& theP, { case GeomAbs_Cylinder: { - Standard_Real aZ; + Standard_Real aZ = NAN; ElSLib::CylinderParameters(Ax3, RCyl, theP, aTheta, aZ); } break; case GeomAbs_Cone: { - Standard_Real aZ; + Standard_Real aZ = NAN; ElSLib::ConeParameters(Ax3, RCyl, Angle, theP, aTheta, aZ); } break; @@ -526,7 +528,7 @@ void IntAna_Curve::FindParameter(const gp_Pnt& theP, cost, sint, SigneSqrtDis); const gp_Pnt aP(InternalValue(U, V)); - Standard_Real aSqTol; + Standard_Real aSqTol = NAN; if (aParams[i] == aTheta || (TwoCurves && aParams[i] == DomainSup + DomainSup - aTheta)) aSqTol = InternalPrecision; diff --git a/src/IntAna/IntAna_Int3Pln.hxx b/src/IntAna/IntAna_Int3Pln.hxx index 6932f46c9e..eb4a7db627 100644 --- a/src/IntAna/IntAna_Int3Pln.hxx +++ b/src/IntAna/IntAna_Int3Pln.hxx @@ -68,8 +68,8 @@ private: - Standard_Boolean done; - Standard_Boolean empt; + Standard_Boolean done{}; + Standard_Boolean empt{}; gp_Pnt pnt; diff --git a/src/IntAna/IntAna_IntConicQuad.cxx b/src/IntAna/IntAna_IntConicQuad.cxx index 2ea0d72085..f44db75adb 100644 --- a/src/IntAna/IntAna_IntConicQuad.cxx +++ b/src/IntAna/IntAna_IntConicQuad.cxx @@ -23,6 +23,8 @@ #define PERFORM void IntAna_IntConicQuad::Perform +#include + #include #include #include @@ -47,11 +49,11 @@ static Standard_Real PIpPI = M_PI + M_PI; //============================================================================= //== E m p t y C o n s t r u c t o r //== -CREATE(void) { - done=Standard_False; - parallel = Standard_False; - inquadric = Standard_False; - nbpts = 0; +CREATE(void) : done(Standard_False), parallel(Standard_False), inquadric(Standard_False), nbpts(0) { + + + + memset (paramonc, 0, sizeof (paramonc)); } //============================================================================= @@ -63,7 +65,7 @@ CREATE(const gp_Lin& L,const IntAna_Quadric& Quad) { PERFORM(const gp_Lin& L,const IntAna_Quadric& Quad) { - Standard_Real Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,QCte; + Standard_Real Qxx = NAN,Qyy = NAN,Qzz = NAN,Qxy = NAN,Qxz = NAN,Qyz = NAN,Qx = NAN,Qy = NAN,Qz = NAN,QCte = NAN; done=inquadric=parallel=Standard_False; //---------------------------------------------------------------------- @@ -80,7 +82,7 @@ PERFORM(const gp_Lin& L,const IntAna_Quadric& Quad) { //---------------------------------------------------------------------- - Standard_Real Lx0,Ly0,Lz0,Lx,Ly,Lz; + Standard_Real Lx0 = NAN,Ly0 = NAN,Lz0 = NAN,Lx = NAN,Ly = NAN,Lz = NAN; nbpts=0; @@ -135,7 +137,7 @@ CREATE(const gp_Circ& C,const IntAna_Quadric& Quad) { PERFORM(const gp_Circ& C,const IntAna_Quadric& Quad) { - Standard_Real Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,QCte; + Standard_Real Qxx = NAN,Qyy = NAN,Qzz = NAN,Qxy = NAN,Qxz = NAN,Qyz = NAN,Qx = NAN,Qy = NAN,Qz = NAN,QCte = NAN; //---------------------------------------------------------------------- //-- Dans le repere liee a C.Position() : @@ -197,7 +199,7 @@ CREATE(const gp_Elips& E,const IntAna_Quadric& Quad) { PERFORM(const gp_Elips& E,const IntAna_Quadric& Quad) { - Standard_Real Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,QCte; + Standard_Real Qxx = NAN,Qyy = NAN,Qzz = NAN,Qxy = NAN,Qxz = NAN,Qyz = NAN,Qx = NAN,Qy = NAN,Qz = NAN,QCte = NAN; done=inquadric=parallel=Standard_False; @@ -259,7 +261,7 @@ CREATE(const gp_Parab& P,const IntAna_Quadric& Quad) { PERFORM(const gp_Parab& P,const IntAna_Quadric& Quad) { - Standard_Real Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,QCte; + Standard_Real Qxx = NAN,Qyy = NAN,Qzz = NAN,Qxy = NAN,Qxz = NAN,Qyz = NAN,Qx = NAN,Qy = NAN,Qz = NAN,QCte = NAN; done=inquadric=parallel=Standard_False; @@ -315,7 +317,7 @@ CREATE(const gp_Hypr& H,const IntAna_Quadric& Quad) { PERFORM(const gp_Hypr& H,const IntAna_Quadric& Quad) { - Standard_Real Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,QCte; + Standard_Real Qxx = NAN,Qyy = NAN,Qzz = NAN,Qxy = NAN,Qxz = NAN,Qyz = NAN,Qx = NAN,Qy = NAN,Qz = NAN,QCte = NAN; done=inquadric=parallel=Standard_False; @@ -420,9 +422,9 @@ void IntAna_IntConicQuad::Perform (const gp_Lin& L, const gp_Pln& P, done=Standard_False; - Standard_Real A,B,C,D; - Standard_Real Al,Bl,Cl; - Standard_Real Dis,Direc; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN; + Standard_Real Al = NAN,Bl = NAN,Cl = NAN; + Standard_Real Dis = NAN,Direc = NAN; P.Coefficients(A,B,C,D); gp_Pnt Orig(L.Location()); diff --git a/src/IntAna/IntAna_IntLinTorus.cxx b/src/IntAna/IntAna_IntLinTorus.cxx index 18decab651..91e25f737c 100644 --- a/src/IntAna/IntAna_IntLinTorus.cxx +++ b/src/IntAna/IntAna_IntLinTorus.cxx @@ -16,6 +16,8 @@ //-- lbr : la methode avec les coefficients est catastrophique. //-- Mise en place d'une vraie solution. +#include + #include #include #include @@ -58,9 +60,9 @@ void IntAna_IntLinTorus::Perform (const gp_Lin& L, const gp_Torus& T) { NewPL.Transform(trsf); DL.Transform(trsf); - Standard_Real a,b,c,x1,y1,z1,x0,y0,z0; - Standard_Real a0,a1,a2,a3,a4; - Standard_Real R,r,R2,r2; + Standard_Real a = NAN,b = NAN,c = NAN,x1 = NAN,y1 = NAN,z1 = NAN,x0 = NAN,y0 = NAN,z0 = NAN; + Standard_Real a0 = NAN,a1 = NAN,a2 = NAN,a3 = NAN,a4 = NAN; + Standard_Real R = NAN,r = NAN,R2 = NAN,r2 = NAN; x1 = DL.X(); y1 = DL.Y(); z1 = DL.Z(); x0 = NewPL.X(); y0 = NewPL.Y(); z0 = NewPL.Z(); @@ -77,7 +79,7 @@ void IntAna_IntLinTorus::Perform (const gp_Lin& L, const gp_Torus& T) { a1 = 2.0*b*c+8.0*R2*z1*z0; a0 = c*c+4.0*R2*(z0*z0-r2); - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; math_DirectPolynomialRoots mdpr(a4,a3,a2,a1,a0); if(mdpr.IsDone()) { Standard_Integer nbsolvalid = 0; diff --git a/src/IntAna/IntAna_IntLinTorus.hxx b/src/IntAna/IntAna_IntLinTorus.hxx index 03d01a55f5..cfb4eb5f53 100644 --- a/src/IntAna/IntAna_IntLinTorus.hxx +++ b/src/IntAna/IntAna_IntLinTorus.hxx @@ -72,12 +72,12 @@ private: - Standard_Boolean done; - Standard_Integer nbpt; + Standard_Boolean done{}; + Standard_Integer nbpt{}; gp_Pnt thePoint[4]; - Standard_Real theParam[4]; - Standard_Real theFi[4]; - Standard_Real theTheta[4]; + Standard_Real theParam[4]{}; + Standard_Real theFi[4]{}; + Standard_Real theTheta[4]{}; }; diff --git a/src/IntAna/IntAna_IntQuadQuad.cxx b/src/IntAna/IntAna_IntQuadQuad.cxx index 20fb88e65d..31846002ac 100644 --- a/src/IntAna/IntAna_IntQuadQuad.cxx +++ b/src/IntAna/IntAna_IntQuadQuad.cxx @@ -14,6 +14,7 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include #include #include @@ -117,7 +118,7 @@ static void AddSpecialPoints(const IntAna_Quadric& theQuad, class TrigonometricRoots { private: - Standard_Real Roots[4]; + Standard_Real Roots[4]{}; Standard_Boolean done; Standard_Integer NbRoots; Standard_Boolean infinite_roots; @@ -136,7 +137,7 @@ class TrigonometricRoots { } //IsARoot Standard_Boolean IsARoot(Standard_Real u) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Real aEps=RealEpsilon(); Standard_Real PIpPI = M_PI + M_PI; // @@ -183,13 +184,13 @@ TrigonometricRoots::TrigonometricRoots(const Standard_Real CC, const Standard_Real Cte, const Standard_Real Binf, const Standard_Real Bsup) -: infinite_roots(Standard_False) +: done(Standard_False), infinite_roots(Standard_False) { - Standard_Integer i, j, SvNbRoots; - Standard_Boolean Triee; + Standard_Integer i = 0, j = 0, SvNbRoots = 0; + Standard_Boolean Triee = 0; Standard_Real PIpPI = M_PI + M_PI; // - done=Standard_False; + // //-- F= AA*CN*CN+2*BB*CN*SN+CC*CN+DD*SN+EE; math_TrigonometricFunctionRoots MTFR(CC, SC, C, S, Cte, Binf, Bsup); @@ -218,7 +219,7 @@ TrigonometricRoots::TrigonometricRoots(const Standard_Real CC, //-- La recherche directe donne n importe quoi. SvNbRoots=NbRoots; for(i=0; i PolZ2 // - Standard_Integer nbsol, nbsol1, nbsolZ2; - Standard_Real Z2CC, Z2SS, Z2Cte, Z2SC, Z2C, Z2S; - Standard_Real Z1CC, Z1SS, Z1Cte, Z1SC, Z1C, Z1S; - Standard_Real C_1,C_SS, C_CC, C_S, C_C, C_SC; + Standard_Integer nbsol = 0, nbsol1 = 0, nbsolZ2 = 0; + Standard_Real Z2CC = NAN, Z2SS = NAN, Z2Cte = NAN, Z2SC = NAN, Z2C = NAN, Z2S = NAN; + Standard_Real Z1CC = NAN, Z1SS = NAN, Z1Cte = NAN, Z1SC = NAN, Z1C = NAN, Z1S = NAN; + Standard_Real C_1 = NAN,C_SS = NAN, C_CC = NAN, C_S = NAN, C_C = NAN, C_SC = NAN; // Z2CC = Qxx; Z2SS = Qyy; @@ -882,9 +883,9 @@ void IntAna_IntQuadQuad::Perform(const gp_Cone& Cone, //-- //-- Seule la courbe Z_NEGATIF est affectee //---------------------------------------------------------------------- - Standard_Boolean RacinesdePolZ2DansTheta1Theta2; - Standard_Integer i2; - Standard_Real r; + Standard_Boolean RacinesdePolZ2DansTheta1Theta2 = 0; + Standard_Integer i2 = 0; + Standard_Real r = NAN; // //nbsolZ2=PolZ2.NbSolutions(); RacinesdePolZ2DansTheta1Theta2=Standard_False; @@ -916,8 +917,8 @@ void IntAna_IntQuadQuad::Perform(const gp_Cone& Cone, } else { //#1 - Standard_Boolean NoChanges; - Standard_Real NewMin, NewMax, to; + Standard_Boolean NoChanges = 0; + Standard_Real NewMin = NAN, NewMax = NAN, to = NAN; // NewMin=Theta1; NewMax=Theta2; @@ -1059,10 +1060,10 @@ void IntAna_IntQuadQuad::Perform(const gp_Cone& Cone, //======================================================================= void IntAna_IntQuadQuad::InternalSetNextAndPrevious() { - Standard_Boolean NotLastOpenC2, NotFirstOpenC2; - Standard_Integer c1,c2; - Standard_Real aEps, aEPSILON_DISTANCE; - Standard_Real DInfC1,DSupC1, DInfC2,DSupC2; + Standard_Boolean NotLastOpenC2 = 0, NotFirstOpenC2 = 0; + Standard_Integer c1 = 0,c2 = 0; + Standard_Real aEps = NAN, aEPSILON_DISTANCE = NAN; + Standard_Real DInfC1 = NAN,DSupC1 = NAN, DInfC2 = NAN,DSupC2 = NAN; // aEps=0.0000001; aEPSILON_DISTANCE=0.0000000001; diff --git a/src/IntAna/IntAna_IntQuadQuad.hxx b/src/IntAna/IntAna_IntQuadQuad.hxx index c286a05ca5..33fe9e83cd 100644 --- a/src/IntAna/IntAna_IntQuadQuad.hxx +++ b/src/IntAna/IntAna_IntQuadQuad.hxx @@ -121,13 +121,13 @@ protected: protected: - Standard_Boolean done; - Standard_Boolean identical; + Standard_Boolean done{}; + Standard_Boolean identical{}; IntAna_Curve TheCurve[12]; - Standard_Integer previouscurve[12]; - Standard_Integer nextcurve[12]; - Standard_Integer NbCurves; - Standard_Integer Nbpoints; + Standard_Integer previouscurve[12]{}; + Standard_Integer nextcurve[12]{}; + Standard_Integer NbCurves{}; + Standard_Integer Nbpoints{}; gp_Pnt Thepoints[2]; Standard_Integer myNbMaxCurves; Standard_Real myEpsilon; diff --git a/src/IntAna/IntAna_QuadQuadGeo.cxx b/src/IntAna/IntAna_QuadQuadGeo.cxx index c3dcf2c767..72d93e443c 100644 --- a/src/IntAna/IntAna_QuadQuadGeo.cxx +++ b/src/IntAna/IntAna_QuadQuadGeo.cxx @@ -25,6 +25,8 @@ #endif +#include + #include #include #include @@ -140,7 +142,7 @@ AxeOperator::AxeOperator(const gp_Ax1& A1,const gp_Ax1& A2, : Axe1 (A1), Axe2 (A2), - myEPSILON_DISTANCE (theEpsDistance), + thecoplanar(Standard_False), thenormal(Standard_False), myEPSILON_DISTANCE (theEpsDistance), myEPSILON_AXES_PARA (theEpsAxesPara) { //--------------------------------------------------------------------- @@ -151,8 +153,8 @@ AxeOperator::AxeOperator(const gp_Ax1& A1,const gp_Ax1& A2, // RefineDir(V1); RefineDir(V2); - thecoplanar= Standard_False; - thenormal = Standard_False; + + //--- check if the two axis are parallel theparallel=V1.IsParallel(V2, myEPSILON_AXES_PARA); @@ -167,7 +169,7 @@ AxeOperator::AxeOperator(const gp_Ax1& A1,const gp_Ax1& A2, Axe2.Location()))); } //--- check if Axis are Coplanar - Standard_Real D33; + Standard_Real D33 = NAN; if(thedistanceaTreshDist || fabs(aDist2)>aTreshDist) { - Standard_Boolean bIsDone, bIsParallel; + Standard_Boolean bIsDone = 0, bIsParallel = 0; IntAna_IntConicQuad aICQ; // // 1. @@ -549,10 +551,10 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo( const gp_Pln& P ,const Standard_Real H) { done = Standard_False; - Standard_Real dist,radius; - Standard_Real A,B,C,D; - Standard_Real X,Y,Z; - Standard_Real sint,cost,h; + Standard_Real dist = NAN,radius = NAN; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN; + Standard_Real X = NAN,Y = NAN,Z = NAN; + Standard_Real sint = NAN,cost = NAN,h = NAN; gp_XYZ axex,axey,omega; @@ -608,7 +610,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo( const gp_Pln& P { gp_XYZ omegaXYZ(X,Y,Z); gp_XYZ omegaXYZtrnsl( omegaXYZ + 100.*axec.Direction().XYZ() ); - Standard_Real Xt,Yt,Zt,distt; + Standard_Real Xt = NAN,Yt = NAN,Zt = NAN,distt = NAN; omegaXYZtrnsl.Coord(Xt,Yt,Zt); distt = A*Xt + B*Yt + C*Zt + D; gp_XYZ omega1(omegaXYZtrnsl.X()-distt*A, @@ -636,7 +638,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo( const gp_Pln& P { gp_XYZ omegaXYZ(X,Y,Z); gp_XYZ omegaXYZtrnsl( omegaXYZ + 100.*axec.Direction().XYZ() ); - Standard_Real Xt,Yt,Zt,distt,ht; + Standard_Real Xt = NAN,Yt = NAN,Zt = NAN,distt = NAN,ht = NAN; omegaXYZtrnsl.Coord(Xt,Yt,Zt); distt = A*Xt + B*Yt + C*Zt + D; // ht = Sqrt(radius*radius - distt*distt); @@ -746,10 +748,10 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo( const gp_Pln& P done = Standard_False; nbint = 0; - Standard_Real A,B,C,D; - Standard_Real X,Y,Z; - Standard_Real dist,sint,cost,sina,cosa,angl,costa; - Standard_Real dh; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN; + Standard_Real X = NAN,Y = NAN,Z = NAN; + Standard_Real dist = NAN,sint = NAN,cost = NAN,sina = NAN,cosa = NAN,angl = NAN,costa = NAN; + Standard_Real dh = NAN; gp_XYZ axex,axey; gp_Lin axec(Co.Axis()); @@ -819,7 +821,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo( const gp_Pln& P else { // Solutions possibles : cercle, ellipse, parabole, hyperbole selon // l inclinaison du plan. - Standard_Real deltacenter, distance; + Standard_Real deltacenter = NAN, distance = NAN; if (cost < Tolang) { // Le plan contient la direction de l axe du cone. La solution est @@ -958,8 +960,8 @@ void IntAna_QuadQuadGeo::Perform( const gp_Pln& P { done = Standard_False; - Standard_Real A,B,C,D,dist, radius; - Standard_Real X,Y,Z; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN,dist = NAN, radius = NAN; + Standard_Real X = NAN,Y = NAN,Z = NAN; nbint = 0; // debug JAG : on met typeres = IntAna_Empty par defaut... @@ -1032,10 +1034,10 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl1, myEPSILON_CYLINDER_DELTA_DISTANCE, myEPSILON_AXES_PARA); Standard_Real R1=Cyl1.Radius(); Standard_Real R2=Cyl2.Radius(); - Standard_Real RmR, RmR_Relative; + Standard_Real RmR = NAN, RmR_Relative = NAN; RmR=(R1>R2)? (R1-R2) : (R2-R1); { - Standard_Real Rmax; + Standard_Real Rmax = NAN; Rmax=(R1>R2)? R1 : R2; RmR_Relative=RmR/Rmax; } @@ -1209,7 +1211,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl1, pt1=pt2=A1A2.PtIntersect(); Standard_Real A=DirCyl1.Angle(DirCyl2); - Standard_Real B; + Standard_Real B = NAN; B=Abs(Sin(0.5*(M_PI-A))); A=Abs(Sin(0.5*A)); @@ -1245,7 +1247,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl1, if(Abs(DistA1A2-Cyl1.Radius()-Cyl2.Radius()) tol2) { @@ -2026,7 +2028,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl, Standard_Real dO1O2=O1.Distance(O2); Standard_Real R1=Sph1.Radius(); Standard_Real R2=Sph2.Radius(); - Standard_Real Rmin,Rmax; + Standard_Real Rmin = NAN,Rmax = NAN; typeres=IntAna_Empty; param2bis=0.0; //-- pour eviter param2bis not used .... @@ -2052,7 +2054,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl, if(t >= 0.0 && t <=Tol) { typeres = IntAna_Point; nbint = 1; - Standard_Real t2; + Standard_Real t2 = NAN; if(R1==Rmax) t2=(R1 + (R2 + dO1O2)) * 0.5; else t2=(-R1+(dO1O2-R2))*0.5; @@ -2136,7 +2138,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& Pln, { done = Standard_True; // - Standard_Real aRMin, aRMaj; + Standard_Real aRMin = NAN, aRMaj = NAN; // aRMin = Tor.MinorRadius(); aRMaj = Tor.MajorRadius(); @@ -2148,7 +2150,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& Pln, const gp_Ax1 aPlnAx = Pln.Axis(); const gp_Ax1 aTorAx = Tor.Axis(); // - Standard_Boolean bParallel, bNormal; + Standard_Boolean bParallel = 0, bNormal = 0; // bParallel = aTorAx.IsParallel(aPlnAx, myEPSILON_AXES_PARA); bNormal = !bParallel ? aTorAx.IsNormal(aPlnAx, myEPSILON_AXES_PARA) : Standard_False; @@ -2157,11 +2159,11 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& Pln, return; } // - Standard_Real aDist; + Standard_Real aDist = NAN; // gp_Pnt aTorLoc = aTorAx.Location(); if (bParallel) { - Standard_Real aDt, X, Y, Z, A, B, C, D, aDR, aTolNum; + Standard_Real aDt = NAN, X = NAN, Y = NAN, Z = NAN, A = NAN, B = NAN, C = NAN, D = NAN, aDR = NAN, aTolNum = NAN; // aTolNum=myEPSILON_CYLINDER_DELTA_RADIUS; // @@ -2248,7 +2250,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl, { done = Standard_True; // - Standard_Real aRMin, aRMaj; + Standard_Real aRMin = NAN, aRMaj = NAN; // aRMin = Tor.MinorRadius(); aRMaj = Tor.MajorRadius(); @@ -2269,7 +2271,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl, return; } // - Standard_Real aRCyl; + Standard_Real aRCyl = NAN; // aRCyl = Cyl.Radius(); if (((aRCyl + Tol) < (aRMaj - aRMin)) || ((aRCyl - Tol) > (aRMaj + aRMin))) { @@ -2331,7 +2333,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con, { done = Standard_True; // - Standard_Real aRMin, aRMaj; + Standard_Real aRMin = NAN, aRMaj = NAN; // aRMin = Tor.MinorRadius(); aRMaj = Tor.MajorRadius(); @@ -2352,8 +2354,8 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con, return; } // - Standard_Real anAngle, aDist, aParam[4], aDt; - Standard_Integer i; + Standard_Real anAngle = NAN, aDist = NAN, aParam[4], aDt = NAN; + Standard_Integer i = 0; gp_Pnt aTorLoc, aPCT, aPN, aPt[4]; gp_Dir aDir[4]; // @@ -2469,7 +2471,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Sphere& Sph, { done = Standard_True; // - Standard_Real aRMin, aRMaj; + Standard_Real aRMin = NAN, aRMaj = NAN; // aRMin = Tor.MinorRadius(); aRMaj = Tor.MajorRadius(); @@ -2487,7 +2489,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Sphere& Sph, return; } // - Standard_Real aRSph, aDist; + Standard_Real aRSph = NAN, aDist = NAN; gp_Pnt aTorLoc; // gp_Dir aXDir = Tor.XAxis().Direction(); @@ -2504,7 +2506,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Sphere& Sph, // typeres = IntAna_Circle; // - Standard_Real anAlpha, aBeta; + Standard_Real anAlpha = NAN, aBeta = NAN; // anAlpha = 0.5*(aRMin*aRMin - aRSph*aRSph + aDist*aDist ) / aDist; aBeta = Sqrt(Abs(aRMin*aRMin - anAlpha*anAlpha)); @@ -2566,7 +2568,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Torus& Tor1, { done = Standard_True; // - Standard_Real aRMin1, aRMin2, aRMaj1, aRMaj2; + Standard_Real aRMin1 = NAN, aRMin2 = NAN, aRMaj1 = NAN, aRMaj2 = NAN; // aRMin1 = Tor1.MinorRadius(); aRMaj1 = Tor1.MajorRadius(); @@ -2598,7 +2600,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Torus& Tor1, return; } // - Standard_Real aDist; + Standard_Real aDist = NAN; gp_Pnt aP1, aP2; // gp_Dir aXDir1 = Tor1.XAxis().Direction(); @@ -2615,7 +2617,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Torus& Tor1, // typeres = IntAna_Circle; // - Standard_Real anAlpha, aBeta; + Standard_Real anAlpha = NAN, aBeta = NAN; // anAlpha = 0.5*(aRMin1*aRMin1 - aRMin2*aRMin2 + aDist*aDist ) / aDist; aBeta = Sqrt(Abs(aRMin1*aRMin1 - anAlpha*anAlpha)); @@ -2708,7 +2710,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Torus& Tor1, } if(n==1) { - Standard_Real R1=param1, R2=param1bis, aTmp; + Standard_Real R1=param1, R2=param1bis, aTmp = NAN; if (R1 + #include #include #include @@ -42,8 +44,8 @@ //---------------------------------------------------------------------- //-- Quadric Vide //---------------------------------------------------------------------- -IntAna_Quadric::IntAna_Quadric(void) { - CXX=CYY=CZZ=CXY=CXZ=CYZ=CX=CY=CZ=0.0; CCte=1.0; +IntAna_Quadric::IntAna_Quadric(void) : CCte(1.0) { + CXX=CYY=CZZ=CXY=CXZ=CYZ=CX=CY=CZ=0.0; } //---------------------------------------------------------------------- //-- Pln -----> Quadric @@ -125,13 +127,13 @@ void IntAna_Quadric::NewCoefficients( Standard_Real& _CXX,Standard_Real& _CYY,St ,Standard_Real& _CCte ,const gp_Ax3& Axis) const { - Standard_Real t11,t12,t13,t14; // x = t11 X + t12 Y + t13 Z + t14 - Standard_Real t21,t22,t23,t24; // y = t21 X + t22 Y + t23 Z + t24 - Standard_Real t31,t32,t33,t34; // z = t31 X + t32 Y + t33 Z + t34 + Standard_Real t11 = NAN,t12 = NAN,t13 = NAN,t14 = NAN; // x = t11 X + t12 Y + t13 Z + t14 + Standard_Real t21 = NAN,t22 = NAN,t23 = NAN,t24 = NAN; // y = t21 X + t22 Y + t23 Z + t24 + Standard_Real t31 = NAN,t32 = NAN,t33 = NAN,t34 = NAN; // z = t31 X + t32 Y + t33 Z + t34 // = X DirX + Y DirY + Z DirZ + Loc - Standard_Real Cxx,Cyy,Czz,Cxy,Cxz,Cyz,Cx,Cy,Cz,Ccte; + Standard_Real Cxx = NAN,Cyy = NAN,Czz = NAN,Cxy = NAN,Cxz = NAN,Cyz = NAN,Cx = NAN,Cy = NAN,Cz = NAN,Ccte = NAN; gp_Trsf Trans; Trans.SetTransformation(Axis); diff --git a/src/IntAna/IntAna_Quadric.hxx b/src/IntAna/IntAna_Quadric.hxx index 4f2cddbca1..8b3e259a20 100644 --- a/src/IntAna/IntAna_Quadric.hxx +++ b/src/IntAna/IntAna_Quadric.hxx @@ -20,6 +20,8 @@ #include #include +#include + class gp_Cone; class gp_Cylinder; class gp_Pln; @@ -91,16 +93,16 @@ private: - Standard_Real CXX; - Standard_Real CYY; - Standard_Real CZZ; - Standard_Real CXY; - Standard_Real CXZ; - Standard_Real CYZ; - Standard_Real CX; - Standard_Real CY; - Standard_Real CZ; - Standard_Real CCte; + Standard_Real CXX{}; + Standard_Real CYY{}; + Standard_Real CZZ{}; + Standard_Real CXY{}; + Standard_Real CXZ{}; + Standard_Real CYZ{}; + Standard_Real CX{}; + Standard_Real CY{}; + Standard_Real CZ{}; + Standard_Real CCte{}; NCollection_List mySpecialPoints; }; diff --git a/src/IntAna2d/IntAna2d_AnaIntersection.hxx b/src/IntAna2d/IntAna2d_AnaIntersection.hxx index 8892e62481..aec387bc16 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection.hxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection.hxx @@ -138,11 +138,11 @@ private: - Standard_Boolean done; - Standard_Boolean para; - Standard_Boolean iden; - Standard_Boolean empt; - Standard_Integer nbp; + Standard_Boolean done{}; + Standard_Boolean para{}; + Standard_Boolean iden{}; + Standard_Boolean empt{}; + Standard_Integer nbp{}; IntAna2d_IntPoint lpnt[4]; diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_1.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_1.cxx index f7d70afab7..1dc6b30398 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection_1.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_1.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -26,13 +28,13 @@ void IntAna2d_AnaIntersection::Perform (const gp_Lin2d& L1, done = Standard_False; - Standard_Real A1,B1,C1; - Standard_Real A2,B2,C2; + Standard_Real A1 = NAN,B1 = NAN,C1 = NAN; + Standard_Real A2 = NAN,B2 = NAN,C2 = NAN; L1.Coefficients(A1,B1,C1); L2.Coefficients(A2,B2,C2); - Standard_Real al1,be1,ga1; - Standard_Real al2,be2,ga2; + Standard_Real al1 = NAN,be1 = NAN,ga1 = NAN; + Standard_Real al2 = NAN,be2 = NAN,ga2 = NAN; Standard_Real Det =Max (Abs(A1),Max(Abs(A2),Max(Abs(B1),Abs(B2)))); @@ -99,7 +101,7 @@ void IntAna2d_AnaIntersection::Perform (const gp_Lin2d& L1, YS=temp; } - Standard_Real La,Mu; + Standard_Real La = NAN,Mu = NAN; if (Abs(A1)>=Abs(B1)) { La=(YS-L1.Location().Y())/A1; } diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_2.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_2.cxx index 1f345e531a..f9a586c2ad 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection_2.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_2.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -97,7 +99,7 @@ void IntAna2d_AnaIntersection::Perform (const gp_Circ2d& C1, Standard_Real sint2=h /R2; Standard_Real cost2=(l1-d)/R2; - Standard_Real ang1,ang2; + Standard_Real ang1 = NAN,ang2 = NAN; // ang1 et ang2 correspondent aux solutions avec sinus positif // si l'axe de reference est l'axe des centres C1C2 diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_3.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_3.cxx index fe31e86c77..da7aef5426 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection_3.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_3.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -33,7 +35,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, iden=Standard_False; para=Standard_False; // - Standard_Real A,B,C0, d; + Standard_Real A = NAN,B = NAN,C0 = NAN, d = NAN; gp_Pnt2d aP2D, aP2D1, aP2D2; // L.Coefficients(A,B,C0); @@ -53,7 +55,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, //modified by NIZNHY-PKV Fri Jun 15 09:55:29 2007t if (Abs(Abs(d)-C.Radius())<=Epsilon(C.Radius())) { // Cas de tangence - Standard_Real u, XS, YS, ang; + Standard_Real u = NAN, XS = NAN, YS = NAN, ang = NAN; // nbp=1; XS=C.Location().X() - d*A; @@ -78,7 +80,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, lpnt[0].SetValue(XS,YS,u,ang); } else { // 2 points d intersection - Standard_Real h, XS1,YS1, XS2,YS2, ang1,ang2, u1,u2;//,cost,sint angt; + Standard_Real h = NAN, XS1 = NAN,YS1 = NAN, XS2 = NAN,YS2 = NAN, ang1 = NAN,ang2 = NAN, u1 = NAN,u2 = NAN;//,cost,sint angt; nbp=2; h=Sqrt(C.Radius()*C.Radius()-d*d); //modified by NIZNHY-PKV Fri Jun 15 09:55:47 2007f diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_4.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_4.cxx index d009e4dad4..fb4a39d725 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection_4.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_4.cxx @@ -15,6 +15,8 @@ //============================================ IntAna2d_AnaIntersection_4.cxx //============================================================================ +#include + #include #include #include @@ -26,11 +28,11 @@ void IntAna2d_AnaIntersection::Perform (const gp_Lin2d& L, const IntAna2d_Conic& Conic) { - Standard_Real A,B,C,D,E,F; - Standard_Real px0,px1,px2; - Standard_Real DR_A,DR_B,DR_C,X0,Y0; - Standard_Integer i; - Standard_Real tx,ty,S; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN,E = NAN,F = NAN; + Standard_Real px0 = NAN,px1 = NAN,px2 = NAN; + Standard_Real DR_A = NAN,DR_B = NAN,DR_C = NAN,X0 = NAN,Y0 = NAN; + Standard_Integer i = 0; + Standard_Real tx = NAN,ty = NAN,S = NAN; done = Standard_False; nbp = 0; diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_5.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_5.cxx index 5fc58732b8..442b7e7e0b 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection_5.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_5.cxx @@ -15,6 +15,8 @@ //============================================ IntAna2d_AnaIntersection_5.cxx //============================================================================ +#include + #include #include #include @@ -26,12 +28,12 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& Circle, const IntAna2d_Conic& Conic) { Standard_Boolean CIsDirect = Circle.IsDirect(); - Standard_Real A,B,C,D,E,F; - Standard_Real pcc,pss,p2sc,pc,ps,pcte; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN,E = NAN,F = NAN; + Standard_Real pcc = NAN,pss = NAN,p2sc = NAN,pc = NAN,ps = NAN,pcte = NAN; Standard_Real radius=Circle.Radius(); Standard_Real radius_P2=radius*radius; - Standard_Integer i; - Standard_Real tx,ty,S; + Standard_Integer i = 0; + Standard_Real tx = NAN,ty = NAN,S = NAN; done = Standard_False; nbp = 0; diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_6.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_6.cxx index 81e697af34..f2fe2dd030 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection_6.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_6.cxx @@ -15,6 +15,8 @@ //============================================ IntAna2d_AnaIntersection_6.cxx //============================================================================ +#include + #include #include #include @@ -27,12 +29,12 @@ void IntAna2d_AnaIntersection::Perform(const gp_Elips2d& Elips, const IntAna2d_Conic& Conic) { Standard_Boolean EIsDirect = Elips.IsDirect(); - Standard_Real A,B,C,D,E,F; - Standard_Real pcte,ps,pc,p2sc,pcc,pss; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN,E = NAN,F = NAN; + Standard_Real pcte = NAN,ps = NAN,pc = NAN,p2sc = NAN,pcc = NAN,pss = NAN; Standard_Real minor_radius=Elips.MinorRadius(); Standard_Real major_radius=Elips.MajorRadius(); - Standard_Integer i; - Standard_Real tx,ty,S; + Standard_Integer i = 0; + Standard_Real tx = NAN,ty = NAN,S = NAN; done = Standard_False; nbp = 0; diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_7.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_7.cxx index 784cc5236b..0d82573c6f 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection_7.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_7.cxx @@ -15,6 +15,8 @@ //============================================ IntAna2d_AnaIntersection_7.cxx //============================================================================ +#include + #include #include #include @@ -27,10 +29,10 @@ void IntAna2d_AnaIntersection::Perform(const gp_Parab2d& P, const IntAna2d_Conic& Conic) { Standard_Boolean PIsDirect = P.IsDirect(); - Standard_Real A,B,C,D,E,F; - Standard_Real px4,px3,px2,px1,px0; - Standard_Integer i; - Standard_Real tx,ty,S; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN,E = NAN,F = NAN; + Standard_Real px4 = NAN,px3 = NAN,px2 = NAN,px1 = NAN,px0 = NAN; + Standard_Integer i = 0; + Standard_Real tx = NAN,ty = NAN,S = NAN; Standard_Real un_sur_2p=0.5/(P.Parameter()); gp_Ax2d Axe_rep(P.MirrorAxis()); diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_8.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_8.cxx index e9eebdffcb..e068fbc504 100644 --- a/src/IntAna2d/IntAna2d_AnaIntersection_8.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_8.cxx @@ -15,6 +15,8 @@ //============================================ IntAna2d_AnaIntersection_8.cxx //============================================================================ +#include + #include #include #include @@ -42,12 +44,12 @@ void IntAna2d_AnaIntersection::Perform(const gp_Hypr2d& H, const IntAna2d_Conic& Conic) { Standard_Boolean HIsDirect = H.IsDirect(); - Standard_Real A,B,C,D,E,F; - Standard_Real px0,px1,px2,px3,px4; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN,E = NAN,F = NAN; + Standard_Real px0 = NAN,px1 = NAN,px2 = NAN,px3 = NAN,px4 = NAN; Standard_Real minor_radius=H.MinorRadius(); Standard_Real major_radius=H.MajorRadius(); - Standard_Integer i; - Standard_Real tx,ty,S; + Standard_Integer i = 0; + Standard_Real tx = NAN,ty = NAN,S = NAN; done = Standard_False; nbp = 0; diff --git a/src/IntAna2d/IntAna2d_Conic.cxx b/src/IntAna2d/IntAna2d_Conic.cxx index 78348a95b3..6370a5626b 100644 --- a/src/IntAna2d/IntAna2d_Conic.cxx +++ b/src/IntAna2d/IntAna2d_Conic.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -21,11 +23,11 @@ #include #include -IntAna2d_Conic::IntAna2d_Conic (const gp_Lin2d& L) { +IntAna2d_Conic::IntAna2d_Conic (const gp_Lin2d& L) : a(0.0), b(0.0), c(0.0) { - a = 0.0; - b = 0.0; - c = 0.0; + + + L.Coefficients(d,e,f); f = 2*f; } @@ -55,9 +57,9 @@ IntAna2d_Conic::IntAna2d_Conic (const gp_Hypr2d& H) { void IntAna2d_Conic::NewCoefficients(Standard_Real& A,Standard_Real& B,Standard_Real& C ,Standard_Real& D,Standard_Real& E,Standard_Real& F ,const gp_Ax2d& Dir1) const { - Standard_Real t11,t12,t13; // x = t11 X + t12 Y + t13 - Standard_Real t21,t22,t23; // y = t21 X + t22 Y + t23 - Standard_Real A1,B1,C1,D1,E1,F1; + Standard_Real t11 = NAN,t12 = NAN,t13 = NAN; // x = t11 X + t12 Y + t13 + Standard_Real t21 = NAN,t22 = NAN,t23 = NAN; // y = t21 X + t22 Y + t23 + Standard_Real A1 = NAN,B1 = NAN,C1 = NAN,D1 = NAN,E1 = NAN,F1 = NAN; // P0(x,y)=A x x + B y y + ... + F =0 (x,y "absolute" coordinates) // and P1(X(x,y),Y(x,y))=P0(x,y) @@ -82,20 +84,20 @@ void IntAna2d_Conic::NewCoefficients(Standard_Real& A,Standard_Real& B,Standard_ Standard_Real IntAna2d_Conic::Value (const Standard_Real X, const Standard_Real Y) const { - Standard_Real _a,_b,_c,_d,_e,_f; + Standard_Real _a = NAN,_b = NAN,_c = NAN,_d = NAN,_e = NAN,_f = NAN; this->Coefficients(_a,_b,_c,_d,_e,_f); return (_a*X*X + _b*Y*Y + 2.*_c*X*Y + 2.*_d*X + 2.*_e*Y +_f); } gp_XY IntAna2d_Conic::Grad (const Standard_Real X, const Standard_Real Y) const { - Standard_Real _a,_b,_c,_d,_e,_f; + Standard_Real _a = NAN,_b = NAN,_c = NAN,_d = NAN,_e = NAN,_f = NAN; this->Coefficients(_a,_b,_c,_d,_e,_f); return gp_XY(2.*_a*X + 2.*_c*Y + 2.*_d, 2.*_b*Y + 2.*_c*X + 2.*_e); } void IntAna2d_Conic::ValAndGrad (const Standard_Real X, const Standard_Real Y, Standard_Real& Val, gp_XY& Grd) const { - Standard_Real la,lb,lc,ld,le,lf; + Standard_Real la = NAN,lb = NAN,lc = NAN,ld = NAN,le = NAN,lf = NAN; this->Coefficients(la,lb,lc,ld,le,lf); Grd.SetCoord(2.*la*X + 2.*lc*Y + 2.*ld, 2.*lb*Y + 2.*lc*X + 2.*le); Val = la*X*X + lb*Y*Y + 2.*lc*X*Y + 2.*ld*X + 2.*le*Y +lf; diff --git a/src/IntAna2d/IntAna2d_Conic.hxx b/src/IntAna2d/IntAna2d_Conic.hxx index af8ec25fe1..12694609d0 100644 --- a/src/IntAna2d/IntAna2d_Conic.hxx +++ b/src/IntAna2d/IntAna2d_Conic.hxx @@ -82,12 +82,12 @@ private: - Standard_Real a; - Standard_Real b; - Standard_Real c; - Standard_Real d; - Standard_Real e; - Standard_Real f; + Standard_Real a{}; + Standard_Real b{}; + Standard_Real c{}; + Standard_Real d{}; + Standard_Real e{}; + Standard_Real f{}; }; diff --git a/src/IntAna2d/IntAna2d_Outils.cxx b/src/IntAna2d/IntAna2d_Outils.cxx index d5b960ad24..c0dfba3b06 100644 --- a/src/IntAna2d/IntAna2d_Outils.cxx +++ b/src/IntAna2d/IntAna2d_Outils.cxx @@ -15,6 +15,8 @@ //============================================================================ //======================================================= IntAna2d_Outils.cxx //============================================================================ +#include + #include #include @@ -22,10 +24,10 @@ MyDirectPolynomialRoots::MyDirectPolynomialRoots(const Standard_Real A4, const Standard_Real A3, const Standard_Real A2, const Standard_Real A1, - const Standard_Real A0) { + const Standard_Real A0) : nbsol(0), same(Standard_False) { //-- std::cout<<" IntAna2d : A4..A0 "<1;i--) { Standard_Boolean Non_Egalite=Standard_True; for(j=i-1;(j>0) && Non_Egalite;j--) { @@ -251,10 +253,10 @@ void Traitement_Points_Confondus(Standard_Integer& nb_pts, pts[i-1].Value().Y(), pts[j-1].Value().X(), pts[j-1].Value().Y())) { - Standard_Integer k; + Standard_Integer k = 0; Non_Egalite=Standard_False; for(k=i;k-1); } Standard_Boolean InfiniteRoots() const { return(same); } private: - Standard_Real sol[16]; - Standard_Real val[16]; + Standard_Real sol[16]{}; + Standard_Real val[16]{}; Standard_Integer nbsol; Standard_Boolean same; }; diff --git a/src/IntCurve/IntCurve_IConicTool.cxx b/src/IntCurve/IntCurve_IConicTool.cxx index aa21a3f1be..f08109d42e 100644 --- a/src/IntCurve/IntCurve_IConicTool.cxx +++ b/src/IntCurve/IntCurve_IConicTool.cxx @@ -62,74 +62,61 @@ IntCurve_IConicTool::IntCurve_IConicTool(void) } -IntCurve_IConicTool::IntCurve_IConicTool(const IntCurve_IConicTool& ITool) { - prm1=ITool.prm1; - prm2=ITool.prm2; - prm3=ITool.prm3; - Axis=ITool.Axis; - Abs_To_Object=ITool.Abs_To_Object; - type=ITool.type; +IntCurve_IConicTool::IntCurve_IConicTool(const IntCurve_IConicTool& ITool) : prm1(ITool.prm1), prm2(ITool.prm2), prm3(ITool.prm3), Axis(ITool.Axis), type(ITool.type), Abs_To_Object(ITool.Abs_To_Object) { + + + + + + } //====================================================================== //====================================================================== IntCurve_IConicTool::IntCurve_IConicTool(const gp_Lin2d& Line) : prm1(0.0), prm2(0.0), - prm3(0.0) + prm3(0.0), type(GeomAbs_Line) { Line.Coefficients(Line_a,Line_b,Line_c); Axis = gp_Ax22d(Line.Position(),Standard_True); - type = GeomAbs_Line; + } //====================================================================== IntCurve_IConicTool::IntCurve_IConicTool(const gp_Elips2d& Elips) -: prm1(0.0), - prm2(0.0), - prm3(0.0) +: prm1(Elips.MajorRadius()), + prm2(Elips.MinorRadius()), + prm3(sqrt(Elips_a*Elips_a-Elips_b*Elips_b)), + Axis(Elips.Axis()), + type(GeomAbs_Ellipse) { - Elips_a = Elips.MajorRadius(); - Elips_b = Elips.MinorRadius(); - Elips_c = sqrt(Elips_a*Elips_a-Elips_b*Elips_b); - Axis = Elips.Axis(); Abs_To_Object.SetTransformation(gp::OX2d(),Axis.XAxis()); - type = GeomAbs_Ellipse; } //====================================================================== IntCurve_IConicTool::IntCurve_IConicTool(const gp_Circ2d& C) -: prm1(0.0), - prm2(0.0), - prm3(0.0) +: prm1(C.Radius()), prm2(0.0), + prm3(0.0), Axis(C.Axis()), type(GeomAbs_Circle) { - Circle_r=C.Radius(); - Axis=C.Axis(); + + Circle_x0=Axis.Location().X(); Circle_y0=Axis.Location().Y(); Abs_To_Object.SetTransformation(gp::OX2d(),Axis.XAxis()); - type = GeomAbs_Circle; + } //====================================================================== IntCurve_IConicTool::IntCurve_IConicTool(const gp_Parab2d& P) -: prm1(0.0), - prm2(0.0), - prm3(0.0) +: prm1(P.Focal()), + prm2(4.0*Parab_f), prm3(0.0), type(GeomAbs_Parabola) { - Parab_f=P.Focal(); - Parab_2p=4.0*Parab_f; Axis=P.Axis(); Abs_To_Object.SetTransformation(gp::OX2d(),Axis.XAxis()); - type = GeomAbs_Parabola; } //====================================================================== IntCurve_IConicTool::IntCurve_IConicTool(const gp_Hypr2d& H) -: prm1(0.0), - prm2(0.0), - prm3(0.0) +: prm1(H.MajorRadius()), + prm2(H.MinorRadius()), prm3(0.0), Axis(H.Axis()), type(GeomAbs_Hyperbola) { - Hypr_a = H.MajorRadius(); - Hypr_b = H.MinorRadius(); - Axis = H.Axis(); Abs_To_Object.SetTransformation(gp::OX2d(),Axis.XAxis()); - type = GeomAbs_Hyperbola; } //---------------------------------------------------------------------- gp_Pnt2d IntCurve_IConicTool::Value(const Standard_Real X) const { diff --git a/src/IntCurve/IntCurve_IntConicConic.cxx b/src/IntCurve/IntCurve_IntConicConic.cxx index 37f4833da1..7839cbdf0d 100644 --- a/src/IntCurve/IntCurve_IntConicConic.cxx +++ b/src/IntCurve/IntCurve_IntConicConic.cxx @@ -16,6 +16,8 @@ // Modified: OFV Thu Nov 6 17:03:52 2003 +#include + #include #include #include @@ -206,7 +208,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L, Inter.SetReversedParameters(ReversedParameters()); - Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol; + Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol = NAN; gp_Pnt2d Pntinf,Pntsup; if(Tol > TolConf) maxtol = Tol; else maxtol = TolConf; maxtol*=100.0; @@ -283,7 +285,7 @@ void IntCurve_IntConicConic::Perform(const gp_Circ2d& C, D.SetEquivalentParameters(DC.FirstParameter(),DC.FirstParameter()+M_PI+M_PI); } - Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol; + Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol = NAN; gp_Pnt2d Pntinf,Pntsup; maxtol = C.Radius() / 10.0; gp_Circ2d Cp(C); @@ -400,7 +402,7 @@ void IntCurve_IntConicConic::Perform(const gp_Circ2d& C, if(! DC.IsClosed()) { D.SetEquivalentParameters(DC.FirstParameter(),DC.FirstParameter()+M_PI+M_PI); } - Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol; + Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol = NAN; gp_Pnt2d Pntinf,Pntsup; maxtol = C.Radius() / 10.0; gp_Vec2d Offset(maxtol*H.XAxis().Direction().X(), @@ -470,7 +472,7 @@ void IntCurve_IntConicConic::Perform(const gp_Parab2d& P1, PCurve.SetAccuracy(20); Inter.SetReversedParameters(ReversedParameters()); - Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol; + Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol = NAN; gp_Pnt2d Pntinf,Pntsup; if(Tol > TolConf) maxtol = Tol; else maxtol = TolConf; maxtol*=100.0; @@ -549,7 +551,7 @@ void IntCurve_IntConicConic::Perform(const gp_Elips2d& E, //-- std::cout<<" Parab Elips "< TolConf) maxtol = Tol; else maxtol = TolConf; @@ -625,7 +627,7 @@ void IntCurve_IntConicConic::Perform(const gp_Parab2d& P, IntCurve_PConic PCurve(H); Inter.SetReversedParameters(ReversedParameters()); - Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol; + Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol = NAN; gp_Pnt2d Pntinf,Pntsup; if(Tol > TolConf) maxtol = Tol; else maxtol = TolConf; maxtol*=100.0; @@ -747,7 +749,7 @@ void IntCurve_IntConicConic::Perform(const gp_Elips2d& E, DEModif.SetEquivalentParameters(DE.FirstParameter(),DE.FirstParameter()+M_PI+M_PI); } - Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol; + Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol = NAN; gp_Pnt2d Pntinf,Pntsup; maxtol = E.MinorRadius() / 10.0; gp_Vec2d Offset(maxtol*H.XAxis().Direction().X(), @@ -822,7 +824,7 @@ void IntCurve_IntConicConic::Perform(const gp_Hypr2d& H1, Inter.SetReversedParameters(ReversedParameters()); - Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol; + Standard_Real binf = Precision::Infinite(),bsup = -Precision::Infinite(),maxtol = NAN; gp_Pnt2d Pntinf,Pntsup; if(Tol > TolConf) maxtol = Tol; else maxtol = TolConf; maxtol*=100.0; diff --git a/src/IntCurve/IntCurve_IntConicConic_1.cxx b/src/IntCurve/IntCurve_IntConicConic_1.cxx index 4ecd7bce42..d1245ef188 100644 --- a/src/IntCurve/IntCurve_IntConicConic_1.cxx +++ b/src/IntCurve/IntCurve_IntConicConic_1.cxx @@ -16,6 +16,8 @@ // a modifier le cas de 2 points confondus ( Insert a la place d'append ? ) +#include + #include #include #include @@ -140,7 +142,7 @@ void CircleCircleGeometricIntersection(const gp_Circ2d& C1 ,PeriodicInterval& C1_Res2 ,Standard_Integer& nbsol) { - Standard_Real C1_binf1,C1_binf2=0,C1_bsup1,C1_bsup2=0; + Standard_Real C1_binf1 = NAN,C1_binf2=0,C1_bsup1 = NAN,C1_bsup2=0; Standard_Real dO1O2=(C1.Location()).Distance(C2.Location()); Standard_Real R1=C1.Radius(); Standard_Real R2=C2.Radius(); @@ -172,7 +174,7 @@ void CircleCircleGeometricIntersection(const gp_Circ2d& C1 Standard_Real R1pTolR1pTol=R1pTol*R1pTol; Standard_Real R1mTolR1mTol=R1mTol*R1mTol; Standard_Real dO1O2dO1O2=dO1O2*dO1O2; - Standard_Real dAlpha1; + Standard_Real dAlpha1 = NAN; //--------------------------------------------------------------- Cas //-- C2 coupe le cercle C1+ (=C(x1,y1,R1+Tol)) //-- 1 seul segment donne par Inter C2 C1+ @@ -258,7 +260,7 @@ void CircleCircleGeometricIntersection(const gp_Circ2d& C1 gp_Vec2d Axe1=C1.XAxis().Direction(); gp_Vec2d AxeO1O2=gp_Vec2d(C1.Location(),C2.Location()); - Standard_Real dAngle1; + Standard_Real dAngle1 = NAN; if(AxeO1O2.Magnitude() <= gp::Resolution()) dAngle1=Axe1.Angle(C2.XAxis().Direction()); else @@ -392,7 +394,7 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, Standard_Real dO1O2=Line.Distance(Circle.Location()); Standard_Real R=Circle.Radius(); Standard_Real RmTol=R-Tol; - Standard_Real binf1,binf2=0,bsup1,bsup2=0; + Standard_Real binf1 = NAN,binf2=0,bsup1 = NAN,bsup2=0; //---------------------------------------------------------------- if(dO1O2 > (R+Tol)) { //-- pas d intersection avec le 'tuyau' @@ -408,13 +410,13 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, } else { //---------------------------------------------------------------- - Standard_Boolean b2Sol; - Standard_Real dAlpha1; + Standard_Boolean b2Sol = 0; + Standard_Real dAlpha1 = NAN; //--------------------------------------------------------------- //-- Line coupe le cercle Circle+ (=C(x1,y1,R1+Tol)) b2Sol=Standard_False; if (R>dO1O2+TolTang) { - Standard_Real aX2, aTol2; + Standard_Real aX2 = NAN, aTol2 = NAN; // aTol2=Tol*Tol; aX2=4.*(R*R-dO1O2*dO1O2); @@ -479,7 +481,7 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, #endif - Standard_Real a,b,c,d; + Standard_Real a = NAN,b = NAN,c = NAN,d = NAN; Line.Coefficients(a,b,c); d = a*Circle.Location().X() + b*Circle.Location().Y() + c; @@ -832,7 +834,7 @@ void IntCurve_IntConicConic::Perform(const gp_Circ2d& Circle1 Standard_Real R2=Circle2.Radius(); Standard_Real Tol2=Tol+Tol; //---- Pour eviter de toujours retourner //des segments - Standard_Integer i ; + Standard_Integer i = 0 ; if(Tol < (1e-10)) Tol2 = 1e-10; @@ -1110,7 +1112,7 @@ static Standard_Boolean computeIntPoint(const IntRes2d_Domain& theCurDomain, Standard_Real aRes2 = theParOther + (theResSup - theParCur) * theCosT1T2; - Standard_Real aFirst2, aLast2, aTol21, aTol22, aTol11, aTol12 ; + Standard_Real aFirst2 = NAN, aLast2 = NAN, aTol21 = NAN, aTol22 = NAN, aTol11 = NAN, aTol12 = NAN ; getDomainParametrs(theDomainOther,aFirst2, aLast2, aTol21, aTol22); @@ -1142,7 +1144,7 @@ static Standard_Boolean computeIntPoint(const IntRes2d_Domain& theCurDomain, Standard_Real aResU1 = theParCur; Standard_Real aResU2 = theParOther; - Standard_Real aFirst1, aLast1; + Standard_Real aFirst1 = NAN, aLast1 = NAN; getDomainParametrs(theCurDomain,aFirst1, aLast1, aTol11, aTol12); Standard_Boolean isInside1 = (theParCur >= aFirst1 && theParCur <= aLast1); @@ -1219,13 +1221,13 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1 this->ResetFields(); //-- Coordonnees du point d intersection sur chacune des 2 droites - Standard_Real U1,U2; + Standard_Real U1 = NAN,U2 = NAN; //-- Nombre de points solution : 1 : Intersection //-- 0 : Non Confondues //-- 2 : Confondues a la tolerance pres - Standard_Integer nbsol; + Standard_Integer nbsol = 0; IntRes2d_IntersectionPoint PtSeg1,PtSeg2; - Standard_Real aHalfSinL1L2; + Standard_Real aHalfSinL1L2 = NAN; Standard_Real Tol = TolR; if(Tol < Precision::PConfusion()) Tol = Precision::PConfusion(); @@ -1255,8 +1257,8 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1 Standard_Real U1sup=U1+d; Standard_Real U1mU2=U1-U2; Standard_Real U1pU2=U1+U2; - Standard_Real Res1inf,Res1sup; - Standard_Real ProdVectTan; + Standard_Real Res1inf = NAN,Res1sup = NAN; + Standard_Real ProdVectTan = NAN; //--------------------------------------------------- @@ -1345,8 +1347,8 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1 else { //-- Intersection AND Domain1 --------> Segment --------------------- - Standard_Real U2inf,U2sup; - Standard_Real Res2inf,Res2sup; + Standard_Real U2inf = NAN,U2sup = NAN; + Standard_Real Res2inf = NAN,Res2sup = NAN; if (isOpposite) { U2inf = U1pU2 -Res1sup; U2sup= U1pU2-Res1inf; } else { U2inf = Res1inf-U1mU2; U2sup= Res1sup-U1mU2; } @@ -1459,7 +1461,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1 } gp_Pnt2d Ptdebut; if(Pos1a==IntRes2d_Middle) { - Standard_Real t3; + Standard_Real t3 = NAN; if (isOpposite) { t3 = (Pos2a == IntRes2d_Head)? Res2sup : Res2inf; } @@ -1529,7 +1531,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1 if(Pos1b!=IntRes2d_Middle || Pos2b!=IntRes2d_Middle) { gp_Pnt2d Ptfin; if(Pos1b==IntRes2d_Middle) { - Standard_Real t2; + Standard_Real t2 = NAN; if (isOpposite) { t2 = (Pos2b == IntRes2d_Head)? Res2sup : Res2inf; } @@ -1682,7 +1684,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1 //-- Standard_Integer ResHasFirstPoint=0; Standard_Integer ResHasLastPoint=0; - Standard_Real ParamStart = 0.,ParamStart2,ParamEnd = 0.,ParamEnd2; + Standard_Real ParamStart = 0.,ParamStart2 = NAN,ParamEnd = 0.,ParamEnd2 = NAN; Standard_Real Org2SurL1=ElCLib::Parameter(L1,L2.Location()); //== 3 : L1 et L2 bornent //== 2 : L2 borne @@ -1998,7 +2000,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& Line //-- ( Rayon * Intervalle.Length() < TolConf ) ### Modif 19 Nov Tol-->TolConf //-- Standard_Real R=Circle.Radius(); - Standard_Integer i ; + Standard_Integer i = 0 ; Standard_Real MaxTol = TolConf; if(MaxTol + #include #include @@ -91,7 +93,7 @@ Standard_Real NormalizeOnCircleDomain(const Standard_Real _Param //---------------------------------------------------------------------- PeriodicInterval PeriodicInterval::FirstIntersection(PeriodicInterval& PInter) { - Standard_Real a,b; + Standard_Real a = NAN,b = NAN; if(PInter.isnull || isnull) { PeriodicInterval PourSGI; return(PourSGI); } @@ -123,7 +125,7 @@ PeriodicInterval PeriodicInterval::FirstIntersection(PeriodicInterval& PInter) //---------------------------------------------------------------------- PeriodicInterval PeriodicInterval::SecondIntersection(PeriodicInterval& PInter) { - Standard_Real a,b; + Standard_Real a = NAN,b = NAN; if(PInter.isnull @@ -153,8 +155,8 @@ Interval::Interval() : Binf(0.), Bsup(0.), HasFirstBound(Standard_False), - HasLastBound(Standard_False) -{ IsNull=Standard_True; } + HasLastBound(Standard_False), IsNull(Standard_True) +{ } Interval::Interval(const Standard_Real a,const Standard_Real b) { HasFirstBound=HasLastBound=Standard_True; @@ -165,9 +167,9 @@ Interval::Interval(const Standard_Real a,const Standard_Real b) { Interval::Interval(const IntRes2d_Domain& Domain) : Binf(0.0), - Bsup(0.0) + Bsup(0.0), IsNull(Standard_False) { - IsNull=Standard_False; + if(Domain.HasFirstPoint()) { HasFirstBound=Standard_True; Binf=Domain.FirstParameter()-Domain.FirstTolerance(); @@ -182,11 +184,11 @@ Interval::Interval(const IntRes2d_Domain& Domain) } Interval::Interval( const Standard_Real a,const Standard_Boolean hf - ,const Standard_Real b,const Standard_Boolean hl) { - Binf=a; Bsup=b; - IsNull=Standard_False; - HasFirstBound=hf; - HasLastBound=hl; + ,const Standard_Real b,const Standard_Boolean hl) : Binf(a), Bsup(b), IsNull(Standard_False), HasFirstBound(hf), HasLastBound(hl) { + + + + } Standard_Real Interval::Length() { return((IsNull)? -1.0 :Abs(Bsup-Binf)); } @@ -195,7 +197,7 @@ Interval Interval::IntersectionWithBounded(const Interval& Inter) { if(IsNull || Inter.IsNull) { Interval PourSGI; return(PourSGI); } if(!(HasFirstBound || HasLastBound)) return(Interval(Inter.Binf,Inter.Bsup)); - Standard_Real a,b; + Standard_Real a = NAN,b = NAN; if(HasFirstBound) { if(Inter.Bsup < Binf) { Interval PourSGI; return(PourSGI); } a=(Inter.Binf < Binf)? Binf : Inter.Binf; diff --git a/src/IntCurve/IntCurve_ProjectOnPConicTool.cxx b/src/IntCurve/IntCurve_ProjectOnPConicTool.cxx index 25f2a2f1f3..76b7782903 100644 --- a/src/IntCurve/IntCurve_ProjectOnPConicTool.cxx +++ b/src/IntCurve/IntCurve_ProjectOnPConicTool.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -28,7 +30,7 @@ Standard_Real IntCurve_ProjectOnPConicTool::FindParameter const Standard_Real) { - Standard_Real ParamSup,ParamInf,Param=0; + Standard_Real ParamSup = NAN,ParamInf = NAN,Param=0; if(LowParameter>HighParameter) { ParamSup=LowParameter; ParamInf=HighParameter; diff --git a/src/IntCurveSurface/IntCurveSurface_Intersection.cxx b/src/IntCurveSurface/IntCurveSurface_Intersection.cxx index 62e6b30c74..c8e97f0907 100644 --- a/src/IntCurveSurface/IntCurveSurface_Intersection.cxx +++ b/src/IntCurveSurface/IntCurveSurface_Intersection.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -62,7 +64,7 @@ void IntCurveSurface_Intersection::SetValues(const IntCurveSurface_Intersection& lseg.Clear(); lpnt.Clear(); Standard_Integer N = Other.lpnt.Length(); - Standard_Integer i ; + Standard_Integer i = 0 ; for( i=1; i<= N ; i++) { lpnt.Append(Other.lpnt.Value(i)); } @@ -83,7 +85,7 @@ void IntCurveSurface_Intersection::Append(const IntCurveSurface_Intersection& Ot // const Standard_Real b) const Standard_Real ) { - Standard_Integer i,ni; + Standard_Integer i = 0,ni = 0; if(Other.done) { ni = Other.lpnt.Length(); for(i=1;i<=ni;i++) { Append(Other.Point(i)); } @@ -93,8 +95,8 @@ void IntCurveSurface_Intersection::Append(const IntCurveSurface_Intersection& Ot } //================================================================================ void IntCurveSurface_Intersection::Append(const IntCurveSurface_IntersectionPoint& OtherPoint) { - Standard_Integer i,ni; - Standard_Real anu,anv,anw,u,v,w; + Standard_Integer i = 0,ni = 0; + Standard_Real anu = NAN,anv = NAN,anw = NAN,u = NAN,v = NAN,w = NAN; IntCurveSurface_TransitionOnCurve TrOnCurve,anTrOnCurve; gp_Pnt P,anP; ni = lpnt.Length(); @@ -129,7 +131,7 @@ void IntCurveSurface_Intersection::ResetFields() { //================================================================================ void IntCurveSurface_Intersection::Dump() const { if(done) { - Standard_Integer i,ni; + Standard_Integer i = 0,ni = 0; ni = lpnt.Length(); for(i=1;i<=ni;i++) { Point(i).Dump(); } ni = lseg.Length(); diff --git a/src/IntCurvesFace/IntCurvesFace_Intersector.cxx b/src/IntCurvesFace/IntCurvesFace_Intersector.cxx index 6db23180f9..f042a1457e 100644 --- a/src/IntCurvesFace/IntCurvesFace_Intersector.cxx +++ b/src/IntCurvesFace/IntCurvesFace_Intersector.cxx @@ -16,6 +16,8 @@ #define OPTIMISATION 1 +#include + #include #include @@ -58,8 +60,8 @@ static void ComputeSamplePars(const Handle(Adaptor3d_Surface)& Hsurface, TColStd_Array1OfInteger NbUSubInts(1, NbUInts); TColStd_Array1OfInteger NbVSubInts(1, NbVInts); // - Standard_Integer i, j, ind, NbU, NbV; - Standard_Real t, dt; + Standard_Integer i = 0, j = 0, ind = 0, NbU = 0, NbV = 0; + Standard_Real t = NAN, dt = NAN; t = UInts(NbUInts + 1) - UInts(1); t = 1. / t; NbU = 0; @@ -132,11 +134,11 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face, done(Standard_False), myReady(Standard_False), nbpnt(0), - myUseBoundTol (UseBToler), + face(Face), myUseBoundTol (UseBToler), myIsParallel(Standard_False) { BRepAdaptor_Surface surface; - face = Face; + surface.Initialize(Face, aRestr); Hsurface = new BRepAdaptor_Surface(surface); myTopolTool = new BRepTopAdaptor_TopolTool(Hsurface); @@ -147,8 +149,8 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face, && (SurfaceType != GeomAbs_Cone) && (SurfaceType != GeomAbs_Sphere) && (SurfaceType != GeomAbs_Torus)) { - Standard_Integer nbsu,nbsv; - Standard_Real U0,V0,U1,V1; + Standard_Integer nbsu = 0,nbsv = 0; + Standard_Real U0 = NAN,V0 = NAN,U1 = NAN,V1 = NAN; U0 = Hsurface->FirstUParameter(); U1 = Hsurface->LastUParameter(); V0 = Hsurface->FirstVParameter(); @@ -253,7 +255,7 @@ void IntCurvesFace_Intersector::InternalCall(const IntCurveSurface_HInter &HICS, for(; anExp.More(); anExp.Next()) { TopoDS_Edge anE = TopoDS::Edge(anExp.Current()); - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) aPC = BRep_Tool::Curve (anE, f, l); GeomAPI_ProjectPointOnCurve aProj (HICSPointindex.Pnt(), aPC, f, l); if (aProj.NbPoints() > 0) @@ -445,7 +447,7 @@ void IntCurvesFace_Intersector::Perform(const Handle(Adaptor3d_Curve)& HCu, if(parinfParMax) parsup = ParMax; if(parinf>(parsup-1e-9)) return; - Standard_Integer nbs; + Standard_Integer nbs = 0; nbs = IntCurveSurface_TheHCurveTool::NbSamples(HCu,parinf,parsup); IntCurveSurface_ThePolygonOfHInter polygon(HCu, diff --git a/src/IntCurvesFace/IntCurvesFace_ShapeIntersector.cxx b/src/IntCurvesFace/IntCurvesFace_ShapeIntersector.cxx index 8010244384..4564cf498a 100644 --- a/src/IntCurvesFace/IntCurvesFace_ShapeIntersector.cxx +++ b/src/IntCurvesFace/IntCurvesFace_ShapeIntersector.cxx @@ -36,7 +36,7 @@ void IntCurvesFace_ShapeIntersector::Load(const TopoDS_Shape& theShape, const Standard_Real theTol) { TopExp_Explorer Ex; - Standard_Integer i; + Standard_Integer i = 0; for(myNbFaces = 0, i = 0, Ex.Init(theShape, TopAbs_FACE); Ex.More(); ++i, Ex.Next()) { ++myNbFaces; @@ -116,7 +116,7 @@ void IntCurvesFace_ShapeIntersector::PerformNearest(const gp_Lin& theL, if (!myPtrNums.IsEmpty() && anIndexFace >= 0) { myPtrNums.ChangeValue(anIndexFace) += 1; - Standard_Integer im1; + Standard_Integer im1 = 0; for (im1 = anIndexFace - 1, i = anIndexFace; i >= 1 && myPtrNums.Value(i) > myPtrNums.Value(im1); --i, --im1) { std::swap(myPtrIndexNums.ChangeValue(i), myPtrIndexNums.ChangeValue(im1)); @@ -186,7 +186,7 @@ void IntCurvesFace_ShapeIntersector::SortResult() } //Sort according to parameter w - Standard_Boolean isOK; + Standard_Boolean isOK = 0; do { isOK = Standard_True; diff --git a/src/IntImp/IntImp_ComputeTangence.cxx b/src/IntImp/IntImp_ComputeTangence.cxx index e1c740fc27..8b43044ab4 100644 --- a/src/IntImp/IntImp_ComputeTangence.cxx +++ b/src/IntImp/IntImp_ComputeTangence.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -67,8 +69,8 @@ Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[], // l intersection { - Standard_Real NormDuv[4], aM2, aTol2; - Standard_Integer i; + Standard_Real NormDuv[4], aM2 = NAN, aTol2 = NAN; + Standard_Integer i = 0; // aTol2=1.e-32; // @@ -134,7 +136,7 @@ Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[], //-- Tri sur NormDuv ( en para. avec ChoixRef ) Standard_Boolean triOk = Standard_False; - Standard_Real t; + Standard_Real t = NAN; IntImp_ConstIsoparametric ti; for ( i=0;i<=3;i++) { diff --git a/src/IntImpParGen/IntImpParGen.cxx b/src/IntImpParGen/IntImpParGen.cxx index b83b7be16e..23e5f9b207 100644 --- a/src/IntImpParGen/IntImpParGen.cxx +++ b/src/IntImpParGen/IntImpParGen.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -28,7 +30,7 @@ Standard_Real IntImpParGen::NormalizeOnDomain(Standard_Real& Param, const IntRes2d_Domain& TheDomain) { Standard_Real modParam = Param; if(TheDomain.IsClosed()) { - Standard_Real Periode,t; + Standard_Real Periode = NAN,t = NAN; TheDomain.EquivalentParameters(t,Periode); Periode-=t; while( modParam + #include #include @@ -24,7 +26,7 @@ Standard_Real NormalizeOnDomain(Standard_Real& Param,const IntRes2d_Domain& TheDomain) { Standard_Real modParam = Param; if(TheDomain.IsClosed()) { - Standard_Real Periode,t; + Standard_Real Periode = NAN,t = NAN; TheDomain.EquivalentParameters(t,Periode); Periode-=t; if(TheDomain.HasFirstPoint()) { @@ -117,7 +119,7 @@ void Determine_Transition(const IntRes2d_Position Pos1, else { gp_Vec2d Norm; Norm.SetCoord(-Tan1.Y(),Tan1.X()); - Standard_Real Val1,Val2; + Standard_Real Val1 = NAN,Val2 = NAN; if (!courbure1) { Val1=0.0; } diff --git a/src/IntPatch/IntPatch_ALine.cxx b/src/IntPatch/IntPatch_ALine.cxx index ff79b379bd..d36044eef2 100644 --- a/src/IntPatch/IntPatch_ALine.cxx +++ b/src/IntPatch/IntPatch_ALine.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -29,13 +31,13 @@ IntPatch_ALine::IntPatch_ALine (const IntAna_Curve& C, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2) : IntPatch_Line(Tang,Trans1,Trans2), - fipt(Standard_False), + curv(C), fipt(Standard_False), lapt(Standard_False), indf(0), indl(0) { typ = IntPatch_Analytic; - curv = C; + } @@ -44,26 +46,26 @@ IntPatch_ALine::IntPatch_ALine (const IntAna_Curve& C, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2) : IntPatch_Line(Tang,Situ1,Situ2), - fipt(Standard_False), + curv(C), fipt(Standard_False), lapt(Standard_False), indf(0), indl(0) { typ = IntPatch_Analytic; - curv = C; + } IntPatch_ALine::IntPatch_ALine (const IntAna_Curve& C, const Standard_Boolean Tang) : IntPatch_Line(Tang), - fipt(Standard_False), + curv(C), fipt(Standard_False), lapt(Standard_False), indf(0), indl(0) { typ = IntPatch_Analytic; - curv = C; + } const IntAna_Curve& IntPatch_ALine::Curve() const { @@ -234,11 +236,11 @@ void IntPatch_ALine::AddVertex (const IntPatch_Point& VTXj) { void IntPatch_ALine::ComputeVertexParameters(const Standard_Real Tol) { - Standard_Boolean SortIsOK,APointDeleted; + Standard_Boolean SortIsOK = 0,APointDeleted = 0; Standard_Boolean SortAgain = Standard_True; - Standard_Integer nbvtx,i,j; - Standard_Real ParamMinOnLine,ParamMaxOnLine; - Standard_Boolean OpenFirst,OpenLast; + Standard_Integer nbvtx = 0,i = 0,j = 0; + Standard_Real ParamMinOnLine = NAN,ParamMaxOnLine = NAN; + Standard_Boolean OpenFirst = 0,OpenLast = 0; ParamMinOnLine = FirstParameter(OpenFirst); ParamMaxOnLine = LastParameter(OpenLast); @@ -605,7 +607,7 @@ void IntPatch_ALine::ComputeVertexParameters(const Standard_Real Tol) { IntPatch_Point CopyVtx = VTXm1; VTXm1.SetParameter(VTX.ParameterOnLine()); VTXm1.SetValue(VTX.Value(),VTX.Tolerance(),VTX.IsTangencyPoint()); - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; VTX.Parameters(u1,v1,u2,v2); VTXm1.SetParameters(u1,v1,u2,v2); if(CopyVtx.IsOnDomS1()) { diff --git a/src/IntPatch/IntPatch_ALineToWLine.cxx b/src/IntPatch/IntPatch_ALineToWLine.cxx index 54f8f07453..0a71ff0afd 100644 --- a/src/IntPatch/IntPatch_ALineToWLine.cxx +++ b/src/IntPatch/IntPatch_ALineToWLine.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -263,7 +265,7 @@ void IntPatch_ALineToWLine::CorrectEndPoint(Handle(IntSurf_LineOn2S)& theLine, const Standard_Real aSqTol = 1.e-10; //Perform linear extrapolation from two previous points - Standard_Integer anIndFirst, anIndSecond; + Standard_Integer anIndFirst = 0, anIndSecond = 0; if (theIndex == 1) { anIndFirst = 3; @@ -290,7 +292,7 @@ void IntPatch_ALineToWLine::CorrectEndPoint(Handle(IntSurf_LineOn2S)& theLine, } else if (aQuad.TypeQuadric() == GeomAbs_Sphere) { - Standard_Real aU, aV; + Standard_Real aU = NAN, aV = NAN; aPntOn2S.ParametersOnSurface(anIsOnFirst, aU, aV); if (Abs(aV - M_PI/2) > aTol && Abs(aV + M_PI/2) > aTol) @@ -303,7 +305,7 @@ void IntPatch_ALineToWLine::CorrectEndPoint(Handle(IntSurf_LineOn2S)& theLine, gp_Pnt2d PrevP2d = theLine->Value (anIndSecond).ValueOnSurface(anIsOnFirst); gp_Dir2d aDir = gp_Vec2d(PrevPrevP2d, PrevP2d); Standard_Real aX0 = PrevPrevP2d.X(), aY0 = PrevPrevP2d.Y(); - Standard_Real aXend, aYend; + Standard_Real aXend = NAN, aYend = NAN; aPntOn2S.ParametersOnSurface(anIsOnFirst, aXend, aYend); if (Abs(aDir.Y()) < gp::Resolution()) @@ -363,7 +365,7 @@ Standard_Real IntPatch_ALineToWLine::GetSectionRadius(const gp_Pnt& thePnt3d) co void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theAline, IntPatch_SequenceOfLine& theLines) const { - Standard_Boolean included; + Standard_Boolean included = 0; Standard_Real f = theAline->FirstParameter(included); if(!included) { f+=myTolOpenDomain; @@ -615,7 +617,7 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, } const gp_Pnt aPnt3d(theALine->Value(aPrt)); - Standard_Real u1, v1, u2, v2; + Standard_Real u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN; myQuad1.Parameters(aPnt3d, u1, v1); myQuad2.Parameters(aPnt3d, u2, v2); aRPT.SetValue(aPnt3d, u1, v1, u2, v2); diff --git a/src/IntPatch/IntPatch_CSFunction.cxx b/src/IntPatch/IntPatch_CSFunction.cxx index 0486a742fb..cef44b08ba 100644 --- a/src/IntPatch/IntPatch_CSFunction.cxx +++ b/src/IntPatch/IntPatch_CSFunction.cxx @@ -34,12 +34,12 @@ IntPatch_CSFunction::IntPatch_CSFunction(const Handle(Adaptor3d_Surface)& S1, const Handle(Adaptor2d_Curve2d)& C, - const Handle(Adaptor3d_Surface)& S2) + const Handle(Adaptor3d_Surface)& S2) : surface1((Standard_Address)(&S1)), surface2((Standard_Address)(&S2)), curve((Standard_Address)(&C)), f(0.) { - surface1 = (Standard_Address)(&S1); - surface2 = (Standard_Address)(&S2); - curve = (Standard_Address)(&C); - f = 0.; + + + + } Standard_Integer IntPatch_CSFunction::NbVariables()const { return 3;} diff --git a/src/IntPatch/IntPatch_GLine.cxx b/src/IntPatch/IntPatch_GLine.cxx index 6769b3e04e..091d654c05 100644 --- a/src/IntPatch/IntPatch_GLine.cxx +++ b/src/IntPatch/IntPatch_GLine.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -379,9 +381,9 @@ void IntPatch_GLine::AddVertex (const IntPatch_Point& Pnt) void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) { - Standard_Boolean SortIsOK,APointDeleted; + Standard_Boolean SortIsOK = 0,APointDeleted = 0; Standard_Boolean SortAgain = Standard_True; - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; const Standard_Real ParamMinOnLine = (fipt? Vertex(indf).ParameterOnLine() : -100000.0); const Standard_Real ParamMaxOnLine = (lapt? Vertex(indl).ParameterOnLine() : 100000.0); @@ -740,7 +742,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) // ||(Abs(ponline-M_PI-M_PI) <=PrecisionPConfusion)) // eap, <<= - Standard_Real u1a,v1a,u2a,v2a,u1b,v1b,u2b,v2b; + Standard_Real u1a = NAN,v1a = NAN,u2a = NAN,v2a = NAN,u1b = NAN,v1b = NAN,u2b = NAN,v2b = NAN; VTXM1.Parameters(u1a,v1a,u2a,v2a); VTX.Parameters(u1b,v1b,u2b,v2b); Standard_Integer flag = 0; diff --git a/src/IntPatch/IntPatch_HCurve2dTool.cxx b/src/IntPatch/IntPatch_HCurve2dTool.cxx index bb2d2eae53..e740f1fe3c 100644 --- a/src/IntPatch/IntPatch_HCurve2dTool.cxx +++ b/src/IntPatch/IntPatch_HCurve2dTool.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include //============================================================ @@ -22,7 +24,7 @@ Standard_Integer IntPatch_HCurve2dTool::NbSamples (const Handle(Adaptor2d_Curve2 const Standard_Real U0, const Standard_Real U1) { - Standard_Real nbs; + Standard_Real nbs = NAN; switch (C->GetType()) { case GeomAbs_Line: return 2; diff --git a/src/IntPatch/IntPatch_HInterTool.cxx b/src/IntPatch/IntPatch_HInterTool.cxx index 623febdf28..fc7a382f59 100644 --- a/src/IntPatch/IntPatch_HInterTool.cxx +++ b/src/IntPatch/IntPatch_HInterTool.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -235,7 +237,7 @@ Standard_Boolean IntPatch_HInterTool::Project (const Handle(Adaptor2d_Curve2d)& Standard_Real epsX = 1.e-8; Standard_Integer Nbu = 20; Standard_Real Tol = 1.e-5; - Standard_Real Dist2; + Standard_Real Dist2 = NAN; Extrema_EPCOfExtPC2d extrema(P,*C,Nbu,epsX,Tol); if (!extrema.IsDone()) { diff --git a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx index 6ecec53651..62c7c6a480 100644 --- a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -99,8 +101,8 @@ static IntPatch_SpecPntType IsSeamOrPole(const Handle(Adaptor3d_Surface)& theQSu return IntPatch_SPntNone; //Parameters on Quadric and on parametric for reference point - Standard_Real aUQRef, aVQRef, aUPRef, aVPRef; - Standard_Real aUQNext, aVQNext, aUPNext, aVPNext; + Standard_Real aUQRef = NAN, aVQRef = NAN, aUPRef = NAN, aVPRef = NAN; + Standard_Real aUQNext = NAN, aVQNext = NAN, aUPNext = NAN, aVPNext = NAN; const gp_Pnt &aP3d = theLine->Value(theRefIndex + 1).Value(); @@ -234,9 +236,9 @@ void ComputeTangency (const IntPatch_TheSOnBounds& solrst, const Handle(Adaptor3d_Surface)& PSurf, TColStd_Array1OfInteger& Destination) { - Standard_Integer i,k, NbPoints, seqlength; - Standard_Real theparam,test; - Standard_Boolean fairpt, ispassing; + Standard_Integer i = 0,k = 0, NbPoints = 0, seqlength = 0; + Standard_Real theparam = NAN,test = NAN; + Standard_Boolean fairpt = 0, ispassing = 0; TopAbs_Orientation arcorien,vtxorien; Handle(Adaptor2d_Curve2d) thearc; Handle(Adaptor3d_HVertex) vtx,vtxbis; @@ -451,7 +453,7 @@ void Recadre(const Standard_Boolean , Standard_Real U2, Standard_Real V2) { - Standard_Real U1p,V1p,U2p,V2p; + Standard_Real U1p = NAN,V1p = NAN,U2p = NAN,V2p = NAN; iwline->Line()->Value(Param).Parameters(U1p,V1p,U2p,V2p); switch(typeS1) { @@ -518,7 +520,7 @@ Standard_Real GetLocalStep(const Handle(Adaptor3d_Surface)& theSurf, { TColStd_Array1OfReal anInts(1, aNbInt + 1); theSurf->UIntervals(anInts, GeomAbs_C1); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real aMinInt = Precision::Infinite(); for (i = 1; i <= aNbInt; ++i) { @@ -541,7 +543,7 @@ Standard_Real GetLocalStep(const Handle(Adaptor3d_Surface)& theSurf, { TColStd_Array1OfReal anInts(1, aNbInt + 1); theSurf->VIntervals(anInts, GeomAbs_C1); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real aMinInt = Precision::Infinite(); for (i = 1; i <= aNbInt; ++i) { @@ -572,10 +574,10 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf const Standard_Real Fleche, const Standard_Real Pas) { - Standard_Boolean reversed, procf, procl, dofirst, dolast; - Standard_Integer indfirst = 0, indlast = 0, ind2, NbSegm; - Standard_Integer NbPointIns, NbPointRst, Nblines, Nbpts, NbPointDep; - Standard_Real U1,V1,U2,V2,paramf,paraml,currentparam; + Standard_Boolean reversed = 0, procf = 0, procl = 0, dofirst = 0, dolast = 0; + Standard_Integer indfirst = 0, indlast = 0, ind2 = 0, NbSegm = 0; + Standard_Integer NbPointIns = 0, NbPointRst = 0, Nblines = 0, Nbpts = 0, NbPointDep = 0; + Standard_Real U1 = NAN,V1 = NAN,U2 = NAN,V2 = NAN,paramf = NAN,paraml = NAN,currentparam = NAN; IntPatch_TheSegmentOfTheSOnBounds thesegm; IntSurf_PathPoint PPoint; @@ -778,7 +780,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf return; } - Standard_Real Vmin, Vmax, TolV = 1.e-14; + Standard_Real Vmin = NAN, Vmax = NAN, TolV = 1.e-14; if (!reversed) { //Surf1 is quadric Vmin = Surf1->FirstVParameter(); Vmax = Surf1->LastVParameter(); @@ -822,7 +824,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf } // - Standard_Real AnU1,AnU2,AnV2; + Standard_Real AnU1 = NAN,AnU2 = NAN,AnV2 = NAN; GeomAbs_SurfaceType typQuad = Quad.TypeQuadric(); Standard_Boolean arecadr=Standard_False; @@ -860,7 +862,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf // if(arecadr) { //modified by NIZNHY-PKV Fri Mar 28 15:06:01 2008f - Standard_Real aCf, aTwoPI; + Standard_Real aCf = NAN, aTwoPI = NAN; // aCf=0.; aTwoPI=M_PI+M_PI; @@ -1263,7 +1265,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf Standard_Boolean TransitionOK=Standard_False; if(thesegm.HasFirstPoint()) { - Standard_Real _u1,_v1,_u2,_v2; + Standard_Real _u1 = NAN,_v1 = NAN,_u2 = NAN,_v2 = NAN; dofirst = Standard_True; PStartf = thesegm.FirstPoint(); @@ -1318,7 +1320,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf } } if(thesegm.HasLastPoint()) { - Standard_Real _u1,_v1,_u2,_v2; + Standard_Real _u1 = NAN,_v1 = NAN,_u2 = NAN,_v2 = NAN; dolast = Standard_True; PStartl = thesegm.LastPoint(); @@ -1410,11 +1412,11 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf // Polygone sur restriction solution if (dofirst && dolast) { - Standard_Real prm; + Standard_Real prm = NAN; gp_Pnt ptpoly; IntSurf_PntOn2S p2s; Handle(IntSurf_LineOn2S) Thelin = new IntSurf_LineOn2S (); - Handle(Adaptor2d_Curve2d) arcsegm = thesegm.Curve(); + const Handle(Adaptor2d_Curve2d)& arcsegm = thesegm.Curve(); Standard_Integer nbsample = 100; if (!reversed) { @@ -2572,7 +2574,7 @@ static void DetectOfBoundaryAchievement(const Handle(Adaptor3d_Surface)& theQSur const IntSurf_PntOn2S &aPPrev = theSourceLine->Value(thePointIndex - 1), &aPCurr = theSourceLine->Value(thePointIndex); - Standard_Real aUPrev, aVPrev, aUCurr, aVCurr; + Standard_Real aUPrev = NAN, aVPrev = NAN, aUCurr = NAN, aVCurr = NAN; if (theIsReversed) { aPPrev.ParametersOnS2(aUPrev, aVPrev); // S2 - quadric, set U,V by Pnt3D @@ -3314,7 +3316,7 @@ Standard_Boolean IsCoincide(IntPatch_TheSurfFunction& theFunc, const Standard_Real aUl = aPmin.X(), aVl = aPmin.Y(); - Standard_Real aU, aV; + Standard_Real aU = NAN, aV = NAN; Standard_Real dU = aUl - aUf, dV = aVl - aVf; for(Standard_Integer i = 0; i < 7; i++) { diff --git a/src/IntPatch/IntPatch_InterferencePolyhedron.cxx b/src/IntPatch/IntPatch_InterferencePolyhedron.cxx index 046c2e8a4c..0606314dee 100644 --- a/src/IntPatch/IntPatch_InterferencePolyhedron.cxx +++ b/src/IntPatch/IntPatch_InterferencePolyhedron.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -142,7 +144,7 @@ void IntPatch_InterferencePolyhedron::Interference Standard_Boolean gridOnFirst=Standard_True; Standard_Integer NbTrianglesFirstPol = IntPatch_PolyhedronTool::NbTriangles(FirstPol); Standard_Integer NbTrianglesSecondPol = IntPatch_PolyhedronTool::NbTriangles(SeconPol); - Standard_Integer iFirst, iSecon; + Standard_Integer iFirst = 0, iSecon = 0; //------------------------------------------------------------------------------------------ //-- the same number of triangles it is necessary to test better on @@ -156,7 +158,7 @@ void IntPatch_InterferencePolyhedron::Interference if(!SelfIntf) { if(NbTrianglesFirstPol > NbTrianglesSecondPol+NbTrianglesSecondPol) gridOnFirst=Standard_False; - Standard_Real vol1,vol2,Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + Standard_Real vol1 = NAN,vol2 = NAN,Xmin = NAN, Ymin = NAN, Zmin = NAN, Xmax = NAN, Ymax = NAN, Zmax = NAN; IntPatch_PolyhedronTool::Bounding(FirstPol).Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); vol1 = (Xmax-Xmin)*(Ymax-Ymin)*(Zmax-Zmin); @@ -252,7 +254,7 @@ void IntPatch_InterferencePolyhedron::Intersect // Equation of the triangle plane of the objet gp_XYZ ONor; // Normal vector. - Standard_Real Odp; // Polar Distance. + Standard_Real Odp = NAN; // Polar Distance. Intf::PlaneEquation(IntPatch_PolyhedronTool::Point(FirstPol, OI[0]), IntPatch_PolyhedronTool::Point(FirstPol, OI[1]), IntPatch_PolyhedronTool::Point(FirstPol, OI[2]), @@ -261,7 +263,7 @@ void IntPatch_InterferencePolyhedron::Intersect // Equation of the triangle plane of the tool gp_XYZ TNor; // Normal vector. - Standard_Real Tdp; // Polar distance. + Standard_Real Tdp = NAN; // Polar distance. Intf::PlaneEquation(IntPatch_PolyhedronTool::Point(SeconPol, TI[0]), IntPatch_PolyhedronTool::Point(SeconPol, TI[1]), IntPatch_PolyhedronTool::Point(SeconPol, TI[2]), @@ -309,7 +311,7 @@ void IntPatch_InterferencePolyhedron::Intersect // Otherwise line of section is calculated: else { - Standard_Integer iObj, iToo; + Standard_Integer iObj = 0, iToo = 0; // Zone de stockage des resultats : Standard_Integer nbpiOT=0; @@ -364,7 +366,7 @@ void IntPatch_InterferencePolyhedron::Intersect // Singularite VERTEX EDGE - Standard_Integer inext, jnext; + Standard_Integer inext = 0, jnext = 0; for (iObj=0; iObj<3; iObj++) { if (parO[iObj]==-1.) { for (iToo=0; iToo<3; iToo++) { @@ -452,7 +454,7 @@ void IntPatch_InterferencePolyhedron::Intersect // Singularite EDGE EDGE gp_Pnt piO; gp_XYZ piT; - Standard_Real lg; + Standard_Real lg = NAN; for (iObj=0; iObj<3; iObj++) { inext=Pourcent3[iObj+1]; if (edOT[iObj]==1 && (dpOfT[iObj]*dpOfT[inext])<0.) { @@ -580,12 +582,12 @@ void IntPatch_InterferencePolyhedron::Intersect gp_XYZ dir=ONor^TNor; NCollection_LocalArray d(nbpiOT); - Standard_Integer iPi, iPs; + Standard_Integer iPi = 0, iPs = 0; for (iPi=0; iPi #include #include @@ -260,7 +261,7 @@ static void FUN_TrimInfSurf(const gp_Pnt& Pmin, Extrema_ExtPS ext2(Pmax, *InfSurf, 1.e-7, 1.e-7); if(ext1.IsDone() || ext2.IsDone()) { - Standard_Real Umax = -1.e+100, Umin = 1.e+100, Vmax = -1.e+100, Vmin = 1.e+100, cU, cV; + Standard_Real Umax = -1.e+100, Umin = 1.e+100, Vmax = -1.e+100, Vmin = 1.e+100, cU = NAN, cV = NAN; if(ext1.IsDone()) { for(Standard_Integer i = 1; i <= ext1.NbExt(); i++) @@ -358,7 +359,7 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS, } else//Offset Line, Parab, Hyperb { - Standard_Real VmTr, VMTr; + Standard_Real VmTr = NAN, VMTr = NAN; if(GACT != GeomAbs_Hyperbola) { if(FirstV >= 0. && LastV >= 0.){ VmTr = FirstV; VMTr = ((LastV - FirstV) > 1.e+4) ? (FirstV + 1.e+4) : LastV; } @@ -428,7 +429,7 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS, } else//Offset Line, Parab, Hyperb { - Standard_Real UmTr, UMTr; + Standard_Real UmTr = NAN, UMTr = NAN; if(GACT != GeomAbs_Hyperbola) { if(FirstU >= 0. && LastU >= 0.){ UmTr = FirstU; UMTr = ((LastU - FirstU) > 1.e+4) ? (FirstU + 1.e+4) : LastU; } @@ -472,8 +473,8 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_Surface)& S1, Standard_Boolean isoS1isLine[2] = {0, 0}; Standard_Boolean isoS2isLine[2] = {0, 0}; Handle(Geom_Curve) C1, C2; - const GeomAdaptor_Surface & gas1 = *(GeomAdaptor_Surface*)(S1.get()); - const GeomAdaptor_Surface & gas2 = *(GeomAdaptor_Surface*)(S2.get()); + const GeomAdaptor_Surface & gas1 = *dynamic_cast(S1.get()); + const GeomAdaptor_Surface & gas2 = *dynamic_cast(S2.get()); const Handle(Geom_Surface) gs1 = gas1.Surface(); const Handle(Geom_Surface) gs2 = gas2.Surface(); Standard_Real MS1[2], MS2[2]; @@ -672,8 +673,8 @@ static void FUN_TrimBothSurf(const Handle(Adaptor3d_Surface)& S1, Handle(Adaptor3d_Surface)& NS1, Handle(Adaptor3d_Surface)& NS2) { - const GeomAdaptor_Surface & gas1 = *(GeomAdaptor_Surface*)(S1.get()); - const GeomAdaptor_Surface & gas2 = *(GeomAdaptor_Surface*)(S2.get()); + const GeomAdaptor_Surface & gas1 = *dynamic_cast(S1.get()); + const GeomAdaptor_Surface & gas2 = *dynamic_cast(S2.get()); const Handle(Geom_Surface) gs1 = gas1.Surface(); const Handle(Geom_Surface) gs2 = gas2.Surface(); const Standard_Real UM1 = 0.5 * (S1->LastUParameter() + S1->FirstUParameter()); @@ -708,7 +709,7 @@ static void FUN_TrimBothSurf(const Handle(Adaptor3d_Surface)& S1, Standard_Boolean TrmV1 = Standard_False; Standard_Boolean TrmU2 = Standard_False; Standard_Boolean TrmV2 = Standard_False; - Standard_Real V1S1,V2S1,U1S1,U2S1, V1S2,V2S2,U1S2,U2S2; + Standard_Real V1S1 = NAN,V2S1 = NAN,U1S1 = NAN,U2S1 = NAN, V1S2 = NAN,V2S2 = NAN,U1S2 = NAN,U2S2 = NAN; FUN_NewFirstLast(GA_U1,S1->FirstVParameter(),S1->LastVParameter(),TV,V1S1,V2S1,TrmV1); FUN_NewFirstLast(GA_V1,S1->FirstUParameter(),S1->LastUParameter(),TV,U1S1,U2S1,TrmU1); FUN_NewFirstLast(GA_U2,S2->FirstVParameter(),S2->LastVParameter(),TV,V1S2,V2S2,TrmV2); @@ -774,7 +775,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& theS1, typs1 == GeomAbs_Torus || typs2 == GeomAbs_Torus) { gp_Ax1 aCTAx, aGeomAx; GeomAbs_SurfaceType aCTType; - Standard_Boolean bToCheck; + Standard_Boolean bToCheck = 0; // const Handle(Adaptor3d_Surface)& aCTSurf = (typs1 == GeomAbs_Cone || typs1 == GeomAbs_Torus) ? theS1 : theS2; @@ -1032,7 +1033,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& theS1, typs1 == GeomAbs_Torus || typs2 == GeomAbs_Torus) { gp_Ax1 aCTAx, aGeomAx; GeomAbs_SurfaceType aCTType; - Standard_Boolean bToCheck; + Standard_Boolean bToCheck = 0; // const Handle(Adaptor3d_Surface)& aCTSurf = (typs1 == GeomAbs_Cone || typs1 == GeomAbs_Torus) ? theS1 : theS2; @@ -1802,7 +1803,7 @@ Standard_Boolean IntPatch_Intersection::CheckSingularPoints( // const Standard_Integer aNbBndPnts = 5; const Standard_Real aTol = Precision::Confusion(); - Standard_Integer i; + Standard_Integer i = 0; theD1->Init(); Standard_Boolean isU = Standard_True; for (; theD1->More(); theD1->Next()) @@ -1813,7 +1814,7 @@ Standard_Boolean IntPatch_Intersection::CheckSingularPoints( { continue; } - Standard_Real t, dt = (psup - pinf) / (aNbBndPnts - 1); + Standard_Real t = NAN, dt = (psup - pinf) / (aNbBndPnts - 1); gp_Pnt2d aP1; gp_Vec2d aDir; aBnd->D1((pinf + psup) / 2., aP1, aDir); @@ -1930,7 +1931,7 @@ static void splitCone( gp_Cone aCone = theS->Cone(); - Standard_Real aU0, aV0; + Standard_Real aU0 = NAN, aV0 = NAN; Adaptor3d_TopolTool::GetConeApexParam (aCone, aU0, aV0); TopAbs_State aState = theD->Classify (gp_Pnt2d (aU0, aV0), theTol); diff --git a/src/IntPatch/IntPatch_LineConstructor.cxx b/src/IntPatch/IntPatch_LineConstructor.cxx index 4274665023..eb5388b963 100644 --- a/src/IntPatch/IntPatch_LineConstructor.cxx +++ b/src/IntPatch/IntPatch_LineConstructor.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -51,11 +53,11 @@ static void Recadre(const Handle(Adaptor3d_Surface)& myHS1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2) { - Standard_Real f,l,lmf; + Standard_Real f = NAN,l = NAN,lmf = NAN; GeomAbs_SurfaceType typs1 = myHS1->GetType(); GeomAbs_SurfaceType typs2 = myHS2->GetType(); - Standard_Boolean myHS1IsUPeriodic,myHS1IsVPeriodic; + Standard_Boolean myHS1IsUPeriodic = 0,myHS1IsVPeriodic = 0; switch (typs1) { case GeomAbs_Cylinder: case GeomAbs_Cone: @@ -78,7 +80,7 @@ static void Recadre(const Handle(Adaptor3d_Surface)& myHS1, } } - Standard_Boolean myHS2IsUPeriodic,myHS2IsVPeriodic; + Standard_Boolean myHS2IsUPeriodic = 0,myHS2IsVPeriodic = 0; switch (typs2) { case GeomAbs_Cylinder: case GeomAbs_Cone: @@ -206,7 +208,7 @@ static Standard_Real LocalFirstParameter (const Handle(IntPatch_Line)& L) firstp = alin->FirstPoint().ParameterOnLine(); } else { - Standard_Boolean included; + Standard_Boolean included = 0; firstp = alin->FirstParameter(included); if (!included) { firstp +=Epsilon(firstp); @@ -286,7 +288,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L) lastp = alin->LastPoint().ParameterOnLine(); } else { - Standard_Boolean included; + Standard_Boolean included = 0; lastp = alin->LastParameter(included); if (!included) { lastp -=Epsilon(lastp); @@ -392,7 +394,7 @@ static Standard_Integer AppendSameVertexA(Handle(IntPatch_ALine)&alig, const Handle(IntPatch_ALine)& L, const Standard_Integer index, Standard_Integer *TabIndex) { - Standard_Integer i,a,n; + Standard_Integer i = 0,a = 0,n = 0; a=0; n=L->NbVertex(); const IntPatch_Point& Vtxindex = L->Vertex(index); @@ -423,9 +425,9 @@ static Standard_Integer AppendSameVertexG(Handle(IntPatch_GLine)& glig,const Han const Standard_Integer index, const Standard_Real decal, Standard_Integer *TabIndex) { - Standard_Integer i,a,n; - Standard_Real p1,p2,d; //,tol - Standard_Boolean aajouter; + Standard_Integer i = 0,a = 0,n = 0; + Standard_Real p1 = NAN,p2 = NAN,d = NAN; //,tol + Standard_Boolean aajouter = 0; a=0; n=L->NbVertex(); const IntPatch_Point& Vtxindex = L->Vertex(index); @@ -474,7 +476,7 @@ static Standard_Integer AppendSameVertexW(Handle(IntPatch_WLine)& wlig, const Standard_Integer index, const Standard_Real par, Standard_Integer *TabIndex) { - Standard_Integer i,a,n; + Standard_Integer i = 0,a = 0,n = 0; a=0; n=L->NbVertex(); const IntPatch_Point& Vtxindex = L->Vertex(index); @@ -490,7 +492,7 @@ static Standard_Integer AppendSameVertexW(Handle(IntPatch_WLine)& wlig, //-- le debugger voit 2 fois la variable d ici. ???? -> d_2 if(d_2 <= thetol2) { Vtxi.SetParameter(par); - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Vtxindex.ParametersOnS1(u1,v1); Vtxindex.ParametersOnS2(u2,v2); Vtxi.SetParameters(u1,v1,u2,v2); @@ -513,7 +515,7 @@ static Standard_Integer AppendSameVertexR(Handle(IntPatch_RLine)&rlig, const Handle(IntPatch_RLine)& L, const Standard_Integer index, Standard_Integer *TabIndex) { - Standard_Integer i,a,n; + Standard_Integer i = 0,a = 0,n = 0; a=0; n=L->NbVertex(); const IntPatch_Point& Vtxindex = L->Vertex(index); @@ -824,7 +826,7 @@ static Standard_Boolean TestWLineIsARLine(const IntPatch_SequenceOfLine& slinref Standard_Boolean onFirst = is==0; if((onFirst && rlin->IsArcOnS1()) || (!onFirst && rlin->IsArcOnS2())) { Handle(Adaptor2d_Curve2d) arc; - Standard_Real u,v,u1,v1; + Standard_Real u = NAN,v = NAN,u1 = NAN,v1 = NAN; if (onFirst) { arc = rlin->ArcOnS1(); POn2S.ParametersOnS1(u,v); @@ -867,16 +869,16 @@ static Standard_Boolean TestIfWLineIsRestriction(const IntPatch_SequenceOfLine& Standard_Real TolArc) { Standard_Integer NbPnts = wlin->NbPnts(); - Standard_Integer allon1=0,allon2=0,i; + Standard_Integer allon1=0,allon2=0,i = 0; Standard_Real tol2d1=0., tol2d2=0.; for(i=1;i<=NbPnts;i++) { const IntSurf_PntOn2S& Pmid = wlin->Point(i); - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Pmid.Parameters(u1,v1,u2,v2); //-- Estimation d un majorant de Toluv a partir de Tol gp_Pnt ap; gp_Vec ad1u,ad1v; - Standard_Real tol; + Standard_Real tol = NAN; //------------------------------------------ S1->D1(u1,v1,ap,ad1u,ad1v); tol = ComputeParametricTolerance(TolArc,ad1u,ad1v); @@ -955,7 +957,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref, Standard_Integer midInd = (ParamMaxOnLine + ParamMinOnLine) / 2; TColStd_SequenceOfInteger indicesV1,indicesV2; - Standard_Integer iv; + Standard_Integer iv = 0; for (iv=1; iv <= nbvtx; iv++) { Standard_Integer plin = (Standard_Integer) WLine->Vertex(iv).ParameterOnLine(); if (plin == ParamMinOnLine) indicesV1.Append(iv); @@ -970,7 +972,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref, typedef Standard_Real (IntPatch_Point::* PParOnArc)() const; // cycle for both surfaces - Standard_Integer is; + Standard_Integer is = 0; for (is=0; is<2; is++) { Standard_Boolean onFirst = is==0; if(( onFirst && WLine->HasArcOnS1()) || @@ -999,7 +1001,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref, } // resolve arcs for vertices not having a link to an arc - Standard_Real utst,vtst; + Standard_Real utst = NAN,vtst = NAN; TColStd_Array1OfReal paramsResolved(1,nbvtx); TColStd_Array1OfTransient arcsResolved(1,nbvtx); arcsResolved.Init(Handle(Adaptor2d_Curve2d)()); @@ -1010,7 +1012,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref, Standard_Real distmin=RealLast(); for (aDomain->Init(); aDomain->More(); aDomain->Next()) { const Handle(Adaptor2d_Curve2d)& arc = aDomain->Value(); - Standard_Real par,dist; + Standard_Real par = NAN,dist = NAN; if (ProjectOnArc(utst,vtst,arc,surf,TolArc,par,dist) && dist < distmin) { arcsResolved(iv) = arc; paramsResolved(iv) = par; @@ -1022,7 +1024,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref, // prepare list of common arcs for both ends of wline TColStd_IndexedMapOfTransient mapArcsV1,mapArcs; - Standard_Integer i; + Standard_Integer i = 0; for (i=1; i <= indicesV1.Length(); i++) { iv = indicesV1(i); Handle(Adaptor2d_Curve2d) arc; @@ -1081,7 +1083,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref, utst = (utst+utst1)*0.5; vtst = (vtst+vtst1)*0.5; } - Standard_Real par,dist; + Standard_Real par = NAN,dist = NAN; if (!ProjectOnArc(utst,vtst,arc,surf,TolArc,par,dist)) { #ifdef OCCT_DEBUG std::cout<<" Pb en projection ds IntPatch_LineConstructor"<Curve(); - Standard_Integer ivmin,ivmax; - Standard_Real parmin, parmax; + Standard_Integer ivmin = 0,ivmax = 0; + Standard_Real parmin = NAN, parmax = NAN; Standard_Boolean reverse = Standard_False; - TColStd_SequenceOfInteger *pIndVmin, *pIndVmax; + TColStd_SequenceOfInteger *pIndVmin = nullptr, *pIndVmax = nullptr; if (par1Add(Lori->Value(i)); @@ -1187,15 +1189,15 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, const Handle(Adaptor3d_TopolTool)& myDom2, const Standard_Real TolArc) { - Standard_Integer i=1,nbvtx; - Standard_Real firstp,lastp; + Standard_Integer i=1,nbvtx = 0; + Standard_Real firstp = NAN,lastp = NAN; Standard_Real Tol = Precision::PConfusion()*100.; // JMB le 13 Jan 2000. Report de la correction du PRO19653 GeomAbs_SurfaceType typs1 = mySurf1->GetType(); GeomAbs_SurfaceType typs2 = mySurf2->GetType(); IntPatch_IType typl = L->ArcType(); if(typl == IntPatch_Analytic) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Handle(IntPatch_ALine) ALine (Handle(IntPatch_ALine)::DownCast (L)); slin.Clear(); nbvtx = ALine->NbVertex(); @@ -1247,7 +1249,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, return; } else if(typl == IntPatch_Walking) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Handle(IntPatch_WLine) WLine (Handle(IntPatch_WLine)::DownCast (L)); slin.Clear(); nbvtx = WLine->NbVertex(); @@ -1265,7 +1267,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, firstp = WLineVertex_i.ParameterOnLine(); lastp = WLineVertex_ip1.ParameterOnLine(); if(firstp!=lastp && !IsSegmentSmall(WLine,i,i+1/*,TolArc*/)) { - Standard_Integer pmid; + Standard_Integer pmid = 0; pmid = (Standard_Integer)((firstp+lastp)/2); Standard_Integer int_lastp = (Standard_Integer)lastp; Standard_Integer int_firstp = (Standard_Integer)firstp; @@ -1303,7 +1305,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, // situation when (lastp-firstp) != 1. if(Abs(int_lastp-int_firstp) == 1) { - Standard_Real vFu1,vFv1,vFu2,vFv2,vLu1,vLv1,vLu2,vLv2; + Standard_Real vFu1 = NAN,vFv1 = NAN,vFu2 = NAN,vFv2 = NAN,vLu1 = NAN,vLv1 = NAN,vLu2 = NAN,vLv2 = NAN; const IntSurf_PntOn2S& vF = WLineVertex_i. PntOn2S(); const IntSurf_PntOn2S& vL = WLineVertex_ip1. PntOn2S(); vF.Parameters(vFu1,vFv1,vFu2,vFv2); @@ -1312,7 +1314,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, Recadre(mySurf1,mySurf2,vLu1,vLv1,vLu2,vLv2); if(in1 != TopAbs_IN) { - Standard_Real du,dv; + Standard_Real du = NAN,dv = NAN; gp_Pnt2d pvF(vFu1,vFv1); gp_Pnt2d pvL(vLu1,vLv1); gp_Pnt2d pPm(u1,v1); @@ -1334,7 +1336,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, } if(in2 != TopAbs_IN) { - Standard_Real du,dv; + Standard_Real du = NAN,dv = NAN; gp_Pnt2d pvF(vFu2,vFv2); gp_Pnt2d pvL(vLu2,vLv2); gp_Pnt2d pPm(u2,v2); @@ -1359,13 +1361,13 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, if (in1 != TopAbs_OUT && in2 != TopAbs_OUT) { Standard_Boolean LignetropPetite=Standard_False; - Standard_Real u1a,v1a,u2a,v2a; + Standard_Real u1a = NAN,v1a = NAN,u2a = NAN,v2a = NAN; const IntSurf_PntOn2S& Pmid1 = WLine->Point((Standard_Integer)firstp); Pmid1.Parameters(u1a,v1a,u2a,v2a); Recadre(mySurf1,mySurf2,u1a,v1a,u2a,v2a); const IntSurf_PntOn2S& Pmid2 = WLine->Point((Standard_Integer)lastp); - Standard_Real u1b,v1b,u2b,v2b; + Standard_Real u1b = NAN,v1b = NAN,u2b = NAN,v2b = NAN; Pmid2.Parameters(u1b,v1b,u2b,v2b); Recadre(mySurf1,mySurf2,u1b,v1b,u2b,v2b); @@ -1406,7 +1408,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, return; } else if (typl != IntPatch_Restriction) { // JAG 01.07.96 - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Handle(IntPatch_GLine) GLine (Handle(IntPatch_GLine)::DownCast (L)); slin.Clear(); nbvtx = GLine->NbVertex(); @@ -1567,7 +1569,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, gp_Pnt Px = mySurf1->Value(Px2d.X(),Px2d.Y()); gp_Vec P0Px=gp_Vec(P0,Px); - Standard_Real U1,V1,U2,V2; + Standard_Real U1 = NAN,V1 = NAN,U2 = NAN,V2 = NAN; Vtx1.PntOn2S().Parameters(U1,V1,U2,V2); gp_Vec D1u,D1v; @@ -1580,7 +1582,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, //-- le 23 mars 1999 TopAbs_State bornin = myDom2->Classify(gp_Pnt2d(U2,V2),Tol,Standard_False); if(bornin!=TopAbs_OUT) { - Standard_Real U1t,V1t,U2t,V2t; + Standard_Real U1t = NAN,V1t = NAN,U2t = NAN,V2t = NAN; Vtx2.PntOn2S().Parameters(U1t,V1t,U2t,V2t); bornin = myDom2->Classify(gp_Pnt2d(U2t,V2t),Tol,Standard_False); } @@ -1593,7 +1595,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, //-- POPx . D1v = deltau * D1u.D1v + deltav * D1v.D1v //-- //-- deltau= - Standard_Real D1uD1v,TgD1u,TgD1v,D1uD1u,D1vD1v,DIS; + Standard_Real D1uD1v = NAN,TgD1u = NAN,TgD1v = NAN,D1uD1u = NAN,D1vD1v = NAN,DIS = NAN; //Standard_Real DeltaU,DeltaV; D1uD1u = D1u.Dot(D1u); D1vD1v = D1v.Dot(D1v); @@ -1646,7 +1648,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, gp_Pnt Px = mySurf2->Value(Px2d.X(),Px2d.Y()); gp_Vec P0Px=gp_Vec(P0,Px); - Standard_Real U1,V1,U2,V2; + Standard_Real U1 = NAN,V1 = NAN,U2 = NAN,V2 = NAN; Vtx1.PntOn2S().Parameters(U1,V1,U2,V2); gp_Vec D1u,D1v; @@ -1659,7 +1661,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, //-- le 23 mars 1999 TopAbs_State bornin = myDom1->Classify(gp_Pnt2d(U1,V1),Tol,Standard_False); if(bornin!=TopAbs_OUT) { - Standard_Real U1t,V1t,U2t,V2t; + Standard_Real U1t = NAN,V1t = NAN,U2t = NAN,V2t = NAN; Vtx2.PntOn2S().Parameters(U1t,V1t,U2t,V2t); bornin = myDom1->Classify(gp_Pnt2d(U1t,V1t),Tol,Standard_False); } @@ -1672,7 +1674,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, //-- POPx . D1v = deltau * D1u.D1v + deltav * D1v.D1v //-- //-- deltau= - Standard_Real D1uD1v,TgD1u,TgD1v,D1uD1u,D1vD1v,DIS; + Standard_Real D1uD1v = NAN,TgD1u = NAN,TgD1v = NAN,D1uD1u = NAN,D1vD1v = NAN,DIS = NAN; //Standard_Real DeltaU,DeltaV; D1uD1u = D1u.Dot(D1u); D1vD1v = D1v.Dot(D1v); diff --git a/src/IntPatch/IntPatch_Point.cxx b/src/IntPatch/IntPatch_Point.cxx index 6c681d27da..e37283fc49 100644 --- a/src/IntPatch/IntPatch_Point.cxx +++ b/src/IntPatch/IntPatch_Point.cxx @@ -21,6 +21,7 @@ #include #include +#include #include void IntPatch_Point::SetValue (const gp_Pnt& Pt, const Standard_Real Tol, @@ -147,7 +148,7 @@ static void DumpTransition(const IntSurf_Transition& T) void IntPatch_Point::Dump() const { std::cout<<"----------- IntPatch_Point : "< + #include #include #include @@ -63,15 +65,15 @@ IntPatch_PolyArc::IntPatch_PolyArc(const Handle(Adaptor2d_Curve2d)& Line , Standard_Integer IndexInf = NbSample+1; Standard_Integer IndexSup = 0; - Standard_Real bx0,by0,bxmin,bxmax,bymin,bymax,r,r2; + Standard_Real bx0 = NAN,by0 = NAN,bxmin = NAN,bxmax = NAN,bymin = NAN,bymax = NAN,r = NAN,r2 = NAN; BoxOtherPolygon.Get(bxmin,bymin,bxmax,bymax); r=(bxmax-bxmin)+(bymax-bymin); bx0=(bxmax+bxmin)*0.5; by0=(bymax+bymin)*0.5; - Standard_Real Pas; - Standard_Real X,Y,Xs,Ys,Xm,Ym,XXs,YYs; + Standard_Real Pas = NAN; + Standard_Real X = NAN,Y = NAN,Xs = NAN,Ys = NAN,Xm = NAN,Ym = NAN,XXs = NAN,YYs = NAN; r*=0.8; r2 = r*r*49.; @@ -108,7 +110,7 @@ IntPatch_PolyArc::IntPatch_PolyArc(const Handle(Adaptor2d_Curve2d)& Line , if(!isMidPtInBox) { Standard_Real d = (X-Xs)*(X-Xs)+(Y-Ys)*(Y-Ys); if (d > r2) { - Standard_Real xmin,xmax,ymin,ymax; + Standard_Real xmin = NAN,xmax = NAN,ymin = NAN,ymax = NAN; MinMax (Xs,X, xmin,xmax); MinMax (Ys,Y, ymin,ymax); isSegOut = (xmax < bxmin || xmin > bxmax || @@ -184,7 +186,7 @@ Standard_Real IntPatch_PolyArc::Parameter(const Standard_Integer Index ) const void IntPatch_PolyArc::SetOffset(const Standard_Real ox,const Standard_Real oy) { - Standard_Real xmin,ymin,xmax,ymax,g; + Standard_Real xmin = NAN,ymin = NAN,xmax = NAN,ymax = NAN,g = NAN; myBox.Get(xmin,ymin,xmax,ymax); g = myBox.GetGap(); diff --git a/src/IntPatch/IntPatch_PolyLine.cxx b/src/IntPatch/IntPatch_PolyLine.cxx index fa7eaeaed1..74f469c8dd 100644 --- a/src/IntPatch/IntPatch_PolyLine.cxx +++ b/src/IntPatch/IntPatch_PolyLine.cxx @@ -17,6 +17,8 @@ //-- lbr le 12 juin : Ajout des fleches sur les Lines //-- msv 13.03.2002 : compute deflection for WLine; Error() returns deflection +#include + #include #include #include @@ -79,7 +81,7 @@ void IntPatch_PolyLine::SetRLine(const Standard_Boolean OnFirst, const Handle(In void IntPatch_PolyLine::Prepare() { - Standard_Integer i; + Standard_Integer i = 0; myBox.SetVoid(); Standard_Integer n=NbPoints(); const Standard_Real eps_2 = myError * myError; @@ -93,7 +95,7 @@ void IntPatch_PolyLine::Prepare() if (i >= 3) { gp_XY V13 = P3.XY() - P1.XY(); gp_XY V12 = P2.XY() - P1.XY(); - Standard_Real d13_2 = V13.SquareModulus(), d_2; + Standard_Real d13_2 = V13.SquareModulus(), d_2 = NAN; if (d13_2 > eps_2) d_2 = V13.CrossSquareMagnitude(V12) / d13_2; else @@ -171,7 +173,7 @@ Standard_Integer IntPatch_PolyLine::NbPoints() const gp_Pnt2d IntPatch_PolyLine::Point(const Standard_Integer Index ) const { - Standard_Real X,Y,X1,Y1,DX,DY; + Standard_Real X = NAN,Y = NAN,X1 = NAN,Y1 = NAN,DX = NAN,DY = NAN; DX=DY=0; if (onfirst) { if (typ == IntPatch_Walking) { diff --git a/src/IntPatch/IntPatch_Polyhedron.cxx b/src/IntPatch/IntPatch_Polyhedron.cxx index 9f436bbb22..5ac490c7fe 100644 --- a/src/IntPatch/IntPatch_Polyhedron.cxx +++ b/src/IntPatch/IntPatch_Polyhedron.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #define MSG_DEBUG 0 @@ -90,8 +91,8 @@ IntPatch_Polyhedron::IntPatch_Polyhedron (const Handle(Adaptor3d_Surface)& Surfa const Standard_Real V1mV0sNbdeltaV = (v1-v0)/(Standard_Real)nbdeltaV; gp_Pnt TP; - Standard_Real U,V; - Standard_Integer i1, i2, Index=1; + Standard_Real U = NAN,V = NAN; + Standard_Integer i1 = 0, i2 = 0, Index=1; for (i1 = 0, U = u0; i1 <= nbdeltaU; i1++, U+= U1mU0sNbdeltaU) { for (i2 = 0, V = v0; i2 <= nbdeltaV; i2++, V+= V1mV0sNbdeltaV ) { Surface->D0(U,V,TP); @@ -149,8 +150,8 @@ IntPatch_Polyhedron::IntPatch_Polyhedron (const Handle(Adaptor3d_Surface)& Surfa const Standard_Real V1mV0sNbdeltaV = (v1-v0)/(Standard_Real)nbdeltaV; gp_Pnt TP; - Standard_Real U,V; - Standard_Integer i1, i2, Index=1; + Standard_Real U = NAN,V = NAN; + Standard_Integer i1 = 0, i2 = 0, Index=1; for (i1 = 0, U = u0; i1 <= nbdeltaU; i1++, U+= U1mU0sNbdeltaU) { for (i2 = 0, V = v0; i2 <= nbdeltaV; i2++, V+= V1mV0sNbdeltaV ) { Surface->D0(U,V,TP); @@ -185,11 +186,11 @@ Standard_Real IntPatch_Polyhedron::DeflectionOnTriangle (const Handle(Adaptor3d_Surface)& Surface, const Standard_Integer Triang) const { - Standard_Integer i1,i2,i3; + Standard_Integer i1 = 0,i2 = 0,i3 = 0; Triangle(Triang,i1,i2,i3); //-- Calcul de l eqution du plan - Standard_Real u1,v1,u2,v2,u3,v3; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN,u3 = NAN,v3 = NAN; gp_Pnt P1,P2,P3; P1 = Point(i1,u1,v1); P2 = Point(i2,u2,v2); @@ -268,7 +269,7 @@ void IntPatch_Polyhedron::FillBounding() { TheComponentsBnd=new Bnd_HArray1OfBox(1, NbTriangles()); Bnd_Box Boite; - Standard_Integer p1, p2, p3; + Standard_Integer p1 = 0, p2 = 0, p3 = 0; Standard_Integer nbtriangles = NbTriangles(); for (Standard_Integer iTri=1; iTri<=nbtriangles; iTri++) { Triangle(iTri, p1, p2, p3); @@ -354,7 +355,7 @@ Standard_Integer IntPatch_Polyhedron::TriConnex (const Standard_Integer Triang, // Triangle position General case : Standard_Integer linT = 0, colT = 0; Standard_Integer linO = 0, colO = 0; - Standard_Integer t,tt; + Standard_Integer t = 0,tt = 0; if (Triang!=0) { t = (Triang-1)/(nbdeltaVm2); tt= (Triang-1)-t*nbdeltaVm2; @@ -530,7 +531,7 @@ void IntPatch_Polyhedron::PlaneEquation (const Standard_Integer Triang, gp_XYZ& NormalVector, Standard_Real& PolarDistance) const { - Standard_Integer i1,i2,i3; + Standard_Integer i1 = 0,i2 = 0,i3 = 0; Triangle(Triang,i1,i2,i3); gp_XYZ Pointi1(Point(i1).XYZ()); @@ -563,7 +564,7 @@ void IntPatch_Polyhedron::PlaneEquation (const Standard_Integer Triang, Standard_Boolean IntPatch_Polyhedron::Contain (const Standard_Integer Triang, const gp_Pnt& ThePnt) const { - Standard_Integer i1,i2,i3; + Standard_Integer i1 = 0,i2 = 0,i3 = 0; Triangle(Triang,i1,i2,i3); gp_XYZ Pointi1(Point(i1).XYZ()); gp_XYZ Pointi2(Point(i2).XYZ()); diff --git a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx index a3ba76ddb4..630d4bfd1b 100644 --- a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx @@ -17,6 +17,8 @@ // modified by Edward AGAPOV (eap) Tue Jan 22 12:29:55 2002 // modified by Oleg FEDYAED (ofv) Fri Nov 29 16:08:02 2002 +#include + #include #include #include @@ -81,7 +83,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, Standard_Real aU1 = 0.0, aV1 = 0.0, aU2 = 0.0, aV2 = 0.0; Standard_Integer cnbV = theWLline->NbVertex(); - Standard_Integer ciV; + Standard_Integer ciV = 0; for( ciV = 1; ciV <= cnbV; ciV++ ) { Standard_Real pntDMin = 1.e+100; @@ -90,7 +92,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, gp_Pnt cPV = theWLline->Vertex(ciV).Value(); theWLline->Vertex(ciV).Parameters(aU1, aV1, aU2, aV2); const gp_Pnt2d aPCS1(aU1, aV1), aPCS2(aU2, aV2); - Standard_Integer iL; + Standard_Integer iL = 0; for( iL = 1; iL <= theSLin.Length(); iL++) { const Handle(IntPatch_Line)& aSLine = theSLin.Value(iL); @@ -99,7 +101,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, continue; const Handle(IntPatch_WLine) aWLine = Handle(IntPatch_WLine)::DownCast(aSLine); Standard_Integer tnbV = aWLine->NbVertex(); - Standard_Integer tiV; + Standard_Integer tiV = 0; for( tiV = 1; tiV <= tnbV; tiV++ ) { gp_Pnt tPV = aWLine->Vertex(tiV).Value(); @@ -148,7 +150,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, Standard_Integer cNbP = theWLline->NbPnts(); TColStd_SequenceOfInteger VPold; - Standard_Integer iPo; + Standard_Integer iPo = 0; for( iPo = 1; iPo <= cnbV; iPo++ ) { Standard_Real Po = theWLline->Vertex(iPo).ParameterOnLine(); @@ -208,7 +210,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, Standard_Integer pI = ciVpar; - Standard_Integer iP; + Standard_Integer iP = 0; for( iP = 1; iP <= cNbP; iP++) { if( pI == iP ) @@ -233,7 +235,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, Handle(IntPatch_WLine) NWLine = new IntPatch_WLine(newL2s,Standard_False,theTrans1,theTrans2); NWLine->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm); - Standard_Integer iV; + Standard_Integer iV = 0; for( iV = 1; iV <= cnbV; iV++ ) { if( iV == ciV ) @@ -378,32 +380,32 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S Standard_Integer NbLigCalculee = 0; - Standard_Real U1,U2,V1,V2; - Standard_Real pu1,pu2,pv1,pv2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; + Standard_Real pu1 = NAN,pu2 = NAN,pv1 = NAN,pv2 = NAN; TColStd_Array1OfReal StartParams(1,4); IntWalk_PWalking PW( Surf1, Surf2, TolTangency, Epsilon, Deflection, Increment ); Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant - Standard_Real incidence; - Standard_Real dminiPointLigne; + Standard_Real incidence = NAN; + Standard_Real dminiPointLigne = NAN; - Standard_Boolean HasStartPoint,RejetLigne; + Standard_Boolean HasStartPoint = 0,RejetLigne = 0; IntSurf_PntOn2S StartPOn2S; - Standard_Integer ver; + Standard_Integer ver = 0; gp_Pnt Point3dDebut,Point3dFin; if( nbLigSec >= 1 ) { Standard_Integer *TabL = new Standard_Integer [nbLigSec+1]; - Standard_Integer ls; + Standard_Integer ls = 0; for( ls = 1; ls <= nbLigSec; ls++ ) TabL[ls]=ls; - Standard_Boolean triok; + Standard_Boolean triok = 0; do { triok=Standard_True; for(Standard_Integer b=2; b<=nbLigSec; b++) { @@ -423,12 +425,12 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S Standard_Integer nbp = LineSec.NumberOfPoints(); Standard_Integer *TabPtDep = new Standard_Integer [nbp+1]; - Standard_Integer ilig; + Standard_Integer ilig = 0; for( ilig = 1; ilig <= nbp; ilig++) TabPtDep[ilig]=0; - Standard_Real UminLig1,VminLig1,UmaxLig1,VmaxLig1; - Standard_Real UminLig2,VminLig2,UmaxLig2,VmaxLig2; + Standard_Real UminLig1 = NAN,VminLig1 = NAN,UmaxLig1 = NAN,VmaxLig1 = NAN; + Standard_Real UminLig2 = NAN,VminLig2 = NAN,UmaxLig2 = NAN,VmaxLig2 = NAN; SectionPointToParameters(LineSec.GetPoint(1),Poly1,Poly2,UminLig1,VminLig1,UminLig2,VminLig2); @@ -463,7 +465,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S Standard_Integer nbp1_4=nbp/4; Standard_Integer nbp3_4=nbp-nbp1_4; - Standard_Integer nsp; + Standard_Integer nsp = 0; for(nsp=nbp/2; nsp= SeuildPointLigne); l++) { const Handle(IntPatch_WLine)& testwline = *((Handle(IntPatch_WLine)*)&SLin.Value(l)); @@ -566,10 +568,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S if(!RejetLigne) { // Calculation transition IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -633,13 +635,13 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S delete [] TabL; }// nbLigSec >= 1 - Standard_Real UminLig1,VminLig1,UmaxLig1,VmaxLig1; - Standard_Real UminLig2,VminLig2,UmaxLig2,VmaxLig2; + Standard_Real UminLig1 = NAN,VminLig1 = NAN,UmaxLig1 = NAN,VmaxLig1 = NAN; + Standard_Real UminLig2 = NAN,VminLig2 = NAN,UmaxLig2 = NAN,VmaxLig2 = NAN; UminLig1=VminLig1=UminLig2=VminLig2=RealLast(); UmaxLig1=VmaxLig1=UmaxLig2=VmaxLig2=-UminLig1; - Standard_Integer z; + Standard_Integer z = 0; for(z=1; z <= nbTanZon; z++) { const Intf_TangentZone& TangentZone=Interference.ZoneValue(z); for(Standard_Integer pz=1; pz<=TangentZone.NumberOfPoints(); pz++) { @@ -659,7 +661,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S for(z=1; z <= nbTanZon; z++) { const Intf_TangentZone& TangentZone=Interference.ZoneValue(z); - Standard_Integer pz; + Standard_Integer pz = 0; for( pz=1; pz<=TangentZone.NumberOfPoints(); pz++) { SectionPointToParameters(TangentZone.GetPoint(pz),Poly1,Poly2,U1,V1,U2,V2); @@ -673,7 +675,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S StartPOn2S.Parameters(pu1,pv1,pu2,pv2); NbLigCalculee = SLin.Length(); dminiPointLigne = SeuildPointLigne + SeuildPointLigne; - Standard_Integer l; + Standard_Integer l = 0; for( l = 1; (l <= NbLigCalculee) && (dminiPointLigne >= SeuildPointLigne); l++) { const Handle(IntPatch_WLine)& testwline = *((Handle(IntPatch_WLine)*)&SLin.Value(l)); @@ -717,10 +719,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S if(!RejetLigne) { IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -797,29 +799,29 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S Standard_Integer nbLigSec = Interference.NbSectionLines(); Standard_Integer nbTanZon = Interference.NbTangentZones(); - Standard_Integer NbPntOn2SOnLine; + Standard_Integer NbPntOn2SOnLine = 0; Standard_Integer NbLigCalculee = 0; - Standard_Real U1,U2,V1,V2; - Standard_Real pu1,pu2,pv1,pv2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; + Standard_Real pu1 = NAN,pu2 = NAN,pv1 = NAN,pv2 = NAN; TColStd_Array1OfReal StartParams(1,4); IntWalk_PWalking PW(Surf1,Surf1,TolTangency,Epsilon,Deflection,Increment); Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant - Standard_Real incidence; - Standard_Real dminiPointLigne; + Standard_Real incidence = NAN; + Standard_Real dminiPointLigne = NAN; - Standard_Boolean HasStartPoint,RejetLigne; + Standard_Boolean HasStartPoint = 0,RejetLigne = 0; IntSurf_PntOn2S StartPOn2S; - Standard_Integer ver; + Standard_Integer ver = 0; gp_Pnt Point3dDebut,Point3dFin; if(nbLigSec>=1) { - Standard_Integer ls; + Standard_Integer ls = 0; for( ls = 1; ls <= nbLigSec; ls++) { const Intf_SectionLine& LineSec=Interference.LineValue(ls); Standard_Integer nbp = LineSec.NumberOfPoints(); @@ -830,7 +832,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S NombreDePointsDeDepartDuCheminement++; if(NombreDePointsDeDepartDuCheminement == 1) { incidence = 0.0; - Standard_Integer nsp1; + Standard_Integer nsp1 = 0; for( nsp1= nbp/2; nsp1 >= 1; nsp1--) { SectionPointToParameters(LineSec.GetPoint(nsp1),Poly1,Poly1,U1,V1,U2,V2); Standard_Real CurrentIncidence = Abs(U1-U2)+Abs(V1-V2); @@ -883,16 +885,16 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S StartPOn2S.Parameters(pu1,pv1,pu2,pv2); if(Abs(pu1-pu2)>1e-7 || Abs(pv1-pv2)>1e-7) { NbLigCalculee = SLin.Length(); - Standard_Integer l; + Standard_Integer l = 0; for( l = 1; (l <= NbLigCalculee) && (dminiPointLigne >= SeuildPointLigne); l++) { const Handle(IntPatch_WLine)& testwline = *((Handle(IntPatch_WLine)*)&SLin.Value(l)); if( (testwline->IsOutSurf1Box(gp_Pnt2d(pu1,pv1))==Standard_False) && (testwline->IsOutSurf2Box(gp_Pnt2d(pu2,pv2))==Standard_False) && (testwline->IsOutBox(StartPOn2S.Value())==Standard_False) ) { NbPntOn2SOnLine = testwline->NbPnts(); - Standard_Integer ll; + Standard_Integer ll = 0; for( ll=1; (ll < NbPntOn2SOnLine) && (dminiPointLigne >= SeuildPointLigne); ll++) { - Standard_Real t,Au1,Av1,Au2,Av2,Bu1,Bv1,Bu2,Bv2; + Standard_Real t = NAN,Au1 = NAN,Av1 = NAN,Au2 = NAN,Av2 = NAN,Bu1 = NAN,Bv1 = NAN,Bu2 = NAN,Bv2 = NAN; testwline->Point(ll).Parameters(Au1,Av1,Au2,Av2); testwline->Point(ll+1).Parameters(Bu1,Bv1,Bu2,Bv2); if(Au1>Bu1) { @@ -946,10 +948,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S if(!RejetLigne) { IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -967,9 +969,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S } IntSurf_LineOn2S LineOn2S; - Standard_Integer nbpw,imin,imax,i; + Standard_Integer nbpw = 0,imin = 0,imax = 0,i = 0; nbpw = PW.Line()->NbPoints(); - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; i=0; do { i++; @@ -1004,7 +1006,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S const IntSurf_PntOn2S& POn2SDeb = wline->Point(1); const IntSurf_PntOn2S& POn2SFin = wline->Point(wline->NbPnts()); if((POn2SDeb.Value()).Distance(POn2SFin.Value()) <= TolTangency) { - Standard_Real u1t,v1t,u2t,v2t; + Standard_Real u1t = NAN,v1t = NAN,u2t = NAN,v2t = NAN; POn2SDeb.Parameters(u1t,v1t,u2t,v2t); IntPatch_Point vtx; vtx.SetValue(POn2SDeb.Value(),TolTang,Standard_False); @@ -1045,7 +1047,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S }// for( ls ... }// nbLigSec>=1 - Standard_Integer z; + Standard_Integer z = 0; for( z = 1; z <= nbTanZon; z++) { const Intf_TangentZone& TangentZone=Interference.ZoneValue(z); for(Standard_Integer pz=1; pz<=TangentZone.NumberOfPoints(); pz++) { @@ -1062,16 +1064,16 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S if(Abs(pu1-pu2)>1e-7 || Abs(pv1-pv2)>1e-7) { NbLigCalculee = SLin.Length(); dminiPointLigne = SeuildPointLigne + SeuildPointLigne; - Standard_Integer l; + Standard_Integer l = 0; for( l = 1; (l <= NbLigCalculee) && (dminiPointLigne >= SeuildPointLigne); l++) { const Handle(IntPatch_WLine)& testwline = *((Handle(IntPatch_WLine)*)&SLin.Value(l)); if( (testwline->IsOutSurf1Box(gp_Pnt2d(pu1,pv1))==Standard_False) && (testwline->IsOutSurf2Box(gp_Pnt2d(pu2,pv2))==Standard_False) && (testwline->IsOutBox(StartPOn2S.Value())==Standard_False) ) { NbPntOn2SOnLine = testwline->NbPnts(); - Standard_Integer ll; + Standard_Integer ll = 0; for( ll = 1; (ll < NbPntOn2SOnLine) && (dminiPointLigne >= SeuildPointLigne); ll++) { - Standard_Real t,Au1,Av1,Au2,Av2,Bu1,Bv1,Bu2,Bv2; + Standard_Real t = NAN,Au1 = NAN,Av1 = NAN,Au2 = NAN,Av2 = NAN,Bu1 = NAN,Bv1 = NAN,Bu2 = NAN,Bv2 = NAN; testwline->Point(ll).Parameters(Au1,Av1,Au2,Av2); testwline->Point(ll+1).Parameters(Bu1,Bv1,Bu2,Bv2); if(Au1>Bu1) { @@ -1124,10 +1126,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S if(!RejetLigne) { IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -1145,9 +1147,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S } IntSurf_LineOn2S LineOn2S; - Standard_Integer nbp,imin,imax,i; + Standard_Integer nbp = 0,imin = 0,imax = 0,i = 0; nbp = PW.Line()->NbPoints(); - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; i=0; do { i++; @@ -1182,7 +1184,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S const IntSurf_PntOn2S& POn2SDeb = wline->Point(1); const IntSurf_PntOn2S& POn2SFin = wline->Point(wline->NbPnts()); if((POn2SDeb.Value()).Distance(POn2SFin.Value()) <= TolTangency) { - Standard_Real u1t,v1t,u2t,v2t; + Standard_Real u1t = NAN,v1t = NAN,u2t = NAN,v2t = NAN; POn2SDeb.Parameters(u1t,v1t,u2t,v2t); IntPatch_Point vtx; vtx.SetValue(POn2SDeb.Value(),TolTang,Standard_False); @@ -1255,10 +1257,10 @@ Handle(IntPatch_Line) IntPatch_PrmPrmIntersection::NewLine (const Handle(Adaptor TColStd_Array1OfReal V2(Low,High); TColStd_Array1OfReal AC(Low,High); - Standard_Real s,ds; + Standard_Real s = NAN,ds = NAN; Handle(IntPatch_WLine) TheLine = Handle(IntPatch_WLine)::DownCast(Line(NumLine)); const IntSurf_PntOn2S& Point=TheLine->Point(Low); - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point.Parameters(u1,v1,u2,v2); U1(Low) = u1; V1(Low) = v1; @@ -1268,7 +1270,7 @@ Handle(IntPatch_Line) IntPatch_PrmPrmIntersection::NewLine (const Handle(Adaptor IntWalk_PWalking PW(Surf1,Surf2,0.000001,0.000001,0.001,0.001); - Standard_Integer i; + Standard_Integer i = 0; for(i=Low+1; i<=High; i++) { const IntSurf_PntOn2S& Pointi=TheLine->Point(i); @@ -1348,11 +1350,11 @@ void SectionPointToParameters(const Intf_SectionPoint& Sp, Standard_Real& v2) { Intf_PIType typ; - Standard_Integer Adr1,Adr2; - Standard_Real Param,u,v; + Standard_Integer Adr1 = 0,Adr2 = 0; + Standard_Real Param = NAN,u = NAN,v = NAN; gp_Pnt P(Sp.Pnt()); - Standard_Integer Pt1,Pt2,Pt3; + Standard_Integer Pt1 = 0,Pt2 = 0,Pt3 = 0; Sp.InfoFirst(typ,Adr1,Adr2,Param); switch(typ) { @@ -1371,7 +1373,7 @@ void SectionPointToParameters(const Intf_SectionPoint& Sp, } case Intf_FACE: { - Standard_Real ua,va,ub,vb,uc,vc,ca,cb,cc,cabc; + Standard_Real ua = NAN,va = NAN,ub = NAN,vb = NAN,uc = NAN,vc = NAN,ca = NAN,cb = NAN,cc = NAN,cabc = NAN; Poly1.Triangle(Adr1,Pt1,Pt2,Pt3); gp_Pnt PA(Poly1.Point(Pt1)); gp_Pnt PB(Poly1.Point(Pt2)); @@ -1416,7 +1418,7 @@ void SectionPointToParameters(const Intf_SectionPoint& Sp, } case Intf_FACE: { - Standard_Real ua,va,ub,vb,uc,vc,ca,cb,cc,cabc; + Standard_Real ua = NAN,va = NAN,ub = NAN,vb = NAN,uc = NAN,vc = NAN,ca = NAN,cb = NAN,cc = NAN,cabc = NAN; Poly2.Triangle(Adr1,Pt1,Pt2,Pt3); gp_Pnt PA(Poly2.Point(Pt1)); gp_Pnt PB(Poly2.Point(Pt2)); @@ -1456,7 +1458,7 @@ void IntPatch_PrmPrmIntersection::RemplitLin(const Standard_Integer x1, const Standard_Integer z2, IntPatch_PrmPrmIntersection_T3Bits& Map) const { - int xg,yg,zg; + int xg = 0,yg = 0,zg = 0; xg=x1-x2; if(xg<0) xg=-xg; yg=y1-y2; if(yg<0) yg=-yg; zg=z1-z2; if(zg<0) zg=-zg; @@ -1532,7 +1534,7 @@ void IntPatch_PrmPrmIntersection::Remplit(const Standard_Integer a, const Standard_Integer c, IntPatch_PrmPrmIntersection_T3Bits& Map) const { - int iax,iay,iaz,ibx,iby,ibz,icx,icy,icz; + int iax = 0,iay = 0,iaz = 0,ibx = 0,iby = 0,ibz = 0,icx = 0,icy = 0,icz = 0; if(a!=-1) Map.Add(a); if(b!=-1) Map.Add(b); if(c!=-1) Map.Add(c); @@ -1569,9 +1571,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S empt = Standard_True; SLin.Clear(); - Standard_Real UminLig1,VminLig1,UmaxLig1,VmaxLig1; - Standard_Real UminLig2,VminLig2,UmaxLig2,VmaxLig2; - Standard_Real U1,U2,V1,V2; + Standard_Real UminLig1 = NAN,VminLig1 = NAN,UmaxLig1 = NAN,VmaxLig1 = NAN; + Standard_Real UminLig2 = NAN,VminLig2 = NAN,UmaxLig2 = NAN,VmaxLig2 = NAN; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; UminLig1 = Surf1->FirstUParameter(); VminLig1 = Surf1->FirstVParameter(); @@ -1594,7 +1596,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S { Standard_Real TolPar = Precision::PConfusion(); IntSurf_ListOfPntOn2S AdditionalPnts; - Standard_Real NewU1, NewV1, NewU2, NewV2; + Standard_Real NewU1 = NAN, NewV1 = NAN, NewU2 = NAN, NewV2 = NAN; for(; IterLOP1.More(); IterLOP1.Next()) { IntSurf_PntOn2S Pnt = IterLOP1.Value(); @@ -1700,9 +1702,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; - Standard_Integer NbLigCalculee = 0, ver; - Standard_Real pu1,pu2,pv1,pv2, dminiPointLigne; - Standard_Boolean HasStartPoint,RejetLigne; + Standard_Integer NbLigCalculee = 0, ver = 0; + Standard_Real pu1 = NAN,pu2 = NAN,pv1 = NAN,pv2 = NAN, dminiPointLigne = NAN; + Standard_Boolean HasStartPoint = 0,RejetLigne = 0; IntSurf_PntOn2S StartPOn2S; gp_Pnt Point3dDebut,Point3dFin; @@ -1725,7 +1727,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S if(HasStartPoint) { StartPOn2S.Parameters(pu1,pv1,pu2,pv2); NbLigCalculee = SLin.Length(); - Standard_Integer l; + Standard_Integer l = 0; for( l = 1; (l <= NbLigCalculee) && (dminiPointLigne >= SeuildPointLigne); l++) { const Handle(IntPatch_WLine)& testwline = *((Handle(IntPatch_WLine)*)&SLin.Value(l)); @@ -1773,10 +1775,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& S if(!RejetLigne) { IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -1866,7 +1868,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Su //------------------------------------------------------------ - Standard_Real pu1,pu2,pv1,pv2; + Standard_Real pu1 = NAN,pu2 = NAN,pv1 = NAN,pv2 = NAN; TColStd_Array1OfReal StartParams(1,4); @@ -1894,7 +1896,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Su //Standard_Real incidence; //Standard_Real dminiPointLigne; - Standard_Boolean HasStartPoint;//,RejetLigne; + Standard_Boolean HasStartPoint = 0;//,RejetLigne; IntSurf_PntOn2S StartPOn2S; @@ -1927,10 +1929,10 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Su Point3dFin = PW.Value(PW.NbPoints()).Value(); IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -1992,9 +1994,9 @@ void AdjustOnPeriodic(const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor3d_Surface)& Surf2, IntPatch_SequenceOfLine& aSLin) { - Standard_Boolean bIsPeriodic[4], bModified, bIsNull, bIsPeriod; - Standard_Integer i, j, k, aNbLines, aNbPx, aIndx, aIndq; - Standard_Real aPeriod[4], dPeriod[4], ux[4], uq[4], aEps, du; + Standard_Boolean bIsPeriodic[4], bModified = 0, bIsNull = 0, bIsPeriod = 0; + Standard_Integer i = 0, j = 0, k = 0, aNbLines = 0, aNbPx = 0, aIndx = 0, aIndq = 0; + Standard_Real aPeriod[4], dPeriod[4], ux[4], uq[4], aEps = NAN, du = NAN; // aEps=Precision::Confusion(); // @@ -2105,7 +2107,7 @@ IntSurf_PntOn2S MakeNewPoint(const IntSurf_PntOn2S& replacePnt, oldPnt.Parameters(OldParams[0], OldParams[1], OldParams[2], OldParams[3]); replacePnt.Parameters(NewParams[0], NewParams[1], NewParams[2], NewParams[3]); - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i < 4; i++) { if (Periods[i] != 0.) @@ -2208,8 +2210,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf Standard_Integer nbTanZon = Interference.NbTangentZones(); Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; - Standard_Integer NbLigCalculee = 0, ver; - Standard_Real pu1,pu2,pv1,pv2, incidence, dminiPointLigne; + Standard_Integer NbLigCalculee = 0, ver = 0; + Standard_Real pu1 = NAN,pu2 = NAN,pv1 = NAN,pv2 = NAN, incidence = NAN, dminiPointLigne = NAN; Standard_Boolean HasStartPoint = Standard_False, RejectLine = Standard_False; IntSurf_PntOn2S StartPOn2S; gp_Pnt Point3dDebut,Point3dFin; @@ -2226,8 +2228,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf } //----------------------------------------1.1 { - Standard_Boolean triok; - Standard_Integer nb_A, nb_B, tyu; + Standard_Boolean triok = 0; + Standard_Integer nb_A = 0, nb_B = 0, tyu = 0; do { triok=Standard_True; @@ -2265,9 +2267,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf TabPtDep[ilig]=0; } // - Standard_Real UminLig1,VminLig1,UmaxLig1,VmaxLig1; - Standard_Real UminLig2,VminLig2,UmaxLig2,VmaxLig2; - Standard_Real _x,_y,_z; + Standard_Real UminLig1 = NAN,VminLig1 = NAN,UmaxLig1 = NAN,VmaxLig1 = NAN; + Standard_Real UminLig2 = NAN,VminLig2 = NAN,UmaxLig2 = NAN,VmaxLig2 = NAN; + Standard_Real _x = NAN,_y = NAN,_z = NAN; // Interference.GetLinePoint(TabL[ls], 1, _x, _y, _z, UminLig1, VminLig1, UminLig2, VminLig2, @@ -2280,7 +2282,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf // for(Standard_Integer ilig = 2; ilig <= nbp; ilig++ ) { - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; Interference.GetLinePoint(TabL[ls],ilig,_x,_y,_z,U1,V1,U2,V2,incidence); // if(U1>UmaxLig1) UmaxLig1=U1; @@ -2334,7 +2336,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf // if(TabPtDep[nbps2] == 0) { - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; TabPtDep[nbps2] = 1; Interference.GetLinePoint(TabL[ls],nbps2,_x,_y,_z,U1,V1,U2,V2,incidence); @@ -2350,7 +2352,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf { StartPOn2S.Parameters(pu1,pv1,pu2,pv2); NbLigCalculee = SLin.Length(); - Standard_Integer l; + Standard_Integer l = 0; for( l = 1; (l <= NbLigCalculee) && (dminiPointLigne >= SeuildPointLigne); l++) { const Handle(IntPatch_WLine)& testwline = *((Handle(IntPatch_WLine)*)&SLin.Value(l)); @@ -2367,8 +2369,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf UmaxLig1, VmaxLig1, UmaxLig2, VmaxLig2); // - Standard_Boolean bPWIsDone; - Standard_Real aD11, aD12, aD21, aD22, aDx; + Standard_Boolean bPWIsDone = 0; + Standard_Real aD11 = NAN, aD12 = NAN, aD21 = NAN, aD22 = NAN, aDx = NAN; // bPWIsDone=PW.IsDone(); @@ -2418,7 +2420,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf if((aD11<=TolTangency && aD22<=TolTangency) || (aD12<=TolTangency && aD21<=TolTangency)) { - Standard_Integer m, mx; + Standard_Integer m = 0, mx = 0; // mx=aNbPointsVer/2; if (aNbPointsVer%2) @@ -2465,10 +2467,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf if(!RejectLine) { IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -2545,22 +2547,22 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf //-------------------------------------------------------------------- //-- Calcul des parametres approches a partir des Zones De Tangence -- //-------------------------------------------------------------------- - Standard_Real UminLig1,VminLig1,UmaxLig1,VmaxLig1; - Standard_Real UminLig2,VminLig2,UmaxLig2,VmaxLig2; + Standard_Real UminLig1 = NAN,VminLig1 = NAN,UmaxLig1 = NAN,VmaxLig1 = NAN; + Standard_Real UminLig2 = NAN,VminLig2 = NAN,UmaxLig2 = NAN,VmaxLig2 = NAN; UminLig1=VminLig1=UminLig2=VminLig2=RealLast(); UmaxLig1=VmaxLig1=UmaxLig2=VmaxLig2=-UminLig1; // NbPointsInTangentZone always == 1 (eap) - Standard_Integer z; + Standard_Integer z = 0; for( z=1; z <= nbTanZon; z++) { //Standard_Integer NbPointsInTangentZone=Interference.NbPointsInTangentZone(z); //for(Standard_Integer pz=1; pz<=NbPointsInTangentZone; pz++) { Standard_Integer pz=1; - Standard_Real _x,_y,_z; - Standard_Real U1, U2, V1, V2; + Standard_Real _x = NAN,_y = NAN,_z = NAN; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; Interference.GetTangentZonePoint(z,pz,_x,_y,_z,U1,V1,U2,V2); if(U1>UmaxLig1) UmaxLig1=U1; @@ -2580,8 +2582,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf //Standard_Integer NbPointsInTangentZone=Interference.NbPointsInTangentZone(z); //for(Standard_Integer pz=1; pz<=NbPointsInTangentZone; pz++) { Standard_Integer pz=1; - Standard_Real _x,_y,_z; - Standard_Real U1, U2, V1, V2; + Standard_Real _x = NAN,_y = NAN,_z = NAN; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; Interference.GetTangentZonePoint(z,pz,_x,_y,_z,U1,V1,U2,V2); StartParams(1) = U1; @@ -2680,10 +2682,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf if(!RejectLine) { IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -2764,8 +2766,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf done = Standard_True; Standard_Integer NbLigCalculee = 0; - Standard_Real U1,U2,V1,V2; - Standard_Real pu1,pu2,pv1,pv2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; + Standard_Real pu1 = NAN,pu2 = NAN,pv1 = NAN,pv2 = NAN; TColStd_Array1OfReal StartParams(1,4); Standard_Integer MaxOscill = NbU1; @@ -2779,10 +2781,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf IntWalk_PWalking PW(Surf1,Surf2,TolTangency,Epsilon,Deflection,nIncrement); Standard_Real SeuildPointLigne = 15.0 * Increment * Increment; //-- 10 est insuffisant - Standard_Real dminiPointLigne; - Standard_Boolean HasStartPoint,RejetLigne; + Standard_Real dminiPointLigne = NAN; + Standard_Boolean HasStartPoint = 0,RejetLigne = 0; IntSurf_PntOn2S StartPOn2S; - Standard_Integer ver; + Standard_Integer ver = 0; gp_Pnt Point3dDebut,Point3dFin; //------------------------------------------------------------ @@ -2879,10 +2881,10 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf if(!RejetLigne) { IntSurf_TypeTrans trans1,trans2; - Standard_Real locu,locv; + Standard_Real locu = NAN,locv = NAN; gp_Vec norm1,norm2,d1u,d1v; gp_Pnt ptbid; - Standard_Integer indextg; + Standard_Integer indextg = 0; gp_Vec tgline(PW.TangentAtLine(indextg)); PW.Line()->Value(indextg).ParametersOnS1(locu,locv); Surf1->D1(locu,locv,ptbid,d1u,d1v); @@ -2954,9 +2956,9 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf class IntPatch_InfoPD { public: //----------------------------------------C-tor - IntPatch_InfoPD(const Standard_Integer aNBI) { - Standard_Integer aNBI2, i, j; - myNBI=aNBI; + IntPatch_InfoPD(const Standard_Integer aNBI) : myNBI(aNBI) { + Standard_Integer aNBI2 = 0, i = 0, j = 0; + // aNBI2=aNBI*aNBI; myP1DS2=new char[aNBI2]; @@ -3054,16 +3056,16 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S const Standard_Integer SU_2, const Standard_Integer SV_2) const { - Standard_Integer i, j, xNBI; + Standard_Integer i = 0, j = 0, xNBI = 0; //modified by NIZNHY-PKV Tue May 24 11:37:38 2011f xNBI=200; IntPatch_InfoPD aIPD(xNBI); //modified by NIZNHY-PKV Wed May 25 06:47:12 2011t - Standard_Integer iC15, SU1, SV1, SU2, SV2; - Standard_Real U0, U1, V0, V1, U, V; - Standard_Real resu0,resv0; - Standard_Real du1,du2,dv1,dv2, dmaxOn1, dmaxOn2; - Standard_Real x0,y0,z0, x1,y1,z1,d; + Standard_Integer iC15 = 0, SU1 = 0, SV1 = 0, SU2 = 0, SV2 = 0; + Standard_Real U0 = NAN, U1 = NAN, V0 = NAN, V1 = NAN, U = NAN, V = NAN; + Standard_Real resu0 = NAN,resv0 = NAN; + Standard_Real du1 = NAN,du2 = NAN,dv1 = NAN,dv2 = NAN, dmaxOn1 = NAN, dmaxOn2 = NAN; + Standard_Real x0 = NAN,y0 = NAN,z0 = NAN, x1 = NAN,y1 = NAN,z1 = NAN,d = NAN; Bnd_Box Box1, Box2; // iC15=15; @@ -3144,11 +3146,11 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S return; } // - Standard_Integer aNbPG; - Standard_Real x10,y10,z10,x11,y11,z11; - Standard_Real x20,y20,z20,x21,y21,z21; - Standard_Real dx, dy, dz, dmax; - Standard_Real dx2, dy2, dz2; + Standard_Integer aNbPG = 0; + Standard_Real x10 = NAN,y10 = NAN,z10 = NAN,x11 = NAN,y11 = NAN,z11 = NAN; + Standard_Real x20 = NAN,y20 = NAN,z20 = NAN,x21 = NAN,y21 = NAN,z21 = NAN; + Standard_Real dx = NAN, dy = NAN, dz = NAN, dmax = NAN; + Standard_Real dx2 = NAN, dy2 = NAN, dz2 = NAN; // Box1.Get(x10,y10,z10,x11,y11,z11); Box2.Get(x20,y20,z20,x21,y21,z21); @@ -3290,7 +3292,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S long unsigned Compt=0; int ok=0; int indicepointtraite = 0; - Standard_Integer k,nu,nv; + Standard_Integer k = 0,nu = 0,nv = 0; // do { indicepointtraite--; @@ -3301,7 +3303,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S int LIM=3; if( DansGrille(i-1) && DansGrille(j-1) && DansGrille(k-1) && DansGrille(i+1) && DansGrille(j+1) && DansGrille(k+1)) { - int si,sj,sk; + int si = 0,sj = 0,sk = 0; for(si=-1; si<= 1 && nbIsOutSurf2Box(gp_Pnt2d(pu2, pv2)) == Standard_False) && (theWLine->IsOutBox(thePOn2S.Value()) == Standard_False)) { const Standard_Integer NbPntOn2SOnLine = theWLine->NbPnts(); - Standard_Integer ll; + Standard_Integer ll = 0; for (ll=1; ll < NbPntOn2SOnLine && !isOnLine; ll++) { const gp_Pnt &Pa = theWLine->Point(ll).Value(); @@ -3533,7 +3535,7 @@ void AddWLine(IntPatch_SequenceOfLine &theLines, { Standard_Integer i = 1; Standard_Integer aNbLines = theLines.Length(); - Standard_Boolean isToRemove; + Standard_Boolean isToRemove = 0; // Check each line of theLines if it is on theWLine. while (i <= aNbLines) { @@ -3553,7 +3555,7 @@ void AddWLine(IntPatch_SequenceOfLine &theLines, // Middle point is on theWLine. Check vertices. isToRemove = Standard_True; - Standard_Integer j; + Standard_Integer j = 0; const Standard_Integer aNbVtx = aWLine->NbVertex(); for (j = 1; j <= aNbVtx; j++) { diff --git a/src/IntPatch/IntPatch_RLine.cxx b/src/IntPatch/IntPatch_RLine.cxx index 4e552fc067..bbf9571dfc 100644 --- a/src/IntPatch/IntPatch_RLine.cxx +++ b/src/IntPatch/IntPatch_RLine.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -26,7 +28,7 @@ IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2) : IntPatch_PointLine(Tang,Trans1,Trans2), - ParamInf1(0.0), + onS2(Standard_False), onS1(Standard_False), ParamInf1(0.0), ParamSup1(0.0), ParamInf2(0.0), ParamSup2(0.0), @@ -36,8 +38,8 @@ IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang, indl(0) { typ = IntPatch_Restriction; - onS2=Standard_False; - onS1=Standard_False; + + } @@ -45,7 +47,7 @@ IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2) : IntPatch_PointLine(Tang,Situ1,Situ2), - ParamInf1(0.0), + onS2(Standard_False), onS1(Standard_False), ParamInf1(0.0), ParamSup1(0.0), ParamInf2(0.0), ParamSup2(0.0), @@ -55,14 +57,14 @@ IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang, indl(0) { typ = IntPatch_Restriction; - onS2=Standard_False; - onS1=Standard_False; + + } IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang) : IntPatch_PointLine(Tang), - ParamInf1(0.0), + onS2(Standard_False), onS1(Standard_False), ParamInf1(0.0), ParamSup1(0.0), ParamInf2(0.0), ParamSup2(0.0), @@ -72,8 +74,8 @@ IntPatch_RLine::IntPatch_RLine (const Standard_Boolean Tang) : indl(0) { typ = IntPatch_Restriction; - onS2=Standard_False; - onS1=Standard_False; + + } void IntPatch_RLine::ParamOnS1(Standard_Real& a,Standard_Real& b) const { @@ -124,7 +126,7 @@ void IntPatch_RLine::SetPoint(const Standard_Integer Index, //void IntPatch_RLine::ComputeVertexParameters(const Standard_Real Tol) void IntPatch_RLine::ComputeVertexParameters(const Standard_Real ) { - Standard_Integer i,j,nbvtx;//k; + Standard_Integer i = 0,j = 0,nbvtx = 0;//k; Standard_Boolean APointDeleted = Standard_False; //---------------------------------------------------------- @@ -194,7 +196,7 @@ void IntPatch_RLine::ComputeVertexParameters(const Standard_Real ) //---------------------------------------------------- //-- On trie les Vertex - Standard_Boolean SortIsOK; + Standard_Boolean SortIsOK = 0; do { SortIsOK = Standard_True; for(i=2; i<=nbvtx; i++) { @@ -208,7 +210,7 @@ void IntPatch_RLine::ComputeVertexParameters(const Standard_Real ) do { APointDeleted = Standard_False; - Standard_Boolean restrdiff; + Standard_Boolean restrdiff = 0; for(i=1; i<=nbvtx && (APointDeleted == Standard_False); i++) { const IntPatch_Point& VTX = svtx.Value(i); for(j=1; j<=nbvtx && (APointDeleted == Standard_False) ; j++) { @@ -374,7 +376,7 @@ void IntPatch_RLine::Dump(const Standard_Integer theMode) const printf("Num [X Y Z] [U1 V1] [U2 V2]\n"); for(Standard_Integer i=1; i<=aNbPoints; i++) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point(i).Parameters(u1,v1,u2,v2); printf("%4d [%+10.20f %+10.20f %+10.20f] [%+10.20f %+10.20f] [%+10.20f %+10.20f]\n", i,Point(i).Value().X(),Point(i).Value().Y(),Point(i).Value().Z(), @@ -400,7 +402,7 @@ void IntPatch_RLine::Dump(const Standard_Integer theMode) const case 1: for(Standard_Integer i = 1; i <= aNbPoints; i++) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point(i).Parameters(u1,v1,u2,v2); printf("point p%d %+10.20f %+10.20f %+10.20f\n", i,Point(i).Value().X(),Point(i).Value().Y(),Point(i).Value().Z()); @@ -410,7 +412,7 @@ void IntPatch_RLine::Dump(const Standard_Integer theMode) const case 2: for(Standard_Integer i = 1; i <= aNbPoints; i++) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point(i).Parameters(u1,v1,u2,v2); printf("point p%d %+10.20f %+10.20f\n", i, u1, v1); } @@ -419,7 +421,7 @@ void IntPatch_RLine::Dump(const Standard_Integer theMode) const default: for(Standard_Integer i = 1; i <= aNbPoints; i++) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point(i).Parameters(u1,v1,u2,v2); printf("point p%d %+10.20f %+10.20f\n", i, u2, v2); } diff --git a/src/IntPatch/IntPatch_RstInt.cxx b/src/IntPatch/IntPatch_RstInt.cxx index b1b996ff92..863206b4ec 100644 --- a/src/IntPatch/IntPatch_RstInt.cxx +++ b/src/IntPatch/IntPatch_RstInt.cxx @@ -25,6 +25,8 @@ //-- - Pour rester coherent avec cette facon de faire, //-- Chercher(Nbvtx++). +#include + #include #include #include @@ -57,7 +59,7 @@ static void Recadre(GeomAbs_SurfaceType typeS1, { Standard_Integer nbpnts = wlin->NbPnts(); if(Param<1) Param=1; else if(Param>nbpnts) Param=nbpnts; - Standard_Real U1p,V1p,U2p,V2p; + Standard_Real U1p = NAN,V1p = NAN,U2p = NAN,V2p = NAN; wlin->Point(Param).Parameters(U1p,V1p,U2p,V2p); switch(typeS1) { @@ -153,7 +155,7 @@ static void VerifyTgline(const Handle(IntPatch_WLine)& wlin, && Abs(Tgl.Z())NbPnts(); + Standard_Integer i = 0, n = 0, nbpt=wlin->NbPnts(); Standard_Boolean forward = (nbpt-param) >= (param-1); for (n = 2; n > 0; n--, forward = !forward) { if (forward) { @@ -203,7 +205,7 @@ static void GetLinePoint2d (const Handle(IntPatch_Line)& L, else par = Abs(param-par); - Standard_Real us1,vs1,us2,vs2; + Standard_Real us1 = NAN,vs1 = NAN,us2 = NAN,vs2 = NAN; if (typL == IntPatch_Walking) { if (OnFirst) { wlin->Point(Irang).ParametersOnS1(us1,vs1); @@ -281,8 +283,8 @@ static Standard_Boolean FindParameter(const Handle(IntPatch_Line)& L, } else if (typL == IntPatch_Walking) { - Standard_Integer i, is, nbpt=wlin->NbPnts(); - Standard_Real norm1,norm2; + Standard_Integer i = 0, is = 0, nbpt=wlin->NbPnts(); + Standard_Real norm1 = NAN,norm2 = NAN; Standard_Integer ParamSearchInf=1; Standard_Integer ParamSearchSup=nbpt; @@ -375,10 +377,10 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, IntPatch_SearchPnt Commun; - Standard_Real U,V,W; - Standard_Real U1,V1,U2 = 0.,V2 = 0.; + Standard_Real U = NAN,V = NAN,W = NAN; + Standard_Real U1 = NAN,V1 = NAN,U2 = 0.,V2 = 0.; Standard_Real paramarc=0.,paramline=0.; - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; TColgp_SequenceOfPnt locpt; TColgp_SequenceOfPnt2d locpt2; Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (L)); //-- aucune verification n est @@ -389,8 +391,8 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, tolPLin = Min (tolPLin, Precision::Confusion()); IntPatch_PolyLine PLin(tolPLin); - Standard_Real PFirst,PLast; - Standard_Integer NbEchant; + Standard_Real PFirst = NAN,PLast = NAN; + Standard_Integer NbEchant = 0; gp_Pnt ptsommet, ptbid; gp_Vec tgline, tgrst, d1u, d1v, normsurf; @@ -400,7 +402,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, IntPatch_Point Sommet, ptline; Handle(Adaptor3d_HVertex) vtxarc,vtxline; Handle(Adaptor2d_Curve2d) arc; - Standard_Boolean VtxOnArc, duplicate, found; + Standard_Boolean VtxOnArc = 0, duplicate = 0, found = 0; IntSurf_Transition transarc,transline; IntPatch_IType typL = L->ArcType(); @@ -502,7 +504,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, { NbEchant=10; - Standard_Real aXmin, aYmin, aXmax, aYmax; + Standard_Real aXmin = NAN, aYmin = NAN, aXmax = NAN, aYmax = NAN; BPLin.Get(aXmin, aYmin, aXmax, aYmax); gp_Lin2d aLin = arc->Line(); const gp_Pnt2d& aLoc = aLin.Location(); @@ -550,7 +552,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, } if(SurfaceIsPeriodic) { - Standard_Real xmin,ymin,xmax,ymax,g; + Standard_Real xmin = NAN,ymin = NAN,xmax = NAN,ymax = NAN,g = NAN; BPLin.Get(xmin,ymin,xmax,ymax); g = BPLin.GetGap(); BPLin.SetVoid(); @@ -559,7 +561,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, BPLin.SetGap(g); } if(SurfaceIsBiPeriodic) { - Standard_Real xmin,ymin,xmax,ymax,g; + Standard_Real xmin = NAN,ymin = NAN,xmax = NAN,ymax = NAN,g = NAN; BPLin.Get(xmin,ymin,xmax,ymax); g = BPLin.GetGap(); BPLin.SetVoid(); @@ -709,7 +711,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, } VtxOnArc = CoincideOnArc(ptsommet,arc,Surf,edgeTol,Domain,vtxarc); - Standard_Real vtxTol; + Standard_Real vtxTol = NAN; if (VtxOnArc) { vtxTol = Tol3d(vtxarc,Domain); if (edgeTol > vtxTol) vtxTol = edgeTol; @@ -1000,7 +1002,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, //-- On reprend la ligne et on recale les parametres des vertex. //-- if (typL == IntPatch_Walking) { - Standard_Real pu1,pv1,pu2,pv2; + Standard_Real pu1 = NAN,pv1 = NAN,pu2 = NAN,pv2 = NAN; pu1=pv1=pu2=pv2=0.0; switch(TypeS1) { case GeomAbs_Cylinder: diff --git a/src/IntPatch/IntPatch_SpecialPoints.cxx b/src/IntPatch/IntPatch_SpecialPoints.cxx index d2fb94add0..27d65df886 100644 --- a/src/IntPatch/IntPatch_SpecialPoints.cxx +++ b/src/IntPatch/IntPatch_SpecialPoints.cxx @@ -43,18 +43,18 @@ public: { }; - virtual Standard_Integer NbVariables() const + Standard_Integer NbVariables() const override { return 3; }; - virtual Standard_Integer NbEquations() const + Standard_Integer NbEquations() const override { return 3; } - virtual Standard_Boolean Value(const math_Vector& theX, - math_Vector& theF) + Standard_Boolean Value(const math_Vector& theX, + math_Vector& theF) override { try { @@ -74,8 +74,8 @@ public: return Standard_True; }; - virtual Standard_Boolean Derivatives(const math_Vector& theX, - math_Matrix& theD) + Standard_Boolean Derivatives(const math_Vector& theX, + math_Matrix& theD) override { try { @@ -112,9 +112,9 @@ public: return Standard_True; }; - virtual Standard_Boolean Values (const math_Vector& theX, + Standard_Boolean Values (const math_Vector& theX, math_Vector& theF, - math_Matrix& theD) + math_Matrix& theD) override { if(!Value(theX, theF)) return Standard_False; diff --git a/src/IntPatch/IntPatch_WLine.cxx b/src/IntPatch/IntPatch_WLine.cxx index 7cdb93daaf..f3855e7b62 100644 --- a/src/IntPatch/IntPatch_WLine.cxx +++ b/src/IntPatch/IntPatch_WLine.cxx @@ -26,6 +26,7 @@ IMPLEMENT_STANDARD_RTTIEXT(IntPatch_WLine,IntPatch_PointLine) #define DEBUGV 0 #include +#include #include @@ -33,13 +34,13 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2) : - IntPatch_PointLine(Tang,Trans1,Trans2),fipt(Standard_False),lapt(Standard_False), + IntPatch_PointLine(Tang,Trans1,Trans2),curv(Line), fipt(Standard_False),lapt(Standard_False), hasArcOnS1(Standard_False),hasArcOnS2(Standard_False), myIsPurgerAllowed(Standard_True), myCreationWay(IntPatch_WLUnknown) { typ = IntPatch_Walking; - curv = Line; + u1period=v1period=u2period=v2period=0.0; } @@ -48,26 +49,26 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2) : - IntPatch_PointLine(Tang,Situ1,Situ2),fipt(Standard_False),lapt(Standard_False), + IntPatch_PointLine(Tang,Situ1,Situ2),curv(Line), fipt(Standard_False),lapt(Standard_False), hasArcOnS1(Standard_False),hasArcOnS2(Standard_False), myIsPurgerAllowed(Standard_True), myCreationWay(IntPatch_WLUnknown) { typ = IntPatch_Walking; - curv = Line; + u1period=v1period=u2period=v2period=0.0; } IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang) : - IntPatch_PointLine(Tang),fipt(Standard_False),lapt(Standard_False), + IntPatch_PointLine(Tang),curv(Line), fipt(Standard_False),lapt(Standard_False), hasArcOnS1(Standard_False),hasArcOnS2(Standard_False), myIsPurgerAllowed(Standard_True), myCreationWay(IntPatch_WLUnknown) { typ = IntPatch_Walking; - curv = Line; + u1period=v1period=u2period=v2period=0.0; } @@ -114,7 +115,7 @@ static void RecadreMemePeriode(IntSurf_PntOn2S& POn2S,const IntSurf_PntOn2S& Ref const Standard_Real vp1, const Standard_Real up2, const Standard_Real vp2) { - Standard_Real u1,v1,u2,v2,pu1,pv1,pu2,pv2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN,pu1 = NAN,pv1 = NAN,pu2 = NAN,pv2 = NAN; POn2S.Parameters(u1,v1,u2,v2); RefPOn2S.Parameters(pu1,pv1,pu2,pv2); RecadreMemePeriode(u1,v1,u2,v2,pu1,pv1,pu2,pv2,up1,vp1,up2,vp2); @@ -221,7 +222,7 @@ static Standard_Boolean CompareVerticesOnSurf(const IntPatch_Point& vtx1, const IntPatch_Point& vtx2, const Standard_Boolean onFirst) { - Standard_Real u1,v1,u2,v2, tolU, tolV; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN, tolU = NAN, tolV = NAN; if (onFirst) { vtx1.ParametersOnS1(u1,v1); vtx2.ParametersOnS1(u2,v2); @@ -247,9 +248,9 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol) // MSV Oct 15, 2001: use tolerance of vertex instead of RTol where // it is possible - Standard_Integer i,j,k,nbvtx,nbponline; - Standard_Integer indicevertexonline; - Standard_Real indicevertex; + Standard_Integer i = 0,j = 0,k = 0,nbvtx = 0,nbponline = 0; + Standard_Integer indicevertexonline = 0; + Standard_Real indicevertex = NAN; Standard_Boolean APointDeleted = Standard_False; //---------------------------------------------------------- @@ -282,7 +283,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol) //-- sur des restrictions differentes //-- //-- Phase Creation de nouveaux points sur S1 - Standard_Boolean encoreunefois; + Standard_Boolean encoreunefois = 0; do { nbvtx=NbVertex(); encoreunefois=Standard_False; @@ -450,7 +451,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol) //---------------------------------------------------- //-- On trie les Vertex - Standard_Boolean SortIsOK; + Standard_Boolean SortIsOK = 0; do { SortIsOK = Standard_True; for(i=2; i<=nbvtx; i++) { @@ -513,7 +514,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol) //Adjust first point of curve to corresponding vertex the following way: //set 3D point as the point of the vertex and 2D points as the points of the point on curve. curv->SetPoint (1, POn2S.Value()); - Standard_Real mu1,mv1,mu2,mv2; + Standard_Real mu1 = NAN,mv1 = NAN,mu2 = NAN,mv2 = NAN; curv->Value(1).Parameters(mu1,mv1,mu2,mv2); svtx.ChangeValue(i).SetParameter(1); svtx.ChangeValue(i).SetParameters(mu1,mv1,mu2,mv2); @@ -556,7 +557,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol) //--------------------------------------------------------- Standard_Boolean Substitution = Standard_False; //-- for(k=indicevertexonline+1; !Substitution && k>=indicevertexonline-1;k--) { avant le 9 oct 97 - Standard_Real mu1,mv1,mu2,mv2; + Standard_Real mu1 = NAN,mv1 = NAN,mu2 = NAN,mv2 = NAN; curv->Value(indicevertexonline).Parameters(mu1,mv1,mu2,mv2); for(k=indicevertexonline+1; k>=indicevertexonline-1;k--) { @@ -593,7 +594,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol) //Remove duplicating points if (Substitution) { - Standard_Integer ind_point; + Standard_Integer ind_point = 0; for(ind_point = 2; (ind_point <= nbponline && nbponline > 1); ind_point++) { Standard_Real d = (curv->Value(ind_point-1).Value()).SquareDistance((curv->Value(ind_point).Value())); if(d < dmini) { @@ -771,7 +772,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol) } } if(bFirst == Standard_False) { - Standard_Real pu1,pv1,pu2,pv2; + Standard_Real pu1 = NAN,pv1 = NAN,pu2 = NAN,pv2 = NAN; Standard_Boolean vtxfound = Standard_False; IntPatch_Point vtx; curv->Value(1).Parameters(pu1,pv1,pu2,pv2); @@ -796,7 +797,7 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol) indf = 1; } if(bLast == Standard_False) { - Standard_Real pu1,pv1,pu2,pv2; + Standard_Real pu1 = NAN,pv1 = NAN,pu2 = NAN,pv2 = NAN; Standard_Boolean vtxfound = Standard_False; IntPatch_Point vtx; curv->Value(nbponline).Parameters(pu1,pv1,pu2,pv2); @@ -1000,7 +1001,7 @@ void IntPatch_WLine::Dump(const Standard_Integer theMode) const printf("Num [X Y Z] [U1 V1] [U2 V2]\n"); for(Standard_Integer i=1; i<=aNbPoints; i++) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point(i).Parameters(u1,v1,u2,v2); printf("%4d [%+10.20f %+10.20f %+10.20f] [%+10.20f %+10.20f] [%+10.20f %+10.20f]\n", i,Point(i).Value().X(),Point(i).Value().Y(),Point(i).Value().Z(), @@ -1026,7 +1027,7 @@ void IntPatch_WLine::Dump(const Standard_Integer theMode) const case 1: for(Standard_Integer i = 1; i <= aNbPoints; i++) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point(i).Parameters(u1,v1,u2,v2); printf("point p%d %+10.20f %+10.20f %+10.20f\n", i,Point(i).Value().X(),Point(i).Value().Y(),Point(i).Value().Z()); @@ -1036,7 +1037,7 @@ void IntPatch_WLine::Dump(const Standard_Integer theMode) const case 2: for(Standard_Integer i = 1; i <= aNbPoints; i++) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point(i).Parameters(u1,v1,u2,v2); printf("point p%d %+10.20f %+10.20f\n", i, u1, v1); } @@ -1045,7 +1046,7 @@ void IntPatch_WLine::Dump(const Standard_Integer theMode) const default: for(Standard_Integer i = 1; i <= aNbPoints; i++) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; Point(i).Parameters(u1,v1,u2,v2); printf("point p%d %+10.20f %+10.20f\n", i, u2, v2); } diff --git a/src/IntPatch/IntPatch_WLine.hxx b/src/IntPatch/IntPatch_WLine.hxx index ccebfe4fec..784d041105 100644 --- a/src/IntPatch/IntPatch_WLine.hxx +++ b/src/IntPatch/IntPatch_WLine.hxx @@ -225,8 +225,8 @@ private: Handle(IntSurf_LineOn2S) curv; Standard_Boolean fipt; Standard_Boolean lapt; - Standard_Integer indf; - Standard_Integer indl; + Standard_Integer indf{}; + Standard_Integer indl{}; IntPatch_SequenceOfPoint svtx; Standard_Real u1period; Standard_Real v1period; diff --git a/src/IntPatch/IntPatch_WLineTool.cxx b/src/IntPatch/IntPatch_WLineTool.cxx index 9132bf33e0..8ac6ee873a 100644 --- a/src/IntPatch/IntPatch_WLineTool.cxx +++ b/src/IntPatch/IntPatch_WLineTool.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -73,7 +75,7 @@ static void FillPointsHash(const Handle(IntPatch_WLine) &theWLine, // 1 - Delete point. // 0 - Store point. // -1 - Vertex point (not delete). - Standard_Integer i, v; + Standard_Integer i = 0, v = 0; for(i = 1; i <= theWLine->NbPnts(); i++) thePointsHash.SetValue(i, 0); @@ -95,7 +97,7 @@ static Handle(IntPatch_WLine) MakeNewWLine(const Handle(IntPatch_WLine) NCollection_Array1 &thePointsHash, const Standard_Boolean theIsOuter) { - Standard_Integer i; + Standard_Integer i = 0; Handle(IntSurf_LineOn2S) aPurgedLineOn2S = new IntSurf_LineOn2S(); Handle(IntPatch_WLine) aLocalWLine = new IntPatch_WLine(aPurgedLineOn2S, Standard_False); @@ -219,7 +221,7 @@ static Handle(IntPatch_WLine) const Handle(Adaptor3d_TopolTool) &theDom1, const Handle(Adaptor3d_TopolTool) &theDom2) { - Standard_Integer i; + Standard_Integer i = 0; NCollection_Array1 aDelOuterPointsHash(1, theWLine->NbPnts()); FillPointsHash(theWLine, aDelOuterPointsHash); @@ -229,7 +231,7 @@ static Handle(IntPatch_WLine) return theWLine; gp_Pnt2d aPntOnF1, aPntOnF2; - Standard_Real aX1, aY1, aX2, aY2; + Standard_Real aX1 = NAN, aY1 = NAN, aX2 = NAN, aY2 = NAN; // Iterate over points in walking line and delete which are out of bounds. // Forward. @@ -314,7 +316,7 @@ static Handle(IntPatch_WLine) // Vertex geometry. IntPatch_Point aVertex = aLocalWLine->Vertex(1); aVertex.SetValue(theWLine->Point(aFirstGeomIdx).Value()); - Standard_Real aU1, aU2, aV1, aV2; + Standard_Real aU1 = NAN, aU2 = NAN, aV1 = NAN, aV2 = NAN; theWLine->Point(aFirstGeomIdx).Parameters(aU1, aV1, aU2, aV2); MovePoint(theS1, aU1, aV1); MovePoint(theS2, aU2, aV2); @@ -329,7 +331,7 @@ static Handle(IntPatch_WLine) // Vertex geometry. IntPatch_Point aVertex = aLocalWLine->Vertex(aLocalWLine->NbVertex()); aVertex.SetValue(theWLine->Point(aLastGeomIdx).Value()); - Standard_Real aU1, aU2, aV1, aV2; + Standard_Real aU1 = NAN, aU2 = NAN, aV1 = NAN, aV2 = NAN; theWLine->Point(aLastGeomIdx).Parameters(aU1, aV1, aU2, aV2); MovePoint(theS1, aU1, aV1); MovePoint(theS2, aU2, aV2); @@ -421,7 +423,7 @@ static Handle(IntPatch_WLine) // III: Check points for tube criteria: // Workaround to handle case of small amount points after purge. // Test "boolean boptuc_complex B5" and similar. - Standard_Integer aNbPnt = 0 , i; + Standard_Integer aNbPnt = 0 , i = 0; if (theWLine->NbPnts() <= 2) return theWLine; @@ -1373,7 +1375,7 @@ Handle(IntPatch_WLine) IntPatch_WLineTool:: const Handle(Adaptor3d_TopolTool) &theDom1, const Handle(Adaptor3d_TopolTool) &theDom2) { - Standard_Integer i, k, v, nb, nbvtx; + Standard_Integer i = 0, k = 0, v = 0, nb = 0, nbvtx = 0; Handle(IntPatch_WLine) aResult; nbvtx = theWLine->NbVertex(); nb = theWLine->NbPnts(); @@ -1726,7 +1728,7 @@ static Standard_Boolean IsNeedSkipWL(const Handle(IntPatch_WLine)& theWL, const Bnd_Box2d& theBoxS2, const Standard_Real* const theArrPeriods) { - Standard_Real aFirstp, aLastp; + Standard_Real aFirstp = NAN, aLastp = NAN; Standard_Integer aNbVtx = theWL->NbVertex(); Standard_Boolean isNeedSkip = Standard_True; @@ -1734,7 +1736,7 @@ static Standard_Boolean IsNeedSkipWL(const Handle(IntPatch_WLine)& theWL, aFirstp = theWL->Vertex (i).ParameterOnLine(); aLastp = theWL->Vertex (i + 1).ParameterOnLine(); - Standard_Real aU1, aV1, aU2, aV2; + Standard_Real aU1 = NAN, aV1 = NAN, aU2 = NAN, aV2 = NAN; const Standard_Integer pmid = (Standard_Integer)((aFirstp + aLastp) / 2); const IntSurf_PntOn2S& aPmid = theWL->Point (pmid); aPmid.Parameters (aU1, aV1, aU2, aV2); diff --git a/src/IntPolyh/IntPolyh_Intersection.cxx b/src/IntPolyh/IntPolyh_Intersection.cxx index 0c8b2d59cd..3c9215f8a3 100644 --- a/src/IntPolyh/IntPolyh_Intersection.cxx +++ b/src/IntPolyh/IntPolyh_Intersection.cxx @@ -36,16 +36,16 @@ static Standard_Integer ComputeIntersection(IntPolyh_PMaillageAffinage& theMaill //purpose : //======================================================================= IntPolyh_Intersection::IntPolyh_Intersection(const Handle(Adaptor3d_Surface)& theS1, - const Handle(Adaptor3d_Surface)& theS2) + const Handle(Adaptor3d_Surface)& theS2) : mySurf1(theS1), mySurf2(theS2), myNbSU1(10), myNbSV1(10), myNbSU2(10), myNbSV2(10), myIsDone(Standard_False), myIsParallel(Standard_False) { - mySurf1 = theS1; - mySurf2 = theS2; - myNbSU1 = 10; - myNbSV1 = 10; - myNbSU2 = 10; - myNbSV2 = 10; - myIsDone = Standard_False; - myIsParallel = Standard_False; + + + + + + + + mySectionLines.Init(1000); myTangentZones.Init(10000); Perform(); @@ -60,16 +60,16 @@ IntPolyh_Intersection::IntPolyh_Intersection(const Handle(Adaptor3d_Surface)& th const Standard_Integer theNbSV1, const Handle(Adaptor3d_Surface)& theS2, const Standard_Integer theNbSU2, - const Standard_Integer theNbSV2) + const Standard_Integer theNbSV2) : mySurf1(theS1), mySurf2(theS2), myNbSU1(theNbSU1), myNbSV1(theNbSV1), myNbSU2(theNbSU2), myNbSV2(theNbSV2), myIsDone(Standard_False), myIsParallel(Standard_False) { - mySurf1 = theS1; - mySurf2 = theS2; - myNbSU1 = theNbSU1; - myNbSV1 = theNbSV1; - myNbSU2 = theNbSU2; - myNbSV2 = theNbSV2; - myIsDone = Standard_False; - myIsParallel = Standard_False; + + + + + + + + mySectionLines.Init(1000); myTangentZones.Init(10000); Perform(); @@ -84,16 +84,16 @@ IntPolyh_Intersection::IntPolyh_Intersection(const Handle(Adaptor3d_Surface)& th const TColStd_Array1OfReal& theVPars1, const Handle(Adaptor3d_Surface)& theS2, const TColStd_Array1OfReal& theUPars2, - const TColStd_Array1OfReal& theVPars2) + const TColStd_Array1OfReal& theVPars2) : mySurf1(theS1), mySurf2(theS2), myNbSU1(theUPars1.Length()), myNbSV1(theVPars1.Length()), myNbSU2(theUPars2.Length()), myNbSV2(theVPars2.Length()), myIsDone(Standard_False), myIsParallel(Standard_False) { - mySurf1 = theS1; - mySurf2 = theS2; - myNbSU1 = theUPars1.Length(); - myNbSV1 = theVPars1.Length(); - myNbSU2 = theUPars2.Length(); - myNbSV2 = theVPars2.Length(); - myIsDone = Standard_False; - myIsParallel = Standard_False; + + + + + + + + mySectionLines.Init(1000); myTangentZones.Init(10000); Perform(theUPars1, theVPars1, theUPars2, theVPars2); @@ -358,7 +358,7 @@ Standard_Boolean IntPolyh_Intersection::PerformMaillage(const TColStd_Array1OfRe if (FinTTC == 0) { // Check if enlarge for the surfaces is possible - Standard_Boolean isEnlargeU1, isEnlargeV1, isEnlargeU2, isEnlargeV2; + Standard_Boolean isEnlargeU1 = 0, isEnlargeV1 = 0, isEnlargeU2 = 0, isEnlargeV2 = 0; IntPolyh_Tools::IsEnlargePossible(mySurf1, isEnlargeU1, isEnlargeV1); IntPolyh_Tools::IsEnlargePossible(mySurf2, isEnlargeU2, isEnlargeV2); diff --git a/src/IntPolyh/IntPolyh_MaillageAffinage.cxx b/src/IntPolyh/IntPolyh_MaillageAffinage.cxx index 1e2300416b..532af0662b 100644 --- a/src/IntPolyh/IntPolyh_MaillageAffinage.cxx +++ b/src/IntPolyh/IntPolyh_MaillageAffinage.cxx @@ -23,6 +23,8 @@ // Modified by skv - Thu Sep 25 17:42:42 2003 OCC567 // modified by ofv Thu Apr 8 14:58:13 2004 fip +#include + #include #include #include @@ -170,7 +172,7 @@ public: {} //! Rejects the node - virtual Standard_Boolean RejectNode (const BVH_Vec3d& theCMin1, + Standard_Boolean RejectNode (const BVH_Vec3d& theCMin1, const BVH_Vec3d& theCMax1, const BVH_Vec3d& theCMin2, const BVH_Vec3d& theCMax2, @@ -180,7 +182,7 @@ public: } //! Accepts the element - virtual Standard_Boolean Accept (const Standard_Integer theID1, + Standard_Boolean Accept (const Standard_Integer theID1, const Standard_Integer theID2) Standard_OVERRIDE { if (!myBVHSet1->Box (theID1).IsOut (myBVHSet2->Box (theID2))) @@ -371,10 +373,10 @@ void IntPolyh_MaillageAffinage::FillArrayOfPnt const TColStd_Array1OfReal& Vpars, const Standard_Real *theDeflTol) { - Standard_Boolean bDegI, bDeg; - Standard_Integer aNbU, aNbV, iCnt, i, j; - Standard_Integer aID1, aID2, aJD1, aJD2; - Standard_Real aTol, aU, aV, aX, aY, aZ; + Standard_Boolean bDegI = 0, bDeg = 0; + Standard_Integer aNbU = 0, aNbV = 0, iCnt = 0, i = 0, j = 0; + Standard_Integer aID1 = 0, aID2 = 0, aJD1 = 0, aJD2 = 0; + Standard_Real aTol = NAN, aU = NAN, aV = NAN, aX = NAN, aY = NAN, aZ = NAN; gp_Pnt aP; // aNbU=(SurfID==1)? NbSamplesU1 : NbSamplesU2; @@ -418,7 +420,7 @@ void IntPolyh_MaillageAffinage::FillArrayOfPnt aTol = !theDeflTol ? IntPolyh_Tools::ComputeDeflection(aS, Upars, Vpars) : *theDeflTol; aTol *= 1.2; - Standard_Real a1,a2,a3,b1,b2,b3; + Standard_Real a1 = NAN,a2 = NAN,a3 = NAN,b1 = NAN,b2 = NAN,b3 = NAN; // aBox.Get(a1,a2,a3,b1,b2,b3); aBox.Update(a1-aTol,a2-aTol,a3-aTol,b1+aTol,b2+aTol,b3+aTol); @@ -447,9 +449,9 @@ void IntPolyh_MaillageAffinage::FillArrayOfPnt(const Standard_Integer SurfID, if (!(aJD1 || aJD2)) DegeneratedIndex(theUPars, aNbU, aS, 2, aID1, aID2); - Standard_Boolean bDegI, bDeg; - Standard_Integer iCnt(0), i, j; - Standard_Real aX, aY, aZ, aU, aV; + Standard_Boolean bDegI = 0, bDeg = 0; + Standard_Integer iCnt(0), i = 0, j = 0; + Standard_Real aX = NAN, aY = NAN, aZ = NAN, aU = NAN, aV = NAN; TPoints.Init(thePointsNorm.NbItems()); @@ -483,7 +485,7 @@ void IntPolyh_MaillageAffinage::FillArrayOfPnt(const Standard_Integer SurfID, // Update box Standard_Real Tol = theDeflTol*1.2; - Standard_Real a1,a2,a3,b1,b2,b3; + Standard_Real a1 = NAN,a2 = NAN,a3 = NAN,b1 = NAN,b2 = NAN,b3 = NAN; aBox.Get(a1,a2,a3,b1,b2,b3); aBox.Update(a1-Tol,a2-Tol,a3-Tol,b1+Tol,b2+Tol,b3+Tol); aBox.Enlarge(MyTolerance); @@ -518,7 +520,7 @@ void IntPolyh_MaillageAffinage::FillArrayOfPnt //======================================================================= void IntPolyh_MaillageAffinage::CommonBox() { - Standard_Real XMin, YMin, ZMin, XMax, YMax, ZMax; + Standard_Real XMin = NAN, YMin = NAN, ZMin = NAN, XMax = NAN, YMax = NAN, ZMax = NAN; CommonBox(GetBox(1), GetBox(2), XMin, YMin, ZMin, XMax, YMax, ZMax); } @@ -539,8 +541,8 @@ void IntPolyh_MaillageAffinage::CommonBox (const Bnd_Box &, Standard_Real &YMax, Standard_Real &ZMax) { - Standard_Real x10,y10,z10,x11,y11,z11; - Standard_Real x20,y20,z20,x21,y21,z21; + Standard_Real x10 = NAN,y10 = NAN,z10 = NAN,x11 = NAN,y11 = NAN,z11 = NAN; + Standard_Real x20 = NAN,y20 = NAN,z20 = NAN,x21 = NAN,y21 = NAN,z21 = NAN; MyBox1.Get(x10,y10,z10,x11,y11,z11); MyBox2.Get(x20,y20,z20,x21,y21,z21); @@ -567,7 +569,7 @@ void IntPolyh_MaillageAffinage::CommonBox (const Bnd_Box &, } } // - Standard_Real X,Y,Z; + Standard_Real X = NAN,Y = NAN,Z = NAN; X=XMax-XMin; Y=YMax-YMin; Z=ZMax-ZMin; @@ -596,10 +598,10 @@ void IntPolyh_MaillageAffinage::CommonBox (const Bnd_Box &, //Marking of points included in the common const Standard_Integer FinTP1 = TPoints1.NbItems(); // for(Standard_Integer i=0; i FlecheMax1) { return; } @@ -1113,7 +1115,7 @@ void IntPolyh_MaillageAffinage::TrianglesDeflectionsRefinementBSB() ComputeDeflections(2); //-- Check arrows at output - Standard_Real FlecheCritique2; + Standard_Real FlecheCritique2 = NAN; if (FlecheMin2 > FlecheMax2) { return; } @@ -1125,8 +1127,8 @@ void IntPolyh_MaillageAffinage::TrianglesDeflectionsRefinementBSB() // The greatest of two bounding boxes created in FillArrayOfPoints is found. // Then this value is weighted depending on the discretization // (NbSamplesU and NbSamplesV) - Standard_Real diag1, diag2; - Standard_Real x0, y0, z0, x1, y1, z1; + Standard_Real diag1 = NAN, diag2 = NAN; + Standard_Real x0 = NAN, y0 = NAN, z0 = NAN, x1 = NAN, y1 = NAN, z1 = NAN; MyBox1.Get(x0, y0, z0, x1, y1, z1); x0 -= x1; y0 -= y1; z0 -= z1; @@ -1438,7 +1440,7 @@ Standard_Integer IntPolyh_MaillageAffinage::StartingPointsResearch nn1.Cross(e1, e2); //normal to the first triangle mm1.Cross(f1, f2); //normal to the second triangle - Standard_Real nn1modulus, mm1modulus; + Standard_Real nn1modulus = NAN, mm1modulus = NAN; nn1modulus=sqrt(nn1.SquareModulus()); mm1modulus=sqrt(mm1.SquareModulus()); @@ -1561,7 +1563,7 @@ Standard_Integer IntPolyh_MaillageAffinage::NextStartingPointsResearch nn1.Cross(e1, e2); //normal to the first triangle mm1.Cross(f1, f2); //normal to the second triangle - Standard_Real nn1modulus, mm1modulus; + Standard_Real nn1modulus = NAN, mm1modulus = NAN; nn1modulus=sqrt(nn1.SquareModulus()); mm1modulus=sqrt(mm1.SquareModulus()); @@ -1666,7 +1668,7 @@ void CalculPtsInterTriEdgeCoplanaires(const Standard_Integer TriSurfID, IntPolyh_StartPoint &SP2, Standard_Integer &NbPoints) { - Standard_Real aDE, aDC; + Standard_Real aDE = NAN, aDC = NAN; // gp_Vec aVE(Edge.X(), Edge.Y(), Edge.Z()); gp_Vec aVC(Cote.X(), Cote.Y(), Cote.Z()); @@ -2162,7 +2164,7 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact Standard_Real Cote23X=Cote23.X(); Standard_Real D1=0.0; - Standard_Real D3,D4; + Standard_Real D3 = NAN,D4 = NAN; //Combination Eq1 Eq2 if(Abs(Cote23X)>MyConfusionPrecision) { @@ -2351,7 +2353,7 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleCompare () Standard_Real CoupleAngle = -2.0; // // Intersection of the triangles - Standard_Integer i, aNb = aDMILI.Extent(); + Standard_Integer i = 0, aNb = aDMILI.Extent(); for (i = 1; i <= aNb; ++i) { const Standard_Integer i_S1 = aDMILI.FindKey(i); IntPolyh_Triangle &Triangle1 = TTriangles1[i_S1]; @@ -2419,7 +2421,7 @@ Standard_Boolean CheckCoupleAndGetAngle2(const Standard_Integer T1, ///T11 and T22 are two other triangles implied in the contact edge edge /// CT11 couple( T1,T22) and CT22 couple (T2,T11) /// these couples will be marked if there is a start point - Standard_Boolean Test1 , Test2, Test3; + Standard_Boolean Test1 = 0 , Test2 = 0, Test3 = 0; Test1 = Test2 = Test3 = Standard_False; // IntPolyh_ListIteratorOfListOfCouples aIt(TTrianglesContacts); @@ -2534,7 +2536,7 @@ Standard_Integer IntPolyh_MaillageAffinage::StartPointsChain MySectionLine.Init(10000);//Initialisation of array of StartPoint Standard_Integer NbPoints=-1; - Standard_Integer T1I, T2I; + Standard_Integer T1I = 0, T2I = 0; T1I = aCouple.FirstValue(); T2I = aCouple.SecondValue(); @@ -2600,7 +2602,7 @@ Standard_Integer IntPolyh_MaillageAffinage::StartPointsChain //chain of the other side IntPolyh_StartPoint SP12;//=SP1; if (SP1.E2()>=0) { //&&(SP1.E1()!=-1) already tested - Standard_Integer NextTriangle2; + Standard_Integer NextTriangle2 = 0; if (TEdges2[SP1.E2()].FirstTriangle()!=T2I) NextTriangle2=TEdges2[SP1.E2()].FirstTriangle(); else NextTriangle2=TEdges2[SP1.E2()].SecondTriangle(); @@ -2724,7 +2726,7 @@ Standard_Integer IntPolyh_MaillageAffinage::GetNextChainStartPoint Standard_Integer NbPoints=0; if( (SP.E1()>=0)&&(SP.E2()==-2) ) { //case if the point is on edge of T1 - Standard_Integer NextTriangle1; + Standard_Integer NextTriangle1 = 0; if (TEdges1[SP.E1()].FirstTriangle()!=SP.T1()) NextTriangle1=TEdges1[SP.E1()].FirstTriangle(); else NextTriangle1=TEdges1[SP.E1()].SecondTriangle(); @@ -2747,7 +2749,7 @@ Standard_Integer IntPolyh_MaillageAffinage::GetNextChainStartPoint } else if( (SP.E1()==-2)&&(SP.E2()>=0) ) { //case if the point is on edge of T2 - Standard_Integer NextTriangle2; + Standard_Integer NextTriangle2 = 0; if (TEdges2[SP.E2()].FirstTriangle()!=SP.T2()) NextTriangle2=TEdges2[SP.E2()].FirstTriangle(); else NextTriangle2=TEdges2[SP.E2()].SecondTriangle(); @@ -2774,11 +2776,11 @@ Standard_Integer IntPolyh_MaillageAffinage::GetNextChainStartPoint } else if( (SP.E1()>=0)&&(SP.E2()>=0) ) { ///the point is located on two edges - Standard_Integer NextTriangle1; + Standard_Integer NextTriangle1 = 0; if (TEdges1[SP.E1()].FirstTriangle()!=SP.T1()) NextTriangle1=TEdges1[SP.E1()].FirstTriangle(); else NextTriangle1=TEdges1[SP.E1()].SecondTriangle(); - Standard_Integer NextTriangle2; + Standard_Integer NextTriangle2 = 0; if (TEdges2[SP.E2()].FirstTriangle()!=SP.T2()) NextTriangle2=TEdges2[SP.E2()].FirstTriangle(); else NextTriangle2=TEdges2[SP.E2()].SecondTriangle(); @@ -2912,9 +2914,9 @@ void DegeneratedIndex(const TColStd_Array1OfReal& aXpars, Standard_Integer& aI1, Standard_Integer& aI2) { - Standard_Integer i; - Standard_Boolean bDegX1, bDegX2; - Standard_Real aDegX1, aDegX2, aTol2, aX; + Standard_Integer i = 0; + Standard_Boolean bDegX1 = 0, bDegX2 = 0; + Standard_Real aDegX1 = NAN, aDegX2 = NAN, aTol2 = NAN, aX = NAN; // aI1=0; aI2=0; @@ -2959,9 +2961,9 @@ Standard_Boolean IsDegenerated(const Handle(Adaptor3d_Surface)& aS, const Standard_Real aTol2, Standard_Real& aDegX) { - Standard_Boolean bRet; - Standard_Integer i, aNbP; - Standard_Real aU, dU, aU1, aU2, aV, dV, aV1, aV2, aD2; + Standard_Boolean bRet = 0; + Standard_Integer i = 0, aNbP = 0; + Standard_Real aU = NAN, dU = NAN, aU1 = NAN, aU2 = NAN, aV = NAN, dV = NAN, aV1 = NAN, aV2 = NAN, aD2 = NAN; gp_Pnt aP1, aP2; // bRet=Standard_False; diff --git a/src/IntPolyh/IntPolyh_StartPoint.cxx b/src/IntPolyh/IntPolyh_StartPoint.cxx index 91136a8e6b..08fa311fa0 100644 --- a/src/IntPolyh/IntPolyh_StartPoint.cxx +++ b/src/IntPolyh/IntPolyh_StartPoint.cxx @@ -40,13 +40,13 @@ IntPolyh_StartPoint::IntPolyh_StartPoint(const Standard_Real _x, const Standard_Integer _t2, const Standard_Integer _e2, const Standard_Real _lambda2, - const Standard_Integer _chainlist):angle(-2.0) { - x=_x; y=_y; z=_z; - u1=_u1; v1=_v1; - u2=_u2; v2=_v2; - t1=_t1; e1=_e1; lambda1=_lambda1; - t2=_t2; e2=_e2; lambda2=_lambda2; - chainlist=_chainlist; + const Standard_Integer _chainlist):x(_x), y(_y), z(_z), u1(_u1), v1(_v1), u2(_u2), v2(_v2), lambda1(_lambda1), lambda2(_lambda2), angle(-2.0), t1(_t1), e1(_e1), t2(_t2), e2(_e2), chainlist(_chainlist) { + + + + + + } Standard_Real IntPolyh_StartPoint::X() const { return(x); } @@ -69,7 +69,7 @@ Standard_Integer IntPolyh_StartPoint::GetEdgePoints(const IntPolyh_Triangle &Tri Standard_Integer &FirstEdgePoint, Standard_Integer &SecondEdgePoint, Standard_Integer &LastPoint) const { - Standard_Integer SurfID; + Standard_Integer SurfID = 0; if(e1!=-1) { if(e1==1) { FirstEdgePoint = Triangle.FirstPoint(); SecondEdgePoint = Triangle.SecondPoint(); LastPoint = Triangle.ThirdPoint(); } diff --git a/src/IntPolyh/IntPolyh_Tools.cxx b/src/IntPolyh/IntPolyh_Tools.cxx index 6d2ce1e0cc..684ba300a0 100644 --- a/src/IntPolyh/IntPolyh_Tools.cxx +++ b/src/IntPolyh/IntPolyh_Tools.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -68,7 +70,7 @@ static void EnlargeZone(const Handle(Adaptor3d_Surface)& theSurf, Standard_Real &v0, Standard_Real &v1) { - Standard_Boolean isToEnlargeU, isToEnlargeV; + Standard_Boolean isToEnlargeU = 0, isToEnlargeV = 0; IntPolyh_Tools::IsEnlargePossible(theSurf, isToEnlargeU, isToEnlargeV); // Enlarge U if (isToEnlargeU) @@ -101,7 +103,7 @@ void IntPolyh_Tools::MakeSampling(const Handle(Adaptor3d_Surface)& theSurf, theUPars.Resize(1, theNbSU, Standard_False); theVPars.Resize(1, theNbSV, Standard_False); // - Standard_Real u0, u1, v0, v1; + Standard_Real u0 = NAN, u1 = NAN, v0 = NAN, v1 = NAN; u0 = theSurf->FirstUParameter(); u1 = theSurf->LastUParameter(); v0 = theSurf->FirstVParameter(); diff --git a/src/IntPolyh/IntPolyh_Triangle.cxx b/src/IntPolyh/IntPolyh_Triangle.cxx index 4e0aab33c3..959db95155 100644 --- a/src/IntPolyh/IntPolyh_Triangle.cxx +++ b/src/IntPolyh/IntPolyh_Triangle.cxx @@ -294,7 +294,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, (TPoints[FinTP]).Middle( MySurface,P1, P2); ///les nouveaux triangles - Standard_Integer T1,T2,T3,T4; + Standard_Integer T1 = 0,T2 = 0,T3 = 0,T4 = 0; T1=FinTT; NewTriangle(numP2,numP3,FinTP,TTriangles,MySurface,TPoints); @@ -323,7 +323,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, NewTriangle(numP3b,numP1,FinTP,TTriangles,MySurface,TPoints); ///On cree les nouveaux edges - Standard_Integer E1,E2,E3,E4; + Standard_Integer E1 = 0,E2 = 0,E3 = 0,E4 = 0; E1=FinTE; NewEdge(numP1,FinTP,T2,T4,TEdges); @@ -356,7 +356,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, } else { ///seulement deux nouveaux triangles //on cree les nouveaux edges avec T1 et T2 - Standard_Integer E1,E2,E3; + Standard_Integer E1 = 0,E2 = 0,E3 = 0; E1=FinTE; NewEdge(numP1,FinTP,T2,-1,TEdges); @@ -382,7 +382,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, (TPoints[FinTP]).Middle(MySurface, P2,P3); ///les nouveaux triangles - Standard_Integer T1,T2,T3,T4; + Standard_Integer T1 = 0,T2 = 0,T3 = 0,T4 = 0; T1=FinTT; NewTriangle(numP1,numP2,FinTP,TTriangles,MySurface,TPoints); @@ -411,7 +411,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, NewTriangle(numP1b,numP3,FinTP,TTriangles,MySurface,TPoints); ///Nouveaux Edges - Standard_Integer E1,E2,E3,E4; + Standard_Integer E1 = 0,E2 = 0,E3 = 0,E4 = 0; E1=FinTE; NewEdge(numP2,FinTP,T1,T3,TEdges); @@ -443,7 +443,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, } else { ///seulement deux nouveaux triangles ///Nouveaux Edges - Standard_Integer E1,E2,E3; + Standard_Integer E1 = 0,E2 = 0,E3 = 0; E1=FinTE; NewEdge(numP2,FinTP,T1,-1,TEdges); @@ -467,7 +467,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, const Standard_Integer FinTP = TPoints.NbItems(); (TPoints[FinTP]).Middle(MySurface, P3,P1); - Standard_Integer T1,T2,T3,T4; + Standard_Integer T1 = 0,T2 = 0,T3 = 0,T4 = 0; T1=FinTT; NewTriangle(numP1,numP2,FinTP,TTriangles,MySurface,TPoints); @@ -497,7 +497,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, NewTriangle(numP2b,numP3,FinTP,TTriangles,MySurface,TPoints); ///Nouveaux Edges - Standard_Integer E1,E2,E3,E4; + Standard_Integer E1 = 0,E2 = 0,E3 = 0,E4 = 0; E1=FinTE; NewEdge(numP2,FinTP,T1,T2,TEdges); @@ -529,7 +529,7 @@ void IntPolyh_Triangle::MiddleRefinement(const Standard_Integer NumTri, } else { ///seulement deux nouveaux triangles ///Nouveaux Edges - Standard_Integer E1,E2,E4; + Standard_Integer E1 = 0,E2 = 0,E4 = 0; E1=FinTE; NewEdge(numP2,FinTP,T1,T2,TEdges); diff --git a/src/IntRes2d/IntRes2d_Domain.hxx b/src/IntRes2d/IntRes2d_Domain.hxx index 634a9989f7..ac9ee021a3 100644 --- a/src/IntRes2d/IntRes2d_Domain.hxx +++ b/src/IntRes2d/IntRes2d_Domain.hxx @@ -129,15 +129,15 @@ private: - Standard_Integer status; - Standard_Real first_param; - Standard_Real last_param; - Standard_Real first_tol; - Standard_Real last_tol; + Standard_Integer status{}; + Standard_Real first_param{}; + Standard_Real last_param{}; + Standard_Real first_tol{}; + Standard_Real last_tol{}; gp_Pnt2d first_point; gp_Pnt2d last_point; - Standard_Real periodfirst; - Standard_Real periodlast; + Standard_Real periodfirst{}; + Standard_Real periodlast{}; }; diff --git a/src/IntRes2d/IntRes2d_Intersection.cxx b/src/IntRes2d/IntRes2d_Intersection.cxx index 1986ec78d8..d1b166abd0 100644 --- a/src/IntRes2d/IntRes2d_Intersection.cxx +++ b/src/IntRes2d/IntRes2d_Intersection.cxx @@ -97,7 +97,7 @@ void IntRes2d_Intersection::Insert(const IntRes2d_IntersectionPoint& Pnt) { } void IntRes2d_Intersection::SetValues(const IntRes2d_Intersection& Other) { - Standard_Integer i ; + Standard_Integer i = 0 ; if(Other.done) { lseg.Clear(); lpnt.Clear(); @@ -168,7 +168,7 @@ void IntRes2d_Intersection::Append( const IntRes2d_Intersection& Other if(Other.done) { //-- Verification of the Position of the IntersectionPoints Standard_Integer n=Other.lpnt.Length(); - Standard_Integer i ; + Standard_Integer i = 0 ; for( i=1; i<=n ; i++) { const IntRes2d_IntersectionPoint& P=Other.lpnt(i); diff --git a/src/IntSurf/IntSurf_LineOn2S.cxx b/src/IntSurf/IntSurf_LineOn2S.cxx index 2608c4eae5..6b6b249462 100644 --- a/src/IntSurf/IntSurf_LineOn2S.cxx +++ b/src/IntSurf/IntSurf_LineOn2S.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -33,7 +35,7 @@ Handle(IntSurf_LineOn2S) IntSurf_LineOn2S::Split (const Standard_Integer Index) IntSurf_SequenceOfPntOn2S SS; mySeq.Split(Index,SS); Handle(IntSurf_LineOn2S) NS = new IntSurf_LineOn2S (); - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer leng = SS.Length(); for (i=1; i<=leng; i++) { NS->Add(SS(i)); @@ -84,7 +86,7 @@ Standard_Boolean IntSurf_LineOn2S::IsOutBox(const gp_Pnt& Pxyz) gp_Pnt P = mySeq(i).Value(); myBxyz.Add(P); } - Standard_Real x0, y0, z0, x1, y1, z1; + Standard_Real x0 = NAN, y0 = NAN, z0 = NAN, x1 = NAN, y1 = NAN, z1 = NAN; myBxyz.Get(x0, y0, z0, x1, y1, z1); x1 -= x0; y1 -= y0; z1 -= z0; if (x1>y1) @@ -119,7 +121,7 @@ Standard_Boolean IntSurf_LineOn2S::IsOutSurf1Box(const gp_Pnt2d& P1uv) if (myBuv1.IsWhole()) { Standard_Integer n = NbPoints(); - Standard_Real pu1, pu2, pv1, pv2; + Standard_Real pu1 = NAN, pu2 = NAN, pv1 = NAN, pv2 = NAN; myBuv1.SetVoid(); for (Standard_Integer i = 1; i <= n; i++) { @@ -147,7 +149,7 @@ Standard_Boolean IntSurf_LineOn2S::IsOutSurf2Box(const gp_Pnt2d& P2uv) if (myBuv2.IsWhole()) { Standard_Integer n = NbPoints(); - Standard_Real pu1, pu2, pv1, pv2; + Standard_Real pu1 = NAN, pu2 = NAN, pv1 = NAN, pv2 = NAN; myBuv2.SetVoid(); for (Standard_Integer i = 1; i <= n; i++) { diff --git a/src/IntSurf/IntSurf_PathPoint.cxx b/src/IntSurf/IntSurf_PathPoint.cxx index e00db4fd3b..910c1817d8 100644 --- a/src/IntSurf/IntSurf_PathPoint.cxx +++ b/src/IntSurf/IntSurf_PathPoint.cxx @@ -27,9 +27,9 @@ IntSurf_PathPoint::IntSurf_PathPoint (): IntSurf_PathPoint::IntSurf_PathPoint (const gp_Pnt& P, const Standard_Real U, const Standard_Real V): - pt(P),ispass(Standard_True),istgt(Standard_True) + pt(P),ispass(Standard_True),istgt(Standard_True), sequv(new TColgp_HSequenceOfXY ()) { - sequv = new TColgp_HSequenceOfXY (); + sequv->Append(gp_XY(U,V)); } diff --git a/src/IntSurf/IntSurf_Quadric.cxx b/src/IntSurf/IntSurf_Quadric.cxx index 5dba23198d..882004967b 100644 --- a/src/IntSurf/IntSurf_Quadric.cxx +++ b/src/IntSurf/IntSurf_Quadric.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -32,52 +34,52 @@ IntSurf_Quadric::IntSurf_Quadric ():typ(GeomAbs_OtherSurface), } // ============================================================ IntSurf_Quadric::IntSurf_Quadric (const gp_Pln& P): - ax3(P.Position()),typ(GeomAbs_Plane) + ax3(P.Position()),typ(GeomAbs_Plane), ax3direc(ax3.Direct()) { - ax3direc = ax3.Direct(); + P.Coefficients(prm1,prm2,prm3,prm4); } // ============================================================ IntSurf_Quadric::IntSurf_Quadric (const gp_Cylinder& C): - ax3(C.Position()),lin(ax3.Axis()),typ(GeomAbs_Cylinder) + ax3(C.Position()),lin(ax3.Axis()),typ(GeomAbs_Cylinder), ax3direc(ax3.Direct()), prm1(C.Radius()) { prm2=prm3=prm4=0.0; - ax3direc=ax3.Direct(); - prm1=C.Radius(); + + } // ============================================================ IntSurf_Quadric::IntSurf_Quadric (const gp_Sphere& S): - ax3(S.Position()),lin(ax3.Axis()),typ(GeomAbs_Sphere) + ax3(S.Position()),lin(ax3.Axis()),typ(GeomAbs_Sphere), ax3direc(ax3.Direct()), prm1(S.Radius()) { prm2=prm3=prm4=0.0; - ax3direc = ax3.Direct(); - prm1=S.Radius(); + + } // ============================================================ IntSurf_Quadric::IntSurf_Quadric (const gp_Cone& C): - ax3(C.Position()),typ(GeomAbs_Cone) + ax3(C.Position()),typ(GeomAbs_Cone), ax3direc(ax3.Direct()), prm1(C.RefRadius()), prm2(C.SemiAngle()), prm3(Cos(prm2)), prm4(0.0) { - ax3direc = ax3.Direct(); + lin.SetPosition(ax3.Axis()); - prm1 = C.RefRadius(); - prm2 = C.SemiAngle(); - prm3 = Cos(prm2); - prm4 = 0.0; + + + + } // ============================================================ IntSurf_Quadric::IntSurf_Quadric (const gp_Torus& T): - ax3(T.Position()),typ(GeomAbs_Torus) + ax3(T.Position()),typ(GeomAbs_Torus), ax3direc(ax3.Direct()), prm1(T.MajorRadius()), prm2(T.MinorRadius()), prm3(0.0), prm4(0.0) { - ax3direc = ax3.Direct(); + lin.SetPosition(ax3.Axis()); - prm1 = T.MajorRadius(); - prm2 = T.MinorRadius(); - prm3 = 0.0; - prm4 = 0.0; + + + + } // ============================================================ void IntSurf_Quadric::SetValue (const gp_Pln& P) @@ -143,7 +145,7 @@ Standard_Real IntSurf_Quadric::Distance (const gp_Pnt& P) const { case GeomAbs_Cone: // cone { Standard_Real dist = lin.Distance(P); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V); gp_Pnt Pp = ElSLib::ConeValue(U,V,ax3,prm1,prm2); Standard_Real distp = lin.Distance(Pp); @@ -200,7 +202,7 @@ gp_Vec IntSurf_Quadric::Gradient (const gp_Pnt& P) const { break; case GeomAbs_Cone: // cone { - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V); gp_Pnt Pp = ElSLib::ConeValue(U,V,ax3,prm1,prm2); gp_Vec D1u,D1v; @@ -273,7 +275,7 @@ void IntSurf_Quadric::ValAndGrad (const gp_Pnt& P, case GeomAbs_Cone: { Standard_Real dist = lin.Distance(P); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; gp_Vec D1u,D1v; gp_Pnt Pp; ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V); @@ -473,7 +475,7 @@ gp_Vec IntSurf_Quadric::Normale (const gp_Pnt& P) const } case GeomAbs_Cone: { - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; ElSLib::ConeParameters(ax3,prm1,prm2,P,U,V); return Normale(U,V); } diff --git a/src/IntSurf/IntSurf_Quadric.hxx b/src/IntSurf/IntSurf_Quadric.hxx index 28374d715a..8e740d7f21 100644 --- a/src/IntSurf/IntSurf_Quadric.hxx +++ b/src/IntSurf/IntSurf_Quadric.hxx @@ -114,10 +114,10 @@ private: gp_Ax3 ax3; gp_Lin lin; GeomAbs_SurfaceType typ; - Standard_Real prm1; - Standard_Real prm2; - Standard_Real prm3; - Standard_Real prm4; + Standard_Real prm1{}; + Standard_Real prm2{}; + Standard_Real prm3{}; + Standard_Real prm4{}; Standard_Boolean ax3direc; diff --git a/src/IntTools/IntTools.cxx b/src/IntTools/IntTools.cxx index fd16f03e57..44b2751b2a 100644 --- a/src/IntTools/IntTools.cxx +++ b/src/IntTools/IntTools.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -51,7 +53,7 @@ return 0; } - Standard_Real t2; + Standard_Real t2 = NAN; gp_Pnt P1, P2, P3; t2=0.5*(t1+t3); @@ -96,9 +98,9 @@ Standard_Integer IntTools::PrepareArgs (BRepAdaptor_Curve& C, { TColStd_ListOfReal aPars; - Standard_Real dt, tCurrent, tNext, aR, anAbsDeflection; - Standard_Integer ip, i, j, aNbDeflectionPoints; - Standard_Boolean aRFlag; + Standard_Real dt = NAN, tCurrent = NAN, tNext = NAN, aR = NAN, anAbsDeflection = NAN; + Standard_Integer ip = 0, i = 0, j = 0, aNbDeflectionPoints = 0; + Standard_Boolean aRFlag = 0; GeomAbs_CurveType aCurveType; aCurveType=C.GetType(); @@ -183,7 +185,7 @@ Standard_Integer IntTools::PrepareArgs (BRepAdaptor_Curve& C, void IntTools::RemoveIdenticalRoots(IntTools_SequenceOfRoots& aSR, const Standard_Real anEpsT) { - Standard_Integer aNbRoots, j, k; + Standard_Integer aNbRoots = 0, j = 0, k = 0; Standard_Real anEpsT2=0.5*anEpsT; aNbRoots=aSR.Length(); for (j=1; j<=aNbRoots; j++) { @@ -215,7 +217,7 @@ namespace { void IntTools::SortRoots(IntTools_SequenceOfRoots& mySequenceOfRoots, const Standard_Real /*myEpsT*/) { - Standard_Integer j, aNbRoots; + Standard_Integer j = 0, aNbRoots = 0; aNbRoots=mySequenceOfRoots.Length(); @@ -238,8 +240,8 @@ namespace { void IntTools::FindRootStates(IntTools_SequenceOfRoots& mySequenceOfRoots, const Standard_Real myEpsNull) { - Standard_Integer aType, j, aNbRoots; - Standard_Real t1, t2, f1, f2, absf2; + Standard_Integer aType = 0, j = 0, aNbRoots = 0; + Standard_Real t1 = NAN, t2 = NAN, f1 = NAN, f2 = NAN, absf2 = NAN; aNbRoots=mySequenceOfRoots.Length(); @@ -309,7 +311,7 @@ namespace { const Handle(Geom_Curve)& aCurve, Standard_Real& aParameter) { - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; GeomAbs_CurveType aCurveType; aFirst=aCurve->FirstParameter(); diff --git a/src/IntTools/IntTools_BaseRangeSample.cxx b/src/IntTools/IntTools_BaseRangeSample.cxx index 45600377a3..174b3bf353 100644 --- a/src/IntTools/IntTools_BaseRangeSample.cxx +++ b/src/IntTools/IntTools_BaseRangeSample.cxx @@ -16,12 +16,12 @@ #include -IntTools_BaseRangeSample::IntTools_BaseRangeSample() +IntTools_BaseRangeSample::IntTools_BaseRangeSample() : myDepth(0) { - myDepth = 0; + } -IntTools_BaseRangeSample::IntTools_BaseRangeSample(const Standard_Integer theDepth) +IntTools_BaseRangeSample::IntTools_BaseRangeSample(const Standard_Integer theDepth) : myDepth(theDepth) { - myDepth = theDepth; + } diff --git a/src/IntTools/IntTools_BeanFaceIntersector.cxx b/src/IntTools/IntTools_BeanFaceIntersector.cxx index b5095096eb..a5865f2bf9 100644 --- a/src/IntTools/IntTools_BeanFaceIntersector.cxx +++ b/src/IntTools/IntTools_BeanFaceIntersector.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -114,11 +116,11 @@ myVMinParameter(0.), myVMaxParameter(0.), myBeanTolerance(0.), myFaceTolerance(0.), -myIsDone(Standard_False), +myCurveResolution(Precision::PConfusion()), myCriteria(Precision::Confusion()), myIsDone(Standard_False), myMinSqDistance(RealLast()) { - myCriteria = Precision::Confusion(); - myCurveResolution = Precision::PConfusion(); + + } @@ -176,7 +178,7 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Cur const Standard_Real theVMaxParameter, const Standard_Real theBeanTolerance, const Standard_Real theFaceTolerance) : - myFirstParameter(theFirstParOnCurve), + myCurve(theCurve), mySurface(theSurface), myFirstParameter(theFirstParOnCurve), myLastParameter(theLastParOnCurve), myUMinParameter(theUMinParameter), myUMaxParameter(theUMaxParameter), @@ -184,15 +186,15 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Cur myVMaxParameter(theVMaxParameter), myBeanTolerance(theBeanTolerance), myFaceTolerance(theFaceTolerance), - myIsDone(Standard_False), + myCriteria(myBeanTolerance + myFaceTolerance), myIsDone(Standard_False), myMinSqDistance(RealLast()) { - myCurve = theCurve; - myCriteria = myBeanTolerance + myFaceTolerance; + + myCurveResolution = myCurve.Resolution(myCriteria); - mySurface = theSurface; + myTrsfSurface = Handle(Geom_Surface)::DownCast(mySurface.Surface().Surface()->Transformed(mySurface.Trsf())); } @@ -606,7 +608,7 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection() solutionIsValid = Standard_False; // if(mySurface.IsUPeriodic()) { - Standard_Real aNewU, aUPeriod, aEps, du; + Standard_Real aNewU = NAN, aUPeriod = NAN, aEps = NAN, du = NAN; // aUPeriod = mySurface.UPeriod(); aEps = Epsilon(aUPeriod); @@ -623,7 +625,7 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection() solutionIsValid = Standard_False; // if(mySurface.IsVPeriodic()) { - Standard_Real aNewV, aVPeriod, aEps, dv; + Standard_Real aNewV = NAN, aVPeriod = NAN, aEps = NAN, dv = NAN; // aVPeriod = mySurface.VPeriod(); aEps = Epsilon(aVPeriod); @@ -811,9 +813,9 @@ void IntTools_BeanFaceIntersector::ComputeLinePlane() myIsDone = Standard_True; - Standard_Real A,B,C,D; - Standard_Real Al,Bl,Cl; - Standard_Real Dis,Direc; + Standard_Real A = NAN,B = NAN,C = NAN,D = NAN; + Standard_Real Al = NAN,Bl = NAN,Cl = NAN; + Standard_Real Dis = NAN,Direc = NAN; P.Coefficients(A,B,C,D); gp_Pnt Orig(L.Location()); @@ -861,14 +863,14 @@ void IntTools_BeanFaceIntersector::ComputeLinePlane() gp_Pnt pint(Orig.X()+t*Al, Orig.Y()+t*Bl, Orig.Z()+t*Cl); - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; ElSLib::Parameters(P, pint, u, v); if(myUMinParameter > u || u > myUMaxParameter || myVMinParameter > v || v > myVMaxParameter) { return; } // // compute correct range on the edge - Standard_Real anAngle, aDt; + Standard_Real anAngle = NAN, aDt = NAN; gp_Dir aDL, aDP; // aDL = L.Position().Direction(); @@ -893,7 +895,7 @@ void IntTools_BeanFaceIntersector::ComputeLinePlane() // ================================================================================== void IntTools_BeanFaceIntersector::ComputeUsingExtremum() { - Standard_Real Tol, af, al; + Standard_Real Tol = NAN, af = NAN, al = NAN; Tol = Precision::PConfusion(); Handle(Geom_Curve) aCurve = BRep_Tool::Curve (myCurve.Edge(), af, al); GeomAdaptor_Surface aGASurface (myTrsfSurface, @@ -942,7 +944,7 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum() myMinSqDistance = Min (myMinSqDistance, aSqDist); if (aSqDist < myCriteria * myCriteria) { - Standard_Real U1, V1, U2, V2; + Standard_Real U1 = NAN, V1 = NAN, U2 = NAN, V2 = NAN; Standard_Real adistance1 = Distance(anarg1, U1, V1); Standard_Real adistance2 = Distance(anarg2, U2, V2); Standard_Boolean validdistance1 = (adistance1 < myCriteria); @@ -1012,7 +1014,7 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum() Extrema_POnCurv p1; Extrema_POnSurf p2; anExtCS.Points (j, p1, p2); - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; p2.Parameter(U, V); Standard_Integer aNbRanges = myRangeManager.Length(); @@ -1896,7 +1898,7 @@ Standard_Boolean IntTools_BeanFaceIntersector::ComputeLocalized() { Extrema_POnSurf p2; p1 = anExtremaGen.PointOnCurve(j); p2 = anExtremaGen.PointOnSurface(j); - Standard_Real U, V, T; + Standard_Real U = NAN, V = NAN, T = NAN; T = p1.Parameter(); p2.Parameter(U, V); @@ -1963,7 +1965,7 @@ Standard_Boolean IntTools_BeanFaceIntersector::TestComputeCoinside() Standard_Integer i = 0; - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; if(Distance(cfp, U, V) > myCriteria) return Standard_False; @@ -2040,9 +2042,9 @@ void ComputeGridPoints const Standard_Real theTolerance, IntTools_SurfaceRangeLocalizeData &theSurfaceData) { - Standard_Integer i; - Standard_Integer j; - Standard_Integer k; + Standard_Integer i = 0; + Standard_Integer j = 0; + Standard_Integer k = 0; Standard_Integer aNbSamples[2] = { theSurf->UDegree(), theSurf->VDegree() }; Standard_Integer aNbKnots[2] = { theSurf->NbUKnots(), @@ -2053,7 +2055,7 @@ void ComputeGridPoints theSurf->UKnots(aKnotsU); theSurf->VKnots(aKnotsV); - Standard_Integer iLmI; + Standard_Integer iLmI = 0; Standard_Integer iMin[2] = { -1, -1 }; Standard_Integer iMax[2] = { -1, -1 }; Standard_Integer aNbGridPnts[2]; @@ -2121,7 +2123,7 @@ void ComputeGridPoints // Setting the first and last parameters. Standard_Integer iAbs = 1; - Standard_Real aMinPar; + Standard_Real aMinPar = NAN; Standard_Real aMaxPar = (j == 0) ? theLastU : theLastV; for (i = iMin[j]; i < iMax[j]; i++) { @@ -2167,8 +2169,8 @@ void ComputeGridPoints // Compute of grid points. gp_Pnt aPnt; - Standard_Real aParU; - Standard_Real aParV; + Standard_Real aParU = NAN; + Standard_Real aParV = NAN; gp_Vec aDU, aDV; Standard_Real du = 0, dv = 0; Standard_Boolean isCalcDefl = aNbGridPnts[0] < 30 && aNbGridPnts[1] < 30; @@ -2215,8 +2217,8 @@ void ComputeGridPoints Standard_Real aDef = 0.; if (isCalcDefl) { - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; - Standard_Real xmin1, ymin1, zmin1, xmax1, ymax1, zmax1; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; + Standard_Real xmin1 = NAN, ymin1 = NAN, zmin1 = NAN, xmax1 = NAN, ymax1 = NAN, zmax1 = NAN; aGridBox.Get(xmin, ymin, zmin, xmax, ymax, zmax); anExtBox.Get(xmin1, ymin1, zmin1, xmax1, ymax1, zmax1); Standard_Integer anExtCount = 0; @@ -2274,11 +2276,11 @@ void BuildBox(const Handle(Geom_BSplineSurface) &theSurf, IntTools_SurfaceRangeLocalizeData &theSurfaceData, Bnd_Box &theBox) { - Standard_Integer i; - Standard_Integer j; - Standard_Integer aNbUPnts; - Standard_Integer aNbVPnts; - Standard_Real aParam; + Standard_Integer i = 0; + Standard_Integer j = 0; + Standard_Integer aNbUPnts = 0; + Standard_Integer aNbVPnts = 0; + Standard_Real aParam = NAN; gp_Pnt aPnt; theSurfaceData.SetFrame(theFirstU, theLastU, theFirstV, theLastV); diff --git a/src/IntTools/IntTools_BeanFaceIntersector.hxx b/src/IntTools/IntTools_BeanFaceIntersector.hxx index 3660372f6b..13482f1a6d 100644 --- a/src/IntTools/IntTools_BeanFaceIntersector.hxx +++ b/src/IntTools/IntTools_BeanFaceIntersector.hxx @@ -175,10 +175,10 @@ private: Standard_Real myUMaxParameter; Standard_Real myVMinParameter; Standard_Real myVMaxParameter; - Standard_Real myBeanTolerance; - Standard_Real myFaceTolerance; - Standard_Real myCurveResolution; - Standard_Real myCriteria; + Standard_Real myBeanTolerance{}; + Standard_Real myFaceTolerance{}; + Standard_Real myCurveResolution{}; + Standard_Real myCriteria{}; GeomAPI_ProjectPointOnSurf myProjector; IntTools_MarkedRangeSet myRangeManager; Handle(IntTools_Context) myContext; diff --git a/src/IntTools/IntTools_CommonPrt.cxx b/src/IntTools/IntTools_CommonPrt.cxx index 4a2a88f7d6..7e23fb8cf6 100644 --- a/src/IntTools/IntTools_CommonPrt.cxx +++ b/src/IntTools/IntTools_CommonPrt.cxx @@ -26,7 +26,7 @@ IntTools_CommonPrt::IntTools_CommonPrt() : myType(TopAbs_SHAPE), - myAllNullFlag(Standard_False) + myVertPar1(0.), myVertPar2(0.), myAllNullFlag(Standard_False) { // @@ -34,8 +34,8 @@ IntTools_CommonPrt::IntTools_CommonPrt() myPnt2.SetCoord(0.,0.,0.); // // modified by NIZHNY-MKK Wed Jun 8 16:47:04 2005.BEGIN - myVertPar1 = 0.; - myVertPar2 = 0.; + + // modified by NIZHNY-MKK Wed Jun 8 16:47:07 2005.END } @@ -57,7 +57,7 @@ IntTools_CommonPrt::IntTools_CommonPrt() myPnt2(Other.myPnt2) // { - Standard_Integer i, aNb=Other.myRanges2.Length(); + Standard_Integer i = 0, aNb=Other.myRanges2.Length(); for (i=1; i<=aNb; i++) { myRanges2.Append(Other.myRanges2(i)); } @@ -79,7 +79,7 @@ IntTools_CommonPrt::IntTools_CommonPrt() myPnt1=Other.myPnt1; myPnt2=Other.myPnt2; // - Standard_Integer i, aNb=Other.myRanges2.Length(); + Standard_Integer i = 0, aNb=Other.myRanges2.Length(); for (i=1; i<=aNb; i++) { myRanges2.Append(Other.myRanges2(i)); } @@ -263,7 +263,7 @@ IntTools_CommonPrt::IntTools_CommonPrt() aCP.SetVertexParameter2(myVertPar2); IntTools_SequenceOfRanges aSeqRanges; - Standard_Integer i, aNb; + Standard_Integer i = 0, aNb = 0; aNb=myRanges2.Length(); for (i=1; i<=aNb; i++) { aCP.AppendRange2(myRanges2(i)); diff --git a/src/IntTools/IntTools_Context.cxx b/src/IntTools/IntTools_Context.cxx index 286bac96fc..4b305bee73 100644 --- a/src/IntTools/IntTools_Context.cxx +++ b/src/IntTools/IntTools_Context.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -225,7 +227,7 @@ IntTools_FClass2d& IntTools_Context::FClass2d(const TopoDS_Face& aF) IntTools_FClass2d* pFClass2d = NULL; if (!myFClass2dMap.Find (aF, pFClass2d)) { - Standard_Real aTolF; + Standard_Real aTolF = NAN; TopoDS_Face aFF; // aFF=aF; @@ -249,7 +251,7 @@ GeomAPI_ProjectPointOnSurf& IntTools_Context::ProjPS(const TopoDS_Face& aF) GeomAPI_ProjectPointOnSurf* pProjPS = NULL; if (!myProjPSMap.Find (aF, pProjPS)) { - Standard_Real Umin, Usup, Vmin, Vsup; + Standard_Real Umin = NAN, Usup = NAN, Vmin = NAN, Vsup = NAN; UVBounds(aF, Umin, Usup, Vmin, Vsup); const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aF); // @@ -271,7 +273,7 @@ GeomAPI_ProjectPointOnCurve& IntTools_Context::ProjPC(const TopoDS_Edge& aE) GeomAPI_ProjectPointOnCurve* pProjPC = NULL; if (!myProjPCMap.Find (aE, pProjPC)) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; // Handle(Geom_Curve)aC3D=BRep_Tool::Curve (aE, f, l); // @@ -295,7 +297,7 @@ GeomAPI_ProjectPointOnCurve& IntTools_Context::ProjPT GeomAPI_ProjectPointOnCurve* pProjPT = NULL; if (!myProjPTMap.Find (aC3D, pProjPT)) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; f=aC3D->FirstParameter(); l=aC3D->LastParameter(); // @@ -354,8 +356,8 @@ Geom2dHatch_Hatcher& IntTools_Context::Hatcher(const TopoDS_Face& aF) Geom2dHatch_Hatcher* pHatcher = NULL; if (!myHatcherMap.Find (aF, pHatcher)) { - Standard_Real aTolArcIntr, aTolTangfIntr, aTolHatch2D, aTolHatch3D; - Standard_Real aU1, aU2, aEpsT; + Standard_Real aTolArcIntr = NAN, aTolTangfIntr = NAN, aTolHatch2D = NAN, aTolHatch3D = NAN; + Standard_Real aU1 = NAN, aU2 = NAN, aEpsT = NAN; TopAbs_Orientation aOrE; Handle(Geom_Surface) aS; Handle(Geom2d_Curve) aC2D; @@ -462,8 +464,8 @@ Standard_Integer IntTools_Context::ComputePE if (!BRep_Tool::IsGeometric(aE2)) { return -2; } - Standard_Real aTolE2, aTolSum; - Standard_Integer aNbProj; + Standard_Real aTolE2 = NAN, aTolSum = NAN; + Standard_Integer aNbProj = 0; // GeomAPI_ProjectPointOnCurve& aProjector=ProjPC(aE2); aProjector.Perform(aP1); @@ -526,8 +528,8 @@ Standard_Integer IntTools_Context::ComputeVE if (!BRep_Tool::IsGeometric(theE)) { return -2; } - Standard_Real aDist, aTolV, aTolE, aTolSum; - Standard_Integer aNbProj; + Standard_Real aDist = NAN, aTolV = NAN, aTolE = NAN, aTolSum = NAN; + Standard_Integer aNbProj = 0; gp_Pnt aP; // aP=BRep_Tool::Pnt(theV); @@ -565,7 +567,7 @@ Standard_Integer IntTools_Context::ComputeVF Standard_Real& theTol, const Standard_Real theFuzz) { - Standard_Real aTolV, aTolF, aTolSum, aDist; + Standard_Real aTolV = NAN, aTolF = NAN, aTolSum = NAN, aDist = NAN; gp_Pnt aP; aP = BRep_Tool::Pnt(theVertex); @@ -638,7 +640,7 @@ Standard_Boolean IntTools_Context::IsPointInFace const Standard_Real aTol) { Standard_Boolean bIn = Standard_False; - Standard_Real aDist; + Standard_Real aDist = NAN; // GeomAPI_ProjectPointOnSurf& aProjector=ProjPS(aF); aProjector.Perform(aP); @@ -647,7 +649,7 @@ Standard_Boolean IntTools_Context::IsPointInFace if (bDone) { aDist = aProjector.LowerDistance(); if (aDist < aTol) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; // aProjector.LowerDistanceParameters(U, V); gp_Pnt2d aP2D(U, V); @@ -679,8 +681,8 @@ Standard_Boolean IntTools_Context::IsValidPointForFace const TopoDS_Face& aF, const Standard_Real aTol) { - Standard_Boolean bFlag; - Standard_Real Umin, U, V; + Standard_Boolean bFlag = 0; + Standard_Real Umin = NAN, U = NAN, V = NAN; GeomAPI_ProjectPointOnSurf& aProjector=ProjPS(aF); aProjector.Perform(aP); @@ -710,7 +712,7 @@ Standard_Boolean IntTools_Context::IsValidPointForFaces const TopoDS_Face& aF2, const Standard_Real aTol) { - Standard_Boolean bFlag1, bFlag2; + Standard_Boolean bFlag1 = 0, bFlag2 = 0; bFlag1=IsValidPointForFace(aP, aF1, aTol); if (!bFlag1) { @@ -730,13 +732,13 @@ Standard_Boolean IntTools_Context::IsValidBlockForFace const TopoDS_Face& aF, const Standard_Real aTol) { - Standard_Boolean bFlag; - Standard_Real aTInterm; + Standard_Boolean bFlag = 0; + Standard_Real aTInterm = NAN; gp_Pnt aPInterm; aTInterm=IntTools_Tools::IntermediatePoint(aT1, aT2); - Handle(Geom_Curve) aC3D=aC.Curve(); + const Handle(Geom_Curve)& aC3D=aC.Curve(); // point 3D aC3D->D0(aTInterm, aPInterm); // @@ -796,8 +798,8 @@ Standard_Boolean IntTools_Context::IsVertexOnLine const Standard_Real aTolC, Standard_Real& aT) { - Standard_Boolean bRet; - Standard_Real aTolV; + Standard_Boolean bRet = 0; + Standard_Real aTolV = NAN; // aTolV=BRep_Tool::Tolerance(aV); bRet=IntTools_Context::IsVertexOnLine(aV, aTolV, aC, aTolC , aT); @@ -815,13 +817,13 @@ Standard_Boolean IntTools_Context::IsVertexOnLine const Standard_Real aTolC, Standard_Real& aT) { - Standard_Real aFirst, aLast, aDist, aTolSum; - Standard_Integer aNbProj; + Standard_Real aFirst = NAN, aLast = NAN, aDist = NAN, aTolSum = NAN; + Standard_Integer aNbProj = 0; gp_Pnt aPv; aPv=BRep_Tool::Pnt(aV); - Handle(Geom_Curve) aC3D=aC.Curve(); + const Handle(Geom_Curve)& aC3D=aC.Curve(); aTolSum=aTolV+aTolC; @@ -1006,7 +1008,7 @@ Standard_Boolean IntTools_Context::ProjectPointOnEdge const TopoDS_Edge& anEdge, Standard_Real& aT) { - Standard_Integer aNbPoints; + Standard_Integer aNbPoints = 0; GeomAPI_ProjectPointOnCurve& aProjector=ProjPC(anEdge); aProjector.Perform(aP); diff --git a/src/IntTools/IntTools_CurveRangeLocalizeData.cxx b/src/IntTools/IntTools_CurveRangeLocalizeData.cxx index 20fc8a2781..7f86df281e 100644 --- a/src/IntTools/IntTools_CurveRangeLocalizeData.cxx +++ b/src/IntTools/IntTools_CurveRangeLocalizeData.cxx @@ -20,10 +20,10 @@ #include IntTools_CurveRangeLocalizeData::IntTools_CurveRangeLocalizeData(const Standard_Integer theNbSample, - const Standard_Real theMinRange) + const Standard_Real theMinRange) : myNbSampleC(theNbSample), myMinRangeC(theMinRange) { - myNbSampleC = theNbSample; - myMinRangeC = theMinRange; + + } void IntTools_CurveRangeLocalizeData::AddOutRange(const IntTools_CurveRangeSample& theRange) diff --git a/src/IntTools/IntTools_CurveRangeSample.cxx b/src/IntTools/IntTools_CurveRangeSample.cxx index 90c3ac3c04..0276b5dad2 100644 --- a/src/IntTools/IntTools_CurveRangeSample.cxx +++ b/src/IntTools/IntTools_CurveRangeSample.cxx @@ -17,14 +17,14 @@ #include #include -IntTools_CurveRangeSample::IntTools_CurveRangeSample() +IntTools_CurveRangeSample::IntTools_CurveRangeSample() : myIndex(0) { - myIndex = 0; + } -IntTools_CurveRangeSample::IntTools_CurveRangeSample(const Standard_Integer theIndex) +IntTools_CurveRangeSample::IntTools_CurveRangeSample(const Standard_Integer theIndex) : myIndex(theIndex) { - myIndex = theIndex; + } IntTools_Range IntTools_CurveRangeSample::GetRange(const Standard_Real theFirst, diff --git a/src/IntTools/IntTools_EdgeEdge.cxx b/src/IntTools/IntTools_EdgeEdge.cxx index f5aa29374f..4ebc9711eb 100644 --- a/src/IntTools/IntTools_EdgeEdge.cxx +++ b/src/IntTools/IntTools_EdgeEdge.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -105,7 +107,7 @@ static void IntTools_EdgeEdge::Prepare() { GeomAbs_CurveType aCT1, aCT2; - Standard_Integer iCT1, iCT2; + Standard_Integer iCT1 = 0, iCT2 = 0; // myCurve1.Initialize(myEdge1); myCurve2.Initialize(myEdge2); @@ -129,7 +131,7 @@ void IntTools_EdgeEdge::Prepare() if (iCT1 == iCT2) { if (iCT1 != 0) { //compute deflection - Standard_Real aC1, aC2; + Standard_Real aC1 = NAN, aC2 = NAN; // aC2 = CurveDeflection(myCurve2, myRange2); aC1 = (aC2 > Precision::Confusion()) ? @@ -163,7 +165,7 @@ void IntTools_EdgeEdge::Prepare() myTol = myTol1 + myTol2; // if (iCT1 != 0 || iCT2 != 0) { - Standard_Real f, l, aTM; + Standard_Real f = NAN, l = NAN, aTM = NAN; // myGeom1 = BRep_Tool::Curve(myEdge1, f, l); myGeom2 = BRep_Tool::Curve(myEdge2, f, l); @@ -212,7 +214,7 @@ void IntTools_EdgeEdge::Perform() // if (myQuickCoincidenceCheck) { if (IsCoincident()) { - Standard_Real aT11, aT12, aT21, aT22; + Standard_Real aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN; // myRange1.Range(aT11, aT12); myRange2.Range(aT21, aT22); @@ -242,7 +244,7 @@ void IntTools_EdgeEdge::Perform() IntTools_SequenceOfRanges aRanges1, aRanges2; // //3.2. Find ranges containing solutions - Standard_Boolean bSplit2; + Standard_Boolean bSplit2 = 0; FindSolutions(aRanges1, aRanges2, bSplit2); // //4. Merge solutions and save common parts @@ -255,9 +257,9 @@ void IntTools_EdgeEdge::Perform() //======================================================================= Standard_Boolean IntTools_EdgeEdge::IsCoincident() { - Standard_Integer i, iCnt, aNbSeg, aNbP2; - Standard_Real dT, aT1, aCoeff, aTresh, aD; - Standard_Real aT11, aT12, aT21, aT22; + Standard_Integer i = 0, iCnt = 0, aNbSeg = 0, aNbP2 = 0; + Standard_Real dT = NAN, aT1 = NAN, aCoeff = NAN, aTresh = NAN, aD = NAN; + Standard_Real aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN; GeomAPI_ProjectPointOnCurve aProjPC; gp_Pnt aP1; // @@ -298,8 +300,8 @@ void IntTools_EdgeEdge::FindSolutions(IntTools_SequenceOfRanges& theRanges1, IntTools_SequenceOfRanges& theRanges2, Standard_Boolean& bSplit2) { - Standard_Boolean bIsClosed2; - Standard_Real aT11, aT12, aT21, aT22; + Standard_Boolean bIsClosed2 = 0; + Standard_Real aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN; Bnd_Box aB1, aB2; // bSplit2 = Standard_False; @@ -328,7 +330,7 @@ void IntTools_EdgeEdge::FindSolutions(IntTools_SequenceOfRanges& theRanges1, return; } // - Standard_Integer i, j, aNb1, aNb2; + Standard_Integer i = 0, j = 0, aNb1 = 0, aNb2 = 0; IntTools_SequenceOfRanges aSegments1, aSegments2; // aNb1 = IsClosed(myGeom1, aT11, aT12, myTol1, myRes1) ? 2 : 1; @@ -361,11 +363,11 @@ void IntTools_EdgeEdge::FindSolutions(const IntTools_Range& theR1, IntTools_SequenceOfRanges& theRanges1, IntTools_SequenceOfRanges& theRanges2) { - Standard_Boolean bOut, bStop, bThin; - Standard_Real aT11, aT12, aT21, aT22; - Standard_Real aTB11, aTB12, aTB21, aTB22; - Standard_Real aSmallStep1, aSmallStep2; - Standard_Integer iCom; + Standard_Boolean bOut = 0, bStop = 0, bThin = 0; + Standard_Real aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN; + Standard_Real aTB11 = NAN, aTB12 = NAN, aTB21 = NAN, aTB22 = NAN; + Standard_Real aSmallStep1 = NAN, aSmallStep2 = NAN; + Standard_Integer iCom = 0; Bnd_Box aB1, aB2; // theR1.Range(aT11, aT12); @@ -453,8 +455,8 @@ void IntTools_EdgeEdge::FindSolutions(const IntTools_Range& theR1, if (bThin) { if (iCom != 0) { //check intermediate points - Standard_Boolean bSol; - Standard_Real aT1; + Standard_Boolean bSol = 0; + Standard_Real aT1 = NAN; gp_Pnt aP1; GeomAPI_ProjectPointOnCurve aProjPC; // @@ -468,7 +470,7 @@ void IntTools_EdgeEdge::FindSolutions(const IntTools_Range& theR1, bSol = aProjPC.LowerDistance() <= myTol; } else { - Standard_Real aT2; + Standard_Real aT2 = NAN; gp_Pnt aP2; // aT2 = (aT21 + aT22) * .5; @@ -494,7 +496,7 @@ void IntTools_EdgeEdge::FindSolutions(const IntTools_Range& theR1, } // //split ranges on segments and repeat - Standard_Integer i, aNb1; + Standard_Integer i = 0, aNb1 = 0; IntTools_SequenceOfRanges aSegments1; // // Build box for first curve to compare @@ -529,10 +531,10 @@ Standard_Boolean IntTools_EdgeEdge::FindParameters(const BRepAdaptor_Curve& theB Standard_Real& aTB1, Standard_Real& aTB2) { - Standard_Boolean bRet; - Standard_Integer aC, i; - Standard_Real aCf, aDiff, aDt, aT, aTB, aTOut, aTIn; - Standard_Real aDist, aDistP; + Standard_Boolean bRet = 0; + Standard_Integer aC = 0, i = 0; + Standard_Real aCf = NAN, aDiff = NAN, aDt = NAN, aT = NAN, aTB = NAN, aTOut = NAN, aTIn = NAN; + Standard_Real aDist = NAN, aDistP = NAN; gp_Pnt aP; Bnd_Box aCBx; // @@ -632,13 +634,13 @@ void IntTools_EdgeEdge::MergeSolutions(const IntTools_SequenceOfRanges& theRange } // IntTools_Range aRi1, aRi2, aRj1, aRj2; - Standard_Boolean bCond; - Standard_Integer i, j; + Standard_Boolean bCond = 0; + Standard_Integer i = 0, j = 0; TopAbs_ShapeEnum aType; - Standard_Real aT11, aT12, aT21, aT22; - Standard_Real aTi11, aTi12, aTi21, aTi22; - Standard_Real aTj11, aTj12, aTj21, aTj22; - Standard_Real aRes1, aRes2, dTR1, dTR2; + Standard_Real aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN; + Standard_Real aTi11 = NAN, aTi12 = NAN, aTi21 = NAN, aTi22 = NAN; + Standard_Real aTj11 = NAN, aTj12 = NAN, aTj21 = NAN, aTj22 = NAN; + Standard_Real aRes1 = NAN, aRes2 = NAN, dTR1 = NAN, dTR2 = NAN; TColStd_MapOfInteger aMI; // aRes1 = Resolution(myCurve1.Curve().Curve(), @@ -744,7 +746,7 @@ void IntTools_EdgeEdge::AddSolution(const Standard_Real aT11, } // if (theType == TopAbs_VERTEX) { - Standard_Real aT1, aT2; + Standard_Real aT1 = NAN, aT2 = NAN; // FindBestSolution(aT11, aT12, aT21, aT22, aT1, aT2); // @@ -770,9 +772,9 @@ void IntTools_EdgeEdge::FindBestSolution(const Standard_Real aT11, Standard_Real& aT1, Standard_Real& aT2) { - Standard_Integer i, aNbS, iErr; - Standard_Real aDMin, aD, aRes1, aSolCriteria, aTouchCriteria; - Standard_Real aT1A, aT1B, aT1Min, aT2Min; + Standard_Integer i = 0, aNbS = 0, iErr = 0; + Standard_Real aDMin = NAN, aD = NAN, aRes1 = NAN, aSolCriteria = NAN, aTouchCriteria = NAN; + Standard_Real aT1A = NAN, aT1B = NAN, aT1Min = NAN, aT2Min = NAN; GeomAPI_ProjectPointOnCurve aProjPC; IntTools_SequenceOfRanges aRanges; // @@ -853,7 +855,7 @@ void IntTools_EdgeEdge::ComputeLineLine() return; } - Standard_Real aT11, aT12, aT21, aT22; + Standard_Real aT11 = NAN, aT12 = NAN, aT21 = NAN, aT22 = NAN; myRange1.Range (aT11, aT12); myRange2.Range (aT21, aT22); @@ -981,11 +983,11 @@ Standard_Boolean IntTools_EdgeEdge::IsIntersection(const Standard_Real aT11, const Standard_Real aT21, const Standard_Real aT22) { - Standard_Boolean bRet; + Standard_Boolean bRet = 0; gp_Pnt aP11, aP12, aP21, aP22; gp_Vec aV11, aV12, aV21, aV22; - Standard_Real aD11_21, aD11_22, aD12_21, aD12_22, aCriteria, aCoef; - Standard_Boolean bSmall_11_21, bSmall_11_22, bSmall_12_21, bSmall_12_22; + Standard_Real aD11_21 = NAN, aD11_22 = NAN, aD12_21 = NAN, aD12_22 = NAN, aCriteria = NAN, aCoef = NAN; + Standard_Boolean bSmall_11_21 = 0, bSmall_11_22 = 0, bSmall_12_21 = 0, bSmall_12_22 = 0; // bRet = Standard_True; aCoef = 1.e+5; @@ -1022,7 +1024,7 @@ Standard_Boolean IntTools_EdgeEdge::IsIntersection(const Standard_Real aT11, return bRet; } // - Standard_Real anAngleCriteria; + Standard_Real anAngleCriteria = NAN; Standard_Real anAngle1 = 0.0, anAngle2 = 0.0; // @@ -1044,8 +1046,8 @@ Standard_Boolean IntTools_EdgeEdge::IsIntersection(const Standard_Real aT11, if (((anAngle1 < anAngleCriteria) || ((M_PI - anAngle1) < anAngleCriteria)) || ((anAngle2 < anAngleCriteria) || ((M_PI - anAngle2) < anAngleCriteria))) { GeomAPI_ProjectPointOnCurve aProjPC; - Standard_Integer iErr; - Standard_Real aD, aT1Min, aT2Min; + Standard_Integer iErr = 0; + Standard_Real aD = NAN, aT1Min = NAN, aT2Min = NAN; // aD = Precision::Infinite(); aProjPC.Init(myGeom2, aT21, aT22); @@ -1068,8 +1070,8 @@ Standard_Integer IntTools_EdgeEdge::CheckCoincidence(const Standard_Real aT11, const Standard_Real theCriteria, const Standard_Real theCurveRes1) { - Standard_Integer iErr, aNb, aNb1, i; - Standard_Real aT1A, aT1B, aT1max, aT2max, aDmax; + Standard_Integer iErr = 0, aNb = 0, aNb1 = 0, i = 0; + Standard_Real aT1A = NAN, aT1B = NAN, aT1max = NAN, aT2max = NAN, aDmax = NAN; GeomAPI_ProjectPointOnCurve aProjPC; IntTools_SequenceOfRanges aRanges; // @@ -1129,8 +1131,8 @@ Standard_Integer FindDistPC(const Standard_Real aT1A, Standard_Real& aT2max, const Standard_Boolean bMaxDist) { - Standard_Integer iErr, iC; - Standard_Real aGS, aXP, aA, aB, aXL, aYP, aYL, aT2P, aT2L; + Standard_Integer iErr = 0, iC = 0; + Standard_Real aGS = NAN, aXP = NAN, aA = NAN, aB = NAN, aXL = NAN, aYP = NAN, aYL = NAN, aT2P = NAN, aT2L = NAN; // iC = bMaxDist ? 1 : -1; iErr = 0; @@ -1218,7 +1220,7 @@ Standard_Integer DistPC(const Standard_Real aT1, Standard_Real& aT2max, const Standard_Integer iC) { - Standard_Integer iErr; + Standard_Integer iErr = 0; // iErr = DistPC(aT1, theC1, theCriteria, theProjPC, aD, aT2, iC); if (iErr == 1) { @@ -1245,7 +1247,7 @@ Standard_Integer DistPC(const Standard_Real aT1, Standard_Real& aT2, const Standard_Integer iC) { - Standard_Integer iErr, aNbP2; + Standard_Integer iErr = 0, aNbP2 = 0; gp_Pnt aP1; // iErr = 0; @@ -1283,8 +1285,8 @@ Standard_Integer SplitRangeOnSegments(const Standard_Real aT1, return 1; } // - Standard_Real aDt, aT1x, aT2x, aSeg; - Standard_Integer aNbSegments, i; + Standard_Real aDt = NAN, aT1x = NAN, aT2x = NAN, aSeg = NAN; + Standard_Integer aNbSegments = 0, i = 0; // aNbSegments = theNbSeg; aDt = aDiff / aNbSegments; @@ -1334,8 +1336,8 @@ Standard_Real PointBoxDistance(const Bnd_Box& aB, { Standard_Real aPCoord[3]; Standard_Real aBMinCoord[3], aBMaxCoord[3]; - Standard_Real aDist, aR1, aR2; - Standard_Integer i; + Standard_Real aDist = NAN, aR1 = NAN, aR2 = NAN; + Standard_Integer i = 0; // aP.Coord(aPCoord[0], aPCoord[1], aPCoord[2]); aB.Get(aBMinCoord[0], aBMinCoord[1], aBMinCoord[2], @@ -1365,7 +1367,7 @@ Standard_Real PointBoxDistance(const Bnd_Box& aB, //======================================================================= Standard_Integer TypeToInteger(const GeomAbs_CurveType theCType) { - Standard_Integer iRet; + Standard_Integer iRet = 0; // switch(theCType) { case GeomAbs_Line: @@ -1430,8 +1432,8 @@ Standard_Real ResolutionCoeff(const BRepAdaptor_Curve& theBAC, case GeomAbs_Hyperbola : case GeomAbs_Parabola : case GeomAbs_OtherCurve :{ - Standard_Real k, kMin, aDist, aDt, aT1, aT2, aT; - Standard_Integer aNbP, i; + Standard_Real k = NAN, kMin = NAN, aDist = NAN, aDt = NAN, aT1 = NAN, aT2 = NAN, aT = NAN; + Standard_Integer aNbP = 0, i = 0; gp_Pnt aP1, aP2; // aNbP = 30; @@ -1471,7 +1473,7 @@ Standard_Real Resolution(const Handle(Geom_Curve)& theCurve, const Standard_Real theResCoeff, const Standard_Real theR3D) { - Standard_Real aRes; + Standard_Real aRes = NAN; // switch (theCurveType) { case GeomAbs_Line : @@ -1518,8 +1520,8 @@ Standard_Real Resolution(const Handle(Geom_Curve)& theCurve, Standard_Real CurveDeflection(const BRepAdaptor_Curve& theBAC, const IntTools_Range& theRange) { - Standard_Real aDt, aT, aT1, aT2, aDefl; - Standard_Integer i, aNbP; + Standard_Real aDt = NAN, aT = NAN, aT1 = NAN, aT2 = NAN, aDefl = NAN; + Standard_Integer i = 0, aNbP = 0; gp_Vec aV1, aV2; gp_Pnt aP; // diff --git a/src/IntTools/IntTools_EdgeFace.cxx b/src/IntTools/IntTools_EdgeFace.cxx index 7d4f236b6c..652532fc43 100644 --- a/src/IntTools/IntTools_EdgeFace.cxx +++ b/src/IntTools/IntTools_EdgeFace.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -53,13 +55,13 @@ static //function : IntTools_EdgeFace::IntTools_EdgeFace //purpose : //======================================================================= - IntTools_EdgeFace::IntTools_EdgeFace() + IntTools_EdgeFace::IntTools_EdgeFace() : myFuzzyValue(Precision::Confusion()), myIsDone(Standard_False), myErrorStatus(1), myQuickCoincidenceCheck(Standard_False), myMinDistance(RealLast()) { - myFuzzyValue = Precision::Confusion(); - myIsDone=Standard_False; - myErrorStatus=1; - myQuickCoincidenceCheck=Standard_False; - myMinDistance = RealLast(); + + + + + } //======================================================================= //function : IsCoincident @@ -67,8 +69,8 @@ static //======================================================================= Standard_Boolean IntTools_EdgeFace::IsCoincident() { - Standard_Integer i, iCnt; - Standard_Real dT, aT, aD, aT1, aT2, aU, aV; + Standard_Integer i = 0, iCnt = 0; + Standard_Real dT = NAN, aT = NAN, aD = NAN, aT1 = NAN, aT2 = NAN, aU = NAN, aV = NAN; gp_Pnt aP; TopAbs_State aState; @@ -172,7 +174,7 @@ void IntTools_EdgeFace::CheckData() Standard_Boolean IntTools_EdgeFace::IsProjectable (const Standard_Real aT) const { - Standard_Boolean bFlag; + Standard_Boolean bFlag = 0; gp_Pnt aPC; // myC.D0(aT, aPC); @@ -187,13 +189,13 @@ Standard_Boolean IntTools_EdgeFace::IsProjectable Standard_Real IntTools_EdgeFace::DistanceFunction (const Standard_Real t) { - Standard_Real aD; + Standard_Real aD = NAN; // gp_Pnt P; myC.D0(t, P); // - Standard_Boolean bIsEqDistance; + Standard_Boolean bIsEqDistance = 0; bIsEqDistance= IntTools_EdgeFace::IsEqDistance(P, myS, 1.e-7, aD); if (bIsEqDistance) { @@ -243,7 +245,7 @@ Standard_Boolean IntTools_EdgeFace::IsEqDistance gp_Cylinder aCyl=aBAS.Cylinder(); const gp_Ax1& anAx1 =aCyl.Axis(); gp_Lin aLinAxis(anAx1); - Standard_Real aDC, aRadius=aCyl.Radius(); + Standard_Real aDC = NAN, aRadius=aCyl.Radius(); aDC=aLinAxis.Distance(aP); if (aDC < aTol) { aD=aRadius; @@ -255,7 +257,7 @@ Standard_Boolean IntTools_EdgeFace::IsEqDistance gp_Cone aCone=aBAS.Cone(); const gp_Ax1& anAx1 =aCone.Axis(); gp_Lin aLinAxis(anAx1); - Standard_Real aDC, aRadius, aDS, aSemiAngle; + Standard_Real aDC = NAN, aRadius = NAN, aDS = NAN, aSemiAngle = NAN; aDC=aLinAxis.Distance(aP); if (aDC < aTol) { gp_Pnt anApex=aCone.Apex(); @@ -269,7 +271,7 @@ Standard_Boolean IntTools_EdgeFace::IsEqDistance } if (aSurfType==GeomAbs_Torus) { - Standard_Real aMajorRadius, aMinorRadius, aDC; + Standard_Real aMajorRadius = NAN, aMinorRadius = NAN, aDC = NAN; gp_Torus aTorus=aBAS.Torus(); gp_Pnt aPLoc=aTorus.Location(); @@ -292,9 +294,9 @@ Standard_Boolean IntTools_EdgeFace::IsEqDistance Standard_Integer IntTools_EdgeFace::MakeType (IntTools_CommonPrt& aCommonPrt) { - Standard_Real af1, al1; - Standard_Real df1, tm; - Standard_Boolean bAllNullFlag; + Standard_Real af1 = NAN, al1 = NAN; + Standard_Real df1 = NAN, tm = NAN; + Standard_Boolean bAllNullFlag = 0; // bAllNullFlag=aCommonPrt.AllNullFlag(); if (bAllNullFlag) { @@ -349,14 +351,14 @@ Standard_Boolean IntTools_EdgeFace::CheckTouch (const IntTools_CommonPrt& aCP, Standard_Real& aTx) { - Standard_Real aTF, aTL, Tol, U1f, U1l, V1f, V1l, af, al,aDist2, aMinDist2; + Standard_Real aTF = NAN, aTL = NAN, Tol = NAN, U1f = NAN, U1l = NAN, V1f = NAN, V1l = NAN, af = NAN, al = NAN,aDist2 = NAN, aMinDist2 = NAN; Standard_Boolean theflag=Standard_False; - Standard_Integer aNbExt, iLower; + Standard_Integer aNbExt = 0, iLower = 0; aCP.Range1(aTF, aTL); // - Standard_Real aCR; + Standard_Real aCR = NAN; aCR=myC.Resolution(myCriteria); if((Abs(aTF - myRange.First()) < aCR) && (Abs(aTL - myRange.Last()) < aCR)) { @@ -429,7 +431,7 @@ Standard_Boolean IntTools_EdgeFace::CheckTouch } } - Standard_Real aBoundaryDist; + Standard_Real aBoundaryDist = NAN; aBoundaryDist = DistanceFunction(aTF) + myCriteria; if(aBoundaryDist * aBoundaryDist < aDist2) { @@ -475,7 +477,7 @@ Standard_Boolean IntTools_EdgeFace::CheckTouch //======================================================================= void IntTools_EdgeFace::Perform() { - Standard_Integer i, aNb; + Standard_Integer i = 0, aNb = 0; IntTools_CommonPrt aCommonPrt; // aCommonPrt.SetEdge1(myEdge); @@ -554,7 +556,7 @@ void IntTools_EdgeFace::Perform() for (i=1; i<=aNb; i++) { IntTools_CommonPrt& aCP=mySeqOfCommonPrts.ChangeValue(i); // - Standard_Real aTx1, aTx2; + Standard_Real aTx1 = NAN, aTx2 = NAN; gp_Pnt aPx1, aPx2; // aCP.Range1(aTx1, aTx2); @@ -569,8 +571,8 @@ void IntTools_EdgeFace::Perform() GeomAbs_CurveType aCType; GeomAbs_SurfaceType aSType; TopAbs_ShapeEnum aType; - Standard_Boolean bIsTouch; - Standard_Real aTx; + Standard_Boolean bIsTouch = 0; + Standard_Real aTx = NAN; aCType=myC.GetType(); aSType=myS.GetType(); @@ -600,7 +602,7 @@ void IntTools_EdgeFace::Perform() // Circle\Plane's Common Parts treatment if (aCType==GeomAbs_Circle && aSType==GeomAbs_Plane) { - Standard_Boolean bIsCoplanar, bIsRadius; + Standard_Boolean bIsCoplanar = 0, bIsRadius = 0; bIsCoplanar=IsCoplanar(myC, myS); bIsRadius=IsRadius(myC, myS, myCriteria); if (!bIsCoplanar && !bIsRadius) { @@ -637,10 +639,10 @@ Standard_Boolean IntTools_EdgeFace::CheckTouchVertex (const IntTools_CommonPrt& aCP, Standard_Real& aTx) { - Standard_Real aTF, aTL, Tol, U1f,U1l,V1f,V1l; - Standard_Real aEpsT, af, al,aDist2, aMinDist2, aTm, aDist2New; + Standard_Real aTF = NAN, aTL = NAN, Tol = NAN, U1f = NAN,U1l = NAN,V1f = NAN,V1l = NAN; + Standard_Real aEpsT = NAN, af = NAN, al = NAN,aDist2 = NAN, aMinDist2 = NAN, aTm = NAN, aDist2New = NAN; Standard_Boolean theflag=Standard_False; - Standard_Integer aNbExt, i, iLower ; + Standard_Integer aNbExt = 0, i = 0, iLower = 0 ; GeomAbs_CurveType aType; // aCP.Range1(aTF, aTL); @@ -788,7 +790,7 @@ Standard_Integer AdaptiveDiscret (const Standard_Integer iDiscret, const BRepAdaptor_Curve& aCurve , const BRepAdaptor_Surface& aSurface) { - Standard_Integer iDiscretNew; + Standard_Integer iDiscretNew = 0; iDiscretNew=iDiscret; @@ -797,7 +799,7 @@ Standard_Integer AdaptiveDiscret (const Standard_Integer iDiscret, aSType=aSurface.GetType(); if (aSType==GeomAbs_Cylinder) { - Standard_Real aELength, aRadius, dLR; + Standard_Real aELength = NAN, aRadius = NAN, dLR = NAN; aELength=IntTools::Length(aCurve.Edge()); diff --git a/src/IntTools/IntTools_EdgeFace.hxx b/src/IntTools/IntTools_EdgeFace.hxx index 8ecf4f9467..2a04d96826 100644 --- a/src/IntTools/IntTools_EdgeFace.hxx +++ b/src/IntTools/IntTools_EdgeFace.hxx @@ -202,7 +202,7 @@ protected: Standard_Real myFuzzyValue; BRepAdaptor_Curve myC; BRepAdaptor_Surface myS; - Standard_Real myCriteria; + Standard_Real myCriteria{}; Standard_Boolean myIsDone; Standard_Integer myErrorStatus; Handle(IntTools_Context) myContext; diff --git a/src/IntTools/IntTools_FClass2d.cxx b/src/IntTools/IntTools_FClass2d.cxx index ab6d700a72..43a9de2469 100644 --- a/src/IntTools/IntTools_FClass2d.cxx +++ b/src/IntTools/IntTools_FClass2d.cxx @@ -44,6 +44,7 @@ #include #include +#include #include //#define DEBUG_PCLASS_POLYGON @@ -84,13 +85,13 @@ Standard_Boolean IntTools_FClass2d::IsHole() const void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const Standard_Real TolUV) { - Standard_Boolean WireIsNotEmpty, Ancienpnt3dinitialise, degenerated; - Standard_Integer firstpoint, NbEdges; - Standard_Integer iX, aNbs1, nbs, Avant, BadWire; - Standard_Real u, du, Tole, Tol, pfbid, plbid; - Standard_Real FlecheU, FlecheV, TolVertex1, TolVertex; - Standard_Real uFirst, uLast; - Standard_Real aPrCf, aPrCf2; + Standard_Boolean WireIsNotEmpty = 0, Ancienpnt3dinitialise = 0, degenerated = 0; + Standard_Integer firstpoint = 0, NbEdges = 0; + Standard_Integer iX = 0, aNbs1 = 0, nbs = 0, Avant = 0, BadWire = 0; + Standard_Real u = NAN, du = NAN, Tole = NAN, Tol = NAN, pfbid = NAN, plbid = NAN; + Standard_Real FlecheU = NAN, FlecheV = NAN, TolVertex1 = NAN, TolVertex = NAN; + Standard_Real uFirst = NAN, uLast = NAN; + Standard_Real aPrCf = NAN, aPrCf2 = NAN; // TopoDS_Edge edge; TopoDS_Vertex Va,Vb; @@ -265,9 +266,9 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, //-- afar from the last saved point Avant = SeqPnt2d.Length(); for(iX=firstpoint; iX<=aNbs1; iX++) { - Standard_Boolean IsRealCurve3d; - Standard_Integer ii; - Standard_Real aDstX; + Standard_Boolean IsRealCurve3d = 0; + Standard_Integer ii = 0; + Standard_Real aDstX = NAN; gp_Pnt2d P2d; gp_Pnt P3d; // @@ -291,7 +292,7 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, IsRealCurve3d = Standard_True; if (aDstX < aPrCf2) { if(iX>1) { - Standard_Real aDstX1; + Standard_Real aDstX1 = NAN; gp_Pnt MidP3d; // MidP3d = C3d.Value(0.5*(u+aPrms(iX-1))); @@ -312,7 +313,7 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, // ii= SeqPnt2d.Length(); if(ii>(Avant+4)) { - Standard_Real ul, dU, dV; + Standard_Real ul = NAN, dU = NAN, dV = NAN; gp_Pnt2d Pp; // gp_Lin2d Lin(SeqPnt2d(ii-2),gp_Dir2d(gp_Vec2d(SeqPnt2d(ii-2),SeqPnt2d(ii)))); @@ -589,14 +590,14 @@ TopAbs_State IntTools_FClass2d::Perform const Standard_Real uperiod = IsUPer ? surf->UPeriod() : 0.0; const Standard_Real vperiod = IsVPer ? surf->VPeriod() : 0.0; - Standard_Boolean urecadre, vrecadre, bUseClassifier; + Standard_Boolean urecadre = 0, vrecadre = 0, bUseClassifier = 0; Standard_Integer dedans = 1; // urecadre = Standard_False; vrecadre = Standard_False; // if (RecadreOnPeriodic) { - Standard_Real du, dv; + Standard_Real du = NAN, dv = NAN; if (IsUPer) { GeomInt::AdjustPeriodic(uu, Umin, Umax, uperiod, uu, du); }// if (IsUPer) { @@ -611,7 +612,7 @@ TopAbs_State IntTools_FClass2d::Perform gp_Pnt2d Puv(u,v); bUseClassifier = (TabOrien(1) == -1); if(!bUseClassifier) { - Standard_Integer n, cur, TabOrien_n ; + Standard_Integer n = 0, cur = 0, TabOrien_n = 0 ; for(n=1; n<=nbtabclass; n++) { cur = ((CSLib_Class2d *)TabClass(n))->SiDans(Puv); TabOrien_n=TabOrien(n); @@ -644,8 +645,8 @@ TopAbs_State IntTools_FClass2d::Perform //compute state of the point using face classifier if (bUseClassifier) { //compute tolerance to use in face classifier - Standard_Real aURes, aVRes, aFCTol; - Standard_Boolean bUIn, bVIn; + Standard_Real aURes = NAN, aVRes = NAN, aFCTol = NAN; + Standard_Boolean bUIn = 0, bVIn = 0; // aURes = surf->UResolution(Toluv); aVRes = surf->VResolution(Toluv); @@ -736,7 +737,7 @@ TopAbs_State IntTools_FClass2d::TestOnRestriction Standard_Integer dedans = 1; if (RecadreOnPeriodic) { - Standard_Real du, dv; + Standard_Real du = NAN, dv = NAN; if (IsUPer) { GeomInt::AdjustPeriodic(uu, Umin, Umax, uperiod, uu, du); }// if (IsUPer) { diff --git a/src/IntTools/IntTools_FClass2d.hxx b/src/IntTools/IntTools_FClass2d.hxx index 5b37565f1b..3fbb872de4 100644 --- a/src/IntTools/IntTools_FClass2d.hxx +++ b/src/IntTools/IntTools_FClass2d.hxx @@ -72,17 +72,17 @@ private: BRepTopAdaptor_SeqOfPtr TabClass; TColStd_SequenceOfInteger TabOrien; - Standard_Real Toluv; + Standard_Real Toluv{}; TopoDS_Face Face; - Standard_Real U1; - Standard_Real V1; - Standard_Real U2; - Standard_Real V2; - Standard_Real Umin; - Standard_Real Umax; - Standard_Real Vmin; - Standard_Real Vmax; - Standard_Boolean myIsHole; + Standard_Real U1{}; + Standard_Real V1{}; + Standard_Real U2{}; + Standard_Real V2{}; + Standard_Real Umin{}; + Standard_Real Umax{}; + Standard_Real Vmin{}; + Standard_Real Vmax{}; + Standard_Boolean myIsHole{}; mutable std::unique_ptr myFExplorer; diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index b95022f00b..1988af14b3 100644 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -160,17 +162,17 @@ static //function : //purpose : //======================================================================= -IntTools_FaceFace::IntTools_FaceFace() +IntTools_FaceFace::IntTools_FaceFace() : myIsDone(Standard_False), myTangentFaces(Standard_False), myHS1(new GeomAdaptor_Surface ()), myHS2(new GeomAdaptor_Surface ()), myTolF1(0.), myTolF2(0.), myTol(0.), myFuzzyValue(Precision::Confusion()) { - myIsDone=Standard_False; - myTangentFaces=Standard_False; + + // - myHS1 = new GeomAdaptor_Surface (); - myHS2 = new GeomAdaptor_Surface (); - myTolF1 = 0.; - myTolF2 = 0.; - myTol = 0.; - myFuzzyValue = Precision::Confusion(); + + + + + + SetParameters(Standard_True, Standard_True, Standard_True, 1.e-07); } //======================================================================= @@ -385,7 +387,7 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1, if (myListOfPnts.Extent()) { - Standard_Real aU1,aV1,aU2,aV2; + Standard_Real aU1 = NAN,aV1 = NAN,aU2 = NAN,aV2 = NAN; IntSurf_ListIteratorOfListOfPntOn2S aItP2S; // aItP2S.Initialize(myListOfPnts); @@ -423,7 +425,7 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1, aType2 == GeomAbs_Torus); if(aType1==GeomAbs_Plane && aType2==GeomAbs_Plane) { - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; // myContext->UVBounds(myFace1, umin, umax, vmin, vmax); myHS1->Load(S1, umin, umax, vmin, vmax); @@ -459,7 +461,7 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1, if ((aType1==GeomAbs_Plane) && isFace2Quad) { - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; // F1 myContext->UVBounds(myFace1, umin, umax, vmin, vmax); CorrectPlaneBoundaries(umin, umax, vmin, vmax); @@ -471,7 +473,7 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1, } else if ((aType2==GeomAbs_Plane) && isFace1Quad) { - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; //F1 myContext->UVBounds(myFace1, umin, umax, vmin, vmax); CorrectSurfaceBoundaries(myFace1, myTol * 2., umin, umax, vmin, vmax); @@ -483,7 +485,7 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1, } else { - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; myContext->UVBounds(myFace1, umin, umax, vmin, vmax); CorrectSurfaceBoundaries(myFace1, myTol * 2., umin, umax, vmin, vmax); myHS1->Load(S1, umin, umax, vmin, vmax); @@ -581,8 +583,8 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1, } // Points - Standard_Boolean bValid2D1, bValid2D2; - Standard_Real U1,V1,U2,V2; + Standard_Boolean bValid2D1 = 0, bValid2D2 = 0; + Standard_Real U1 = NAN,V1 = NAN,U2 = NAN,V2 = NAN; IntTools_PntOnFace aPntOnF1, aPntOnF2; IntTools_PntOn2Faces aPntOn2Faces; // @@ -630,7 +632,7 @@ void IntTools_FaceFace::Perform (const TopoDS_Face& aF1, //======================================================================= void IntTools_FaceFace::ComputeTolReached3d (const Standard_Boolean theToRunParallel) { - Standard_Integer i, j, aNbLin = mySeqOfCurve.Length(); + Standard_Integer i = 0, j = 0, aNbLin = mySeqOfCurve.Length(); if (!aNbLin) { return; } @@ -664,7 +666,7 @@ void IntTools_FaceFace::ComputeTolReached3d (const Standard_Boolean theToRunPara if (!aC2D.IsNull()) { // Look for the maximal deviation between 3D and 2D curves - Standard_Real aD, aT; + Standard_Real aD = NAN, aT = NAN; const Handle(Geom_Surface)& aS = !j ? aS1 : aS2; if (IntTools_Tools::ComputeTolerance (aC3D, aC2D, aS, aFirst, aLast, aD, aT, Precision::PConfusion(), theToRunParallel)) { @@ -707,11 +709,11 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, const Handle(Adaptor3d_TopolTool)& dom2, const Standard_Real theToler) { - Standard_Boolean bDone, rejectSurface, reApprox, bAvoidLineConstructor; - Standard_Boolean ok, bPCurvesOk; - Standard_Integer i, j, aNbParts; - Standard_Real fprm, lprm; - Standard_Real Tolpc; + Standard_Boolean bDone = 0, rejectSurface = 0, reApprox = 0, bAvoidLineConstructor = 0; + Standard_Boolean ok = 0, bPCurvesOk = 0; + Standard_Integer i = 0, j = 0, aNbParts = 0; + Standard_Real fprm = NAN, lprm = NAN; + Standard_Real Tolpc = NAN; Handle(IntPatch_Line) L; IntPatch_IType typl; Handle(Geom_Curve) newc; @@ -802,7 +804,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, // aNbParts=myLConstruct.NbParts(); for (i=1; i<=aNbParts; i++) { - Standard_Boolean bFNIt, bLPIt; + Standard_Boolean bFNIt = 0, bLPIt = 0; // myLConstruct.Part(i, fprm, lprm); // @@ -847,7 +849,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, else { // on regarde si on garde // - Standard_Real aTestPrm, dT=100.; + Standard_Real aTestPrm = NAN, dT=100.; // aTestPrm=0.; if (bFNIt && !bLPIt) { @@ -876,7 +878,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, continue; } - Standard_Real u1, v1, u2, v2, Tol; + Standard_Real u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN, Tol = NAN; Tol = Precision::Confusion(); Parameters(myHS1, myHS2, ptref, u1, v1, u2, v2); @@ -910,7 +912,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, // aNbParts=myLConstruct.NbParts(); // - Standard_Real aPeriod, aNul; + Standard_Real aPeriod = NAN, aNul = NAN; TColStd_SequenceOfReal aSeqFprm, aSeqLprm; aNul=0.; @@ -1042,7 +1044,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, } } // - Standard_Real aTwoPIdiv17, u1, v1, u2, v2, Tol; + Standard_Real aTwoPIdiv17 = NAN, u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN, Tol = NAN; aTwoPIdiv17=2.*M_PI/17.; @@ -1104,7 +1106,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, #endif // - Standard_Integer ifprm, ilprm; + Standard_Integer ifprm = 0, ilprm = 0; // if (!myApprox) { aNbParts = 1; @@ -1140,9 +1142,9 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, }// if (!myApprox) { // else { // X - Standard_Boolean bIsDecomposited; - Standard_Integer nbiter, aNbSeqOfL; - Standard_Real tol2d, aTolApproxImp; + Standard_Boolean bIsDecomposited = 0; + Standard_Integer nbiter = 0, aNbSeqOfL = 0; + Standard_Real tol2d = NAN, aTolApproxImp = NAN; IntPatch_SequenceOfLine aSeqOfL; GeomInt_WLApprox theapp3d; Approx_ParametrizationType aParType = Approx_ChordLength; @@ -1241,7 +1243,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, if (reApprox && !rejectSurface) theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_False, aParType); else { - Standard_Integer iDegMax, iDegMin, iNbIter; + Standard_Integer iDegMax = 0, iDegMin = 0, iNbIter = 0; // ApproxParameters(myHS1, myHS2, iDegMin, iDegMax, iNbIter); theapp3d.SetParameters(myTolApprox, tol2d, iDegMin, iDegMax, @@ -1267,7 +1269,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_True, aParType); - Standard_Boolean bUseSurfaces; + Standard_Boolean bUseSurfaces = 0; bUseSurfaces = IntTools_WLineTool::NotUseSurfacesForApprox(myFace1, myFace2, WL, ifprm, ilprm); if (bUseSurfaces) { // ###### @@ -1309,7 +1311,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, } } // - Standard_Integer aNbMultiCurves, nbpoles; + Standard_Integer aNbMultiCurves = 0, nbpoles = 0; aNbMultiCurves=theapp3d.NbMultiCurves(); for (j=1; j<=aNbMultiCurves; j++) { if(typs1 == GeomAbs_Plane) { @@ -1322,7 +1324,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, mbspc.Curve(1,tpoles2d); const gp_Pln& Pln = myHS1->Plane(); // - Standard_Integer ik; + Standard_Integer ik = 0; for(ik = 1; ik<= nbpoles; ik++) { tpoles.SetValue(ik, ElSLib::Value(tpoles2d.Value(ik).X(), @@ -1401,7 +1403,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, mbspc.Curve((myApprox1==Standard_True)? 2 : 1,tpoles2d); const gp_Pln& Pln = myHS2->Plane(); // - Standard_Integer ik; + Standard_Integer ik = 0; for(ik = 1; ik<= nbpoles; ik++) { tpoles.SetValue(ik, ElSLib::Value(tpoles2d.Value(ik).X(), @@ -1497,7 +1499,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, }// else if(typs2 == GeomAbs_Plane) // else { //typs2 != GeomAbs_Plane && typs1 != GeomAbs_Plane - Standard_Boolean bIsValid1, bIsValid2; + Standard_Boolean bIsValid1 = 0, bIsValid2 = 0; Handle(Geom_BSplineCurve) BS; IntTools_Curve aCurve; // @@ -1608,7 +1610,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, Handle(Geom_Curve) aC3d; Handle(Geom2d_Curve) aC2d1, aC2d2; - Standard_Real aTolReached; + Standard_Real aTolReached = NAN; GeomInt_IntSS::TreatRLine(RL, myHS1, myHS2, aC3d, aC2d1, aC2d2, aTolReached); @@ -1770,11 +1772,11 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, const Standard_Integer ideb, const Standard_Integer ifin) { - Standard_Integer i,nbpnt = ifin-ideb+1; + Standard_Integer i = 0,nbpnt = ifin-ideb+1; TColgp_Array1OfPnt poles(1,nbpnt); TColStd_Array1OfReal knots(1,nbpnt); TColStd_Array1OfInteger mults(1,nbpnt); - Standard_Integer ipidebm1; + Standard_Integer ipidebm1 = 0; for(i=1,ipidebm1=i+ideb-1; i<=nbpnt;ipidebm1++, i++) { poles(i) = WL->Point(ipidebm1).Value(); mults(i) = 1; @@ -1791,7 +1793,7 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, //======================================================================= void IntTools_FaceFace::PrepareLines3D(const Standard_Boolean bToSplit) { - Standard_Integer i, aNbCurves; + Standard_Integer i = 0, aNbCurves = 0; GeomAbs_SurfaceType aType1, aType2; IntTools_SequenceOfCurves aNewCvs; // @@ -1801,7 +1803,7 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, const IntTools_Curve& aIC=mySeqOfCurve(i); // if (bToSplit) { - Standard_Integer j, aNbC; + Standard_Integer j = 0, aNbC = 0; IntTools_SequenceOfCurves aSeqCvs; // aNbC=IntTools_Tools::SplitCurve(aIC, aSeqCvs); @@ -1870,8 +1872,8 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, Standard_Real& thevmin, Standard_Real& thevmax) { - Standard_Boolean enlarge, isuperiodic, isvperiodic; - Standard_Real uinf, usup, vinf, vsup, delta; + Standard_Boolean enlarge = 0, isuperiodic = 0, isvperiodic = 0; + Standard_Real uinf = NAN, usup = NAN, vinf = NAN, vsup = NAN, delta = NAN; GeomAbs_SurfaceType aType; Handle(Geom_Surface) aSurface; // @@ -1960,7 +1962,7 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, for(anExp.Init(theFace, TopAbs_EDGE); anExp.More(); anExp.Next()) { if(BRep_Tool::IsClosed(TopoDS::Edge(anExp.Current()), theFace)) { correct = Standard_True; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; TopoDS_Edge anEdge = TopoDS::Edge(anExp.Current()); for(Standard_Integer i = 0; i < 2; i++) { @@ -2000,7 +2002,7 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, } if(correct) { - Standard_Real umin, vmin, umax, vmax; + Standard_Real umin = NAN, vmin = NAN, umax = NAN, vmax = NAN; aBox.Get(umin, vmin, umax, vmax); if(isuperiodic && correctU) { @@ -2047,7 +2049,7 @@ Standard_Boolean ParameterOutOfBoundary(const Standard_Real theParameter, Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(theFace1); Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(theFace2); - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; GeomAPI_ProjectPointOnSurf aPrj1; aSurf1->Bounds(u1, u2, v1, v2); @@ -2151,7 +2153,7 @@ Standard_Boolean ApproxWithPCurves(const gp_Cylinder& theCyl, Standard_Real R1 = theCyl.Radius(), R2 = theSph.Radius(); // { - Standard_Real aD2, aRc2, aEps; + Standard_Real aD2 = NAN, aRc2 = NAN, aEps = NAN; gp_Pnt aApexSph; // aEps=1.E-7; @@ -2252,11 +2254,11 @@ void PerformPlanes(const Handle(GeomAdaptor_Surface)& theS1, gp_Lin2d aLin2d2 = aProj.Line(); // //classify line2d1 relatively first plane - Standard_Real P11, P12; + Standard_Real P11 = NAN, P12 = NAN; Standard_Boolean IsCrossed = ClassifyLin2d(theS1, aLin2d1, TolTang, P11, P12); if(!IsCrossed) return; //classify line2d2 relatively second plane - Standard_Real P21, P22; + Standard_Real P21 = NAN, P22 = NAN; IsCrossed = ClassifyLin2d(theS2, aLin2d2, TolTang, P21, P22); if(!IsCrossed) return; @@ -2265,7 +2267,7 @@ void PerformPlanes(const Handle(GeomAdaptor_Surface)& theS1, if(P21 >= P12) return; if(P22 <= P11) return; - Standard_Real pmin, pmax; + Standard_Real pmin = NAN, pmax = NAN; pmin = Max(P11, P21); pmax = Min(P12, P22); @@ -2301,7 +2303,7 @@ void PerformPlanes(const Handle(GeomAdaptor_Surface)& theS1, aCurve.SetTolerance(aTolC); // // Computation of the tangential tolerance - Standard_Real anAngle, aDt; + Standard_Real anAngle = NAN, aDt = NAN; gp_Dir aD1, aD2; // aD1 = aPln1.Position().Direction(); @@ -2342,7 +2344,7 @@ Standard_Boolean ClassifyLin2d(const Handle(GeomAdaptor_Surface)& theS, Standard_Real& theP2) { - Standard_Real xmin, xmax, ymin, ymax, d1, d2, A, B, C; + Standard_Real xmin = NAN, xmax = NAN, ymin = NAN, ymax = NAN, d1 = NAN, d2 = NAN, A = NAN, B = NAN, C = NAN; Standard_Real par[2]; Standard_Integer nbi = 0; @@ -2490,7 +2492,7 @@ void ApproxParameters(const Handle(GeomAdaptor_Surface)& aHS1, // Cylinder/Torus if ((aTS1==GeomAbs_Cylinder && aTS2==GeomAbs_Torus) || (aTS2==GeomAbs_Cylinder && aTS1==GeomAbs_Torus)) { - Standard_Real aRC, aRT, dR, aPC; + Standard_Real aRC = NAN, aRT = NAN, dR = NAN, aPC = NAN; gp_Cylinder aCylinder; gp_Torus aTorus; // @@ -2530,7 +2532,7 @@ void Tolerances(const Handle(GeomAdaptor_Surface)& aHS1, // Cylinder/Torus if ((aTS1==GeomAbs_Cylinder && aTS2==GeomAbs_Torus) || (aTS2==GeomAbs_Cylinder && aTS1==GeomAbs_Torus)) { - Standard_Real aRC, aRT, dR, aPC; + Standard_Real aRC = NAN, aRT = NAN, dR = NAN, aPC = NAN; gp_Cylinder aCylinder; gp_Torus aTorus; // @@ -2558,8 +2560,8 @@ void Tolerances(const Handle(GeomAdaptor_Surface)& aHS1, Standard_Boolean SortTypes(const GeomAbs_SurfaceType aType1, const GeomAbs_SurfaceType aType2) { - Standard_Boolean bRet; - Standard_Integer aI1, aI2; + Standard_Boolean bRet = 0; + Standard_Integer aI1 = 0, aI2 = 0; // bRet=Standard_False; // @@ -2576,7 +2578,7 @@ Standard_Boolean SortTypes(const GeomAbs_SurfaceType aType1, //======================================================================= Standard_Integer IndexType(const GeomAbs_SurfaceType aType) { - Standard_Integer aIndex; + Standard_Integer aIndex = 0; // aIndex=11; // @@ -2626,8 +2628,8 @@ Standard_Real FindMaxDistance(const Handle(Geom_Curve)& theCurve, const TopoDS_Face& theFace, const Handle(IntTools_Context)& theContext) { - Standard_Integer aNbS; - Standard_Real aT1, aT2, aDt, aD, aDMax, anEps; + Standard_Integer aNbS = 0; + Standard_Real aT1 = NAN, aT2 = NAN, aDt = NAN, aD = NAN, aDMax = NAN, anEps = NAN; // aNbS = 11; aDt = (theLast - theFirst) / aNbS; @@ -2663,7 +2665,7 @@ Standard_Real FindMaxDistance(const Handle(Geom_Curve)& theC, GeomAPI_ProjectPointOnSurf& theProjPS, const Standard_Real theEps) { - Standard_Real aA, aB, aCf, aX, aX1, aX2, aF1, aF2, aF; + Standard_Real aA = NAN, aB = NAN, aCf = NAN, aX = NAN, aX1 = NAN, aX2 = NAN, aF1 = NAN, aF2 = NAN, aF = NAN; // aCf = 0.61803398874989484820458683436564;//(sqrt(5.)-1)/2.; aA = theFirst; @@ -2714,7 +2716,7 @@ Standard_Real MaxDistance(const Handle(Geom_Curve)& theC, const Standard_Real aT, GeomAPI_ProjectPointOnSurf& theProjPS) { - Standard_Real aD; + Standard_Real aD = NAN; gp_Pnt aP; // theC->D0(aT, aP); @@ -2733,8 +2735,8 @@ Standard_Real MaxDistance(const Handle(Geom_Curve)& theC, const Handle(IntTools_Context)& theCtx) { const Standard_Integer NPoints = 23; - Standard_Integer i; - Standard_Real umin,umax,vmin,vmax; + Standard_Integer i = 0; + Standard_Real umin = NAN,umax = NAN,vmin = NAN,vmax = NAN; theCtx->UVBounds(aFace, umin, umax, vmin, vmax); Standard_Real tolU = Max ((umax-umin)*0.01, Precision::Confusion()); @@ -2750,7 +2752,7 @@ Standard_Real MaxDistance(const Handle(Geom_Curve)& theC, aSurf = (Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf))->BasisSurface(); } gp_Pnt2d pnt = aPC->Value((fp+lp)/2); - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; pnt.Coord(u,v); // if (aSurf->IsUPeriodic()) { @@ -2769,9 +2771,9 @@ Standard_Real MaxDistance(const Handle(Geom_Curve)& theC, } // //-------------------------------------------------------- - Standard_Boolean bRet; - Standard_Integer j, aNbIntervals; - Standard_Real aT, dT; + Standard_Boolean bRet = 0; + Standard_Integer j = 0, aNbIntervals = 0; + Standard_Real aT = NAN, dT = NAN; gp_Pnt2d aP2D; // Geom2dAdaptor_Curve aGAC(aPC); @@ -2809,7 +2811,7 @@ Standard_Real MaxDistance(const Handle(Geom_Curve)& theC, { if (!(Precision::IsInfinite(aUmin) || Precision::IsInfinite(aUmax))) { - Standard_Real dU; + Standard_Real dU = NAN; // dU=0.1*(aUmax-aUmin); aUmin=aUmin-dU; @@ -2817,7 +2819,7 @@ Standard_Real MaxDistance(const Handle(Geom_Curve)& theC, } if (!(Precision::IsInfinite(aVmin) || Precision::IsInfinite(aVmax))) { - Standard_Real dV; + Standard_Real dV = NAN; // dV=0.1*(aVmax-aVmin); aVmin=aVmin-dV; diff --git a/src/IntTools/IntTools_FaceFace.hxx b/src/IntTools/IntTools_FaceFace.hxx index 228bc57ee5..5d45c215dc 100644 --- a/src/IntTools/IntTools_FaceFace.hxx +++ b/src/IntTools/IntTools_FaceFace.hxx @@ -117,11 +117,11 @@ protected: GeomInt_LineConstructor myLConstruct; Handle(GeomAdaptor_Surface) myHS1; Handle(GeomAdaptor_Surface) myHS2; - Standard_Integer myNbrestr; - Standard_Boolean myApprox; - Standard_Boolean myApprox1; - Standard_Boolean myApprox2; - Standard_Real myTolApprox; + Standard_Integer myNbrestr{}; + Standard_Boolean myApprox{}; + Standard_Boolean myApprox1{}; + Standard_Boolean myApprox2{}; + Standard_Real myTolApprox{}; Standard_Real myTolF1; Standard_Real myTolF2; Standard_Real myTol; diff --git a/src/IntTools/IntTools_MarkedRangeSet.hxx b/src/IntTools/IntTools_MarkedRangeSet.hxx index 8d5ac3d1d1..892f2202b0 100644 --- a/src/IntTools/IntTools_MarkedRangeSet.hxx +++ b/src/IntTools/IntTools_MarkedRangeSet.hxx @@ -125,7 +125,7 @@ public: private: TColStd_SequenceOfReal myRangeSetStorer; - Standard_Integer myRangeNumber; + Standard_Integer myRangeNumber{}; TColStd_SequenceOfInteger myFlags; TColStd_SequenceOfInteger myFoundIndices; diff --git a/src/IntTools/IntTools_PntOn2Faces.cxx b/src/IntTools/IntTools_PntOn2Faces.cxx index 14d4a2376f..a7caefabd7 100644 --- a/src/IntTools/IntTools_PntOn2Faces.cxx +++ b/src/IntTools/IntTools_PntOn2Faces.cxx @@ -32,10 +32,10 @@ IntTools_PntOn2Faces::IntTools_PntOn2Faces() IntTools_PntOn2Faces::IntTools_PntOn2Faces(const IntTools_PntOnFace& aP1, const IntTools_PntOnFace& aP2) : - myIsValid(Standard_False) + myIsValid(Standard_False), myPnt1(aP1), myPnt2(aP2) { - myPnt1=aP1; - myPnt2=aP2; + + } //======================================================================= //function : SetP1 diff --git a/src/IntTools/IntTools_Range.cxx b/src/IntTools/IntTools_Range.cxx index f07cb7ad9b..8900ec821c 100644 --- a/src/IntTools/IntTools_Range.cxx +++ b/src/IntTools/IntTools_Range.cxx @@ -26,10 +26,10 @@ IntTools_Range::IntTools_Range():myFirst(0.), myLast(0.) {} //function : IntTools_Range::IntTools_Range //purpose : //======================================================================= - IntTools_Range::IntTools_Range(const Standard_Real aFirst,const Standard_Real aLast) + IntTools_Range::IntTools_Range(const Standard_Real aFirst,const Standard_Real aLast) : myFirst(aFirst), myLast(aLast) { - myFirst=aFirst; - myLast=aLast; + + } //======================================================================= //function : SetFirst diff --git a/src/IntTools/IntTools_Root.cxx b/src/IntTools/IntTools_Root.cxx index f12476335b..30771d62c0 100644 --- a/src/IntTools/IntTools_Root.cxx +++ b/src/IntTools/IntTools_Root.cxx @@ -36,7 +36,7 @@ IntTools_Root::IntTools_Root(): //======================================================================= IntTools_Root::IntTools_Root(const Standard_Real aRoot, const Standard_Integer aType): - myLayerHeight(0.), + myRoot(aRoot), myType(aType), myLayerHeight(0.), myStateBefore(TopAbs_UNKNOWN), myStateAfter(TopAbs_UNKNOWN), myt1(0.), @@ -44,8 +44,8 @@ IntTools_Root::IntTools_Root(): myf1(0.), myf2(0.) { - myRoot=aRoot; - myType=aType; + + } //======================================================================= diff --git a/src/IntTools/IntTools_ShrunkRange.cxx b/src/IntTools/IntTools_ShrunkRange.cxx index 646a629395..b4dd3cc3cb 100644 --- a/src/IntTools/IntTools_ShrunkRange.cxx +++ b/src/IntTools/IntTools_ShrunkRange.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -25,15 +27,15 @@ //function : //purpose : //======================================================================= - IntTools_ShrunkRange::IntTools_ShrunkRange () + IntTools_ShrunkRange::IntTools_ShrunkRange () : myT1(-99), myT2(myT1), myTS1(myT1), myTS2(myT1), myIsDone(Standard_False), myIsSplittable(Standard_False), myLength(0.0) { - myT1=-99; - myT2=myT1; - myTS1=myT1; - myTS2=myT1; - myIsDone=Standard_False; - myIsSplittable=Standard_False; - myLength = 0.0; + + + + + + + } //======================================================================= //function : ~ @@ -137,7 +139,7 @@ void IntTools_ShrunkRange::Perform() // gp_Pnt aP1 = BRep_Tool::Pnt(myV1); gp_Pnt aP2 = BRep_Tool::Pnt(myV2); - Standard_Real aTolE, aTolV1, aTolV2; + Standard_Real aTolE = NAN, aTolV1 = NAN, aTolV2 = NAN; aTolE = BRep_Tool::Tolerance(myEdge); aTolV1 = BRep_Tool::Tolerance(myV1); aTolV2 = BRep_Tool::Tolerance(myV2); diff --git a/src/IntTools/IntTools_SurfaceRangeLocalizeData.cxx b/src/IntTools/IntTools_SurfaceRangeLocalizeData.cxx index 4e13d4ad4c..c469ed0b50 100644 --- a/src/IntTools/IntTools_SurfaceRangeLocalizeData.cxx +++ b/src/IntTools/IntTools_SurfaceRangeLocalizeData.cxx @@ -21,18 +21,18 @@ #include #include -IntTools_SurfaceRangeLocalizeData::IntTools_SurfaceRangeLocalizeData() +IntTools_SurfaceRangeLocalizeData::IntTools_SurfaceRangeLocalizeData() : myNbSampleU(1), myNbSampleV(1), myMinRangeU(0.), myMinRangeV(0.), myDeflection(0.), myUIndMin(0), myUIndMax(0), myVIndMin(0), myVIndMax(0) { - myNbSampleU = 1; - myNbSampleV = 1; - myMinRangeU = 0.; - myMinRangeV = 0.; + + + + // Modified by skv - Thu Nov 3 11:58:24 2005 Optimization Begin - myDeflection = 0.; - myUIndMin = 0; - myUIndMax = 0; - myVIndMin = 0; - myVIndMax = 0; + + + + + // Modified by skv - Thu Nov 3 11:58:24 2005 Optimization End } @@ -40,18 +40,18 @@ IntTools_SurfaceRangeLocalizeData::IntTools_SurfaceRangeLocalizeData() IntTools_SurfaceRangeLocalizeData::IntTools_SurfaceRangeLocalizeData(const Standard_Integer theNbSampleU, const Standard_Integer theNbSampleV, const Standard_Real theMinRangeU, - const Standard_Real theMinRangeV) + const Standard_Real theMinRangeV) : myNbSampleU(theNbSampleU), myNbSampleV(theNbSampleV), myMinRangeU(theMinRangeU), myMinRangeV(theMinRangeV), myDeflection(0.), myUIndMin(0), myUIndMax(0), myVIndMin(0), myVIndMax(0) { - myNbSampleU = theNbSampleU; - myNbSampleV = theNbSampleV; - myMinRangeU = theMinRangeU; - myMinRangeV = theMinRangeV; + + + + // Modified by skv - Thu Nov 3 11:58:24 2005 Optimization Begin - myDeflection = 0.; - myUIndMin = 0; - myUIndMax = 0; - myVIndMin = 0; - myVIndMax = 0; + + + + + // Modified by skv - Thu Nov 3 11:58:24 2005 Optimization End } @@ -181,8 +181,8 @@ void IntTools_SurfaceRangeLocalizeData::SetFrame(const Standard_Real theUMin, return; } - Standard_Integer i; - Standard_Integer aLmI; + Standard_Integer i = 0; + Standard_Integer aLmI = 0; Standard_Integer aLen = myUParams->Length(); // Compute frame along U. diff --git a/src/IntTools/IntTools_SurfaceRangeLocalizeData.hxx b/src/IntTools/IntTools_SurfaceRangeLocalizeData.hxx index eec3296f5c..076b4b9d63 100644 --- a/src/IntTools/IntTools_SurfaceRangeLocalizeData.hxx +++ b/src/IntTools/IntTools_SurfaceRangeLocalizeData.hxx @@ -143,20 +143,20 @@ private: - Standard_Integer myNbSampleU; - Standard_Integer myNbSampleV; - Standard_Real myMinRangeU; - Standard_Real myMinRangeV; + Standard_Integer myNbSampleU{}; + Standard_Integer myNbSampleV{}; + Standard_Real myMinRangeU{}; + Standard_Real myMinRangeV{}; IntTools_MapOfSurfaceSample myMapRangeOut; IntTools_DataMapOfSurfaceSampleBox myMapBox; Handle(TColStd_HArray1OfReal) myUParams; Handle(TColStd_HArray1OfReal) myVParams; Handle(TColgp_HArray2OfPnt) myGridPoints; - Standard_Integer myUIndMin; - Standard_Integer myUIndMax; - Standard_Integer myVIndMin; - Standard_Integer myVIndMax; - Standard_Real myDeflection; + Standard_Integer myUIndMin{}; + Standard_Integer myUIndMax{}; + Standard_Integer myVIndMin{}; + Standard_Integer myVIndMax{}; + Standard_Real myDeflection{}; }; diff --git a/src/IntTools/IntTools_SurfaceRangeSample.cxx b/src/IntTools/IntTools_SurfaceRangeSample.cxx index 63cc80e878..c20c84096f 100644 --- a/src/IntTools/IntTools_SurfaceRangeSample.cxx +++ b/src/IntTools/IntTools_SurfaceRangeSample.cxx @@ -31,10 +31,10 @@ IntTools_SurfaceRangeSample::IntTools_SurfaceRangeSample(const Standard_Integer } IntTools_SurfaceRangeSample::IntTools_SurfaceRangeSample(const IntTools_CurveRangeSample& theRangeU, - const IntTools_CurveRangeSample& theRangeV) + const IntTools_CurveRangeSample& theRangeV) : myRangeU(theRangeU), myRangeV(theRangeV) { - myRangeU = theRangeU; - myRangeV = theRangeV; + + } IntTools_SurfaceRangeSample::IntTools_SurfaceRangeSample(const IntTools_SurfaceRangeSample& Other) diff --git a/src/IntTools/IntTools_Tools.cxx b/src/IntTools/IntTools_Tools.cxx index 3c72ec9906..f871d90b3a 100644 --- a/src/IntTools/IntTools_Tools.cxx +++ b/src/IntTools/IntTools_Tools.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -81,8 +83,8 @@ static //======================================================================= Standard_Boolean IntTools_Tools::IsClosed (const Handle(Geom_Curve)& aC3D) { - Standard_Boolean bRet; - Standard_Real aF, aL, aDist, aPC; + Standard_Boolean bRet = 0; + Standard_Real aF = NAN, aL = NAN, aDist = NAN, aPC = NAN; gp_Pnt aP1, aP2; Handle (Geom_BoundedCurve) aGBC= @@ -113,8 +115,8 @@ static void IntTools_Tools::RejectLines(const IntTools_SequenceOfCurves& aSIn, IntTools_SequenceOfCurves& aSOut) { - Standard_Integer i, j, aNb; - Standard_Boolean bFlag; + Standard_Integer i = 0, j = 0, aNb = 0; + Standard_Boolean bFlag = 0; Handle (Geom_Curve) aC3D; gp_Dir aD1, aD2; @@ -168,10 +170,10 @@ static //======================================================================= Standard_Boolean IntTools_Tools::IsDirsCoinside (const gp_Dir& D1, const gp_Dir& D2) { - Standard_Boolean bFlag; + Standard_Boolean bFlag = 0; gp_Pnt P1(D1.X(), D1.Y(), D1.Z()); gp_Pnt P2(D2.X(), D2.Y(), D2.Z()); - Standard_Real dLim=0.0002, d; + Standard_Real dLim=0.0002, d = NAN; d=P1.Distance (P2); bFlag= (dFirstParameter(); @@ -264,7 +266,7 @@ static { //define parameter division number as 10*e^(-M_PI) = 0.43213918 const Standard_Real PAR_T = 0.43213918; - Standard_Real aParm; + Standard_Real aParm = NAN; aParm=(1.-PAR_T)*aFirst + PAR_T*aLast; return aParm; } @@ -277,8 +279,8 @@ static const Standard_Real aTolPV, const TopoDS_Vertex& aV) { - Standard_Boolean bRet; - Standard_Real aTolV, aD, dTol; + Standard_Boolean bRet = 0; + Standard_Real aTolV = NAN, aD = NAN, dTol = NAN; gp_Pnt aPv; aTolV=BRep_Tool::Tolerance(aV); @@ -301,8 +303,8 @@ static //======================================================================= Standard_Boolean IntTools_Tools::IsVertex (const IntTools_CommonPrt& aCmnPrt) { - Standard_Boolean anIsVertex; - Standard_Real aParam; + Standard_Boolean anIsVertex = 0; + Standard_Real aParam = NAN; const TopoDS_Edge& aE1=aCmnPrt.Edge1(); const IntTools_Range& aR1=aCmnPrt.Range1(); @@ -332,7 +334,7 @@ static const TopoDS_Vertex& aV, const Standard_Real t) { - Standard_Real aTolV, aTolV2, d2; + Standard_Real aTolV = NAN, aTolV2 = NAN, d2 = NAN; gp_Pnt aPv, aPt; BRepAdaptor_Curve aBAC(aE); @@ -354,7 +356,7 @@ static Standard_Boolean IntTools_Tools::IsVertex (const TopoDS_Edge& aE, const Standard_Real t) { - Standard_Real aTolV, aTolV2, d2; + Standard_Real aTolV = NAN, aTolV2 = NAN, d2 = NAN; TopoDS_Vertex aV; gp_Pnt aPv, aPt; @@ -384,7 +386,7 @@ static Standard_Integer IntTools_Tools::ComputeVV(const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV2) { - Standard_Real aTolV1, aTolV2, aTolSum, d; + Standard_Real aTolV1 = NAN, aTolV2 = NAN, aTolSum = NAN, d = NAN; gp_Pnt aP1, aP2; aTolV1=BRep_Tool::Tolerance(aV1); @@ -424,7 +426,7 @@ static TopAbs_State IntTools_Tools::ClassifyPointByFace(const TopoDS_Face& aF, const gp_Pnt2d& aP2d) { - Standard_Real aFaceTolerance; + Standard_Real aFaceTolerance = NAN; TopAbs_State aState; aFaceTolerance=BRep_Tool::Tolerance(aF); @@ -442,8 +444,8 @@ static const TopoDS_Edge& aE2) { - Standard_Boolean bRet; - Standard_Real f1, l1, m1, f2, l2, m2, aTol1, aTol2, aSumTol, aD2; + Standard_Boolean bRet = 0; + Standard_Real f1 = NAN, l1 = NAN, m1 = NAN, f2 = NAN, l2 = NAN, m2 = NAN, aTol1 = NAN, aTol2 = NAN, aSumTol = NAN, aD2 = NAN; gp_Pnt aP1, aP2; aTol1=BRep_Tool::Tolerance(aE1); @@ -470,7 +472,7 @@ static Standard_Real IntTools_Tools::CurveTolerance(const Handle(Geom_Curve)& aC3D, const Standard_Real aTolBase) { - Standard_Real aTolReached, aTf, aTl, aTolMin, aTolMax; + Standard_Real aTolReached = NAN, aTf = NAN, aTl = NAN, aTolMin = NAN, aTolMax = NAN; aTolReached=aTolBase; // @@ -525,8 +527,8 @@ void ParabolaTolerance(const Handle(Geom_Curve)& aC3D, return; } - Standard_Integer aNbPoints; - Standard_Real aFocal, aX1, aX2, aTol1, aTol2; + Standard_Integer aNbPoints = 0; + Standard_Real aFocal = NAN, aX1 = NAN, aX2 = NAN, aTol1 = NAN, aTol2 = NAN; gp_Pnt aPf, aPl; gp_Parab aParab=aGP->Parab(); gp_Ax1 aXAxis=aParab.XAxis(); @@ -613,7 +615,7 @@ Standard_Boolean IntTools_Tools::IsOnPave(const Standard_Real aT1, const IntTools_Range& aRange, const Standard_Real aTolerance) { - Standard_Boolean firstisonpave1, firstisonpave2, bIsOnPave; + Standard_Boolean firstisonpave1 = 0, firstisonpave2 = 0, bIsOnPave = 0; // firstisonpave1 = (Abs(aRange.First() - aT1) < aTolerance); firstisonpave2 = (Abs(aRange.Last() - aT1) < aTolerance); @@ -667,8 +669,8 @@ Standard_Boolean IntTools_Tools::IsOnPave1(const Standard_Real aTR, const IntTools_Range& aCPRange, const Standard_Real aTolerance) { - Standard_Boolean bIsOnPave; - Standard_Real aT1, aT2, dT1, dT2; + Standard_Boolean bIsOnPave = 0; + Standard_Real aT1 = NAN, aT2 = NAN, dT1 = NAN, dT2 = NAN; // aT1=aCPRange.First(); aT2=aCPRange.Last(); @@ -690,8 +692,8 @@ Standard_Boolean IntTools_Tools::IsInRange(const IntTools_Range& aRRef, const IntTools_Range& aR, const Standard_Real aTolerance) { - Standard_Boolean bIsIn; - Standard_Real aT1, aT2, aTRef1, aTRef2; + Standard_Boolean bIsIn = 0; + Standard_Real aT1 = NAN, aT2 = NAN, aTRef1 = NAN, aTRef2 = NAN; // aR.Range(aT1, aT2); aRRef.Range(aTRef1, aTRef2); @@ -720,8 +722,8 @@ Standard_Integer IntTools_Tools::SegPln(const gp_Lin& theLin, Standard_Real& theTPmin, Standard_Real& theTPmax) { - Standard_Integer iRet; - Standard_Real aTol, aA, aB, aC, aD, aE, aH, aTP, aDist1, aDist2; + Standard_Integer iRet = 0; + Standard_Real aTol = NAN, aA = NAN, aB = NAN, aC = NAN, aD = NAN, aE = NAN, aH = NAN, aTP = NAN, aDist1 = NAN, aDist2 = NAN; gp_Pnt aP1, aP2; // iRet=0; @@ -826,13 +828,13 @@ Standard_Real IntTools_Tools::ComputeIntRange(const Standard_Real theTol1, const Standard_Real theTol2, const Standard_Real theAngle) { - Standard_Real aDt; + Standard_Real aDt = NAN; // if (Abs(M_PI_2 - theAngle) < Precision::Angular()) { aDt = theTol2; } else { - Standard_Real a1, a2, anAngle; + Standard_Real a1 = NAN, a2 = NAN, anAngle = NAN; // anAngle = (theAngle > M_PI_2) ? (M_PI - theAngle) : theAngle; a1 = theTol1 * tan(M_PI_2 - anAngle); diff --git a/src/IntTools/IntTools_TopolTool.cxx b/src/IntTools/IntTools_TopolTool.cxx index a5b8bdaa0e..269ba1b249 100644 --- a/src/IntTools/IntTools_TopolTool.cxx +++ b/src/IntTools/IntTools_TopolTool.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,25 +39,25 @@ static void Analyse(const TColgp_Array2OfPnt& array2, // function: Constructor // purpose: // ===================================================================================== -IntTools_TopolTool::IntTools_TopolTool() +IntTools_TopolTool::IntTools_TopolTool() : myNbSmplU(0), myNbSmplV(0), myDU(1.), myDV(1.) { - myNbSmplU = 0; - myNbSmplV = 0; - myDU = 1.; - myDV = 1.; + + + + } // ===================================================================================== // function: Constructor // purpose: // ===================================================================================== -IntTools_TopolTool::IntTools_TopolTool(const Handle(Adaptor3d_Surface)& theSurface) +IntTools_TopolTool::IntTools_TopolTool(const Handle(Adaptor3d_Surface)& theSurface) : myNbSmplU(0), myNbSmplV(0), myDU(1.), myDV(1.) { Initialize(theSurface); - myNbSmplU = 0; - myNbSmplV = 0; - myDU = 1.; - myDV = 1.; + + + + } // ===================================================================================== @@ -87,7 +89,7 @@ void IntTools_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& theSurface) // ===================================================================================== void IntTools_TopolTool::ComputeSamplePoints() { - Standard_Real uinf, usup, vinf, vsup; + Standard_Real uinf = NAN, usup = NAN, vinf = NAN, vsup = NAN; uinf = myS->FirstUParameter(); usup = myS->LastUParameter(); vinf = myS->FirstVParameter(); @@ -96,7 +98,7 @@ void IntTools_TopolTool::ComputeSamplePoints() if (usup < uinf) { Standard_Real temp = uinf; uinf = usup; usup = temp; } if (vsup < vinf) { Standard_Real temp = vinf; vinf = vsup; vsup = temp; } - Standard_Boolean isbiguinf, isbigusup, isbigvinf, isbigvsup; + Standard_Boolean isbiguinf = 0, isbigusup = 0, isbigvinf = 0, isbigvsup = 0; isbiguinf = Precision::IsNegativeInfinite(uinf); isbigusup = Precision::IsPositiveInfinite(usup); isbigvinf = Precision::IsNegativeInfinite(vinf); @@ -176,7 +178,7 @@ void IntTools_TopolTool::ComputeSamplePoints() case GeomAbs_Sphere: case GeomAbs_Torus: { gp_Circ aCircle; - Standard_Real aRadius1, aRadius2; + Standard_Real aRadius1 = NAN, aRadius2 = NAN; if(typS == GeomAbs_Torus) { gp_Torus aTorus = myS->Torus(); @@ -358,7 +360,7 @@ void Analyse(const TColgp_Array2OfPnt& array2, Standard_Integer& theNbSamplesV) { gp_Vec Vi,Vip1; - Standard_Integer sh,nbch,i,j; + Standard_Integer sh = 0,nbch = 0,i = 0,j = 0; const Standard_Integer nbup = array2.UpperRow() - array2.LowerRow() + 1; const Standard_Integer nbvp = array2.UpperCol() - array2.LowerCol() + 1; diff --git a/src/IntTools/IntTools_TopolTool.hxx b/src/IntTools/IntTools_TopolTool.hxx index 2a5bcc6fbf..04b026194c 100644 --- a/src/IntTools/IntTools_TopolTool.hxx +++ b/src/IntTools/IntTools_TopolTool.hxx @@ -97,8 +97,8 @@ private: Standard_Integer myNbSmplU; Standard_Integer myNbSmplV; - Standard_Real myU0; - Standard_Real myV0; + Standard_Real myU0{}; + Standard_Real myV0{}; Standard_Real myDU; Standard_Real myDV; diff --git a/src/IntTools/IntTools_WLineTool.cxx b/src/IntTools/IntTools_WLineTool.cxx index 8d8e1a6b31..44c335b565 100644 --- a/src/IntTools/IntTools_WLineTool.cxx +++ b/src/IntTools/IntTools_WLineTool.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -51,8 +53,8 @@ Standard_Boolean IsDegeneratedZone(const gp_Pnt2d& aP2d, const Standard_Integer iDir) { Standard_Boolean bFlag=Standard_True; - Standard_Real US1, US2, VS1, VS2, dY, dX, d1, d2, dD; - Standard_Real aXm, aYm, aXb, aYb, aXe, aYe; + Standard_Real US1 = NAN, US2 = NAN, VS1 = NAN, VS2 = NAN, dY = NAN, dX = NAN, d1 = NAN, d2 = NAN, dD = NAN; + Standard_Real aXm = NAN, aYm = NAN, aXb = NAN, aYb = NAN, aXe = NAN, aYe = NAN; aS->Bounds(US1, US2, VS1, VS2); gp_Pnt aPm, aPb, aPe; @@ -123,8 +125,8 @@ Standard_Boolean IsPointInDegeneratedZone(const IntSurf_PntOn2S& aP2S, { Standard_Boolean bFlag=Standard_True; - Standard_Real US11, US12, VS11, VS12, US21, US22, VS21, VS22; - Standard_Real U1, V1, U2, V2, aDelta, aD; + Standard_Real US11 = NAN, US12 = NAN, VS11 = NAN, VS12 = NAN, US21 = NAN, US22 = NAN, VS21 = NAN, VS22 = NAN; + Standard_Real U1 = NAN, V1 = NAN, U2 = NAN, V2 = NAN, aDelta = NAN, aD = NAN; gp_Pnt2d aP2d; Handle(Geom_Surface)aS1 = BRep_Tool::Surface(aF1); @@ -208,7 +210,7 @@ Standard_Boolean IntTools_WLineTool::NotUseSurfacesForApprox(const TopoDS_Face& const Standard_Integer ifprm, const Standard_Integer ilprm) { - Standard_Boolean bPInDZ; + Standard_Boolean bPInDZ = 0; Handle(IntSurf_LineOn2S) aLineOn2S=WL->Curve(); @@ -239,9 +241,9 @@ Standard_Boolean IsPointOnBoundary(const Standard_Real theParameter, const Standard_Real theResolution, Standard_Boolean& IsOnFirstBoundary) { - Standard_Boolean bRet; - Standard_Integer i; - Standard_Real adist; + Standard_Boolean bRet = 0; + Standard_Integer i = 0; + Standard_Real adist = NAN; // bRet=Standard_False; for(i = 0; i < 2; ++i) { @@ -311,8 +313,8 @@ gp_Pnt2d AdjustByNeighbour(const gp_Pnt2d& theaNeighbourPoint, static void RefineVector(gp_Vec2d& aV2D) { - Standard_Integer k,m; - Standard_Real aC[2], aEps, aR1, aR2, aNum; + Standard_Integer k = 0,m = 0; + Standard_Real aC[2], aEps = NAN, aR1 = NAN, aR2 = NAN, aNum = NAN; // aEps=RealEpsilon(); aR1=1.-aEps; @@ -407,7 +409,7 @@ Standard_Boolean FindPoint(const gp_Pnt2d& theFirstPoint, if ( bIsOut ) acurvec.Reverse(); - Standard_Real aDotX, anAngleX; + Standard_Real aDotX = NAN, anAngleX = NAN; // aDotX = aVec.Dot(acurvec); anAngleX = aVec.Angle(acurvec); @@ -449,8 +451,8 @@ Standard_Boolean IntTools_WLineTool:: IntPatch_SequenceOfLine& theNewLines, const Handle(IntTools_Context)& aContext) { - Standard_Boolean bRet, bAvoidLineConstructor; - Standard_Integer aNbPnts, aNbParts; + Standard_Boolean bRet = 0, bAvoidLineConstructor = 0; + Standard_Integer aNbPnts = 0, aNbParts = 0; // bRet=Standard_False; aNbPnts=theWLine->NbPnts(); @@ -466,9 +468,9 @@ Standard_Boolean IntTools_WLineTool:: } } // - Standard_Boolean bIsPrevPointOnBoundary, bIsPointOnBoundary, bIsCurrentPointOnBoundary; - Standard_Integer nblines, pit, i, j; - Standard_Real aTol; + Standard_Boolean bIsPrevPointOnBoundary = 0, bIsPointOnBoundary = 0, bIsCurrentPointOnBoundary = 0; + Standard_Integer nblines = 0, pit = 0, i = 0, j = 0; + Standard_Real aTol = NAN; TColStd_Array1OfListOfInteger anArrayOfLines(1, aNbPnts); TColStd_Array1OfInteger anArrayOfLineType(1, aNbPnts); TColStd_ListOfInteger aListOfPointIndex; @@ -484,10 +486,10 @@ Standard_Boolean IntTools_WLineTool:: // // Points for(pit = 1; pit <= aNbPnts; ++pit) { - Standard_Boolean bIsOnFirstBoundary, isperiodic; - Standard_Real aResolution, aPeriod, alowerboundary, aupperboundary, U, V; - Standard_Real aParameter, anoffset, anAdjustPar; - Standard_Real umin, umax, vmin, vmax; + Standard_Boolean bIsOnFirstBoundary = 0, isperiodic = 0; + Standard_Real aResolution = NAN, aPeriod = NAN, alowerboundary = NAN, aupperboundary = NAN, U = NAN, V = NAN; + Standard_Real aParameter = NAN, anoffset = NAN, anAdjustPar = NAN; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; // bIsCurrentPointOnBoundary = Standard_False; const IntSurf_PntOn2S& aPoint = theWLine->Point(pit); @@ -647,7 +649,7 @@ Standard_Boolean IntTools_WLineTool:: } else { Standard_Real aPeriod = (parit == 0) ? aGASurface->UPeriod() : aGASurface->VPeriod(); - Standard_Real anoffset, anAdjustPar; + Standard_Real anoffset = NAN, anAdjustPar = NAN; GeomInt::AdjustPeriodic(aParameter, alowerboundary, aupperboundary, aPeriod, anAdjustPar, anoffset); @@ -686,7 +688,7 @@ Standard_Boolean IntTools_WLineTool:: Standard_Real aupperboundary = (bIsUBoundary) ? umax : vmax; Standard_Real aPeriod = (bIsUBoundary) ? aGASurface->UPeriod() : aGASurface->VPeriod(); Standard_Real aParameter = (bIsUBoundary) ? U : V; - Standard_Real anoffset, anAdjustPar; + Standard_Real anoffset = NAN, anAdjustPar = NAN; GeomInt::AdjustPeriodic(aParameter, alowerboundary, aupperboundary, aPeriod, anAdjustPar, anoffset); @@ -695,7 +697,7 @@ Standard_Boolean IntTools_WLineTool:: anotherPar += anoffset; Standard_Integer aneighbourpointindex = (j == 0) ? aListOfIndex.First() : aListOfIndex.Last(); const IntSurf_PntOn2S& aNeighbourPoint = theWLine->Point(aneighbourpointindex); - Standard_Real nU1, nV1; + Standard_Real nU1 = NAN, nV1 = NAN; if(surfit == 0) aNeighbourPoint.ParametersOnS1(nU1, nV1); @@ -737,7 +739,7 @@ Standard_Boolean IntTools_WLineTool:: while((anindexother <= iLast) && (anindexother >= iFirst)) { anindexother = (j == 0) ? (anindexother + 1) : (anindexother - 1); const IntSurf_PntOn2S& aPrevNeighbourPoint = theWLine->Point(anindexother); - Standard_Real nU2, nV2; + Standard_Real nU2 = NAN, nV2 = NAN; if(surfit == 0) aPrevNeighbourPoint.ParametersOnS1(nU2, nV2); @@ -754,7 +756,7 @@ Standard_Boolean IntTools_WLineTool:: if((fabs(anAngle) < (M_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) { if(bCheckAngle1) { - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; IntSurf_PntOn2S atmppoint = aNewP; atmppoint.SetValue((surfit == 0), anewU, anewV); atmppoint.Parameters(U1, V1, U2, V2); @@ -791,7 +793,7 @@ Standard_Boolean IntTools_WLineTool:: if ( bIsNearBoundary ) { // re-compute point near natural boundary or near tangent zone - Standard_Real u1, v1, u2, v2; + Standard_Real u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN; aNewP.Parameters( u1, v1, u2, v2 ); if(surfit == 0) anewpoint = gp_Pnt2d( u1, v1 ); @@ -800,7 +802,7 @@ Standard_Boolean IntTools_WLineTool:: Standard_Integer aneighbourpointindex1 = (j == 0) ? iFirst : iLast; const IntSurf_PntOn2S& aNeighbourPoint = theWLine->Point(aneighbourpointindex1); - Standard_Real nU1, nV1; + Standard_Real nU1 = NAN, nV1 = NAN; if(surfit == 0) aNeighbourPoint.ParametersOnS1(nU1, nV1); @@ -827,7 +829,7 @@ Standard_Boolean IntTools_WLineTool:: Standard_Integer aneighbourpointindex1 = (j == 0) ? iFirst : iLast; const IntSurf_PntOn2S& aNeighbourPoint = theWLine->Point(aneighbourpointindex1); - Standard_Real nU1, nV1; + Standard_Real nU1 = NAN, nV1 = NAN; if(surfit == 0) aNeighbourPoint.ParametersOnS1(nU1, nV1); @@ -840,7 +842,7 @@ Standard_Boolean IntTools_WLineTool:: while((aneighbourpointindex2 <= iLast) && (aneighbourpointindex2 >= iFirst)) { aneighbourpointindex2 = (j == 0) ? (aneighbourpointindex2 + 1) : (aneighbourpointindex2 - 1); const IntSurf_PntOn2S& aPrevNeighbourPoint = theWLine->Point(aneighbourpointindex2); - Standard_Real nU2, nV2; + Standard_Real nU2 = NAN, nV2 = NAN; if(surfit == 0) aPrevNeighbourPoint.ParametersOnS1(nU2, nV2); @@ -877,7 +879,7 @@ Standard_Boolean IntTools_WLineTool:: //Note, it may be shifted on a period Standard_Integer aneindex1 = (j == 0) ? iFirst : iLast; const IntSurf_PntOn2S& aNeighbourPoint = theWLine->Point(aneindex1); - Standard_Real nUn, nVn; + Standard_Real nUn = NAN, nVn = NAN; if(surfit == 0) aNeighbourPoint.ParametersOnS2(nUn, nVn); @@ -930,7 +932,7 @@ Standard_Boolean IntTools_WLineTool:: // Correct wlines.end // Split wlines.begin - Standard_Integer nbiter; + Standard_Integer nbiter = 0; // nbiter=1; if (!bAvoidLineConstructor) { @@ -938,8 +940,8 @@ Standard_Boolean IntTools_WLineTool:: } // for(j = 1; j <= nbiter; ++j) { - Standard_Real fprm, lprm; - Standard_Integer ifprm, ilprm; + Standard_Real fprm = NAN, lprm = NAN; + Standard_Integer ifprm = 0, ilprm = 0; // if(bAvoidLineConstructor) { ifprm = 1; diff --git a/src/IntWalk/IntWalk_PWalking.cxx b/src/IntWalk/IntWalk_PWalking.cxx index bc32b6a9ed..85cc24f4ad 100644 --- a/src/IntWalk/IntWalk_PWalking.cxx +++ b/src/IntWalk/IntWalk_PWalking.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -136,7 +138,7 @@ static void IsParallel(const Handle(IntSurf_LineOn2S)& theLine, if (aNPoint > aNbLinePnts) aNPoint = aNbLinePnts; - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; if(theCheckSurf1) theLine->Value(RealToInt(aNPoint)).ParametersOnS1(u, v); else @@ -206,10 +208,9 @@ tgfirst(Standard_False), tglast(Standard_False), myTangentIdx(0), fleche(Deflection), -pasMax(0.0), -tolconf(Epsilon), +pasMax(Increment*0.2), tolconf(Epsilon), myTolTang(TolTangency), -sensCheminement(1), +Um1(Adaptor3d_HSurfaceTool::FirstUParameter(Caro1)), UM1(Adaptor3d_HSurfaceTool::LastUParameter(Caro1)), Vm1(Adaptor3d_HSurfaceTool::FirstVParameter(Caro1)), VM1(Adaptor3d_HSurfaceTool::LastVParameter(Caro1)), Um2(Adaptor3d_HSurfaceTool::FirstUParameter(Caro2)), UM2(Adaptor3d_HSurfaceTool::LastUParameter(Caro2)), Vm2(Adaptor3d_HSurfaceTool::FirstVParameter(Caro2)), VM2(Adaptor3d_HSurfaceTool::LastVParameter(Caro2)), ResoU1(Adaptor3d_HSurfaceTool::UResolution(Caro1,Precision::Confusion())), ResoU2(Adaptor3d_HSurfaceTool::UResolution(Caro2,Precision::Confusion())), ResoV1(Adaptor3d_HSurfaceTool::VResolution(Caro1,Precision::Confusion())), ResoV2(Adaptor3d_HSurfaceTool::VResolution(Caro2,Precision::Confusion())), sensCheminement(1), previoustg(Standard_False), myIntersectionOn2S(Caro1,Caro2,TolTangency), STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0), @@ -217,26 +218,26 @@ STATIC_PRECEDENT_INFLEXION(0) { Standard_Real KELARG=20.; // - pasMax=Increment*0.2; //-- June 25 99 after problems with precision - Um1 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro1); - Vm1 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro1); - UM1 = Adaptor3d_HSurfaceTool::LastUParameter(Caro1); - VM1 = Adaptor3d_HSurfaceTool::LastVParameter(Caro1); - - Um2 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro2); - Vm2 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro2); - UM2 = Adaptor3d_HSurfaceTool::LastUParameter(Caro2); - VM2 = Adaptor3d_HSurfaceTool::LastVParameter(Caro2); - - ResoU1 = Adaptor3d_HSurfaceTool::UResolution(Caro1,Precision::Confusion()); - ResoV1 = Adaptor3d_HSurfaceTool::VResolution(Caro1,Precision::Confusion()); - - ResoU2 = Adaptor3d_HSurfaceTool::UResolution(Caro2,Precision::Confusion()); - ResoV2 = Adaptor3d_HSurfaceTool::VResolution(Caro2,Precision::Confusion()); - - Standard_Real NEWRESO; - Standard_Real MAXVAL; - Standard_Real MAXVAL2; + //-- June 25 99 after problems with precision + + + + + + + + + + + + + + + + + Standard_Real NEWRESO = NAN; + Standard_Real MAXVAL = NAN; + Standard_Real MAXVAL2 = NAN; // MAXVAL = Abs(Um1); MAXVAL2 = Abs(UM1); if(MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2; @@ -354,34 +355,34 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, done(Standard_True), close(Standard_False), fleche(Deflection), -tolconf(Epsilon), +pasMax(Increment*0.2), tolconf(Epsilon), myTolTang(TolTangency), -sensCheminement(1), +Um1(Adaptor3d_HSurfaceTool::FirstUParameter(Caro1)), UM1(Adaptor3d_HSurfaceTool::LastUParameter(Caro1)), Vm1(Adaptor3d_HSurfaceTool::FirstVParameter(Caro1)), VM1(Adaptor3d_HSurfaceTool::LastVParameter(Caro1)), Um2(Adaptor3d_HSurfaceTool::FirstUParameter(Caro2)), UM2(Adaptor3d_HSurfaceTool::LastUParameter(Caro2)), Vm2(Adaptor3d_HSurfaceTool::FirstVParameter(Caro2)), VM2(Adaptor3d_HSurfaceTool::LastVParameter(Caro2)), ResoU1(Adaptor3d_HSurfaceTool::UResolution(Caro1,Precision::Confusion())), ResoU2(Adaptor3d_HSurfaceTool::UResolution(Caro2,Precision::Confusion())), ResoV1(Adaptor3d_HSurfaceTool::VResolution(Caro1,Precision::Confusion())), ResoV2(Adaptor3d_HSurfaceTool::VResolution(Caro2,Precision::Confusion())), sensCheminement(1), myIntersectionOn2S(Caro1,Caro2,TolTangency), STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0), STATIC_PRECEDENT_INFLEXION(0) { Standard_Real KELARG=20.; // - pasMax=Increment*0.2; //-- June 25 99 after problems with precision + //-- June 25 99 after problems with precision // - Um1 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro1); - Vm1 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro1); - UM1 = Adaptor3d_HSurfaceTool::LastUParameter(Caro1); - VM1 = Adaptor3d_HSurfaceTool::LastVParameter(Caro1); + + + + - Um2 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro2); - Vm2 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro2); - UM2 = Adaptor3d_HSurfaceTool::LastUParameter(Caro2); - VM2 = Adaptor3d_HSurfaceTool::LastVParameter(Caro2); + + + + - ResoU1 = Adaptor3d_HSurfaceTool::UResolution(Caro1,Precision::Confusion()); - ResoV1 = Adaptor3d_HSurfaceTool::VResolution(Caro1,Precision::Confusion()); + + - ResoU2 = Adaptor3d_HSurfaceTool::UResolution(Caro2,Precision::Confusion()); - ResoV2 = Adaptor3d_HSurfaceTool::VResolution(Caro2,Precision::Confusion()); + + // - Standard_Real NEWRESO, MAXVAL, MAXVAL2; + Standard_Real NEWRESO = NAN, MAXVAL = NAN, MAXVAL2 = NAN; // MAXVAL = Abs(Um1); MAXVAL2 = Abs(UM1); @@ -517,7 +518,7 @@ Standard_Boolean IntWalk_PWalking::PerformFirstPoint (const TColStd_Array1OfRea sensCheminement = 1; close = Standard_False; // - Standard_Integer i; + Standard_Integer i = 0; TColStd_Array1OfReal Param(1,4); // for (i=1; i<=4; ++i) { @@ -720,9 +721,9 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, return; } // - Standard_Boolean Arrive, DejaReparti; + Standard_Boolean Arrive = 0, DejaReparti = 0; const Standard_Integer RejectIndexMAX = 250000; - Standard_Integer IncKey, RejectIndex; + Standard_Integer IncKey = 0, RejectIndex = 0; gp_Pnt pf,pl; // DejaReparti = Standard_False; @@ -757,7 +758,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, // IntWalk_StatusDeflection aStatus = IntWalk_OK, aPrevStatus = IntWalk_OK; Standard_Boolean NoTestDeflection = Standard_False; - Standard_Real SvParam[4], f; + Standard_Real SvParam[4], f = NAN; Standard_Integer LevelOfEmptyInmyIntersectionOn2S=0; Standard_Integer LevelOfPointConfondu = 0; Standard_Integer LevelOfIterWithoutAppend = -1; @@ -803,7 +804,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, previousPoint.Parameters(Param(1),Param(2),Param(3),Param(4)); // //--ofv.begin - Standard_Real aIncKey, aEps, dP1, dP2, dP3, dP4; + Standard_Real aIncKey = NAN, aEps = NAN, dP1 = NAN, dP2 = NAN, dP3 = NAN, dP4 = NAN; // dP1 = sensCheminement * pasuv[0] * previousd1.X() /f; dP2 = sensCheminement * pasuv[1] * previousd1.Y() /f; @@ -917,7 +918,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, //== Calculation of exact point from Param(.) is possible if (myIntersectionOn2S.IsEmpty()) { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; previousPoint.Parameters(u1,v1,u2,v2); // Arrive = Standard_False; @@ -1006,8 +1007,8 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, if(NbPasOKConseq >= 5) { NbPasOKConseq=0; - Standard_Boolean pastroppetit; - Standard_Real t; + Standard_Boolean pastroppetit = 0; + Standard_Real t = NAN; // do { @@ -1126,7 +1127,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, if(LevelOfPointConfondu>5) { - Standard_Boolean pastroppetit; + Standard_Boolean pastroppetit = 0; // do { @@ -1233,7 +1234,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, //== Check on the current point of myInters Standard_Boolean pointisvalid = Standard_False; { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; myIntersectionOn2S.Point().Parameters(u1,v1,u2,v2); // @@ -1260,7 +1261,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, //===================================================== //== Check on the previous Point { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; previousPoint.Parameters(u1,v1,u2,v2); if( u1 <= UM1 && u2 <= UM2 && v1 <= VM1 && v2 <= VM2 && u1 >= Um1 && u2 >= Um2 && @@ -1428,7 +1429,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, //== Check on PreviousPoint @@ { - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; previousPoint.Parameters(u1,v1,u2,v2); //To save initial 2d points @@ -1443,7 +1444,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, // //xf - Standard_Boolean bFlag1, bFlag2; + Standard_Boolean bFlag1 = 0, bFlag2 = 0; Standard_Real aTol2D=1.e-11; // bFlag1=u1 >= Um1-aTol2D && v1 >= Vm1-aTol2D && u1 <= UM1+aTol2D && v1 <= VM1+aTol2D; @@ -1453,9 +1454,9 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, if (line->NbPoints() > 1) { IntSurf_PntOn2S prevprevPoint = line->Value(line->NbPoints()-1); - Standard_Real ppU1, ppV1, ppU2, ppV2; + Standard_Real ppU1 = NAN, ppV1 = NAN, ppU2 = NAN, ppV2 = NAN; prevprevPoint.Parameters(ppU1, ppV1, ppU2, ppV2); - Standard_Real pU1, pV1, pU2, pV2; + Standard_Real pU1 = NAN, pV1 = NAN, pU2 = NAN, pV2 = NAN; previousPointSave.Parameters(pU1, pV1, pU2, pV2); gp_Vec2d V1onS1(gp_Pnt2d(ppU1, ppV1), gp_Pnt2d(pU1, pV1)); gp_Vec2d V2onS1(gp_Pnt2d(pU1, pV1), gp_Pnt2d(u1, v1)); @@ -1504,7 +1505,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, //There are three consecutive points: //previousPointSave -> ParamPnt -> curPnt. - Standard_Real prevU1, prevV1, prevU2, prevV2; + Standard_Real prevU1 = NAN, prevV1 = NAN, prevU2 = NAN, prevV2 = NAN; previousPointSave.Parameters(prevU1, prevV1, prevU2, prevV2); gp_Pnt2d prevPntOnS1(prevU1, prevV1), prevPntOnS2(prevU2, prevV2); gp_Pnt2d curPntOnS1(u1, v1), curPntOnS2(u2, v2); @@ -1863,9 +1864,9 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop // if(!bStop) { - Standard_Real u11,v11,u12,v12; + Standard_Real u11 = NAN,v11 = NAN,u12 = NAN,v12 = NAN; myIntersectionOn2S.Point().Parameters(u11,v11,u12,v12); - Standard_Real u21,v21,u22,v22; + Standard_Real u21 = NAN,v21 = NAN,u22 = NAN,v22 = NAN; previousPoint.Parameters(u21,v21,u22,v22); if(((fabs(u11-u21) < ResoU1) && (fabs(v11-v21) < ResoV1)) || @@ -1883,7 +1884,7 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop if(!bStop) { Standard_Boolean pointisvalid = Standard_False; - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; myIntersectionOn2S.Point().Parameters(u1,v1,u2,v2); if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 && @@ -1962,7 +1963,7 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop Standard_Boolean pointisvalid = Standard_False; previousPoint = myIntersectionOn2S.Point(); - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; previousPoint.Parameters(u1,v1,u2,v2); if(u1 <= UM1 && u2 <= UM2 && v1 <= VM1 && @@ -2374,10 +2375,10 @@ Standard_Boolean IntWalk_PWalking::HandleSingleSingularPoint(const Handle(Adapto gp_Pnt aP; gp_Vec aDU, aDV; gp_Pnt aPInt; - Standard_Integer k; + Standard_Integer k = 0; for (k = 0; k < 2; ++k) { - Standard_Integer iu, iv; + Standard_Integer iu = 0, iv = 0; iu = 2*k; iv = iu + 1; aSurfs[k]->D1(aPars[iu], aPars[iv], aPInt, aDU, aDV); @@ -2418,7 +2419,7 @@ Standard_Boolean IntWalk_PWalking::HandleSingleSingularPoint(const Handle(Adapto } // // - Standard_Integer j; + Standard_Integer j = 0; for (j = 1; j <= 4; ++j) { thePnt(j) = aPars[j - 1]; @@ -2704,7 +2705,7 @@ PutToBoundary(const Handle(Adaptor3d_Surface)& theASurf1, IsParallel(line, Standard_True, aTol, isU1parallel, isV1parallel); IsParallel(line, Standard_False, aTol, isU2parallel, isV2parallel); - Standard_Real u1, v1, u2, v2; + Standard_Real u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN; line->Value(1).Parameters(u1, v1, u2, v2); Standard_Real aDelta = 0.0; @@ -2916,8 +2917,8 @@ SeekAdditionalPoints( const Handle(Adaptor3d_Surface)& theASurf1, aNbPointsPrev = aNbPoints; for(Standard_Integer fp = 1, lp = 2; fp < aNbPoints; fp = lp + 1) { - Standard_Real U1f, V1f, U2f, V2f; //first point in 1st and 2nd surafaces - Standard_Real U1l, V1l, U2l, V2l; //last point in 1st and 2nd surafaces + Standard_Real U1f = NAN, V1f = NAN, U2f = NAN, V2f = NAN; //first point in 1st and 2nd surafaces + Standard_Real U1l = NAN, V1l = NAN, U2l = NAN, V2l = NAN; //last point in 1st and 2nd surafaces lp = fp+1; line->Value(fp).Parameters(U1f, V1f, U2f, V2f); @@ -3038,8 +3039,8 @@ RepartirOuDiviser(Standard_Boolean& DejaReparti, pasuv[2]=pasSav[2]; pasuv[3]=pasSav[3]; #else - Standard_Real u1,v1,u2,v2; - Standard_Real U1,V1,U2,V2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; + Standard_Real U1 = NAN,V1 = NAN,U2 = NAN,V2 = NAN; Standard_Integer nn=line->NbPoints(); if(nn>2) { line->Value(nn).Parameters(u1,v1,u2,v2); @@ -3088,8 +3089,8 @@ RepartirOuDiviser(Standard_Boolean& DejaReparti, pasuv[2]=pasSav[2]; pasuv[3]=pasSav[3]; #else - Standard_Real u1,v1,u2,v2; - Standard_Real U1,V1,U2,V2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; + Standard_Real U1 = NAN,V1 = NAN,U2 = NAN,V2 = NAN; Standard_Integer nn=line->NbPoints(); if(nn>2) { line->Value(nn).Parameters(u1,v1,u2,v2); @@ -3141,7 +3142,7 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIso } IntWalk_StatusDeflection aStatus = IntWalk_OK; - Standard_Real FlecheCourante , Ratio = 1.0; + Standard_Real FlecheCourante = NAN , Ratio = 1.0; // Caro1 and Caro2 const Handle(Adaptor3d_Surface)& Caro1 = myIntersectionOn2S.Function().AuxillarSurface1(); @@ -3208,7 +3209,7 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIso //Compute local resolution: for OCC26717 if (Abs(pasuv[choixIso] - pasInit[choixIso]) <= Precision::Confusion()) { - Standard_Real CurU, CurV; + Standard_Real CurU = NAN, CurV = NAN; if (choixIso == IntImp_UIsoparametricOnCaro1 || choixIso == IntImp_VIsoparametricOnCaro1) previousPoint.ParametersOnS1(CurU, CurV); @@ -3259,8 +3260,8 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIso } //================================================================================== - Standard_Real Up1,Vp1,Uc1,Vc1,Du1,Dv1,AbsDu1,AbsDu2,AbsDv1,AbsDv2; - Standard_Real Up2,Vp2,Uc2,Vc2,Du2,Dv2; + Standard_Real Up1 = NAN,Vp1 = NAN,Uc1 = NAN,Vc1 = NAN,Du1 = NAN,Dv1 = NAN,AbsDu1 = NAN,AbsDu2 = NAN,AbsDv1 = NAN,AbsDv2 = NAN; + Standard_Real Up2 = NAN,Vp2 = NAN,Uc2 = NAN,Vc2 = NAN,Du2 = NAN,Dv2 = NAN; previousPoint.Parameters(Up1,Vp1,Up2,Vp2); CurrentPoint.Parameters(Uc1,Vc1,Uc2,Vc2); @@ -3289,8 +3290,8 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIso ResoV2 < Precision::PConfusion() ) tolArea = tolArea*2.0; - Standard_Real Cosi1, CosRef1, Ang1, AngRef1, ResoUV1, Duv1, d1, tolCoeff1; - Standard_Real Cosi2, CosRef2, Ang2, AngRef2, ResoUV2, Duv2, d2, tolCoeff2; + Standard_Real Cosi1 = NAN, CosRef1 = NAN, Ang1 = NAN, AngRef1 = NAN, ResoUV1 = NAN, Duv1 = NAN, d1 = NAN, tolCoeff1 = NAN; + Standard_Real Cosi2 = NAN, CosRef2 = NAN, Ang2 = NAN, AngRef2 = NAN, ResoUV2 = NAN, Duv2 = NAN, d2 = NAN, tolCoeff2 = NAN; Cosi1 = Du1*previousd1.X() + Dv1*previousd1.Y(); Cosi2 = Du2*previousd2.X() + Dv2*previousd2.Y(); Duv1 = Du1*Du1 + Dv1*Dv1; @@ -3402,7 +3403,7 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIso if(pasuv[2]10.0 ) { Ratio=10.0; } - Standard_Real R1,R = pasInit[0]/pasuv[0]; + Standard_Real R1 = NAN,R = pasInit[0]/pasuv[0]; R1= pasInit[1]/pasuv[1]; if(R1Value(1); //On S1 POn2S1.ParametersOnS1(u,v); diff --git a/src/IntWalk/IntWalk_PWalking.hxx b/src/IntWalk/IntWalk_PWalking.hxx index d2442ad0ff..716fd83a18 100644 --- a/src/IntWalk/IntWalk_PWalking.hxx +++ b/src/IntWalk/IntWalk_PWalking.hxx @@ -27,6 +27,7 @@ #include class gp_Pnt; +class IntSurf_LineOn2S; //! This class implements an algorithm to determine the //! intersection between 2 parametrized surfaces, marching from @@ -248,12 +249,12 @@ private: Standard_Boolean done; Handle(IntSurf_LineOn2S) line; Standard_Boolean close; - Standard_Boolean tgfirst; - Standard_Boolean tglast; + Standard_Boolean tgfirst{}; + Standard_Boolean tglast{}; //! Index of point on the surface boundary. //! It is used for transition computation - Standard_Integer myTangentIdx; + Standard_Integer myTangentIdx{}; //! Tangent to WLine in the point with index myTangentIdx gp_Dir tgdir; @@ -262,10 +263,10 @@ private: Standard_Real pasMax; Standard_Real tolconf; Standard_Real myTolTang; - Standard_Real pasuv[4]; - Standard_Real myStepMin[4]; - Standard_Real pasSav[4]; - Standard_Real pasInit[4]; + Standard_Real pasuv[4]{}; + Standard_Real myStepMin[4]{}; + Standard_Real pasSav[4]{}; + Standard_Real pasInit[4]{}; Standard_Real Um1; Standard_Real UM1; Standard_Real Vm1; @@ -281,7 +282,7 @@ private: Standard_Integer sensCheminement; IntImp_ConstIsoparametric choixIsoSav; IntSurf_PntOn2S previousPoint; - Standard_Boolean previoustg; + Standard_Boolean previoustg{}; gp_Dir previousd; gp_Dir2d previousd1; gp_Dir2d previousd2; diff --git a/src/Interface/Interface_BitMap.cxx b/src/Interface/Interface_BitMap.cxx index 10af42ec9e..0d8a719344 100644 --- a/src/Interface/Interface_BitMap.cxx +++ b/src/Interface/Interface_BitMap.cxx @@ -70,7 +70,7 @@ void Interface_BitMap::Reservate (const Standard_Integer moreflags) if (nbflags >= thenbflags + moreflags) return; Standard_Integer nbw = thenbwords * (thenbflags+moreflags+2); Handle(TColStd_HArray1OfInteger) flags = new TColStd_HArray1OfInteger(0,nbw); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 0; i <= nb; i ++) flags->SetValue (i,theflags->Value(i)); for (i = nb+1; i <= nbw; i ++) flags->SetValue (i,0); @@ -104,7 +104,7 @@ Standard_Integer Interface_BitMap::AddFlag (const Standard_CString name) Standard_Integer deja = 0; if (thenames.IsNull()) thenames = new TColStd_HSequenceOfAsciiString(); else { - Standard_Integer i, nb = thenames->Length(); + Standard_Integer i = 0, nb = thenames->Length(); for (i = 1; i <= nb; i ++) { if (thenames->Value(i).IsEqual(".")) { thenames->ChangeValue(i).AssignCat(name); deja = i; } @@ -165,7 +165,7 @@ Standard_Integer Interface_BitMap::FlagNumber { if (name[0] == '\0') return 0; if (thenames.IsNull()) return 0; - Standard_Integer i, nb = thenames->Length(); + Standard_Integer i = 0, nb = thenames->Length(); for (i = 1; i <= nb; i ++) if (thenames->Value(i).IsEqual(name)) return i; return 0; @@ -217,7 +217,7 @@ Standard_Boolean Interface_BitMap::CTrue Standard_Integer numw = (thenbwords * flag) + (item >> 5); Standard_Integer numb = item & 31; Standard_Integer& val = theflags->ChangeValue (numw); - Standard_Integer res, mot = (1 << numb); + Standard_Integer res = 0, mot = (1 << numb); if (val == 0) { val = mot; return Standard_False; } else { res = val & mot; val |= mot; } @@ -230,7 +230,7 @@ Standard_Boolean Interface_BitMap::CFalse Standard_Integer numw = (thenbwords * flag) + (item >> 5); Standard_Integer numb = item & 31; Standard_Integer& val = theflags->ChangeValue (numw); - Standard_Integer res, mot = ~(1 << numb); + Standard_Integer res = 0, mot = ~(1 << numb); if (val == ~(0)) { val = mot; return Standard_False; } else { res = val | mot; val &= mot; } @@ -241,7 +241,7 @@ Standard_Boolean Interface_BitMap::CFalse void Interface_BitMap::Init (const Standard_Boolean val, const Standard_Integer flag) const { - Standard_Integer i, ii = thenbwords, i1 = thenbwords *flag; + Standard_Integer i = 0, ii = thenbwords, i1 = thenbwords *flag; if (flag < 0) { i1 = 0; ii = thenbwords*(thenbflags+1); } if (val) for (i = 0; i < ii; i ++) theflags->SetValue (i1+i,~(0)); else for (i = 0; i < ii; i ++) theflags->SetValue (i1+i, 0 ); diff --git a/src/Interface/Interface_BitMap.hxx b/src/Interface/Interface_BitMap.hxx index fd21c3f588..0d16377496 100644 --- a/src/Interface/Interface_BitMap.hxx +++ b/src/Interface/Interface_BitMap.hxx @@ -149,9 +149,9 @@ private: - Standard_Integer thenbitems; - Standard_Integer thenbwords; - Standard_Integer thenbflags; + Standard_Integer thenbitems{}; + Standard_Integer thenbwords{}; + Standard_Integer thenbflags{}; Handle(TColStd_HArray1OfInteger) theflags; Handle(TColStd_HSequenceOfAsciiString) thenames; diff --git a/src/Interface/Interface_Category.cxx b/src/Interface/Interface_Category.cxx index 05c3060aac..4c3a1af709 100644 --- a/src/Interface/Interface_Category.cxx +++ b/src/Interface/Interface_Category.cxx @@ -38,7 +38,7 @@ Standard_Integer Interface_Category::CatNum const Interface_ShareTool& theShares) { if (theEnt.IsNull()) return 0; - Standard_Integer CN; + Standard_Integer CN = 0; Handle(Interface_GeneralModule) aModule; if (!myGTool->Select (theEnt,aModule,CN)) return 0; return aModule->CategoryNumber (CN,theEnt,theShares); @@ -50,7 +50,7 @@ void Interface_Category::Compute { ClearNums(); if (theModel.IsNull()) return; - Standard_Integer CN, i, nb = theModel->NbEntities(); + Standard_Integer CN = 0, i = 0, nb = theModel->NbEntities(); myGTool->Reservate (nb); if (nb == 0) return; myNum = new TColStd_HArray1OfInteger (1,nb); myNum->Init(0); @@ -94,7 +94,7 @@ Standard_CString Interface_Category::Name (const Standard_Integer theNum) Standard_Integer Interface_Category::Number (const Standard_CString theName) { - Standard_Integer i; + Standard_Integer i = 0; for (i = theCats().Lower(); i <= theCats().Upper(); i ++) { if (theCats().ChangeValue(i).IsEqual(theName)) return i; } diff --git a/src/Interface/Interface_Check.cxx b/src/Interface/Interface_Check.cxx index b6ff1aff34..576d9a4d66 100644 --- a/src/Interface/Interface_Check.cxx +++ b/src/Interface/Interface_Check.cxx @@ -39,9 +39,9 @@ Interface_Check::Interface_Check() //purpose : //======================================================================= -Interface_Check::Interface_Check(const Handle(Standard_Transient)& anentity) +Interface_Check::Interface_Check(const Handle(Standard_Transient)& anentity) : theent(anentity) { - theent = anentity; + } // .... Ajout de message d Erreur vraie (Fail) @@ -421,7 +421,7 @@ Standard_Boolean Interface_Check::Complies(const Handle(TCollection_HAsciiString if (mess.IsNull()) return Standard_False; Standard_Integer lng = mess->Length(); if (status == Interface_CheckWarning || status == Interface_CheckAny) { - Standard_Integer i, nb = NbWarnings(); + Standard_Integer i = 0, nb = NbWarnings(); for (i = nb; i > 0; i --) { Handle(TCollection_HAsciiString) ames = Warning(i); if (incl == 0) { if (mess->IsSameString (ames)) return Standard_True; } @@ -430,7 +430,7 @@ Standard_Boolean Interface_Check::Complies(const Handle(TCollection_HAsciiString } } if (status == Interface_CheckFail || status == Interface_CheckAny) { - Standard_Integer i, nb = NbWarnings(); + Standard_Integer i = 0, nb = NbWarnings(); for (i = nb; i > 0; i --) { Handle(TCollection_HAsciiString) ames = Warning(i); if (incl == 0) { if (mess->IsSameString (ames)) return Standard_True; } @@ -528,7 +528,7 @@ Standard_Boolean Interface_Check::Remove(const Handle(TCollection_HAsciiString)& Standard_Boolean res = Standard_False; Standard_Integer lng = mess->Length(); if (status == Interface_CheckWarning || status == Interface_CheckAny) { - Standard_Integer i, nb = NbWarnings(); + Standard_Integer i = 0, nb = NbWarnings(); for (i = nb; i > 0; i --) { Standard_Boolean rem = Standard_False; Handle(TCollection_HAsciiString) ames = Warning(i); @@ -539,7 +539,7 @@ Standard_Boolean Interface_Check::Remove(const Handle(TCollection_HAsciiString)& } } if (status == Interface_CheckFail || status == Interface_CheckAny) { - Standard_Integer i, nb = NbWarnings(); + Standard_Integer i = 0, nb = NbWarnings(); for (i = nb; i > 0; i --) { Standard_Boolean rem = Standard_False; Handle(TCollection_HAsciiString) ames = Warning(i); @@ -561,7 +561,7 @@ Standard_Boolean Interface_Check::Remove(const Handle(TCollection_HAsciiString)& Standard_Boolean Interface_Check::Mend(const Standard_CString pref, const Standard_Integer num) { - Standard_Integer i, n1 = num, n2 = num; + Standard_Integer i = 0, n1 = num, n2 = num; if (pref && pref[2] == '\0') { if (pref[0] == 'F' && pref[1] == 'M') return Mend ("Mended",num); if (pref[0] == 'C' && pref[1] == 'A') { Clear(); return Standard_True; } @@ -634,7 +634,7 @@ void Interface_Check::GetEntity(const Handle(Standard_Transient)& anentity) void Interface_Check::GetMessages (const Handle(Interface_Check)& other) { - Standard_Integer nb,i; + Standard_Integer nb = 0,i = 0; if ( (nb = other->NbFails()) != 0) { if (thefails.IsNull()) thefails = new TColStd_HSequenceOfHAsciiString(); if (thefailo.IsNull()) thefailo = new TColStd_HSequenceOfHAsciiString(); @@ -664,7 +664,7 @@ void Interface_Check::GetMessages (const Handle(Interface_Check)& other) void Interface_Check::GetAsWarning(const Handle(Interface_Check)& other, const Standard_Boolean failsonly) { - Standard_Integer nb,i; + Standard_Integer nb = 0,i = 0; if ( (nb = other->NbFails()) != 0) { if (thewarns.IsNull()) thewarns = new TColStd_HSequenceOfHAsciiString(); if (thewarno.IsNull()) thewarno = new TColStd_HSequenceOfHAsciiString(); @@ -688,7 +688,7 @@ void Interface_Check::GetAsWarning(const Handle(Interface_Check)& other, void Interface_Check::Print(Standard_OStream& S, const Standard_Integer level, const Standard_Integer final) const { - Standard_Integer j, nb = NbFails(); + Standard_Integer j = 0, nb = NbFails(); if (level >= 1) { nb = NbFails(); diff --git a/src/Interface/Interface_CheckIterator.cxx b/src/Interface/Interface_CheckIterator.cxx index 645be1169c..3cd569ea20 100644 --- a/src/Interface/Interface_CheckIterator.cxx +++ b/src/Interface/Interface_CheckIterator.cxx @@ -141,7 +141,7 @@ void Interface_CheckIterator::Add(const Handle(Interface_Check)& ach, else nm = -1; } if (nm >= 0 && nm <= - (thecurr->Value()) ) { - Standard_Integer i , numpos = 0 , nb = thelist->Length(); + Standard_Integer i = 0 , numpos = 0 , nb = thelist->Length(); for (i = nb; i > 0; i --) if (thenums->Value(i) == nm) { numpos = i; break; } if (numpos > 0 && nm >= 0) { @@ -164,7 +164,7 @@ void Interface_CheckIterator::Add(const Handle(Interface_Check)& ach, const Handle(Interface_Check)& Interface_CheckIterator::Check (const Standard_Integer num) const { - Standard_Integer i, nb = thelist->Length(); + Standard_Integer i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { if (num == thenums->Value(i)) return thelist->Value(i); } @@ -184,7 +184,7 @@ const Handle(Interface_Check)& Interface_CheckIterator::Check if (!themod.IsNull()) num = themod->Number(ent); if (num > 0) return Check(num); - Standard_Integer i, nb = thelist->Length(); + Standard_Integer i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { if (ent == thelist->Value(i)->Entity()) return thelist->Value(i); } @@ -200,7 +200,7 @@ const Handle(Interface_Check)& Interface_CheckIterator::Check Handle(Interface_Check)& Interface_CheckIterator::CCheck (const Standard_Integer num) { - Standard_Integer i, nb = thenums->Length(); + Standard_Integer i = 0, nb = thenums->Length(); for (i = 1; i <= nb; i ++) { if (num == thenums->Value(i)) return thelist->ChangeValue(i); } @@ -222,7 +222,7 @@ Handle(Interface_Check)& Interface_CheckIterator::CCheck if (!themod.IsNull()) num = themod->Number(ent); if (num > 0) return CCheck(num); - Standard_Integer i, nb = thelist->Length(); + Standard_Integer i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { if (ent == thelist->Value(i)->Entity()) return thelist->ChangeValue(i); } @@ -243,7 +243,7 @@ Standard_Boolean Interface_CheckIterator::IsEmpty { if (thelist->IsEmpty()) return Standard_True; if (!failsonly) return Standard_False; - Standard_Integer i, nb = thelist->Length(); + Standard_Integer i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { if (thelist->Value(i)->HasFailed()) return Standard_False; } @@ -259,7 +259,7 @@ Standard_Boolean Interface_CheckIterator::IsEmpty Interface_CheckStatus Interface_CheckIterator::Status () const { Interface_CheckStatus stat = Interface_CheckOK; - Standard_Integer i, nb = thelist->Length(); + Standard_Integer i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { const Handle(Interface_Check) ach = thelist->Value(i); if (ach->HasFailed()) return Interface_CheckFail; @@ -351,7 +351,7 @@ Interface_CheckIterator Interface_CheckIterator::Extract { Interface_CheckIterator res; res.SetModel (themod); res.SetName (thename.ToCString()); - Standard_Integer i, nb = thelist->Length(); + Standard_Integer i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { const Handle(Interface_Check) ach = thelist->Value(i); Standard_Integer nbf = ach->NbFails(), nbw = ach->NbWarnings(); @@ -383,7 +383,7 @@ Interface_CheckIterator Interface_CheckIterator::Extract Handle(TCollection_HAsciiString) str = new TCollection_HAsciiString (mess); Interface_CheckIterator res; res.SetModel (themod); res.SetName (thename.ToCString()); - Standard_Integer i, nb = thelist->Length(); + Standard_Integer i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { const Handle(Interface_Check) ach = thelist->Value(i); if (ach->Complies(str,incl,stat)) res.Add (ach,thenums->Value(i)); @@ -403,7 +403,7 @@ Standard_Boolean Interface_CheckIterator::Remove(const Standard_CString mess, { Handle(TCollection_HAsciiString) str = new TCollection_HAsciiString (mess); Standard_Boolean res = Standard_False; - Standard_Integer i, nb = thelist->Length(); + Standard_Integer i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { Handle(Interface_Check) ach = thelist->ChangeValue(i); if (ach->Remove (str,incl,stat)) res = Standard_True; @@ -423,7 +423,7 @@ Handle(TColStd_HSequenceOfTransient) Interface_CheckIterator::Checkeds Handle(TColStd_HSequenceOfTransient) list; if (themod.IsNull()) return list; list = new TColStd_HSequenceOfTransient(); - Standard_Integer num, i, nb = thelist->Length(); + Standard_Integer num = 0, i = 0, nb = thelist->Length(); for (i = 1; i <= nb; i ++) { const Handle(Interface_Check) chk = thelist->Value(i); if (failsonly && !chk->HasFailed()) continue; @@ -523,7 +523,7 @@ void Interface_CheckIterator::Print(Standard_OStream& S, Standard_CString mesnum0 = ":"; Standard_CString mesnum1 = " (original):"; Standard_CString mesnum2 = " (computed):"; */ - Standard_Integer i, nbch = 0, nb = thelist->Length();//,j; svv #2 + Standard_Integer i = 0, nbch = 0, nb = thelist->Length();//,j; svv #2 Standard_Boolean yamod = !model.IsNull(); for (i = 1; i <= nb; i ++) { const Handle(Interface_Check) ach = thelist->Value(i); diff --git a/src/Interface/Interface_CheckTool.cxx b/src/Interface/Interface_CheckTool.cxx index fb44054c48..64450061e4 100644 --- a/src/Interface/Interface_CheckTool.cxx +++ b/src/Interface/Interface_CheckTool.cxx @@ -70,9 +70,9 @@ static void raisecheck (Standard_Failure& theException,Handle(Interface_Check)& Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol) : thegtool ( new Interface_GTool(protocol,model->NbEntities()) ) , - theshare (model,protocol) + theshare (model,protocol), thestat(0) { - thestat = 0; + } @@ -82,9 +82,9 @@ Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)& //======================================================================= Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)& model) - : thegtool(model->GTool()) , theshare (model,model->GTool()) + : thegtool(model->GTool()) , theshare (model,model->GTool()), thestat(0) { - thestat = 0; + thegtool->Reservate(model->NbEntities()); } @@ -121,7 +121,7 @@ void Interface_CheckTool::FillCheck(const Handle(Standard_Transient)& ent, Handle(Interface_Check)& ach) { Handle(Interface_GeneralModule) module; - Standard_Integer CN; + Standard_Integer CN = 0; if (thegtool->Select(ent,module,CN)) { // Sans try/catch (fait par l appelant, evite try/catch en boucle) if (!errh) { @@ -155,7 +155,7 @@ void Interface_CheckTool::FillCheck(const Handle(Standard_Transient)& ent, void Interface_CheckTool::Print(const Handle(Interface_Check)& ach, Standard_OStream& S) const { - Standard_Integer i, nb; + Standard_Integer i = 0, nb = 0; nb = ach->NbFails(); if (nb > 0) S << " Fail Messages : " << nb << " :\n"; for (i = 1; i <= nb; i ++) { diff --git a/src/Interface/Interface_CheckTool.hxx b/src/Interface/Interface_CheckTool.hxx index f948e371df..4fb14b0d46 100644 --- a/src/Interface/Interface_CheckTool.hxx +++ b/src/Interface/Interface_CheckTool.hxx @@ -130,7 +130,7 @@ private: Handle(Interface_GTool) thegtool; Interface_ShareTool theshare; - Standard_Integer thestat; + Standard_Integer thestat{}; }; diff --git a/src/Interface/Interface_CopyMap.cxx b/src/Interface/Interface_CopyMap.cxx index 60db31fbc5..3361316d87 100644 --- a/src/Interface/Interface_CopyMap.cxx +++ b/src/Interface/Interface_CopyMap.cxx @@ -23,8 +23,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Interface_CopyMap,Interface_CopyControl) // CopyMap : rien de plus qu une Map passive Interface_CopyMap::Interface_CopyMap (const Handle(Interface_InterfaceModel)& amodel) - : theres (0,amodel->NbEntities()) - { themod = amodel; } + : themod(amodel), theres (0,amodel->NbEntities()) + { } void Interface_CopyMap::Clear () diff --git a/src/Interface/Interface_CopyTool.cxx b/src/Interface/Interface_CopyTool.cxx index 323308ee17..39308534ac 100644 --- a/src/Interface/Interface_CopyTool.cxx +++ b/src/Interface/Interface_CopyTool.cxx @@ -39,25 +39,25 @@ Interface_CopyTool::Interface_CopyTool (const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib) - : thelib (lib) , thelst (amodel->NbEntities()) + : thelib (lib) , themod(amodel), themap(new Interface_CopyMap (amodel)), therep(new Interface_CopyMap (amodel)), thelst (amodel->NbEntities()), thelev(0), theimp(Standard_False) { thelst.Init(Standard_False); - themod = amodel; - themap = new Interface_CopyMap (amodel); - therep = new Interface_CopyMap (amodel); - thelev = 0; theimp = Standard_False; + + + + } Interface_CopyTool::Interface_CopyTool (const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol) - : thelib (protocol) , thelst (amodel->NbEntities()) + : thelib (protocol) , themod(amodel), themap(new Interface_CopyMap (amodel)), therep(new Interface_CopyMap (amodel)), thelst (amodel->NbEntities()), thelev(0), theimp(Standard_False) { thelst.Init(Standard_False); - themod = amodel; - themap = new Interface_CopyMap (amodel); - therep = new Interface_CopyMap (amodel); - thelev = 0; theimp = Standard_False; + + + + } @@ -154,7 +154,7 @@ Interface_CopyTool::Interface_CopyTool const Handle(Standard_Transient)& entto) { Handle(Interface_GeneralModule) module; - Standard_Integer CN; + Standard_Integer CN = 0; if (thelib.Select(entfrom,module,CN)) module->RenewImpliedCase(CN,entfrom,entto,*this); } diff --git a/src/Interface/Interface_CopyTool.hxx b/src/Interface/Interface_CopyTool.hxx index 984129c341..911f6950b1 100644 --- a/src/Interface/Interface_CopyTool.hxx +++ b/src/Interface/Interface_CopyTool.hxx @@ -209,7 +209,7 @@ private: Standard_Boolean theimp; Handle(Standard_Transient) theent; Handle(Interface_GeneralModule) themdu; - Standard_Integer theCN; + Standard_Integer theCN{}; }; diff --git a/src/Interface/Interface_EntityCluster.cxx b/src/Interface/Interface_EntityCluster.cxx index 45fdfd659e..da1303d7a9 100644 --- a/src/Interface/Interface_EntityCluster.cxx +++ b/src/Interface/Interface_EntityCluster.cxx @@ -36,13 +36,13 @@ Interface_EntityCluster::Interface_EntityCluster () { } { theents[0] = ent; } Interface_EntityCluster::Interface_EntityCluster - (const Handle(Interface_EntityCluster)& ec) - { thenext = ec; } + (const Handle(Interface_EntityCluster)& ec) : thenext(ec) + { } Interface_EntityCluster::Interface_EntityCluster (const Handle(Standard_Transient)& ent, - const Handle(Interface_EntityCluster)& ec) - { theents[0] = ent; thenext = ec; } + const Handle(Interface_EntityCluster)& ec) : thenext(ec) + { theents[0] = ent; } // .... AJOUT - SUPPRESSION .... @@ -69,7 +69,7 @@ Interface_EntityCluster::Interface_EntityCluster () { } (const Handle(Standard_Transient)& ent) { if (ent.IsNull()) throw Standard_NullObject("Interface_EntityCluster Remove"); - Standard_Integer i; + Standard_Integer i = 0; // est-il ici ? si oui, on a son rang if (ent == theents[0]) i = 1; else if (ent == theents[1]) i = 2; @@ -174,7 +174,7 @@ Standard_Boolean Interface_EntityCluster::IsLocalFull () const Standard_Integer Interface_EntityCluster::NbLocal () const { - Standard_Integer nb; + Standard_Integer nb = 0; if (!theents[3].IsNull()) nb = 4; else if (!theents[2].IsNull()) nb = 3; else if (!theents[1].IsNull()) nb = 2; diff --git a/src/Interface/Interface_EntityIterator.cxx b/src/Interface/Interface_EntityIterator.cxx index 7c7dd75a78..932f7d00fe 100644 --- a/src/Interface/Interface_EntityIterator.cxx +++ b/src/Interface/Interface_EntityIterator.cxx @@ -31,11 +31,11 @@ Interface_EntityIterator::Interface_EntityIterator () } Interface_EntityIterator::Interface_EntityIterator - (const Handle(TColStd_HSequenceOfTransient)& list) + (const Handle(TColStd_HSequenceOfTransient)& list) : thecurr(new Interface_IntVal), thelist(list) { - thecurr = new Interface_IntVal; + thecurr->CValue() = 0; - thelist = list; + } void Interface_EntityIterator::AddList @@ -78,7 +78,7 @@ Interface_EntityIterator::Interface_EntityIterator () (const Handle(Standard_Type)& atype, const Standard_Boolean keep) { if (thelist.IsNull()) return; - Standard_Integer i, n = thelist->Length(); + Standard_Integer i = 0, n = thelist->Length(); Handle(TColStd_HSequenceOfTransient) nlist = new TColStd_HSequenceOfTransient(); for (i = 1 ; i <= n ; i ++) { if (thelist->Value(i)->IsKind(atype) == keep) nlist->Append(thelist->Value(i)); @@ -100,7 +100,7 @@ Interface_EntityIterator::Interface_EntityIterator () { Standard_Integer res = 0; if (thelist.IsNull()) return res; - Standard_Integer i, n = thelist->Length(); + Standard_Integer i = 0, n = thelist->Length(); for (i = 1 ; i <= n ; i ++) { if (thelist->Value(i)->IsKind(atype)) res ++; } @@ -112,7 +112,7 @@ Interface_EntityIterator::Interface_EntityIterator () { Interface_EntityIterator res; if (thelist.IsNull()) return res; - Standard_Integer i, n = thelist->Length(); + Standard_Integer i = 0, n = thelist->Length(); for (i = 1 ; i <= n ; i ++) { if (thelist->Value(i)->IsKind(atype)) res.AddItem (thelist->Value(i)); } diff --git a/src/Interface/Interface_FileParameter.cxx b/src/Interface/Interface_FileParameter.cxx index 897deed8e6..95c41498a3 100644 --- a/src/Interface/Interface_FileParameter.cxx +++ b/src/Interface/Interface_FileParameter.cxx @@ -19,9 +19,9 @@ //function : Interface_FileParameter //purpose : //======================================================================= -Interface_FileParameter::Interface_FileParameter () +Interface_FileParameter::Interface_FileParameter () : thetype(Interface_ParamMisc), thenum(0) { -thetype = Interface_ParamMisc; thenum = 0; + } //======================================================================= diff --git a/src/Interface/Interface_FileParameter.hxx b/src/Interface/Interface_FileParameter.hxx index d806f909f1..6b5a71c19e 100644 --- a/src/Interface/Interface_FileParameter.hxx +++ b/src/Interface/Interface_FileParameter.hxx @@ -87,7 +87,7 @@ private: Interface_ParamType thetype; - Standard_PCharacter theval; + Standard_PCharacter theval{}; Standard_Integer thenum; diff --git a/src/Interface/Interface_FileReaderData.cxx b/src/Interface/Interface_FileReaderData.cxx index 810e298500..e6b61d993a 100644 --- a/src/Interface/Interface_FileReaderData.cxx +++ b/src/Interface/Interface_FileReaderData.cxx @@ -41,12 +41,12 @@ static Standard_Integer thenp0 = -1; Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr, const Standard_Integer npar) - : therrload (0), thenumpar (0,nbr), theents (0,nbr) + : thenum0(++thefic), therrload (0), theparams(new Interface_ParamSet (npar)), thenumpar (0,nbr), theents (0,nbr) { - theparams = new Interface_ParamSet (npar); + thenumpar.Init(0); thenm0 = -1; - thenum0 = ++thefic; + } Standard_Integer Interface_FileReaderData::NbRecords () const diff --git a/src/Interface/Interface_FileReaderTool.cxx b/src/Interface/Interface_FileReaderTool.cxx index a2504d05a1..f354ee7509 100644 --- a/src/Interface/Interface_FileReaderTool.cxx +++ b/src/Interface/Interface_FileReaderTool.cxx @@ -56,11 +56,11 @@ //purpose : //======================================================================= -Interface_FileReaderTool::Interface_FileReaderTool () +Interface_FileReaderTool::Interface_FileReaderTool () : themessenger(Message::DefaultMessenger()), theerrhand(Standard_True), thetrace(0) { - themessenger = Message::DefaultMessenger(); - theerrhand = Standard_True; - thetrace = 0; + + + thenbrep0 = thenbreps = 0; } @@ -201,7 +201,7 @@ Standard_Boolean Interface_FileReaderTool::ErrorHandle() const void Interface_FileReaderTool::SetEntities () { - Standard_Integer num; + Standard_Integer num = 0; thenbreps = 0; thenbrep0 = 0; for (num = thereader->FindNextRecord(0); num > 0; @@ -342,7 +342,7 @@ void Interface_FileReaderTool::LoadModel amodel->Reservate (thereader->NbEntities()); - Standard_Integer num, num0 = thereader->FindNextRecord(0); + Standard_Integer num = 0, num0 = thereader->FindNextRecord(0); num = num0; while (num > 0) { diff --git a/src/Interface/Interface_FloatWriter.cxx b/src/Interface/Interface_FloatWriter.cxx index e4d20b1eae..e9f45b4128 100644 --- a/src/Interface/Interface_FloatWriter.cxx +++ b/src/Interface/Interface_FloatWriter.cxx @@ -98,7 +98,7 @@ Standard_Integer Interface_FloatWriter::Convert (const Standard_Real val, { // Valeur flottante, expurgee de "0000" qui trainent et de "E+00" const Standard_Integer anMasSize = 5; // change 6 to 5: index 5 is not used below - char lxp[anMasSize], *pText; + char lxp[anMasSize], *pText = nullptr; int i0 = 0, j0 = 0; for (Standard_Integer i = 0; i < anMasSize; ++i) diff --git a/src/Interface/Interface_FloatWriter.hxx b/src/Interface/Interface_FloatWriter.hxx index bd092a068c..505a55423c 100644 --- a/src/Interface/Interface_FloatWriter.hxx +++ b/src/Interface/Interface_FloatWriter.hxx @@ -111,11 +111,11 @@ private: - Standard_Character themainform[12]; - Standard_Real therange1; - Standard_Real therange2; - Standard_Character therangeform[12]; - Standard_Boolean thezerosup; + Standard_Character themainform[12]{}; + Standard_Real therange1{}; + Standard_Real therange2{}; + Standard_Character therangeform[12]{}; + Standard_Boolean thezerosup{}; }; diff --git a/src/Interface/Interface_Graph.cxx b/src/Interface/Interface_Graph.cxx index 7d6412474e..e9cefcd0f2 100644 --- a/src/Interface/Interface_Graph.cxx +++ b/src/Interface/Interface_Graph.cxx @@ -87,9 +87,9 @@ Interface_Graph::Interface_Graph Interface_Graph::Interface_Graph (const Interface_Graph& agraph, const Standard_Boolean /*copied*/) -: themodel (agraph.Model()), thepresents ("") +: themodel (agraph.Model()), thepresents (""), thesharings(agraph.SharingTable()) { - thesharings = agraph.SharingTable(); + Standard_Integer nb = agraph.NbStatuses(); if(!nb) return; @@ -145,7 +145,7 @@ void Interface_Graph::Evaluate() return; - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <= n; i ++) { // ATTENTION : Si Entite non chargee donc illisible, basculer sur son // "Contenu" equivalent @@ -158,7 +158,7 @@ void Interface_Graph::Evaluate() // Mise en forme : liste d entiers for (iter.Start(); iter.More(); iter.Next()) { // num = 0 -> on sort du Model de depart, le noter "Error" et passer - Handle(Standard_Transient) entshare = iter.Value(); + const Handle(Standard_Transient)& entshare = iter.Value(); if(entshare == ent) continue; @@ -349,7 +349,7 @@ void Interface_Graph::GetFromIter if(thestats.IsNull()) return; for (iter.Start(); iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); + const Handle(Standard_Transient)& ent = iter.Value(); Standard_Integer num = EntityNumber(ent); if (!num) continue; @@ -368,7 +368,7 @@ void Interface_Graph::GetFromIter if(thestats.IsNull()) return; for (iter.Start(); iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); + const Handle(Standard_Transient)& ent = iter.Value(); Standard_Integer num = EntityNumber(ent); if (!num) continue; @@ -428,7 +428,7 @@ Interface_EntityIterator Interface_Graph::Shareds //if (num == 0) throw Standard_DomainError("Interface : Shareds"); Handle(Interface_GeneralModule) module; - Standard_Integer CN; + Standard_Integer CN = 0; if (themodel->GTool()->Select(aCurEnt,module,CN)) module->FillShared(themodel,CN,aCurEnt,iter); return iter; @@ -516,7 +516,7 @@ Handle(TCollection_HAsciiString) Interface_Graph::Name(const Handle(Standard_Tr if (gtool.IsNull()) return str; Handle(Interface_GeneralModule) module; - Standard_Integer CN; + Standard_Integer CN = 0; if (!gtool->Select(ent,module,CN)) return str; Interface_ShareTool sht (*this); diff --git a/src/Interface/Interface_GraphContent.cxx b/src/Interface/Interface_GraphContent.cxx index c0a16a91b0..e7fa227ea0 100644 --- a/src/Interface/Interface_GraphContent.cxx +++ b/src/Interface/Interface_GraphContent.cxx @@ -34,7 +34,7 @@ Interface_GraphContent::Interface_GraphContent () { } Standard_Integer nb = list.NbEntities(); if (nb == 0) return; // Liste redefinie a VIDE for( ; list.More(); list.Next()) { - Handle(Standard_Transient) curent = list.Value(); + const Handle(Standard_Transient)& curent = list.Value(); if (agraph.IsPresent(agraph.EntityNumber(curent))) GetOneItem (curent); } diff --git a/src/Interface/Interface_IntList.cxx b/src/Interface/Interface_IntList.cxx index 0b2510fead..6a3478dbbd 100644 --- a/src/Interface/Interface_IntList.cxx +++ b/src/Interface/Interface_IntList.cxx @@ -38,13 +38,13 @@ Interface_IntList::Interface_IntList () Initialize (nbe); } - Interface_IntList::Interface_IntList (const Interface_IntList& other, const Standard_Boolean copied) + Interface_IntList::Interface_IntList (const Interface_IntList& other, const Standard_Boolean copied) : thenbe(other.NbEntities()) { - thenbe = other.NbEntities(); + thenum = thecount = therank = 0; //szv#4:S4163:12Mar99 initialization needed other.Internals (thenbr, theents, therefs); if (copied) { - Standard_Integer i; + Standard_Integer i = 0; Handle(TColStd_HArray1OfInteger) ents = new TColStd_HArray1OfInteger (0,thenbe); ents->Init(0); for (i = 1; i <= thenbe; i ++) ents->SetValue (i,theents->Value(i)); Handle(TColStd_HArray1OfInteger) refs = new TColStd_HArray1OfInteger (0,thenbr); refs->Init(0); @@ -75,7 +75,7 @@ Standard_Integer Interface_IntList::NbEntities () const void Interface_IntList::SetNbEntities (const Standard_Integer nbe) { if (nbe <= theents->Upper()) return; - Standard_Integer i; + Standard_Integer i = 0; Handle(TColStd_HArray1OfInteger) ents = new TColStd_HArray1OfInteger (0,nbe); ents->Init(0); for (i = 1; i <= thenbe; i ++) ents->SetValue (i,theents->Value(i)); theents = ents; @@ -174,7 +174,7 @@ void Interface_IntList::Reservate (const Standard_Integer count) thenbr -= count; return; } - Standard_Integer up, oldup = 0; + Standard_Integer up = 0, oldup = 0; if (thenbr == 0) { // c-a-d pas encore allouee ... up = thenbe/2+1; if (up < 2) up = 2; if (up < count) up = count*3/2; @@ -268,7 +268,7 @@ Standard_Boolean Interface_IntList::Remove (const Standard_Integer) void Interface_IntList::Clear () { if (thenbr == 0) return; // deja clear - Standard_Integer i,low,up; + Standard_Integer i = 0,low = 0,up = 0; low = theents->Lower(); up = theents->Upper(); for (i = low; i <= up; i ++) theents->SetValue (i,0); thenbr = 0; @@ -279,7 +279,7 @@ void Interface_IntList::Clear () void Interface_IntList::AdjustSize (const Standard_Integer margin) { - Standard_Integer i, up = theents->Upper(); + Standard_Integer i = 0, up = theents->Upper(); if (up > thenbe) { Handle(TColStd_HArray1OfInteger) ents = new TColStd_HArray1OfInteger (0,thenbe); ents->Init(0); for (i = 1; i <= thenbe; i ++) ents->SetValue (i,theents->Value(i)); diff --git a/src/Interface/Interface_IntList.hxx b/src/Interface/Interface_IntList.hxx index 271c0baf41..2e14333b76 100644 --- a/src/Interface/Interface_IntList.hxx +++ b/src/Interface/Interface_IntList.hxx @@ -132,11 +132,11 @@ public: private: - Standard_Integer thenbe; - Standard_Integer thenbr; - Standard_Integer thenum; - Standard_Integer thecount; - Standard_Integer therank; + Standard_Integer thenbe{}; + Standard_Integer thenbr{}; + Standard_Integer thenum{}; + Standard_Integer thecount{}; + Standard_Integer therank{}; Handle(TColStd_HArray1OfInteger) theents; Handle(TColStd_HArray1OfInteger) therefs; diff --git a/src/Interface/Interface_IntVal.cxx b/src/Interface/Interface_IntVal.cxx index 5a79c3cb84..627b93d4f5 100644 --- a/src/Interface/Interface_IntVal.cxx +++ b/src/Interface/Interface_IntVal.cxx @@ -17,7 +17,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Interface_IntVal,Standard_Transient) -Interface_IntVal::Interface_IntVal () { theval = 0; } +Interface_IntVal::Interface_IntVal () : theval(0) { } Standard_Integer Interface_IntVal::Value () const { return theval; } diff --git a/src/Interface/Interface_InterfaceModel.cxx b/src/Interface/Interface_InterfaceModel.cxx index 184743ce32..35eda4f417 100644 --- a/src/Interface/Interface_InterfaceModel.cxx +++ b/src/Interface/Interface_InterfaceModel.cxx @@ -62,10 +62,10 @@ static const Handle(Interface_Check)& nulch() //======================================================================= Interface_InterfaceModel::Interface_InterfaceModel () - : haschecksem (Standard_False), isdispatch (Standard_False) + : thecheckstx(new Interface_Check), thechecksem(new Interface_Check), haschecksem (Standard_False), isdispatch (Standard_False) { - thecheckstx = new Interface_Check; - thechecksem = new Interface_Check; + + } @@ -498,7 +498,7 @@ void Interface_InterfaceModel::FillSemanticChecks for (checks.Start(); checks.More(); checks.Next()) nb ++; therepch.ReSize (therepch.Extent() + nb + 2); for (checks.Start(); checks.More(); checks.Next()) { - const Handle(Interface_Check) ach = checks.Value(); + const Handle(Interface_Check)& ach = checks.Value(); Standard_Integer num = checks.Number(); // global check : ok si MEME MODELE if (num == 0) thechecksem->GetMessages(ach); @@ -638,7 +638,7 @@ void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& ane else AddEntity(anent); Interface_EntityIterator iter; - Handle(Interface_GeneralModule) module; Standard_Integer CN; + Handle(Interface_GeneralModule) module; Standard_Integer CN = 0; if (lib.Select (anent,module,CN)) { module->FillSharedCase (CN,anent,iter); // FillShared tout court : supposerait que le modele soit deja pret @@ -678,7 +678,7 @@ void Interface_InterfaceModel::ReverseOrders (const Standard_Integer after) Standard_Integer nb = NbEntities(); //Standard_Integer num; svv #2 if (nb < 2 || after >= nb) return; TColStd_Array1OfTransient ents(1,nb); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for (i = 1; i <= nb; i ++) ents.SetValue (i, theentities.FindKey(i)); // On va vider la Map, puis la recharger : dans l ordre jusqua after @@ -710,7 +710,7 @@ void Interface_InterfaceModel::ChangeOrder(const Standard_Integer oldnum, const Standard_Integer newnum, const Standard_Integer cnt) //szv#4:S4163:12Mar99 `count` hid one from this { - Standard_Integer nb = NbEntities(); Standard_Integer i; //, num; svv #2 + Standard_Integer nb = NbEntities(); Standard_Integer i = 0; //, num; svv #2 if (nb < 2 || newnum >= nb || cnt<= 0) return; TColStd_Array1OfTransient ents(1,nb); // On va preparer le changement @@ -756,7 +756,8 @@ void Interface_InterfaceModel::GetFromTransfer { theentities.Clear(); theentities.ReSize (aniter.NbEntities()); for (aniter.Start(); aniter.More(); aniter.Next()) { - Handle(Standard_Transient) ent = aniter.Value(); AddEntity(ent); + const Handle(Standard_Transient)& ent = aniter.Value(); + AddEntity(ent); } } @@ -772,7 +773,7 @@ void Interface_InterfaceModel::GetFromTransfer Standard_Boolean Interface_InterfaceModel::SetCategoryNumber (const Standard_Integer num, const Standard_Integer val) { - Standard_Integer i,nb = NbEntities(); + Standard_Integer i = 0,nb = NbEntities(); if (num < 1 || num > nb) return Standard_False; if (thecategory.IsNull()) thecategory = new TCollection_HAsciiString(nb,' '); else if (thecategory->Length() < nb) { @@ -956,7 +957,7 @@ Standard_Integer Interface_InterfaceModel::NextNumberForLabel Standard_Integer lnb = labs->Length(); labs->LowerCase(); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for (i = fromnum+1; i <= n; i ++) { Handle(TCollection_HAsciiString) lab = StringLabel (Value(i)); if (lab.IsNull()) continue; diff --git a/src/Interface/Interface_LineBuffer.cxx b/src/Interface/Interface_LineBuffer.cxx index 629e591177..111e2e1b2f 100644 --- a/src/Interface/Interface_LineBuffer.cxx +++ b/src/Interface/Interface_LineBuffer.cxx @@ -18,10 +18,10 @@ #include Interface_LineBuffer::Interface_LineBuffer (const Standard_Integer size) -: myLine (1, size+1) +: myLine (1, size+1), myMax(size) { myLine.SetValue (1, '\0'); - myMax = size; + myInit = myLen = myGet = myKeep = myFriz = 0; } diff --git a/src/Interface/Interface_LineBuffer.hxx b/src/Interface/Interface_LineBuffer.hxx index 8cebf160cf..907d1e0e0f 100644 --- a/src/Interface/Interface_LineBuffer.hxx +++ b/src/Interface/Interface_LineBuffer.hxx @@ -112,7 +112,7 @@ private: Standard_Integer myGet; Standard_Integer myLen; Standard_Integer myFriz; - Standard_Character myKept; + Standard_Character myKept{}; }; diff --git a/src/Interface/Interface_MSG.cxx b/src/Interface/Interface_MSG.cxx index 55398cf2b1..bb10881f14 100644 --- a/src/Interface/Interface_MSG.cxx +++ b/src/Interface/Interface_MSG.cxx @@ -122,7 +122,7 @@ Interface_MSG::operator Standard_CString () const Standard_Integer Interface_MSG::Read (Standard_IStream& S) { - Standard_Integer i,nb = 0; + Standard_Integer i = 0,nb = 0; char buf[200], key[200]; buf[0] = '\0'; while (S.getline (buf,200)) { @@ -158,7 +158,7 @@ Standard_Integer Interface_MSG::Read (Standard_IStream& S) for (; iter.More(); iter.Next()) { if (!iter.Key().StartsWith(rootkey)) continue; S<<"@"<ToCString()<<"\n"; @@ -237,7 +237,7 @@ void Interface_MSG::SetMode (const Standard_Boolean running, void Interface_MSG::PrintTrace (Standard_OStream& S) { Handle(TCollection_HAsciiString) dup; - Standard_Integer i, nb = 0; + Standard_Integer i = 0, nb = 0; if (!thedup.IsNull()) nb = thedup->Length()/2; for (i = 1; i <= nb; i ++) { dup = thedup->Value(2*i-1); @@ -370,7 +370,7 @@ Standard_Boolean Interface_MSG::NDate (const Standard_CString text, Standard_Integer& mn, Standard_Integer& ss) { - Standard_Integer i ,num = 1; + Standard_Integer i = 0 ,num = 1; for (i = 0; text[i] != '\0'; i ++) { char val = text[i]; if (val >= 48 && val <= 57) { @@ -413,7 +413,7 @@ Standard_Integer Interface_MSG::CDate (const Standard_CString text1, Standard_CString Interface_MSG::Blanks (const Standard_Integer val, const Standard_Integer max) { - Standard_Integer count; + Standard_Integer count = 0; if (val < 0) return Interface_MSG::Blanks (-val,max-1); if (val < 10) count = 9; else if (val < 100) count = 8; diff --git a/src/Interface/Interface_ParamSet.cxx b/src/Interface/Interface_ParamSet.cxx index 20fc428713..dd606d8f27 100644 --- a/src/Interface/Interface_ParamSet.cxx +++ b/src/Interface/Interface_ParamSet.cxx @@ -20,13 +20,13 @@ IMPLEMENT_STANDARD_RTTIEXT(Interface_ParamSet,Standard_Transient) -Interface_ParamSet::Interface_ParamSet (const Standard_Integer nres, const Standard_Integer )//nst) +Interface_ParamSet::Interface_ParamSet (const Standard_Integer nres, const Standard_Integer ) : thelist(new Interface_ParamList), themxpar(nres), thenbpar(0), thelnval(0), thelnres(100)//nst) { - thelist = new Interface_ParamList;// (nst,nst+nres+2); - themxpar = nres; - thenbpar = 0; - thelnval = 0; - thelnres = 100; // *20; // 10 caracteres par Param (\0 inclus) : raisonnable + // (nst,nst+nres+2); + + + + // *20; // 10 caracteres par Param (\0 inclus) : raisonnable theval = new char[thelnres]; //szv#4:S4163:12Mar99 `thelnres+1` chars was wrong } @@ -53,7 +53,7 @@ Standard_Integer Interface_ParamSet::Append (const Standard_CString val, const } else { // .. Gestion locale des caracteres .. - Standard_Integer i; + Standard_Integer i = 0; if (thelnval + lnval + 1 > thelnres) { // Reservation de caracteres insuffisante : d abord augmenter Standard_Integer newres = (Standard_Integer)(thelnres*2 + lnval); @@ -131,7 +131,7 @@ void Interface_ParamSet::SetParam (const Standard_Integer num, const Interface_F Handle(Interface_ParamList) Interface_ParamSet::Params (const Standard_Integer num, const Standard_Integer nb) const { - Standard_Integer i, n0 = num-1, nbp = nb; + Standard_Integer i = 0, n0 = num-1, nbp = nb; if (num > themxpar) return thenext->Params (num-themxpar,nb); if (num == 0 && nb == 0) { diff --git a/src/Interface/Interface_ReportEntity.cxx b/src/Interface/Interface_ReportEntity.cxx index 3623ce8a6c..57005f2fde 100644 --- a/src/Interface/Interface_ReportEntity.cxx +++ b/src/Interface/Interface_ReportEntity.cxx @@ -24,10 +24,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Interface_ReportEntity,Standard_Transient) //purpose : //======================================================================= Interface_ReportEntity::Interface_ReportEntity - (const Handle(Standard_Transient)& unknown) + (const Handle(Standard_Transient)& unknown) : theconcerned(unknown), thecontent(unknown) { - theconcerned = unknown; - thecontent = unknown; + + } @@ -39,9 +39,9 @@ Interface_ReportEntity::Interface_ReportEntity Interface_ReportEntity::Interface_ReportEntity (const Handle(Interface_Check)& acheck, const Handle(Standard_Transient)& concerned) -: thecheck(acheck) +: thecheck(acheck), theconcerned(concerned) { - theconcerned = concerned; + thecheck->SetEntity(concerned); } diff --git a/src/Interface/Interface_STAT.cxx b/src/Interface/Interface_STAT.cxx index 24ad2109bb..b0c22af3ec 100644 --- a/src/Interface/Interface_STAT.cxx +++ b/src/Interface/Interface_STAT.cxx @@ -20,10 +20,10 @@ static Interface_STAT statvoid(""); static Interface_STAT statact (""); static Standard_CString voidname = ""; - Interface_STAT::Interface_STAT (const Standard_CString title) + Interface_STAT::Interface_STAT (const Standard_CString title) : thetitle(new TCollection_HAsciiString(title)), thetotal(1.) { - thetitle = new TCollection_HAsciiString(title); - thetotal = 1.; + + } Interface_STAT::Interface_STAT (const Interface_STAT& other) diff --git a/src/Interface/Interface_STAT.hxx b/src/Interface/Interface_STAT.hxx index ef406156f8..01ecb2027e 100644 --- a/src/Interface/Interface_STAT.hxx +++ b/src/Interface/Interface_STAT.hxx @@ -205,7 +205,7 @@ private: Handle(TCollection_HAsciiString) thetitle; - Standard_Real thetotal; + Standard_Real thetotal{}; Handle(TColStd_HSequenceOfAsciiString) thephnam; Handle(TColStd_HSequenceOfReal) thephw; Handle(TColStd_HSequenceOfInteger) thephdeb; diff --git a/src/Interface/Interface_ShareFlags.cxx b/src/Interface/Interface_ShareFlags.cxx index 56e33a3893..dfa6450c67 100644 --- a/src/Interface/Interface_ShareFlags.cxx +++ b/src/Interface/Interface_ShareFlags.cxx @@ -26,46 +26,46 @@ Interface_ShareFlags::Interface_ShareFlags (const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib) - : theflags (amodel->NbEntities()) + : themodel(amodel), theflags (amodel->NbEntities()) { Handle(Interface_GTool) gtool; // null - themodel = amodel; + Evaluate(lib,gtool); } Interface_ShareFlags::Interface_ShareFlags (const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_GTool)& gtool) - : theflags (amodel->NbEntities()) + : themodel(amodel), theflags (amodel->NbEntities()) { - themodel = amodel; + Evaluate(gtool->Lib(),gtool); } Interface_ShareFlags::Interface_ShareFlags (const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol) - : theflags (amodel->NbEntities()) + : themodel(amodel), theflags (amodel->NbEntities()) { Handle(Interface_GTool) gtool; // null - themodel = amodel; + Evaluate(Interface_GeneralLib(protocol),gtool); } Interface_ShareFlags::Interface_ShareFlags (const Handle(Interface_InterfaceModel)& amodel) - : theflags (amodel->NbEntities()) + : themodel(amodel), theflags (amodel->NbEntities()) { Handle(Interface_GTool) gtool = themodel->GTool(); gtool->Reservate(amodel->NbEntities()); - themodel = amodel; + Evaluate (gtool->Lib(),gtool); } Interface_ShareFlags::Interface_ShareFlags (const Interface_Graph& agraph) - : theflags (agraph.Model()->NbEntities()) + : themodel(agraph.Model()), theflags (agraph.Model()->NbEntities()) { - themodel = agraph.Model(); + Standard_Integer nb = themodel->NbEntities(); if (nb == 0) return; theroots = new TColStd_HSequenceOfTransient(); @@ -87,7 +87,7 @@ Interface_ShareFlags::Interface_ShareFlags Standard_Integer nb = themodel->NbEntities(); if (nb == 0) return; theroots = new TColStd_HSequenceOfTransient(); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <= nb; i ++) { // ATTENTION : Si Entite non chargee donc illisible, basculer sur son @@ -98,7 +98,7 @@ Interface_ShareFlags::Interface_ShareFlags // Resultat obtenu via GeneralLib Interface_EntityIterator iter; Handle(Interface_GeneralModule) module; - Standard_Integer CN; + Standard_Integer CN = 0; if (patool) { if (lib.Select(ent,module,CN)) module->FillShared(themodel,CN,ent,iter); } else { diff --git a/src/Interface/Interface_ShareTool.cxx b/src/Interface/Interface_ShareTool.cxx index 730420954d..8a82fb11f4 100644 --- a/src/Interface/Interface_ShareTool.cxx +++ b/src/Interface/Interface_ShareTool.cxx @@ -25,36 +25,36 @@ #include Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel, - const Interface_GeneralLib& lib) + const Interface_GeneralLib& lib) : theHGraph(new Interface_HGraph(amodel,lib)) { - theHGraph = new Interface_HGraph(amodel,lib); + } Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel, - const Handle(Interface_GTool)& gtool) + const Handle(Interface_GTool)& gtool) : theHGraph(new Interface_HGraph(amodel,gtool)) { - theHGraph = new Interface_HGraph(amodel,gtool); + } Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel, - const Handle(Interface_Protocol)& protocol) + const Handle(Interface_Protocol)& protocol) : theHGraph(new Interface_HGraph(amodel,protocol)) { - theHGraph = new Interface_HGraph(amodel,protocol); + } -Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel) +Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel) : theHGraph(new Interface_HGraph(amodel)) { - theHGraph = new Interface_HGraph(amodel); + } -Interface_ShareTool::Interface_ShareTool (const Interface_Graph& agraph) +Interface_ShareTool::Interface_ShareTool (const Interface_Graph& agraph) : theHGraph(new Interface_HGraph(agraph.Model())) { - theHGraph = new Interface_HGraph(agraph.Model()); + } -Interface_ShareTool::Interface_ShareTool (const Handle(Interface_HGraph)& ahgraph) +Interface_ShareTool::Interface_ShareTool (const Handle(Interface_HGraph)& ahgraph) : theHGraph(ahgraph) { - theHGraph = ahgraph; + } // Ajout des "Implied" sur toutes les Entites du Graphe @@ -156,7 +156,7 @@ Interface_ShareTool::Interface_ShareTool (const Handle(Interface_HGraph)& ahgrap { Handle(Interface_InterfaceModel) model = Model(); Interface_EntityIterator list; - Standard_Integer i, n0 = 0, nb = model->NbEntities(); + Standard_Integer i = 0, n0 = 0, nb = model->NbEntities(); Handle(TColStd_HArray1OfInteger) fl = new TColStd_HArray1OfInteger (0,nb); fl->Init(0); if (ent == model) { @@ -202,7 +202,7 @@ void Interface_ShareTool::Print (const Interface_EntityIterator& iter, Standard { S << " Nb.Entities : " << iter.NbEntities() << " : "; for (iter.Start(); iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); + const Handle(Standard_Transient)& ent = iter.Value(); S << " n0/id:"; Model()->Print (ent, S); } diff --git a/src/Interface/Interface_Static.cxx b/src/Interface/Interface_Static.cxx index afa597d56e..c2f9697656 100644 --- a/src/Interface/Interface_Static.cxx +++ b/src/Interface/Interface_Static.cxx @@ -18,6 +18,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(Interface_Static,Interface_TypedValue) @@ -49,20 +50,20 @@ static char defmess[31]; { switch (Type()) { case Interface_ParamInteger : { - Standard_Integer lim; + Standard_Integer lim = 0; if (other->IntegerLimit (Standard_True ,lim)) SetIntegerLimit (Standard_True ,lim); if (other->IntegerLimit (Standard_False,lim)) SetIntegerLimit (Standard_False,lim); } break; case Interface_ParamReal : { - Standard_Real lim; + Standard_Real lim = NAN; if (other->RealLimit (Standard_True ,lim)) SetRealLimit (Standard_True ,lim); if (other->RealLimit (Standard_False,lim)) SetRealLimit (Standard_False,lim); SetUnitDef (other->UnitDef()); } break; case Interface_ParamEnum : { - Standard_Boolean match; Standard_Integer e0,e1,i; + Standard_Boolean match = 0; Standard_Integer e0 = 0,e1 = 0,i = 0; other->EnumDef (e0,e1,match); StartEnum (e0,match); // if (e1 >= e0) theenums = new TColStd_HArray1OfAsciiString(e0,e1); @@ -171,7 +172,7 @@ Standard_Boolean Interface_Static::Init // Editions : init donne un petit texte d edition, en 2 termes "cmd var" : // imin imax rmin rmax unit // enum ematch eval - Standard_Integer i,iblc = 0; + Standard_Integer i = 0,iblc = 0; for (i = 0; init[i] != '\0'; i ++) if (init[i] == ' ') iblc = i+1; // Reconnaissance du sous-cas et aiguillage if (init[0] == 'i' && init[2] == 'i') @@ -242,12 +243,12 @@ Standard_CString Interface_Static::CDef return stat->EnumVal(nume); } if (part[0] == 'i') { - Standard_Integer ilim; + Standard_Integer ilim = 0; if (!stat->IntegerLimit((part[2] == 'a'),ilim)) return ""; Sprintf(defmess,"%d",ilim); return defmess; } if (part[0] == 'r') { - Standard_Real rlim; + Standard_Real rlim = NAN; if (!stat->RealLimit((part[2] == 'a'),rlim)) return ""; Sprintf(defmess,"%f",rlim); return defmess; } @@ -263,12 +264,12 @@ Standard_Integer Interface_Static::IDef Handle(Interface_Static) stat = Interface_Static::Static(name); if (stat.IsNull()) return 0; if (part[0] == 'i') { - Standard_Integer ilim; + Standard_Integer ilim = 0; if (!stat->IntegerLimit((part[2] == 'a'),ilim)) return 0; return ilim; } if (part[0] == 'e') { - Standard_Integer startcase,endcase; Standard_Boolean match; + Standard_Integer startcase = 0,endcase = 0; Standard_Boolean match = 0; stat->EnumDef (startcase,endcase,match); if (part[1] == 's') return startcase; if (part[1] == 'c') return (endcase - startcase + 1); diff --git a/src/Interface/Interface_Static.hxx b/src/Interface/Interface_Static.hxx index 7069c5f361..1a7dd158bf 100644 --- a/src/Interface/Interface_Static.hxx +++ b/src/Interface/Interface_Static.hxx @@ -264,18 +264,18 @@ private: Interface_ParamType thetype; Handle(Standard_Type) theotyp; Handle(Interface_Static) thewild; - Standard_Integer thelims; - Standard_Integer theintlow; - Standard_Integer theintup; - Standard_Real therealow; - Standard_Real therealup; + Standard_Integer thelims{}; + Standard_Integer theintlow{}; + Standard_Integer theintup{}; + Standard_Real therealow{}; + Standard_Real therealup{}; TCollection_AsciiString theunidef; Handle(TColStd_HArray1OfAsciiString) theenums; NCollection_DataMap theeadds; - Interface_StaticSatisfies thesatisf; + Interface_StaticSatisfies thesatisf{}; TCollection_AsciiString thesatisn; Standard_Boolean theupdate; - Standard_Integer theival; + Standard_Integer theival{}; Handle(TCollection_HAsciiString) thehval; Handle(Standard_Transient) theoval; diff --git a/src/Interface/Interface_UndefinedContent.cxx b/src/Interface/Interface_UndefinedContent.cxx index dd43ebf428..dab2693bad 100644 --- a/src/Interface/Interface_UndefinedContent.cxx +++ b/src/Interface/Interface_UndefinedContent.cxx @@ -32,8 +32,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Interface_UndefinedContent,Standard_Transient) // Unknown (ceci, a defaut d'un double heritage) : description litterale -Interface_UndefinedContent::Interface_UndefinedContent () // Unknown -{ thenbparams = 0; thenbstr = 0; } +Interface_UndefinedContent::Interface_UndefinedContent () : thenbparams(0), thenbstr(0) // Unknown +{ } // .... Les Parametres .... @@ -182,7 +182,7 @@ Interface_UndefinedContent::ParamValue thenbstr --; } // Supprimer ce parametre de la liste (qui est un tableau) - Standard_Integer np; // svv Jan11 2000 : porting on DEC + Standard_Integer np = 0; // svv Jan11 2000 : porting on DEC for (np = num+1; np <= thenbparams; np ++) theparams->SetValue(np-1,theparams->Value(np)); theparams->SetValue(thenbparams,0); @@ -242,7 +242,7 @@ Interface_UndefinedContent::ParamValue if (!c1ent) { // Literal : le supprimer et renumeroter les Parametres de type "Entity" // (Remove Literal mais dans un tableau) - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = rang+1; i <= thenbstr; i ++) thevalues->SetValue(i-1,thevalues->Value(i)); Handle(TCollection_HAsciiString) nulstr; diff --git a/src/Intf/Intf_Interference.cxx b/src/Intf/Intf_Interference.cxx index 4d5cce8cbc..f39e28e8af 100644 --- a/src/Intf/Intf_Interference.cxx +++ b/src/Intf/Intf_Interference.cxx @@ -68,7 +68,7 @@ Standard_Boolean Intf_Interference::Insert(const Intf_TangentZone& LaZone) // Loop on edges of the TangentZone : npcz=myTZones(Iz).NumberOfPoints(); - Standard_Integer Ipz0, Ipz1, Ipz2; + Standard_Integer Ipz0 = 0, Ipz1 = 0, Ipz2 = 0; for (Ipz1=1; Ipz1<=npcz; Ipz1++) { Ipz0=Ipz1-1; if (Ipz0<=0) Ipz0=npcz; @@ -76,7 +76,7 @@ Standard_Boolean Intf_Interference::Insert(const Intf_TangentZone& LaZone) // Loop on edges of the new TangentZone and search of the // corresponding point or edge: - Standard_Integer Ilz1, Ilz2; + Standard_Integer Ilz1 = 0, Ilz2 = 0; for (Ilz1=1; Ilz1<=nplz; Ilz1++) { Ilz2=(Ilz1%nplz)+1; @@ -114,7 +114,7 @@ Standard_Boolean Intf_Interference::Insert(const Intf_TangentZone& LaZone) if (lotp!=0) break; } - Standard_Integer Ilc; + Standard_Integer Ilc = 0; if (lotp!=0) { for (Ilc=lotl+1; (((Ilc-1)%nplz)+1)!=lunl; Ilc++) { myTZones(lzin).InsertBefore @@ -159,7 +159,7 @@ void Intf_Interference::Insert(const Intf_SectionPoint& pdeb, Standard_Integer TheLS=0; Standard_Boolean Begin=Standard_False; Intf_SectionPoint TheBout(pfin); - Standard_Integer ils, nd, nf; + Standard_Integer ils = 0, nd = 0, nf = 0; for (ils=1; ils<=mySLines.Length(); ils++) { Intf_SectionLine& SL=mySLines(ils); diff --git a/src/Intf/Intf_InterferencePolygon2d.cxx b/src/Intf/Intf_InterferencePolygon2d.cxx index 8a51000ee9..abff412725 100644 --- a/src/Intf/Intf_InterferencePolygon2d.cxx +++ b/src/Intf/Intf_InterferencePolygon2d.cxx @@ -16,6 +16,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -155,7 +157,7 @@ void Intf_InterferencePolygon2d::Interference Bnd_Box2d bSO; Bnd_Box2d bST; - Standard_Integer iObje1, iObje2, n1 = nbso, n2 = Obje2.NbSegments(); + Standard_Integer iObje1 = 0, iObje2 = 0, n1 = nbso, n2 = Obje2.NbSegments(); Standard_Real d1 = Obje1.DeflectionOverEstimation(), d2 = Obje2.DeflectionOverEstimation(); @@ -192,7 +194,7 @@ void Intf_InterferencePolygon2d::Interference Bnd_Box2d bSO; Bnd_Box2d bST; - Standard_Integer iObje1, iObje2, n = Obje.NbSegments(); + Standard_Integer iObje1 = 0, iObje2 = 0, n = Obje.NbSegments(); Standard_Real d = Obje.DeflectionOverEstimation(); gp_Pnt2d p1b, p1e, p2b, p2e; @@ -230,11 +232,11 @@ void Intf_InterferencePolygon2d::Clean() // if there is no real point of intersection EDGE/EDGE: Standard_Integer nbIt=myTZones.Length(); Standard_Integer decal=0; - Standard_Integer addr1, addr2; + Standard_Integer addr1 = 0, addr2 = 0; Intf_PIType dim1, dim2; - Standard_Real par; - Standard_Integer tsp, tsps; - Standard_Integer lpi, ltz; + Standard_Real par = NAN; + Standard_Integer tsp = 0, tsps = 0; + Standard_Integer lpi = 0, ltz = 0; Standard_Boolean Only1Seg=Standard_False; #define PI1 (myTZones(ltz-decal).GetPoint(lpi)) @@ -242,7 +244,7 @@ void Intf_InterferencePolygon2d::Clean() for (ltz=1; ltz<=nbIt; ltz++) { tsp=tsps=0; - Standard_Real pr1mi,pr1ma,pr2mi,pr2ma,delta1,delta2; + Standard_Real pr1mi = NAN,pr1ma = NAN,pr2mi = NAN,pr2ma = NAN,delta1 = NAN,delta2 = NAN; myTZones(ltz-decal).ParamOnFirst(pr1mi,pr1ma); delta1=pr1ma-pr1mi; myTZones(ltz-decal).ParamOnSecond(pr2mi,pr2ma); @@ -437,7 +439,7 @@ void Intf_InterferencePolygon2d::Intersect else if (rayIntf>=Tolerance) { Standard_Real deltaO=rayIntf/lgO; Standard_Real deltaT=rayIntf/lgT; - Standard_Real x, y; + Standard_Real x = NAN, y = NAN; Standard_Real parOdeb=parOSP-deltaO; Standard_Real parOfin=parOSP+deltaO; Standard_Real parTdeb=parTSP-sigPS*deltaT; @@ -496,7 +498,7 @@ void Intf_InterferencePolygon2d::Intersect parTmax=Max(parTmax, parT[i]); } - Standard_Real delta; + Standard_Real delta = NAN; if (parOdeb<0.) { delta=-parOdeb; parOdeb=0.; @@ -565,7 +567,7 @@ void Intf_InterferencePolygon2d::Intersect } //-- lbr : The points too close to each other are suspended - Standard_Boolean suppr; + Standard_Boolean suppr = 0; do { suppr=Standard_False; for(Standard_Integer i=2; suppr==Standard_False && i<=nbpi; i++) { @@ -621,7 +623,7 @@ void Intf_InterferencePolygon2d::Intersect TheTZ.PolygonInsert(thePi(2)); } else { - Standard_Integer lpj; + Standard_Integer lpj = 0; Standard_Integer lmin=1; Standard_Integer lmax=1; for (lpj=2; lpj<=nbpi; lpj++) { diff --git a/src/Intf/Intf_SectionLine.cxx b/src/Intf/Intf_SectionLine.cxx index 1af8df4891..12113a8fdb 100644 --- a/src/Intf/Intf_SectionLine.cxx +++ b/src/Intf/Intf_SectionLine.cxx @@ -32,9 +32,9 @@ Intf_SectionLine::Intf_SectionLine () //======================================================================= Intf_SectionLine::Intf_SectionLine (const Intf_SectionLine& Other) - : closed(Standard_False) + : myPoints(Other.myPoints), closed(Standard_False) { - myPoints=Other.myPoints; + } diff --git a/src/Intf/Intf_TangentZone.cxx b/src/Intf/Intf_TangentZone.cxx index 4d0caf51ea..ee7ff3a897 100644 --- a/src/Intf/Intf_TangentZone.cxx +++ b/src/Intf/Intf_TangentZone.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #define DEBUG_TANGENTZONE 0 @@ -211,7 +213,7 @@ Standard_Boolean Intf_TangentZone::IsEqual { if (Result.Length() != Other.Result.Length()) return Standard_False; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= Result.Length(); i++) { if (!Result(i).IsEqual(Other.Result(i))) return Standard_False; @@ -228,7 +230,7 @@ Standard_Boolean Intf_TangentZone::IsEqual Standard_Boolean Intf_TangentZone::Contains (const Intf_SectionPoint& ThePI) const { - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= Result.Length(); i++) if (ThePI.IsEqual(Result(i))) return Standard_True; @@ -278,7 +280,7 @@ void Intf_TangentZone::InfoSecond(Standard_Integer& segMin, Standard_Boolean Intf_TangentZone::RangeContains (const Intf_SectionPoint& ThePI) const { - Standard_Real a, b, c, d; + Standard_Real a = NAN, b = NAN, c = NAN, d = NAN; ParamOnFirst(a, b); ParamOnSecond(c, d); if (a<=ThePI.ParamOnFirst() && ThePI.ParamOnFirst()<=b && @@ -296,8 +298,8 @@ Standard_Boolean Intf_TangentZone::RangeContains Standard_Boolean Intf_TangentZone::HasCommonRange (const Intf_TangentZone& Other) const { - Standard_Real a1,b1,c1,d1; - Standard_Real a2,b2,c2,d2; + Standard_Real a1 = NAN,b1 = NAN,c1 = NAN,d1 = NAN; + Standard_Real a2 = NAN,b2 = NAN,c2 = NAN,d2 = NAN; ParamOnFirst(a1, b1); ParamOnSecond(a2, b2); Other.ParamOnFirst(c1, d1); diff --git a/src/Intf/Intf_Tool.cxx b/src/Intf/Intf_Tool.cxx index bc78341dbc..39f4d9f854 100644 --- a/src/Intf/Intf_Tool.cxx +++ b/src/Intf/Intf_Tool.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -70,12 +72,12 @@ void Intf_Tool::Lin2dBox(const gp_Lin2d& L2d, } else if (domain.IsVoid()) return; - Standard_Real xmin, xmax, ymin, ymax; + Standard_Real xmin = NAN, xmax = NAN, ymin = NAN, ymax = NAN; Standard_Real Xmin=0, Xmax=0, Ymin=0, Ymax=0; Standard_Real parmin=-Precision::Infinite(); Standard_Real parmax=Precision::Infinite(); - Standard_Real parcur, par1,par2; - Standard_Boolean xToSet, yToSet; + Standard_Real parcur = NAN, par1 = NAN,par2 = NAN; + Standard_Boolean xToSet = 0, yToSet = 0; domain.Get(xmin,ymin,xmax,ymax); @@ -172,11 +174,11 @@ void Intf_Tool::Hypr2dBox(const gp_Hypr2d& theHypr2d, Standard_Integer nbPi=Inters2d(theHypr2d, domain); if (nbPi>0) { - Standard_Real Xmin, Xmax, Ymin, Ymax; + Standard_Real Xmin = NAN, Xmax = NAN, Ymin = NAN, Ymax = NAN; domain.Get(Xmax, Ymax, Xmin, Ymin); - Standard_Integer npi; + Standard_Integer npi = 0; for (npi=0; npi 10.) ipmax = 10; else ipmax = (Standard_Integer)(endOnCurve[nbSeg-1]); @@ -250,7 +252,7 @@ void Intf_Tool::Hypr2dBox(const gp_Hypr2d& theHypr2d, // 10); ipmin=ipmin*10+1; ipmax=ipmax*10-1; - Standard_Integer ip, pas=1; + Standard_Integer ip = 0, pas=1; for (ip=ipmin; ip<=ipmax; ip+=pas) { boxHypr2d.Add(ElCLib::Value(Standard_Real(ip)/10., theHypr2d)); if (Abs(ip)<=10) pas=1; @@ -277,8 +279,8 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Hypr2d& theCurv, const Bnd_Box2d& Domain) { Standard_Integer nbpi=0; - Standard_Integer npi; - Standard_Real xmin, xmax, ymin, ymax; + Standard_Integer npi = 0; + Standard_Real xmin = NAN, xmax = NAN, ymin = NAN, ymax = NAN; Domain.Get(xmin,ymin,xmax,ymax); @@ -379,11 +381,11 @@ void Intf_Tool::Parab2dBox(const gp_Parab2d& theParab2d, Standard_Integer nbPi=Inters2d(theParab2d, domain); if (nbPi>0) { - Standard_Real Xmin, Xmax, Ymin, Ymax; + Standard_Real Xmin = NAN, Xmax = NAN, Ymin = NAN, Ymax = NAN; domain.Get(Xmax, Ymax, Xmin, Ymin); - Standard_Integer npi; + Standard_Integer npi = 0; for (npi=0; npi 10.) ipmax = 10; else ipmax = (Standard_Integer)(endOnCurve[nbSeg-1]); @@ -457,7 +459,7 @@ void Intf_Tool::Parab2dBox(const gp_Parab2d& theParab2d, // 10); ipmin=ipmin*10+1; ipmax=ipmax*10-1; - Standard_Integer ip, pas=1; + Standard_Integer ip = 0, pas=1; for (ip=ipmin; ip<=ipmax; ip+=pas) { boxParab2d.Add(ElCLib::Value(Standard_Real(ip)/10., theParab2d)); if (Abs(ip)<=10) pas=1; @@ -484,8 +486,8 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Parab2d& theCurv, const Bnd_Box2d& Domain) { Standard_Integer nbpi=0; - Standard_Integer npi; - Standard_Real xmin, xmax, ymin, ymax; + Standard_Integer npi = 0; + Standard_Real xmin = NAN, xmax = NAN, ymin = NAN, ymax = NAN; Domain.Get(xmin,ymin,xmax,ymax); @@ -587,12 +589,12 @@ void Intf_Tool::LinBox(const gp_Lin& L, } else if (domain.IsVoid()) return; - Standard_Real xmin, xmax, ymin, ymax, zmin, zmax; + Standard_Real xmin = NAN, xmax = NAN, ymin = NAN, ymax = NAN, zmin = NAN, zmax = NAN; Standard_Real Xmin=0, Xmax=0, Ymin=0, Ymax=0, Zmin=0, Zmax=0; Standard_Real parmin=-Precision::Infinite(); Standard_Real parmax=Precision::Infinite(); - Standard_Real parcur, par1,par2; - Standard_Boolean xToSet, yToSet, zToSet; + Standard_Real parcur = NAN, par1 = NAN,par2 = NAN; + Standard_Boolean xToSet = 0, yToSet = 0, zToSet = 0; domain.Get(xmin,ymin,zmin,xmax,ymax,zmax); @@ -723,12 +725,12 @@ void Intf_Tool::HyprBox(const gp_Hypr& theHypr, return; } // - Standard_Integer nbPi; + Standard_Integer nbPi = 0; // nbPi=Inters3d(theHypr, domain); if (nbPi>0) { - Standard_Integer npi; - Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + Standard_Integer npi = 0; + Standard_Real Xmin = NAN, Ymin = NAN, Zmin = NAN, Xmax = NAN, Ymax = NAN, Zmax = NAN; // domain.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); // @@ -778,7 +780,7 @@ void Intf_Tool::HyprBox(const gp_Hypr& theHypr, out=Standard_True; // //modified by NIZNHY-PKV Fri Jul 11 13:54:54 2008f - Standard_Real ipmin, ipmax, ip, pas; + Standard_Real ipmin = NAN, ipmax = NAN, ip = NAN, pas = NAN; // ipmin=-10.; if (beginOnCurve[nbSeg-1]>ipmin) { @@ -841,8 +843,8 @@ Standard_Integer Intf_Tool::Inters3d(const gp_Hypr& theCurv, const Bnd_Box& Domain) { Standard_Integer nbpi=0; - Standard_Integer npi; - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Integer npi = 0; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; Domain.Get(xmin, ymin, zmin, xmax, ymax, zmax); @@ -1016,8 +1018,8 @@ Standard_Integer Intf_Tool::Inters3d(const gp_Parab& theCurv, const Bnd_Box& Domain) { Standard_Integer nbpi=0; - Standard_Integer npi; - Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; + Standard_Integer npi = 0; + Standard_Real xmin = NAN, ymin = NAN, zmin = NAN, xmax = NAN, ymax = NAN, zmax = NAN; Domain.Get(xmin, ymin, zmin, xmax, ymax, zmax); @@ -1200,8 +1202,8 @@ void Intf_Tool::ParabBox(const gp_Parab& theParab, Standard_Integer nbPi = Inters3d(theParab, domain); if (nbPi > 0) { - Standard_Integer npi; - Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + Standard_Integer npi = 0; + Standard_Real Xmin = NAN, Ymin = NAN, Zmin = NAN, Xmax = NAN, Ymax = NAN, Zmax = NAN; domain.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); @@ -1245,17 +1247,17 @@ void Intf_Tool::ParabBox(const gp_Parab& theParab, endOnCurve[nbSeg - 1] = parint[npi]; out = Standard_True; - Standard_Integer ipmin; + Standard_Integer ipmin = 0; if (beginOnCurve[nbSeg - 1] < -10.) ipmin = -10; else ipmin = (Standard_Integer)(beginOnCurve[nbSeg - 1]); - Standard_Integer ipmax; + Standard_Integer ipmax = 0; if (endOnCurve[nbSeg - 1] > 10.) ipmax = 10; else ipmax = (Standard_Integer)(endOnCurve[nbSeg - 1]); ipmin = ipmin * 10 + 1; ipmax = ipmax * 10 - 1; - Standard_Integer ip, pas = 1; + Standard_Integer ip = 0, pas = 1; for (ip = ipmin; ip <= ipmax; ip += pas) { boxParab.Add(ElCLib::Value(Standard_Real(ip) / 10., theParab)); if (Abs(ip) <= 10) pas = 1; diff --git a/src/Intf/Intf_Tool.hxx b/src/Intf/Intf_Tool.hxx index 7d520eb062..0c6c585985 100644 --- a/src/Intf/Intf_Tool.hxx +++ b/src/Intf/Intf_Tool.hxx @@ -82,13 +82,13 @@ private: Standard_Integer nbSeg; - Standard_Real beginOnCurve[6]; - Standard_Real endOnCurve[6]; - Standard_Integer bord[12]; - Standard_Real xint[12]; - Standard_Real yint[12]; - Standard_Real zint[12]; - Standard_Real parint[12]; + Standard_Real beginOnCurve[6]{}; + Standard_Real endOnCurve[6]{}; + Standard_Integer bord[12]{}; + Standard_Real xint[12]{}; + Standard_Real yint[12]{}; + Standard_Real zint[12]{}; + Standard_Real parint[12]{}; }; diff --git a/src/Intrv/Intrv_Interval.cxx b/src/Intrv/Intrv_Interval.cxx index a2108f7f20..e38ac58510 100644 --- a/src/Intrv/Intrv_Interval.cxx +++ b/src/Intrv/Intrv_Interval.cxx @@ -36,10 +36,10 @@ //purpose : //======================================================================= Intrv_Interval::Intrv_Interval - () : myStart(RealFirst()), myEnd (RealLast ()) + () : myStart(RealFirst()), myEnd (RealLast ()), myTolStart((Standard_ShortReal)Epsilon(RealFirst())), myTolEnd((Standard_ShortReal)Epsilon(RealLast ())) { - myTolStart = (Standard_ShortReal)Epsilon(RealFirst()); - myTolEnd = (Standard_ShortReal)Epsilon(RealLast ()); + + } //======================================================================= @@ -49,10 +49,10 @@ Intrv_Interval::Intrv_Interval Intrv_Interval::Intrv_Interval (const Standard_Real Start, const Standard_Real End) : - myStart(Start), myEnd (End) + myStart(Start), myEnd (End), myTolStart((Standard_ShortReal)Epsilon(myStart)), myTolEnd((Standard_ShortReal)Epsilon(myEnd)) { - myTolStart = (Standard_ShortReal)Epsilon(myStart); - myTolEnd = (Standard_ShortReal)Epsilon(myEnd); + + } //======================================================================= diff --git a/src/Intrv/Intrv_Intervals.cxx b/src/Intrv/Intrv_Intervals.cxx index 9e4468e3b0..432a19148b 100644 --- a/src/Intrv/Intrv_Intervals.cxx +++ b/src/Intrv/Intrv_Intervals.cxx @@ -147,7 +147,7 @@ void Intrv_Intervals::Subtract (const Intrv_Interval& Tool) void Intrv_Intervals::Subtract (const Intrv_Intervals& Tool) { - Standard_Integer index; + Standard_Integer index = 0; for (index = 1; index <= Tool.myInter.Length(); index++) Subtract (Tool.myInter(index)); } @@ -246,7 +246,7 @@ void Intrv_Intervals::Unite (const Intrv_Interval& Tool) void Intrv_Intervals::Unite (const Intrv_Intervals& Tool) { - Standard_Integer index; + Standard_Integer index = 0; for (index = 1; index<=Tool.myInter.Length(); index++) Unite (Tool.myInter(index)); } diff --git a/src/LDOM/LDOMBasicString.cxx b/src/LDOM/LDOMBasicString.cxx index 7fa4fec88f..e42eec6ff6 100644 --- a/src/LDOM/LDOMBasicString.cxx +++ b/src/LDOM/LDOMBasicString.cxx @@ -308,7 +308,7 @@ Standard_Boolean LDOMBasicString::GetInteger (Standard_Integer& aResult) const case LDOM_AsciiDocClear: case LDOM_AsciiHashed: { - char * ptr; + char * ptr = nullptr; errno = 0; long aValue = strtol ((const char *)myVal.ptr, &ptr, 10); if (ptr == myVal.ptr || errno == ERANGE || errno == EINVAL) diff --git a/src/LDOM/LDOMParser.cxx b/src/LDOM/LDOMParser.cxx index 9137f8f832..b635e956ab 100644 --- a/src/LDOM/LDOMParser.cxx +++ b/src/LDOM/LDOMParser.cxx @@ -276,7 +276,7 @@ Standard_Boolean LDOMParser::ParseElement (Standard_IStream& theIStream, Standar for(;;) { LDOM_Node::NodeType aLocType; LDOMBasicString aTextValue; - char *aTextStr; + char *aTextStr = nullptr; LDOM_XmlReader::RecordType aType = ReadRecord (* myReader, theIStream, myCurrentData, theDocStart); switch (aType) { case LDOM_XmlReader::XML_UNKNOWN: @@ -324,7 +324,7 @@ Standard_Boolean LDOMParser::ParseElement (Standard_IStream& theIStream, Standar case LDOM_XmlReader::XML_TEXT: aLocType = LDOM_Node::TEXT_NODE; { - Standard_Integer aTextLen; + Standard_Integer aTextLen = 0; aTextStr = LDOM_CharReference::Decode ((char *)myCurrentData.str(), aTextLen); // try to convert to integer if (IsDigit(aTextStr[0])) { @@ -338,7 +338,7 @@ Standard_Boolean LDOMParser::ParseElement (Standard_IStream& theIStream, Standar case LDOM_XmlReader::XML_COMMENT: aLocType = LDOM_Node::COMMENT_NODE; { - Standard_Integer aTextLen; + Standard_Integer aTextLen = 0; aTextStr = LDOM_CharReference::Decode ((char *)myCurrentData.str(), aTextLen); aTextValue = LDOMBasicString (aTextStr, aTextLen, myDocument); } diff --git a/src/LDOM/LDOM_BasicElement.cxx b/src/LDOM/LDOM_BasicElement.cxx index b6334dbe57..0fd63cb420 100644 --- a/src/LDOM/LDOM_BasicElement.cxx +++ b/src/LDOM/LDOM_BasicElement.cxx @@ -39,7 +39,7 @@ LDOM_BasicElement& LDOM_BasicElement::Create void * aMem = aDoc -> Allocate (sizeof(LDOM_BasicElement)); LDOM_BasicElement * aNewElem = new (aMem) LDOM_BasicElement; - Standard_Integer aHash; + Standard_Integer aHash = 0; // aDoc -> HashedAllocate (aString, strlen(aString), aNewElem -> myTagName); aNewElem -> myTagName = aDoc -> HashedAllocate (aName, aLen, aHash); @@ -156,7 +156,7 @@ const LDOM_BasicAttribute& LDOM_BasicElement::GetAttribute (const LDOMBasicString& aName, const LDOM_BasicNode * aLastCh) const { - const LDOM_BasicNode * aNode; + const LDOM_BasicNode * aNode = nullptr; if (aLastCh) aNode = aLastCh -> GetSibling (); else @@ -184,8 +184,8 @@ const LDOM_BasicAttribute * LDOM_BasicElement::GetFirstAttribute const LDOM_BasicNode **& thePrevNode) const { // Find the First Attribute as well as the Last Child among siblings - const LDOM_BasicNode * aFirstAttr; - const LDOM_BasicNode ** aPrevNode; + const LDOM_BasicNode * aFirstAttr = nullptr; + const LDOM_BasicNode ** aPrevNode = nullptr; if (theLastCh) { aFirstAttr = theLastCh -> mySibling; aPrevNode = (const LDOM_BasicNode **) &(theLastCh -> mySibling); @@ -220,13 +220,13 @@ const LDOM_BasicNode * LDOM_BasicElement::AddAttribute const LDOM_BasicNode * aLastCh) { // Create attribute - Standard_Integer aHash; + Standard_Integer aHash = 0; LDOM_BasicAttribute& anAttr = LDOM_BasicAttribute::Create (anAttrName, aDocument, aHash); anAttr.myValue = anAttrValue; // Initialize the loop of attribute name search - const LDOM_BasicNode ** aPrNode; + const LDOM_BasicNode ** aPrNode = nullptr; const LDOM_BasicAttribute * aFirstAttr = GetFirstAttribute (aLastCh, aPrNode); const char * aNameStr = anAttrName.GetString(); @@ -283,7 +283,7 @@ const LDOM_BasicNode * LDOM_BasicElement::RemoveAttribute if ((myAttributeMask & anAttributeMask) == 0) { ; // maybe cause for exception } else { - const LDOM_BasicNode ** aPrevNode; // dummy + const LDOM_BasicNode ** aPrevNode = nullptr; // dummy const LDOM_BasicAttribute * anAttr = GetFirstAttribute (aLastCh, aPrevNode); while (anAttr) { if (anAttr -> getNodeType () == LDOM_Node::ATTRIBUTE_NODE) @@ -379,7 +379,7 @@ void LDOM_BasicElement::AddElementsByTagName void LDOM_BasicElement::AddAttributes (LDOM_NodeList& aList, const LDOM_BasicNode * aLastChild) const { - const LDOM_BasicNode * aBNode; + const LDOM_BasicNode * aBNode = nullptr; if (aLastChild) aBNode = aLastChild -> GetSibling(); else @@ -411,7 +411,7 @@ void LDOM_BasicElement::ReplaceElement for (; aBNode != NULL; aBNode = aBNode -> GetSibling()) { if (aBNode -> isNull()) continue; - LDOM_BasicNode * aNewBNode; + LDOM_BasicNode * aNewBNode = nullptr; const LDOM_Node::NodeType aNewNodeType = aBNode -> getNodeType(); switch (aNewNodeType) { case LDOM_Node::ELEMENT_NODE: @@ -450,7 +450,7 @@ void LDOM_BasicElement::ReplaceElement loop_attr: LDOM_BasicNode * aLastAttr = (LDOM_BasicNode *) aLastChild; for (; aBNode != NULL; aBNode = aBNode -> GetSibling()) { - Standard_Integer aHash; + Standard_Integer aHash = 0; if (aBNode -> isNull()) continue; const LDOM_BasicAttribute * aBNodeAtt= (const LDOM_BasicAttribute *) aBNode; LDOM_BasicAttribute * aNewAtt = diff --git a/src/LDOM/LDOM_CharReference.cxx b/src/LDOM/LDOM_CharReference.cxx index a6917beb68..8077e024e5 100644 --- a/src/LDOM/LDOM_CharReference.cxx +++ b/src/LDOM/LDOM_CharReference.cxx @@ -72,8 +72,8 @@ char * LDOM_CharReference::Decode (char * theSrc, Standard_Integer& theLen) memmove (aDstPtr, aSrcPtr, aByteCount); aSrcPtr = aPtr; if (aSrcPtr[1] == '#') { - unsigned long aChar; - char * aNewPtr; + unsigned long aChar = 0; + char * aNewPtr = nullptr; aDstPtr = aSrcPtr - anIncrCount + 1; if (aSrcPtr[2] == 'x') aChar = strtoul (&aSrcPtr[3], &aNewPtr, 16); // hex encoding @@ -147,7 +147,7 @@ char * LDOM_CharReference::Encode (const char* theSrc, Standard_Integer& theLen, entityRef("'", 6) }; - const char * endSrc, * ptrSrc = theSrc; + const char * endSrc = nullptr, * ptrSrc = theSrc; char * aDest = (char *) theSrc; Standard_Integer aCount = 0; // Analyse if there is a non-standard character in the string diff --git a/src/LDOM/LDOM_Document.cxx b/src/LDOM/LDOM_Document.cxx index 132f5bc588..f8547d5cff 100644 --- a/src/LDOM/LDOM_Document.cxx +++ b/src/LDOM/LDOM_Document.cxx @@ -25,9 +25,9 @@ //purpose : Constructor //======================================================================= -LDOM_Document::LDOM_Document () +LDOM_Document::LDOM_Document () : myMemManager(new LDOM_MemManager (MEMORY_GRANULE)) { - myMemManager = new LDOM_MemManager (MEMORY_GRANULE); + } //======================================================================= @@ -35,9 +35,9 @@ LDOM_Document::LDOM_Document () //purpose : Constructor to be used in LDOM_MemManager::Doc() //======================================================================= -LDOM_Document::LDOM_Document (const LDOM_MemManager& aMemManager) +LDOM_Document::LDOM_Document (const LDOM_MemManager& aMemManager) : myMemManager(&aMemManager) { - myMemManager = &aMemManager; + } //======================================================================= diff --git a/src/LDOM/LDOM_MemManager.cxx b/src/LDOM/LDOM_MemManager.cxx index b65287bd29..47ca3e6249 100644 --- a/src/LDOM/LDOM_MemManager.cxx +++ b/src/LDOM/LDOM_MemManager.cxx @@ -48,10 +48,10 @@ inline Standard_Boolean compareStrings (char * const str, inline LDOM_MemManager::MemBlock::MemBlock (const Standard_Integer aSize, LDOM_MemManager::MemBlock * aFirst) - : mySize (aSize), myNext (aFirst) + : mySize (aSize), myFreeSpace(myBlock = new Standard_Integer [aSize]), myEndBlock(myBlock + aSize), myNext (aFirst) { - myFreeSpace = myBlock = new Standard_Integer [aSize]; - myEndBlock = myBlock + aSize; + + } //======================================================================= @@ -118,7 +118,7 @@ LDOM_MemManager::HashTable::HashTable (/* const Standard_Integer aMask, */ LDOM_MemManager& aMemManager) : myManager (aMemManager) { - Standard_Integer m, nKeys = HASH_MASK + 1; + Standard_Integer m = 0, nKeys = HASH_MASK + 1; /* Standard_Integer m = aMask; Standard_Integer nKeys = 1; @@ -330,7 +330,7 @@ void LDOM_MemManager::HashedAllocate (const char * aString, LDOMBasicString& theResult) { theResult.myType = LDOMBasicString::LDOM_AsciiHashed; - Standard_Integer aDummy; + Standard_Integer aDummy = 0; const char * aHashedString = HashedAllocate (aString, theLen, aDummy); if (aHashedString != NULL) theResult.myVal.ptr = (void *) aHashedString; diff --git a/src/LDOM/LDOM_NodeList.cxx b/src/LDOM/LDOM_NodeList.cxx index a5ea3dfbe1..7adcb949fa 100644 --- a/src/LDOM/LDOM_NodeList.cxx +++ b/src/LDOM/LDOM_NodeList.cxx @@ -27,9 +27,9 @@ IMPLEMENT_SEQUENCE (LDOM_BasicNodeSequence, LDOM_BasicNodePtr) //purpose : Constructor //======================================================================= -LDOM_NodeList::LDOM_NodeList ( ) +LDOM_NodeList::LDOM_NodeList ( ) : mySeq(new LDOM_BasicNodeSequence) { - mySeq = new LDOM_BasicNodeSequence; + } //======================================================================= @@ -38,9 +38,9 @@ LDOM_NodeList::LDOM_NodeList ( ) //======================================================================= LDOM_NodeList::LDOM_NodeList (const Handle(LDOM_MemManager)& aDoc) - : myDoc (aDoc) + : myDoc (aDoc), mySeq(new LDOM_BasicNodeSequence) { - mySeq = new LDOM_BasicNodeSequence; + } //======================================================================= @@ -58,11 +58,11 @@ void LDOM_NodeList::Append (const LDOM_BasicNode& aNode) const //purpose : Copy constructor //======================================================================= -LDOM_NodeList::LDOM_NodeList (const LDOM_NodeList& theOther) +LDOM_NodeList::LDOM_NodeList (const LDOM_NodeList& theOther) : mySeq(new LDOM_BasicNodeSequence), myDoc(theOther.myDoc) { - mySeq = new LDOM_BasicNodeSequence; + * mySeq = * theOther.mySeq; - myDoc = theOther.myDoc; + } //======================================================================= diff --git a/src/LDOM/LDOM_OSStream.cxx b/src/LDOM/LDOM_OSStream.cxx index 4734721346..2bebdfe097 100644 --- a/src/LDOM/LDOM_OSStream.cxx +++ b/src/LDOM/LDOM_OSStream.cxx @@ -37,10 +37,10 @@ LDOM_SBuffer::LDOM_StringElem::LDOM_StringElem //======================================================================= LDOM_SBuffer::LDOM_SBuffer (const Standard_Integer theMaxBuf) : myMaxBuf (theMaxBuf), myLength(0), - myAlloc (new NCollection_IncAllocator) + myCurString(myFirstString), myAlloc (new NCollection_IncAllocator) { myFirstString = new (myAlloc) LDOM_StringElem (theMaxBuf, myAlloc); - myCurString = myFirstString; + } //======================================================================= diff --git a/src/LDOM/LDOM_XmlReader.cxx b/src/LDOM/LDOM_XmlReader.cxx index 17c15c90a3..88e84ec8b2 100644 --- a/src/LDOM/LDOM_XmlReader.cxx +++ b/src/LDOM/LDOM_XmlReader.cxx @@ -90,7 +90,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord (Standard_IStream& theIStr theData.Clear(); myError.Clear(); ParserState aState = STATE_WAITING; - const char * aStartData = NULL, * aNameEnd = NULL, * aPtr; + const char * aStartData = NULL, * aNameEnd = NULL, * aPtr = nullptr; LDOMBasicString anAttrName, anAttrValue; char anAttDelimiter = '\0'; Standard_Boolean aHasRead = Standard_False; @@ -129,7 +129,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord (Standard_IStream& theIStr // Read the full buffer and reset start and end buffer pointers myPtr = &myBuffer[0]; - Standard_Size aNBytes; + Standard_Size aNBytes = 0; if (myTagPerStep) { @@ -578,7 +578,7 @@ attr_name: ePtr = strchr (aDataString, '\0'); } - Standard_Integer aDataLen; + Standard_Integer aDataLen = 0; aDataString = LDOM_CharReference::Decode (aDataString, aDataLen); if (IsDigit(aDataString[0])) { if (getInteger (anAttrValue, aDataString, ePtr)) @@ -635,7 +635,7 @@ static Standard_Boolean isName (const char * aString, const char * aStringEnd, const char *& aNameEnd) { - Standard_Boolean aResult; + Standard_Boolean aResult = 0; char aCh = aString[0]; if (IsAlphabetic(aCh) || aCh == '_' || aCh == ':') { const char * aPtr = &aString[1]; @@ -692,7 +692,7 @@ Standard_Boolean LDOM_XmlReader::getInteger (LDOMBasicString& theValue, const char * theStart, const char * theEnd) { - char * ptr; + char * ptr = nullptr; errno = 0; if (theEnd - theStart == 1 || theStart[0] != '0') { diff --git a/src/LDOM/LDOM_XmlReader.hxx b/src/LDOM/LDOM_XmlReader.hxx index 9703f025fa..11e5c33a6a 100644 --- a/src/LDOM/LDOM_XmlReader.hxx +++ b/src/LDOM/LDOM_XmlReader.hxx @@ -89,7 +89,7 @@ class LDOM_XmlReader const LDOM_BasicNode * myLastChild; // optim. reading attributes const char * myPtr; const char * myEndPtr; - char myBuffer [XML_BUFFER_SIZE+4]; + char myBuffer [XML_BUFFER_SIZE+4]{}; Standard_Boolean myTagPerStep; LDOM_OSStream::BOMType myBOM; }; diff --git a/src/LDOM/LDOM_XmlWriter.cxx b/src/LDOM/LDOM_XmlWriter.cxx index 950d5692be..0a2c079238 100644 --- a/src/LDOM/LDOM_XmlWriter.cxx +++ b/src/LDOM/LDOM_XmlWriter.cxx @@ -327,7 +327,7 @@ void LDOM_XmlWriter::Write (Standard_OStream& theOStream, const LDOMBasicString& { case LDOMBasicString::LDOM_Integer: { - Standard_Integer aValue; + Standard_Integer aValue = 0; theString.GetInteger (aValue); TCollection_AsciiString aStrValue (aValue); @@ -355,7 +355,7 @@ void LDOM_XmlWriter::Write (Standard_OStream& theOStream, const LDOMBasicString& const char* aStr = theString.GetString(); if (aStr) { - Standard_Integer aLen; + Standard_Integer aLen = 0; char* encStr = LDOM_CharReference::Encode (aStr, aLen, Standard_False); if (aLen > 0) { @@ -408,7 +408,7 @@ void LDOM_XmlWriter::WriteAttribute (Standard_OStream& theOStream, const LDOM_No // Integer attribute value if (aValueStr.Type() == LDOMBasicString::LDOM_Integer) { - Standard_Integer anIntValue; + Standard_Integer anIntValue = 0; aValueStr.GetInteger (anIntValue); aLength = (Standard_Integer)(20 + strlen (aName)); @@ -429,7 +429,7 @@ void LDOM_XmlWriter::WriteAttribute (Standard_OStream& theOStream, const LDOM_No } else // String attribute value { - char* encStr; + char* encStr = nullptr; const char* aValue = aValueStr.GetString(); if (aValueStr.Type() == LDOMBasicString::LDOM_AsciiDocClear) { diff --git a/src/LProp/LProp_AnalyticCurInf.cxx b/src/LProp/LProp_AnalyticCurInf.cxx index 2678b6263f..020798b306 100644 --- a/src/LProp/LProp_AnalyticCurInf.cxx +++ b/src/LProp/LProp_AnalyticCurInf.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -45,7 +47,7 @@ void LProp_AnalyticCurInf::Perform (const GeomAbs_CurveType CType, case GeomAbs_Ellipse: { - Standard_Real U1,U2,U3,U4; + Standard_Real U1 = NAN,U2 = NAN,U3 = NAN,U4 = NAN; Standard_Real UFPlus2PI = UFirst + 2*M_PI; U1 = ElCLib::InPeriod(0.0 ,UFirst,UFPlus2PI); diff --git a/src/Law/Law.cxx b/src/Law/Law.cxx index 0623d1792c..99b5d42fe7 100644 --- a/src/Law/Law.cxx +++ b/src/Law/Law.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -29,7 +31,7 @@ Handle(Law_BSpFunc) Law::MixBnd(const Handle(Law_Linear)& Lin) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Lin->Bounds(f,l); TColStd_Array1OfReal Knots(1,4); TColStd_Array1OfInteger Mults(1,4); @@ -50,7 +52,7 @@ Handle(TColStd_HArray1OfReal) Law::MixBnd const TColStd_Array1OfInteger& Mults, const Handle(Law_Linear)& Lin) { - Standard_Integer nbpol = 0, nbfk = 0, i, j, k = 0; + Standard_Integer nbpol = 0, nbfk = 0, i = 0, j = 0, k = 0; for(i = Mults.Lower(); i <= Mults.Upper(); i++){ nbfk += Mults(i); } @@ -119,7 +121,7 @@ Handle(TColStd_HArray1OfReal) Law::MixTgt Standard_Real first = Knots(Knots.Lower()); Standard_Real last = Knots(Knots.Upper()); Standard_Real piv = Knots(Index); - Standard_Integer nbpol = 0, nbfk = 0, i, j, k = 0; + Standard_Integer nbpol = 0, nbfk = 0, i = 0, j = 0, k = 0; for(i = Mults.Lower(); i <= Mults.Upper(); i++){ nbfk += Mults(i); } @@ -155,7 +157,7 @@ Handle(Law_BSpline) Law::Reparametrize(const Adaptor3d_Curve& Curve, { // On evalue la longeur approximative de la courbe. - Standard_Integer i; + Standard_Integer i = 0; Standard_Real DDFirst = DFirst, DDLast = DLast; if(HasDF && Rev) DDFirst = -DFirst; if(HasDL && Rev) DDLast = -DLast; @@ -164,7 +166,7 @@ Handle(Law_BSpline) Law::Reparametrize(const Adaptor3d_Curve& Curve, gp_Pnt P1,P2; Standard_Real U1 = Curve.FirstParameter(); Standard_Real U2 = Curve.LastParameter(); - Standard_Real U, DU, Length = 0.; + Standard_Real U = NAN, DU = NAN, Length = 0.; if(!Rev){ P1 = Curve.Value(U1); U = U1; @@ -192,7 +194,7 @@ Handle(Law_BSpline) Law::Reparametrize(const Adaptor3d_Curve& Curve, Standard_Real DCorde = Length / ( NbPoints - 1); Standard_Real Corde = DCorde; Standard_Integer Index = 1; - Standard_Real Alpha; + Standard_Real Alpha = NAN; Standard_Real fac = 1./(NbPoints-1); point->SetValue(1,ucourbe(1)); @@ -249,7 +251,7 @@ Handle(Law_BSpline) Law::Scale(const Standard_Real First, const Standard_Real VFirst, const Standard_Real VLast) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Real Milieu = 0.5*(First+Last); TColStd_Array1OfReal knot(1,3); TColStd_Array1OfReal fknot(1,10); diff --git a/src/Law/Law_BSpFunc.cxx b/src/Law/Law_BSpFunc.cxx index 883f09cf95..cc1cc075bd 100644 --- a/src/Law/Law_BSpFunc.cxx +++ b/src/Law/Law_BSpFunc.cxx @@ -16,6 +16,8 @@ // pmn -> 17/01/1996 added : Continuity, (Nb)Intervals, D2, Trim +#include + #include #include #include @@ -68,7 +70,7 @@ Standard_Integer Law_BSpFunc::NbIntervals(const GeomAbs_Shape S) const { Standard_Integer myNbIntervals = 1; if ( S > Continuity()) { - Standard_Integer Cont; + Standard_Integer Cont = 0; switch ( S) { case GeomAbs_G1: case GeomAbs_G2: @@ -94,7 +96,7 @@ Standard_Integer Law_BSpFunc::NbIntervals(const GeomAbs_Shape S) const Standard_Integer Nb = curv->NbKnots(); Standard_Integer Index1 = 0; Standard_Integer Index2 = 0; - Standard_Real newFirst, newLast; + Standard_Real newFirst = NAN, newLast = NAN; TColStd_Array1OfReal TK(1,Nb); TColStd_Array1OfInteger TM(1,Nb); curv->Knots(TK); @@ -131,7 +133,7 @@ void Law_BSpFunc::Intervals(TColStd_Array1OfReal& T, { Standard_Integer myNbIntervals = 1; if ( S > Continuity()) { - Standard_Integer Cont; + Standard_Integer Cont = 0; switch ( S) { case GeomAbs_G1: case GeomAbs_G2: @@ -157,7 +159,7 @@ void Law_BSpFunc::Intervals(TColStd_Array1OfReal& T, Standard_Integer Nb = curv->NbKnots(); Standard_Integer Index1 = 0; Standard_Integer Index2 = 0; - Standard_Real newFirst, newLast; + Standard_Real newFirst = NAN, newLast = NAN; TColStd_Array1OfReal TK(1,Nb); TColStd_Array1OfInteger TM(1,Nb); curv->Knots(TK); diff --git a/src/Law/Law_BSpline.cxx b/src/Law/Law_BSpline.cxx index 0f245a42b0..b9ad712ff7 100644 --- a/src/Law/Law_BSpline.cxx +++ b/src/Law/Law_BSpline.cxx @@ -20,6 +20,8 @@ // bon appel a LocateParameter (PRO6973) et mise en conformite avec // le cdl de LocateU, lorsque U est un noeud (PRO6988) +#include + #include #include #include @@ -50,7 +52,7 @@ static void SetPoles(const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Weights, TColStd_Array1OfReal& FP) { - Standard_Integer i,j = FP.Lower(); + Standard_Integer i = 0,j = FP.Lower(); for (i = Poles.Lower(); i <= Poles.Upper(); i++) { Standard_Real w = Weights(i); FP(j) = Poles(i) * w; @@ -71,7 +73,7 @@ static void GetPoles(const TColStd_Array1OfReal& FP, TColStd_Array1OfReal& Weights) { - Standard_Integer i,j = FP.Lower(); + Standard_Integer i = 0,j = FP.Lower(); for (i = Poles.Lower(); i <= Poles.Upper(); i++) { Standard_Real w = FP(j+1); Weights(i) = w; @@ -160,7 +162,7 @@ static void KnotAnalysis Periodic ? CKnots.Upper() : BSplCLib::LastUKnotIndex (Degree,CMults); MaxKnotMult = 0; if (LastKM - FirstKM != 1) { - Standard_Integer Multi; + Standard_Integer Multi = 0; for (Standard_Integer i = FirstKM + 1; i < LastKM; i++) { Multi = CMults (i); MaxKnotMult = Max (MaxKnotMult, Multi); @@ -176,7 +178,7 @@ static void KnotAnalysis static Standard_Boolean Rational(const TColStd_Array1OfReal& W) { - Standard_Integer i, n = W.Length(); + Standard_Integer i = 0, n = W.Length(); Standard_Boolean rat = Standard_False; for (i = 1; i < n; i++) { rat = Abs(W(i) - W(i+1)) > gp::Resolution(); @@ -220,7 +222,7 @@ Law_BSpline::Law_BSpline const TColStd_Array1OfInteger& Mults, const Standard_Integer Degree, const Standard_Boolean Periodic) : - rational(Standard_False),periodic(Periodic), deg(Degree) + rational(Standard_False),periodic(Periodic), deg(Degree), poles(new TColStd_HArray1OfReal(1,Poles.Length())), knots(new TColStd_HArray1OfReal(1,Knots.Length())), mults(new TColStd_HArray1OfInteger(1,Mults.Length())) { // check @@ -233,14 +235,14 @@ Law_BSpline::Law_BSpline // copy arrays - poles = new TColStd_HArray1OfReal(1,Poles.Length()); + poles->ChangeArray1() = Poles; - knots = new TColStd_HArray1OfReal(1,Knots.Length()); + knots->ChangeArray1() = Knots; - mults = new TColStd_HArray1OfInteger(1,Mults.Length()); + mults->ChangeArray1() = Mults; UpdateKnots(); @@ -275,7 +277,7 @@ Law_BSpline::Law_BSpline if (Weights.Length() != Poles.Length()) throw Standard_ConstructionError("Law_BSpline"); - Standard_Integer i; + Standard_Integer i = 0; for (i = Weights.Lower(); i <= Weights.Upper(); i++) { if (Weights(i) <= gp::Resolution()) throw Standard_ConstructionError("Law_BSpline"); @@ -402,7 +404,7 @@ void Law_BSpline::IncreaseMultiplicity (const Standard_Integer I1, Handle(TColStd_HArray1OfReal) tk = knots; TColStd_Array1OfReal k((knots->Array1())(I1),I1,I2); TColStd_Array1OfInteger m(I1,I2); - Standard_Integer i; + Standard_Integer i = 0; for (i = I1; i <= I2; i++) m(i) = M - mults->Value(i); InsertKnots(k,m,Epsilon(1.)); @@ -455,7 +457,7 @@ void Law_BSpline::InsertKnots(const TColStd_Array1OfReal& Knots, const Standard_Boolean Add) { // Check and compute new sizes - Standard_Integer nbpoles,nbknots; + Standard_Integer nbpoles = 0,nbknots = 0; if (!BSplCLib::PrepareInsertKnots(deg,periodic, knots->Array1(),mults->Array1(), @@ -810,7 +812,7 @@ void Law_BSpline::Reverse () { BSplCLib::Reverse(knots->ChangeArray1()); BSplCLib::Reverse(mults->ChangeArray1()); - Standard_Integer last; + Standard_Integer last = 0; if (periodic) last = flatknots->Upper() - deg - 1; else @@ -847,9 +849,9 @@ void Law_BSpline::Segment(const Standard_Real U1, Standard_Real Eps = Epsilon(Max(Abs(U1),Abs(U2))); Standard_Real delta = U2 - U1; - Standard_Real NewU1, NewU2; - Standard_Real U; - Standard_Integer index; + Standard_Real NewU1 = NAN, NewU2 = NAN; + Standard_Real U = NAN; + Standard_Integer index = 0; TColStd_Array1OfReal Knots(1,2); TColStd_Array1OfInteger Mults(1,2); @@ -896,7 +898,7 @@ void Law_BSpline::Segment(const Standard_Real U1, Handle(TColStd_HArray1OfInteger) nmults = new TColStd_HArray1OfInteger(1,nbknots); - Standard_Integer i , k = 1; + Standard_Integer i = 0 , k = 1; for ( i = index1; i<= index2; i++) { nknots->SetValue(k, knots->Value(i)); nmults->SetValue(k, mults->Value(i)); @@ -1060,7 +1062,7 @@ void Law_BSpline::SetOrigin(const Standard_Integer Index) { Standard_NoSuchObject_Raise_if( !periodic, "Law_BSpline::SetOrigin"); - Standard_Integer i,k; + Standard_Integer i = 0,k = 0; Standard_Integer first = FirstUKnotIndex(); Standard_Integer last = LastUKnotIndex(); @@ -1148,7 +1150,7 @@ void Law_BSpline::SetOrigin(const Standard_Integer Index) void Law_BSpline::SetNotPeriodic () { if ( periodic) { - Standard_Integer NbKnots, NbPoles; + Standard_Integer NbKnots = 0, NbPoles = 0; BSplCLib::PrepareUnperiodize( deg, mults->Array1(),NbKnots,NbPoles); Handle(TColStd_HArray1OfReal) npoles @@ -1304,7 +1306,7 @@ void Law_BSpline::UpdateKnots() void Law_BSpline::PeriodicNormalization(Standard_Real& Parameter) const { - Standard_Real Period ; + Standard_Real Period = NAN ; if (periodic){ Period = flatknots->Value(flatknots->Upper() - deg) - @@ -1388,7 +1390,7 @@ Standard_Integer Law_BSpline::Degree () const Standard_Real Law_BSpline::Value(const Standard_Real U)const { - Standard_Real P; + Standard_Real P = NAN; D0(U,P); return P; } @@ -1495,7 +1497,7 @@ void Law_BSpline::D3(const Standard_Real U , Standard_Real Law_BSpline::DN(const Standard_Real U, const Standard_Integer N ) const { - Standard_Real V; + Standard_Real V = NAN; if (rational) { BSplCLib::DN(U,N,0,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,V); } @@ -1629,7 +1631,7 @@ Standard_Real Law_BSpline::LocalValue const Standard_Integer FromK1, const Standard_Integer ToK2) const { - Standard_Real P; + Standard_Real P = NAN; LocalD0(U,FromK1,ToK2,P); return P; } @@ -1761,7 +1763,7 @@ Standard_Real Law_BSpline::LocalDN BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); - Standard_Real V; + Standard_Real V = NAN; if (rational) { BSplCLib::DN(u,N,index,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,V); } @@ -1887,7 +1889,7 @@ void Law_BSpline::Weights if (IsRational()) W = weights->Array1(); else { - Standard_Integer i; + Standard_Integer i = 0; for (i = W.Lower(); i <= W.Upper(); i++) W(i) = 1.; } @@ -1972,10 +1974,10 @@ void Law_BSpline:: Standard_Integer& ErrorStatus) { TColStd_Array1OfReal new_poles(1, poles->Length()); - Standard_Real delta, - *poles_array, - *new_poles_array, - delta_derivative; + Standard_Real delta = NAN, + *poles_array = nullptr, + *new_poles_array = nullptr, + delta_derivative = NAN; const Standard_Integer dimension = 1 ; D1(U, delta, diff --git a/src/Law/Law_Composite.cxx b/src/Law/Law_Composite.cxx index a02a415af2..06d4051bdf 100644 --- a/src/Law/Law_Composite.cxx +++ b/src/Law/Law_Composite.cxx @@ -16,6 +16,8 @@ // pmn -> 17/01/1996 added : Continuity, (Nb)Intervals, D2, Trim +#include + #include #include #include @@ -87,7 +89,7 @@ void Law_Composite::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) co Law_ListIteratorOfLaws It(funclist); Handle(Law_Function) func; Handle(TColStd_HArray1OfReal) LocT; - Standard_Integer nb_index, Iloc, IGlob=2; + Standard_Integer nb_index = 0, Iloc = 0, IGlob=2; func = funclist.First(); func->Bounds(T(1),T(2)); @@ -179,7 +181,7 @@ void Law_Composite::Bounds(Standard_Real& PFirst, Standard_Real& PLast) void Law_Composite::Prepare(Standard_Real& W) { - Standard_Real f,l, Wtest, Eps; + Standard_Real f = NAN,l = NAN, Wtest = NAN, Eps = NAN; if (W-TFirst < TLast-W) { Eps = PTol; } else { Eps = -PTol;} diff --git a/src/Law/Law_Interpol.cxx b/src/Law/Law_Interpol.cxx index 486d16edfe..3a025c1b2f 100644 --- a/src/Law/Law_Interpol.cxx +++ b/src/Law/Law_Interpol.cxx @@ -14,6 +14,8 @@ // pmn -> modified 17/01/1996 : utilisation de Curve() et SetCurve() +#include + #include #include #include @@ -113,8 +115,8 @@ void Law_Interpol::Set(const TColgp_Array1OfPnt2d& ParAndRad, Handle(TColStd_HArray1OfReal) rad; if(Periodic) rad = new TColStd_HArray1OfReal(1,nbp - 1); else rad = new TColStd_HArray1OfReal(1,nbp); - Standard_Real x,y; - Standard_Integer i; + Standard_Real x = NAN,y = NAN; + Standard_Integer i = 0; for(i = 1; i <= nbp; i++){ ParAndRad(l + i - 1).Coord(x,y); par->SetValue(i,x); @@ -150,8 +152,8 @@ void Law_Interpol::SetInRelative(const TColgp_Array1OfPnt2d& ParAndRad, Handle(TColStd_HArray1OfReal) rad; if(Periodic) rad = new TColStd_HArray1OfReal(1,nbp - 1); else rad = new TColStd_HArray1OfReal(1,nbp); - Standard_Real x,y; - Standard_Integer i; + Standard_Real x = NAN,y = NAN; + Standard_Integer i = 0; for(i = 1; i <= nbp; i++){ ParAndRad(l + i - 1).Coord(x,y); par->SetValue(i,(Uf*(x-wd)+Ud*(wf-x))/(wf-wd)); @@ -187,8 +189,8 @@ void Law_Interpol::Set(const TColgp_Array1OfPnt2d& ParAndRad, Handle(TColStd_HArray1OfReal) rad; if(Periodic) rad = new TColStd_HArray1OfReal(1,nbp - 1); else rad = new TColStd_HArray1OfReal(1,nbp); - Standard_Real x,y; - Standard_Integer i; + Standard_Real x = NAN,y = NAN; + Standard_Integer i = 0; for(i = 1; i <= nbp; i++){ ParAndRad(l + i - 1).Coord(x,y); par->SetValue(i,x); @@ -219,8 +221,8 @@ void Law_Interpol::SetInRelative(const TColgp_Array1OfPnt2d& ParAndRad, Handle(TColStd_HArray1OfReal) rad; if(Periodic) rad = new TColStd_HArray1OfReal(1,nbp - 1); else rad = new TColStd_HArray1OfReal(1,nbp); - Standard_Real x,y; - Standard_Integer i; + Standard_Real x = NAN,y = NAN; + Standard_Integer i = 0; for(i = 1; i <= nbp; i++){ ParAndRad(l + i - 1).Coord(x,y); par->SetValue(i,(Uf*(x-wd)+Ud*(wf-x))/(wf-wd)); diff --git a/src/Law/Law_Interpolate.cxx b/src/Law/Law_Interpolate.cxx index 9c3b06fa5a..11acfa9830 100644 --- a/src/Law/Law_Interpolate.cxx +++ b/src/Law/Law_Interpolate.cxx @@ -16,6 +16,8 @@ // Programme cree +#include + #include #include #include @@ -32,8 +34,8 @@ static Standard_Boolean CheckParameters (const TColStd_Array1OfReal& Parameters) { - Standard_Integer ii; - Standard_Real distance; + Standard_Integer ii = 0; + Standard_Real distance = NAN; Standard_Boolean result = Standard_True; for (ii = Parameters.Lower() ; result && ii < Parameters.Upper() ; ii++) { distance = Parameters.Value(ii+1) - Parameters.Value(ii); @@ -50,8 +52,8 @@ static void BuildParameters(const Standard_Boolean PeriodicFlag, const TColStd_Array1OfReal& PointsArray, Handle(TColStd_HArray1OfReal)& ParametersPtr) { - Standard_Integer ii, index = 2; - Standard_Real distance; + Standard_Integer ii = 0, index = 2; + Standard_Real distance = NAN; Standard_Integer num_parameters = PointsArray.Length(); if (PeriodicFlag) { num_parameters += 1; @@ -123,7 +125,7 @@ static void BuildTangents(const TColStd_Array1OfReal& PointsArray, const TColStd_Array1OfReal& ParametersArray) { Standard_Integer degree = 3;//,ii; - Standard_Real *point_array, *parameter_array, eval_result[2]; + Standard_Real *point_array = nullptr, *parameter_array = nullptr, eval_result[2]; if ( PointsArray.Length() < 3) { throw Standard_ConstructionError(); @@ -173,15 +175,15 @@ Law_Interpolate::Law_Interpolate myTolerance(Tolerance), myPoints(PointsPtr), myIsDone(Standard_False), - myPeriodic(PeriodicFlag), + myTangents(new TColStd_HArray1OfReal (myPoints->Lower(), + myPoints->Upper())), myTangentFlags(new TColStd_HArray1OfBoolean(myPoints->Lower(), + myPoints->Upper())), myPeriodic(PeriodicFlag), myTangentRequest(Standard_False) { //Standard_Integer ii; - myTangents = new TColStd_HArray1OfReal (myPoints->Lower(), - myPoints->Upper()); - myTangentFlags = new TColStd_HArray1OfBoolean(myPoints->Lower(), - myPoints->Upper()); + + BuildParameters(PeriodicFlag, PointsPtr->Array1(), @@ -233,7 +235,7 @@ void Law_Interpolate::Load const Handle(TColStd_HArray1OfBoolean)& TangentFlagsPtr) { //Standard_Boolean result; - Standard_Integer ii; + Standard_Integer ii = 0; myTangentRequest = Standard_True; myTangentFlags = TangentFlagsPtr; if (Tangents.Length() != myPoints->Length() || @@ -284,20 +286,20 @@ void Law_Interpolate::Perform() void Law_Interpolate::PerformPeriodic() { - Standard_Integer degree, - ii, + Standard_Integer degree = 0, + ii = 0, //jj, - index, - index1, + index = 0, + index1 = 0, //index2, - mult_index, - half_order, - inversion_problem, - num_points, - num_distinct_knots, - num_poles; + mult_index = 0, + half_order = 0, + inversion_problem = 0, + num_points = 0, + num_distinct_knots = 0, + num_poles = 0; - Standard_Real period; + Standard_Real period = NAN; //gp_Pnt a_point; @@ -438,18 +440,18 @@ void Law_Interpolate::PerformPeriodic() void Law_Interpolate::PerformNonPeriodic() { - Standard_Integer degree, - ii, + Standard_Integer degree = 0, + ii = 0, //jj, - index, - index1, - index2, - index3, - mult_index, - inversion_problem, - num_points, - num_distinct_knots, - num_poles; + index = 0, + index1 = 0, + index2 = 0, + index3 = 0, + mult_index = 0, + inversion_problem = 0, + num_points = 0, + num_distinct_knots = 0, + num_poles = 0; num_points = num_distinct_knots = diff --git a/src/Law/Law_Linear.cxx b/src/Law/Law_Linear.cxx index 42e5f98256..efc799a109 100644 --- a/src/Law/Law_Linear.cxx +++ b/src/Law/Law_Linear.cxx @@ -16,6 +16,8 @@ // pmn -> 17/01/1996 added : Continuity, (Nb)Interals, D2, Trim +#include + #include #include #include @@ -106,7 +108,7 @@ Handle(Law_Function) Law_Linear::Trim(const Standard_Real PFirst, const Standard_Real ) const { Handle(Law_Linear) l = new (Law_Linear)(); - Standard_Real Vdeb, Vfin; + Standard_Real Vdeb = NAN, Vfin = NAN; Vdeb = (( PFirst-pdeb)*valfin + (pfin-PFirst)*valdeb)/(pfin-pdeb); Vfin = (( PLast-pdeb)*valfin + (pfin-PLast)*valdeb)/(pfin-pdeb); l->Set(PFirst, Vdeb, PLast, Vfin); diff --git a/src/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx b/src/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx index b548cd196a..18c93d28ac 100644 --- a/src/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx +++ b/src/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -32,10 +34,10 @@ void LocalAnalysis_CurveContinuity::CurvC0( GeomLProp_CLProps& Curv1, void LocalAnalysis_CurveContinuity::CurvC1( GeomLProp_CLProps& Curv1, GeomLProp_CLProps& Curv2) { gp_Vec V1, V2; - Standard_Real ang; + Standard_Real ang = NAN; V1 = Curv1.D1(); V2 = Curv2.D1(); - Standard_Real norm1,norm2; + Standard_Real norm1 = NAN,norm2 = NAN; norm1 = V1.Magnitude(); norm2 = V2.Magnitude(); @@ -57,7 +59,7 @@ void LocalAnalysis_CurveContinuity::CurvC2(GeomLProp_CLProps& Curv1, GeomLProp_CLProps& Curv2) { gp_Vec V1, V2, V12, V22; // gp_Dir D1, D2; - Standard_Real norm1, norm2, norm12, norm22,ang; + Standard_Real norm1 = NAN, norm2 = NAN, norm12 = NAN, norm22 = NAN,ang = NAN; V1 = Curv1.D1(); V2 = Curv2.D1(); V12 = Curv1.D2(); @@ -91,7 +93,7 @@ void LocalAnalysis_CurveContinuity::CurvC2(GeomLProp_CLProps& Curv1, void LocalAnalysis_CurveContinuity::CurvG1 ( GeomLProp_CLProps& Curv1, GeomLProp_CLProps & Curv2) { gp_Dir Tang1,Tang2; - Standard_Real ang; + Standard_Real ang = NAN; if (Curv1.IsTangentDefined() && Curv2.IsTangentDefined ()) { Curv1.Tangent(Tang1); Curv2.Tangent(Tang2); @@ -109,7 +111,7 @@ void LocalAnalysis_CurveContinuity::CurvG2( GeomLProp_CLProps& Curv1, GeomLProp_CLProps & Curv2 ) { gp_Vec V1, V2; gp_Dir D1, D2; - Standard_Real ang; + Standard_Real ang = NAN; Standard_Real epscrb= 8*myepsC0/(myMaxLon*myMaxLon); if (Curv1.IsTangentDefined() && Curv2.IsTangentDefined()) @@ -155,18 +157,18 @@ LocalAnalysis_CurveContinuity::LocalAnalysis_CurveContinuity(const Handle(Geom_C myCourbC2(0.0), myG2Variation(0.0), myLambda1(0.0), - myLambda2(0.0) -{ myTypeCont = Order; - myepsnul= Epsnul; - myMaxLon=Maxlen; - myepsC0= EpsC0; - myepsC1= EpsC1; - myepsC2= EpsC2; - myepsG1= EpsG1; - myepsG2= EpsG2; - myperce=Percent; - - myIsDone = Standard_True; + myLambda2(0.0), myTypeCont(Order), myepsnul(Epsnul), myMaxLon(Maxlen), myepsC0(EpsC0), myepsC1(EpsC1), myepsC2(EpsC2), myepsG1(EpsG1), myepsG2(EpsG2), myperce(Percent), myIsDone(Standard_True) +{ + + + + + + + + + + switch ( Order) { case GeomAbs_C0 : { //TypeCont=GeomAbs_C0; @@ -229,7 +231,7 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsC1() const /*********************************************************************************/ Standard_Boolean LocalAnalysis_CurveContinuity::IsC2() const -{ Standard_Real epsil1, epsil2; +{ Standard_Real epsil1 = NAN, epsil2 = NAN; if (!myIsDone) { throw StdFail_NotDone();} if ( IsC1()) @@ -258,8 +260,8 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsG1() const /*********************************************************************************/ Standard_Boolean LocalAnalysis_CurveContinuity::IsG2()const -{ Standard_Real CRBINF, CRBNUL; - Standard_Integer IETA1, IETA2; +{ Standard_Real CRBINF = NAN, CRBNUL = NAN; + Standard_Integer IETA1 = 0, IETA2 = 0; // etat des coubures IETA. -> 0 Crbure nulle // -> 1 Crbure finie // -> 2 Crbure infinie diff --git a/src/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx b/src/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx index 550d56e3d2..34f62cfadd 100644 --- a/src/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx +++ b/src/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -38,7 +40,7 @@ void LocalAnalysis_SurfaceContinuity::SurfC0 (const GeomLProp_SLProps& Surf1, void LocalAnalysis_SurfaceContinuity::SurfC1( GeomLProp_SLProps& Surf1, GeomLProp_SLProps & Surf2) { gp_Vec V1u, V2u, V1v, V2v; - Standard_Real norm1u, norm2u, norm1v, norm2v,angu,angv; + Standard_Real norm1u = NAN, norm2u = NAN, norm1v = NAN, norm2v = NAN,angu = NAN,angv = NAN; V1u = Surf1.D1U(); V2u = Surf2.D1U(); @@ -75,8 +77,8 @@ void LocalAnalysis_SurfaceContinuity::SurfC2( GeomLProp_SLProps& Surf1, GeomLProp_SLProps& Surf2) { gp_Vec V11u, V12u, V21u, V22u, V11v, V12v, V21v, V22v; - Standard_Real norm11u, norm12u, norm21u, norm22u, norm11v, norm12v, norm21v, norm22v; - Standard_Real ang; + Standard_Real norm11u = NAN, norm12u = NAN, norm21u = NAN, norm22u = NAN, norm11v = NAN, norm12v = NAN, norm21v = NAN, norm22v = NAN; + Standard_Real ang = NAN; V11u = Surf1.D1U(); V12u = Surf2.D1U(); V21u = Surf1.D2U(); @@ -150,8 +152,8 @@ void LocalAnalysis_SurfaceContinuity::SurfG1( GeomLProp_SLProps& Surf1, void LocalAnalysis_SurfaceContinuity::SurfG2 ( GeomLProp_SLProps& Surf1, GeomLProp_SLProps & Surf2) { gp_Dir DMIN1, DMIN2, DMAX1, DMAX2; - Standard_Real RMIN1,RMIN2,RMAX1,RMAX2; - Standard_Real x1, x2, y1, y2, z1, z2; + Standard_Real RMIN1 = NAN,RMIN2 = NAN,RMAX1 = NAN,RMAX2 = NAN; + Standard_Real x1 = NAN, x2 = NAN, y1 = NAN, y2 = NAN, z1 = NAN, z2 = NAN; if ( Surf1.IsCurvatureDefined() && Surf2.IsCurvatureDefined()) { @@ -175,7 +177,7 @@ void LocalAnalysis_SurfaceContinuity::SurfG2 ( GeomLProp_SLProps& Surf1, myZETA1 = (RMAX1-RMIN1)/2; myZETA2 = (RMAX2-RMIN2)/2; myZETA = (myZETA1+myZETA2)/2; - Standard_Real DETA,DZETA; + Standard_Real DETA = NAN,DZETA = NAN; DETA = ( myETA1- myETA2)/2; DZETA =( myZETA1- myZETA2)/2; myGap= Abs(DETA) + sqrt( DZETA*DZETA*Cos(myAlpha)*Cos(myAlpha) @@ -209,15 +211,15 @@ LocalAnalysis_SurfaceContinuity::LocalAnalysis_SurfaceContinuity(const Standard_ myZETA2(0.0), myZETA(0.0), myAlpha(0.0), - myGap(0.0) -{ myepsnul=EpsNul; - myepsC0= EpsC0; - myepsC1= EpsC1; - myepsC2= EpsC2; - myepsG1= EpsG1; - myperce= Percent; - mymaxlen= Maxlen; - myIsDone = Standard_True; + myepsnul(EpsNul), myepsC0(EpsC0), myepsC1(EpsC1), myepsC2(EpsC2), myepsG1(EpsG1), myperce(Percent), mymaxlen(Maxlen), myGap(0.0), myIsDone(Standard_True) +{ + + + + + + + } void LocalAnalysis_SurfaceContinuity::ComputeAnalysis(GeomLProp_SLProps& Surf1, GeomLProp_SLProps& Surf2, @@ -281,16 +283,16 @@ LocalAnalysis_SurfaceContinuity::LocalAnalysis_SurfaceContinuity( const Handle(G myZETA2(0.0), myZETA(0.0), myAlpha(0.0), - myGap(0.0) -{ myTypeCont = Ordre; - myepsnul=EpsNul; - myepsC0= EpsC0; - myepsC1= EpsC1; - myepsC2= EpsC2; - myepsG1= EpsG1; - myperce= Percent; - mymaxlen= Maxlen; - myIsDone = Standard_True; + myTypeCont(Ordre), myepsnul(EpsNul), myepsC0(EpsC0), myepsC1(EpsC1), myepsC2(EpsC2), myepsG1(EpsG1), myperce(Percent), mymaxlen(Maxlen), myGap(0.0), myIsDone(Standard_True) +{ + + + + + + + + switch ( Ordre ) { case GeomAbs_C0 : { GeomLProp_SLProps Surfa1 ( Surf1, u1, v1, 0, myepsnul); @@ -359,18 +361,18 @@ LocalAnalysis_SurfaceContinuity::LocalAnalysis_SurfaceContinuity(const Handle(Ge myZETA2(0.0), myZETA(0.0), myAlpha(0.0), - myGap(0.0) -{ Standard_Real pard1, parf1, pard2, parf2, u1, v1, u2, v2; + myTypeCont(Ordre), myepsnul(EpsNul), myepsC0(EpsC0), myepsC1(EpsC1), myepsC2(EpsC2), myepsG1(EpsG1), myperce(Percent), mymaxlen(Maxlen), myGap(0.0), myIsDone(Standard_True) +{ Standard_Real pard1 = NAN, parf1 = NAN, pard2 = NAN, parf2 = NAN, u1 = NAN, v1 = NAN, u2 = NAN, v2 = NAN; + + + + + + + + + - myTypeCont = Ordre; - myepsnul=EpsNul; - myepsC0= EpsC0; - myepsC1= EpsC1; - myepsC2= EpsC2; - myepsG1= EpsG1; - myperce= Percent; - mymaxlen= Maxlen; - myIsDone = Standard_True; pard1 = curv1->FirstParameter(); pard2 = curv2->FirstParameter(); @@ -444,7 +446,7 @@ Standard_Boolean LocalAnalysis_SurfaceContinuity::IsC1() const /*********************************************************************************/ Standard_Boolean LocalAnalysis_SurfaceContinuity::IsC2() const -{ Standard_Real eps1u, eps1v, eps2u, eps2v; +{ Standard_Real eps1u = NAN, eps1v = NAN, eps2u = NAN, eps2v = NAN; if (!myIsDone) { throw StdFail_NotDone();} if ( IsC1()) @@ -478,8 +480,8 @@ Standard_Boolean LocalAnalysis_SurfaceContinuity::IsG1() const /*********************************************************************************/ Standard_Boolean LocalAnalysis_SurfaceContinuity::IsG2()const -{ Standard_Real EPSNL; - Standard_Integer itype; +{ Standard_Real EPSNL = NAN; + Standard_Integer itype = 0; if (!myIsDone) { throw StdFail_NotDone();} itype =0; diff --git a/src/MAT/MAT_Arc.cxx b/src/MAT/MAT_Arc.cxx index 000233e384..3311f2de0e 100644 --- a/src/MAT/MAT_Arc.cxx +++ b/src/MAT/MAT_Arc.cxx @@ -32,13 +32,13 @@ MAT_Arc::MAT_Arc (const Standard_Integer ArcIndex, const Handle(MAT_BasicElt)& SecondElement) : arcIndex(ArcIndex), geomIndex(GeomIndex), - firstArcLeft (0), + firstElement(FirstElement), secondElement(SecondElement), firstArcLeft (0), firstArcRight (0), secondArcRight (0), secondArcLeft (0) { - firstElement = FirstElement; - secondElement = SecondElement; + + } //======================================================================== diff --git a/src/MAT/MAT_Bisector.cxx b/src/MAT/MAT_Bisector.cxx index efb415598c..7ae618fd27 100644 --- a/src/MAT/MAT_Bisector.cxx +++ b/src/MAT/MAT_Bisector.cxx @@ -23,12 +23,12 @@ IMPLEMENT_STANDARD_RTTIEXT(MAT_Bisector,Standard_Transient) -MAT_Bisector::MAT_Bisector() +MAT_Bisector::MAT_Bisector() : thebisectornumber(-1), thefirstparameter(Precision::Infinite()), thesecondparameter(Precision::Infinite()), thelistofbisectors(new MAT_ListOfBisector()) { - thebisectornumber = -1; - thefirstparameter = Precision::Infinite(); - thesecondparameter = Precision::Infinite(); - thelistofbisectors = new MAT_ListOfBisector(); + + + + } void MAT_Bisector::AddBisector(const Handle(MAT_Bisector)& abisector) const @@ -173,7 +173,7 @@ Standard_Real MAT_Bisector::SecondParameter() const void MAT_Bisector::Dump(const Standard_Integer ashift, const Standard_Integer alevel) const { - Standard_Integer i; + Standard_Integer i = 0; for(i=0; i + #include #include #include @@ -57,15 +59,15 @@ void MAT_Graph::Perform(const Standard_Boolean SemiInfinite, const Standard_Integer NbBasicElts, const Standard_Integer NbArcs) { - Standard_Integer NbRoots; + Standard_Integer NbRoots = 0; Handle(MAT_Arc) FirstArc; Handle(MAT_Arc) CurrentArc; Handle(MAT_Node) Extremite; Standard_Integer IndTabArcs = 1; - Standard_Integer IndTabNodes; - Standard_Integer i; - Standard_Real DistExt; - Standard_Integer IndExt; + Standard_Integer IndTabNodes = 0; + Standard_Integer i = 0; + Standard_Real DistExt = NAN; + Standard_Integer IndExt = 0; Handle(MAT_Arc) PreviousArc = CurrentArc; //------------------------ @@ -251,7 +253,7 @@ void MAT_Graph::FusionOfBasicElts(const Standard_Integer IndexElt1, if (Elt1 == Elt2) return; - Standard_Integer i; + Standard_Integer i = 0; Handle(MAT_Zone) Zone2 = new MAT_Zone(Elt2); //-------------------------------------------------------------------- @@ -386,7 +388,7 @@ void MAT_Graph::FusionOfArcs(const Handle(MAT_Arc)& Arc1, // Note: the Arc2 is actually a reference to a handle contained in theArcs map; // it is necessary to create copy of that handle and use only it to access // that object, since the handle contained in the map is destroyed by UnBind() - Handle(MAT_Arc) anArc2 = Arc2; + const Handle(MAT_Arc)& anArc2 = Arc2; theArcs .UnBind(Arc2->Index()); numberOfArcs--; @@ -484,7 +486,7 @@ Handle(MAT_BasicElt) MAT_Graph::ChangeBasicElt(const Standard_Integer Index) //============================================================================= void MAT_Graph::UpDateNodes (Standard_Integer& IndTabNodes) { - Standard_Integer i; + Standard_Integer i = 0; Handle(MAT_Node) Bout; Handle(MAT_Arc) CurrentArc; @@ -512,7 +514,7 @@ static Handle(MAT_Arc) MakeArc(const Handle(MAT_Bisector)& aBisector, Handle(MAT_Arc) NextArc; Handle(MAT_Node) Extremite; Handle(MAT_ListOfBisector) BisectorList; - Standard_Real DistExt; + Standard_Real DistExt = NAN; #ifdef OCCT_DEBUG_Graph std::cout<<"Construction Arc : Index"<IndexNumber()< + #include #include #include @@ -71,10 +73,10 @@ static Standard_Real CrossProd(const Handle(Geom2d_Geometry)& Geom1, //============================================================================= MAT2d_Circuit::MAT2d_Circuit(const GeomAbs_JoinType aJoinType, const Standard_Boolean IsOpenResult) -: direction(0.0) +: direction(0.0), myJoinType(aJoinType), myIsOpenResult(IsOpenResult) { - myJoinType = aJoinType; - myIsOpenResult = IsOpenResult; + + } //============================================================================= @@ -88,7 +90,7 @@ void MAT2d_Circuit::Perform const Standard_Boolean Trigo) { Standard_Integer NbLines = FigItem.Length(); - Standard_Integer i; + Standard_Integer i = 0; TColStd_Array1OfBoolean Open(1,NbLines); MAT2d_SequenceOfConnexion SVide; Handle(MAT2d_Connexion) ConnexionNul; @@ -211,7 +213,7 @@ Standard_Boolean MAT2d_Circuit::IsSharpCorner(const Handle(Geom2d_Geometry)& Geo const Handle(Geom2d_Geometry)& Geom2, const Standard_Real Direction) const { - Standard_Real DotProd; + Standard_Real DotProd = NAN; Standard_Real ProVec = CrossProd (Geom1,Geom2,DotProd); Standard_Integer NbTest = 1; Standard_Real DU = Precision::Confusion(); @@ -254,7 +256,7 @@ Standard_Boolean MAT2d_Circuit::IsSharpCorner(const Handle(Geom2d_Geometry)& Geo // de calcul // Si pas dintersection => saillant. // Sinon => rentrant. - Standard_Real D ; + Standard_Real D = NAN ; Standard_Real Tol = Precision::Confusion(); Standard_Real MilC1 = (C1->LastParameter() + C1->FirstParameter())*0.5; Standard_Real MilC2 = (C2->LastParameter() + C2->FirstParameter())*0.5; @@ -355,10 +357,10 @@ void MAT2d_Circuit::ConstructCircuit { Handle(MAT2d_Connexion) PrevC,CurC; TColGeom2d_SequenceOfGeometry SetOfItem; - Standard_Integer NbConnexions; - Standard_Integer ILastItem; - Standard_Integer IndLast; - Standard_Integer i; + Standard_Integer NbConnexions = 0; + Standard_Integer ILastItem = 0; + Standard_Integer IndLast = 0; + Standard_Integer i = 0; NbConnexions = Road.Path().Length(); //----------------------------------------------------- @@ -476,7 +478,7 @@ void MAT2d_Circuit::ConstructCircuit void MAT2d_Circuit::InitOpen (TColGeom2d_SequenceOfGeometry& Line) const { Handle(Geom2d_TrimmedCurve) Curve; - Standard_Real DotProd; + Standard_Real DotProd = NAN; Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.First()); Line.InsertBefore(1,new Geom2d_CartesianPoint(Curve->StartPoint())); @@ -507,8 +509,8 @@ const Handle(Standard_Type) Type; Handle(Geom2d_TrimmedCurve) Curve; Standard_Integer NbItems = Line.Length(); - Standard_Integer i; - Standard_Real ProVec,DotProd; + Standard_Integer i = 0; + Standard_Real ProVec = NAN,DotProd = NAN; Handle(MAT2d_Connexion) CC; //-------------------------- @@ -534,7 +536,7 @@ const //------------------------------------------ Standard_Integer IAfter = ConnexionFrom.Length(); Standard_Integer NbConnexions = IAfter; - Standard_Integer IndCOF; + Standard_Integer IndCOF = 0; for (i = 1; i <= IAfter; i++) { CC = ConnexionFrom.Value(i); @@ -651,9 +653,9 @@ const //============================================================================= void MAT2d_Circuit::InsertCorner (TColGeom2d_SequenceOfGeometry& Line) const { - Standard_Integer i,isuiv; + Standard_Integer i = 0,isuiv = 0; Handle(Geom2d_TrimmedCurve) Curve; - Standard_Boolean Insert; + Standard_Boolean Insert = 0; for ( i = 1; i <= Line.Length(); i++) { isuiv = (i == Line.Length()) ? 1 : i + 1; @@ -727,7 +729,7 @@ const TColStd_SequenceOfInteger& MAT2d_Circuit::RefToEqui //============================================================================= void MAT2d_Circuit::SortRefToEqui (const MAT2d_BiInt& BiRef) { - Standard_Integer i; + Standard_Integer i = 0; TColStd_SequenceOfInteger& S = linkRefEqui.ChangeFind(BiRef); TColStd_SequenceOfInteger SFin; @@ -819,7 +821,7 @@ void MAT2d_Circuit::UpDateLink(const Standard_Integer IFirst, const Standard_Integer ICurveLast) { Standard_Integer IEqui = IFirst; - Standard_Integer i; + Standard_Integer i = 0; for (i = ICurveFirst; i <= ICurveLast; i++) { MAT2d_BiInt Key(ILine,i); diff --git a/src/MAT2d/MAT2d_CutCurve.cxx b/src/MAT2d/MAT2d_CutCurve.cxx index 2838d2f755..3dca9f6fe6 100644 --- a/src/MAT2d/MAT2d_CutCurve.cxx +++ b/src/MAT2d/MAT2d_CutCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -55,7 +57,7 @@ void MAT2d_CutCurve::Perform(const Handle(Geom2d_Curve)& C) Geom2dLProp_CurAndInf2d Sommets; Handle(Geom2d_TrimmedCurve) TrimC; - Standard_Real UF,UL,UC; + Standard_Real UF = NAN,UL = NAN,UC = NAN; gp_Pnt2d PF,PL,PC; Standard_Real PTol = Precision::PConfusion()*10; Standard_Real Tol = Precision::Confusion()*10; diff --git a/src/MAT2d/MAT2d_Mat2d.cxx b/src/MAT2d/MAT2d_Mat2d.cxx index 4e3d54c176..e30781871b 100644 --- a/src/MAT2d/MAT2d_Mat2d.cxx +++ b/src/MAT2d/MAT2d_Mat2d.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -30,12 +32,12 @@ // purpose : //======================================================================== MAT2d_Mat2d::MAT2d_Mat2d(const Standard_Boolean IsOpenResult) -: semiInfinite(Standard_False), +: myIsOpenResult(IsOpenResult), thenumberofbisectors(0), thenumberofedges(0), semiInfinite(Standard_False), isDone(Standard_False) { - myIsOpenResult = IsOpenResult; - thenumberofbisectors = 0; - thenumberofedges = 0; + + + } @@ -133,12 +135,12 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool) Handle(MAT_Edge) edgetoremove; Handle(MAT_Edge) previousedge,currentedge; - Standard_Integer noofbisectorstoremove; + Standard_Integer noofbisectorstoremove = 0; Handle(MAT_Bisector) firstbisector,secondbisector; Handle(MAT_Edge) edge; - Standard_Integer intersectionpoint; - Standard_Integer beginbisector; - Standard_Integer noofbisectors; + Standard_Integer intersectionpoint = 0; + Standard_Integer beginbisector = 0; + Standard_Integer noofbisectors = 0; Standard_Integer NbIterBis = 0; Standard_Integer EvenNbIterBis = 10; @@ -151,10 +153,10 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool) Handle(MAT_Bisector) bisectortoremove,lastbisector,currentbisector; Handle(MAT_Bisector) previousbisector; - Standard_Integer i,j,k,narea,shift,compact,all; - Standard_Integer noofedges; - Standard_Integer NumberMaxOfIte; - Standard_Real toleranceofconfusion; + Standard_Integer i = 0,j = 0,k = 0,narea = 0,shift = 0,compact = 0,all = 0; + Standard_Integer noofedges = 0; + Standard_Integer NumberMaxOfIte = 0; + Standard_Real toleranceofconfusion = NAN; noofedges = atool.NumberOfItems(); toleranceofconfusion = atool.ToleranceOfConfusion(); @@ -198,7 +200,7 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool) //--------------------------------------------------- // Initialisation des bissectrices issues du contour. //--------------------------------------------------- - Standard_Real Dist; + Standard_Real Dist = NAN; theedgelist->First(); for(i=0; iNumber()-1; i++) { @@ -800,12 +802,12 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool) Handle(MAT_Edge) edgetoremove; Handle(MAT_Edge) previousedge,currentedge; - Standard_Integer noofbisectorstoremove; + Standard_Integer noofbisectorstoremove = 0; Handle(MAT_Bisector) firstbisector,secondbisector; Handle(MAT_Edge) edge; - Standard_Integer intersectionpoint; - Standard_Integer beginbisector; - Standard_Integer noofbisectors; + Standard_Integer intersectionpoint = 0; + Standard_Integer beginbisector = 0; + Standard_Integer noofbisectors = 0; Standard_Integer NbIterBis = 0; Standard_Integer EvenNbIterBis = 10; @@ -818,10 +820,10 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool) Handle(MAT_Bisector) bisectortoremove,lastbisector,currentbisector; Handle(MAT_Bisector) previousbisector; - Standard_Integer i,j,k,narea,shift,compact,all; - Standard_Integer noofedges; - Standard_Integer NumberMaxOfIte; - Standard_Real toleranceofconfusion; + Standard_Integer i = 0,j = 0,k = 0,narea = 0,shift = 0,compact = 0,all = 0; + Standard_Integer noofedges = 0; + Standard_Integer NumberMaxOfIte = 0; + Standard_Real toleranceofconfusion = NAN; noofedges = atool.NumberOfItems(); toleranceofconfusion = atool.ToleranceOfConfusion(); @@ -869,7 +871,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool) //--------------------------------------------------- // Initialisation des bissectrices issues du contour. //--------------------------------------------------- - Standard_Real Dist; + Standard_Real Dist = NAN; theedgelist->First(); for(i=0; iNumber(); i++) { @@ -1510,7 +1512,7 @@ void MAT2d_Mat2d::LoadBisectorsToRemove const Handle(MAT_Bisector)& lastbisectortoremove2 ) { - Standard_Integer found,index; + Standard_Integer found = 0,index = 0; Handle(MAT_Bisector) firstbisectortoremove[2]; Handle(MAT_Bisector) lastbisectortoremove[2]; @@ -1573,10 +1575,10 @@ void MAT2d_Mat2d::Intersect( MAT2d_Tool2d& atool, const Handle(MAT_Bisector)& firstbisector, const Handle(MAT_Bisector)& secondbisector) { - Standard_Integer bisectornumber; - Standard_Real distant,saveparameter; + Standard_Integer bisectornumber = 0; + Standard_Real distant = NAN,saveparameter = NAN; Standard_Real distance[2]; - Standard_Integer intersectionpoint; + Standard_Integer intersectionpoint = 0; Handle(MAT_Bisector) lastbisector,previousbisector; Handle(MAT_Bisector) firstbisectortoremove[2]; Handle(MAT_Bisector) lastbisectortoremove[2]; @@ -1727,7 +1729,7 @@ MAT2d_Mat2d::~MAT2d_Mat2d() MAT_DataMapIteratorOfDataMapOfIntegerBisector itmap(bisectormap); for (; itmap.More(); itmap.Next()) { - Handle(MAT_Bisector) aBisector = itmap.Value(); + const Handle(MAT_Bisector)& aBisector = itmap.Value(); aBisector->FirstEdge(NULL); aBisector->SecondEdge(NULL); } diff --git a/src/MAT2d/MAT2d_MiniPath.cxx b/src/MAT2d/MAT2d_MiniPath.cxx index 7015f32860..b299f1bf2d 100644 --- a/src/MAT2d/MAT2d_MiniPath.cxx +++ b/src/MAT2d/MAT2d_MiniPath.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -50,7 +52,7 @@ void MAT2d_MiniPath::Perform const Standard_Boolean Sense) { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Standard_Integer NbLines = Figure.Length(); MAT2d_Array2OfConnexion Connexion (1,NbLines,1,NbLines); @@ -71,8 +73,8 @@ void MAT2d_MiniPath::Perform TColStd_SequenceOfInteger Set1; TColStd_SequenceOfInteger Set2; - Standard_Real DistS1S2; - Standard_Integer IndiceLine1,IndiceLine2; + Standard_Real DistS1S2 = NAN; + Standard_Integer IndiceLine1 = 0,IndiceLine2 = 0; Standard_Integer ISuiv =0,MinOnSet1 =0,MinOnSet2 =0; //--------------------------------------------------------------------------- // - 0 Set1 est initialise avec la ligne de depart. @@ -222,7 +224,7 @@ Handle(MAT2d_Connexion) MAT2d_MiniPath::Father(const Standard_Integer ILine) //============================================================================ void MAT2d_MiniPath::RunOnConnexions() { - Standard_Integer i; + Standard_Integer i = 0; Handle(MAT2d_Connexion) C; const MAT2d_SequenceOfConnexion& SC = theConnexions(indStart); @@ -243,7 +245,7 @@ void MAT2d_MiniPath::RunOnConnexions() void MAT2d_MiniPath::ExploSons( MAT2d_SequenceOfConnexion& CResult, const Handle(MAT2d_Connexion)& CRef ) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer Index = CRef->IndexSecondLine(); if (!theConnexions.IsBound(Index)) return; @@ -286,8 +288,8 @@ Handle(MAT2d_Connexion) MAT2d_MiniPath::MinimumL1L2 const Standard_Integer IL2) const { Extrema_POnCurv2d PointOnCurv1,PointOnCurv2; - Standard_Integer IC1,IC2,IMinC1 =0,IMinC2 =0,i; - Standard_Real DistL1L2_2,DistP1P2_2; + Standard_Integer IC1 = 0,IC2 = 0,IMinC1 =0,IMinC2 =0,i = 0; + Standard_Real DistL1L2_2 = NAN,DistP1P2_2 = NAN; Standard_Real ParameterOnC1 =0.,ParameterOnC2 =0.; TColGeom2d_SequenceOfGeometry L1,L2; gp_Pnt2d Point1,Point2,P1,P2; diff --git a/src/MAT2d/MAT2d_Tool2d.cxx b/src/MAT2d/MAT2d_Tool2d.cxx index 9c77259759..b2823a5a1f 100644 --- a/src/MAT2d/MAT2d_Tool2d.cxx +++ b/src/MAT2d/MAT2d_Tool2d.cxx @@ -29,6 +29,8 @@ #include #endif +#include + #include #include #include @@ -102,13 +104,13 @@ static Standard_Real MAT2d_TOLCONF = 1.e-7; //function : //purpose : //============================================================================ -MAT2d_Tool2d::MAT2d_Tool2d() +MAT2d_Tool2d::MAT2d_Tool2d() : theDirection(1.), theJoinType(GeomAbs_Arc), theNumberOfBisectors(0), theNumberOfPnts(0), theNumberOfVecs(0) { - theDirection = 1.; - theJoinType = GeomAbs_Arc; //default - theNumberOfBisectors = 0; - theNumberOfVecs = 0; - theNumberOfPnts = 0; + + //default + + + } //============================================================================= @@ -207,7 +209,7 @@ Standard_Integer MAT2d_Tool2d::FirstPoint(const Standard_Integer anitem, Standard_Integer MAT2d_Tool2d::TangentBefore(const Standard_Integer anitem, const Standard_Boolean IsOpenResult) { - Standard_Integer item; + Standard_Integer item = 0; Handle(Geom2d_Curve) curve; theNumberOfVecs++; @@ -216,7 +218,7 @@ Standard_Integer MAT2d_Tool2d::TangentBefore(const Standard_Integer anitem, else item = (anitem == theCircuit->NumberOfItems()) ? (anitem - 1) : (anitem + 1); if (theCircuit->ConnexionOn(item)){ - Standard_Real x1,y1,x2,y2; + Standard_Real x1 = NAN,y1 = NAN,x2 = NAN,y2 = NAN; theCircuit->Connexion(item)->PointOnFirst().Coord(x1,y1); theCircuit->Connexion(item)->PointOnSecond().Coord(x2,y2); theGeomVecs.Bind(theNumberOfVecs,gp_Vec2d((x2-x1),(y2-y1))); @@ -258,13 +260,13 @@ Standard_Integer MAT2d_Tool2d::TangentBefore(const Standard_Integer anitem, Standard_Integer MAT2d_Tool2d::TangentAfter(const Standard_Integer anitem, const Standard_Boolean IsOpenResult) { - Standard_Integer item; + Standard_Integer item = 0; Handle(Geom2d_Curve) curve; gp_Vec2d thevector; theNumberOfVecs++; if (theCircuit->ConnexionOn(anitem)){ - Standard_Real x1,y1,x2,y2; + Standard_Real x1 = NAN,y1 = NAN,x2 = NAN,y2 = NAN; theCircuit->Connexion(anitem)->PointOnFirst().Coord(x1,y1); theCircuit->Connexion(anitem)->PointOnSecond().Coord(x2,y2); theGeomVecs.Bind(theNumberOfVecs,gp_Vec2d((x1-x2),(y1-y2))); @@ -466,7 +468,7 @@ void MAT2d_Tool2d::TrimBisec ( Bisector_Bisec& B1, //gp_Vec2d Tan1,Tan2; gp_Pnt2d Ori; //PEdge; - Standard_Integer INext; + Standard_Integer INext = 0; INext = (IndexEdge == theCircuit->NumberOfItems()) ? 1 : (IndexEdge + 1); Handle(Standard_Type) EdgeType = theCircuit->Value(IndexEdge)->DynamicType(); @@ -553,7 +555,7 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector (const Handle(MAT_Bisector)& abisector, const Standard_Integer apoint) { - Standard_Real Param; + Standard_Real Param = NAN; Handle(Geom2d_TrimmedCurve) Bisector = ChangeGeomBis(abisector->BisectorNumber()).ChangeValue(); @@ -591,7 +593,7 @@ Standard_Boolean MAT2d_Tool2d::Projection (const Standard_Integer IEdge , Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge); Handle(Standard_Type) Type = Elt->DynamicType(); Handle(Geom2d_TrimmedCurve) Curve; - Standard_Integer INext; + Standard_Integer INext = 0; Standard_Real Eps = MAT2d_TOLCONF;//*10.; if (Type == STANDARD_TYPE(Geom2d_CartesianPoint)) { @@ -672,7 +674,7 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance ( { TColStd_Array1OfReal Dist(1,4); const Standard_Real eps = 1.e-7; - Standard_Integer IEdge1,IEdge2,IEdge3,IEdge4; + Standard_Integer IEdge1 = 0,IEdge2 = 0,IEdge3 = 0,IEdge4 = 0; IEdge1 = BisectorOne->FirstEdge() ->EdgeNumber(); IEdge2 = BisectorOne->SecondEdge()->EdgeNumber(); @@ -782,10 +784,10 @@ Standard_Real MAT2d_Tool2d::IntersectBisector ( Standard_Integer& IntPnt) { Standard_Real Tolerance = MAT2d_TOLCONF; - Standard_Real Param1,Param2; - Standard_Real Parama,Paramb; - Standard_Real Distance = 0.,DistanceMini; - Standard_Boolean SolutionValide; + Standard_Real Param1 = NAN,Param2 = NAN; + Standard_Real Parama = NAN,Paramb = NAN; + Standard_Real Distance = 0.,DistanceMini = NAN; + Standard_Boolean SolutionValide = 0; gp_Pnt2d PointSolution; Handle(Geom2d_TrimmedCurve) Bisector1 = @@ -890,7 +892,7 @@ Standard_Real MAT2d_Tool2d::IntersectBisector ( // ---------------------------------------------------------------- if ((Segment.HasFirstPoint() && Segment.HasLastPoint())) { gp_Pnt2d P1,P2; - Standard_Real SegmentLength; + Standard_Real SegmentLength = NAN; P1 = Segment.FirstPoint().Value(); P2 = Segment.LastPoint().Value(); SegmentLength = P1.Distance(P2); @@ -980,7 +982,7 @@ Standard_Real MAT2d_Tool2d::IntersectBisector ( // et un cote). //----------------------------------------------------------------------- - Standard_Integer IndexEdge1,IndexEdge2,IndexEdge3,IndexEdge4; + Standard_Integer IndexEdge1 = 0,IndexEdge2 = 0,IndexEdge3 = 0,IndexEdge4 = 0; Standard_Boolean ExtremiteControle = Standard_True; IndexEdge1 = BisectorOne->FirstEdge() ->EdgeNumber(); @@ -1178,7 +1180,7 @@ Handle(MAT2d_Circuit) MAT2d_Tool2d::Circuit()const void MAT2d_Tool2d::BisecFusion(const Standard_Integer I1, const Standard_Integer I2) { - Standard_Real DU,UL1,UF1; + Standard_Real DU = NAN,UL1 = NAN,UF1 = NAN; Handle(Geom2d_TrimmedCurve) Bisector1; Handle(Geom2d_TrimmedCurve) Bisector2; @@ -1267,7 +1269,7 @@ Standard_Boolean AreNeighbours(const Standard_Integer IEdge1, static void SetTrim(Bisector_Bisec& Bis, const Handle(Geom2d_Curve)& Line1) { Geom2dInt_GInter Intersect; - Standard_Real Distance; + Standard_Real Distance = NAN; Standard_Real Tolerance = MAT2d_TOLCONF; Handle(Geom2d_TrimmedCurve) Bisector = Bis.ChangeValue(); @@ -1320,7 +1322,7 @@ IntRes2d_Domain Domain(const Handle(Geom2d_TrimmedCurve)& Bisector1, } gp_Parab2d gpParabola; gp_Hypr2d gpHyperbola; - Standard_Real Focus; + Standard_Real Focus = NAN; Standard_Real Limit = 50000.; if (Type1 == STANDARD_TYPE(Geom2d_Parabola)) { gpParabola = Handle(Geom2d_Parabola)::DownCast(BasisCurve)->Parab2d(); diff --git a/src/Media/Media_Packet.hxx b/src/Media/Media_Packet.hxx index 60bd3f0406..a7a8193dea 100644 --- a/src/Media/Media_Packet.hxx +++ b/src/Media/Media_Packet.hxx @@ -77,7 +77,7 @@ public: protected: AVPacket* myPacket; //!< packet - double myDurationSec; //!< packet duration in seconds + double myDurationSec{}; //!< packet duration in seconds }; diff --git a/src/Message/Message_Algorithm.cxx b/src/Message/Message_Algorithm.cxx index 8a04ef27cc..67c8f8eaec 100644 --- a/src/Message/Message_Algorithm.cxx +++ b/src/Message/Message_Algorithm.cxx @@ -35,9 +35,9 @@ IMPLEMENT_STANDARD_RTTIEXT(Message_Algorithm,Standard_Transient) //function : Message_Algorithm //purpose : //======================================================================= -Message_Algorithm::Message_Algorithm () +Message_Algorithm::Message_Algorithm () : myMessenger(Message::DefaultMessenger()) { - myMessenger = Message::DefaultMessenger(); + } //======================================================================= diff --git a/src/Message/Message_AttributeMeter.cxx b/src/Message/Message_AttributeMeter.cxx index e50976c910..07dc53c9b1 100644 --- a/src/Message/Message_AttributeMeter.cxx +++ b/src/Message/Message_AttributeMeter.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -144,7 +146,7 @@ void Message_AttributeMeter::SetAlertMetrics (const Handle(Message_AlertExtended if (anActiveMetrics.Contains (Message_MetricType_ProcessCPUUserTime) || anActiveMetrics.Contains (Message_MetricType_ProcessCPUSystemTime)) { - Standard_Real aProcessUserTime, aProcessSystemTime; + Standard_Real aProcessUserTime = NAN, aProcessSystemTime = NAN; OSD_Chronometer::GetProcessCPU (aProcessUserTime, aProcessSystemTime); if (anActiveMetrics.Contains (Message_MetricType_ProcessCPUUserTime)) { @@ -172,7 +174,7 @@ void Message_AttributeMeter::SetAlertMetrics (const Handle(Message_AlertExtended if (anActiveMetrics.Contains (Message_MetricType_ThreadCPUUserTime) || anActiveMetrics.Contains (Message_MetricType_ThreadCPUSystemTime)) { - Standard_Real aThreadUserTime, aThreadSystemTime; + Standard_Real aThreadUserTime = NAN, aThreadSystemTime = NAN; OSD_Chronometer::GetThreadCPU (aThreadUserTime, aThreadSystemTime); if (anActiveMetrics.Contains (Message_MetricType_ThreadCPUUserTime)) { diff --git a/src/Message/Message_AttributeObject.cxx b/src/Message/Message_AttributeObject.cxx index db16d967bf..f71ca44cc6 100644 --- a/src/Message/Message_AttributeObject.cxx +++ b/src/Message/Message_AttributeObject.cxx @@ -22,9 +22,9 @@ IMPLEMENT_STANDARD_RTTIEXT(Message_AttributeObject, Message_Attribute) //======================================================================= Message_AttributeObject::Message_AttributeObject (const Handle(Standard_Transient)& theObject, const TCollection_AsciiString& theName) -: Message_Attribute(theName) +: Message_Attribute(theName), myObject(theObject) { - myObject = theObject; + } //======================================================================= diff --git a/src/Message/Message_Msg.cxx b/src/Message/Message_Msg.cxx index ade83fe1ff..4b3b33bf1b 100644 --- a/src/Message/Message_Msg.cxx +++ b/src/Message/Message_Msg.cxx @@ -39,10 +39,10 @@ Message_Msg::Message_Msg () //purpose : Constructor //======================================================================= -Message_Msg::Message_Msg (const Message_Msg& theMsg) +Message_Msg::Message_Msg (const Message_Msg& theMsg) : myMessageBody(theMsg.myMessageBody), myOriginal(theMsg.myOriginal) { - myMessageBody = theMsg.myMessageBody; - myOriginal = theMsg.myOriginal; + + for ( Standard_Integer i = 1, n = theMsg.mySeqOfFormats.Length(); i <=n; i++ ) mySeqOfFormats.Append ( theMsg.mySeqOfFormats.Value(i) ); } @@ -251,7 +251,7 @@ Message_Msg& Message_Msg::Arg (const Standard_Real theValue) const TCollection_ExtendedString& Message_Msg::Get () { // remove all non-initialised format specifications - Standard_Integer i, anIncrement = 0; + Standard_Integer i = 0, anIncrement = 0; static const TCollection_ExtendedString anUnknown ("UNKNOWN"); for (i = 1; i < mySeqOfFormats.Length(); i += 3) { diff --git a/src/Message/Message_MsgFile.cxx b/src/Message/Message_MsgFile.cxx index 34abfe57f3..fb232c1622 100644 --- a/src/Message/Message_MsgFile.cxx +++ b/src/Message/Message_MsgFile.cxx @@ -95,8 +95,8 @@ getString (CharType *& thePtr, Standard_Integer& theLeftSpaces) { CharType * anEndPtr = thePtr; - CharType * aPtr; - Standard_Integer aLeftSpaces; + CharType * aPtr = nullptr; + Standard_Integer aLeftSpaces = 0; do { diff --git a/src/Message/Message_PrinterOStream.cxx b/src/Message/Message_PrinterOStream.cxx index ee53f8187a..3e487036af 100644 --- a/src/Message/Message_PrinterOStream.cxx +++ b/src/Message/Message_PrinterOStream.cxx @@ -102,7 +102,7 @@ void Message_PrinterOStream::Close () ostr->flush(); if ( myIsFile ) { - std::ofstream* ofile = (std::ofstream* )ostr; + std::ofstream* ofile = dynamic_cast(ostr); ofile->close(); delete ofile; myIsFile = Standard_False; diff --git a/src/Message/Message_PrinterToReport.cxx b/src/Message/Message_PrinterToReport.cxx index 0bbd84062f..2888a55bd9 100644 --- a/src/Message/Message_PrinterToReport.cxx +++ b/src/Message/Message_PrinterToReport.cxx @@ -112,7 +112,7 @@ void Message_PrinterToReport::send (const TCollection_AsciiString& theString, //function : sendMetricAlert //purpose : //======================================================================= -void Message_PrinterToReport::sendMetricAlert (const TCollection_AsciiString theValue, +void Message_PrinterToReport::sendMetricAlert (const TCollection_AsciiString& theValue, const Message_Gravity theGravity) const { Message_AlertExtended::AddAlert (Report(), new Message_AttributeMeter (theValue), theGravity); diff --git a/src/Message/Message_PrinterToReport.hxx b/src/Message/Message_PrinterToReport.hxx index e82cfe1565..eb05a60638 100644 --- a/src/Message/Message_PrinterToReport.hxx +++ b/src/Message/Message_PrinterToReport.hxx @@ -61,7 +61,7 @@ protected: const Message_Gravity theGravity) const Standard_OVERRIDE; //! Send an alert with metrics active in the current report - Standard_EXPORT void sendMetricAlert (const TCollection_AsciiString theValue, + Standard_EXPORT void sendMetricAlert (const TCollection_AsciiString& theValue, const Message_Gravity theGravity) const; private: diff --git a/src/Message/Message_ProgressIndicator.cxx b/src/Message/Message_ProgressIndicator.cxx index 6abf893f9c..ac893cf934 100644 --- a/src/Message/Message_ProgressIndicator.cxx +++ b/src/Message/Message_ProgressIndicator.cxx @@ -21,9 +21,9 @@ IMPLEMENT_STANDARD_RTTIEXT(Message_ProgressIndicator,Standard_Transient) //======================================================================= Message_ProgressIndicator::Message_ProgressIndicator() : myPosition(0.), - myRootScope (NULL) + myRootScope(new Message_ProgressScope (this)) { - myRootScope = new Message_ProgressScope (this); + } //======================================================================= diff --git a/src/Message/Message_Report.cxx b/src/Message/Message_Report.cxx index b63bd7137f..9f606f7448 100644 --- a/src/Message/Message_Report.cxx +++ b/src/Message/Message_Report.cxx @@ -148,7 +148,7 @@ void Message_Report::ActivateInMessenger (const Standard_Boolean toActivate, Message_SequenceOfPrinters aPrintersToRemove; for (Message_SequenceOfPrinters::Iterator anIterator (aMessenger->Printers()); anIterator.More(); anIterator.Next()) { - const Handle(Message_Printer) aPrinter = anIterator.Value(); + const Handle(Message_Printer)& aPrinter = anIterator.Value(); if (aPrinter->IsKind(STANDARD_TYPE (Message_PrinterToReport)) && Handle(Message_PrinterToReport)::DownCast (aPrinter)->Report() == this) aPrintersToRemove.Append (aPrinter); diff --git a/src/MoniTool/MoniTool_AttrList.cxx b/src/MoniTool/MoniTool_AttrList.cxx index e5deb74a74..b7533c8f8b 100644 --- a/src/MoniTool/MoniTool_AttrList.cxx +++ b/src/MoniTool/MoniTool_AttrList.cxx @@ -169,10 +169,10 @@ MoniTool_AttrList::MoniTool_AttrList () { } NCollection_DataMap::Iterator iter(list); for (; iter.More(); iter.Next()) { - TCollection_AsciiString name = iter.Key(); + const TCollection_AsciiString& name = iter.Key(); if (!name.StartsWith(fromname)) continue; - Handle(Standard_Transient) atr = iter.Value(); + const Handle(Standard_Transient)& atr = iter.Value(); Handle(Standard_Transient) newatr = atr; // Copy ? according type diff --git a/src/MoniTool/MoniTool_CaseData.cxx b/src/MoniTool/MoniTool_CaseData.cxx index 9df9eea736..a9fd1323cf 100644 --- a/src/MoniTool/MoniTool_CaseData.cxx +++ b/src/MoniTool/MoniTool_CaseData.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -45,8 +47,8 @@ static OSD_Timer& chrono() { MoniTool_CaseData::MoniTool_CaseData (const Standard_CString caseid, const Standard_CString name) - : thesubst (0) , thecase (caseid) , thename (name) - { thecheck = DefCheck(caseid); } + : thecheck(DefCheck(caseid)), thesubst (0) , thecase (caseid) , thename (name) + { } void MoniTool_CaseData::SetCaseId (const Standard_CString caseid) { thecase.Clear(); thecase.AssignCat (caseid); thecheck = DefCheck(caseid); thesubst = 0; } @@ -141,7 +143,7 @@ static OSD_Timer& chrono() { { Standard_Real cpu = curCPU; if (cpu == 0.) { - Standard_Real sec; Standard_Integer i1,i2; + Standard_Real sec = NAN; Standard_Integer i1 = 0,i2 = 0; chrono().Show (sec,i1,i2,cpu); } cpu = cpu - lastCPU; @@ -151,7 +153,7 @@ static OSD_Timer& chrono() { Standard_Real MoniTool_CaseData::GetCPU () const { if (!stachr) { chrono().Start(); stachr = Standard_True; } - Standard_Real sec,cpu; Standard_Integer i1,i2; + Standard_Real sec = NAN,cpu = NAN; Standard_Integer i1 = 0,i2 = 0; chrono().Show (sec,i1,i2,cpu); return cpu; } @@ -162,7 +164,7 @@ static OSD_Timer& chrono() { { Standard_Real cpu = curCPU; if (cpu == 0.) { - Standard_Real sec; Standard_Integer i1,i2; + Standard_Real sec = NAN; Standard_Integer i1 = 0,i2 = 0; chrono().Show (sec,i1,i2,cpu); } cpu = cpu - lastCPU; @@ -285,7 +287,7 @@ static Standard_Integer NameRank (const Standard_CString name) (const Standard_CString name) const { if (!name || name[0] == '\0') return 0; - Standard_Integer nd, nn = 0, nb = NbData(); + Standard_Integer nd = 0, nn = 0, nb = NbData(); for (nd = 1; nd <= nb; nd ++) { if (thednam(nd).IsEqual(name)) return nd; } @@ -399,7 +401,7 @@ Message_Msg MoniTool_CaseData::Msg () const Standard_Integer MoniTool_CaseData::DefCheck (const Standard_CString acode) { - Standard_Integer val; + Standard_Integer val = 0; if (!defch.Find(acode, val)) val = 0; return val; diff --git a/src/MoniTool/MoniTool_IntVal.cxx b/src/MoniTool/MoniTool_IntVal.cxx index f98c8e5104..774fd84c04 100644 --- a/src/MoniTool/MoniTool_IntVal.cxx +++ b/src/MoniTool/MoniTool_IntVal.cxx @@ -17,7 +17,7 @@ IMPLEMENT_STANDARD_RTTIEXT(MoniTool_IntVal,Standard_Transient) -MoniTool_IntVal::MoniTool_IntVal (const Standard_Integer val) { theval = val; } +MoniTool_IntVal::MoniTool_IntVal (const Standard_Integer val) : theval(val) { } Standard_Integer MoniTool_IntVal::Value () const { return theval; } diff --git a/src/MoniTool/MoniTool_RealVal.cxx b/src/MoniTool/MoniTool_RealVal.cxx index 54014306eb..5064332665 100644 --- a/src/MoniTool/MoniTool_RealVal.cxx +++ b/src/MoniTool/MoniTool_RealVal.cxx @@ -17,7 +17,7 @@ IMPLEMENT_STANDARD_RTTIEXT(MoniTool_RealVal,Standard_Transient) -MoniTool_RealVal::MoniTool_RealVal (const Standard_Real val) { theval = val; } +MoniTool_RealVal::MoniTool_RealVal (const Standard_Real val) : theval(val) { } Standard_Real MoniTool_RealVal::Value () const { return theval; } diff --git a/src/MoniTool/MoniTool_Stat.cxx b/src/MoniTool/MoniTool_Stat.cxx index 7f656fe77a..3e8462e5ed 100644 --- a/src/MoniTool/MoniTool_Stat.cxx +++ b/src/MoniTool/MoniTool_Stat.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -19,13 +21,13 @@ //static MoniTool_Stat Statact (""); //not Used //static Standard_CString voidname = ""; -MoniTool_Stat::MoniTool_Stat (const Standard_CString title) +MoniTool_Stat::MoniTool_Stat (const Standard_CString title) : thetit(new TCollection_HAsciiString(title)), thelev(0), thetot(new TColStd_HArray1OfInteger (1,20)), thedone(new TColStd_HArray1OfInteger (1,20)), thecurr(new TColStd_HArray1OfInteger (1,20)) { - thetit = new TCollection_HAsciiString(title); - thelev = 0; - thetot = new TColStd_HArray1OfInteger (1,20); thetot->Init(0); - thedone = new TColStd_HArray1OfInteger (1,20); thetot->Init(0); - thecurr = new TColStd_HArray1OfInteger (1,20); thetot->Init(0); + + + thetot->Init(0); + thetot->Init(0); + thetot->Init(0); } MoniTool_Stat::MoniTool_Stat (const MoniTool_Stat& ) @@ -84,7 +86,7 @@ Standard_Integer MoniTool_Stat::Level () const Standard_Real MoniTool_Stat::Percent (const Standard_Integer fromlev) const { if (fromlev > thelev) return 0; - Standard_Real r1,r2,r3; + Standard_Real r1 = NAN,r2 = NAN,r3 = NAN; Standard_Integer tot = thetot->Value(fromlev); Standard_Integer done = thedone->Value(fromlev); if (done >= tot) return 100.; diff --git a/src/MoniTool/MoniTool_Timer.cxx b/src/MoniTool/MoniTool_Timer.cxx index fb7021f935..f95f843f8f 100644 --- a/src/MoniTool/MoniTool_Timer.cxx +++ b/src/MoniTool/MoniTool_Timer.cxx @@ -19,6 +19,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(MoniTool_Timer,Standard_Transient) @@ -28,8 +29,8 @@ IMPLEMENT_STANDARD_RTTIEXT(MoniTool_Timer,Standard_Transient) //======================================================================= void MoniTool_Timer::Dump(Standard_OStream &ostr) { - Standard_Integer hours, minutes; - Standard_Real seconds, CPUtime, user, system; + Standard_Integer hours = 0, minutes = 0; + Standard_Real seconds = NAN, CPUtime = NAN, user = NAN, system = NAN; myTimer.Show(seconds,minutes,hours,CPUtime); myTimer.OSD_Chronometer::Show(user,system); @@ -131,7 +132,7 @@ void MoniTool_Timer::ComputeAmendments () { const Standard_Integer NBTESTS = 100000; - Standard_Integer i; + Standard_Integer i = 0; Handle(MoniTool_Timer) MT0 = MoniTool_Timer::Timer("_mt_amend_0_"); Handle(MoniTool_Timer) MT1 = MoniTool_Timer::Timer("_mt_amend_1_"); @@ -180,7 +181,7 @@ void MoniTool_Timer::ComputeAmendments () MT3->Stop(); // analyze results - Standard_Real cpu0, cpu1, cpu2, cpu3, cput1, cput2, cput3; + Standard_Real cpu0 = NAN, cpu1 = NAN, cpu2 = NAN, cpu3 = NAN, cput1 = NAN, cput2 = NAN, cput3 = NAN; cpu0 = MoniTool_Timer::Timer("_mt_amend_0_")->CPU(); cpu1 = MoniTool_Timer::Timer("_mt_amend_1_")->CPU(); cput1 = MT->CPU(); diff --git a/src/MoniTool/MoniTool_TypedValue.cxx b/src/MoniTool/MoniTool_TypedValue.cxx index 244f821d83..386f2f860e 100644 --- a/src/MoniTool/MoniTool_TypedValue.cxx +++ b/src/MoniTool/MoniTool_TypedValue.cxx @@ -21,6 +21,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(MoniTool_TypedValue,Standard_Transient) @@ -99,7 +100,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) theoval (other->ObjectValue()) { NCollection_DataMap eadds; - Standard_CString satisname; + Standard_CString satisname = nullptr; other->Internals (theinterp,thesatisf,satisname, eadds); thesatisn.AssignCat (satisname); @@ -108,7 +109,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) if (other->RealLimit (Standard_False,therealow)) thelims |= 1; if (other->RealLimit (Standard_True ,therealup)) thelims |= 2; - Standard_Integer startcase, endcase; Standard_Boolean match; + Standard_Integer startcase = 0, endcase = 0; Standard_Boolean match = 0; if (other->EnumDef (startcase,endcase,match)) { theintlow = startcase; theintup = endcase; if (match) thelims |= 4; @@ -149,7 +150,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) switch (thetype) { case MoniTool_ValueInteger : { def.AssignCat("Integer"); - Standard_Integer ilim; + Standard_Integer ilim = 0; if (IntegerLimit(Standard_False, ilim)) { Sprintf(mess," >= %d",ilim); def.AssignCat(mess); @@ -162,7 +163,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) break; case MoniTool_ValueReal : { def.AssignCat("Real"); - Standard_Real rlim; + Standard_Real rlim = NAN; if (RealLimit(Standard_False, rlim)) { Sprintf(mess," >= %f",rlim); def.AssignCat(mess); @@ -192,7 +193,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) def.AssignCat(" , alpha: "); NCollection_DataMap::Iterator listadd(theeadds); for (; listadd.More(); listadd.Next()) { - TCollection_AsciiString aName = listadd.Key(); + const TCollection_AsciiString& aName = listadd.Key(); Standard_CString enva = aName.ToCString(); if (enva[0] == '?') continue; Sprintf(mess,":%d ",listadd.Value()); @@ -268,7 +269,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) (const Standard_CString init) { // Editions : init donne un petit texte d edition, en 2 termes "cmd var" : - Standard_Integer i,iblc = 0; + Standard_Integer i = 0,iblc = 0; for (i = 0; init[i] != '\0'; i ++) if (init[i] == ' ') iblc = i+1; if (iblc == 0) return Standard_False; // Reconnaissance du sous-cas et aiguillage @@ -475,7 +476,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) (const Standard_CString val) const { if (thetype != MoniTool_ValueEnum) return (theintlow - 1); - Standard_Integer i; // svv Jan 10 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan 10 2000 : porting on DEC for (i = theintlow; i <= theintup; i ++) if (theenums->Value(i).IsEqual(val)) return i; // cas additionnel ? @@ -553,7 +554,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) if (theinterp) return theinterp (this,hval,native); if (thetype == MoniTool_ValueEnum) { // On admet les deux formes : Enum de preference, sinon Integer - Standard_Integer startcase, endcase; Standard_Boolean match; + Standard_Integer startcase = 0, endcase = 0; Standard_Boolean match = 0; EnumDef (startcase,endcase,match); Standard_Integer encas = EnumCase (hval->ToCString()); if (encas < startcase) return hval; // loupe @@ -573,7 +574,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) switch (thetype) { case MoniTool_ValueInteger : { if (!val->IsIntegerValue()) return Standard_False; - Standard_Integer ival, ilim; ival = atoi(val->ToCString()); + Standard_Integer ival = 0, ilim = 0; ival = atoi(val->ToCString()); if (IntegerLimit(Standard_False, ilim)) if (ilim > ival) return Standard_False; if (IntegerLimit(Standard_True, ilim)) @@ -582,7 +583,7 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) } case MoniTool_ValueReal : { if (!val->IsRealValue()) return Standard_False; - Standard_Real rval, rlim; rval = val->RealValue(); + Standard_Real rval = NAN, rlim = NAN; rval = val->RealValue(); if (RealLimit(Standard_False, rlim)) if (rlim > rval) return Standard_False; if (RealLimit(Standard_True, rlim)) @@ -591,8 +592,8 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val) } case MoniTool_ValueEnum : { // On admet les deux formes : Enum de preference, sinon Integer - Standard_Integer startcase, endcase;// unused ival; - Standard_Boolean match; + Standard_Integer startcase = 0, endcase = 0;// unused ival; + Standard_Boolean match = 0; EnumDef (startcase,endcase,match); if (!match) return Standard_True; if (EnumCase (val->ToCString()) >= startcase) return Standard_True; diff --git a/src/MoniTool/MoniTool_TypedValue.hxx b/src/MoniTool/MoniTool_TypedValue.hxx index f5180b114c..19c2d4fe8e 100644 --- a/src/MoniTool/MoniTool_TypedValue.hxx +++ b/src/MoniTool/MoniTool_TypedValue.hxx @@ -337,8 +337,8 @@ private: TCollection_AsciiString theunidef; Handle(TColStd_HArray1OfAsciiString) theenums; NCollection_DataMap theeadds; - MoniTool_ValueInterpret theinterp; - MoniTool_ValueSatisfies thesatisf; + MoniTool_ValueInterpret theinterp{}; + MoniTool_ValueSatisfies thesatisf{}; TCollection_AsciiString thesatisn; Standard_Integer theival; Handle(TCollection_HAsciiString) thehval; diff --git a/src/NCollection/NCollection_AccAllocator.cxx b/src/NCollection/NCollection_AccAllocator.cxx index e7172ccff7..00ccd68a9f 100644 --- a/src/NCollection/NCollection_AccAllocator.cxx +++ b/src/NCollection/NCollection_AccAllocator.cxx @@ -48,7 +48,7 @@ NCollection_AccAllocator::~NCollection_AccAllocator() void* NCollection_AccAllocator::Allocate(const size_t theSize) { const AlignedSize aSize(theSize); - Block* aBlock; + Block* aBlock = nullptr; if (aSize <= mypLastBlock->FreeSize()) { @@ -91,7 +91,7 @@ void* NCollection_AccAllocator::Allocate(const size_t theSize) //======================================================================= void NCollection_AccAllocator::Free(void* theAddress) { - Key aKey; + Key aKey{}; Block* aBlock = findBlock(theAddress, aKey); #if !defined No_Exception && !defined No_Standard_ProgramError @@ -111,7 +111,7 @@ void NCollection_AccAllocator::Free(void* theAddress) if (myBlocks.Size() > 1) { Standard::Free(anAddress); - Block** appBlock; + Block** appBlock = nullptr; for (appBlock = &mypLastBlock; *appBlock != 0L; appBlock = &(*appBlock)->prevBlock) diff --git a/src/NCollection/NCollection_BaseMap.cxx b/src/NCollection/NCollection_BaseMap.cxx index c18c219fcb..399ab28a8a 100644 --- a/src/NCollection/NCollection_BaseMap.cxx +++ b/src/NCollection/NCollection_BaseMap.cxx @@ -84,9 +84,9 @@ void NCollection_BaseMap::Destroy (NCollection_DelMapNode fDel, { if (!IsEmpty()) { - Standard_Integer i; + Standard_Integer i = 0; NCollection_ListNode** data = (NCollection_ListNode**) myData1; - NCollection_ListNode *p,*q; + NCollection_ListNode *p = nullptr,*q = nullptr; for (i = 0; i <= NbBuckets(); i++) { if (data[i]) @@ -129,9 +129,9 @@ void NCollection_BaseMap::Statistics(Standard_OStream& S) const // compute statistics on 1 Standard_Integer * sizes = new Standard_Integer [mySize+1]; - Standard_Integer i,l,nb; - NCollection_ListNode* p; - NCollection_ListNode** data; + Standard_Integer i = 0,l = 0,nb = 0; + NCollection_ListNode* p = nullptr; + NCollection_ListNode** data = nullptr; S << "\nStatistics for the first Key\n"; for (i = 0; i <= mySize; i++) sizes[i] = 0; diff --git a/src/NCollection/NCollection_BaseSequence.cxx b/src/NCollection/NCollection_BaseSequence.cxx index 08a0a45934..847ca5ce15 100644 --- a/src/NCollection/NCollection_BaseSequence.cxx +++ b/src/NCollection/NCollection_BaseSequence.cxx @@ -436,8 +436,8 @@ void NCollection_BaseSequence::RemoveSeq (const Standard_Integer From, NCollection_SeqNode * NCollection_BaseSequence::Find (const Standard_Integer theIndex) const { - Standard_Integer i; - NCollection_SeqNode * p; + Standard_Integer i = 0; + NCollection_SeqNode * p = nullptr; if (theIndex <= myCurrentIndex) { if (theIndex < myCurrentIndex / 2) { p = myFirstItem; diff --git a/src/NLPlate/NLPlate_HPG0Constraint.cxx b/src/NLPlate/NLPlate_HPG0Constraint.cxx index 4f9503c5d1..c7690070d7 100644 --- a/src/NLPlate/NLPlate_HPG0Constraint.cxx +++ b/src/NLPlate/NLPlate_HPG0Constraint.cxx @@ -21,12 +21,12 @@ IMPLEMENT_STANDARD_RTTIEXT(NLPlate_HPG0Constraint,NLPlate_HGPPConstraint) NLPlate_HPG0Constraint::NLPlate_HPG0Constraint(const gp_XY& UV,const gp_XYZ& Value) -:myXYZTarget(Value) +:myXYZTarget(Value), UVIsFree(Standard_False), IncrementalLoadingAllowed(Standard_False) { SetUV(UV); SetActiveOrder(0); - UVIsFree = Standard_False; - IncrementalLoadingAllowed = Standard_False; + + } void NLPlate_HPG0Constraint::SetUVFreeSliding(const Standard_Boolean UVFree) { diff --git a/src/NLPlate/NLPlate_HPG0G1Constraint.cxx b/src/NLPlate/NLPlate_HPG0G1Constraint.cxx index 6deefe1b5d..865e88a524 100644 --- a/src/NLPlate/NLPlate_HPG0G1Constraint.cxx +++ b/src/NLPlate/NLPlate_HPG0G1Constraint.cxx @@ -22,10 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(NLPlate_HPG0G1Constraint,NLPlate_HPG0Constraint) NLPlate_HPG0G1Constraint::NLPlate_HPG0G1Constraint(const gp_XY& UV,const gp_XYZ& Value,const Plate_D1& D1T) -: NLPlate_HPG0Constraint(UV,Value),myG1Target(D1T) +: NLPlate_HPG0Constraint(UV,Value),myG1Target(D1T), myOrientation(0) { SetActiveOrder(1); - myOrientation = 0; + } void NLPlate_HPG0G1Constraint::SetOrientation(const Standard_Integer Orient) diff --git a/src/NLPlate/NLPlate_HPG1Constraint.cxx b/src/NLPlate/NLPlate_HPG1Constraint.cxx index 416f1d83e3..412071c6af 100644 --- a/src/NLPlate/NLPlate_HPG1Constraint.cxx +++ b/src/NLPlate/NLPlate_HPG1Constraint.cxx @@ -22,12 +22,12 @@ IMPLEMENT_STANDARD_RTTIEXT(NLPlate_HPG1Constraint,NLPlate_HGPPConstraint) NLPlate_HPG1Constraint::NLPlate_HPG1Constraint(const gp_XY& UV,const Plate_D1& D1T) -:myG1Target(D1T) +:IncrementalLoadingAllowed(Standard_False), myG1Target(D1T), myOrientation(0) { SetUV(UV); SetActiveOrder(1); - IncrementalLoadingAllowed = Standard_False; - myOrientation = 0; + + } void NLPlate_HPG1Constraint::SetIncrementalLoadAllowed(const Standard_Boolean ILA) { diff --git a/src/NLPlate/NLPlate_NLPlate.cxx b/src/NLPlate/NLPlate_NLPlate.cxx index c3aa031dcf..fa7e6dcc96 100644 --- a/src/NLPlate/NLPlate_NLPlate.cxx +++ b/src/NLPlate/NLPlate_NLPlate.cxx @@ -162,7 +162,7 @@ NLPlate_NLPlate::NLPlate_NLPlate(const Handle(Geom_Surface)& InitialSurface) : Standard_Integer NLPlate_NLPlate::Continuity() const { - Standard_Integer cont ; + Standard_Integer cont = 0 ; for( cont=-1; cont<10;cont++) { if(!(myInitialSurface->IsCNu(cont+1)&&myInitialSurface->IsCNv(cont+1)))break; diff --git a/src/OSD/OSD.cxx b/src/OSD/OSD.cxx index c150fe7e87..97163ccd46 100644 --- a/src/OSD/OSD.cxx +++ b/src/OSD/OSD.cxx @@ -21,7 +21,7 @@ Standard_Boolean OSD::RealToCString(const Standard_Real aReal, Standard_PCharacter& aString) { - char *p, *q ; + char *p = nullptr, *q = nullptr ; if (Sprintf(aString,"%.17e",aReal) <= 0) //BUC60808 return Standard_False ; @@ -48,7 +48,7 @@ Standard_Boolean OSD::RealToCString(const Standard_Real aReal, Standard_Boolean OSD::CStringToReal(const Standard_CString aString, Standard_Real& aReal) { - char *endptr ; + char *endptr = nullptr ; aReal = Strtod(aString, &endptr); if (*endptr) return Standard_False ; diff --git a/src/OSD/OSD_Chronometer.cxx b/src/OSD/OSD_Chronometer.cxx index 9a95197797..8cab812c0f 100644 --- a/src/OSD/OSD_Chronometer.cxx +++ b/src/OSD/OSD_Chronometer.cxx @@ -21,6 +21,7 @@ #ifndef _WIN32 +#include #include #include @@ -58,7 +59,7 @@ void OSD_Chronometer::GetProcessCPU (Standard_Real& theUserSeconds, static const long aCLK_TCK = CLK_TCK; #endif - tms aCurrentTMS; + tms aCurrentTMS{}; times (&aCurrentTMS); theUserSeconds = (Standard_Real)aCurrentTMS.tms_utime / aCLK_TCK; @@ -84,7 +85,7 @@ void OSD_Chronometer::GetThreadCPU (Standard_Real& theUserSeconds, } #elif (defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)) || defined(__ANDROID__) || defined(__QNX__) // on Linux, only user times are available for threads via clock_gettime() - struct timespec t; + struct timespec t{}; if (!clock_gettime (CLOCK_THREAD_CPUTIME_ID, &t)) { theUserSeconds = t.tv_sec + 0.000000001 * t.tv_nsec; @@ -226,7 +227,7 @@ void OSD_Chronometer::Stop() { if (!myIsStopped) { - Standard_Real Curr_user, Curr_sys; + Standard_Real Curr_user = NAN, Curr_sys = NAN; if (myIsThreadOnly) GetThreadCPU (Curr_user, Curr_sys); else @@ -292,7 +293,7 @@ void OSD_Chronometer::Show (Standard_Real& theUserSec, Standard_Real& theSystemS return; } - Standard_Real aCurrUser, aCurrSys; + Standard_Real aCurrUser = NAN, aCurrSys = NAN; if (myIsThreadOnly) GetThreadCPU (aCurrUser, aCurrSys); else diff --git a/src/OSD/OSD_DirectoryIterator.cxx b/src/OSD/OSD_DirectoryIterator.cxx index 51060492f9..c1fdf9090b 100644 --- a/src/OSD/OSD_DirectoryIterator.cxx +++ b/src/OSD/OSD_DirectoryIterator.cxx @@ -83,7 +83,7 @@ Standard_Boolean OSD_DirectoryIterator::More(){ static int strcmp_joker(const char *Mask,const char *Name) { - const char *p, *s ; + const char *p = nullptr, *s = nullptr ; for(p = Mask,s = Name ; *p && *p != '*' ; p++,s++) if (*p != *s) return 0 ; @@ -99,7 +99,7 @@ static int strcmp_joker(const char *Mask,const char *Name) void OSD_DirectoryIterator::Next(){ int again = 1; -struct stat stat_buf; +struct stat stat_buf{}; myFlag = false; // Initialize to nothing found do{ @@ -138,7 +138,7 @@ OSD_Directory OSD_DirectoryIterator::Values(){ OSD_Path thisvalue; TCollection_AsciiString Name; TCollection_AsciiString Ext; -Standard_Integer position; +Standard_Integer position = 0; if (myEntry) Name = ((struct dirent *)myEntry)->d_name ; diff --git a/src/OSD/OSD_Disk.cxx b/src/OSD/OSD_Disk.cxx index 1900bf327d..45a65ea1a2 100644 --- a/src/OSD/OSD_Disk.cxx +++ b/src/OSD/OSD_Disk.cxx @@ -184,7 +184,7 @@ Standard_Integer OSD_Disk::DiskSize() ULONGLONG aSize = aNbTotalBytes.QuadPart / 512; return (Standard_Integer )aSize; // may be an overflow #else - struct statvfs aBuffer; + struct statvfs aBuffer{}; if (statvfs (myDiskName.ToCString(), &aBuffer) == 0) { unsigned long aBSize512 = aBuffer.f_frsize / 512; @@ -216,7 +216,7 @@ Standard_Integer OSD_Disk::DiskFree() ULONGLONG aSize = aNbFreeAvailableBytes.QuadPart / 512; return (Standard_Integer )aSize; // may be an overflow #else - struct statvfs aBuffer; + struct statvfs aBuffer{}; if (statvfs (myDiskName.ToCString(), &aBuffer) == 0) { unsigned long aBSize512 = aBuffer.f_frsize / 512; diff --git a/src/OSD/OSD_Environment.cxx b/src/OSD/OSD_Environment.cxx index 55259fe2e7..a00503c7e3 100644 --- a/src/OSD/OSD_Environment.cxx +++ b/src/OSD/OSD_Environment.cxx @@ -157,7 +157,7 @@ void OSD_Environment::Build () else { // Allocation memoire. Surtout tout la heap! index = Ibuffer++; - char **aTmp; + char **aTmp = nullptr; aTmp = (char **) realloc ( buffer, Ibuffer * sizeof(char*) ); if (aTmp) { diff --git a/src/OSD/OSD_Error.cxx b/src/OSD/OSD_Error.cxx old mode 100755 new mode 100644 index 89c1b35108..801d0fea05 --- a/src/OSD/OSD_Error.cxx +++ b/src/OSD/OSD_Error.cxx @@ -22,8 +22,8 @@ #include /* Created by Stephan GARNAUD (ARM) 1992 for Matra Datavision */ -OSD_Error::OSD_Error(){ - myErrno = 0; +OSD_Error::OSD_Error() : myErrno(0){ + } diff --git a/src/OSD/OSD_Error.hxx b/src/OSD/OSD_Error.hxx index 8e0ea5c5b7..441f43fb2c 100644 --- a/src/OSD/OSD_Error.hxx +++ b/src/OSD/OSD_Error.hxx @@ -73,7 +73,7 @@ private: TCollection_AsciiString myMessage; Standard_Integer myErrno; OSD_WhoAmI myCode; - Standard_Integer extCode; + Standard_Integer extCode{}; }; diff --git a/src/OSD/OSD_File.cxx b/src/OSD/OSD_File.cxx index db63054d1d..fcdb3491f4 100644 --- a/src/OSD/OSD_File.cxx +++ b/src/OSD/OSD_File.cxx @@ -1006,7 +1006,7 @@ OSD_KindFile OSD_File::KindOfFile() const } return OSD_UNKNOWN; #else - struct stat aStatBuffer; + struct stat aStatBuffer{}; if (stat (aFullName.ToCString(), &aStatBuffer) == 0) { if (S_ISDIR (aStatBuffer.st_mode)) { return OSD_DIRECTORY; } @@ -1345,7 +1345,7 @@ void OSD_File::SetLock (const OSD_LockType theLock) myLock = theLock; } #elif defined(SYSV) - struct flock aLockKey; + struct flock aLockKey{}; aLockKey.l_whence = 0; aLockKey.l_start = 0; aLockKey.l_len = 0; @@ -1375,7 +1375,7 @@ void OSD_File::SetLock (const OSD_LockType theLock) if (theLock == OSD_ExclusiveLock) { - struct stat aStatBuf; + struct stat aStatBuf{}; fstat (myFileChannel, &aStatBuf); TCollection_AsciiString aFilePath; myPath.SystemName (aFilePath); @@ -1461,7 +1461,7 @@ void OSD_File::UnLock() #elif defined(SYSV) if (ImperativeFlag) { - struct stat aStatBuf; + struct stat aStatBuf{}; fstat (myFileChannel, &aStatBuf); TCollection_AsciiString aBuffer; myPath.SystemName (aBuffer); @@ -1469,7 +1469,7 @@ void OSD_File::UnLock() ImperativeFlag = Standard_False; } - struct flock aLockKey; + struct flock aLockKey{}; aLockKey.l_type = F_UNLCK; const int aStatus = fcntl (myFileChannel, F_SETLK, &aLockKey); if (aStatus == -1) @@ -1529,7 +1529,7 @@ Standard_Size OSD_File::Size() TCollection_AsciiString aFilePath; myPath.SystemName (aFilePath); - struct stat aStatBuf; + struct stat aStatBuf{}; const int aStatus = stat (aFilePath.ToCString(), &aStatBuf); if (aStatus == -1) { diff --git a/src/OSD/OSD_FileIterator.cxx b/src/OSD/OSD_FileIterator.cxx index 5893545994..4a5d6795ee 100644 --- a/src/OSD/OSD_FileIterator.cxx +++ b/src/OSD/OSD_FileIterator.cxx @@ -103,7 +103,7 @@ Standard_Boolean OSD_FileIterator::More(){ static int strcmp_joker(const char *Mask,const char *Name) { - const char *p, *s ; + const char *p = nullptr, *s = nullptr ; for(p = Mask,s = Name ; *p && *p != '*' ; p++,s++) if (*p != *s) return 0 ; @@ -175,7 +175,7 @@ static int strcmp_joker(char *fileMask,char *fileName) void OSD_FileIterator::Next(){ int again = 1; -struct stat stat_buf; +struct stat stat_buf{}; myFlag = false; // Initialize to nothing found do { @@ -213,7 +213,7 @@ OSD_File OSD_FileIterator::Values(){ OSD_Path thisvalue; TCollection_AsciiString Name; TCollection_AsciiString Ext; -Standard_Integer position; +Standard_Integer position = 0; if (myEntry) Name = ((struct dirent *)myEntry)->d_name ; diff --git a/src/OSD/OSD_FileNode.cxx b/src/OSD/OSD_FileNode.cxx index 66ff85a1ac..7dacb35e62 100644 --- a/src/OSD/OSD_FileNode.cxx +++ b/src/OSD/OSD_FileNode.cxx @@ -74,7 +74,7 @@ void OSD_FileNode::SetPath (const OSD_Path& Name){ // Test if specified file/directory exists Standard_Boolean OSD_FileNode::Exists(){ -int status; +int status = 0; // if (myPath.Name().Length()==0) A directory can have a null name field (ex: root) @@ -111,7 +111,7 @@ void OSD_FileNode::Remove(){ return; } - struct stat stat_buf; + struct stat stat_buf{}; if(stat(aBuffer.ToCString(), &stat_buf)) { @@ -147,7 +147,7 @@ void OSD_FileNode::Remove(){ // Move a file/directory to another path void OSD_FileNode::Move(const OSD_Path& NewPath){ -int status; +int status = 0; TCollection_AsciiString thisPath; // if (myPath.Name().Length()==0) @@ -206,7 +206,7 @@ int static copy_file( const char* src, const char* trg ) void OSD_FileNode::Copy(const OSD_Path& ToPath) { -int status; +int status = 0; TCollection_AsciiString second_name; // if (myPath.Name().Length()==0) Copy .login would raise !! @@ -232,9 +232,9 @@ TCollection_AsciiString second_name; OSD_Protection OSD_FileNode::Protection(){ OSD_Protection thisProt; -struct stat myStat; -int status; -int s,u,g,w; +struct stat myStat{}; +int status = 0; +int s = 0,u = 0,g = 0,w = 0; // if (myPath.Name().Length()==0) // throw OSD_OSDError("OSD_FileNode::Protection : no name was given"); @@ -273,7 +273,7 @@ int s,u,g,w; // Set protections of a file/directory void OSD_FileNode::SetProtection(const OSD_Protection& Prot){ -int status; +int status = 0; // if (myPath.Name().Length()==0) // throw OSD_OSDError("OSD_FileNode::SetProtection : no name was given"); @@ -291,8 +291,8 @@ int status; Quantity_Date OSD_FileNode::CreationMoment(){ Quantity_Date result; - struct tm *decode; - struct stat buffer; + struct tm *decode = nullptr; + struct stat buffer{}; // if (myPath.Name().Length()==0) // throw OSD_OSDError("OSD_FileNode::CreationMoment : no name was given"); @@ -319,8 +319,8 @@ Quantity_Date OSD_FileNode::CreationMoment(){ Quantity_Date OSD_FileNode::AccessMoment(){ Quantity_Date result; - struct tm *decode; - struct stat buffer; + struct tm *decode = nullptr; + struct stat buffer{}; // if (myPath.Name().Length()==0) // throw OSD_OSDError("OSD_FileNode::AccessMoment : no name was given"); diff --git a/src/OSD/OSD_Host.cxx b/src/OSD/OSD_Host.cxx index 1547be3fbd..0c1358c7fd 100644 --- a/src/OSD/OSD_Host.cxx +++ b/src/OSD/OSD_Host.cxx @@ -51,7 +51,7 @@ OSD_Host::OSD_Host(){} // ========================================================================= TCollection_AsciiString OSD_Host::SystemVersion(){ -struct utsname info; +struct utsname info{}; TCollection_AsciiString result; uname (&info); @@ -64,7 +64,7 @@ TCollection_AsciiString result; // ========================================================================= OSD_SysType OSD_Host::SystemId()const{ -struct utsname info; +struct utsname info{}; uname (&info); @@ -86,7 +86,7 @@ struct utsname info; TCollection_AsciiString OSD_Host::HostName(){ TCollection_AsciiString result; char value[65]; -int status; +int status = 0; status = gethostname(value, 64); if (status == -1) myError.SetValue(errno, Iam, "Host Name"); @@ -100,7 +100,7 @@ if (status == -1) myError.SetValue(errno, Iam, "Host Name"); Standard_Integer OSD_Host::AvailableMemory(){ - Standard_Integer result; + Standard_Integer result = 0; #if defined(__osf__) || defined(DECOSF1) char buffer[16]; @@ -117,8 +117,8 @@ Standard_Integer OSD_Host::AvailableMemory(){ // ========================================================================= TCollection_AsciiString OSD_Host::InternetAddress(){ - struct hostent internet_address; - int a,b,c,d; + struct hostent internet_address{}; + int a = 0,b = 0,c = 0,d = 0; char buffer[16]; TCollection_AsciiString result,host; @@ -139,7 +139,7 @@ TCollection_AsciiString OSD_Host::InternetAddress(){ // ========================================================================= OSD_OEMType OSD_Host::MachineType(){ -struct utsname info; +struct utsname info{}; uname (&info); diff --git a/src/OSD/OSD_MAllocHook.cxx b/src/OSD/OSD_MAllocHook.cxx index f1f61e8bcc..8102b80494 100644 --- a/src/OSD/OSD_MAllocHook.cxx +++ b/src/OSD/OSD_MAllocHook.cxx @@ -302,7 +302,7 @@ Standard_Boolean OSD_MAllocHook::LogFileHandler::MakeReport while (fgets(aStr, MAX_STR-1, aLogFile) != NULL) { // detect operation type, request number and block size - unsigned long aReqNum, aSize; + unsigned long aReqNum = 0, aSize = 0; char* aType = aStr; char* pStr = aStr; //sscanf(aStr, "%5s %lu %lu", aType, &aReqNum, &aSize); diff --git a/src/OSD/OSD_MemInfo.hxx b/src/OSD/OSD_MemInfo.hxx index 6545ade300..9e53f98295 100644 --- a/src/OSD/OSD_MemInfo.hxx +++ b/src/OSD/OSD_MemInfo.hxx @@ -118,8 +118,8 @@ protected: private: - Standard_Size myCounters[MemCounter_NB]; //!< Counters' values, in bytes - Standard_Boolean myActiveCounters[MemCounter_NB]; //!< container of active state for a counter + Standard_Size myCounters[MemCounter_NB]{}; //!< Counters' values, in bytes + Standard_Boolean myActiveCounters[MemCounter_NB]{}; //!< container of active state for a counter }; diff --git a/src/OSD/OSD_OpenFile.cxx b/src/OSD/OSD_OpenFile.cxx index 72b54b08ea..60539d1e6f 100644 --- a/src/OSD/OSD_OpenFile.cxx +++ b/src/OSD/OSD_OpenFile.cxx @@ -132,7 +132,7 @@ Standard_Time OSD_FileStatCTime (const char* theName) aTime = (Standard_Time )aStat.st_ctime; } #else - struct stat aStat; + struct stat aStat{}; if (stat (theName, &aStat) == 0) { aTime = (Standard_Time )aStat.st_ctime; diff --git a/src/OSD/OSD_Parallel_Threads.cxx b/src/OSD/OSD_Parallel_Threads.cxx index c36753ea9a..cc627dec65 100644 --- a/src/OSD/OSD_Parallel_Threads.cxx +++ b/src/OSD/OSD_Parallel_Threads.cxx @@ -96,7 +96,7 @@ namespace //! Method is executed in the context of thread, //! so this method defines the main calculations. - virtual void Perform (int ) Standard_OVERRIDE + void Perform (int ) Standard_OVERRIDE { for (OSD_Parallel::UniversalIterator anIter = myRange.It(); anIter != myRange.End(); anIter = myRange.It()) { diff --git a/src/OSD/OSD_Path.cxx b/src/OSD/OSD_Path.cxx index e034e9e91d..95dd05c039 100644 --- a/src/OSD/OSD_Path.cxx +++ b/src/OSD/OSD_Path.cxx @@ -59,8 +59,8 @@ static OSD_SysType whereAmI() #include #include -OSD_Path::OSD_Path(){ - mySysDep = whereAmI(); +OSD_Path::OSD_Path() : mySysDep(whereAmI()){ + } static void VmsExtract(const TCollection_AsciiString& what, @@ -73,7 +73,7 @@ static void VmsExtract(const TCollection_AsciiString& what, TCollection_AsciiString& ext){ TCollection_AsciiString buffer; - Standard_Integer pos; + Standard_Integer pos = 0; buffer = what; @@ -152,10 +152,10 @@ static void UnixExtract(const TCollection_AsciiString& what, TCollection_AsciiString& name, TCollection_AsciiString& ext){ - Standard_Integer pos; + Standard_Integer pos = 0; TCollection_AsciiString buffer; // To manipulate 'what' without modifying it - Standard_PCharacter p; + Standard_PCharacter p = nullptr; buffer = what; #ifdef TOTO // Username, password and node are no longer given in the string (LD) @@ -242,8 +242,8 @@ static void DosExtract(const TCollection_AsciiString& what, TCollection_AsciiString& ext){ TCollection_AsciiString buffer; - Standard_Integer pos; - Standard_PCharacter p; + Standard_Integer pos = 0; + Standard_PCharacter p = nullptr; buffer = what; @@ -291,8 +291,8 @@ static void MacExtract(const TCollection_AsciiString& what, TCollection_AsciiString& name, TCollection_AsciiString& ){ - Standard_Integer pos; - Standard_PCharacter p; + Standard_Integer pos = 0; + Standard_PCharacter p = nullptr; // I don't know how to distinguish a disk from a trek ! @@ -321,9 +321,9 @@ static void MacExtract(const TCollection_AsciiString& what, OSD_Path::OSD_Path(const TCollection_AsciiString& aDependentName, - const OSD_SysType aSysType){ + const OSD_SysType aSysType) : mySysDep(whereAmI()){ - mySysDep = whereAmI(); + OSD_SysType todo; // Standard_Integer i,l; @@ -368,9 +368,9 @@ OSD_Path::OSD_Path(const TCollection_AsciiString& Nod, const TCollection_AsciiString& Dsk, const TCollection_AsciiString& Trk, const TCollection_AsciiString& Nam, - const TCollection_AsciiString& ext){ + const TCollection_AsciiString& ext) : mySysDep(whereAmI()){ - mySysDep = whereAmI(); + SetValues ( Nod, UsrNm, Passwd, Dsk, Trk, Nam, ext); @@ -418,7 +418,7 @@ void OSD_Path::UpTrek(){ if (length == 0) return; - Standard_Integer awhere,aHowmany; + Standard_Integer awhere = 0,aHowmany = 0; TCollection_AsciiString tok; tok = myTrek.Token("|",length); @@ -456,7 +456,7 @@ void OSD_Path::RemoveATrek(const Standard_Integer thewhere){ if (length <= 0 || thewhere > length) throw Standard_NumericError("OSD_Path::RemoveATrek : where has an invalid value"); - Standard_Integer posit,aHowmany; + Standard_Integer posit = 0,aHowmany = 0; TCollection_AsciiString tok; tok = myTrek.Token("|",thewhere); @@ -475,7 +475,7 @@ void OSD_Path::RemoveATrek(const TCollection_AsciiString& aName){ if (length == 0) return; - Standard_Integer awhere; + Standard_Integer awhere = 0; awhere = myTrek.Search(aName); if (awhere != -1){ @@ -545,7 +545,7 @@ static void P2VMS (TCollection_AsciiString & Way){ // Convert a Trek to MAC syntax static void P2MAC (TCollection_AsciiString & Way){ - int i,l; + int i = 0,l = 0; Way.ChangeAll('|',':'); l = (int)Way.Length(); @@ -561,7 +561,7 @@ static void P2MAC (TCollection_AsciiString & Way){ // Convert a Trek to UNIX syntax static void P2UNIX (TCollection_AsciiString & Way){ - int i,l; + int i = 0,l = 0; Standard_Integer length = Way.Length(); if (length == 0) return; @@ -585,7 +585,7 @@ static void P2UNIX (TCollection_AsciiString & Way){ // Convert a Trek to DOS like syntax static void P2DOS (TCollection_AsciiString & Way){ - int i,l; + int i = 0,l = 0; Standard_Integer len = Way.Length(); if (len == 0) return; @@ -1493,7 +1493,7 @@ Standard_Boolean OSD_Path::IsValid (const TCollection_AsciiString& theDependentN static Standard_Integer RemoveExtraSeparator(TCollection_AsciiString& aString) { - Standard_Integer i, j, len,start = 1 ; + Standard_Integer i = 0, j = 0, len = 0,start = 1 ; len = aString.Length() ; #ifdef _WIN32 @@ -1520,8 +1520,8 @@ TCollection_AsciiString OSD_Path::RelativePath( { TCollection_AsciiString EmptyString = "" ; TCollection_AsciiString FilePath ; - Standard_Integer len ; - Standard_Integer i, n ; + Standard_Integer len = 0 ; + Standard_Integer i = 0, n = 0 ; Standard_Boolean Wnt = 0 ; FilePath = aAbsFilePath ; @@ -1596,7 +1596,7 @@ TCollection_AsciiString OSD_Path::AbsolutePath( if (aRelFilePath.Search("/") == 1 || aRelFilePath.Search(":") == 2) return aRelFilePath ; TCollection_AsciiString DirPath = aDirPath, RelFilePath = aRelFilePath ; - Standard_Integer i,len ; + Standard_Integer i = 0,len = 0 ; if (DirPath.Search("/") != 1 && DirPath.Search(":") != 2) return EmptyString ; diff --git a/src/OSD/OSD_Path.hxx b/src/OSD/OSD_Path.hxx index 13804571ec..f0c5d4031a 100644 --- a/src/OSD/OSD_Path.hxx +++ b/src/OSD/OSD_Path.hxx @@ -338,7 +338,7 @@ private: TCollection_AsciiString myTrek; TCollection_AsciiString myName; TCollection_AsciiString myExtension; - Standard_Boolean myUNCFlag; + Standard_Boolean myUNCFlag{}; OSD_SysType mySysDep; }; diff --git a/src/OSD/OSD_PerfMeter.cxx b/src/OSD/OSD_PerfMeter.cxx index f20fed96ca..a9dd132155 100644 --- a/src/OSD/OSD_PerfMeter.cxx +++ b/src/OSD/OSD_PerfMeter.cxx @@ -28,6 +28,7 @@ /*14/05/2002 : AGV : Portability UNIX/Windows */ /*======================================================================*/ +#include #include #include #include @@ -160,7 +161,7 @@ int perf_stop_meter (const char * const MeterName) if (ic >= 0 && MeterTable[ic].start_time) { t_TimeCounter * const ptc = &MeterTable[ic]; - PERF_TIME utime; + PERF_TIME utime = NAN; PICK_TIME (utime) ptc->cumul_time += utime - ptc->start_time; ptc->start_time = 0; @@ -181,7 +182,7 @@ int perf_stop_imeter (const int iMeter) if (iMeter >= 0 && iMeter < nb_meters) { t_TimeCounter * const ptc = &MeterTable[iMeter]; if (ptc->start_time) { - PERF_TIME utime; + PERF_TIME utime = NAN; PICK_TIME (utime) ptc->cumul_time += utime - ptc->start_time; ptc->start_time = 0; @@ -235,7 +236,7 @@ void perf_sprint_all_meters (char *buffer, int length, int reset) { char string[256]; - int i; + int i = 0; for (i=0; inb_enter) { @@ -317,7 +318,7 @@ Returns : none ======================================================================*/ void perf_destroy_all_meters (void) { - int i; + int i = 0; for (i=0; i myThreads; //!< array of defined threads (excluding self-thread) - int myNbDefThreads; //!< maximum number of threads to be locked by a single Launcher by default bool myShutDown; //!< flag to shut down (destroy) the thread pool }; diff --git a/src/OSD/OSD_Timer.cxx b/src/OSD/OSD_Timer.cxx index 5a0a176bf4..b097d169d1 100644 --- a/src/OSD/OSD_Timer.cxx +++ b/src/OSD/OSD_Timer.cxx @@ -19,7 +19,8 @@ #ifdef _WIN32 #include #else - #include + #include +#include #endif namespace @@ -74,7 +75,7 @@ Standard_Real OSD_Timer::GetWallClockTime() : 0.001 * GetTickCount(); #endif #else - struct timeval aTime; + struct timeval aTime{}; // use time of first call as base for computing total time, // to avoid loss of precision due to big values of tv_sec (counted since 1970) static const time_t aStartSec = (gettimeofday (&aTime, NULL) == 0 ? aTime.tv_sec : 0); @@ -183,8 +184,8 @@ void OSD_Timer::Show (Standard_OStream& theOStream) const { const Standard_Real aTimeCumul = ElapsedTime(); - Standard_Integer anHours, aMinutes; - Standard_Real aSeconds; + Standard_Integer anHours = 0, aMinutes = 0; + Standard_Real aSeconds = NAN; timeToHoursMinutesSeconds (aTimeCumul, anHours, aMinutes, aSeconds); std::streamsize prec = theOStream.precision (12); diff --git a/src/OSD/OSD_signal.cxx b/src/OSD/OSD_signal.cxx index 7da3f19004..7a415bdd9c 100644 --- a/src/OSD/OSD_signal.cxx +++ b/src/OSD/OSD_signal.cxx @@ -789,7 +789,7 @@ static void Handler (const int theSignal, siginfo_t */*theSigInfo*/, const Stand static void Handler (const int theSignal) #endif { - struct sigaction oldact, act; + struct sigaction oldact{}, act{}; // re-install the signal if ( ! sigaction (theSignal, NULL, &oldact) ) { // std::cout << " signal is " << theSignal << " handler is " << oldact.sa_handler << std::endl; @@ -1041,7 +1041,7 @@ void OSD::SetSignal (OSD_SignalMode theSignalMode, } // Prepare signal descriptors - struct sigaction anActSet, anActDfl, anActOld; + struct sigaction anActSet{}, anActDfl{}, anActOld{}; sigemptyset(&anActSet.sa_mask); sigemptyset(&anActDfl.sa_mask); sigemptyset(&anActOld.sa_mask); @@ -1085,7 +1085,7 @@ void OSD::SetSignal (OSD_SignalMode theSignalMode, } if (theSignalMode == OSD_SignalMode_SetUnhandled && retcode == 0 && anActOld.sa_handler != SIG_DFL) { - struct sigaction anActOld2; + struct sigaction anActOld2{}; sigemptyset(&anActOld2.sa_mask); retcode = sigaction (aSignalTypes[i], &anActOld, &anActOld2); } diff --git a/src/PCDM/PCDM_ReadWriter.cxx b/src/PCDM/PCDM_ReadWriter.cxx index a0a7b44e22..436185e37b 100644 --- a/src/PCDM/PCDM_ReadWriter.cxx +++ b/src/PCDM/PCDM_ReadWriter.cxx @@ -201,7 +201,7 @@ static TCollection_ExtendedString TryXmlDriverType // of the DocumentElement, the XML format cannot be defined if (aParser.parse (theFileName.ToCString())) { - LDOM_Element anElement = aParser.GetElement(); + const LDOM_Element& anElement = aParser.GetElement(); if (anElement.getTagName().equals (LDOMString(aDocumentElementName))) theFormat = anElement.getAttribute ("format"); } @@ -226,7 +226,7 @@ static TCollection_ExtendedString TryXmlDriverType (Standard_IStream& theIStream // of the DocumentElement, the XML format cannot be defined if (aParser.parse (theIStream, Standard_True)) { - LDOM_Element anElement = aParser.GetElement(); + const LDOM_Element& anElement = aParser.GetElement(); if (anElement.getTagName().equals (LDOMString(aDocumentElementName))) theFormat = anElement.getAttribute ("format"); } diff --git a/src/PCDM/PCDM_ReadWriter_1.cxx b/src/PCDM/PCDM_ReadWriter_1.cxx index 812766ded5..dbd22d0984 100644 --- a/src/PCDM/PCDM_ReadWriter_1.cxx +++ b/src/PCDM/PCDM_ReadWriter_1.cxx @@ -52,7 +52,7 @@ IMPLEMENT_STANDARD_RTTIEXT(PCDM_ReadWriter_1,PCDM_ReadWriter) PCDM_ReadWriter_1::PCDM_ReadWriter_1() {} static Standard_Integer RemoveExtraSeparator(TCollection_AsciiString& aString) { - Standard_Integer i, j, len ; + Standard_Integer i = 0, j = 0, len = 0 ; len = aString.Length() ; #ifdef _WIN32 @@ -85,7 +85,7 @@ static TCollection_AsciiString AbsolutePath( return aRelFilePath ; TCollection_AsciiString DirPath = aDirPath, RelFilePath = aRelFilePath ; - Standard_Integer i,len ; + Standard_Integer i = 0,len = 0 ; #ifdef _WIN32 if(DirPath.Search(":") != 2 && @@ -226,7 +226,7 @@ void PCDM_ReadWriter_1::WriteVersion(const Handle(Storage_Data)& aData, const Ha Standard_Integer PCDM_ReadWriter_1::ReadReferenceCounter(const TCollection_ExtendedString& aFileName, const Handle(Message_Messenger)& theMsgDriver) const { Standard_Integer theReferencesCounter(0) ; - Standard_Integer i ; + Standard_Integer i = 0 ; Handle(Storage_BaseDriver) theFileDriver; TCollection_AsciiString aFileNameU(aFileName); if(PCDM::FileDriverType(aFileNameU, theFileDriver) == PCDM_TOFD_Unknown) @@ -278,9 +278,9 @@ void PCDM_ReadWriter_1::ReadReferences(const TCollection_ExtendedString& aFileNa ReadUserInfo(aFileName,START_REF,END_REF,ReadReferences, theMsgDriver); - Standard_Integer theReferenceIdentifier; + Standard_Integer theReferenceIdentifier = 0; TCollection_ExtendedString theFileName; - Standard_Integer theDocumentVersion; + Standard_Integer theDocumentVersion = 0; TCollection_AsciiString theAbsoluteDirectory=GetDirFromFile(aFileName); @@ -337,7 +337,7 @@ void PCDM_ReadWriter_1::ReadUserInfo(const TCollection_ExtendedString& aFileName TColStd_SequenceOfExtendedString& theUserInfo, const Handle(Message_Messenger)&) { - Standard_Integer i ; + Standard_Integer i = 0 ; Handle(Storage_BaseDriver) theFileDriver; TCollection_AsciiString aFileNameU(aFileName); if(PCDM::FileDriverType(aFileNameU, theFileDriver) == PCDM_TOFD_Unknown) @@ -389,7 +389,7 @@ Standard_Integer PCDM_ReadWriter_1::ReadDocumentVersion(const TCollection_Extend hd.Read (theFileDriver); const TColStd_SequenceOfAsciiString &refUserInfo = hd.UserInfo(); - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i =1; i<= refUserInfo.Length() ; i++) { if(refUserInfo(i).Search(MODIFICATION_COUNTER) != -1) { try { OCC_CATCH_SIGNALS theVersion=refUserInfo(i).Token(" ",2).IntegerValue();} diff --git a/src/PCDM/PCDM_ReferenceIterator.cxx b/src/PCDM/PCDM_ReferenceIterator.cxx index 5cc2ddb545..2f528946ae 100644 --- a/src/PCDM/PCDM_ReferenceIterator.cxx +++ b/src/PCDM/PCDM_ReferenceIterator.cxx @@ -35,9 +35,9 @@ IMPLEMENT_STANDARD_RTTIEXT(PCDM_ReferenceIterator,Standard_Transient) //======================================================================= PCDM_ReferenceIterator::PCDM_ReferenceIterator (const Handle(Message_Messenger)& theMsgDriver) : - myIterator(0) + myIterator(0), myMessageDriver(theMsgDriver) { - myMessageDriver = theMsgDriver; + } //======================================================================= diff --git a/src/PLib/PLib.cxx b/src/PLib/PLib.cxx index 521a339a2a..08aaec2b1e 100644 --- a/src/PLib/PLib.cxx +++ b/src/PLib/PLib.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -207,7 +209,7 @@ public: : myBinom (NULL), myMaxBinom (theMaxBinom) { - Standard_Integer i, im1, ip1, id2, md2, md3, j, k; + Standard_Integer i = 0, im1 = 0, ip1 = 0, id2 = 0, md2 = 0, md3 = 0, j = 0, k = 0; Standard_Integer np1 = myMaxBinom + 1; myBinom = new Standard_Integer*[np1]; myBinom[0] = new Standard_Integer[1]; @@ -332,11 +334,11 @@ void PLib::RationalDerivative(const Standard_Integer Degree, // u (1) u (2) .... u (Dimension) v (1) // // - Standard_Real Inverse; + Standard_Real Inverse = NAN; Standard_Real *PolesArray = &Ders; Standard_Real *RationalArray = &RDers; - Standard_Real Factor ; - Standard_Integer ii, Index, OtherIndex, Index1, Index2, jj; + Standard_Real Factor = NAN ; + Standard_Integer ii = 0, Index = 0, OtherIndex = 0, Index1 = 0, Index2 = 0, jj = 0; NCollection_LocalArray binomial_array; NCollection_LocalArray derivative_storage; if (Dimension == 3) { @@ -419,7 +421,7 @@ void PLib::RationalDerivative(const Standard_Integer Degree, } } else { - Standard_Integer kk; + Standard_Integer kk = 0; Standard_Integer Dimension1 = Dimension + 1; Standard_Integer Dimension2 = Dimension << 1; Standard_Integer DeRequest1 = DerivativeRequest + 1; @@ -548,13 +550,13 @@ void PLib::RationalDerivatives(const Standard_Integer DerivativeRequest, // make arrays for the binomial since computing it each time could // raize a performance issue // - Standard_Real Inverse; + Standard_Real Inverse = NAN; Standard_Real *PolesArray = &PolesDerivates; Standard_Real *WeightsArray = &WeightsDerivates; Standard_Real *RationalArray = &RationalDerivates; - Standard_Real Factor ; + Standard_Real Factor = NAN ; - Standard_Integer ii, Index, Index1, Index2, jj; + Standard_Integer ii = 0, Index = 0, Index1 = 0, Index2 = 0, jj = 0; Standard_Integer DeRequest1 = DerivativeRequest + 1; NCollection_LocalArray binomial_array (DeRequest1); @@ -594,7 +596,7 @@ void PLib::RationalDerivatives(const Standard_Integer DerivativeRequest, } } else { - Standard_Integer kk; + Standard_Integer kk = 0; Standard_Integer Dimension2 = Dimension << 1; Index = 0 ; Index2 = - Dimension2; @@ -754,7 +756,7 @@ void PLib::EvalPolynomial(const Standard_Real Par, { Standard_Real* aCoeffs = &PolynomialCoeff + Degree * Dimension; Standard_Real* aRes = &Results; - Standard_Real* anOriginal; + Standard_Real* anOriginal = nullptr; Standard_Integer ind = 0; switch (DerivativeRequest) { @@ -969,7 +971,7 @@ void PLib::EvalPoly2Var(const Standard_Real UParameter, TColStd_Array1OfReal Point(1, Dimension*(VDerivativeRequest+1)); Standard_Real * Result = (Standard_Real *) &Curve.ChangeValue(1); Standard_Real * Digit = (Standard_Real *) &Point.ChangeValue(1); - Standard_Real * ResultArray ; + Standard_Real * ResultArray = nullptr ; ResultArray = &Results ; PLib::EvalPolynomial(UParameter, @@ -1032,12 +1034,12 @@ PLib::EvalLagrange(const Standard_Real Parameter, // [0] is assign to first point // [1] is assign to second point // - Standard_Integer ii, jj, kk, Index, Index1, ReturnCode=0; + Standard_Integer ii = 0, jj = 0, kk = 0, Index = 0, Index1 = 0, ReturnCode=0; Standard_Integer local_request = DerivativeRequest; - Standard_Real *ParameterArray; - Standard_Real difference; - Standard_Real *PointsArray; - Standard_Real *ResultArray ; + Standard_Real *ParameterArray = nullptr; + Standard_Real difference = NAN; + Standard_Real *PointsArray = nullptr; + Standard_Real *ResultArray = nullptr ; PointsArray = &Values ; ParameterArray = &Parameters ; @@ -1155,18 +1157,18 @@ Standard_Integer PLib::EvalCubicHermite // [0] is assign to first point // [1] is assign to last point // - Standard_Integer ii, jj, kk, pp, Index, Index1, Degree, ReturnCode; + Standard_Integer ii = 0, jj = 0, kk = 0, pp = 0, Index = 0, Index1 = 0, Degree = 0, ReturnCode = 0; Standard_Integer local_request = DerivativeRequest ; ReturnCode = 0 ; Degree = 3 ; Standard_Real ParametersArray[4]; - Standard_Real difference; - Standard_Real inverse; - Standard_Real *FirstLast; - Standard_Real *PointsArray; - Standard_Real *DerivativesArray; - Standard_Real *ResultArray ; + Standard_Real difference = NAN; + Standard_Real inverse = NAN; + Standard_Real *FirstLast = nullptr; + Standard_Real *PointsArray = nullptr; + Standard_Real *DerivativesArray = nullptr; + Standard_Real *ResultArray = nullptr ; DerivativesArray = &Derivatives ; PointsArray = &Values ; @@ -1272,8 +1274,8 @@ Standard_Boolean PLib::HermiteCoefficients(const Standard_Real FirstParameter, math_Matrix& MatrixCoefs) { Standard_Integer NbCoeff = FirstOrder + LastOrder + 2, Ordre[2]; - Standard_Integer ii, jj, pp, cote, iof=0; - Standard_Real Prod, TBorne = FirstParameter; + Standard_Integer ii = 0, jj = 0, pp = 0, cote = 0, iof=0; + Standard_Real Prod = NAN, TBorne = FirstParameter; math_Vector Coeff(1,NbCoeff), B(1, NbCoeff, 0.0); math_Matrix MAT(1,NbCoeff, 1,NbCoeff, 0.0); @@ -1392,7 +1394,7 @@ void PLib::CoefficientsPoles (const Standard_Integer dim, Standard_Integer upwc=0; Standard_Integer upwp=0; Standard_Integer reflen = Coefs.Length()/dim; - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; //Les Extremites. if (rat) { lowc = WCoefs->Lower(); lowp = Weights->Lower(); @@ -1408,7 +1410,7 @@ void PLib::CoefficientsPoles (const Standard_Integer dim, (*Weights) (upwp) = (*WCoefs) (upwc); } - Standard_Real Cnp; + Standard_Real Cnp = NAN; for (i = 2; i < reflen; i++ ) { Cnp = PLib::Bin(reflen - 1, i - 1); if (rat) (*Weights)(lowp + i - 1) = (*WCoefs)(lowc + i - 1) / Cnp; @@ -1502,7 +1504,7 @@ void PLib::Trimming(const Standard_Real U1, // decomposee sous la forme du schema iteratif de horner. Standard_Real lsp = U2 - U1; - Standard_Integer indc, indw=0; + Standard_Integer indc = 0, indw=0; Standard_Integer upc = Coefs.Upper() - dim + 1, upw=0; Standard_Integer len = Coefs.Length()/dim; Standard_Boolean rat = WCoefs != NULL; @@ -1515,7 +1517,7 @@ void PLib::Trimming(const Standard_Real U1, len --; for (Standard_Integer i = 1; i <= len; i++) { - Standard_Integer j ; + Standard_Integer j = 0 ; indc = upc - dim*(i-1); if (rat) indw = upw - i + 1; //calcul du coefficient de degre le plus faible a l'iteration i @@ -1574,11 +1576,11 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs, // par buildcache // Standard_Boolean inv = Standard_False; //ColLength != Coefs.ColLength(); - Standard_Integer Row, Col; - Standard_Real W, Cnp; + Standard_Integer Row = 0, Col = 0; + Standard_Real W = NAN, Cnp = NAN; - Standard_Integer I1, I2; - Standard_Integer NPoleu , NPolev; + Standard_Integer I1 = 0, I2 = 0; + Standard_Integer NPoleu = 0 , NPolev = 0; gp_XYZ Temp; for (NPoleu = LowerRow; NPoleu <= UpperRow; NPoleu++){ @@ -1665,7 +1667,7 @@ void PLib::UTrimming(const Standard_Real U1, TColStd_Array1OfReal Temw (lr,ur); for (Standard_Integer icol = lc; icol <= uc; icol++) { - Standard_Integer irow ; + Standard_Integer irow = 0 ; for ( irow = lr; irow <= ur; irow++) { Temp (irow) = Coeffs (irow, icol); if (rat) Temw (irow) = (*WCoeffs) (irow, icol); @@ -1699,7 +1701,7 @@ void PLib::VTrimming(const Standard_Real V1, TColStd_Array1OfReal Temw (lc,uc); for (Standard_Integer irow = lr; irow <= ur; irow++) { - Standard_Integer icol ; + Standard_Integer icol = 0 ; for ( icol = lc; icol <= uc; icol++) { Temp (icol) = Coeffs (irow, icol); if (rat) Temw (icol) = (*WCoeffs) (irow, icol); @@ -1754,7 +1756,7 @@ Standard_Boolean PLib::HermiteInterpolate math_Matrix A(0,FirstOrder+LastOrder+1, 0,FirstOrder+LastOrder+1); // The initialisation of the matrix A - Standard_Integer irow ; + Standard_Integer irow = 0 ; for ( irow=0; irow<=FirstOrder; irow++) { Standard_Real FirstVal = 1.; @@ -1794,7 +1796,7 @@ Standard_Boolean PLib::HermiteInterpolate // std::cout << "idim=" << idim << std::endl; math_Vector B(0,FirstOrder+LastOrder+1); - Standard_Integer icol ; + Standard_Integer icol = 0 ; for ( icol=0; icol<=FirstOrder; icol++) B(icol) = FirstConstr(idim,icol); @@ -1958,8 +1960,8 @@ void PLib::JacobiParameters(const GeomAbs_Shape ConstraintOrder, const Standard_Real U1, const Standard_Real U2, Standard_Real& Length) { - Standard_Integer i,j,idim, degdim; - Standard_Real C1,C2,Sum,Tran,X1,X2,Der1,Der2,D1,D2,DD; + Standard_Integer i = 0,j = 0,idim = 0, degdim = 0; + Standard_Real C1 = NAN,C2 = NAN,Sum = NAN,Tran = NAN,X1 = NAN,X2 = NAN,Der1 = NAN,Der2 = NAN,D1 = NAN,D2 = NAN,DD = NAN; Standard_Real *PolynomialArray = &PolynomialCoeff ; @@ -2022,11 +2024,11 @@ void PLib::JacobiParameters(const GeomAbs_Shape ConstraintOrder, const Standard_Real Tol, Standard_Real& Length, Standard_Real& Error) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer NbSubInt = 1, // Current number of subintervals MaxNbIter = 13, // Max number of iterations NbIter = 1; // Current number of iterations - Standard_Real dU,OldLen,LenI; + Standard_Real dU = NAN,OldLen = NAN,LenI = NAN; PLib::EvalLength(Degree,Dimension, PolynomialCoeff, U1,U2, Length); diff --git a/src/PLib/PLib_DoubleJacobiPolynomial.cxx b/src/PLib/PLib_DoubleJacobiPolynomial.cxx index 7021f2f612..74ff14b30e 100644 --- a/src/PLib/PLib_DoubleJacobiPolynomial.cxx +++ b/src/PLib/PLib_DoubleJacobiPolynomial.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -61,8 +63,8 @@ PLib_DoubleJacobiPolynomial::MaxErrorU(const Standard_Integer Dimension, const Standard_Integer dJacCoeff, const TColStd_Array1OfReal& JacCoeff) const { - Standard_Integer ii,idim,dJac,MinU,MinV,WorkDegreeU,WorkDegreeV; - Standard_Real Bid0; + Standard_Integer ii = 0,idim = 0,dJac = 0,MinU = 0,MinV = 0,WorkDegreeU = 0,WorkDegreeV = 0; + Standard_Real Bid0 = NAN; math_Vector MaxErrDim(1,Dimension,0.); @@ -94,8 +96,8 @@ PLib_DoubleJacobiPolynomial::MaxErrorV(const Standard_Integer Dimension, const Standard_Integer dJacCoeff, const TColStd_Array1OfReal& JacCoeff) const { - Standard_Integer jj,idim,dJac,MinU,MinV,WorkDegreeU,WorkDegreeV; - Standard_Real Bid0; + Standard_Integer jj = 0,idim = 0,dJac = 0,MinU = 0,MinV = 0,WorkDegreeU = 0,WorkDegreeV = 0; + Standard_Real Bid0 = NAN; math_Vector MaxErrDim(1,Dimension,0.); @@ -130,8 +132,8 @@ PLib_DoubleJacobiPolynomial::MaxError(const Standard_Integer Dimension, const TColStd_Array1OfReal& JacCoeff, const Standard_Real Error) const { - Standard_Integer ii,jj,idim,dJac,MinU,MinV,WorkDegreeU,WorkDegreeV; - Standard_Real Bid0,Bid1; + Standard_Integer ii = 0,jj = 0,idim = 0,dJac = 0,MinU = 0,MinV = 0,WorkDegreeU = 0,WorkDegreeV = 0; + Standard_Real Bid0 = NAN,Bid1 = NAN; math_Vector MaxErrDim(1,Dimension,0.); @@ -182,8 +184,8 @@ void PLib_DoubleJacobiPolynomial::ReduceDegree(const Standard_Integer Dimension, Standard_Integer& NewDegreeU, Standard_Integer& NewDegreeV) const { - Standard_Integer NewU,NewV; - Standard_Real ErrU,ErrV; + Standard_Integer NewU = 0,NewV = 0; + Standard_Real ErrU = NAN,ErrV = NAN; NewU = MaxDegreeU; NewV = MaxDegreeV; @@ -253,8 +255,8 @@ PLib_DoubleJacobiPolynomial::AverageError(const Standard_Integer Dimension, const Standard_Integer dJacCoeff, const TColStd_Array1OfReal& JacCoeff) const { - Standard_Integer ii,jj,idim,dJac,IDebU,IDebV,MinU,MinV,WorkDegreeU,WorkDegreeV; - Standard_Real Bid0,Bid1,AverageErr; + Standard_Integer ii = 0,jj = 0,idim = 0,dJac = 0,IDebU = 0,IDebV = 0,MinU = 0,MinV = 0,WorkDegreeU = 0,WorkDegreeV = 0; + Standard_Real Bid0 = NAN,Bid1 = NAN,AverageErr = NAN; //----------------------------- Initialisations ------------------------ @@ -300,7 +302,7 @@ void PLib_DoubleJacobiPolynomial::WDoubleJacobiToCoefficients(const Standard_Int const TColStd_Array1OfReal& JacCoeff, TColStd_Array1OfReal& Coefficients) const { - Standard_Integer iu,iv,idim,WorkDegreeU,WorkDegreeV; + Standard_Integer iu = 0,iv = 0,idim = 0,WorkDegreeU = 0,WorkDegreeV = 0; Coefficients.Init(0.); diff --git a/src/PLib/PLib_HermitJacobi.cxx b/src/PLib/PLib_HermitJacobi.cxx index 83681829b7..fba21f609d 100644 --- a/src/PLib/PLib_HermitJacobi.cxx +++ b/src/PLib/PLib_HermitJacobi.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -31,12 +33,12 @@ PLib_HermitJacobi::PLib_HermitJacobi(const Standard_Integer WorkDegree, const GeomAbs_Shape ConstraintOrder) : myH(1,2*(PLib::NivConstr(ConstraintOrder)+1), 1,2*(PLib::NivConstr(ConstraintOrder)+1)), - myWCoeff(1,2*(PLib::NivConstr(ConstraintOrder)+1)+1) + myJacobi(new PLib_JacobiPolynomial (WorkDegree,ConstraintOrder)), myWCoeff(1,2*(PLib::NivConstr(ConstraintOrder)+1)+1) { Standard_Integer NivConstr = PLib::NivConstr(ConstraintOrder); PLib::HermiteCoefficients(-1.,1.,NivConstr,NivConstr,myH); - myJacobi = new PLib_JacobiPolynomial (WorkDegree,ConstraintOrder); + myWCoeff.Init(0.); myWCoeff(1) = 1.; @@ -97,11 +99,11 @@ void PLib_HermitJacobi::ToCoefficients(const Standard_Integer Dimension, const TColStd_Array1OfReal& HermJacCoeff, TColStd_Array1OfReal& Coefficients) const { - Standard_Integer i,k,idim,i1,i2; - Standard_Real h1, h2; + Standard_Integer i = 0,k = 0,idim = 0,i1 = 0,i2 = 0; + Standard_Real h1 = NAN, h2 = NAN; Standard_Integer NivConstr = this->NivConstr(), DegreeH = 2*NivConstr+1; - Standard_Integer ibegHJC = HermJacCoeff.Lower(), kdim; + Standard_Integer ibegHJC = HermJacCoeff.Lower(), kdim = 0; TColStd_Array1OfReal AuxCoeff(0,(Degree+1)*Dimension-1); AuxCoeff.Init(0.); @@ -153,7 +155,7 @@ void PLib_HermitJacobi::D0123(const Standard_Integer NDeriv, NCollection_LocalArray jac3 (4 * 20); NCollection_LocalArray wvalues (4); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Standard_Integer NivConstr = this->NivConstr(), WorkDegree = this->WorkDegree(), DegreeH = 2*NivConstr+1; @@ -162,7 +164,7 @@ void PLib_HermitJacobi::D0123(const Standard_Integer NDeriv, ibeg2 = BasisD2.Lower(), ibeg3 = BasisD3.Lower(); Standard_Integer JacDegree = WorkDegree-DegreeH-1; - Standard_Real W0; + Standard_Real W0 = NAN; TColStd_Array1OfReal JacValue0(jac0[0], 0, Max(0,JacDegree)); TColStd_Array1OfReal WValues(wvalues[0],0,NDeriv); diff --git a/src/PLib/PLib_JacobiPolynomial.cxx b/src/PLib/PLib_JacobiPolynomial.cxx index 6db277c6b7..79d4ec2384 100644 --- a/src/PLib/PLib_JacobiPolynomial.cxx +++ b/src/PLib/PLib_JacobiPolynomial.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,9 +39,9 @@ const Standard_Integer UNDEFINED=-999; //======================================================================= PLib_JacobiPolynomial::PLib_JacobiPolynomial (const Standard_Integer WorkDegree, - const GeomAbs_Shape ConstraintOrder) + const GeomAbs_Shape ConstraintOrder) : myWorkDegree(WorkDegree) { - myWorkDegree = WorkDegree; + switch (ConstraintOrder) { case GeomAbs_C0: myNivConstr = 0; break; @@ -91,7 +93,7 @@ void PLib_JacobiPolynomial::Weights(const Standard_Integer NbGaussPoints, TColStd_Array2OfReal& TabWeights) const { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Standard_Real const *pdb=NULL; // the current pointer to WeightsDB switch (myNivConstr) { case 0: pdb = WeightsDB_C0; break; @@ -167,7 +169,7 @@ Standard_Real PLib_JacobiPolynomial::MaxError(const Standard_Integer Dimension, Standard_Real& JacCoeff, const Standard_Integer NewDegree) const { - Standard_Integer i,idim,ibeg,icut; + Standard_Integer i = 0,idim = 0,ibeg = 0,icut = 0; math_Vector MaxErrDim(1,Dimension,0.); @@ -198,8 +200,8 @@ void PLib_JacobiPolynomial::ReduceDegree(const Standard_Integer Dimension, Standard_Integer& NewDegree, Standard_Real& MaxError) const { - Standard_Integer i,idim,icut, ia = 2*(myNivConstr+1)-1; - Standard_Real Bid,Eps1,Error; + Standard_Integer i = 0,idim = 0,icut = 0, ia = 2*(myNivConstr+1)-1; + Standard_Real Bid = NAN,Eps1 = NAN,Error = NAN; math_Vector MaxErrDim(1,Dimension,0.); @@ -249,8 +251,8 @@ Standard_Real PLib_JacobiPolynomial::AverageError(const Standard_Integer Dimensi const Standard_Integer NewDegree) const { - Standard_Integer i,idim, icut = Max (2*(myNivConstr+1)+1, NewDegree+1); - Standard_Real BidJ, AverageErr = 0.; + Standard_Integer i = 0,idim = 0, icut = Max (2*(myNivConstr+1)+1, NewDegree+1); + Standard_Real BidJ = NAN, AverageErr = 0.; Standard_Real * JacArray = &JacCoeff; for (idim=1; idim<=Dimension; idim++) { for (i=icut; i<=myDegree; i++) { @@ -273,9 +275,9 @@ void PLib_JacobiPolynomial::ToCoefficients(const Standard_Integer Dimension, TColStd_Array1OfReal& Coefficients) const { const Standard_Integer MAXM=31; - Standard_Integer i,iptt,j,idim, ii, jj; + Standard_Integer i = 0,iptt = 0,j = 0,idim = 0, ii = 0, jj = 0; Standard_Real const *pTr=NULL; // the pointer to TransMatrix - Standard_Real Bid; + Standard_Real Bid = NAN; Standard_Integer ibegJC=JacCoeff.Lower(), ibegC=Coefficients.Lower(); switch (myNivConstr) { @@ -325,8 +327,8 @@ void PLib_JacobiPolynomial::D0123(const Standard_Integer NDeriv, TColStd_Array1OfReal& BasisD2, TColStd_Array1OfReal& BasisD3) { - Standard_Integer i,j, HermitNivConstr = 2*(myNivConstr+1); - Standard_Real Aux1,Aux2; + Standard_Integer i = 0,j = 0, HermitNivConstr = 2*(myNivConstr+1); + Standard_Real Aux1 = NAN,Aux2 = NAN; if (myTNorm.IsNull()) { @@ -361,7 +363,7 @@ void PLib_JacobiPolynomial::D0123(const Standard_Integer NDeriv, Standard_Integer ibeg1 = BasisD1.Lower(); Standard_Integer ibeg2 = BasisD2.Lower(); Standard_Integer ibeg3 = BasisD3.Lower(); - Standard_Integer i0, i1, i2, i3; + Standard_Integer i0 = 0, i1 = 0, i2 = 0, i3 = 0; if (myDegree == 0) { @@ -407,7 +409,7 @@ void PLib_JacobiPolynomial::D0123(const Standard_Integer NDeriv, } else { - Standard_Real CofA, CofB, Denom; + Standard_Real CofA = NAN, CofB = NAN, Denom = NAN; for (i=2; i<=myDegree; i++) { i0=i+ibeg0; i1=i+ibeg1; @@ -441,7 +443,7 @@ void PLib_JacobiPolynomial::D0123(const Standard_Integer NDeriv, BV[i] *= TNorm[i]; } else { - Standard_Real TNorm; + Standard_Real TNorm = NAN; for (i=0; i<=myDegree; i++) { TNorm = myTNorm->Value(i); BasisValue(i+ibeg0) *= TNorm; diff --git a/src/Plate/Plate_FreeGtoCConstraint.cxx b/src/Plate/Plate_FreeGtoCConstraint.cxx index 8c07ff8671..aa4ac1e132 100644 --- a/src/Plate/Plate_FreeGtoCConstraint.cxx +++ b/src/Plate/Plate_FreeGtoCConstraint.cxx @@ -37,11 +37,11 @@ static const Standard_Real COSMIN = 1.e-2; // G1 Constraints Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Plate_D1& D1S,const Plate_D1& D1T, - const Standard_Real IncrementalLoad, const Standard_Integer orientation) + const Standard_Real IncrementalLoad, const Standard_Integer orientation) : pnt2d(point2d), nb_PPConstraints(0), nb_LSConstraints(0) { - pnt2d = point2d; - nb_PPConstraints = 0; - nb_LSConstraints = 0; + + + gp_XYZ normale = D1T.Du^D1T.Dv; if(normale.Modulus() < NORMIN) return; @@ -92,11 +92,11 @@ Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Pl Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Plate_D1& D1S,const Plate_D1& D1T0, const Plate_D2& D2S,const Plate_D2& D2T0, - const Standard_Real IncrementalLoad, const Standard_Integer orientation) + const Standard_Real IncrementalLoad, const Standard_Integer orientation) : pnt2d(point2d), nb_PPConstraints(0), nb_LSConstraints(0) { - pnt2d = point2d; - nb_PPConstraints = 0; - nb_LSConstraints = 0; + + + Plate_D1 D1T = D1T0; Plate_D2 D2T = D2T0; @@ -227,11 +227,11 @@ Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Pl Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Plate_D1& D1S,const Plate_D1& D1T0, const Plate_D2& D2S,const Plate_D2& D2T0, const Plate_D3& D3S,const Plate_D3& D3T0, - const Standard_Real IncrementalLoad, const Standard_Integer orientation) + const Standard_Real IncrementalLoad, const Standard_Integer orientation) : pnt2d(point2d), nb_PPConstraints(0), nb_LSConstraints(0) { - pnt2d = point2d; - nb_PPConstraints = 0; - nb_LSConstraints = 0; + + + Plate_D1 D1T = D1T0; Plate_D2 D2T = D2T0; Plate_D3 D3T = D3T0; diff --git a/src/Plate/Plate_GlobalTranslationConstraint.cxx b/src/Plate/Plate_GlobalTranslationConstraint.cxx index 5fa72d2af1..41135d44e9 100644 --- a/src/Plate/Plate_GlobalTranslationConstraint.cxx +++ b/src/Plate/Plate_GlobalTranslationConstraint.cxx @@ -21,7 +21,7 @@ Plate_GlobalTranslationConstraint::Plate_GlobalTranslationConstraint(const TColgp_SequenceOfXY& SOfXY) :myLXYZC(SOfXY.Length()-1,SOfXY.Length() ) { - Standard_Integer i ; + Standard_Integer i = 0 ; for( i=1;i<=SOfXY.Length();i++) { myLXYZC.SetPPC(i,Plate_PinpointConstraint (SOfXY(i),gp_XYZ(0.,0.,0.),0,0)); diff --git a/src/Plate/Plate_GtoCConstraint.cxx b/src/Plate/Plate_GtoCConstraint.cxx index f1bc9351e4..5dac44df2f 100644 --- a/src/Plate/Plate_GtoCConstraint.cxx +++ b/src/Plate/Plate_GtoCConstraint.cxx @@ -28,19 +28,19 @@ static const Standard_Real NORMIN = 1.e-10; static const Standard_Real COSMIN = 1.e-2; Plate_GtoCConstraint::Plate_GtoCConstraint(const Plate_GtoCConstraint& ref) -:myD1SurfInit(ref.myD1SurfInit) +:myD1SurfInit(ref.myD1SurfInit), pnt2d(ref.pnt2d), nb_PPConstraints(ref.nb_PPConstraints) { - pnt2d = ref.pnt2d; - nb_PPConstraints = ref.nb_PPConstraints; + + for(Standard_Integer i = 0; iChangeValue(1) = PPC1; myCoef->ChangeValue(1,1) = coeff; @@ -57,10 +57,10 @@ Plate_LinearScalarConstraint::Plate_LinearScalarConstraint } -Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen) +Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen) : myPPC(new Plate_HArray1OfPinpointConstraint(1,RowLen)), myCoef(new TColgp_HArray2OfXYZ(1,ColLen,1,RowLen)) { - myPPC = new Plate_HArray1OfPinpointConstraint(1,RowLen); - myCoef = new TColgp_HArray2OfXYZ(1,ColLen,1,RowLen); + + myCoef->Init(gp_XYZ(0.,0.,0.)); } diff --git a/src/Plate/Plate_LinearXYZConstraint.cxx b/src/Plate/Plate_LinearXYZConstraint.cxx index 89d093d719..b5fc861cfc 100644 --- a/src/Plate/Plate_LinearXYZConstraint.cxx +++ b/src/Plate/Plate_LinearXYZConstraint.cxx @@ -43,10 +43,10 @@ Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Plate_Array1OfPinpoin } -Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen) +Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Standard_Integer ColLen,const Standard_Integer RowLen) : myPPC(new Plate_HArray1OfPinpointConstraint(1,RowLen)), myCoef(new TColStd_HArray2OfReal(1,ColLen,1,RowLen)) { - myPPC = new Plate_HArray1OfPinpointConstraint(1,RowLen); - myCoef = new TColStd_HArray2OfReal(1,ColLen,1,RowLen); + + myCoef->Init(0.0); } diff --git a/src/Plate/Plate_PinpointConstraint.cxx b/src/Plate/Plate_PinpointConstraint.cxx index b07cd3034b..9c2781ad9e 100644 --- a/src/Plate/Plate_PinpointConstraint.cxx +++ b/src/Plate/Plate_PinpointConstraint.cxx @@ -17,20 +17,20 @@ #include -Plate_PinpointConstraint::Plate_PinpointConstraint() +Plate_PinpointConstraint::Plate_PinpointConstraint() : idu(0), idv(0) { pnt2d = gp_XY(0,0); value = gp_XYZ(0,0,0); - idu = 0; - idv = 0; + + } Plate_PinpointConstraint::Plate_PinpointConstraint(const gp_XY& point2d, const gp_XYZ& ImposedValue, - const Standard_Integer iu, const Standard_Integer iv) + const Standard_Integer iu, const Standard_Integer iv) : pnt2d(point2d), value(ImposedValue), idu(iu), idv(iv) { - pnt2d = point2d; - value = ImposedValue; - idu = iu; - idv = iv; + + + + } diff --git a/src/Plate/Plate_Plate.cxx b/src/Plate/Plate_Plate.cxx index 6047b82b43..3004a431da 100644 --- a/src/Plate/Plate_Plate.cxx +++ b/src/Plate/Plate_Plate.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -37,13 +39,13 @@ Plate_Plate::Plate_Plate() : order(0), n_el(0), n_dim(0), solution(0),points(0),deru(0),derv(0), OK(Standard_False),maxConstraintOrder(0), - Uold (1.e20), + PolynomialPartOnly(Standard_False), Uold (1.e20), Vold (1.e20), U2 (0.0), R (0.0), L (0.0) { - PolynomialPartOnly = Standard_False; + memset (ddu, 0, sizeof (ddu)); memset (ddv, 0, sizeof (ddv)); } @@ -63,7 +65,7 @@ Plate_Plate::Plate_Plate(const Plate_Plate& Ref) R (0.0), L (0.0) { - Standard_Integer i; + Standard_Integer i = 0; if (Ref.OK) { if (n_dim >0 && Ref.solution != 0) { solution = new gp_XYZ[n_dim]; @@ -117,7 +119,7 @@ Plate_Plate::Plate_Plate(const Plate_Plate& Ref) n_el = Ref.n_el; n_dim = Ref.n_dim; OK = Ref.OK; - Standard_Integer i; + Standard_Integer i = 0; if (Ref.OK) { if (n_dim >0 && Ref.solution != 0) { solution = new gp_XYZ[n_dim]; @@ -224,7 +226,7 @@ void Plate_Plate::Load(const Plate_GtoCConstraint& GtoCConst) void Plate_Plate::Load(const Plate_FreeGtoCConstraint& FGtoCConst) { - Standard_Integer i ; + Standard_Integer i = 0 ; for( i=0;i< FGtoCConst.nb_PPC();i++) Load(FGtoCConst.GetPPC(i)); for(i=0;i< FGtoCConst.nb_LSC();i++) @@ -255,14 +257,14 @@ void Plate_Plate::SolveTI(const Standard_Integer ord, if(anisotropie > 1.e+6) return; // computation of the bounding box of the 2d PPconstraints - Standard_Real xmin,xmax,ymin,ymax; + Standard_Real xmin = NAN,xmax = NAN,ymin = NAN,ymax = NAN; UVBox(xmin,xmax,ymin,ymax); Standard_Real du = 0.5*(xmax - xmin); if(anisotropie >1.) du *= anisotropie; if(du < 1.e-10) return; ddu[0] = 1; - Standard_Integer i ; + Standard_Integer i = 0 ; for( i=1;i<=9;i++) ddu[i] = ddu[i-1] / du; Standard_Real dv = 0.5*(ymax - ymin); @@ -300,7 +302,7 @@ void Plate_Plate::SolveTI1(const Standard_Integer IterationNumber, delete [] (gp_XY*)points; points = new gp_XY[n_el]; - Standard_Integer i ; + Standard_Integer i = 0 ; for( i=0; i(this); - Standard_Real U,V; - Standard_Integer IU,IV; + Standard_Real U = NAN,V = NAN; + Standard_Integer IU = 0,IV = 0; if(iv>iu) { @@ -1157,7 +1159,7 @@ Standard_Real Plate_Plate::SolEm(const gp_XY& point2d, const Standard_Integer iu // Standard_Integer expo = mm1 - IU - IV; - Standard_Real pr; + Standard_Real pr = NAN; if(expo<0) { pr = R; @@ -1581,7 +1583,7 @@ Standard_Real Plate_Plate::SolEm(const gp_XY& point2d, const Standard_Integer iu void Plate_Plate::UVBox(Standard_Real& UMin, Standard_Real& UMax, Standard_Real& VMin, Standard_Real& VMax) const { - Standard_Integer i ; + Standard_Integer i = 0 ; const Standard_Real Bmin = 1.e-3; UMin = myConstraints(1).Pnt2d().X(); UMax = UMin; diff --git a/src/Plate/Plate_Plate.hxx b/src/Plate/Plate_Plate.hxx index 0a0594836c..2c89dfeb38 100644 --- a/src/Plate/Plate_Plate.hxx +++ b/src/Plate/Plate_Plate.hxx @@ -160,8 +160,8 @@ private: Plate_SequenceOfPinpointConstraint myConstraints; Plate_SequenceOfLinearXYZConstraint myLXYZConstraints; Plate_SequenceOfLinearScalarConstraint myLScalarConstraints; - Standard_Real ddu[10]; - Standard_Real ddv[10]; + Standard_Real ddu[10]{}; + Standard_Real ddv[10]{}; Standard_Integer maxConstraintOrder; Standard_Boolean PolynomialPartOnly; Standard_Real Uold; diff --git a/src/Plugin/Plugin.cxx b/src/Plugin/Plugin.cxx index 6ad8b23451..0e2d6b6bfd 100644 --- a/src/Plugin/Plugin.cxx +++ b/src/Plugin/Plugin.cxx @@ -41,7 +41,7 @@ Handle(Standard_Transient) Plugin::Load (const Standard_GUID& aGUID, aGUID.ToCString(thePluginId); TCollection_AsciiString pid(thePluginId); static Plugin_MapOfFunctions theMapOfFunctions; - OSD_Function f; + OSD_Function f = nullptr; if(!theMapOfFunctions.IsBound(pid)) { diff --git a/src/Poly/Poly.cxx b/src/Poly/Poly.cxx index dff7e3abaf..35779418db 100644 --- a/src/Poly/Poly.cxx +++ b/src/Poly/Poly.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -117,7 +119,7 @@ void Poly::Write(const Handle(Poly_Triangulation)& T, if (!Compact) OS << "\n3D Nodes :\n"; - Standard_Integer i, nbNodes = T->NbNodes(); + Standard_Integer i = 0, nbNodes = T->NbNodes(); for (i = 1; i <= nbNodes; i++) { const gp_Pnt aNode = T->Node (i); @@ -146,7 +148,7 @@ void Poly::Write(const Handle(Poly_Triangulation)& T, if (!Compact) OS << "\nTriangles :\n"; Standard_Integer nbTriangles = T->NbTriangles(); - Standard_Integer n1, n2, n3; + Standard_Integer n1 = 0, n2 = 0, n3 = 0; for (i = 1; i <= nbTriangles; i++) { if (!Compact) OS << std::setw(10) << i << " : "; @@ -189,7 +191,7 @@ void Poly::Write(const Handle(Poly_Polygon3D)& P, if (!Compact) OS << "\nNodes :\n"; - Standard_Integer i, nbNodes = P->NbNodes(); + Standard_Integer i = 0, nbNodes = P->NbNodes(); const TColgp_Array1OfPnt& Nodes = P->Nodes(); for (i = 1; i <= nbNodes; i++) { if (!Compact) OS << std::setw(10) << i << " : "; @@ -240,7 +242,7 @@ void Poly::Write(const Handle(Poly_Polygon2D)& P, if (!Compact) OS << "\nNodes :\n"; - Standard_Integer i, nbNodes = P->NbNodes(); + Standard_Integer i = 0, nbNodes = P->NbNodes(); const TColgp_Array1OfPnt2d& Nodes = P->Nodes(); for (i = 1; i <= nbNodes; i++) { if (!Compact) OS << std::setw(10) << i << " : "; @@ -304,16 +306,16 @@ Handle(Poly_Triangulation) Poly::ReadTriangulation(Standard_IStream& IS) return Handle(Poly_Triangulation)(); } - Standard_Integer nbNodes, nbTriangles; - Standard_Boolean hasUV; + Standard_Integer nbNodes = 0, nbTriangles = 0; + Standard_Boolean hasUV = 0; IS >> nbNodes >> nbTriangles >> hasUV; - Standard_Real d; + Standard_Real d = NAN; IS >> d; // read the 3d nodes - Standard_Real x,y,z; - Standard_Integer i; + Standard_Real x = NAN,y = NAN,z = NAN; + Standard_Integer i = 0; TColgp_Array1OfPnt Nodes(1, nbNodes); TColgp_Array1OfPnt2d UVNodes(1, nbNodes); @@ -333,7 +335,7 @@ Handle(Poly_Triangulation) Poly::ReadTriangulation(Standard_IStream& IS) // read the triangles - Standard_Integer n1,n2,n3; + Standard_Integer n1 = 0,n2 = 0,n3 = 0; Poly_Array1OfTriangle Triangles(1, nbTriangles); for (i = 1; i <= nbTriangles; i++) { IS >> n1 >> n2 >> n3; @@ -370,18 +372,18 @@ Handle(Poly_Polygon3D) Poly::ReadPolygon3D(Standard_IStream& IS) return Handle(Poly_Polygon3D)(); } - Standard_Integer nbNodes; + Standard_Integer nbNodes = 0; IS >> nbNodes; - Standard_Boolean hasparameters; + Standard_Boolean hasparameters = 0; IS >> hasparameters; - Standard_Real d; + Standard_Real d = NAN; IS >> d; // read the nodes - Standard_Real x,y,z; - Standard_Integer i; + Standard_Real x = NAN,y = NAN,z = NAN; + Standard_Integer i = 0; TColgp_Array1OfPnt Nodes(1, nbNodes); for (i = 1; i <= nbNodes; i++) { @@ -425,15 +427,15 @@ Handle(Poly_Polygon2D) Poly::ReadPolygon2D(Standard_IStream& IS) return Handle(Poly_Polygon2D)(); } - Standard_Integer nbNodes; + Standard_Integer nbNodes = 0; IS >> nbNodes; - Standard_Real d; + Standard_Real d = NAN; IS >> d; // read the nodes - Standard_Real x,y; - Standard_Integer i; + Standard_Real x = NAN,y = NAN; + Standard_Integer i = 0; TColgp_Array1OfPnt2d Nodes(1, nbNodes); for (i = 1; i <= nbNodes; i++) { diff --git a/src/Poly/Poly_CoherentTriangle.cxx b/src/Poly/Poly_CoherentTriangle.cxx index 6de2f89249..651ae56e9a 100644 --- a/src/Poly/Poly_CoherentTriangle.cxx +++ b/src/Poly/Poly_CoherentTriangle.cxx @@ -276,7 +276,7 @@ Standard_Boolean Poly_CoherentTriangle::RemoveConnection Standard_Integer Poly_CoherentTriangle::FindConnection (const Poly_CoherentTriangle& theTri) const { - Standard_Integer aResult; + Standard_Integer aResult = 0; if (mypConnected[0] == &theTri) aResult = 0; else if (mypConnected[1] == &theTri) diff --git a/src/Poly/Poly_CoherentTriangle.hxx b/src/Poly/Poly_CoherentTriangle.hxx index bb973544d9..41d7a514b3 100644 --- a/src/Poly/Poly_CoherentTriangle.hxx +++ b/src/Poly/Poly_CoherentTriangle.hxx @@ -152,10 +152,10 @@ class Poly_CoherentTriangle // ---------- PRIVATE FIELDS ---------- Standard_Integer myNConnections; - Standard_Integer myNodes[3]; - Standard_Integer myNodesOnConnected[3]; - const Poly_CoherentTriangle * mypConnected[3]; - const Poly_CoherentLink * mypLink[3]; + Standard_Integer myNodes[3]{}; + Standard_Integer myNodesOnConnected[3]{}; + const Poly_CoherentTriangle * mypConnected[3]{}; + const Poly_CoherentLink * mypLink[3]{}; friend class Poly_CoherentTriangulation; }; diff --git a/src/Poly/Poly_CoherentTriangulation.cxx b/src/Poly/Poly_CoherentTriangulation.cxx index f98af07866..dbfa7303bf 100644 --- a/src/Poly/Poly_CoherentTriangulation.cxx +++ b/src/Poly/Poly_CoherentTriangulation.cxx @@ -49,7 +49,7 @@ Poly_CoherentTriangulation::Poly_CoherentTriangulation { if (theTriangulation.IsNull() == Standard_False) { const Standard_Integer nNodes = theTriangulation->NbNodes(); - Standard_Integer i; + Standard_Integer i = 0; // Copy the nodes for (i = 0; i < nNodes; i++) { @@ -174,7 +174,7 @@ Standard_Boolean Poly_CoherentTriangulation::GetFreeNodes (NCollection_List& lstNodes) const { lstNodes.Clear(); - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i < myNodes.Length(); i++) { const Poly_CoherentNode& aNode = myNodes(i); if (aNode.IsFreeNode()) @@ -687,7 +687,7 @@ Standard_Integer Poly_CoherentTriangulation::ComputeLinks () // Above algorithm does not create all boundary links, so // it is necessary to check triangles and add absentee links anIter.Init(myTriangles); - Standard_Integer i; + Standard_Integer i = 0; for (; anIter.More(); anIter.Next()) { Poly_CoherentTriangle& aTriangle = anIter.ChangeValue(); diff --git a/src/Poly/Poly_Connect.cxx b/src/Poly/Poly_Connect.cxx index 226b552e5b..d3e0ae38e8 100644 --- a/src/Poly/Poly_Connect.cxx +++ b/src/Poly/Poly_Connect.cxx @@ -226,7 +226,7 @@ void Poly_Connect::Initialize(const Standard_Integer N) myPassedTr.Add (mytr); if (mymore) { - Standard_Integer i, no[3]; + Standard_Integer i = 0, no[3]; myTriangulation->Triangle (myfirst).Get (no[0], no[1], no[2]); for (i = 0; i < 3; i++) if (no[i] == mynode) break; @@ -241,7 +241,7 @@ void Poly_Connect::Initialize(const Standard_Integer N) void Poly_Connect::Next() { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Standard_Integer n[3]; Standard_Integer t[3]; Triangles(mytr, t[0], t[1], t[2]); diff --git a/src/Poly/Poly_MakeLoops.cxx b/src/Poly/Poly_MakeLoops.cxx index 8ba09e83a7..4730a63f1f 100644 --- a/src/Poly/Poly_MakeLoops.cxx +++ b/src/Poly/Poly_MakeLoops.cxx @@ -141,7 +141,7 @@ Standard_Integer Poly_MakeLoops::Perform() { // prepare the set of start indices myStartIndices.Clear(); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= myMapLink.Extent(); i++) { const Link& aLink = myMapLink(i); @@ -162,7 +162,7 @@ Standard_Integer Poly_MakeLoops::Perform() Handle(NCollection_IncAllocator) aTempAlloc1 = new NCollection_IncAllocator(4000); // two pass loop - Standard_Integer aPassNum, nbLoopsOnPass2 = 0; + Standard_Integer aPassNum = 0, nbLoopsOnPass2 = 0; for (aPassNum=0; aPassNum < 2; aPassNum++) { myHangIndices.Clear(); @@ -199,7 +199,7 @@ Standard_Integer Poly_MakeLoops::Perform() if (aStartNumber > 1) { // it is required to mark hanging edges - Standard_Integer aNode; + Standard_Integer aNode = 0; if (aStartNumber <= aContour.Extent()) // mark hanging edges starting from the first one till a bifurcation aNode = getFirstNode(aIndexS); @@ -347,7 +347,7 @@ void Poly_MakeLoops::acceptContour // build a loop, mark links as taken, // remove them from the set of start indices - Standard_Integer i; + Standard_Integer i = 0; for (i = theStartNumber; i <= theContour.Extent(); i++) { Standard_Integer aIndexS = theContour(i); // index with sign diff --git a/src/Poly/Poly_Polygon2D.cxx b/src/Poly/Poly_Polygon2D.cxx index 9d7af7bbea..65937c6490 100644 --- a/src/Poly/Poly_Polygon2D.cxx +++ b/src/Poly/Poly_Polygon2D.cxx @@ -37,7 +37,7 @@ Poly_Polygon2D::Poly_Polygon2D(const TColgp_Array1OfPnt2d& Nodes): myDeflection(0.), myNodes(1, Nodes.Length()) { - Standard_Integer i, j= 1; + Standard_Integer i = 0, j= 1; for (i = Nodes.Lower(); i <= Nodes.Upper(); i++) myNodes(j++) = Nodes(i); } diff --git a/src/Poly/Poly_Polygon3D.cxx b/src/Poly/Poly_Polygon3D.cxx index c7a2c99f4e..29e129d899 100644 --- a/src/Poly/Poly_Polygon3D.cxx +++ b/src/Poly/Poly_Polygon3D.cxx @@ -41,7 +41,7 @@ Poly_Polygon3D::Poly_Polygon3D(const TColgp_Array1OfPnt& Nodes): myDeflection(0.), myNodes(1, Nodes.Length()) { - Standard_Integer i, j= 1; + Standard_Integer i = 0, j= 1; for (i = Nodes.Lower(); i <= Nodes.Upper(); i++) myNodes(j++) = Nodes(i); } @@ -54,11 +54,11 @@ Poly_Polygon3D::Poly_Polygon3D(const TColgp_Array1OfPnt& Nodes): Poly_Polygon3D::Poly_Polygon3D(const TColgp_Array1OfPnt& Nodes, const TColStd_Array1OfReal& P): myDeflection(0.), - myNodes(1, Nodes.Length()) + myNodes(1, Nodes.Length()), myParameters(new TColStd_HArray1OfReal(1, P.Length())) { - myParameters = new TColStd_HArray1OfReal(1, P.Length()); - Standard_Integer i, j= 1; + + Standard_Integer i = 0, j= 1; for (i = Nodes.Lower(); i <= Nodes.Upper(); i++) { myNodes(j) = Nodes(i); myParameters->SetValue(j, P(i)); diff --git a/src/Poly/Poly_PolygonOnTriangulation.cxx b/src/Poly/Poly_PolygonOnTriangulation.cxx index 19a0052372..ea8185b8c9 100644 --- a/src/Poly/Poly_PolygonOnTriangulation.cxx +++ b/src/Poly/Poly_PolygonOnTriangulation.cxx @@ -41,9 +41,9 @@ Poly_PolygonOnTriangulation::Poly_PolygonOnTriangulation (const Standard_Integer Poly_PolygonOnTriangulation::Poly_PolygonOnTriangulation (const TColStd_Array1OfInteger& Nodes) : myDeflection(0.0), - myNodes(1, Nodes.Length()) + myNodes(Nodes) { - myNodes = Nodes; + } //======================================================================= @@ -55,10 +55,8 @@ Poly_PolygonOnTriangulation::Poly_PolygonOnTriangulation (const TColStd_Array1OfInteger& Nodes, const TColStd_Array1OfReal& Parameters): myDeflection(0.0), - myNodes(1, Nodes.Length()) + myNodes(Nodes), myParameters(new TColStd_HArray1OfReal()) { - myNodes = Nodes; - myParameters = new TColStd_HArray1OfReal(1, Parameters.Length()); myParameters->ChangeArray1() = Parameters; } diff --git a/src/Poly/Poly_Triangulation.cxx b/src/Poly/Poly_Triangulation.cxx index 62e3aef70b..256b600453 100644 --- a/src/Poly/Poly_Triangulation.cxx +++ b/src/Poly/Poly_Triangulation.cxx @@ -69,12 +69,12 @@ Poly_Triangulation::Poly_Triangulation (const TColgp_Array1OfPnt& theNodes, : myCachedMinMax (NULL), myDeflection (0), myNodes (theNodes.Length()), - myTriangles (1, theTriangles.Length()), + myTriangles (theTriangles), myPurpose (Poly_MeshPurpose_NONE) { const Poly_ArrayOfNodes aNodeWrapper (theNodes.First(), theNodes.Length()); myNodes = aNodeWrapper; - myTriangles = theTriangles; + } //======================================================================= @@ -88,13 +88,13 @@ Poly_Triangulation::Poly_Triangulation (const TColgp_Array1OfPnt& theNodes, : myCachedMinMax (NULL), myDeflection (0), myNodes (theNodes.Length()), - myTriangles (1, theTriangles.Length()), + myTriangles(theTriangles), myUVNodes (theNodes.Length()), myPurpose (Poly_MeshPurpose_NONE) { const Poly_ArrayOfNodes aNodeWrapper (theNodes.First(), theNodes.Length()); myNodes = aNodeWrapper; - myTriangles = theTriangles; + const Poly_ArrayOfUVNodes aUVNodeWrapper (theUVNodes.First(), theUVNodes.Length()); myUVNodes = aUVNodeWrapper; } diff --git a/src/ProjLib/ProjLib.cxx b/src/ProjLib/ProjLib.cxx index 995ad1333a..75b7195560 100644 --- a/src/ProjLib/ProjLib.cxx +++ b/src/ProjLib/ProjLib.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -51,7 +53,7 @@ //======================================================================= gp_Pnt2d ProjLib::Project(const gp_Pln& Pl, const gp_Pnt& P) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; ElSLib::Parameters(Pl, P, U, V); return gp_Pnt2d(U,V); } @@ -124,7 +126,7 @@ gp_Hypr2d ProjLib::Project(const gp_Pln& Pl, const gp_Hypr& H) gp_Pnt2d ProjLib::Project(const gp_Cylinder& Cy, const gp_Pnt& P) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; ElSLib::Parameters(Cy, P, U, V); return gp_Pnt2d(U,V); } @@ -161,7 +163,7 @@ gp_Lin2d ProjLib::Project(const gp_Cylinder& Cy, const gp_Circ& Ci) gp_Pnt2d ProjLib::Project(const gp_Cone& Co, const gp_Pnt& P) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; ElSLib::Parameters(Co, P, U, V); return gp_Pnt2d(U,V); } @@ -198,7 +200,7 @@ gp_Lin2d ProjLib::Project(const gp_Cone& Co, const gp_Circ& Ci) gp_Pnt2d ProjLib::Project(const gp_Sphere& Sp, const gp_Pnt& P) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; ElSLib::Parameters(Sp, P, U, V); return gp_Pnt2d(U,V); } @@ -223,7 +225,7 @@ gp_Lin2d ProjLib::Project(const gp_Sphere& Sp, const gp_Circ& Ci) gp_Pnt2d ProjLib::Project(const gp_Torus& To, const gp_Pnt& P) { - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; ElSLib::Parameters(To, P, U, V); return gp_Pnt2d(U,V); } diff --git a/src/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ProjLib/ProjLib_CompProjectedCurve.cxx index af709f85e3..a7d9d68631 100644 --- a/src/ProjLib/ProjLib_CompProjectedCurve.cxx +++ b/src/ProjLib/ProjLib_CompProjectedCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -224,7 +226,7 @@ static void d2(const Standard_Real t, // Computation of (d2E/dX2)*(dX/dt)2 = S3 // Row11 = (d2E1/du2, d2E1/dudv) - Standard_Real tmp; + Standard_Real tmp = NAN; gp_Vec2d Row11(3*DS1_u*DS2_u + Ort*DS3_u, tmp = 2*DS1_u*DS2_uv + DS1_v*DS2_u + Ort*DS3_uuv); @@ -338,7 +340,7 @@ static void d2CurvOnSurf(const Standard_Real t, // Computation of (d2E/dX2)*(dX/dt)2 = S3 // Row11 = (d2E1/du2, d2E1/dudv) - Standard_Real tmp; + Standard_Real tmp = NAN; gp_Vec2d Row11(3*DS1_u*DS2_u + Ort*DS3_u, tmp = 2*DS1_u*DS2_uv + DS1_v*DS2_u + Ort*DS3_uuv); @@ -382,7 +384,7 @@ static Standard_Boolean ExactBound(gp_Pnt& Sol, const Handle(Adaptor3d_Curve)& Curve, const Handle(Adaptor3d_Surface)& Surface) { - Standard_Real U0, V0, t, t1, t2, FirstU, LastU, FirstV, LastV; + Standard_Real U0 = NAN, V0 = NAN, t = NAN, t1 = NAN, t2 = NAN, FirstU = NAN, LastU = NAN, FirstV = NAN, LastV = NAN; gp_Pnt2d POnS; U0 = Sol.Y(); V0 = Sol.Z(); @@ -394,7 +396,7 @@ static Standard_Boolean ExactBound(gp_Pnt& Sol, gp_Vec2d D2d; //these variables are to estimate which boundary has more apportunity //to be intersected - Standard_Real RU1, RU2, RV1, RV2; + Standard_Real RU1 = NAN, RU2 = NAN, RV1 = NAN, RV2 = NAN; d1(Sol.X(), U0, V0, D2d, Curve, Surface); // Here we assume that D2d != (0, 0) if(Abs(D2d.X()) < gp::Resolution()) @@ -427,7 +429,7 @@ static Standard_Boolean ExactBound(gp_Pnt& Sol, Seq.Append(gp_Pnt(LastU, RU2, 2)); Seq.Append(gp_Pnt(FirstV, RV1, 3)); Seq.Append(gp_Pnt(LastV, RV2, 3)); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for(i = 1; i <= 3; i++) { for(j = 1; j <= 4-i; j++) @@ -497,7 +499,7 @@ static void DichExactBound(gp_Pnt& Sol, InitChron(chr_dicho_bound); #endif - Standard_Real U0, V0, t; + Standard_Real U0 = NAN, V0 = NAN, t = NAN; gp_Pnt2d POnS; U0 = Sol.Y(); V0 = Sol.Z(); @@ -544,7 +546,7 @@ static Standard_Boolean InitialPoint(const gp_Pnt& Point, { ProjLib_PrjResolve aPrjPS (*C, *S, 1); - Standard_Real ParU,ParV; + Standard_Real ParU = NAN,ParV = NAN; Extrema_ExtPS aExtPS; aExtPS.Initialize (*S, S->FirstUParameter(), S->LastUParameter(), S->FirstVParameter(), @@ -559,7 +561,7 @@ static Standard_Boolean InitialPoint(const gp_Pnt& Point, } if (aExtPS.IsDone() && aExtPS.NbExt()) { - Standard_Integer i, Nend; + Standard_Integer i = 0, Nend = 0; // Search for the nearest solution which is also a normal projection Nend = aExtPS.NbExt(); for(i = 1; i <= Nend; i++) @@ -675,10 +677,10 @@ ProjLib_CompProjectedCurve::ProjLib_CompProjectedCurve myMaxSeg (16), myProj2d (Standard_True), myProj3d (Standard_False), - myMaxDist (theMaxDist) + myMaxDist (theMaxDist), myTolU(Max(Precision::PConfusion(), mySurface->UResolution(theTol3d))), myTolV(Max(Precision::PConfusion(), mySurface->VResolution(theTol3d))) { - myTolU = Max(Precision::PConfusion(), mySurface->UResolution(theTol3d)); - myTolV = Max(Precision::PConfusion(), mySurface->VResolution(theTol3d)); + + Init(); } @@ -724,8 +726,8 @@ void ProjLib_CompProjectedCurve::Init() NCollection_Vector aSplits; aSplits.Clear(); - Standard_Real Tol;// Tolerance for ExactBound - Standard_Integer i, Nend = 0, aSplitIdx = 0; + Standard_Real Tol = NAN;// Tolerance for ExactBound + Standard_Integer i = 0, Nend = 0, aSplitIdx = 0; Standard_Boolean FromLastU = Standard_False, isSplitsComputed = Standard_False; @@ -739,7 +741,7 @@ void ProjLib_CompProjectedCurve::Init() mySurface->GetType() != GeomAbs_SurfaceOfExtrusion) { - Standard_Real min_val2; + Standard_Real min_val2 = NAN; min_val2 = CExt.SquareDistance(1); Nend = CExt.NbExt(); @@ -753,7 +755,7 @@ void ProjLib_CompProjectedCurve::Init() } } - Standard_Real FirstU, LastU, Step, SearchStep, WalkStep, t; + Standard_Real FirstU = NAN, LastU = NAN, Step = NAN, SearchStep = NAN, WalkStep = NAN, t = NAN; FirstU = myCurve->FirstParameter(); LastU = myCurve->LastParameter(); @@ -771,7 +773,7 @@ void ProjLib_CompProjectedCurve::Init() ProjLib_PrjResolve aPrjPS (*myCurve, *mySurface, 1); t = FirstU; - Standard_Boolean new_part; + Standard_Boolean new_part = 0; Standard_Real prevDeb=0.; Standard_Boolean SameDeb=Standard_False; @@ -792,7 +794,7 @@ void ProjLib_CompProjectedCurve::Init() Standard_Boolean initpoint=Standard_False; Standard_Real U = 0., V = 0.; gp_Pnt CPoint; - Standard_Real ParT,ParU,ParV; + Standard_Real ParT = NAN,ParU = NAN,ParV = NAN; // Search an initial point in the list of Extrema Curve-Surface if(Nend != 0 && !CExt.IsParallel()) @@ -875,7 +877,7 @@ void ProjLib_CompProjectedCurve::Init() // Here we are going to stop if the distance between projection and // corresponding curve point is greater than myMaxDist gp_Pnt POnS; - Standard_Real d; + Standard_Real d = NAN; mySurface->D0(U, V, POnS); d = CPoint.Distance(POnS); if (d > myMaxDist) @@ -930,7 +932,7 @@ void ProjLib_CompProjectedCurve::Init() //Computation of WalkStep gp_Vec D1, D2; - Standard_Real MagnD1, MagnD2; + Standard_Real MagnD1 = NAN, MagnD2 = NAN; d2CurvOnSurf(Triple.X(), Triple.Y(), Triple.Z(), D1, D2, myCurve, mySurface); MagnD1 = D1.Magnitude(); MagnD2 = D2.Magnitude(); @@ -942,7 +944,7 @@ void ProjLib_CompProjectedCurve::Init() t = Triple.X() + Step; if (t > LastU) t = LastU; Standard_Real prevStep = Step; - Standard_Real U0, V0; + Standard_Real U0 = NAN, V0 = NAN; //Here we are trying to prolong continuous part while (t <= LastU && new_part) @@ -1087,7 +1089,7 @@ void ProjLib_CompProjectedCurve::Init() } // Sequence post-proceeding. - Standard_Integer j; + Standard_Integer j = 0; // 1. Removing poor parts Standard_Integer NbPart=myNbCurves; @@ -1122,7 +1124,7 @@ void ProjLib_CompProjectedCurve::Init() for(j = 1; j <= mySequence->Value(i)->Length(); j++) { gp_Pnt POnC, POnS, aTriple; - Standard_Real Distance; + Standard_Real Distance = NAN; aTriple = mySequence->Value(i)->Value(j); myCurve->D0(aTriple.X(), POnC); mySurface->D0(aTriple.Y(), aTriple.Z(), POnS); @@ -1137,7 +1139,7 @@ void ProjLib_CompProjectedCurve::Init() // 4. Check the projection to be a single point gp_Pnt2d Pmoy, Pcurr, P; - Standard_Real AveU, AveV; + Standard_Real AveU = NAN, AveV = NAN; mySnglPnts = new TColStd_HArray1OfBoolean(1, myNbCurves); mySnglPnts->Init (Standard_True); @@ -1228,7 +1230,7 @@ void ProjLib_CompProjectedCurve::Perform() Standard_Boolean approx2d = myProj2d; Standard_Boolean approx3d = myProj3d; - Standard_Real Udeb, Ufin, UIso, VIso; + Standard_Real Udeb = NAN, Ufin = NAN, UIso = NAN, VIso = NAN; gp_Pnt2d P2d, Pdeb, Pfin; gp_Pnt P; Handle(Adaptor2d_Curve2d) HPCur; @@ -1320,7 +1322,7 @@ void ProjLib_CompProjectedCurve::Perform() { if (!mySurface->IsUPeriodic()) { - Standard_Real U1, U2; + Standard_Real U1 = NAN, U2 = NAN; Standard_Real dU = 10. * myTolU; U1 = mySurface->FirstUParameter(); @@ -1333,7 +1335,7 @@ void ProjLib_CompProjectedCurve::Perform() if (!mySurface->IsVPeriodic()) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; Standard_Real dV = 10. * myTolV; V1 = mySurface->FirstVParameter(); @@ -1351,7 +1353,7 @@ void ProjLib_CompProjectedCurve::Perform() if (approx2d || approx3d) { - Standard_Boolean only2d, only3d; + Standard_Boolean only2d = 0, only3d = 0; if (approx2d && approx3d) { only2d = !approx2d; @@ -1576,8 +1578,8 @@ gp_Pnt2d ProjLib_CompProjectedCurve::Value(const Standard_Real t) const void ProjLib_CompProjectedCurve::D0(const Standard_Real U,gp_Pnt2d& P) const { - Standard_Integer i, j; - Standard_Real Udeb, Ufin; + Standard_Integer i = 0, j = 0; + Standard_Real Udeb = NAN, Ufin = NAN; Standard_Boolean found = Standard_False; for(i = 1; i <= myNbCurves; i++) @@ -1594,7 +1596,7 @@ void ProjLib_CompProjectedCurve::D0(const Standard_Real U,gp_Pnt2d& P) const throw Standard_DomainError("ProjLib_CompProjectedCurve::D0"); } - Standard_Real U0, V0; + Standard_Real U0 = NAN, V0 = NAN; Standard_Integer End = mySequence->Value(i)->Length(); for(j = 1; j < End; j++) @@ -1623,7 +1625,7 @@ void ProjLib_CompProjectedCurve::D0(const Standard_Real U,gp_Pnt2d& P) const j = mySequence->Value(i)->Length() - 2; gp_Vec2d I1, I2, I3, I21, I22, I31, Y1, Y2, Y3, Y4, Res; - Standard_Real X1, X2, X3, X4; + Standard_Real X1 = NAN, X2 = NAN, X3 = NAN, X4 = NAN; X1 = mySequence->Value(i)->Value(j - 1).X(); X2 = mySequence->Value(i)->Value(j).X(); @@ -1673,14 +1675,14 @@ void ProjLib_CompProjectedCurve::D0(const Standard_Real U,gp_Pnt2d& P) const Extrema_ExtPS aExtPS(thePoint, *mySurface, myTolU, myTolV); if (aExtPS.IsDone() && aExtPS.NbExt()) { - Standard_Integer k, Nend, imin = 1; + Standard_Integer k = 0, Nend = 0, imin = 1; // Search for the nearest solution which is also a normal projection Nend = aExtPS.NbExt(); for(k = 2; k <= Nend; k++) if (aExtPS.SquareDistance(k) < aExtPS.SquareDistance(imin)) imin = k; const Extrema_POnSurf& POnS = aExtPS.Point(imin); - Standard_Real ParU,ParV; + Standard_Real ParU = NAN,ParV = NAN; POnS.Parameter(ParU, ParV); P.SetCoord(ParU, ParV); } @@ -1697,7 +1699,7 @@ void ProjLib_CompProjectedCurve::D1(const Standard_Real t, gp_Pnt2d& P, gp_Vec2d& V) const { - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; D0(t, P); u = P.X(); v = P.Y(); @@ -1713,7 +1715,7 @@ void ProjLib_CompProjectedCurve::D2(const Standard_Real t, gp_Vec2d& V1, gp_Vec2d& V2) const { - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; D0(t, P); u = P.X(); v = P.Y(); @@ -1853,7 +1855,7 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const default: throw Standard_OutOfRange(); } - Standard_Integer i, j, k; + Standard_Integer i = 0, j = 0, k = 0; Standard_Integer NbIntCur = myCurve->NbIntervals(S); Standard_Integer NbIntSurU = mySurface->NbUIntervals(SforS); Standard_Integer NbIntSurV = mySurface->NbVIntervals(SforS); @@ -1866,7 +1868,7 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const mySurface->UIntervals(CutPntsU, SforS); mySurface->VIntervals(CutPntsV, SforS); - Standard_Real Tl, Tr, Ul, Ur, Vl, Vr, Tol; + Standard_Real Tl = NAN, Tr = NAN, Ul = NAN, Ur = NAN, Vl = NAN, Vr = NAN, Tol = NAN; Handle(TColStd_HArray1OfReal) BArr = NULL, CArr = NULL, @@ -1908,7 +1910,7 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const else if((Ul < CutPntsU(k) && CutPntsU(k) < Ur) || (Ur < CutPntsU(k) && CutPntsU(k) < Ul)) { - Standard_Real V; + Standard_Real V = NAN; V = (mySequence->Value(i)->Value(j).Z() + mySequence->Value(i)->Value(j +1).Z())/2; ProjLib_PrjResolve Solver (*myCurve, *mySurface, 2); @@ -1974,7 +1976,7 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const else if((Vl < CutPntsV(k) && CutPntsV(k) < Vr) || (Vr < CutPntsV(k) && CutPntsV(k) < Vl)) { - Standard_Real U; + Standard_Real U = NAN; U = (mySequence->Value(i)->Value(j).Y() + mySequence->Value(i)->Value(j +1).Y())/2; ProjLib_PrjResolve Solver (*myCurve, *mySurface, 3); @@ -2217,7 +2219,7 @@ void ProjLib_CompProjectedCurve::UpdateTripleByTrapCriteria(gp_Pnt &thePoint) co if (!isProblemsPossible) return; - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; Standard_Boolean isDone = InitialPoint(myCurve->Value(thePoint.X()), thePoint.X(), myCurve, mySurface, Precision::PConfusion(), Precision::PConfusion(), U, V, myMaxDist); @@ -2357,7 +2359,7 @@ void FindSplitPoint(SplitDS &theSplitDS, // Check that is point will be projected to the periodic border. const Extrema_POnSurf &aPOnS = theSplitDS.myExtPS->Point(aMinIdx); - Standard_Real U, V, aProjParam; + Standard_Real U = NAN, V = NAN, aProjParam = NAN; aPOnS.Parameter(U, V); aProjParam = theSplitDS.myPeriodicDir ? V : U; diff --git a/src/ProjLib/ProjLib_CompProjectedCurve.hxx b/src/ProjLib/ProjLib_CompProjectedCurve.hxx index 6b93a8d5f0..39c4a67534 100644 --- a/src/ProjLib/ProjLib_CompProjectedCurve.hxx +++ b/src/ProjLib/ProjLib_CompProjectedCurve.hxx @@ -246,12 +246,12 @@ private: Handle(TColStd_HArray1OfBoolean) mySnglPnts; Handle(TColStd_HArray1OfReal) myMaxDistance; Handle(TColStd_HArray1OfReal) myTabInt; - Standard_Real myTol3d; + Standard_Real myTol3d{}; GeomAbs_Shape myContinuity; - Standard_Integer myMaxDegree; - Standard_Integer myMaxSeg; - Standard_Boolean myProj2d; - Standard_Boolean myProj3d; + Standard_Integer myMaxDegree{}; + Standard_Integer myMaxSeg{}; + Standard_Boolean myProj2d{}; + Standard_Boolean myProj3d{}; Standard_Real myMaxDist; Standard_Real myTolU; Standard_Real myTolV; diff --git a/src/ProjLib/ProjLib_ComputeApprox.cxx b/src/ProjLib/ProjLib_ComputeApprox.cxx index 74cf49ea38..e59e8ff398 100644 --- a/src/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ProjLib/ProjLib_ComputeApprox.cxx @@ -16,6 +16,8 @@ // modified by NIZHNY-OFV Thu Jan 20 11:04:19 2005 +#include + #include #include @@ -157,7 +159,7 @@ static Standard_Boolean Function_D1( const Standard_Real U, const Standard_Boolean VCouture ) { gp_Pnt P3d; - Standard_Real dU, dV; + Standard_Real dU = NAN, dV = NAN; P = Function_Value(U,myCurve,mySurface,U1,U2,V1,V2,UCouture,VCouture); @@ -204,7 +206,7 @@ static Standard_Real Function_ComputeStep( const Standard_Real R) { Standard_Real Step0 = .1; - Standard_Real W1, W2; + Standard_Real W1 = NAN, W2 = NAN; W1 = myCurve->FirstParameter(); W2 = myCurve->LastParameter(); Standard_Real L = GCPnts_AbscissaPoint::Length (*myCurve); @@ -235,7 +237,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, const Handle(Adaptor3d_Curve)& myCurve, const Handle(Adaptor3d_Surface)& mySurface) { - Standard_Real W1, W2, W; + Standard_Real W1 = NAN, W2 = NAN, W = NAN; gp_Pnt P1, P2, P; // W1 = myCurve->FirstParameter(); @@ -278,7 +280,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, case GeomAbs_Parabola: case GeomAbs_Hyperbola: case GeomAbs_Ellipse:{ - Standard_Real U1, U2, V1, V2, U , V; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN, U = NAN , V = NAN; ElSLib::Parameters( Cone, P1, U1, V1); ElSLib::Parameters( Cone, P2, U2, V2); ElSLib::Parameters( Cone, P , U , V ); @@ -295,13 +297,13 @@ static void Function_SetUVBounds(Standard_Real& myU1, } break; default: { - Standard_Real U1, V1, U , V, Delta = 0., d = 0., pmin = W1, pmax = W1, dmax = 0., Uf, Ul; + Standard_Real U1 = NAN, V1 = NAN, U = NAN , V = NAN, Delta = 0., d = 0., pmin = W1, pmax = W1, dmax = 0., Uf = NAN, Ul = NAN; ElSLib::Parameters( Cone, P1, U1, V1); ElSLib::Parameters( Cone, P2, Ul, V1); const gp_Ax1& anAx1 = Cone.Axis(); gp_Lin aLin(anAx1); Standard_Real R = (aLin.Distance(P1) + aLin.Distance(P2) + aLin.Distance(P)) / 3.; - Standard_Real Step; + Standard_Real Step = NAN; myU1 = U1; myU2 = U1; Uf = U1; if (myCurve->GetType() == GeomAbs_Line) { @@ -387,7 +389,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, if (myCurve->GetType() == GeomAbs_Ellipse) { - Standard_Real U1, U2, V1, V2, U , V; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN, U = NAN , V = NAN; ElSLib::Parameters( Cylinder, P1, U1, V1); ElSLib::Parameters( Cylinder, P2, U2, V2); ElSLib::Parameters( Cylinder, P , U , V ); @@ -432,10 +434,10 @@ static void Function_SetUVBounds(Standard_Real& myU1, } } else { - Standard_Real U1, V1, U , V; + Standard_Real U1 = NAN, V1 = NAN, U = NAN , V = NAN; ElSLib::Parameters( Cylinder, P1, U1, V1); Standard_Real R = Cylinder.Radius(); - Standard_Real Delta = 0., Step; + Standard_Real Delta = 0., Step = NAN; Standard_Real eps = M_PI, dmax = 0., d = 0.; Step = Function_ComputeStep(myCurve, R); myU1 = U1; myU2 = U1; @@ -503,8 +505,8 @@ static void Function_SetUVBounds(Standard_Real& myU1, // REM : (1) (2) : equation du cercle // (1) (3) (4) : equation de la couture. Standard_Integer NbSolutions = 0; - Standard_Real A, B, C, D, R, Tol = 1.e-10; - Standard_Real U1, U2, V1, V2; + Standard_Real A = NAN, B = NAN, C = NAN, D = NAN, R = NAN, Tol = 1.e-10; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; gp_Trsf Trsf; // gp_Circ Circle = myCurve->Circle(); @@ -531,7 +533,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, if ( A*D > 0.) NbSolutions = 1; } else if ( delta > 0) { - Standard_Real xx; + Standard_Real xx = NAN; delta = Sqrt(delta); xx = -A*D+delta; // @@ -552,7 +554,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, { //May be U1 must be equal 2*PI? gp_Pnt Pd = myCurve->Value(W1+dt); - Standard_Real ud, vd; + Standard_Real ud = NAN, vd = NAN; ElSLib::Parameters(SP, Pd, ud, vd); if(Abs(U1 - ud) > M_PI) { @@ -563,7 +565,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, { //maybe U1 = 0.? gp_Pnt Pd = myCurve->Value(W1+dt); - Standard_Real ud, vd; + Standard_Real ud = NAN, vd = NAN; ElSLib::Parameters(SP, Pd, ud, vd); if(Abs(U1 - ud) > M_PI) { @@ -576,7 +578,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, { //May be U2 must be equal 2*PI? gp_Pnt Pd = myCurve->Value(W2-dt); - Standard_Real ud, vd; + Standard_Real ud = NAN, vd = NAN; ElSLib::Parameters(SP, Pd, ud, vd); if(Abs(U2 - ud) > M_PI) { @@ -587,7 +589,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, { //maybe U2 = 0.? gp_Pnt Pd = myCurve->Value(W2-dt); - Standard_Real ud, vd; + Standard_Real ud = NAN, vd = NAN; ElSLib::Parameters(SP, Pd, ud, vd); if(Abs(U2 - ud) > M_PI) { @@ -629,7 +631,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, } else { // 0 ou 2 solutions gp_Pnt Center = Circle.Location(); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V); myU1 = U-M_PI; myU2 = U+M_PI; @@ -657,7 +659,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, if ( Abs( Abs(pp.Z()) - R) < Tol) { gp_Pnt Center = Circle.Location(); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V); myU1 = U-M_PI; myU2 = U+M_PI; @@ -684,10 +686,10 @@ static void Function_SetUVBounds(Standard_Real& myU1, }//if ( myCurve->GetType() == GeomAbs_Circle) else { - Standard_Real U1, V1, U , V; + Standard_Real U1 = NAN, V1 = NAN, U = NAN , V = NAN; ElSLib::Parameters( SP, P1, U1, V1); Standard_Real R = SP.Radius(); - Standard_Real Delta = 0., Step; + Standard_Real Delta = 0., Step = NAN; Standard_Real eps = M_PI, dmax = 0., d = 0.; Step = Function_ComputeStep(myCurve, R); myU1 = U1; myU2 = U1; @@ -740,10 +742,10 @@ static void Function_SetUVBounds(Standard_Real& myU1, // case GeomAbs_Torus:{ gp_Torus TR = mySurface->Torus(); - Standard_Real U1, V1, U , V, dU, dV; + Standard_Real U1 = NAN, V1 = NAN, U = NAN , V = NAN, dU = NAN, dV = NAN; ElSLib::Parameters( TR, P1, U1, V1); Standard_Real R = TR.MinorRadius(); - Standard_Real DeltaU = 0., DeltaV = 0., Step; + Standard_Real DeltaU = 0., DeltaV = 0., Step = NAN; Standard_Real eps = M_PI, dmaxU = 0., dmaxV = 0.; Step = Function_ComputeStep(myCurve, R); myU1 = U1; myU2 = U1; @@ -844,8 +846,8 @@ class ProjLib_Function : public AppCont_Function { Handle(Adaptor3d_Curve) myCurve; Handle(Adaptor3d_Surface) mySurface; - Standard_Boolean myIsPeriodic[2]; - Standard_Real myPeriod[2]; + Standard_Boolean myIsPeriodic[2]{}; + Standard_Real myPeriod[2]{}; public : Standard_Real myU1,myU2,myV1,myV2; @@ -881,25 +883,25 @@ class ProjLib_Function : public AppCont_Function void PeriodInformation(const Standard_Integer theDimIdx, Standard_Boolean& IsPeriodic, - Standard_Real& thePeriod) const + Standard_Real& thePeriod) const override { IsPeriodic = myIsPeriodic[theDimIdx - 1]; thePeriod = myPeriod[theDimIdx - 1]; } - Standard_Real FirstParameter() const + Standard_Real FirstParameter() const override { return (myCurve->FirstParameter()); } - Standard_Real LastParameter() const + Standard_Real LastParameter() const override { return (myCurve->LastParameter()); } Standard_Boolean Value(const Standard_Real theT, NCollection_Array1& thePnt2d, - NCollection_Array1& /*thePnt*/) const + NCollection_Array1& /*thePnt*/) const override { thePnt2d(1) = Function_Value(theT, myCurve, mySurface, myU1, myU2, myV1, myV2, UCouture, VCouture); return Standard_True; @@ -912,7 +914,7 @@ class ProjLib_Function : public AppCont_Function Standard_Boolean D1(const Standard_Real theT, NCollection_Array1& theVec2d, - NCollection_Array1& /*theVec*/) const + NCollection_Array1& /*theVec*/) const override { gp_Pnt2d aPnt2d; gp_Vec2d aVec2d; @@ -997,7 +999,7 @@ void ProjLib_ComputeApprox::Perform // if the surface is a plane and the curve a BSpline or a BezierCurve, // don`t make an Approx but only the projection of the poles. - Standard_Integer NbKnots, NbPoles ; + Standard_Integer NbKnots = 0, NbPoles = 0 ; GeomAbs_CurveType CType = C->GetType(); GeomAbs_SurfaceType SType = S->GetType(); @@ -1031,7 +1033,7 @@ void ProjLib_ComputeApprox::Perform if ( BS->IsRational()) BS->Weights(Weights); BS->Poles( P3d); gp_Pln Plane = S->Plane(); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; for ( Standard_Integer i = 1; i <= NbPoles; i++) { ElSLib::Parameters( Plane, P3d(i), U, V); Poles.SetValue(i,gp_Pnt2d(U,V)); @@ -1075,7 +1077,7 @@ void ProjLib_ComputeApprox::Perform // project the 3D-Poles on the plane gp_Pln Plane = S->Plane(); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; for ( Standard_Integer i = 1; i <= NbPoles; i++) { ElSLib::Parameters( Plane, P3d(i), U, V); Poles.SetValue(i,gp_Pnt2d(U,V)); @@ -1118,7 +1120,7 @@ void ProjLib_ComputeApprox::Perform #endif //----------- - Standard_Integer Deg1 = 5, Deg2; + Standard_Integer Deg1 = 5, Deg2 = 0; if (simplecase) { Deg2 = 8; } @@ -1162,13 +1164,13 @@ void ProjLib_ComputeApprox::Perform Standard_Real aNewTol2d = 0; if(Fit.IsAllApproximated()) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer NbCurves = Fit.NbMultiCurves(); // on essaie de rendre la courbe au moins C1 Convert_CompBezierCurves2dToBSplineCurve2d Conv; - Standard_Real Tol3d,Tol2d; + Standard_Real Tol3d = NAN,Tol2d = NAN; for (i = 1; i <= NbCurves; i++) { Fit.Error(i,Tol3d, Tol2d); aNewTol2d = Max(aNewTol2d, Tol2d); @@ -1227,7 +1229,7 @@ void ProjLib_ComputeApprox::Perform else { Standard_Integer NbCurves = Fit.NbMultiCurves(); if(NbCurves != 0) { - Standard_Real Tol3d,Tol2d; + Standard_Real Tol3d = NAN,Tol2d = NAN; Fit.Error(NbCurves,Tol3d, Tol2d); aNewTol2d = Tol2d; } @@ -1285,7 +1287,7 @@ void ProjLib_ComputeApprox::Perform } Standard_Boolean ToMirror = Standard_False; Standard_Real du = 0., dv = 0.; - Standard_Integer number; + Standard_Integer number = 0; if (F.VCouture) { if (SType == GeomAbs_Sphere && Abs(u-F.myU1) > M_PI) @@ -1300,7 +1302,7 @@ void ProjLib_ComputeApprox::Perform } if (F.UCouture || (F.VCouture && SType == GeomAbs_Sphere)) { - Standard_Real aNbPer; + Standard_Real aNbPer = NAN; gp_Pnt2d P2d = F.Value (Umid); du = u - P2d.X(); du = (du < 0) ? (du - Precision::PConfusion()) : diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index 3fe5728fcc..f4e3f23496 100644 --- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -86,7 +88,7 @@ struct aFuncStruct Standard_Real mySqProjOrtTol; // Used to filter non-orthogonal projected point. Standard_Real myTolU; Standard_Real myTolV; - Standard_Real myPeriod[2]; // U and V period correspondingly. + Standard_Real myPeriod[2]{}; // U and V period correspondingly. }; //======================================================================= @@ -103,7 +105,7 @@ static void computePeriodicity(const Handle(Adaptor3d_Surface)& theSurf, // Compute once information about periodicity. // Param space may be reduced in case of rectangular trimmed surface, // in this case really trimmed bounds should be set as unperiodic. - Standard_Real aTrimF, aTrimL, aBaseF, aBaseL, aDummyF, aDummyL; + Standard_Real aTrimF = NAN, aTrimL = NAN, aBaseF = NAN, aBaseL = NAN, aDummyF = NAN, aDummyL = NAN; Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface (*theSurf, Standard_False); // Not trim. // U param space. if (theSurf->IsUPeriodic()) @@ -191,7 +193,7 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, gp_Pnt aSurfPnt = theData.mySurf->Value(p2d.X(), p2d.Y()); Standard_Real aSurfPntDist = aSurfPnt.SquareDistance(p); - Standard_Real Uinf, Usup, Vinf, Vsup; + Standard_Real Uinf = NAN, Usup = NAN, Vinf = NAN, Vsup = NAN; Uinf = theData.mySurf->FirstUParameter(); Usup = theData.mySurf->LastUParameter(); Vinf = theData.mySurf->FirstVParameter(); @@ -289,7 +291,7 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, Standard_Real Dist2Min = RealLast(); Standard_Real uperiod = theData.myPeriod[0], vperiod = theData.myPeriod[1], - u, v; + u = NAN, v = NAN; // U0 and V0 are the points within the initialized period. if(U0 < Uinf) @@ -435,14 +437,14 @@ class ProjLib_PolarFunction : public AppCont_Function myStruct.myTolV = Surf->VResolution(Tol3d); } - ~ProjLib_PolarFunction() {} + ~ProjLib_PolarFunction() override {} - Standard_Real FirstParameter() const + Standard_Real FirstParameter() const override { return myStruct.myCurve->FirstParameter(); } - Standard_Real LastParameter() const + Standard_Real LastParameter() const override { return myStruct.myCurve->LastParameter(); } @@ -454,7 +456,7 @@ class ProjLib_PolarFunction : public AppCont_Function Standard_Boolean Value(const Standard_Real theT, NCollection_Array1& thePnt2d, - NCollection_Array1& /*thePnt*/) const + NCollection_Array1& /*thePnt*/) const override { thePnt2d(1) = Function_Value(theT, myStruct); return Standard_True; @@ -462,7 +464,7 @@ class ProjLib_PolarFunction : public AppCont_Function Standard_Boolean D1(const Standard_Real /*theT*/, NCollection_Array1& /*theVec2d*/, - NCollection_Array1& /*theVec*/) const + NCollection_Array1& /*theVec*/) const override {return Standard_False;} }; @@ -557,7 +559,7 @@ ProjLib_ComputeApproxOnPolarSurface::ProjLib_ComputeApproxOnPolarSurface P2d = theInitialCurve2d->Value(theInitialCurve2d->FirstParameter()); P2dBis = theInitialCurve2dBis->Value(theInitialCurve2dBis->FirstParameter()); - Standard_Real Dist, DistBis; + Standard_Real Dist = NAN, DistBis = NAN; Dist = P2dproj.Distance(P2d); DistBis = P2dproj.Distance(P2dBis); if( Dist < DistBis) { @@ -585,7 +587,7 @@ static Handle(Geom2d_BSplineCurve) Concat(Handle(Geom2d_BSplineCurve) C1, Standard_Real theUJump, Standard_Real theVJump) { - Standard_Integer deg, deg1, deg2; + Standard_Integer deg = 0, deg1 = 0, deg2 = 0; deg1 = C1->Degree(); deg2 = C2->Degree(); @@ -599,7 +601,7 @@ static Handle(Geom2d_BSplineCurve) Concat(Handle(Geom2d_BSplineCurve) C1, } else deg = deg1; - Standard_Integer np1,np2,nk1,nk2,np,nk; + Standard_Integer np1 = 0,np2 = 0,nk1 = 0,nk2 = 0,np = 0,nk = 0; np1 = C1->NbPoles(); nk1 = C1->NbKnots(); np2 = C2->NbPoles(); @@ -619,7 +621,7 @@ static Handle(Geom2d_BSplineCurve) Concat(Handle(Geom2d_BSplineCurve) C1, TColStd_Array1OfInteger M(1,nk); TColgp_Array1OfPnt2d P(1,np); - Standard_Integer i, count = 0; + Standard_Integer i = 0, count = 0; // Set Knots and Mults for ( i = 1; i <= nk1; i++) { count++; @@ -686,7 +688,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform Handle(Geom_BSplineCurve) BSC = Curve->BSpline(); Standard_Integer nbInter = Curve->NbIntervals(GeomAbs_C1); if(nbInter > 1) { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Handle(Geom_TrimmedCurve) GTC; Handle(Geom2d_TrimmedCurve) G2dTC; TColStd_Array1OfReal Inter(1,nbInter+1); @@ -702,8 +704,8 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform // - or this is a curve C1 and the sections of interest are taken otherwise the curve is created. // initialization 2d - Standard_Integer nbInter2d; - Standard_Boolean C2dIsToCompute; + Standard_Integer nbInter2d = 0; + Standard_Boolean C2dIsToCompute = 0; C2dIsToCompute = InitialCurve2d.IsNull(); Handle(Geom2d_BSplineCurve) BSC2d; Handle(Geom2d_Curve) G2dC; @@ -847,7 +849,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform } } - Standard_Real anUPeriod, anVPeriod; + Standard_Real anUPeriod = NAN, anVPeriod = NAN; computePeriodicity(S, anUPeriod, anVPeriod); Standard_Integer NbC = LOfBSpline2d.Extent(); Handle(Geom2d_BSplineCurve) CurBS; @@ -928,7 +930,7 @@ Handle(Adaptor2d_Curve2d) NbOfPnts = QUA.NbPoints(); TColgp_Array1OfPnt Pts(1,NbOfPnts); TColStd_Array1OfReal Param(1,NbOfPnts); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for( i = 1; i <= NbOfPnts ; i++ ) { Param(i) = QUA.Parameter(i); Pts(i) = Curve->Value(Param(i)); @@ -939,7 +941,7 @@ Handle(Adaptor2d_Curve2d) Mult.Init(1); Mult(1) = Mult(NbOfPnts) = 2; - Standard_Real Uinf, Usup, Vinf, Vsup; + Standard_Real Uinf = NAN, Usup = NAN, Vinf = NAN, Vsup = NAN; Uinf = Surf->FirstUParameter(); Usup = Surf->LastUParameter(); Vinf = Surf->FirstVParameter(); @@ -947,7 +949,7 @@ Handle(Adaptor2d_Curve2d) GeomAbs_SurfaceType Type = Surf->GetType(); if((Type != GeomAbs_BSplineSurface) && (Type != GeomAbs_BezierSurface) && (Type != GeomAbs_OffsetSurface)) { - Standard_Real S, T; + Standard_Real S = NAN, T = NAN; // Standard_Integer usens = 0, vsens = 0; // to know the position relatively to the period switch (Type) { @@ -964,7 +966,7 @@ Handle(Adaptor2d_Curve2d) case GeomAbs_Cylinder: { // Standard_Real Sloc, Tloc; - Standard_Real Sloc; + Standard_Real Sloc = NAN; Standard_Integer usens = 0; gp_Cylinder Cylinder = Surf->Cylinder(); ElSLib::Parameters( Cylinder, Pts(1), S, T); @@ -986,7 +988,7 @@ Handle(Adaptor2d_Curve2d) case GeomAbs_Cone: { // Standard_Real Sloc, Tloc; - Standard_Real Sloc; + Standard_Real Sloc = NAN; Standard_Integer usens = 0; gp_Cone Cone = Surf->Cone(); ElSLib::Parameters( Cone, Pts(1), S, T); @@ -1007,7 +1009,7 @@ Handle(Adaptor2d_Curve2d) } case GeomAbs_Sphere: { - Standard_Real Sloc, Tloc; + Standard_Real Sloc = NAN, Tloc = NAN; Standard_Integer usens = 0, vsens = 0; //usens steps by half-period Standard_Boolean vparit = Standard_False; gp_Sphere Sphere = Surf->Sphere(); @@ -1046,7 +1048,7 @@ Handle(Adaptor2d_Curve2d) } case GeomAbs_Torus: { - Standard_Real Sloc, Tloc; + Standard_Real Sloc = NAN, Tloc = NAN; Standard_Integer usens = 0, vsens = 0; gp_Torus Torus = Surf->Torus(); ElSLib::Parameters( Torus, Pts(1), S, T); @@ -1301,7 +1303,7 @@ Handle(Adaptor2d_Curve2d) { myDist = LocalMinSqDist; } - Standard_Real LocalU, LocalV; + Standard_Real LocalU = NAN, LocalV = NAN; aGlobalExtr.Point(imin).Parameter(LocalU, LocalV); if (uperiod > 0. && Abs(U0 - LocalU) >= uperiod/2.) { @@ -1359,7 +1361,7 @@ Handle(Adaptor2d_Curve2d) } } if(!myProjIsDone && uperiod) { - Standard_Real aUinf, aUsup, Uaux; + Standard_Real aUinf = NAN, aUsup = NAN, Uaux = NAN; aUinf = Surf->FirstUParameter(); aUsup = Surf->LastUParameter(); if((aUsup - U0) > (U0 - aUinf)) @@ -1390,7 +1392,7 @@ Handle(Adaptor2d_Curve2d) } } if(!myProjIsDone && vperiod) { - Standard_Real aVinf, aVsup, Vaux; + Standard_Real aVinf = NAN, aVsup = NAN, Vaux = NAN; aVinf = Surf->FirstVParameter(); aVsup = Surf->LastVParameter(); if((aVsup - V0) > (V0 - aVinf)) @@ -1421,7 +1423,7 @@ Handle(Adaptor2d_Curve2d) } } if(!myProjIsDone && uperiod && vperiod) { - Standard_Real Uaux, Vaux; + Standard_Real Uaux = NAN, Vaux = NAN; if((Usup - U0) > (U0 - Uinf)) Uaux = 2*Uinf - U0 + uperiod; else @@ -1577,11 +1579,11 @@ Handle(Geom2d_BSplineCurve) Standard_Real TolU = Surf->UResolution(Tol3d), TolV = Surf->VResolution(Tol3d); Standard_Real Tol2d = Max(Sqrt(TolU*TolU + TolV*TolV), Precision::PConfusion()); - Standard_Integer i; + Standard_Integer i = 0; GeomAbs_SurfaceType TheTypeS = Surf->GetType(); GeomAbs_CurveType TheTypeC = Curve->GetType(); if(TheTypeS == GeomAbs_Plane) { - Standard_Real S, T; + Standard_Real S = NAN, T = NAN; gp_Pln Plane = Surf->Plane(); if(TheTypeC == GeomAbs_BSplineCurve) { myTolReached = Precision::Confusion(); @@ -1641,7 +1643,7 @@ Handle(Geom2d_BSplineCurve) gp_Vec V2(p21,p22); if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/M_PI))){ Standard_Integer Dist2Min = IntegerLast(); - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; if(TheTypeC == GeomAbs_BSplineCurve) { myTolReached = Tol3d; Handle(Geom_BSplineCurve) BSC = Curve->BSpline(); @@ -1739,7 +1741,7 @@ Handle(Geom2d_BSplineCurve) gp_Vec V2(p21,p22); if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/M_PI))){ Standard_Integer Dist2Min = IntegerLast(); - Standard_Real u,v; + Standard_Real u = NAN,v = NAN; // gp_Pnt pntproj; if(TheTypeC == GeomAbs_BSplineCurve) { @@ -1865,7 +1867,7 @@ Handle(Geom2d_BSplineCurve) // DrawTrSurf::Set((Standard_CString ) "initc2d",DDD->ChangeCurve2d().Curve()); #endif - Standard_Integer Deg1,Deg2; + Standard_Integer Deg1 = 0,Deg2 = 0; Deg1 = 2; Deg2 = 8; if(myDegMin > 0) @@ -1905,7 +1907,7 @@ Handle(Geom2d_BSplineCurve) Standard_Real anOldTol2d = Tol2d; Standard_Real aNewTol2d = 0; if(Fit.IsAllApproximated()) { - Standard_Integer j; + Standard_Integer j = 0; Standard_Integer NbCurves = Fit.NbMultiCurves(); Standard_Integer MaxDeg = 0; // To transform the MultiCurve into BSpline, it is required that all diff --git a/src/ProjLib/ProjLib_Cone.cxx b/src/ProjLib/ProjLib_Cone.cxx index 1c84d1a818..c63590d232 100644 --- a/src/ProjLib/ProjLib_Cone.cxx +++ b/src/ProjLib/ProjLib_Cone.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -94,7 +96,7 @@ void ProjLib_Cone::Project(const gp_Lin& L) Standard_Real aDeltaV = 0.0; - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; if (aPnt.IsEqual(anApex, Precision::Confusion())) { //Take another point in the line L, which does not coincide with the cone apex. @@ -148,7 +150,7 @@ void ProjLib_Cone::Project(const gp_Circ& C) gp_Dir ZCone = ConePos.XDirection().Crossed(ConePos.YDirection()); gp_Dir ZCir = CircPos.XDirection().Crossed(CircPos.YDirection()); - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; Standard_Real x = ConePos.XDirection().Dot(CircPos.XDirection()); Standard_Real y = ConePos.YDirection().Dot(CircPos.XDirection()); Standard_Real z diff --git a/src/ProjLib/ProjLib_Cylinder.cxx b/src/ProjLib/ProjLib_Cylinder.cxx index efb9a3a697..9681cac004 100644 --- a/src/ProjLib/ProjLib_Cylinder.cxx +++ b/src/ProjLib/ProjLib_Cylinder.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -107,7 +109,7 @@ static gp_Pnt2d EvalPnt2d( const gp_Pnt& P, const gp_Cylinder& Cy ) Standard_Real X = OP.Dot(gp_Vec(Cy.Position().XDirection())); Standard_Real Y = OP.Dot(gp_Vec(Cy.Position().YDirection())); Standard_Real Z = OP.Dot(gp_Vec(Cy.Position().Direction())); - Standard_Real U ; + Standard_Real U = NAN ; if ( Abs(X) > Precision::PConfusion() || Abs(Y) > Precision::PConfusion() ) { diff --git a/src/ProjLib/ProjLib_PrjFunc.cxx b/src/ProjLib/ProjLib_PrjFunc.cxx index 7daac35f73..dd8114c677 100644 --- a/src/ProjLib/ProjLib_PrjFunc.cxx +++ b/src/ProjLib/ProjLib_PrjFunc.cxx @@ -24,9 +24,9 @@ #include ProjLib_PrjFunc::ProjLib_PrjFunc (const Adaptor3d_Curve* C, const Standard_Real FixVal, const Adaptor3d_Surface* S, const Standard_Integer Fix) -: myCurve(C), mySurface(S), myt(0), myU(0), myV(0), myFix(Fix) +: myCurve(C), mySurface(S), myt(0), myU(0), myV(0), myFix(Fix), myNorm(Min(1.,Min(mySurface->UResolution(1.),mySurface->VResolution(1.)))) { - myNorm=Min(1.,Min(mySurface->UResolution(1.),mySurface->VResolution(1.))); + // myNorm=1.; switch(myFix) { case 1: myt = FixVal; break; diff --git a/src/ProjLib/ProjLib_PrjResolve.cxx b/src/ProjLib/ProjLib_PrjResolve.cxx index 26e133be41..6499d93326 100644 --- a/src/ProjLib/ProjLib_PrjResolve.cxx +++ b/src/ProjLib/ProjLib_PrjResolve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -96,7 +98,7 @@ ProjLib_PrjResolve::ProjLib_PrjResolve(const Adaptor3d_Curve& C,const Adaptor3d_ // computation of myDone myDone = Standard_True; - Standard_Real ExtraU , ExtraV; + Standard_Real ExtraU = NAN , ExtraV = NAN; // if(!StrictInside) { ExtraU = 2. * Tol2d.X(); ExtraV = 2. * Tol2d.Y(); diff --git a/src/ProjLib/ProjLib_ProjectOnPlane.cxx b/src/ProjLib/ProjLib_ProjectOnPlane.cxx index 036c1a9c5c..96a7e65a83 100644 --- a/src/ProjLib/ProjLib_ProjectOnPlane.cxx +++ b/src/ProjLib/ProjLib_ProjectOnPlane.cxx @@ -16,6 +16,8 @@ // 09-Aug-95 : xab : changed the ProjLib_ProjectOnPlane in the case // of the line and the parameteriation is kept +#include + #include #include #include @@ -110,7 +112,7 @@ static Standard_Boolean OnPlane_D1(const Standard_Real U, const gp_Ax3& Pl, const gp_Dir& D) { - Standard_Real Alpha; + Standard_Real Alpha = NAN; gp_Pnt Point; gp_Vec Vector; @@ -152,7 +154,7 @@ static Standard_Boolean OnPlane_D2(const Standard_Real U, const gp_Ax3& Pl, const gp_Dir& D) { - Standard_Real Alpha; + Standard_Real Alpha = NAN; gp_Pnt Point; gp_Vec Vector1, Vector2; @@ -200,7 +202,7 @@ static Standard_Boolean OnPlane_D3(const Standard_Real U, const gp_Ax3& Pl, const gp_Dir& D) { - Standard_Real Alpha; + Standard_Real Alpha = NAN; gp_Pnt Point; gp_Vec Vector1, Vector2, @@ -264,19 +266,19 @@ public: myNbPnt2d = 0; } - Standard_Real FirstParameter() const + Standard_Real FirstParameter() const override { return myCurve->FirstParameter(); } - Standard_Real LastParameter() const + Standard_Real LastParameter() const override { return myCurve->LastParameter(); } Standard_Boolean Value(const Standard_Real theT, NCollection_Array1& /*thePnt2d*/, - NCollection_Array1& thePnt) const + NCollection_Array1& thePnt) const override { thePnt(1) = OnPlane_Value(theT, myCurve, myPlane, myDirection); return Standard_True; @@ -284,7 +286,7 @@ public: Standard_Boolean D1(const Standard_Real theT, NCollection_Array1& /*theVec2d*/, - NCollection_Array1& theVec) const + NCollection_Array1& theVec) const override { gp_Pnt aDummyPnt; return OnPlane_D1(theT, aDummyPnt, theVec(1), myCurve, myPlane, myDirection); @@ -309,7 +311,7 @@ public: { } - virtual Standard_Boolean Value(const Standard_Real X, Standard_Real& F) + Standard_Boolean Value(const Standard_Real X, Standard_Real& F) override { myProps->SetParameter(X); F = -myProps->Curvature(); @@ -346,7 +348,7 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, { ProjLib_OnPlane F(C, Pl, D); - Standard_Integer Deg1, Deg2; + Standard_Integer Deg1 = 0, Deg2 = 0; Deg1 = 8; Deg2 = 8; if (C->GetType() == GeomAbs_Parabola) { @@ -367,7 +369,7 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, { return; } - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer NbCurves = Fit.NbMultiCurves(); Standard_Integer MaxDeg = 0; @@ -387,7 +389,7 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, TColStd_Array1OfReal Knots(1, NbCurves + 1); //Noeuds de la BSpline Standard_Integer Compt = 1; - Standard_Real anErrMax = 0., anErr3d, anErr2d; + Standard_Real anErrMax = 0., anErr3d = NAN, anErr2d = NAN; for (i = 1; i <= Fit.NbMultiCurves(); i++) { Fit.Parameters(i, Knots(i), Knots(i + 1)); Fit.Error(i, anErr3d, anErr2d); @@ -595,7 +597,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, gp_Elips Elips; // gp_Hypr Hypr ; - Standard_Integer num_knots; + Standard_Integer num_knots = 0; GeomAbs_CurveType Type = C->GetType(); gp_Ax2 Axis; @@ -648,7 +650,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, myType = GeomAbs_Line; gp_Pnt P = ProjectPnt(myPlane, myDirection, L.Location()); aLine = gp_Lin(P, gp_Dir(Xc)); - Standard_Real Udeb, Ufin; + Standard_Real Udeb = NAN, Ufin = NAN; // eval the first and last parameters of the projected curve Udeb = myCurve->FirstParameter(); @@ -1620,7 +1622,7 @@ Standard_Boolean ProjLib_ProjectOnPlane::BuildParabolaByApex(Handle(Geom_Curve)& return Standard_False; } - Standard_Real aT; + Standard_Real aT = NAN; aT = aSolver.Location(); aProps.SetParameter(aT); gp_Pnt aP0 = aProps.Value(); @@ -1678,7 +1680,7 @@ Standard_Boolean ProjLib_ProjectOnPlane::BuildHyperbolaByApex(Handle(Geom_Curve) if (aSolver.IsDone()) { - Standard_Real aT; + Standard_Real aT = NAN; aT = aSolver.Location(); aProps.SetParameter(aT); Standard_Real aCurv = aProps.Curvature(); diff --git a/src/ProjLib/ProjLib_ProjectOnSurface.cxx b/src/ProjLib/ProjLib_ProjectOnSurface.cxx index de4cf1f20a..05e2432ea0 100644 --- a/src/ProjLib/ProjLib_ProjectOnSurface.cxx +++ b/src/ProjLib/ProjLib_ProjectOnSurface.cxx @@ -95,17 +95,17 @@ public: myExtPS = new Extrema_ExtPS (P, *S, Tol, Tol); } - ~ProjLib_OnSurface() { delete myExtPS; } + ~ProjLib_OnSurface() override { delete myExtPS; } - Standard_Real FirstParameter() const + Standard_Real FirstParameter() const override {return myCurve->FirstParameter();} - Standard_Real LastParameter() const + Standard_Real LastParameter() const override {return myCurve->LastParameter();} Standard_Boolean Value(const Standard_Real theT, NCollection_Array1& /*thePnt2d*/, - NCollection_Array1& thePnt) const + NCollection_Array1& thePnt) const override { thePnt(1) = OnSurface_Value(theT, myCurve, myExtPS); return Standard_True; @@ -113,7 +113,7 @@ public: Standard_Boolean D1(const Standard_Real theT, NCollection_Array1& /*theVec2d*/, - NCollection_Array1& theVec) const + NCollection_Array1& theVec) const override { gp_Pnt aPnt; return OnSurface_D1(theT, aPnt, theVec(1), myCurve, myExtPS); @@ -155,10 +155,10 @@ myIsDone(Standard_False) //======================================================================= ProjLib_ProjectOnSurface::ProjLib_ProjectOnSurface (const Handle(Adaptor3d_Surface)& S ) : -myTolerance(0.0), +mySurface(S), myTolerance(0.0), myIsDone(Standard_False) { - mySurface = S; + } //======================================================================= @@ -185,12 +185,12 @@ void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_Curve)& C, ProjLib_OnSurface F(myCurve, mySurface); - Standard_Integer Deg1, Deg2; + Standard_Integer Deg1 = 0, Deg2 = 0; Deg1 = 8; Deg2 = 8; Approx_FitAndDivide Fit(F,Deg1,Deg2,Precision::Approximation(), Precision::PApproximation(),Standard_True); - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer NbCurves = Fit.NbMultiCurves(); Standard_Integer MaxDeg = 0; diff --git a/src/ProjLib/ProjLib_ProjectedCurve.cxx b/src/ProjLib/ProjLib_ProjectedCurve.cxx index f31bc78d57..6568b19206 100644 --- a/src/ProjLib/ProjLib_ProjectedCurve.cxx +++ b/src/ProjLib/ProjLib_ProjectedCurve.cxx @@ -16,6 +16,8 @@ // Modified by skv - Wed Aug 11 15:45:58 2004 OCC6272 +#include + #include #include #include @@ -94,7 +96,7 @@ static Standard_Boolean IsoIsDeg (const Adaptor3d_Surface& S, const Standard_Real TolMin, const Standard_Real TolMax) { - Standard_Real U1=0.,U2=0.,V1=0.,V2=0.,T; + Standard_Real U1=0.,U2=0.,V1=0.,V2=0.,T = NAN; Standard_Boolean Along = Standard_True; U1 = S.FirstUParameter(); U2 = S.LastUParameter(); @@ -102,7 +104,7 @@ static Standard_Boolean IsoIsDeg (const Adaptor3d_Surface& S, V2 = S.LastVParameter(); gp_Vec D1U,D1V; gp_Pnt P; - Standard_Real Step,D1NormMax; + Standard_Real Step = NAN,D1NormMax = NAN; if (IT == GeomAbs_IsoV) { Step = (U2 - U1)/10; @@ -507,7 +509,7 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C) case GeomAbs_BSplineSurface: { isAnalyticalSurf = Standard_False; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; f = myCurve->FirstParameter(); l = myCurve->LastParameter(); dt = (l - f) * eps; @@ -716,7 +718,7 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C) if(IsTrimmed[0] || IsTrimmed[1]) { // Treatment only for surface of revolution - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; u1 = mySurface->FirstUParameter(); u2 = mySurface->LastUParameter(); v1 = mySurface->FirstVParameter(); diff --git a/src/ProjLib/ProjLib_Projector.cxx b/src/ProjLib/ProjLib_Projector.cxx index 943b271e95..18f919ad4a 100644 --- a/src/ProjLib/ProjLib_Projector.cxx +++ b/src/ProjLib/ProjLib_Projector.cxx @@ -34,10 +34,10 @@ //purpose : //======================================================================= ProjLib_Projector::ProjLib_Projector() -: myIsPeriodic(Standard_False) +: myType(GeomAbs_BSplineCurve), myIsPeriodic(Standard_False), isDone(Standard_False) { - isDone = Standard_False; - myType = GeomAbs_BSplineCurve; + + } diff --git a/src/ProjLib/ProjLib_Sphere.cxx b/src/ProjLib/ProjLib_Sphere.cxx index ba04e89af5..75ac58d6f2 100644 --- a/src/ProjLib/ProjLib_Sphere.cxx +++ b/src/ProjLib/ProjLib_Sphere.cxx @@ -16,6 +16,8 @@ // Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 +#include + #include #include #include @@ -95,7 +97,7 @@ static gp_Pnt2d EvalPnt2d(const gp_Vec& P, Standard_Real X = P.Dot(gp_Vec(Sp.Position().XDirection())); Standard_Real Y = P.Dot(gp_Vec(Sp.Position().YDirection())); Standard_Real Z = P.Dot(gp_Vec(Sp.Position().Direction())); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; if ( Abs(X) > Precision::PConfusion() || Abs(Y) > Precision::PConfusion() ) { @@ -139,7 +141,7 @@ void ProjLib_Sphere::Project(const gp_Circ& C) Ys = mySphere.Position().YDirection(); Zs = mySphere.Position().Direction(); - Standard_Boolean isIsoU, isIsoV; + Standard_Boolean isIsoU = 0, isIsoV = 0; Standard_Real Tol = Precision::Confusion(); isIsoU = Zc.IsNormal(Zs,Tol) && O.IsEqual(C.Location(),Tol); @@ -225,7 +227,7 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U) StdFail_NotDone_Raise_if( !isDone, "ProjLib_Sphere:SetInBounds"); // first set the y of the first point in -pi/2 pi/2 - Standard_Real newY, Y = ElCLib::Value(U,myLin).Y(); + Standard_Real newY = NAN, Y = ElCLib::Value(U,myLin).Y(); newY = ElCLib::InPeriod( Y, -M_PI, M_PI); myLin.Translate(gp_Vec2d(0.,newY-Y)); @@ -258,7 +260,7 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U) myLin.Translate(gp_Vec2d(M_PI,0.)); // il faut maintenant recadrer en U - Standard_Real newX, X = ElCLib::Value(U,myLin).X(); + Standard_Real newX = NAN, X = ElCLib::Value(U,myLin).X(); newX = ElCLib::InPeriod( X, 0., 2.*M_PI); myLin.Translate(gp_Vec2d(newX-X,0.)); } diff --git a/src/ProjLib/ProjLib_Torus.cxx b/src/ProjLib/ProjLib_Torus.cxx index 85e5be3fbc..94f46677bd 100644 --- a/src/ProjLib/ProjLib_Torus.cxx +++ b/src/ProjLib/ProjLib_Torus.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -88,7 +90,7 @@ static gp_Pnt2d EvalPnt2d( const gp_Vec& Ve, const gp_Torus& To) { Standard_Real X = Ve.Dot(gp_Vec(To.Position().XDirection())); Standard_Real Y = Ve.Dot(gp_Vec(To.Position().YDirection())); - Standard_Real U,V; + Standard_Real U = NAN,V = NAN; if ( Abs(X) > Precision::PConfusion() || Abs(Y) > Precision::PConfusion() ) { @@ -133,7 +135,7 @@ void ProjLib_Torus::Project(const gp_Circ& C) Standard_Real Z = OC.Dot(myTorus.Position().Direction()); Z /= myTorus.MinorRadius(); - Standard_Real V; + Standard_Real V = NAN; if ( Z > 1.) { V = M_PI/2.; // protection stupide diff --git a/src/Prs3d/Prs3d.cxx b/src/Prs3d/Prs3d.cxx index d282190260..6b63a8eb8c 100644 --- a/src/Prs3d/Prs3d.cxx +++ b/src/Prs3d/Prs3d.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -103,7 +105,7 @@ Standard_Boolean Prs3d::MatchSegment const gp_Pnt& P2, Standard_Real& dist) { - Standard_Real X1,Y1,Z1,X2,Y2,Z2; + Standard_Real X1 = NAN,Y1 = NAN,Z1 = NAN,X2 = NAN,Y2 = NAN,Z2 = NAN; P1.Coord(X1,Y1,Z1); P2.Coord(X2,Y2,Z2); Standard_Real DX = X2-X1; Standard_Real DY = Y2-Y1; diff --git a/src/Prs3d/Prs3d_ArrowAspect.hxx b/src/Prs3d/Prs3d_ArrowAspect.hxx index e652596b0d..bf03f219ab 100644 --- a/src/Prs3d/Prs3d_ArrowAspect.hxx +++ b/src/Prs3d/Prs3d_ArrowAspect.hxx @@ -71,7 +71,7 @@ protected: Handle(Graphic3d_AspectLine3d) myArrowAspect; Standard_Real myAngle; Standard_Real myLength; - Standard_Boolean myIsZoomable; + Standard_Boolean myIsZoomable{}; }; diff --git a/src/Prs3d/Prs3d_DatumAspect.cxx b/src/Prs3d/Prs3d_DatumAspect.cxx index 01c9f5e90a..99c28d6cf0 100644 --- a/src/Prs3d/Prs3d_DatumAspect.cxx +++ b/src/Prs3d/Prs3d_DatumAspect.cxx @@ -23,7 +23,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect) // purpose : // ======================================================================= Prs3d_DatumAspect::Prs3d_DatumAspect() -: myAxes (Prs3d_DatumAxes_XYZAxes), +: myArrowAspect(new Prs3d_ArrowAspect()), myAxes (Prs3d_DatumAxes_XYZAxes), myToDrawLabels (Standard_True), myToDrawArrows (Standard_True) { @@ -40,7 +40,7 @@ Prs3d_DatumAspect::Prs3d_DatumAspect() myAttributes[Prs3d_DatumAttribute_ShadingNumberOfFacettes] = 12.0; myPointAspect = new Prs3d_PointAspect (Aspect_TOM_EMPTY, aDefaultColor, 1.0); - myArrowAspect = new Prs3d_ArrowAspect(); + for (int aPartIter = Prs3d_DatumParts_Origin; aPartIter <= Prs3d_DatumParts_XOZAxis; ++aPartIter) { const Prs3d_DatumParts aPart = (Prs3d_DatumParts )aPartIter; diff --git a/src/Prs3d/Prs3d_DatumAspect.hxx b/src/Prs3d/Prs3d_DatumAspect.hxx index 9ef2af7dce..4a7cedeb66 100644 --- a/src/Prs3d/Prs3d_DatumAspect.hxx +++ b/src/Prs3d/Prs3d_DatumAspect.hxx @@ -127,7 +127,7 @@ protected: Handle(Prs3d_TextAspect) myTextAspects[Prs3d_DatumParts_NB]; Handle(Prs3d_PointAspect) myPointAspect; Handle(Prs3d_ArrowAspect) myArrowAspect; - Standard_Real myAttributes[Prs3d_DatumAttribute_NB]; + Standard_Real myAttributes[Prs3d_DatumAttribute_NB]{}; Prs3d_DatumAxes myAxes; Standard_Boolean myToDrawLabels; Standard_Boolean myToDrawArrows; diff --git a/src/Prs3d/Prs3d_Drawer.hxx b/src/Prs3d/Prs3d_Drawer.hxx index 38c85647b9..14a4bc7d09 100644 --- a/src/Prs3d/Prs3d_Drawer.hxx +++ b/src/Prs3d/Prs3d_Drawer.hxx @@ -966,9 +966,9 @@ protected: Standard_Boolean myHasOwnTypeOfDeflection; Prs3d_TypeOfHLR myTypeOfHLR; Standard_Real myDeviationCoefficient; - Standard_Real myPreviousDeviationCoefficient; + Standard_Real myPreviousDeviationCoefficient{}; Standard_Real myDeviationAngle; - Standard_Real myPreviousDeviationAngle; + Standard_Real myPreviousDeviationAngle{}; Standard_Boolean myIsoOnPlane; Standard_Boolean myHasOwnIsoOnPlane; Standard_Boolean myIsoOnTriangulation; diff --git a/src/PrsDim/PrsDim.cxx b/src/PrsDim/PrsDim.cxx index b103684ade..93e745b1c6 100644 --- a/src/PrsDim/PrsDim.cxx +++ b/src/PrsDim/PrsDim.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -82,7 +84,7 @@ const Standard_Real SquareTolerance = Precision::SquareConfusion(); gp_Pnt PrsDim::Nearest(const TopoDS_Shape& ashape, const gp_Pnt& apoint) { Standard_Real dist2 = RealLast(); - Standard_Real curdist2; + Standard_Real curdist2 = NAN; gp_Pnt result(0.0,0.0,0.0); gp_Pnt curpnt(0.0,0.0,0.0); TopExp_Explorer explo(ashape,TopAbs_VERTEX); @@ -143,7 +145,7 @@ Standard_Boolean PrsDim::Nearest (const Handle(Geom_Curve)& theCurve, //======================================================================= gp_Pnt PrsDim::Farest( const TopoDS_Shape& aShape, const gp_Pnt& aPoint ) { - Standard_Real MaxDist2 = 0.0e0, curdist2; + Standard_Real MaxDist2 = 0.0e0, curdist2 = NAN; gp_Pnt Result(0.0,0.0,0.0); gp_Pnt curpnt(0.0,0.0,0.0); TopExp_Explorer Explo( aShape, TopAbs_VERTEX ); @@ -171,7 +173,7 @@ Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theEdge, gp_Pnt& theLastPnt) { TopLoc_Location anEdgeLoc; - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; theCurve = BRep_Tool::Curve (theEdge, anEdgeLoc, aFirst, aLast); if (theCurve.IsNull()) { @@ -363,7 +365,7 @@ Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theFirstEdge, } TopLoc_Location aFirstEdgeLoc, aSecondEdgeLoc; - Standard_Real aFirst1, aLast1, aFirst2, aLast2; + Standard_Real aFirst1 = NAN, aLast1 = NAN, aFirst2 = NAN, aLast2 = NAN; theFirstCurve = BRep_Tool::Curve (theFirstEdge, aFirstEdgeLoc, aFirst1, aLast1); theSecondCurve = BRep_Tool::Curve (theSecondEdge, aSecondEdgeLoc, aFirst2, aLast2); @@ -542,7 +544,7 @@ Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theFirstEdge, theExtCurve.Nullify(); theExtIndex = 0; - Standard_Real aFirst1, aLast1, aFirst2, aLast2; + Standard_Real aFirst1 = NAN, aLast1 = NAN, aFirst2 = NAN, aLast2 = NAN; theIsInfinite1 = theIsInfinite2 = Standard_False; BRepAdaptor_Curve aFirstAdaptor (theFirstEdge); @@ -577,7 +579,7 @@ Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theFirstEdge, Handle(Geom_Curve) aSecondSaved = theSecondCurve; // Checks that the projected curve is not in the plane - Standard_Boolean isFirstOnPlane, isSecondOnPlane; + Standard_Boolean isFirstOnPlane = 0, isSecondOnPlane = 0; if ((!ComputeGeomCurve (theFirstCurve, aFirst1, aLast1, theFirstPnt1, theLastPnt1, thePlane, isFirstOnPlane)) || (!ComputeGeomCurve( theSecondCurve, aFirst2, aLast2, theFirstPnt2, theLastPnt2, thePlane,isSecondOnPlane))) @@ -895,7 +897,7 @@ Standard_Boolean PrsDim::InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirs } // Get intersect line. - Handle(Geom_Curve) anIntersectCurve = aPlaneIntersector.Line (1); + const Handle(Geom_Curve)& anIntersectCurve = aPlaneIntersector.Line (1); Handle(Geom_Line) anIntersectLine = Handle(Geom_Line)::DownCast (anIntersectCurve); @@ -907,8 +909,8 @@ Standard_Boolean PrsDim::InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirs gp_Lin anIntersectLin = anIntersectLine->Lin(); gp_Pnt aFirstCenter, aSecondCenter; - Standard_Real anU1Min, anU1Max, aV1Min, aV1Max; - Standard_Real anU2Min, anU2Max, aV2Min, aV2Max; + Standard_Real anU1Min = NAN, anU1Max = NAN, aV1Min = NAN, aV1Max = NAN; + Standard_Real anU2Min = NAN, anU2Max = NAN, aV2Min = NAN, aV2Max = NAN; BRepTools::UVBounds (theFirstFace, anU1Min, anU1Max, aV1Min, aV1Max); BRepTools::UVBounds (theSecondFace, anU2Min, anU2Max, aV2Min, aV2Max); @@ -982,8 +984,7 @@ Standard_Boolean PrsDim::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& th } // Get intersect line. - Handle(Geom_Curve) anIntersectCurve = aSurfaceIntersector.Line (1); - + Handle(Geom_Line) aFirstLine, aSecondLine; Standard_Real aFirstU = 0.0; Standard_Real aFirstV = 0.0; @@ -1056,7 +1057,7 @@ Standard_Boolean PrsDim::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& th theFirstAttach = theCenter.Translated (aDir); // theFirstAttach should be on theFirstSurf. - Standard_Real anU, aV; + Standard_Real anU = NAN, aV = NAN; if (theFirstSurfType == PrsDim_KOS_Cylinder) { ElSLib::Parameters ((Handle(Geom_CylindricalSurface)::DownCast (aFirstSurf))->Cylinder(), @@ -1084,7 +1085,7 @@ Standard_Boolean PrsDim::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& th { return Standard_False; } - Standard_Real anU, aV; + Standard_Real anU = NAN, aV = NAN; aProjector.LowerDistanceParameters (anU, aV); theSecondAttach = aSecondSurf->Value (anU, aV); } @@ -1110,7 +1111,7 @@ void PrsDim::InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFa gp_Dir& theDirOnPlane) { GeomAPI_ProjectPointOnSurf aProjector; - Standard_Real aPU, aPV; + Standard_Real aPU = NAN, aPV = NAN; TopExp_Explorer anExplorer (theFirstFace, TopAbs_VERTEX); @@ -1193,7 +1194,7 @@ gp_Pnt PrsDim::TranslatePointToBound( const gp_Pnt & aPoint, const gp_Dir & aDir TColStd_Array2OfReal Bound( 1, 3, 1, 2 ); TColStd_Array1OfReal Origin( 1, 3 ); TColStd_Array1OfReal Dir( 1, 3 ); - Standard_Real t; + Standard_Real t = NAN; aBndBox.Get( Bound(1,1), Bound(2,1), Bound(3,1), Bound(1,2), Bound(2,2), Bound(3,2) ); aPoint.Coord( Origin(1), Origin(2), Origin(3) ); @@ -1240,7 +1241,7 @@ Standard_Boolean PrsDim::InDomain(const Standard_Real fpar, return ((para >= fpar) && (para <= lpar)); else { // fpar > lpar Standard_Real delta = 2*M_PI-fpar; - Standard_Real lp, par, fp; + Standard_Real lp = NAN, par = NAN, fp = NAN; lp = lpar + delta; par = para + delta; while(lp > 2*M_PI) lp-=2*M_PI; @@ -1264,7 +1265,7 @@ Standard_Real PrsDim::DistanceFromApex(const gp_Elips & elips, const gp_Pnt & Apex, const Standard_Real par) { - Standard_Real dist; + Standard_Real dist = NAN; Standard_Real parApex = ElCLib::Parameter ( elips, Apex ); if(parApex == 0.0 || parApex == M_PI) {//Major case @@ -1315,7 +1316,7 @@ gp_Pnt PrsDim::NearestApex(const gp_Elips & elips, const Standard_Real lpara, Standard_Boolean & IsInDomain) { - Standard_Real parP, parN; + Standard_Real parP = NAN, parN = NAN; gp_Pnt EndOfArrow(0.0,0.0,0.0); IsInDomain = Standard_True; parP = ElCLib::Parameter ( elips, pApex ); @@ -1367,10 +1368,10 @@ void PrsDim::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPre li->SetWidth(aWidth); } - Standard_Real pf, pl; + Standard_Real pf = NAN, pl = NAN; TopLoc_Location loc; Handle(Geom_Curve) curve; - Standard_Boolean isInfinite; + Standard_Boolean isInfinite = 0; curve = BRep_Tool::Curve(anEdge,loc,pf,pl); isInfinite = (Precision::IsInfinite(pf) || Precision::IsInfinite(pl)); diff --git a/src/PrsDim/PrsDim_AngleDimension.cxx b/src/PrsDim/PrsDim_AngleDimension.cxx index 8d480a9686..b828beda2f 100644 --- a/src/PrsDim/PrsDim_AngleDimension.cxx +++ b/src/PrsDim/PrsDim_AngleDimension.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -641,7 +643,7 @@ void PrsDim_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager)& , Standard_Real anArrowLength = aDimensionAspect->ArrowAspect()->Length(); // prepare label string and compute its geometrical width - Standard_Real aLabelWidth; + Standard_Real aLabelWidth = NAN; TCollection_ExtendedString aLabelString = GetValueString (aLabelWidth); // add margins to label width @@ -897,7 +899,7 @@ Standard_Boolean PrsDim_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPl : gp_Pln (aSecondLin.Location(), gp_Vec (aFirstLin.Direction()) ^ gp_Vec (aSecondLin.Direction())); // Compute geometry for this plane and edges - Standard_Boolean isInfinite1,isInfinite2; + Standard_Boolean isInfinite1 = 0,isInfinite2 = 0; gp_Pnt aFirstPoint1, aLastPoint1, aFirstPoint2, aLastPoint2; Handle(Geom_Curve) aFirstCurve = aFirstLine, aSecondCurve = aSecondLine; if (!PrsDim::ComputeGeometry (aFirstEdge, aSecondEdge, @@ -988,7 +990,7 @@ Standard_Boolean PrsDim_AngleDimension::InitTwoFacesAngle() gp_Pln aFirstPln, aSecondPln; Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf; PrsDim_KindOfSurface aFirstSurfType, aSecondSurfType; - Standard_Real aFirstOffset, aSecondOffset; + Standard_Real aFirstOffset = NAN, aSecondOffset = NAN; PrsDim::GetPlaneFromFace (aFirstFace, aFirstPln, aFirstBasisSurf,aFirstSurfType,aFirstOffset); @@ -1028,7 +1030,7 @@ Standard_Boolean PrsDim_AngleDimension::InitTwoFacesAngle (const gp_Pnt& thePoin gp_Pln aFirstPln, aSecondPln; Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf; PrsDim_KindOfSurface aFirstSurfType, aSecondSurfType; - Standard_Real aFirstOffset, aSecondOffset; + Standard_Real aFirstOffset = NAN, aSecondOffset = NAN; PrsDim::GetPlaneFromFace (aFirstFace, aFirstPln, aFirstBasisSurf,aFirstSurfType,aFirstOffset); @@ -1216,7 +1218,7 @@ gp_Pnt PrsDim_AngleDimension::GetTextPosition() const Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect(); // Prepare label string and compute its geometrical width - Standard_Real aLabelWidth; + Standard_Real aLabelWidth = NAN; TCollection_ExtendedString aLabelString = GetValueString (aLabelWidth); gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec(myCenterPoint, myFirstPoint).Normalized() * GetFlyout()); @@ -1396,7 +1398,7 @@ void PrsDim_AngleDimension::FitTextAlignment (const Prs3d_DimensionTextHorizonta Standard_Real anArrowLength = aDimensionAspect->ArrowAspect()->Length(); // Prepare label string and compute its geometrical width - Standard_Real aLabelWidth; + Standard_Real aLabelWidth = NAN; TCollection_ExtendedString aLabelString = GetValueString (aLabelWidth); // add margins to label width diff --git a/src/PrsDim/PrsDim_Chamf3dDimension.cxx b/src/PrsDim/PrsDim_Chamf3dDimension.cxx index b829c42dce..701e047260 100644 --- a/src/PrsDim/PrsDim_Chamf3dDimension.cxx +++ b/src/PrsDim/PrsDim_Chamf3dDimension.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -89,7 +91,7 @@ void PrsDim_Chamf3dDimension::Compute (const Handle(PrsMgr_PresentationManager)& // Calcul du centre de la face //---------------------------- BRepAdaptor_Surface surfAlgo (TopoDS::Face(myFShape)); - Standard_Real uFirst, uLast, vFirst, vLast; + Standard_Real uFirst = NAN, uLast = NAN, vFirst = NAN, vLast = NAN; uFirst = surfAlgo.FirstUParameter(); uLast = surfAlgo.LastUParameter(); vFirst = surfAlgo.FirstVParameter(); diff --git a/src/PrsDim/PrsDim_ConcentricRelation.cxx b/src/PrsDim/PrsDim_ConcentricRelation.cxx index 6f283e13e1..3b3b0e96a7 100644 --- a/src/PrsDim/PrsDim_ConcentricRelation.cxx +++ b/src/PrsDim/PrsDim_ConcentricRelation.cxx @@ -100,8 +100,8 @@ void PrsDim_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_P gp_Pnt p1,p2; Handle(Geom_Curve) C; Handle(Geom_Curve) extCurv; - Standard_Boolean isInfinite; - Standard_Boolean isOnPlanEdge, isOnPlanVertex; + Standard_Boolean isInfinite = 0; + Standard_Boolean isOnPlanEdge = 0, isOnPlanVertex = 0; if (!PrsDim::ComputeGeometry(E,C,p1,p2,extCurv,isInfinite,isOnPlanEdge,myPlane)) return; gp_Pnt P; PrsDim::ComputeGeometry(V,P, myPlane, isOnPlanVertex); @@ -151,7 +151,7 @@ void PrsDim_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Pre gp_Pnt ptat11,ptat12,ptat21,ptat22; Handle(Geom_Curve) geom1,geom2; - Standard_Boolean isInfinite1,isInfinite2; + Standard_Boolean isInfinite1 = 0,isInfinite2 = 0; Handle(Geom_Curve) extCurv; if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), TopoDS::Edge(mySShape), myExtShape, diff --git a/src/PrsDim/PrsDim_ConcentricRelation.hxx b/src/PrsDim/PrsDim_ConcentricRelation.hxx index 3cb179a847..1301fbf70e 100644 --- a/src/PrsDim/PrsDim_ConcentricRelation.hxx +++ b/src/PrsDim/PrsDim_ConcentricRelation.hxx @@ -60,7 +60,7 @@ private: private: gp_Pnt myCenter; - Standard_Real myRad; + Standard_Real myRad{}; gp_Dir myDir; gp_Pnt myPnt; diff --git a/src/PrsDim/PrsDim_Dimension.cxx b/src/PrsDim/PrsDim_Dimension.cxx index ca11eccfaa..61318423ce 100644 --- a/src/PrsDim/PrsDim_Dimension.cxx +++ b/src/PrsDim/PrsDim_Dimension.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -471,7 +473,7 @@ void PrsDim_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentati Bnd_Box aShapeBnd; BRepBndLib::AddClose (aTextShape, aShapeBnd); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; aShapeBnd.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); Standard_Real aXalign = aTextWidth * 0.5 - (aXmax + aXmin) * 0.5; @@ -652,7 +654,7 @@ void PrsDim_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& th Standard_Real anArrowLength = aDimensionAspect->ArrowAspect()->Length(); Standard_Real anExtensionSize = aDimensionAspect->ExtensionSize(); // prepare label string and compute its geometrical width - Standard_Real aLabelWidth; + Standard_Real aLabelWidth = NAN; TCollection_ExtendedString aLabelString = GetValueString (aLabelWidth); // add margins to cut dimension lines for 3d text @@ -1619,7 +1621,7 @@ void PrsDim_Dimension::FitTextAlignmentForLinear (const gp_Pnt& theFirstPoint, Standard_Real anArrowLength = aDimensionAspect->ArrowAspect()->Length(); // prepare label string and compute its geometrical width - Standard_Real aLabelWidth; + Standard_Real aLabelWidth = NAN; TCollection_ExtendedString aLabelString = GetValueString (aLabelWidth); // Add margins to cut dimension lines for 3d text diff --git a/src/PrsDim/PrsDim_EllipseRadiusDimension.cxx b/src/PrsDim/PrsDim_EllipseRadiusDimension.cxx index 1072eaaf75..ba93242805 100644 --- a/src/PrsDim/PrsDim_EllipseRadiusDimension.cxx +++ b/src/PrsDim/PrsDim_EllipseRadiusDimension.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -97,7 +99,7 @@ void PrsDim_EllipseRadiusDimension::ComputeFaceGeometry() gp_Pln aPln; Handle( Geom_Surface ) aBasisSurf; PrsDim_KindOfSurface aSurfType; - Standard_Real Offset; + Standard_Real Offset = NAN; PrsDim::GetPlaneFromFace( TopoDS::Face( myFShape), aPln, aBasisSurf, @@ -122,7 +124,7 @@ void PrsDim_EllipseRadiusDimension::ComputeCylFaceGeometry(const PrsDim_KindOfSu { BRepAdaptor_Surface surf1(TopoDS::Face(myFShape)); - Standard_Real vFirst, vLast; + Standard_Real vFirst = NAN, vLast = NAN; vFirst = surf1.FirstVParameter(); vLast = surf1.LastVParameter(); Standard_Real vMid = (vFirst + vLast)*0.5; diff --git a/src/PrsDim/PrsDim_EllipseRadiusDimension.hxx b/src/PrsDim/PrsDim_EllipseRadiusDimension.hxx index d7f0eee586..dc621122f6 100644 --- a/src/PrsDim/PrsDim_EllipseRadiusDimension.hxx +++ b/src/PrsDim/PrsDim_EllipseRadiusDimension.hxx @@ -49,12 +49,12 @@ protected: protected: gp_Elips myEllipse; - Standard_Real myFirstPar; - Standard_Real myLastPar; - Standard_Boolean myIsAnArc; + Standard_Real myFirstPar{}; + Standard_Real myLastPar{}; + Standard_Boolean myIsAnArc{}; Handle(Geom_OffsetCurve) myOffsetCurve; - Standard_Real myOffset; - Standard_Boolean myIsOffset; + Standard_Real myOffset{}; + Standard_Boolean myIsOffset{}; private: diff --git a/src/PrsDim/PrsDim_EqualDistanceRelation.cxx b/src/PrsDim/PrsDim_EqualDistanceRelation.cxx index cea28b70a9..530a14b685 100644 --- a/src/PrsDim/PrsDim_EqualDistanceRelation.cxx +++ b/src/PrsDim/PrsDim_EqualDistanceRelation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -54,12 +56,12 @@ PrsDim_EqualDistanceRelation::PrsDim_EqualDistanceRelation( const TopoDS_Shape& const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape4, const Handle( Geom_Plane )& aPlane ) -: PrsDim_Relation() +: PrsDim_Relation(), myShape3(aShape3), myShape4(aShape4) { myFShape = aShape1; mySShape = aShape2; - myShape3 = aShape3; - myShape4 = aShape4; + + myPlane = aPlane; //Temporary @@ -372,7 +374,7 @@ void PrsDim_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Pr Handle(Geom_Curve) extCurv; Standard_Real arrsize = ArrowSize;// size Standard_Real Val=0.; - Standard_Boolean isInPlane1, isInPlane2; + Standard_Boolean isInPlane1 = 0, isInPlane2 = 0; if(!PrsDim::ComputeGeometry(FirstEdge,geom1, ptat11, ptat12,extCurv,isInfinite1,isInPlane1, Plane )) return; @@ -589,7 +591,7 @@ void PrsDim_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs ) { - Standard_Boolean isOnPlane1, isOnPlane2; + Standard_Boolean isOnPlane1 = 0, isOnPlane2 = 0; gp_Dir DirAttach; PrsDim::ComputeGeometry( FirstVertex, FirstAttach, Plane, isOnPlane1); PrsDim::ComputeGeometry( SecondVertex, SecondAttach, Plane, isOnPlane2); @@ -685,10 +687,10 @@ void PrsDim_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( gp_Pnt ptonedge1,ptonedge2; Handle(Geom_Curve) aCurve; Handle(Geom_Curve) extCurv; - Standard_Boolean isInfinite; - Standard_Real Val; - Standard_Boolean isOnPlanEdge, isOnPlanVertex; - Standard_Integer edgenum ; + Standard_Boolean isInfinite = 0; + Standard_Real Val = NAN; + Standard_Boolean isOnPlanEdge = 0, isOnPlanVertex = 0; + Standard_Integer edgenum = 0 ; if (FirstShape.ShapeType() == TopAbs_VERTEX) { thevertex = TopoDS::Vertex(FirstShape); diff --git a/src/PrsDim/PrsDim_EqualRadiusRelation.cxx b/src/PrsDim/PrsDim_EqualRadiusRelation.cxx index cd3d32c0eb..c8e3d3dbdd 100644 --- a/src/PrsDim/PrsDim_EqualRadiusRelation.cxx +++ b/src/PrsDim/PrsDim_EqualRadiusRelation.cxx @@ -68,7 +68,7 @@ void PrsDim_EqualRadiusRelation::Compute (const Handle(PrsMgr_PresentationManage Handle( Geom_Curve ) FirstProjCurve = FirstCurve.Curve().Curve(), SecondProjCurve = SecondCurve.Curve().Curve(); gp_Pnt FirstPoint1, LastPoint1, FirstPoint2, LastPoint2; - Standard_Boolean isFirstOnPlane, isSecondOnPlane; + Standard_Boolean isFirstOnPlane = 0, isSecondOnPlane = 0; PrsDim::ComputeGeomCurve (FirstProjCurve, FirstPar1, LastPar1, FirstPoint1, LastPoint1, myPlane, isFirstOnPlane); PrsDim::ComputeGeomCurve (SecondProjCurve, FirstPar2, LastPar2, FirstPoint2, LastPoint2, myPlane, isSecondOnPlane); diff --git a/src/PrsDim/PrsDim_FixRelation.cxx b/src/PrsDim/PrsDim_FixRelation.cxx index b75a001d00..bb34bb8f25 100644 --- a/src/PrsDim/PrsDim_FixRelation.cxx +++ b/src/PrsDim/PrsDim_FixRelation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -367,7 +369,7 @@ void PrsDim_FixRelation::ComputeEdge(const TopoDS_Edge& FixEdge, gp_Pnt& curpos) //--> In case of a circle else if (curEdge->IsKind(STANDARD_TYPE(Geom_Circle))) { gp_Circ gcirc = Handle(Geom_Circle)::DownCast(curEdge)->Circ(); - Standard_Real pfirst, plast; + Standard_Real pfirst = NAN, plast = NAN; BRepAdaptor_Curve cu(FixEdge); pfirst = cu.FirstParameter(); plast = cu.LastParameter(); @@ -415,7 +417,7 @@ void PrsDim_FixRelation::ComputeLinePosition(const gp_Lin& glin, // of the edge : the point closest to the projection is chosen // as the attach point else { - Standard_Real pOnLin; + Standard_Real pOnLin = NAN; if (linparam > plast) pOnLin = plast; else diff --git a/src/PrsDim/PrsDim_IdenticRelation.cxx b/src/PrsDim/PrsDim_IdenticRelation.cxx index abdd768f77..9db36e0742 100644 --- a/src/PrsDim/PrsDim_IdenticRelation.cxx +++ b/src/PrsDim/PrsDim_IdenticRelation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,7 +80,7 @@ static void PrsDim_Sort(Standard_Real tab1[4], Standard_Integer tab3[4]) { Standard_Boolean found = Standard_True; - Standard_Real cur; gp_Pnt cur1; Standard_Integer cur2; + Standard_Real cur = NAN; gp_Pnt cur1; Standard_Integer cur2 = 0; while (found) { found = Standard_False; @@ -377,7 +379,7 @@ void PrsDim_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& { Handle(Geom_Curve) curv1,curv2; gp_Pnt firstp1,lastp1,firstp2,lastp2; - Standard_Boolean isInfinite1,isInfinite2; + Standard_Boolean isInfinite1 = 0,isInfinite2 = 0; Handle(Geom_Curve) extCurv; if ( !PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),TopoDS::Edge(mySShape), myExtShape,curv1,curv2, @@ -454,7 +456,7 @@ void PrsDim_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Pres { Handle(Geom_Curve) curv1,curv2; gp_Pnt firstp1,lastp1,firstp2,lastp2; - Standard_Boolean isInfinite1,isInfinite2; + Standard_Boolean isInfinite1 = 0,isInfinite2 = 0; Handle(Geom_Curve) extCurv; if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), @@ -552,7 +554,7 @@ void PrsDim_IdenticRelation::ComputeTwoLinesPresentation(const Handle(Prs3d_Pres } else { // Computation of the parameters of the 4 points on the line - Standard_Real pf1, pf2, pl1, pl2; + Standard_Real pf1 = NAN, pf2 = NAN, pl1 = NAN, pl2 = NAN; pf1 = ElCLib::Parameter(thelin->Lin(), firstp1); pl1 = ElCLib::Parameter(thelin->Lin(), lastp1); @@ -760,7 +762,7 @@ void PrsDim_IdenticRelation::ComputeTwoCirclesPresentation(const Handle(Prs3d_Pr else if ( !circ1complete && !circ2complete ) { // We project all the points on the circle - Standard_Real pf1, pf2, pl1, pl2; + Standard_Real pf1 = NAN, pf2 = NAN, pl1 = NAN, pl2 = NAN; pf1 = ElCLib::Parameter(thecirc->Circ(), firstp1); pf2 = ElCLib::Parameter(thecirc->Circ(), firstp2); pl1 = ElCLib::Parameter(thecirc->Circ(), lastp1); @@ -1115,7 +1117,7 @@ void PrsDim_IdenticRelation::ComputeTwoEllipsesPresentation(const Handle(Prs3d_P else if ( !circ1complete && !circ2complete ) { // We project all the points on the circle - Standard_Real pf1, pf2, pl1, pl2; + Standard_Real pf1 = NAN, pf2 = NAN, pl1 = NAN, pl2 = NAN; pf1 = ElCLib::Parameter(theEll->Elips(), firstp1); pf2 = ElCLib::Parameter(theEll->Elips(), firstp2); pl1 = ElCLib::Parameter(theEll->Elips(), lastp1); @@ -1407,7 +1409,7 @@ void PrsDim_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Ell //======================================================================= void PrsDim_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Presentation)& aPrs) { - Standard_Boolean isOnPlane1, isOnPlane2; + Standard_Boolean isOnPlane1 = 0, isOnPlane2 = 0; const TopoDS_Vertex& FVertex = TopoDS::Vertex(myFShape); const TopoDS_Vertex& SVertex = TopoDS::Vertex(mySShape); @@ -1624,7 +1626,7 @@ void PrsDim_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3 { TopoDS_Vertex V; TopoDS_Edge E; - Standard_Integer numedge; + Standard_Integer numedge = 0; if (myFShape.ShapeType() == TopAbs_VERTEX) { V = TopoDS::Vertex(myFShape); @@ -1639,8 +1641,8 @@ void PrsDim_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3 gp_Pnt ptonedge1,ptonedge2; Handle(Geom_Curve) aCurve; Handle(Geom_Curve) extCurv; - Standard_Boolean isInfinite; - Standard_Boolean isOnPlanEdge, isOnPlanVertex; + Standard_Boolean isInfinite = 0; + Standard_Boolean isOnPlanEdge = 0, isOnPlanVertex = 0; if (!PrsDim::ComputeGeometry(E,aCurve,ptonedge1,ptonedge2,extCurv,isInfinite,isOnPlanEdge,myPlane)) return; aPrs->SetInfiniteState(isInfinite); diff --git a/src/PrsDim/PrsDim_LengthDimension.cxx b/src/PrsDim/PrsDim_LengthDimension.cxx index e0bb95b055..c3193ffa31 100644 --- a/src/PrsDim/PrsDim_LengthDimension.cxx +++ b/src/PrsDim/PrsDim_LengthDimension.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -531,7 +533,7 @@ Standard_Boolean PrsDim_LengthDimension::InitEdgeFaceLength (const TopoDS_Edge& // Take direction for dimension line (will be orthogonalized later) parallel to edge BRepAdaptor_Curve aCurveAdaptor (theEdge); - Standard_Real aParam; + Standard_Real aParam = NAN; if (aDistAdaptor.SupportOnShape1 (1).ShapeType() == TopAbs_EDGE) { aDistAdaptor.ParOnEdgeS1 (1, aParam); @@ -582,7 +584,7 @@ Standard_Boolean PrsDim_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape gp_Pln aFirstPlane; Handle(Geom_Surface) aFirstSurface; PrsDim_KindOfSurface aFirstSurfKind; - Standard_Real aFirstOffset; + Standard_Real aFirstOffset = NAN; TopoDS_Face aFirstFace = TopoDS::Face (theFirstShape); @@ -599,7 +601,7 @@ Standard_Boolean PrsDim_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape gp_Pln aSecondPlane; Handle(Geom_Surface) aSecondSurface; PrsDim_KindOfSurface aSecondSurfKind; - Standard_Real aSecondOffset; + Standard_Real aSecondOffset = NAN; TopoDS_Face aSecondFace = TopoDS::Face (theSecondShape); @@ -630,7 +632,7 @@ Standard_Boolean PrsDim_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape mySecondPoint = PrsDim::ProjectPointOnPlane (myFirstPoint, aSecondPlane); - Standard_Real anU, aV; + Standard_Real anU = NAN, aV = NAN; ElSLib::Parameters (aSecondPlane, mySecondPoint, anU, aV); BRepTopAdaptor_FClass2d aClassifier (aSecondFace, Precision::Confusion()); @@ -650,8 +652,8 @@ Standard_Boolean PrsDim_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape } else // curvilinear faces { - Standard_Real aU1Min, aV1Min, aU1Max, aV1Max; - Standard_Real aU2Min, aV2Min, aU2Max, aV2Max; + Standard_Real aU1Min = NAN, aV1Min = NAN, aU1Max = NAN, aV1Max = NAN; + Standard_Real aU2Min = NAN, aV2Min = NAN, aU2Max = NAN, aV2Max = NAN; BRepTools::UVBounds (aFirstFace, aU1Min, aU1Max, aV1Min, aV1Max); BRepTools::UVBounds (aSecondFace, aU2Min, aU2Max, aV2Min, aV2Max); @@ -659,7 +661,7 @@ Standard_Boolean PrsDim_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape aU1Min, aU1Max, aV1Min, aV1Max, aU2Min, aU2Max, aV2Min, aV2Max); - Standard_Real aU1, aV1, aU2, aV2; + Standard_Real aU1 = NAN, aV1 = NAN, aU2 = NAN, aV2 = NAN; anExtrema.LowerDistanceParameters (aU1, aV1, aU2, aV2); myFirstPoint = BRep_Tool::Surface (aFirstFace)->Value (aU1, aV1); mySecondPoint = BRep_Tool::Surface (aSecondFace)->Value (aU2, aV2); diff --git a/src/PrsDim/PrsDim_MaxRadiusDimension.cxx b/src/PrsDim/PrsDim_MaxRadiusDimension.cxx index dd4a46c334..8537c0806f 100644 --- a/src/PrsDim/PrsDim_MaxRadiusDimension.cxx +++ b/src/PrsDim/PrsDim_MaxRadiusDimension.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -116,7 +118,7 @@ void PrsDim_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& } arr->SetLength(myArrowSize); - Standard_Real U;//,V; + Standard_Real U = NAN;//,V; gp_Pnt curPos, Center; Center = myEllipse.Location(); if( myAutomaticPosition ) @@ -165,7 +167,7 @@ void PrsDim_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentat } arr->SetLength(myArrowSize); - Standard_Real par; + Standard_Real par = NAN; gp_Pnt curPos, Center; Center = myEllipse.Location(); Standard_Boolean IsInDomain = Standard_True; @@ -258,7 +260,7 @@ void PrsDim_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selectio Standard_Real parEnd = ElCLib::Parameter ( myEllipse, myEndOfArrow ); if(!PrsDim::InDomain(myFirstPar, myLastPar, parEnd)) { - Standard_Real parStart, par; + Standard_Real parStart = NAN, par = NAN; if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) par = myFirstPar; diff --git a/src/PrsDim/PrsDim_MidPointRelation.cxx b/src/PrsDim/PrsDim_MidPointRelation.cxx index 74cec7d3bb..dd53b79804 100644 --- a/src/PrsDim/PrsDim_MidPointRelation.cxx +++ b/src/PrsDim/PrsDim_MidPointRelation.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -72,7 +74,7 @@ void PrsDim_MidPointRelation::Compute (const Handle(PrsMgr_PresentationManager)& if (myTool.ShapeType() == TopAbs_VERTEX) { gp_Pnt pp; - Standard_Boolean isonplane; + Standard_Boolean isonplane = 0; if ( PrsDim::ComputeGeometry(TopoDS::Vertex(myTool),pp,myPlane,isonplane) ) { if ( !isonplane ) ComputeProjVertexPresentation(aprs,TopoDS::Vertex(myTool),pp); @@ -163,7 +165,7 @@ void PrsDim_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection) Handle(Geom_Curve) curv; gp_Pnt firstp,lastp; - Standard_Boolean isInfinite,isOnPlane; + Standard_Boolean isInfinite = 0,isOnPlane = 0; Handle(Geom_Curve) extCurv; // segment on first curve @@ -260,7 +262,7 @@ void PrsDim_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation Handle(Geom_Curve) geom; gp_Pnt ptat1,ptat2; Handle(Geom_Curve) extCurv; - Standard_Boolean isInfinite,isOnPlane; + Standard_Boolean isInfinite = 0,isOnPlane = 0; if ( !PrsDim::ComputeGeometry(E, geom, ptat1, ptat2, extCurv, isInfinite, isOnPlane, myPlane) ) return; gp_Ax2 ax = myPlane->Pln().Position().Ax2(); @@ -314,7 +316,7 @@ void PrsDim_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentati gp_Ax2 ax = myPlane->Pln().Position().Ax2(); if ( first ) { - Standard_Boolean isOnPlane; + Standard_Boolean isOnPlane = 0; TopoDS_Vertex V = TopoDS::Vertex(myFShape); PrsDim::ComputeGeometry(V, myFAttach, myPlane, isOnPlane); DsgPrs_MidPointPresentation::Add(aprs,myDrawer,ax,myMidPoint,myPosition,myFAttach,first); @@ -322,7 +324,7 @@ void PrsDim_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentati } else { - Standard_Boolean isOnPlane; + Standard_Boolean isOnPlane = 0; TopoDS_Vertex V = TopoDS::Vertex(mySShape); PrsDim::ComputeGeometry(V, mySAttach, myPlane, isOnPlane); DsgPrs_MidPointPresentation::Add(aprs,myDrawer,ax,myMidPoint,myPosition,mySAttach,first); @@ -454,10 +456,10 @@ void PrsDim_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc, Standard_Real pcurpos = ElCLib::Parameter(aCirc,curpos); Standard_Real rad = M_PI / 5.0; - Standard_Real segm; + Standard_Real segm = NAN; - Standard_Real pFPnt; - Standard_Real pSPnt; + Standard_Real pFPnt = NAN; + Standard_Real pSPnt = NAN; if ( pnt1.IsEqual(pnt2,confusion) ) // full circle { @@ -581,10 +583,10 @@ void PrsDim_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll, Standard_Real pcurpos = ElCLib::Parameter(anEll,curpos); Standard_Real rad = M_PI / 5.0; - Standard_Real segm; + Standard_Real segm = NAN; - Standard_Real pFPnt; - Standard_Real pSPnt; + Standard_Real pFPnt = NAN; + Standard_Real pSPnt = NAN; if ( pnt1.IsEqual(pnt2,confusion) ) // full circle { diff --git a/src/PrsDim/PrsDim_MinRadiusDimension.cxx b/src/PrsDim/PrsDim_MinRadiusDimension.cxx index 85a0398439..c5b6fc3f0f 100644 --- a/src/PrsDim/PrsDim_MinRadiusDimension.cxx +++ b/src/PrsDim/PrsDim_MinRadiusDimension.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -119,7 +121,7 @@ void PrsDim_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& } arr->SetLength(myArrowSize); - Standard_Real U;//,V; + Standard_Real U = NAN;//,V; gp_Pnt curPos, Center; Center = myEllipse.Location(); if( myAutomaticPosition ) @@ -169,7 +171,7 @@ void PrsDim_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentat } arr->SetLength(myArrowSize); - Standard_Real par; + Standard_Real par = NAN; gp_Pnt curPos, Center; Center = myEllipse.Location(); Standard_Boolean IsInDomain = Standard_True; @@ -263,7 +265,7 @@ void PrsDim_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selectio Standard_Real parEnd = ElCLib::Parameter ( myEllipse, myEndOfArrow ); if(!PrsDim::InDomain(myFirstPar, myLastPar, parEnd)) { - Standard_Real parStart, par; + Standard_Real parStart = NAN, par = NAN; if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) par = myFirstPar; diff --git a/src/PrsDim/PrsDim_OffsetDimension.cxx b/src/PrsDim/PrsDim_OffsetDimension.cxx index 3a4ba3ad98..98fba09271 100644 --- a/src/PrsDim/PrsDim_OffsetDimension.cxx +++ b/src/PrsDim/PrsDim_OffsetDimension.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -111,7 +113,7 @@ void PrsDim_OffsetDimension::Compute (const Handle(PrsMgr_PresentationManager)& gp_Pln bPln = surf2.Plane(); - Standard_Real uPnt, vPnt; + Standard_Real uPnt = NAN, vPnt = NAN; ElSLib::Parameters (bPln , aPnt , uPnt, vPnt); gp_Pnt bPnt = ElSLib::Value (uPnt, vPnt, bPln); if (aPnt.IsEqual(bPnt,Precision::Confusion())) { @@ -175,7 +177,7 @@ void PrsDim_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSel->Add(box); } - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,Proj1); parmax = parmin; @@ -360,7 +362,7 @@ void PrsDim_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentati else { if (myAutomaticPosition && myIsSetBndBox) { - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; myBndBox.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); myPosition.SetCoord( aXmax, aYmax, aZmax ); } @@ -391,7 +393,7 @@ void PrsDim_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentati gp_Pln apln (anax3); //gp_Pnt proj2; - Standard_Real u2,v2, uatt, vatt; + Standard_Real u2 = NAN,v2 = NAN, uatt = NAN, vatt = NAN; ElSLib::Parameters (apln , mySAttach, uatt,vatt); ElSLib::Parameters (apln , curpos , u2,v2); diff --git a/src/PrsDim/PrsDim_ParallelRelation.cxx b/src/PrsDim/PrsDim_ParallelRelation.cxx index e5aa1e995f..d4e4f4da74 100644 --- a/src/PrsDim/PrsDim_ParallelRelation.cxx +++ b/src/PrsDim/PrsDim_ParallelRelation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -140,7 +142,7 @@ void PrsDim_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection) myPosition.Z()+size); aSelection->Add(box); } - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,Proj1); parmax = parmin; @@ -196,7 +198,7 @@ void PrsDim_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Present gp_Pnt ptat11,ptat12,ptat21,ptat22;//,pint3d; Handle(Geom_Curve) geom1,geom2; - Standard_Boolean isInfinite1,isInfinite2; + Standard_Boolean isInfinite1 = 0,isInfinite2 = 0; Handle(Geom_Curve) extCurv; if (!PrsDim::ComputeGeometry(E1,E2,myExtShape, geom1,geom2, diff --git a/src/PrsDim/PrsDim_PerpendicularRelation.cxx b/src/PrsDim/PrsDim_PerpendicularRelation.cxx index 0161b5d4e9..1ae0396133 100644 --- a/src/PrsDim/PrsDim_PerpendicularRelation.cxx +++ b/src/PrsDim/PrsDim_PerpendicularRelation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -164,7 +166,7 @@ void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs // 3d lines Handle(Geom_Curve) geom1,geom2; gp_Pnt pint3d,p1,p2,pAx1,pAx2,ptat11,ptat12,ptat21,ptat22; - Standard_Boolean isInfinite1,isInfinite2; + Standard_Boolean isInfinite1 = 0,isInfinite2 = 0; Handle(Geom_Curve) extCurv; if ( !PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),TopoDS::Edge(mySShape), myExtShape, @@ -218,8 +220,7 @@ void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs // current face BRepBuilderAPI_MakeFace makeface (myPlane->Pln()); - TopoDS_Face face (makeface.Face()); - BRepAdaptor_Surface adp (makeface.Face()); + BRepAdaptor_Surface adp (makeface.Face()); // 2d lines => projection of 3d on current plane Handle(Geom2d_Curve) aGeom2dCurve = GeomAPI::To2d(geom_lin1,myPlane->Pln()); @@ -235,7 +236,7 @@ void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs myPosition = pint3d; // recherche points attache - Standard_Real par1,par2,curpar,pmin,pmax;//,dist,sign; + Standard_Real par1 = NAN,par2 = NAN,curpar = NAN,pmin = NAN,pmax = NAN;//,dist,sign; Standard_Real length(0.); if ( isInfinite1 && isInfinite2 ) diff --git a/src/PrsDim/PrsDim_Relation.cxx b/src/PrsDim/PrsDim_Relation.cxx index d2726741f5..f01d449777 100644 --- a/src/PrsDim/PrsDim_Relation.cxx +++ b/src/PrsDim/PrsDim_Relation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -86,10 +88,10 @@ void PrsDim_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentatio li->SetWidth(width); } - Standard_Real pf, pl; + Standard_Real pf = NAN, pl = NAN; TopLoc_Location loc; Handle(Geom_Curve) curve; - Standard_Boolean isInfinite; + Standard_Boolean isInfinite = 0; curve = BRep_Tool::Curve(anEdge,loc,pf,pl); isInfinite = (Precision::IsInfinite(pf) || Precision::IsInfinite(pl)); diff --git a/src/PrsDim/PrsDim_SymmetricRelation.cxx b/src/PrsDim/PrsDim_SymmetricRelation.cxx index 252d3df144..b28dac66b8 100644 --- a/src/PrsDim/PrsDim_SymmetricRelation.cxx +++ b/src/PrsDim/PrsDim_SymmetricRelation.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -93,7 +95,7 @@ void PrsDim_SymmetricRelation::Compute (const Handle(PrsMgr_PresentationManager) if (myTool.ShapeType() == TopAbs_EDGE) { Handle(Geom_Curve) aCurve,extcurve; gp_Pnt p1,p2; - Standard_Boolean isinfinite,isonplane; + Standard_Boolean isinfinite = 0,isonplane = 0; if (PrsDim::ComputeGeometry(TopoDS::Edge(myTool), aCurve,p1,p2, extcurve, @@ -122,11 +124,11 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection { Handle(Select3D_SensitiveSegment) seg; Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); - Standard_Real F,L; + Standard_Real F = NAN,L = NAN; Handle(Geom_Curve) geom_axis, extcurve; gp_Pnt p1,p2; - Standard_Boolean isinfinite,isonplane; + Standard_Boolean isinfinite = 0,isonplane = 0; if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool), geom_axis,p1,p2, extcurve, @@ -173,7 +175,7 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection myPosition.Z()+size); aSel->Add(box); } - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,P1); parmax = parmin; @@ -220,7 +222,7 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection gp_Pnt ProjCenter1 = ElCLib::Value(ElCLib::Parameter(laxis,Center1),laxis); gp_Vec Vp(ProjCenter1,Center1); if (Vp.Magnitude() <= Precision::Confusion()) Vp = gp_Vec(laxis.Direction())^myPlane->Pln().Position().Direction(); - Standard_Real Dt,R,h; + Standard_Real Dt = NAN,R = NAN,h = NAN; Dt = ProjCenter1.Distance(ProjOffsetPoint); R = circ1.Radius(); if (Dt > .999*R) { @@ -251,7 +253,7 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection myPosition.Z()+size); aSel->Add(box); } - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,P1); parmax = parmin; @@ -304,7 +306,7 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection myPosition.Z()+size); aSel->Add(box); } - Standard_Real parmin,parmax,parcur; + Standard_Real parmin = NAN,parmax = NAN,parcur = NAN; parmin = ElCLib::Parameter(L3,P1); parmax = parmin; @@ -356,7 +358,7 @@ void PrsDim_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Prese // gp_Pnt pint3d,ptat11,ptat12,ptat21,ptat22; gp_Pnt ptat11,ptat12,ptat21,ptat22; Handle(Geom_Curve) geom1,geom2; - Standard_Boolean isInfinite1,isInfinite2; + Standard_Boolean isInfinite1 = 0,isInfinite2 = 0; Handle(Geom_Curve) extCurv; if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), TopoDS::Edge(mySShape), @@ -375,7 +377,7 @@ void PrsDim_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Prese aprs->SetInfiniteState((isInfinite1 || isInfinite2) && (myExtShape !=0)); Handle(Geom_Curve) geom_axis,extcurve; gp_Pnt p1,p2; - Standard_Boolean isinfinite,isonplane; + Standard_Boolean isinfinite = 0,isonplane = 0; if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool), geom_axis,p1,p2, extcurve, @@ -552,7 +554,7 @@ void PrsDim_SymmetricRelation::ComputeTwoVerticesSymmetric(const Handle(Prs3d_Pr if(myFShape.ShapeType() != TopAbs_VERTEX || mySShape.ShapeType() != TopAbs_VERTEX) return; Handle(Geom_Curve) geom_axis,extcurve; gp_Pnt p1,p2; - Standard_Boolean isinfinite,isonplane; + Standard_Boolean isinfinite = 0,isonplane = 0; if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool), geom_axis,p1,p2, extcurve, @@ -560,7 +562,7 @@ void PrsDim_SymmetricRelation::ComputeTwoVerticesSymmetric(const Handle(Prs3d_Pr isonplane, myPlane)) return; - Standard_Boolean isOnPlane1, isOnPlane2; + Standard_Boolean isOnPlane1 = 0, isOnPlane2 = 0; PrsDim::ComputeGeometry(TopoDS::Vertex(myFShape), myFAttach, myPlane, isOnPlane1); PrsDim::ComputeGeometry(TopoDS::Vertex(mySShape), mySAttach, myPlane, isOnPlane2); diff --git a/src/PrsDim/PrsDim_TangentRelation.cxx b/src/PrsDim/PrsDim_TangentRelation.cxx index 756ee39b45..d7ebaf1ab7 100644 --- a/src/PrsDim/PrsDim_TangentRelation.cxx +++ b/src/PrsDim/PrsDim_TangentRelation.cxx @@ -196,7 +196,7 @@ void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentat { Handle(Geom_Curve) copy1,copy2; gp_Pnt ptat11,ptat12,ptat21,ptat22; - Standard_Boolean isInfinite1,isInfinite2; + Standard_Boolean isInfinite1 = 0,isInfinite2 = 0; Handle(Geom_Curve) extCurv; if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), TopoDS::Edge(mySShape), @@ -217,8 +217,7 @@ void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentat aPresentation->SetInfiniteState(isInfinite1 || isInfinite2); // current face BRepBuilderAPI_MakeFace makeface(myPlane->Pln()); - TopoDS_Face face(makeface.Face()); - BRepAdaptor_Surface adp(makeface.Face()); + BRepAdaptor_Surface adp(makeface.Face()); Standard_Integer typArg(0); @@ -255,7 +254,7 @@ void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentat TopExp_Explorer expF(TopoDS::Edge(myFShape),TopAbs_VERTEX); TopExp_Explorer expS(TopoDS::Edge(mySShape),TopAbs_VERTEX); TopoDS_Shape tab[2]; - Standard_Integer p ; + Standard_Integer p = 0 ; for (p = 0; expF.More(); expF.Next(),p++) { tab[p] = TopoDS::Vertex(expF.Current()); diff --git a/src/PrsDim/PrsDim_TangentRelation.hxx b/src/PrsDim/PrsDim_TangentRelation.hxx index b4eb92c4b2..d86cd31fe0 100644 --- a/src/PrsDim/PrsDim_TangentRelation.hxx +++ b/src/PrsDim/PrsDim_TangentRelation.hxx @@ -70,7 +70,7 @@ private: gp_Pnt myAttach; gp_Dir myDir; - Standard_Real myLength; + Standard_Real myLength{}; Standard_Integer myExternRef; }; diff --git a/src/PrsMgr/PrsMgr_PresentableObject.cxx b/src/PrsMgr/PrsMgr_PresentableObject.cxx index 3cb38867de..b723891b86 100644 --- a/src/PrsMgr/PrsMgr_PresentableObject.cxx +++ b/src/PrsMgr/PrsMgr_PresentableObject.cxx @@ -346,7 +346,7 @@ void PrsMgr_PresentableObject::SetTransformPersistence (const Handle(Graphic3d_T //======================================================================= void PrsMgr_PresentableObject::AddChild (const Handle(PrsMgr_PresentableObject)& theObject) { - Handle(PrsMgr_PresentableObject) aHandleGuard = theObject; + const Handle(PrsMgr_PresentableObject)& aHandleGuard = theObject; if (theObject->myParent != NULL) { theObject->myParent->RemoveChild (aHandleGuard); diff --git a/src/Quantity/Quantity_Color.cxx b/src/Quantity/Quantity_Color.cxx index 114620bb4e..ad3b89f0e8 100644 --- a/src/Quantity/Quantity_Color.cxx +++ b/src/Quantity/Quantity_Color.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -309,7 +311,7 @@ void Quantity_Color::Delta (const Quantity_Color& theColor, Standard_Real Quantity_Color::DeltaE2000 (const Quantity_Color& theOther) const { // get color components in CIE Lch space - Standard_Real aL1, aL2, aa1, aa2, ab1, ab2; + Standard_Real aL1 = NAN, aL2 = NAN, aa1 = NAN, aa2 = NAN, ab1 = NAN, ab2 = NAN; this ->Values (aL1, aa1, ab1, Quantity_TOC_CIELab); theOther.Values (aL2, aa2, ab2, Quantity_TOC_CIELab); @@ -682,7 +684,7 @@ void Quantity_Color::DumpJson (Standard_OStream& theOStream, Standard_Integer) c Standard_Boolean Quantity_Color::InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos) { Standard_Integer aPos = theStreamPos; - Standard_Real aRed, aGreen, aBlue; + Standard_Real aRed = NAN, aGreen = NAN, aBlue = NAN; OCCT_INIT_VECTOR_CLASS (Standard_Dump::Text (theSStream), "RGB", aPos, 3, &aRed, &aGreen, &aBlue) SetValues ((Standard_ShortReal)aRed, (Standard_ShortReal)aGreen, (Standard_ShortReal)aBlue, Quantity_TOC_RGB); diff --git a/src/Quantity/Quantity_ColorRGBA.cxx b/src/Quantity/Quantity_ColorRGBA.cxx index 908135c990..82fd880746 100644 --- a/src/Quantity/Quantity_ColorRGBA.cxx +++ b/src/Quantity/Quantity_ColorRGBA.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -160,7 +162,7 @@ bool Quantity_ColorRGBA::ColorFromHex (const char* const theHexColorString, return false; } - ColorInteger aHexColorInteger; + ColorInteger aHexColorInteger = 0; if (!convertStringToInteger (aHexColorString, aHexColorInteger, 16u)) { return false; @@ -217,7 +219,7 @@ Standard_Boolean Quantity_ColorRGBA::InitFromJson (const Standard_SStream& theSS { Standard_Integer aPos = theStreamPos; - Standard_Real aRed, aGreen, aBlue, anAlpha; + Standard_Real aRed = NAN, aGreen = NAN, aBlue = NAN, anAlpha = NAN; OCCT_INIT_VECTOR_CLASS (Standard_Dump::Text (theSStream), "RGBA", aPos, 4, &aRed, &aGreen, &aBlue, &anAlpha) SetValues ((Standard_ShortReal)aRed, (Standard_ShortReal)aGreen, (Standard_ShortReal)aBlue, (Standard_ShortReal)anAlpha); diff --git a/src/Quantity/Quantity_Date.cxx b/src/Quantity/Quantity_Date.cxx index ab1f5addd3..7db075c622 100644 --- a/src/Quantity/Quantity_Date.cxx +++ b/src/Quantity/Quantity_Date.cxx @@ -124,7 +124,7 @@ void Quantity_Date::SetValues(const Standard_Integer mm, const Standard_Integer mis, const Standard_Integer mics){ -Standard_Integer i; +Standard_Integer i = 0; if ( ! Quantity_Date::IsValid (mm,dd,yy,hh,mn,ss,mis,mics)) throw Quantity_DateDefinitionError("Quantity_Date::Quantity_Date invalid parameters"); @@ -174,7 +174,7 @@ void Quantity_Date::Values(Standard_Integer& mm, Standard_Integer& mics)const{ -Standard_Integer i,carry; +Standard_Integer i = 0,carry = 0; for(yy = 1979, carry = mySec ;; yy++) { @@ -229,7 +229,7 @@ mics = myUSec - ( mis * 1000); Quantity_Period Quantity_Date::Difference(const Quantity_Date& OtherDate){ -Standard_Integer i1,i2; +Standard_Integer i1 = 0,i2 = 0; if (mySec == 0 && myUSec == 0) { @@ -270,7 +270,7 @@ return (result); Quantity_Date Quantity_Date::Subtract(const Quantity_Period& During){ -Standard_Integer ss,mics; +Standard_Integer ss = 0,mics = 0; Quantity_Date result; result.mySec = mySec; result.myUSec = myUSec; @@ -317,7 +317,7 @@ return (result); // ~~~~ // ---------------------------------------------------------------------- Standard_Integer Quantity_Date::Year(){ -Standard_Integer dummy, year; +Standard_Integer dummy = 0, year = 0; Values(dummy, dummy, year, dummy, dummy, dummy, dummy, dummy); return (year); } @@ -328,7 +328,7 @@ Standard_Integer dummy, year; // ~~~~~ // ---------------------------------------------------------------------- Standard_Integer Quantity_Date::Month(){ -Standard_Integer dummy, month; +Standard_Integer dummy = 0, month = 0; Values(month, dummy, dummy, dummy, dummy, dummy, dummy, dummy); return(month); } @@ -339,7 +339,7 @@ Standard_Integer dummy, month; // ---------------------------------------------------------------------- Standard_Integer Quantity_Date::Day(){ -Standard_Integer dummy, day; +Standard_Integer dummy = 0, day = 0; Values(dummy, day, dummy, dummy, dummy, dummy, dummy, dummy); return(day); } @@ -350,7 +350,7 @@ Standard_Integer dummy, day; // ---------------------------------------------------------------------- Standard_Integer Quantity_Date::Hour(){ -Standard_Integer dummy, hour; +Standard_Integer dummy = 0, hour = 0; Values(dummy, dummy, dummy, hour, dummy, dummy, dummy, dummy); return(hour); } @@ -361,7 +361,7 @@ Standard_Integer dummy, hour; // ---------------------------------------------------------------------- Standard_Integer Quantity_Date::Minute(){ -Standard_Integer dummy, min; +Standard_Integer dummy = 0, min = 0; Values(dummy, dummy, dummy, dummy, min, dummy, dummy, dummy); return(min); } @@ -372,7 +372,7 @@ Standard_Integer dummy, min; // ---------------------------------------------------------------------- Standard_Integer Quantity_Date::Second(){ -Standard_Integer dummy, sec; +Standard_Integer dummy = 0, sec = 0; Values(dummy, dummy, dummy, dummy, dummy, sec , dummy, dummy); return(sec); } @@ -383,7 +383,7 @@ Standard_Integer dummy, sec; // ---------------------------------------------------------------------- Standard_Integer Quantity_Date::MilliSecond(){ -Standard_Integer dummy, msec; +Standard_Integer dummy = 0, msec = 0; Values(dummy, dummy, dummy, dummy, dummy, dummy, msec, dummy); return(msec); } @@ -394,7 +394,7 @@ return(msec); // ---------------------------------------------------------------------- Standard_Integer Quantity_Date::MicroSecond(){ -Standard_Integer dummy, msec; +Standard_Integer dummy = 0, msec = 0; Values(dummy, dummy, dummy, dummy, dummy, dummy, dummy, msec); return(msec); } diff --git a/src/Quantity/Quantity_Date.hxx b/src/Quantity/Quantity_Date.hxx index 0e0ee52478..d5bc7d36a9 100644 --- a/src/Quantity/Quantity_Date.hxx +++ b/src/Quantity/Quantity_Date.hxx @@ -179,8 +179,8 @@ Standard_Boolean operator > (const Quantity_Date& anOther) const private: - Standard_Integer mySec; - Standard_Integer myUSec; + Standard_Integer mySec{}; + Standard_Integer myUSec{}; }; diff --git a/src/Quantity/Quantity_Period.hxx b/src/Quantity/Quantity_Period.hxx index 7a0f006d71..45740c526c 100644 --- a/src/Quantity/Quantity_Period.hxx +++ b/src/Quantity/Quantity_Period.hxx @@ -137,8 +137,8 @@ Standard_Boolean operator > (const Quantity_Period& anOther) const private: - Standard_Integer mySec; - Standard_Integer myUSec; + Standard_Integer mySec{}; + Standard_Integer myUSec{}; }; diff --git a/src/RWGltf/RWGltf_CafReader.cxx b/src/RWGltf/RWGltf_CafReader.cxx index e50e9426dc..758ab2942e 100644 --- a/src/RWGltf/RWGltf_CafReader.cxx +++ b/src/RWGltf/RWGltf_CafReader.cxx @@ -107,7 +107,7 @@ public: protected: //! Load primitive array. - virtual Handle(Poly_Triangulation) loadData (const Handle(RWGltf_GltfLatePrimitiveArray)& theLateData, + Handle(Poly_Triangulation) loadData (const Handle(RWGltf_GltfLatePrimitiveArray)& theLateData, int theThreadIndex) const Standard_OVERRIDE { GltfReaderTLS& aTlsData = myTlsData.ChangeValue (theThreadIndex); @@ -152,7 +152,7 @@ public: protected: //! Load primitive array. - virtual Handle(Poly_Triangulation) loadData (const Handle(RWGltf_GltfLatePrimitiveArray)& theLateData, + Handle(Poly_Triangulation) loadData (const Handle(RWGltf_GltfLatePrimitiveArray)& theLateData, int theThreadIndex) const Standard_OVERRIDE { (void )theThreadIndex; diff --git a/src/RWGltf/RWGltf_ConfigurationNode.cxx b/src/RWGltf/RWGltf_ConfigurationNode.cxx index 28ce153cbc..e4a0296151 100644 --- a/src/RWGltf/RWGltf_ConfigurationNode.cxx +++ b/src/RWGltf/RWGltf_ConfigurationNode.cxx @@ -40,9 +40,9 @@ RWGltf_ConfigurationNode::RWGltf_ConfigurationNode() : // purpose : //======================================================================= RWGltf_ConfigurationNode::RWGltf_ConfigurationNode(const Handle(RWGltf_ConfigurationNode)& theNode) - :DE_ConfigurationNode(theNode) + :DE_ConfigurationNode(theNode), InternalParameters(theNode->InternalParameters) { - InternalParameters = theNode->InternalParameters; + } //======================================================================= diff --git a/src/RWGltf/RWGltf_Provider.cxx b/src/RWGltf/RWGltf_Provider.cxx index f8a9436c7e..1331011aeb 100644 --- a/src/RWGltf/RWGltf_Provider.cxx +++ b/src/RWGltf/RWGltf_Provider.cxx @@ -26,7 +26,7 @@ namespace // function : SetReaderParameters // purpose : //======================================================================= - static void SetReaderParameters(RWGltf_CafReader& theReader, const Handle(RWGltf_ConfigurationNode) theNode) + static void SetReaderParameters(RWGltf_CafReader& theReader, const Handle(RWGltf_ConfigurationNode)& theNode) { theReader.SetDoublePrecision(!theNode->InternalParameters.ReadSinglePrecision); theReader.SetSystemLengthUnit(theNode->GlobalParameters.LengthUnit / 1000); diff --git a/src/RWHeaderSection/RWHeaderSection_GeneralModule.cxx b/src/RWHeaderSection/RWHeaderSection_GeneralModule.cxx index a49e6867c3..72464c7ea7 100644 --- a/src/RWHeaderSection/RWHeaderSection_GeneralModule.cxx +++ b/src/RWHeaderSection/RWHeaderSection_GeneralModule.cxx @@ -61,7 +61,7 @@ void RWHeaderSection_GeneralModule::CopyCase(const Standard_Integer CN, const Ha switch (CN) { case 1 : { - Standard_Integer i; + Standard_Integer i = 0; DeclareAndCast(HeaderSection_FileName,enfr,entfrom); DeclareAndCast(HeaderSection_FileName,ento,entto); Handle(TCollection_HAsciiString) name = @@ -89,7 +89,7 @@ void RWHeaderSection_GeneralModule::CopyCase(const Standard_Integer CN, const Ha break; case 2 : { - Standard_Integer i; + Standard_Integer i = 0; DeclareAndCast(HeaderSection_FileDescription,enfr,entfrom); DeclareAndCast(HeaderSection_FileDescription,ento,entto); Standard_Integer nbd = enfr->NbDescription(); @@ -104,7 +104,7 @@ void RWHeaderSection_GeneralModule::CopyCase(const Standard_Integer CN, const Ha break; case 3 : { - Standard_Integer i; + Standard_Integer i = 0; DeclareAndCast(HeaderSection_FileSchema,enfr,entfrom); DeclareAndCast(HeaderSection_FileSchema,ento,entto); Standard_Integer nbs = enfr->NbSchemaIdentifiers(); diff --git a/src/RWHeaderSection/RWHeaderSection_RWFileName.cxx b/src/RWHeaderSection/RWHeaderSection_RWFileName.cxx index ce21bc82df..53b9daab7b 100644 --- a/src/RWHeaderSection/RWHeaderSection_RWFileName.cxx +++ b/src/RWHeaderSection/RWHeaderSection_RWFileName.cxx @@ -46,7 +46,7 @@ void RWHeaderSection_RWFileName::ReadStep Handle(Interface_HArray1OfHAsciiString) aAuthor; Handle(TCollection_HAsciiString) aAuthorItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; nsub3 = data->SubListNumber(num, 3, Standard_False); if (nsub3 !=0) { Standard_Integer nb3 = data->NbParams(nsub3); @@ -65,7 +65,7 @@ void RWHeaderSection_RWFileName::ReadStep Handle(Interface_HArray1OfHAsciiString) aOrganization; Handle(TCollection_HAsciiString) aOrganizationItem; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; nsub4 = data->SubListNumber(num, 4, Standard_False); if (nsub4 !=0) { Standard_Integer nb4 = data->NbParams(nsub4); diff --git a/src/RWHeaderSection/RWHeaderSection_RWFileSchema.cxx b/src/RWHeaderSection/RWHeaderSection_RWFileSchema.cxx index 4c2422a23b..58bdafaef5 100644 --- a/src/RWHeaderSection/RWHeaderSection_RWFileSchema.cxx +++ b/src/RWHeaderSection/RWHeaderSection_RWFileSchema.cxx @@ -36,7 +36,7 @@ void RWHeaderSection_RWFileSchema::ReadStep Handle(Interface_HArray1OfHAsciiString) aSchemaIdentifiers; Handle(TCollection_HAsciiString) aSchemaIdentifiersItem; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; nsub1 = data->SubListNumber(num, 1, Standard_False); if (nsub1 !=0) { Standard_Integer nb1 = data->NbParams(nsub1); diff --git a/src/RWObj/RWObj_ConfigurationNode.cxx b/src/RWObj/RWObj_ConfigurationNode.cxx index 94b6b1d4d8..8042a1ff23 100644 --- a/src/RWObj/RWObj_ConfigurationNode.cxx +++ b/src/RWObj/RWObj_ConfigurationNode.cxx @@ -40,9 +40,9 @@ RWObj_ConfigurationNode::RWObj_ConfigurationNode() : // purpose : //======================================================================= RWObj_ConfigurationNode::RWObj_ConfigurationNode(const Handle(RWObj_ConfigurationNode)& theNode) - :DE_ConfigurationNode(theNode) + :DE_ConfigurationNode(theNode), InternalParameters(theNode->InternalParameters) { - InternalParameters = theNode->InternalParameters; + } //======================================================================= diff --git a/src/RWPly/RWPly_ConfigurationNode.cxx b/src/RWPly/RWPly_ConfigurationNode.cxx index fb978975f6..bc593b7810 100644 --- a/src/RWPly/RWPly_ConfigurationNode.cxx +++ b/src/RWPly/RWPly_ConfigurationNode.cxx @@ -34,9 +34,9 @@ RWPly_ConfigurationNode::RWPly_ConfigurationNode() : // purpose : //======================================================================= RWPly_ConfigurationNode::RWPly_ConfigurationNode(const Handle(RWPly_ConfigurationNode)& theNode) - :DE_ConfigurationNode(theNode) + :DE_ConfigurationNode(theNode), InternalParameters(theNode->InternalParameters) { - InternalParameters = theNode->InternalParameters; + } //======================================================================= diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedApprovalAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedApprovalAssignment.cxx index 6f2b432652..2a035dae84 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedApprovalAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedApprovalAssignment.cxx @@ -45,7 +45,7 @@ void RWStepAP214_RWAppliedApprovalAssignment::ReadStep Handle(StepAP214_HArray1OfApprovalItem) aItems; StepAP214_ApprovalItem aItemsItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepAP214_HArray1OfApprovalItem (1, nb2); diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedDateAndTimeAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedDateAndTimeAssignment.cxx index d6bce424a0..4231d32f36 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedDateAndTimeAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedDateAndTimeAssignment.cxx @@ -52,7 +52,7 @@ void RWStepAP214_RWAppliedDateAndTimeAssignment::ReadStep Handle(StepAP214_HArray1OfDateAndTimeItem) aItems; StepAP214_DateAndTimeItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList(num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfDateAndTimeItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedDateAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedDateAssignment.cxx index 82c9de1e9d..56f7c00688 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedDateAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedDateAssignment.cxx @@ -51,7 +51,7 @@ void RWStepAP214_RWAppliedDateAssignment::ReadStep Handle(StepAP214_HArray1OfDateItem) aItems; StepAP214_DateItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList(num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfDateItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedDocumentReference.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedDocumentReference.cxx index 216bd47e08..5fbec809fe 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedDocumentReference.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedDocumentReference.cxx @@ -51,7 +51,7 @@ void RWStepAP214_RWAppliedDocumentReference::ReadStep Handle(StepAP214_HArray1OfDocumentReferenceItem) aItems; StepAP214_DocumentReferenceItem anItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfDocumentReferenceItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedOrganizationAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedOrganizationAssignment.cxx index 212a144c17..7f86732e77 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedOrganizationAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedOrganizationAssignment.cxx @@ -51,7 +51,7 @@ void RWStepAP214_RWAppliedOrganizationAssignment::ReadStep Handle(StepAP214_HArray1OfOrganizationItem) aItems; StepAP214_OrganizationItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfOrganizationItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedPersonAndOrganizationAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedPersonAndOrganizationAssignment.cxx index 08641a3f06..637e72b3b9 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedPersonAndOrganizationAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedPersonAndOrganizationAssignment.cxx @@ -51,7 +51,7 @@ void RWStepAP214_RWAppliedPersonAndOrganizationAssignment::ReadStep Handle(StepAP214_HArray1OfPersonAndOrganizationItem) aItems; StepAP214_PersonAndOrganizationItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfPersonAndOrganizationItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedPresentedItem.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedPresentedItem.cxx index a63da386f6..46d5498f1e 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedPresentedItem.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedPresentedItem.cxx @@ -39,7 +39,7 @@ void RWStepAP214_RWAppliedPresentedItem::ReadStep Handle(StepAP214_HArray1OfPresentedItemSelect) aItems; StepAP214_PresentedItemSelect anent1; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"items",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aItems = new StepAP214_HArray1OfPresentedItemSelect (1, nb1); diff --git a/src/RWStepAP214/RWStepAP214_RWAppliedSecurityClassificationAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAppliedSecurityClassificationAssignment.cxx index abec76cb42..5eb6585d3e 100644 --- a/src/RWStepAP214/RWStepAP214_RWAppliedSecurityClassificationAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAppliedSecurityClassificationAssignment.cxx @@ -45,7 +45,7 @@ void RWStepAP214_RWAppliedSecurityClassificationAssignment::ReadStep Handle(StepAP214_HArray1OfSecurityClassificationItem) aItems; StepAP214_SecurityClassificationItem anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepAP214_HArray1OfSecurityClassificationItem (1, nb2); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignActualDateAndTimeAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignActualDateAndTimeAssignment.cxx index ad25f506b0..e5d30fc280 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignActualDateAndTimeAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignActualDateAndTimeAssignment.cxx @@ -51,7 +51,7 @@ void RWStepAP214_RWAutoDesignActualDateAndTimeAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignDateAndTimeItem) aItems; StepAP214_AutoDesignDateAndTimeItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList(num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfAutoDesignDateAndTimeItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignActualDateAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignActualDateAssignment.cxx index 11b9ac4182..507aa80442 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignActualDateAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignActualDateAssignment.cxx @@ -51,7 +51,7 @@ void RWStepAP214_RWAutoDesignActualDateAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignDatedItem) aItems; StepAP214_AutoDesignDatedItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList(num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfAutoDesignDatedItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignApprovalAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignApprovalAssignment.cxx index 507ae30fc1..01369e7981 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignApprovalAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignApprovalAssignment.cxx @@ -45,7 +45,7 @@ void RWStepAP214_RWAutoDesignApprovalAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignGeneralOrgItem) aItems; StepAP214_AutoDesignGeneralOrgItem aItemsItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepAP214_HArray1OfAutoDesignGeneralOrgItem (1, nb2); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignDateAndPersonAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignDateAndPersonAssignment.cxx index dd69e73de1..70b2beffd9 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignDateAndPersonAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignDateAndPersonAssignment.cxx @@ -51,7 +51,7 @@ void RWStepAP214_RWAutoDesignDateAndPersonAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignDateAndPersonItem) aItems; StepAP214_AutoDesignDateAndPersonItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfAutoDesignDateAndPersonItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignDocumentReference.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignDocumentReference.cxx index 0c3203c71f..302cee29f4 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignDocumentReference.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignDocumentReference.cxx @@ -51,7 +51,7 @@ void RWStepAP214_RWAutoDesignDocumentReference::ReadStep Handle(StepAP214_HArray1OfAutoDesignReferencingItem) aItems; StepAP214_AutoDesignReferencingItem anItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfAutoDesignReferencingItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignGroupAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignGroupAssignment.cxx index ffaa967262..983853c1ac 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignGroupAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignGroupAssignment.cxx @@ -45,7 +45,7 @@ void RWStepAP214_RWAutoDesignGroupAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignGroupedItem) aItems; StepAP214_AutoDesignGroupedItem aItemsItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepAP214_HArray1OfAutoDesignGroupedItem (1, nb2); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignNominalDateAndTimeAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignNominalDateAndTimeAssignment.cxx index 0499f246a7..965cdab4bd 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignNominalDateAndTimeAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignNominalDateAndTimeAssignment.cxx @@ -50,7 +50,7 @@ void RWStepAP214_RWAutoDesignNominalDateAndTimeAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignDateAndTimeItem) aItems; StepAP214_AutoDesignDateAndTimeItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfAutoDesignDateAndTimeItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignNominalDateAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignNominalDateAssignment.cxx index 25d71d400b..355c4c8e30 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignNominalDateAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignNominalDateAssignment.cxx @@ -50,7 +50,7 @@ void RWStepAP214_RWAutoDesignNominalDateAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignDatedItem) aItems; StepAP214_AutoDesignDatedItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfAutoDesignDatedItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignOrganizationAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignOrganizationAssignment.cxx index bd6ce39a81..261ea3626f 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignOrganizationAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignOrganizationAssignment.cxx @@ -50,7 +50,7 @@ void RWStepAP214_RWAutoDesignOrganizationAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignGeneralOrgItem) aItems; StepAP214_AutoDesignGeneralOrgItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfAutoDesignGeneralOrgItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignPersonAndOrganizationAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignPersonAndOrganizationAssignment.cxx index 0ca49e6f37..17d1f8baeb 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignPersonAndOrganizationAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignPersonAndOrganizationAssignment.cxx @@ -50,7 +50,7 @@ void RWStepAP214_RWAutoDesignPersonAndOrganizationAssignment::ReadStep Handle(StepAP214_HArray1OfAutoDesignGeneralOrgItem) aItems; StepAP214_AutoDesignGeneralOrgItem aItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aItems = new StepAP214_HArray1OfAutoDesignGeneralOrgItem (1, nb3); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignPresentedItem.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignPresentedItem.cxx index e522d32f7f..61eac84256 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignPresentedItem.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignPresentedItem.cxx @@ -39,7 +39,7 @@ void RWStepAP214_RWAutoDesignPresentedItem::ReadStep Handle(StepAP214_HArray1OfAutoDesignPresentedItemSelect) aItems; StepAP214_AutoDesignPresentedItemSelect anent1; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"items",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aItems = new StepAP214_HArray1OfAutoDesignPresentedItemSelect (1, nb1); diff --git a/src/RWStepAP214/RWStepAP214_RWAutoDesignSecurityClassificationAssignment.cxx b/src/RWStepAP214/RWStepAP214_RWAutoDesignSecurityClassificationAssignment.cxx index 8ca4e6a8e5..d3b6e36125 100644 --- a/src/RWStepAP214/RWStepAP214_RWAutoDesignSecurityClassificationAssignment.cxx +++ b/src/RWStepAP214/RWStepAP214_RWAutoDesignSecurityClassificationAssignment.cxx @@ -45,7 +45,7 @@ void RWStepAP214_RWAutoDesignSecurityClassificationAssignment::ReadStep Handle(StepBasic_HArray1OfApproval) aItems; Handle(StepBasic_Approval) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepBasic_HArray1OfApproval (1, nb2); diff --git a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx index a12fe181ae..069ec5c33e 100644 --- a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx +++ b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx @@ -3656,7 +3656,7 @@ Standard_Integer RWStepAP214_ReadWriteModule::CaseStep { // FMA - le 25-07-96 : Optimisation -> on teste en premier les types les plus // frequents dans le fichier cad geometry/topology - Standard_Integer num; + Standard_Integer num = 0; if (key.IsEqual(Reco_CartesianPoint)) return 59; // car tres courant if (typenums.Find(key, num)) return num; if (typeshor.Find(key, num)) return num; // AJOUT DES TYPES COURTS @@ -3688,7 +3688,7 @@ Standard_Integer RWStepAP214_ReadWriteModule::CaseStep // SHORT TYPES // Pas tres elegant : on convertit d abord // Sinon, il faudrait sortir des routines - Standard_Integer i,num = 0; + Standard_Integer i = 0,num = 0; for (i = 1; i <= NbComp; i ++) { if (typeshor.IsBound(theTypes(i))) { num = 1; break; } } diff --git a/src/RWStepAP242/RWStepAP242_RWDraughtingModelItemAssociation.cxx b/src/RWStepAP242/RWStepAP242_RWDraughtingModelItemAssociation.cxx index a1600f3a58..4ead229c9d 100644 --- a/src/RWStepAP242/RWStepAP242_RWDraughtingModelItemAssociation.cxx +++ b/src/RWStepAP242/RWStepAP242_RWDraughtingModelItemAssociation.cxx @@ -57,7 +57,7 @@ void RWStepAP242_RWDraughtingModelItemAssociation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) anItems; Handle(StepRepr_RepresentationItem) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; Interface_ParamType aType = data->ParamType(num, 5); if (aType == Interface_ParamIdent) { data->ReadEntity(num, 5,"item_identified_representation_usage.identified_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anEnt); @@ -117,7 +117,7 @@ void RWStepAP242_RWDraughtingModelItemAssociation::Share( // Inherited fields of ItemIdentifiedRepresentationUsage iter.AddItem(ent->Definition().Value()); - Standard_Integer i, nb = ent->NbIdentifiedItem(); + Standard_Integer i = 0, nb = ent->NbIdentifiedItem(); for (i = 1; i <= nb; i++) iter.AddItem (ent->IdentifiedItemValue(i)); } diff --git a/src/RWStepAP242/RWStepAP242_RWGeometricItemSpecificUsage.cxx b/src/RWStepAP242/RWStepAP242_RWGeometricItemSpecificUsage.cxx index be4e8819ab..1f4484d1c1 100644 --- a/src/RWStepAP242/RWStepAP242_RWGeometricItemSpecificUsage.cxx +++ b/src/RWStepAP242/RWStepAP242_RWGeometricItemSpecificUsage.cxx @@ -55,7 +55,7 @@ void RWStepAP242_RWGeometricItemSpecificUsage::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) anItems; Handle(StepRepr_RepresentationItem) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; Interface_ParamType aType = data->ParamType(num, 5); if (aType == Interface_ParamIdent) { data->ReadEntity(num, 5,"item_identified_representation_usage.identified_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anEnt); @@ -109,7 +109,7 @@ void RWStepAP242_RWGeometricItemSpecificUsage::Share( // Inherited fields of ItemIdentifiedRepresentationUsage iter.AddItem(ent->Definition().Value()); - Standard_Integer i, nb = ent->NbIdentifiedItem(); + Standard_Integer i = 0, nb = ent->NbIdentifiedItem(); for (i = 1; i <= nb; i++) iter.AddItem (ent->IdentifiedItemValue(i)); } diff --git a/src/RWStepAP242/RWStepAP242_RWItemIdentifiedRepresentationUsage.cxx b/src/RWStepAP242/RWStepAP242_RWItemIdentifiedRepresentationUsage.cxx index a4065e0f1f..14878070c8 100644 --- a/src/RWStepAP242/RWStepAP242_RWItemIdentifiedRepresentationUsage.cxx +++ b/src/RWStepAP242/RWStepAP242_RWItemIdentifiedRepresentationUsage.cxx @@ -60,7 +60,7 @@ void RWStepAP242_RWItemIdentifiedRepresentationUsage::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) anItems; Handle(StepRepr_RepresentationItem) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; Interface_ParamType aType = data->ParamType(num, 5); if (aType == Interface_ParamIdent) { data->ReadEntity(num, 5,"item_identified_representation_usage.identified_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anEnt); @@ -124,7 +124,7 @@ void RWStepAP242_RWItemIdentifiedRepresentationUsage::Share( Interface_EntityIterator& iter) const { iter.AddItem(ent->Definition().Value()); - Standard_Integer i, nb = ent->NbIdentifiedItem(); + Standard_Integer i = 0, nb = ent->NbIdentifiedItem(); for (i = 1; i <= nb; i++) iter.AddItem (ent->IdentifiedItemValue(i)); } diff --git a/src/RWStepBasic/RWStepBasic_RWApplicationProtocolDefinition.cxx b/src/RWStepBasic/RWStepBasic_RWApplicationProtocolDefinition.cxx index 839d09b920..6dcd0fc70c 100644 --- a/src/RWStepBasic/RWStepBasic_RWApplicationProtocolDefinition.cxx +++ b/src/RWStepBasic/RWStepBasic_RWApplicationProtocolDefinition.cxx @@ -47,7 +47,7 @@ void RWStepBasic_RWApplicationProtocolDefinition::ReadStep // --- own field : applicationProtocolYear --- - Standard_Integer aApplicationProtocolYear; + Standard_Integer aApplicationProtocolYear = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"application_protocol_year",ach,aApplicationProtocolYear); diff --git a/src/RWStepBasic/RWStepBasic_RWCalendarDate.cxx b/src/RWStepBasic/RWStepBasic_RWCalendarDate.cxx index 4434bba189..41da3f0f82 100644 --- a/src/RWStepBasic/RWStepBasic_RWCalendarDate.cxx +++ b/src/RWStepBasic/RWStepBasic_RWCalendarDate.cxx @@ -33,19 +33,19 @@ void RWStepBasic_RWCalendarDate::ReadStep // --- inherited field : yearComponent --- - Standard_Integer aYearComponent; + Standard_Integer aYearComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"year_component",ach,aYearComponent); // --- own field : dayComponent --- - Standard_Integer aDayComponent; + Standard_Integer aDayComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"day_component",ach,aDayComponent); // --- own field : monthComponent --- - Standard_Integer aMonthComponent; + Standard_Integer aMonthComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"month_component",ach,aMonthComponent); diff --git a/src/RWStepBasic/RWStepBasic_RWCoordinatedUniversalTimeOffset.cxx b/src/RWStepBasic/RWStepBasic_RWCoordinatedUniversalTimeOffset.cxx index 8c375e2158..e162e21204 100644 --- a/src/RWStepBasic/RWStepBasic_RWCoordinatedUniversalTimeOffset.cxx +++ b/src/RWStepBasic/RWStepBasic_RWCoordinatedUniversalTimeOffset.cxx @@ -39,13 +39,13 @@ void RWStepBasic_RWCoordinatedUniversalTimeOffset::ReadStep // --- own field : hourOffset --- - Standard_Integer aHourOffset; + Standard_Integer aHourOffset = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"hour_offset",ach,aHourOffset); // --- own field : minuteOffset --- - Standard_Integer aMinuteOffset; + Standard_Integer aMinuteOffset = 0; Standard_Boolean hasAminuteOffset = Standard_True; if (data->IsParamDefined(num,2)) { //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed diff --git a/src/RWStepBasic/RWStepBasic_RWDate.cxx b/src/RWStepBasic/RWStepBasic_RWDate.cxx index 2d97d75776..023301cda8 100644 --- a/src/RWStepBasic/RWStepBasic_RWDate.cxx +++ b/src/RWStepBasic/RWStepBasic_RWDate.cxx @@ -33,7 +33,7 @@ void RWStepBasic_RWDate::ReadStep // --- own field : yearComponent --- - Standard_Integer aYearComponent; + Standard_Integer aYearComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"year_component",ach,aYearComponent); diff --git a/src/RWStepBasic/RWStepBasic_RWDerivedUnit.cxx b/src/RWStepBasic/RWStepBasic_RWDerivedUnit.cxx index 5d864a2ed5..3540367a22 100644 --- a/src/RWStepBasic/RWStepBasic_RWDerivedUnit.cxx +++ b/src/RWStepBasic/RWStepBasic_RWDerivedUnit.cxx @@ -39,7 +39,7 @@ void RWStepBasic_RWDerivedUnit::ReadStep Handle(StepBasic_HArray1OfDerivedUnitElement) elts; Handle(StepBasic_DerivedUnitElement) anelt; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"elements",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); elts = new StepBasic_HArray1OfDerivedUnitElement (1,nb1); @@ -64,7 +64,7 @@ void RWStepBasic_RWDerivedUnit::WriteStep // --- own field : dimensions --- - Standard_Integer i, nb = ent->NbElements(); + Standard_Integer i = 0, nb = ent->NbElements(); SW.OpenSub(); for (i = 1; i <= nb; i ++) { SW.Send (ent->ElementsValue(i)); @@ -76,7 +76,7 @@ void RWStepBasic_RWDerivedUnit::WriteStep void RWStepBasic_RWDerivedUnit::Share(const Handle(StepBasic_DerivedUnit)& ent, Interface_EntityIterator& iter) const { - Standard_Integer i, nb = ent->NbElements(); + Standard_Integer i = 0, nb = ent->NbElements(); for (i = 1; i <= nb; i ++) { iter.GetOneItem(ent->ElementsValue(i)); } diff --git a/src/RWStepBasic/RWStepBasic_RWDerivedUnitElement.cxx b/src/RWStepBasic/RWStepBasic_RWDerivedUnitElement.cxx index 8ab38093d2..b306c9f627 100644 --- a/src/RWStepBasic/RWStepBasic_RWDerivedUnitElement.cxx +++ b/src/RWStepBasic/RWStepBasic_RWDerivedUnitElement.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -38,7 +40,7 @@ void RWStepBasic_RWDerivedUnitElement::ReadStep Handle(StepBasic_NamedUnit) nu; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadEntity(num, 1,"unit", ach, STANDARD_TYPE(StepBasic_NamedUnit), nu); - Standard_Real expo; + Standard_Real expo = NAN; //szv#4:S4163:12Mar99 `stat1 =` not needed data->ReadReal (num,2,"exponent", ach, expo); diff --git a/src/RWStepBasic/RWStepBasic_RWDimensionalExponents.cxx b/src/RWStepBasic/RWStepBasic_RWDimensionalExponents.cxx index b80ed63574..554feb062c 100644 --- a/src/RWStepBasic/RWStepBasic_RWDimensionalExponents.cxx +++ b/src/RWStepBasic/RWStepBasic_RWDimensionalExponents.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -33,43 +35,43 @@ void RWStepBasic_RWDimensionalExponents::ReadStep // --- own field : lengthExponent --- - Standard_Real aLengthExponent; + Standard_Real aLengthExponent = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadReal (num,1,"length_exponent",ach,aLengthExponent); // --- own field : massExponent --- - Standard_Real aMassExponent; + Standard_Real aMassExponent = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadReal (num,2,"mass_exponent",ach,aMassExponent); // --- own field : timeExponent --- - Standard_Real aTimeExponent; + Standard_Real aTimeExponent = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"time_exponent",ach,aTimeExponent); // --- own field : electricCurrentExponent --- - Standard_Real aElectricCurrentExponent; + Standard_Real aElectricCurrentExponent = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"electric_current_exponent",ach,aElectricCurrentExponent); // --- own field : thermodynamicTemperatureExponent --- - Standard_Real aThermodynamicTemperatureExponent; + Standard_Real aThermodynamicTemperatureExponent = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadReal (num,5,"thermodynamic_temperature_exponent",ach,aThermodynamicTemperatureExponent); // --- own field : amountOfSubstanceExponent --- - Standard_Real aAmountOfSubstanceExponent; + Standard_Real aAmountOfSubstanceExponent = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat6 =` not needed data->ReadReal (num,6,"amount_of_substance_exponent",ach,aAmountOfSubstanceExponent); // --- own field : luminousIntensityExponent --- - Standard_Real aLuminousIntensityExponent; + Standard_Real aLuminousIntensityExponent = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat7 =` not needed data->ReadReal (num,7,"luminous_intensity_exponent",ach,aLuminousIntensityExponent); diff --git a/src/RWStepBasic/RWStepBasic_RWEulerAngles.cxx b/src/RWStepBasic/RWStepBasic_RWEulerAngles.cxx index ffe2935e89..ee1bca974d 100644 --- a/src/RWStepBasic/RWStepBasic_RWEulerAngles.cxx +++ b/src/RWStepBasic/RWStepBasic_RWEulerAngles.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -54,7 +56,7 @@ void RWStepBasic_RWEulerAngles::ReadStep (const Handle(StepData_StepReaderData)& aAngles = new TColStd_HArray1OfReal (1, nb0); Standard_Integer num2 = sub1; for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; data->ReadReal (num2, i0, "real", ach, anIt0); aAngles->SetValue(i0, anIt0); } diff --git a/src/RWStepBasic/RWStepBasic_RWLocalTime.cxx b/src/RWStepBasic/RWStepBasic_RWLocalTime.cxx index 3ac134951b..ac56fb45e8 100644 --- a/src/RWStepBasic/RWStepBasic_RWLocalTime.cxx +++ b/src/RWStepBasic/RWStepBasic_RWLocalTime.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -35,13 +37,13 @@ void RWStepBasic_RWLocalTime::ReadStep // --- own field : hourComponent --- - Standard_Integer aHourComponent; + Standard_Integer aHourComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"hour_component",ach,aHourComponent); // --- own field : minuteComponent --- - Standard_Integer aMinuteComponent; + Standard_Integer aMinuteComponent = 0; Standard_Boolean hasAminuteComponent = Standard_True; if (data->IsParamDefined(num,2)) { //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed @@ -54,7 +56,7 @@ void RWStepBasic_RWLocalTime::ReadStep // --- own field : secondComponent --- - Standard_Real aSecondComponent; + Standard_Real aSecondComponent = NAN; Standard_Boolean hasAsecondComponent = Standard_True; if (data->IsParamDefined(num,3)) { //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed diff --git a/src/RWStepBasic/RWStepBasic_RWOrdinalDate.cxx b/src/RWStepBasic/RWStepBasic_RWOrdinalDate.cxx index 5a6d703685..3341cc090e 100644 --- a/src/RWStepBasic/RWStepBasic_RWOrdinalDate.cxx +++ b/src/RWStepBasic/RWStepBasic_RWOrdinalDate.cxx @@ -33,13 +33,13 @@ void RWStepBasic_RWOrdinalDate::ReadStep // --- inherited field : yearComponent --- - Standard_Integer aYearComponent; + Standard_Integer aYearComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"year_component",ach,aYearComponent); // --- own field : dayComponent --- - Standard_Integer aDayComponent; + Standard_Integer aDayComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"day_component",ach,aDayComponent); diff --git a/src/RWStepBasic/RWStepBasic_RWOrganizationalAddress.cxx b/src/RWStepBasic/RWStepBasic_RWOrganizationalAddress.cxx index 181f23882e..cb2e3b5700 100644 --- a/src/RWStepBasic/RWStepBasic_RWOrganizationalAddress.cxx +++ b/src/RWStepBasic/RWStepBasic_RWOrganizationalAddress.cxx @@ -195,7 +195,7 @@ void RWStepBasic_RWOrganizationalAddress::ReadStep Handle(StepBasic_HArray1OfOrganization) aOrganizations; Handle(StepBasic_Organization) anent13; - Standard_Integer nsub13; + Standard_Integer nsub13 = 0; if (data->ReadSubList (num,13,"organizations",ach,nsub13)) { Standard_Integer nb13 = data->NbParams(nsub13); aOrganizations = new StepBasic_HArray1OfOrganization (1, nb13); diff --git a/src/RWStepBasic/RWStepBasic_RWPerson.cxx b/src/RWStepBasic/RWStepBasic_RWPerson.cxx index 345dd2a8c9..18d84dc2dd 100644 --- a/src/RWStepBasic/RWStepBasic_RWPerson.cxx +++ b/src/RWStepBasic/RWStepBasic_RWPerson.cxx @@ -70,7 +70,7 @@ void RWStepBasic_RWPerson::ReadStep Standard_Boolean hasAmiddleNames = Standard_True; if (data->IsParamDefined(num,4)) { Handle(TCollection_HAsciiString) aMiddleNamesItem; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"middle_names",ach,nsub4)) { Standard_Integer nb4 = data->NbParams(nsub4); aMiddleNames = new Interface_HArray1OfHAsciiString (1, nb4); @@ -92,7 +92,7 @@ void RWStepBasic_RWPerson::ReadStep Standard_Boolean hasAprefixTitles = Standard_True; if (data->IsParamDefined(num,5)) { Handle(TCollection_HAsciiString) aPrefixTitlesItem; - Standard_Integer nsub5; + Standard_Integer nsub5 = 0; if (data->ReadSubList (num,5,"prefix_titles",ach,nsub5)) { Standard_Integer nb5 = data->NbParams(nsub5); aPrefixTitles = new Interface_HArray1OfHAsciiString (1, nb5); @@ -114,7 +114,7 @@ void RWStepBasic_RWPerson::ReadStep Standard_Boolean hasAsuffixTitles = Standard_True; if (data->IsParamDefined(num,6)) { Handle(TCollection_HAsciiString) aSuffixTitlesItem; - Standard_Integer nsub6; + Standard_Integer nsub6 = 0; if (data->ReadSubList (num,6,"suffix_titles",ach,nsub6)) { Standard_Integer nb6 = data->NbParams(nsub6); aSuffixTitles = new Interface_HArray1OfHAsciiString (1, nb6); diff --git a/src/RWStepBasic/RWStepBasic_RWPersonalAddress.cxx b/src/RWStepBasic/RWStepBasic_RWPersonalAddress.cxx index 560669934e..58463a0def 100644 --- a/src/RWStepBasic/RWStepBasic_RWPersonalAddress.cxx +++ b/src/RWStepBasic/RWStepBasic_RWPersonalAddress.cxx @@ -195,7 +195,7 @@ void RWStepBasic_RWPersonalAddress::ReadStep Handle(StepBasic_HArray1OfPerson) aPeople; Handle(StepBasic_Person) anent13; - Standard_Integer nsub13; + Standard_Integer nsub13 = 0; if (data->ReadSubList (num,13,"people",ach,nsub13)) { Standard_Integer nb13 = data->NbParams(nsub13); aPeople = new StepBasic_HArray1OfPerson (1, nb13); diff --git a/src/RWStepBasic/RWStepBasic_RWProduct.cxx b/src/RWStepBasic/RWStepBasic_RWProduct.cxx index 63a8754ec5..047aca0c6f 100644 --- a/src/RWStepBasic/RWStepBasic_RWProduct.cxx +++ b/src/RWStepBasic/RWStepBasic_RWProduct.cxx @@ -58,7 +58,7 @@ void RWStepBasic_RWProduct::ReadStep Handle(StepBasic_HArray1OfProductContext) aFrameOfReference; Handle(StepBasic_ProductContext) anent4; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"frame_of_reference",ach,nsub4)) { Standard_Integer nb4 = data->NbParams(nsub4); aFrameOfReference = new StepBasic_HArray1OfProductContext (1, nb4); diff --git a/src/RWStepBasic/RWStepBasic_RWProductDefinitionWithAssociatedDocuments.cxx b/src/RWStepBasic/RWStepBasic_RWProductDefinitionWithAssociatedDocuments.cxx index d93b3944e6..a5374c3d26 100644 --- a/src/RWStepBasic/RWStepBasic_RWProductDefinitionWithAssociatedDocuments.cxx +++ b/src/RWStepBasic/RWStepBasic_RWProductDefinitionWithAssociatedDocuments.cxx @@ -63,7 +63,7 @@ void RWStepBasic_RWProductDefinitionWithAssociatedDocuments::ReadStep Handle(StepBasic_HArray1OfDocument) aDocIds; Handle(StepBasic_Document) anent5; - Standard_Integer nsub5; + Standard_Integer nsub5 = 0; if (data->ReadSubList (num,5,"frame_of_reference",ach,nsub5)) { Standard_Integer nb5 = data->NbParams(nsub5); if (nb5 > 0) aDocIds = new StepBasic_HArray1OfDocument (1, nb5); @@ -104,7 +104,7 @@ void RWStepBasic_RWProductDefinitionWithAssociatedDocuments::WriteStep // -- own : list SW.OpenSub(); - Standard_Integer i,nb = ent->NbDocIds(); + Standard_Integer i = 0,nb = ent->NbDocIds(); for (i = 1; i <= nb; i ++) SW.Send (ent->DocIdsValue(i)); SW.CloseSub(); @@ -119,6 +119,6 @@ void RWStepBasic_RWProductDefinitionWithAssociatedDocuments::Share(const Handle( iter.GetOneItem(ent->FrameOfReference()); - Standard_Integer i,nb = ent->NbDocIds(); + Standard_Integer i = 0,nb = ent->NbDocIds(); for (i = 1; i <= nb; i ++) iter.AddItem (ent->DocIdsValue(i)); } diff --git a/src/RWStepBasic/RWStepBasic_RWProductRelatedProductCategory.cxx b/src/RWStepBasic/RWStepBasic_RWProductRelatedProductCategory.cxx index 2f8e1907ba..3685da533c 100644 --- a/src/RWStepBasic/RWStepBasic_RWProductRelatedProductCategory.cxx +++ b/src/RWStepBasic/RWStepBasic_RWProductRelatedProductCategory.cxx @@ -57,7 +57,7 @@ void RWStepBasic_RWProductRelatedProductCategory::ReadStep Handle(StepBasic_HArray1OfProduct) aProducts; Handle(StepBasic_Product) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"products",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aProducts = new StepBasic_HArray1OfProduct (1, nb3); diff --git a/src/RWStepBasic/RWStepBasic_RWProductType.cxx b/src/RWStepBasic/RWStepBasic_RWProductType.cxx index b073a4a56c..51f55e4744 100644 --- a/src/RWStepBasic/RWStepBasic_RWProductType.cxx +++ b/src/RWStepBasic/RWStepBasic_RWProductType.cxx @@ -57,7 +57,7 @@ void RWStepBasic_RWProductType::ReadStep Handle(StepBasic_HArray1OfProduct) aProducts; Handle(StepBasic_Product) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"products",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aProducts = new StepBasic_HArray1OfProduct (1, nb3); diff --git a/src/RWStepBasic/RWStepBasic_RWWeekOfYearAndDayDate.cxx b/src/RWStepBasic/RWStepBasic_RWWeekOfYearAndDayDate.cxx index 46194f26ed..3dee63057b 100644 --- a/src/RWStepBasic/RWStepBasic_RWWeekOfYearAndDayDate.cxx +++ b/src/RWStepBasic/RWStepBasic_RWWeekOfYearAndDayDate.cxx @@ -33,19 +33,19 @@ void RWStepBasic_RWWeekOfYearAndDayDate::ReadStep // --- inherited field : yearComponent --- - Standard_Integer aYearComponent; + Standard_Integer aYearComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"year_component",ach,aYearComponent); // --- own field : weekComponent --- - Standard_Integer aWeekComponent; + Standard_Integer aWeekComponent = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"week_component",ach,aWeekComponent); // --- own field : dayComponent --- - Standard_Integer aDayComponent; + Standard_Integer aDayComponent = 0; Standard_Boolean hasAdayComponent = Standard_True; if (data->IsParamDefined(num,3)) { //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed diff --git a/src/RWStepDimTol/RWStepDimTol_RWDatumReference.cxx b/src/RWStepDimTol/RWStepDimTol_RWDatumReference.cxx index 3cc2bbe946..315def406f 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWDatumReference.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWDatumReference.cxx @@ -45,7 +45,7 @@ void RWStepDimTol_RWDatumReference::ReadStep (const Handle(StepData_StepReaderDa // Own fields of DatumReference - Standard_Integer aPrecedence; + Standard_Integer aPrecedence = 0; data->ReadInteger (num, 1, "precedence", ach, aPrecedence); Handle(StepDimTol_Datum) aReferencedDatum; diff --git a/src/RWStepDimTol/RWStepDimTol_RWDatumReferenceCompartment.cxx b/src/RWStepDimTol/RWStepDimTol_RWDatumReferenceCompartment.cxx index 591e284c81..8f0d62ad6b 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWDatumReferenceCompartment.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWDatumReferenceCompartment.cxx @@ -76,11 +76,11 @@ void RWStepDimTol_RWDatumReferenceCompartment::ReadStep (const Handle(StepData_S else { Handle(StepDimTol_HArray1OfDatumReferenceElement) anItems; Handle(StepDimTol_DatumReferenceElement) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,5,"general_datum_reference.base",ach,nbSub)) { aType = data->ParamType(nbSub, 1); if (aType == Interface_ParamSub) { - Standard_Integer aNewNbSub; + Standard_Integer aNewNbSub = 0; if (data->ReadSubList (nbSub,1,"general_datum_reference.base",ach,aNewNbSub)) { nbSub = aNewNbSub; } @@ -95,7 +95,7 @@ void RWStepDimTol_RWDatumReferenceCompartment::ReadStep (const Handle(StepData_S aBase.SetValue(anItems); } - Standard_Integer nbSub; + Standard_Integer nbSub = 0; Standard_Boolean hasModifiers = data->ReadSubList(num, 6, "general_datum_reference.modifiers", ach, nbSub, Standard_True); Handle(StepDimTol_HArray1OfDatumReferenceModifier) aModifiers; if (hasModifiers) { @@ -157,7 +157,7 @@ void RWStepDimTol_RWDatumReferenceCompartment::WriteStep (StepData_StepWriter& S } else if (aBaseType == 2) { Handle(StepDimTol_HArray1OfDatumReferenceElement) anArray = ent->Base().CommonDatumList(); - Standard_Integer i, nb = (anArray.IsNull() ? 0 : anArray->Length()); + Standard_Integer i = 0, nb = (anArray.IsNull() ? 0 : anArray->Length()); SW.OpenTypedSub("COMMON_DATUM_LIST"); for (i = 1; i <= nb; i++) SW.Send (anArray->Value(i)); @@ -165,7 +165,7 @@ void RWStepDimTol_RWDatumReferenceCompartment::WriteStep (StepData_StepWriter& S } if (ent->HasModifiers()) { - Standard_Integer i, nb = ent->NbModifiers(); + Standard_Integer i = 0, nb = ent->NbModifiers(); SW.OpenSub(); for (i = 1; i <= nb; i++) { StepDimTol_DatumReferenceModifier aModifier = ent->ModifiersValue(i); @@ -202,7 +202,7 @@ void RWStepDimTol_RWDatumReferenceCompartment::Share (const Handle(StepDimTol_Da } else if (aBaseType == 2) { Handle(StepDimTol_HArray1OfDatumReferenceElement) anArray = ent->Base().CommonDatumList(); - Standard_Integer i, nb = (anArray.IsNull() ? 0 : anArray->Length()); + Standard_Integer i = 0, nb = (anArray.IsNull() ? 0 : anArray->Length()); for (i = 1; i <= nb; i++) iter.AddItem (anArray->Value(i)); } diff --git a/src/RWStepDimTol/RWStepDimTol_RWDatumReferenceElement.cxx b/src/RWStepDimTol/RWStepDimTol_RWDatumReferenceElement.cxx index 29a5d043e7..2312179d5c 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWDatumReferenceElement.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWDatumReferenceElement.cxx @@ -76,11 +76,11 @@ void RWStepDimTol_RWDatumReferenceElement::ReadStep (const Handle(StepData_StepR else { Handle(StepDimTol_HArray1OfDatumReferenceElement) anItems; Handle(StepDimTol_DatumReferenceElement) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,5,"general_datum_reference.base",ach,nbSub)) { aType = data->ParamType(nbSub, 1); if (aType == Interface_ParamSub) { - Standard_Integer aNewNbSub; + Standard_Integer aNewNbSub = 0; if (data->ReadSubList (nbSub,1,"general_datum_reference.base",ach,aNewNbSub)) { nbSub = aNewNbSub; } @@ -95,7 +95,7 @@ void RWStepDimTol_RWDatumReferenceElement::ReadStep (const Handle(StepData_StepR aBase.SetValue(anItems); } - Standard_Integer nbSub; + Standard_Integer nbSub = 0; Standard_Boolean hasModifiers = data->ReadSubList(num, 6, "general_datum_reference.modifiers", ach, nbSub, Standard_True); Handle(StepDimTol_HArray1OfDatumReferenceModifier) aModifiers; if (hasModifiers) { @@ -157,7 +157,7 @@ void RWStepDimTol_RWDatumReferenceElement::WriteStep (StepData_StepWriter& SW, } else if (aBaseType == 2) { Handle(StepDimTol_HArray1OfDatumReferenceElement) anArray = (ent->Base()).CommonDatumList(); - Standard_Integer i, nb = (anArray.IsNull() ? 0 : anArray->Length()); + Standard_Integer i = 0, nb = (anArray.IsNull() ? 0 : anArray->Length()); SW.OpenTypedSub("COMMON_DATUM_LIST"); for (i = 1; i <= nb; i++) SW.Send (anArray->Value(i)); @@ -165,7 +165,7 @@ void RWStepDimTol_RWDatumReferenceElement::WriteStep (StepData_StepWriter& SW, } if (ent->HasModifiers()) { - Standard_Integer i, nb = ent->NbModifiers(); + Standard_Integer i = 0, nb = ent->NbModifiers(); SW.OpenSub(); for (i = 1; i <= nb; i++) { StepDimTol_DatumReferenceModifier aModifier = ent->ModifiersValue(i); @@ -202,7 +202,7 @@ void RWStepDimTol_RWDatumReferenceElement::Share (const Handle(StepDimTol_DatumR } else if (aBaseType == 2) { Handle(StepDimTol_HArray1OfDatumReferenceElement) anArray = ent->Base().CommonDatumList(); - Standard_Integer i, nb = (anArray.IsNull() ? 0 : anArray->Length()); + Standard_Integer i = 0, nb = (anArray.IsNull() ? 0 : anArray->Length()); for (i = 1; i <= nb; i++) iter.AddItem (anArray->Value(i)); } diff --git a/src/RWStepDimTol/RWStepDimTol_RWDatumSystem.cxx b/src/RWStepDimTol/RWStepDimTol_RWDatumSystem.cxx index 0399d21162..9afff4f847 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWDatumSystem.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWDatumSystem.cxx @@ -63,7 +63,7 @@ void RWStepDimTol_RWDatumSystem::ReadStep (const Handle(StepData_StepReaderData) Handle(StepDimTol_HArray1OfDatumReferenceCompartment) aConstituents; Handle(StepDimTol_DatumReferenceCompartment) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,5,"base",ach,nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); aConstituents = new StepDimTol_HArray1OfDatumReferenceCompartment (1, nbElements); @@ -101,7 +101,7 @@ void RWStepDimTol_RWDatumSystem::WriteStep (StepData_StepWriter& SW, SW.SendLogical (ent->ProductDefinitional()); // Own fields of DatumSystem - Standard_Integer i, nb = ent->NbConstituents(); + Standard_Integer i = 0, nb = ent->NbConstituents(); SW.OpenSub(); for (i = 1; i <= nb; i++) SW.Send (ent->ConstituentsValue(i)); @@ -122,7 +122,7 @@ void RWStepDimTol_RWDatumSystem::Share (const Handle(StepDimTol_DatumSystem) &en iter.AddItem (ent->OfShape()); // Own fields of DatumSystem - Standard_Integer i, nb = ent->NbConstituents(); + Standard_Integer i = 0, nb = ent->NbConstituents(); for (i = 1; i <= nb; i++) iter.AddItem (ent->ConstituentsValue(i)); } diff --git a/src/RWStepDimTol/RWStepDimTol_RWGeneralDatumReference.cxx b/src/RWStepDimTol/RWStepDimTol_RWGeneralDatumReference.cxx index e493785914..fa904ba803 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWGeneralDatumReference.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWGeneralDatumReference.cxx @@ -74,11 +74,11 @@ void RWStepDimTol_RWGeneralDatumReference::ReadStep (const Handle(StepData_StepR else { Handle(StepDimTol_HArray1OfDatumReferenceElement) anItems; Handle(StepDimTol_DatumReferenceElement) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,5,"general_datum_reference.base",ach,nbSub)) { aType = data->ParamType(nbSub, 1); if (aType == Interface_ParamSub) { - Standard_Integer aNewNbSub; + Standard_Integer aNewNbSub = 0; if (data->ReadSubList (nbSub,1,"general_datum_reference.base",ach,aNewNbSub)) { nbSub = aNewNbSub; } @@ -93,7 +93,7 @@ void RWStepDimTol_RWGeneralDatumReference::ReadStep (const Handle(StepData_StepR aBase.SetValue(anItems); } - Standard_Integer nbSub; + Standard_Integer nbSub = 0; Standard_Boolean hasModifiers = data->ReadSubList(num, 6, "general_datum_reference.modifiers", ach, nbSub, Standard_True); Handle(StepDimTol_HArray1OfDatumReferenceModifier) aModifiers; if (hasModifiers) { @@ -155,7 +155,7 @@ void RWStepDimTol_RWGeneralDatumReference::WriteStep (StepData_StepWriter& SW, } else if (aBaseType == 2) { Handle(StepDimTol_HArray1OfDatumReferenceElement) anArray = ent->Base().CommonDatumList(); - Standard_Integer i, nb = (anArray.IsNull() ? 0 : anArray->Length()); + Standard_Integer i = 0, nb = (anArray.IsNull() ? 0 : anArray->Length()); SW.OpenTypedSub("COMMON_DATUM_LIST"); for (i = 1; i <= nb; i++) SW.Send (anArray->Value(i)); @@ -163,7 +163,7 @@ void RWStepDimTol_RWGeneralDatumReference::WriteStep (StepData_StepWriter& SW, } if (ent->HasModifiers()) { - Standard_Integer i, nb = ent->NbModifiers(); + Standard_Integer i = 0, nb = ent->NbModifiers(); SW.OpenSub(); for (i = 1; i <= nb; i++) { StepDimTol_DatumReferenceModifier aModifier = ent->ModifiersValue(i); @@ -201,7 +201,7 @@ void RWStepDimTol_RWGeneralDatumReference::Share (const Handle(StepDimTol_Genera } else if (aBaseType == 2) { Handle(StepDimTol_HArray1OfDatumReferenceElement) anArray = ent->Base().CommonDatumList(); - Standard_Integer i, nb = (anArray.IsNull() ? 0 : anArray->Length()); + Standard_Integer i = 0, nb = (anArray.IsNull() ? 0 : anArray->Length()); for (i = 1; i <= nb; i++) iter.AddItem (anArray->Value(i)); } diff --git a/src/RWStepDimTol/RWStepDimTol_RWNonUniformZoneDefinition.cxx b/src/RWStepDimTol/RWStepDimTol_RWNonUniformZoneDefinition.cxx index f38ce30f58..a7c2ca46a6 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWNonUniformZoneDefinition.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWNonUniformZoneDefinition.cxx @@ -51,7 +51,7 @@ void RWStepDimTol_RWNonUniformZoneDefinition::ReadStep (const Handle(StepData_St Handle(StepRepr_HArray1OfShapeAspect) anItems; Handle(StepRepr_ShapeAspect) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,2,"tolerance_zone_definition.boundaries",ach,nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); anItems = new StepRepr_HArray1OfShapeAspect (1, nbElements); @@ -98,7 +98,7 @@ void RWStepDimTol_RWNonUniformZoneDefinition::Share (const Handle(StepDimTol_Non iter.AddItem (ent->Zone()); - Standard_Integer i, nb = ent->NbBoundaries(); + Standard_Integer i = 0, nb = ent->NbBoundaries(); for (i = 1; i <= nb; i++) iter.AddItem (ent->BoundariesValue(i)); } diff --git a/src/RWStepDimTol/RWStepDimTol_RWProjectedZoneDefinition.cxx b/src/RWStepDimTol/RWStepDimTol_RWProjectedZoneDefinition.cxx index 0e8a57efd6..b4cf27a27b 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWProjectedZoneDefinition.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWProjectedZoneDefinition.cxx @@ -51,7 +51,7 @@ void RWStepDimTol_RWProjectedZoneDefinition::ReadStep (const Handle(StepData_Ste Handle(StepRepr_HArray1OfShapeAspect) anItems; Handle(StepRepr_ShapeAspect) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,2,"tolerance_zone_definition.boundaries",ach,nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); anItems = new StepRepr_HArray1OfShapeAspect (1, nbElements); @@ -112,7 +112,7 @@ void RWStepDimTol_RWProjectedZoneDefinition::Share (const Handle(StepDimTol_Proj iter.AddItem (ent->Zone()); - Standard_Integer i, nb = ent->NbBoundaries(); + Standard_Integer i = 0, nb = ent->NbBoundaries(); for (i = 1; i <= nb; i++) iter.AddItem (ent->BoundariesValue(i)); diff --git a/src/RWStepDimTol/RWStepDimTol_RWRunoutZoneDefinition.cxx b/src/RWStepDimTol/RWStepDimTol_RWRunoutZoneDefinition.cxx index d5c77b1fbf..8e7ec8e08e 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWRunoutZoneDefinition.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWRunoutZoneDefinition.cxx @@ -52,7 +52,7 @@ void RWStepDimTol_RWRunoutZoneDefinition::ReadStep (const Handle(StepData_StepRe Handle(StepRepr_HArray1OfShapeAspect) anItems; Handle(StepRepr_ShapeAspect) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,2,"tolerance_zone_definition.boundaries",ach,nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); anItems = new StepRepr_HArray1OfShapeAspect (1, nbElements); @@ -103,7 +103,7 @@ void RWStepDimTol_RWRunoutZoneDefinition::Share (const Handle(StepDimTol_RunoutZ iter.AddItem (ent->Zone()); - Standard_Integer i, nb = ent->NbBoundaries(); + Standard_Integer i = 0, nb = ent->NbBoundaries(); for (i = 1; i <= nb; i++) iter.AddItem (ent->BoundariesValue(i)); } diff --git a/src/RWStepDimTol/RWStepDimTol_RWToleranceZone.cxx b/src/RWStepDimTol/RWStepDimTol_RWToleranceZone.cxx index d2dde91867..8326952f4c 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWToleranceZone.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWToleranceZone.cxx @@ -65,7 +65,7 @@ void RWStepDimTol_RWToleranceZone::ReadStep (const Handle(StepData_StepReaderDat Handle(StepDimTol_HArray1OfToleranceZoneTarget) anItems; StepDimTol_ToleranceZoneTarget anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,5,"defining_tolerance",ach,nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); anItems = new StepDimTol_HArray1OfToleranceZoneTarget (1, nbElements); @@ -131,7 +131,7 @@ void RWStepDimTol_RWToleranceZone::Share (const Handle(StepDimTol_ToleranceZone) iter.AddItem (ent->OfShape()); // Own fields of ToleranceZone - Standard_Integer i, nb = ent->NbDefiningTolerances(); + Standard_Integer i = 0, nb = ent->NbDefiningTolerances(); for (i = 1; i <= nb; i++) iter.AddItem (ent->DefiningToleranceValue(i).Value()); } diff --git a/src/RWStepDimTol/RWStepDimTol_RWToleranceZoneDefinition.cxx b/src/RWStepDimTol/RWStepDimTol_RWToleranceZoneDefinition.cxx index 215c99e432..69bcb471fd 100644 --- a/src/RWStepDimTol/RWStepDimTol_RWToleranceZoneDefinition.cxx +++ b/src/RWStepDimTol/RWStepDimTol_RWToleranceZoneDefinition.cxx @@ -50,7 +50,7 @@ void RWStepDimTol_RWToleranceZoneDefinition::ReadStep (const Handle(StepData_Ste Handle(StepRepr_HArray1OfShapeAspect) anItems; Handle(StepRepr_ShapeAspect) anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num,2,"boundaries",ach,nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); anItems = new StepRepr_HArray1OfShapeAspect (1, nbElements); @@ -97,7 +97,7 @@ void RWStepDimTol_RWToleranceZoneDefinition::Share (const Handle(StepDimTol_Tole iter.AddItem (ent->Zone()); - Standard_Integer i, nb = ent->NbBoundaries(); + Standard_Integer i = 0, nb = ent->NbBoundaries(); for (i = 1; i <= nb; i++) iter.AddItem (ent->BoundariesValue(i)); } diff --git a/src/RWStepElement/RWStepElement_RWCurveElementEndReleasePacket.cxx b/src/RWStepElement/RWStepElement_RWCurveElementEndReleasePacket.cxx index ab6988a06e..84c01cd53f 100644 --- a/src/RWStepElement/RWStepElement_RWCurveElementEndReleasePacket.cxx +++ b/src/RWStepElement/RWStepElement_RWCurveElementEndReleasePacket.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -47,7 +49,7 @@ void RWStepElement_RWCurveElementEndReleasePacket::ReadStep (const Handle(StepDa StepElement_CurveElementFreedom aReleaseFreedom; data->ReadEntity (num, 1, "release_freedom", ach, aReleaseFreedom); - Standard_Real aReleaseStiffness; + Standard_Real aReleaseStiffness = NAN; data->ReadReal (num, 2, "release_stiffness", ach, aReleaseStiffness); // Initialize entity diff --git a/src/RWStepElement/RWStepElement_RWCurveElementSectionDefinition.cxx b/src/RWStepElement/RWStepElement_RWCurveElementSectionDefinition.cxx index 9f20aae073..c6228e69f3 100644 --- a/src/RWStepElement/RWStepElement_RWCurveElementSectionDefinition.cxx +++ b/src/RWStepElement/RWStepElement_RWCurveElementSectionDefinition.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -47,7 +49,7 @@ void RWStepElement_RWCurveElementSectionDefinition::ReadStep (const Handle(StepD Handle(TCollection_HAsciiString) aDescription; data->ReadString (num, 1, "description", ach, aDescription); - Standard_Real aSectionAngle; + Standard_Real aSectionAngle = NAN; data->ReadReal (num, 2, "section_angle", ach, aSectionAngle); // Initialize entity diff --git a/src/RWStepElement/RWStepElement_RWCurveElementSectionDerivedDefinitions.cxx b/src/RWStepElement/RWStepElement_RWCurveElementSectionDerivedDefinitions.cxx index d5b62ee529..c898d258c9 100644 --- a/src/RWStepElement/RWStepElement_RWCurveElementSectionDerivedDefinitions.cxx +++ b/src/RWStepElement/RWStepElement_RWCurveElementSectionDerivedDefinitions.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -52,12 +54,12 @@ void RWStepElement_RWCurveElementSectionDerivedDefinitions::ReadStep (const Hand Handle(TCollection_HAsciiString) aCurveElementSectionDefinition_Description; data->ReadString (num, 1, "curve_element_section_definition.description", ach, aCurveElementSectionDefinition_Description); - Standard_Real aCurveElementSectionDefinition_SectionAngle; + Standard_Real aCurveElementSectionDefinition_SectionAngle = NAN; data->ReadReal (num, 2, "curve_element_section_definition.section_angle", ach, aCurveElementSectionDefinition_SectionAngle); // Own fields of CurveElementSectionDerivedDefinitions - Standard_Real aCrossSectionalArea; + Standard_Real aCrossSectionalArea = NAN; data->ReadReal (num, 3, "cross_sectional_area", ach, aCrossSectionalArea); Handle(StepElement_HArray1OfMeasureOrUnspecifiedValue) aShearArea; @@ -80,13 +82,13 @@ void RWStepElement_RWCurveElementSectionDerivedDefinitions::ReadStep (const Hand aSecondMomentOfArea = new TColStd_HArray1OfReal (1, nb0); Standard_Integer num2 = sub5; for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; data->ReadReal (num2, i0, "real", ach, anIt0); aSecondMomentOfArea->SetValue(i0, anIt0); } } - Standard_Real aTorsionalConstant; + Standard_Real aTorsionalConstant = NAN; data->ReadReal (num, 6, "torsional_constant", ach, aTorsionalConstant); StepElement_MeasureOrUnspecifiedValue aWarpingConstant; diff --git a/src/RWStepElement/RWStepElement_RWSurfaceSectionFieldVarying.cxx b/src/RWStepElement/RWStepElement_RWSurfaceSectionFieldVarying.cxx index 37eca4fe3c..71da4d9086 100644 --- a/src/RWStepElement/RWStepElement_RWSurfaceSectionFieldVarying.cxx +++ b/src/RWStepElement/RWStepElement_RWSurfaceSectionFieldVarying.cxx @@ -59,7 +59,7 @@ void RWStepElement_RWSurfaceSectionFieldVarying::ReadStep (const Handle(StepData } } - Standard_Boolean aAdditionalNodeValues; + Standard_Boolean aAdditionalNodeValues = 0; data->ReadBoolean (num, 2, "additional_node_values", ach, aAdditionalNodeValues); // Initialize entity diff --git a/src/RWStepElement/RWStepElement_RWUniformSurfaceSection.cxx b/src/RWStepElement/RWStepElement_RWUniformSurfaceSection.cxx index 0139f37efe..d2bca2c689 100644 --- a/src/RWStepElement/RWStepElement_RWUniformSurfaceSection.cxx +++ b/src/RWStepElement/RWStepElement_RWUniformSurfaceSection.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -55,7 +57,7 @@ void RWStepElement_RWUniformSurfaceSection::ReadStep (const Handle(StepData_Step // Own fields of UniformSurfaceSection - Standard_Real aThickness; + Standard_Real aThickness = NAN; data->ReadReal (num, 4, "thickness", ach, aThickness); StepElement_MeasureOrUnspecifiedValue aBendingThickness; diff --git a/src/RWStepFEA/RWStepFEA_RWConstantSurface3dElementCoordinateSystem.cxx b/src/RWStepFEA/RWStepFEA_RWConstantSurface3dElementCoordinateSystem.cxx index 2314541eeb..f61fcb4164 100644 --- a/src/RWStepFEA/RWStepFEA_RWConstantSurface3dElementCoordinateSystem.cxx +++ b/src/RWStepFEA/RWStepFEA_RWConstantSurface3dElementCoordinateSystem.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -49,10 +51,10 @@ void RWStepFEA_RWConstantSurface3dElementCoordinateSystem::ReadStep (const Handl // Own fields of ConstantSurface3dElementCoordinateSystem - Standard_Integer aAxis; + Standard_Integer aAxis = 0; data->ReadInteger (num, 2, "axis", ach, aAxis); - Standard_Real aAngle; + Standard_Real aAngle = NAN; data->ReadReal (num, 3, "angle", ach, aAngle); // Initialize entity diff --git a/src/RWStepFEA/RWStepFEA_RWCurveElementEndOffset.cxx b/src/RWStepFEA/RWStepFEA_RWCurveElementEndOffset.cxx index cb8e953848..0046055472 100644 --- a/src/RWStepFEA/RWStepFEA_RWCurveElementEndOffset.cxx +++ b/src/RWStepFEA/RWStepFEA_RWCurveElementEndOffset.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -57,7 +59,7 @@ void RWStepFEA_RWCurveElementEndOffset::ReadStep (const Handle(StepData_StepRead aOffsetVector = new TColStd_HArray1OfReal (1, nb0); Standard_Integer num2 = sub2; for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; data->ReadReal (num2, i0, "real", ach, anIt0); aOffsetVector->SetValue(i0, anIt0); } diff --git a/src/RWStepFEA/RWStepFEA_RWFeaAreaDensity.cxx b/src/RWStepFEA/RWStepFEA_RWFeaAreaDensity.cxx index 05d3ea4f83..ad9c3e95d7 100644 --- a/src/RWStepFEA/RWStepFEA_RWFeaAreaDensity.cxx +++ b/src/RWStepFEA/RWStepFEA_RWFeaAreaDensity.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -49,7 +51,7 @@ void RWStepFEA_RWFeaAreaDensity::ReadStep (const Handle(StepData_StepReaderData) // Own fields of FeaAreaDensity - Standard_Real aFeaConstant; + Standard_Real aFeaConstant = NAN; data->ReadReal (num, 2, "fea_constant", ach, aFeaConstant); // Initialize entity diff --git a/src/RWStepFEA/RWStepFEA_RWFeaMassDensity.cxx b/src/RWStepFEA/RWStepFEA_RWFeaMassDensity.cxx index fd3920aff9..39930b0fa1 100644 --- a/src/RWStepFEA/RWStepFEA_RWFeaMassDensity.cxx +++ b/src/RWStepFEA/RWStepFEA_RWFeaMassDensity.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -49,7 +51,7 @@ void RWStepFEA_RWFeaMassDensity::ReadStep (const Handle(StepData_StepReaderData) // Own fields of FeaMassDensity - Standard_Real aFeaConstant; + Standard_Real aFeaConstant = NAN; data->ReadReal (num, 2, "fea_constant", ach, aFeaConstant); // Initialize entity diff --git a/src/RWStepFEA/RWStepFEA_RWFeaParametricPoint.cxx b/src/RWStepFEA/RWStepFEA_RWFeaParametricPoint.cxx index 1565eaf5cd..4f4ea1e468 100644 --- a/src/RWStepFEA/RWStepFEA_RWFeaParametricPoint.cxx +++ b/src/RWStepFEA/RWStepFEA_RWFeaParametricPoint.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -59,7 +61,7 @@ void RWStepFEA_RWFeaParametricPoint::ReadStep (const Handle(StepData_StepReaderD aCoordinates = new TColStd_HArray1OfReal (1, nb0); Standard_Integer num2 = sub2; for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; data->ReadReal (num2, i0, "real", ach, anIt0); aCoordinates->SetValue(i0, anIt0); } diff --git a/src/RWStepFEA/RWStepFEA_RWFeaSecantCoefficientOfLinearThermalExpansion.cxx b/src/RWStepFEA/RWStepFEA_RWFeaSecantCoefficientOfLinearThermalExpansion.cxx index 0b0eec712e..8ce5e997bd 100644 --- a/src/RWStepFEA/RWStepFEA_RWFeaSecantCoefficientOfLinearThermalExpansion.cxx +++ b/src/RWStepFEA/RWStepFEA_RWFeaSecantCoefficientOfLinearThermalExpansion.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -52,7 +54,7 @@ void RWStepFEA_RWFeaSecantCoefficientOfLinearThermalExpansion::ReadStep (const H StepFEA_SymmetricTensor23d aFeaConstants; data->ReadEntity (num, 2, "fea_constants", ach, aFeaConstants); - Standard_Real aReferenceTemperature; + Standard_Real aReferenceTemperature = NAN; data->ReadReal (num, 3, "reference_temperature", ach, aReferenceTemperature); // Initialize entity diff --git a/src/RWStepFEA/RWStepFEA_RWParametricSurface3dElementCoordinateSystem.cxx b/src/RWStepFEA/RWStepFEA_RWParametricSurface3dElementCoordinateSystem.cxx index 376af8c837..ac7978ddd1 100644 --- a/src/RWStepFEA/RWStepFEA_RWParametricSurface3dElementCoordinateSystem.cxx +++ b/src/RWStepFEA/RWStepFEA_RWParametricSurface3dElementCoordinateSystem.cxx @@ -15,6 +15,8 @@ // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 +#include + #include #include #include @@ -49,10 +51,10 @@ void RWStepFEA_RWParametricSurface3dElementCoordinateSystem::ReadStep (const Han // Own fields of ParametricSurface3dElementCoordinateSystem - Standard_Integer aAxis; + Standard_Integer aAxis = 0; data->ReadInteger (num, 2, "axis", ach, aAxis); - Standard_Real aAngle; + Standard_Real aAngle = NAN; data->ReadReal (num, 3, "angle", ach, aAngle); // Initialize entity diff --git a/src/RWStepGeom/RWStepGeom_RWBSplineCurve.cxx b/src/RWStepGeom/RWStepGeom_RWBSplineCurve.cxx index 5995c45398..7bab9170f4 100644 --- a/src/RWStepGeom/RWStepGeom_RWBSplineCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBSplineCurve.cxx @@ -53,7 +53,7 @@ void RWStepGeom_RWBSplineCurve::ReadStep // --- own field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"degree",ach,aDegree); @@ -61,7 +61,7 @@ void RWStepGeom_RWBSplineCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb3); diff --git a/src/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnots.cxx b/src/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnots.cxx index 6faa4d6ce0..c077285ba6 100644 --- a/src/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnots.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnots.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -63,7 +65,7 @@ void RWStepGeom_RWBSplineCurveWithKnots::ReadStep // --- inherited field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"degree",ach,aDegree); @@ -71,7 +73,7 @@ void RWStepGeom_RWBSplineCurveWithKnots::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); if(nb3 <1) @@ -118,8 +120,8 @@ void RWStepGeom_RWBSplineCurveWithKnots::ReadStep // --- own field : knotMultiplicities --- Handle(TColStd_HArray1OfInteger) aKnotMultiplicities; - Standard_Integer aKnotMultiplicitiesItem; - Standard_Integer nsub7; + Standard_Integer aKnotMultiplicitiesItem = 0; + Standard_Integer nsub7 = 0; if (data->ReadSubList (num,7,"knot_multiplicities",ach,nsub7)) { Standard_Integer nb7 = data->NbParams(nsub7); aKnotMultiplicities = new TColStd_HArray1OfInteger (1, nb7); @@ -133,8 +135,8 @@ void RWStepGeom_RWBSplineCurveWithKnots::ReadStep // --- own field : knots --- Handle(TColStd_HArray1OfReal) aKnots; - Standard_Real aKnotsItem; - Standard_Integer nsub8; + Standard_Real aKnotsItem = NAN; + Standard_Integer nsub8 = 0; if (data->ReadSubList (num,8,"knots",ach,nsub8)) { Standard_Integer nb8 = data->NbParams(nsub8); aKnots = new TColStd_HArray1OfReal (1, nb8); @@ -257,7 +259,7 @@ void RWStepGeom_RWBSplineCurveWithKnots::Check if(nbMult != nbKno) { ach->AddFail("ERROR: No.of KnotMultiplicities not equal No.of Knots"); } - Standard_Integer i;//svv Jan 10 2000: porting on DEC + Standard_Integer i = 0;//svv Jan 10 2000: porting on DEC for (i=1; i<=nbMult-1; i++) { sumMult = sumMult + ent->KnotMultiplicitiesValue(i); } diff --git a/src/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve.cxx b/src/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve.cxx index 416b9c86a9..4d14c4b482 100644 --- a/src/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve.cxx @@ -13,6 +13,8 @@ // sln 04.10.2001. BUC61003. Correction of looking for items of complex entity +#include + #include #include #include @@ -68,7 +70,7 @@ void RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve::ReadStep // --- field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"degree",ach,aDegree); // --- field : controlPointsList --- @@ -76,7 +78,7 @@ void RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"control_points_list",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb2); @@ -128,8 +130,8 @@ void RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve::ReadStep // --- field : knotMultiplicities --- Handle(TColStd_HArray1OfInteger) aKnotMultiplicities; - Standard_Integer aKnotMultiplicitiesItem; - Standard_Integer nsub6; + Standard_Integer aKnotMultiplicitiesItem = 0; + Standard_Integer nsub6 = 0; if (data->ReadSubList (num,1,"knot_multiplicities",ach,nsub6)) { Standard_Integer nb6 = data->NbParams(nsub6); aKnotMultiplicities = new TColStd_HArray1OfInteger (1, nb6); @@ -143,8 +145,8 @@ void RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve::ReadStep // --- field : knots --- Handle(TColStd_HArray1OfReal) aKnots; - Standard_Real aKnotsItem; - Standard_Integer nsub7; + Standard_Real aKnotsItem = NAN; + Standard_Integer nsub7 = 0; if (data->ReadSubList (num,2,"knots",ach,nsub7)) { Standard_Integer nb7 = data->NbParams(nsub7); aKnots = new TColStd_HArray1OfReal (1, nb7); @@ -190,8 +192,8 @@ void RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve::ReadStep // --- field : weightsData --- Handle(TColStd_HArray1OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub9; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub9 = 0; if (data->ReadSubList (num,1,"weights_data",ach,nsub9)) { Standard_Integer nb9 = data->NbParams(nsub9); aWeightsData = new TColStd_HArray1OfReal (1, nb9); @@ -333,7 +335,7 @@ void RWStepGeom_RWBSplineCurveWithKnotsAndRationalBSplineCurve::Check const Interface_ShareTool& aShto, Handle(Interface_Check)& ach) const { - Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) aRationalBSC = ent; + const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)& aRationalBSC = ent; Handle(StepGeom_BSplineCurveWithKnots) aBSCWK = aRationalBSC->BSplineCurveWithKnots(); RWStepGeom_RWBSplineCurveWithKnots t1; diff --git a/src/RWStepGeom/RWStepGeom_RWBSplineSurface.cxx b/src/RWStepGeom/RWStepGeom_RWBSplineSurface.cxx index 51876da8fe..04764f543e 100644 --- a/src/RWStepGeom/RWStepGeom_RWBSplineSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBSplineSurface.cxx @@ -58,13 +58,13 @@ void RWStepGeom_RWBSplineSurface::ReadStep // --- own field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"u_degree",ach,aUDegree); // --- own field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"v_degree",ach,aVDegree); @@ -72,13 +72,13 @@ void RWStepGeom_RWBSplineSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent4; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"control_points_list",ach,nsub4)) { Standard_Integer nbi4 = data->NbParams(nsub4); Standard_Integer nbj4 = data->NbParams(data->ParamNumber(nsub4,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi4, 1, nbj4); for (Standard_Integer i4 = 1; i4 <= nbi4; i4 ++) { - Standard_Integer nsi4; + Standard_Integer nsi4 = 0; if (data->ReadSubList (nsub4,i4,"sub-part(control_points_list)",ach,nsi4)) { for (Standard_Integer j4 =1; j4 <= nbj4; j4 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnots.cxx b/src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnots.cxx index 77203c6ddd..2d20d2d7b3 100644 --- a/src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnots.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnots.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -68,13 +70,13 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::ReadStep // --- inherited field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"u_degree",ach,aUDegree); // --- inherited field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"v_degree",ach,aVDegree); @@ -82,13 +84,13 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent4; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"control_points_list",ach,nsub4)) { Standard_Integer nbi4 = data->NbParams(nsub4); Standard_Integer nbj4 = data->NbParams(data->ParamNumber(nsub4,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi4, 1, nbj4); for (Standard_Integer i4 = 1; i4 <= nbi4; i4 ++) { - Standard_Integer nsi4; + Standard_Integer nsi4 = 0; if (data->ReadSubList (nsub4,i4,"sub-part(control_points_list)",ach,nsi4)) { for (Standard_Integer j4 =1; j4 <= nbj4; j4 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed @@ -141,8 +143,8 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::ReadStep // --- own field : uMultiplicities --- Handle(TColStd_HArray1OfInteger) aUMultiplicities; - Standard_Integer aUMultiplicitiesItem; - Standard_Integer nsub9; + Standard_Integer aUMultiplicitiesItem = 0; + Standard_Integer nsub9 = 0; if (data->ReadSubList (num,9,"u_multiplicities",ach,nsub9)) { Standard_Integer nb9 = data->NbParams(nsub9); aUMultiplicities = new TColStd_HArray1OfInteger (1, nb9); @@ -156,8 +158,8 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::ReadStep // --- own field : vMultiplicities --- Handle(TColStd_HArray1OfInteger) aVMultiplicities; - Standard_Integer aVMultiplicitiesItem; - Standard_Integer nsub10; + Standard_Integer aVMultiplicitiesItem = 0; + Standard_Integer nsub10 = 0; if (data->ReadSubList (num,10,"v_multiplicities",ach,nsub10)) { Standard_Integer nb10 = data->NbParams(nsub10); aVMultiplicities = new TColStd_HArray1OfInteger (1, nb10); @@ -171,8 +173,8 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::ReadStep // --- own field : uKnots --- Handle(TColStd_HArray1OfReal) aUKnots; - Standard_Real aUKnotsItem; - Standard_Integer nsub11; + Standard_Real aUKnotsItem = NAN; + Standard_Integer nsub11 = 0; if (data->ReadSubList (num,11,"u_knots",ach,nsub11)) { Standard_Integer nb11 = data->NbParams(nsub11); aUKnots = new TColStd_HArray1OfReal (1, nb11); @@ -186,8 +188,8 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::ReadStep // --- own field : vKnots --- Handle(TColStd_HArray1OfReal) aVKnots; - Standard_Real aVKnotsItem; - Standard_Integer nsub12; + Standard_Real aVKnotsItem = NAN; + Standard_Integer nsub12 = 0; if (data->ReadSubList (num,12,"v_knots",ach,nsub12)) { Standard_Integer nb12 = data->NbParams(nsub12); aVKnots = new TColStd_HArray1OfReal (1, nb12); @@ -350,7 +352,7 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::Check Standard_Integer nbKnoV = ent->NbVKnots(); Standard_Integer sumMulU = 0; Standard_Integer sumMulV = 0; - Standard_Integer i; + Standard_Integer i = 0; // std::cout << "BSplineSurfaceWithKnots: nbMulU=" << nbMulU << " nbKnoU= " << // nbKnoU << " nbCPLU= " << nbCPLU << " degreeU= " << dgBSSU << std::endl; // std::cout << " nbMulV=" << nbMulV << " nbKnoV= " << diff --git a/src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx b/src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx index 1e106df80a..5351c1b0ab 100644 --- a/src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -70,13 +72,13 @@ void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep // --- field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"u_degree",ach,aUDegree); // --- field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"v_degree",ach,aVDegree); // --- field : controlPointsList --- @@ -84,13 +86,13 @@ void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nbi3 = data->NbParams(nsub3); Standard_Integer nbj3 = data->NbParams(data->ParamNumber(nsub3,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi3, 1, nbj3); for (Standard_Integer i3 = 1; i3 <= nbi3; i3 ++) { - Standard_Integer nsi3temp; + Standard_Integer nsi3temp = 0; if (data->ReadSubList (nsub3,i3,"sub-part(control_points_list)",ach,nsi3temp)) { Standard_Integer nsi3 = data->ParamNumber(nsub3,i3); for (Standard_Integer j3 =1; j3 <= nbj3; j3 ++) { @@ -152,8 +154,8 @@ void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep // --- field : uMultiplicities --- Handle(TColStd_HArray1OfInteger) aUMultiplicities; - Standard_Integer aUMultiplicitiesItem; - Standard_Integer nsub8; + Standard_Integer aUMultiplicitiesItem = 0; + Standard_Integer nsub8 = 0; if (data->ReadSubList (num,1,"u_multiplicities",ach,nsub8)) { Standard_Integer nb8 = data->NbParams(nsub8); aUMultiplicities = new TColStd_HArray1OfInteger (1, nb8); @@ -167,8 +169,8 @@ void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep // --- field : vMultiplicities --- Handle(TColStd_HArray1OfInteger) aVMultiplicities; - Standard_Integer aVMultiplicitiesItem; - Standard_Integer nsub9; + Standard_Integer aVMultiplicitiesItem = 0; + Standard_Integer nsub9 = 0; if (data->ReadSubList (num,2,"v_multiplicities",ach,nsub9)) { Standard_Integer nb9 = data->NbParams(nsub9); aVMultiplicities = new TColStd_HArray1OfInteger (1, nb9); @@ -182,8 +184,8 @@ void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep // --- field : uKnots --- Handle(TColStd_HArray1OfReal) aUKnots; - Standard_Real aUKnotsItem; - Standard_Integer nsub10; + Standard_Real aUKnotsItem = NAN; + Standard_Integer nsub10 = 0; if (data->ReadSubList (num,3,"u_knots",ach,nsub10)) { Standard_Integer nb10 = data->NbParams(nsub10); aUKnots = new TColStd_HArray1OfReal (1, nb10); @@ -197,8 +199,8 @@ void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep // --- field : vKnots --- Handle(TColStd_HArray1OfReal) aVKnots; - Standard_Real aVKnotsItem; - Standard_Integer nsub11; + Standard_Real aVKnotsItem = NAN; + Standard_Integer nsub11 = 0; if (data->ReadSubList (num,4,"v_knots",ach,nsub11)) { Standard_Integer nb11 = data->NbParams(nsub11); aVKnots = new TColStd_HArray1OfReal (1, nb11); @@ -235,14 +237,14 @@ void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::ReadStep // --- field : weightsData --- Handle(TColStd_HArray2OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub13; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub13 = 0; if (data->ReadSubList (num,1,"weights_data",ach,nsub13)) { Standard_Integer nbi13 = data->NbParams(nsub13); Standard_Integer nbj13 = data->NbParams(data->ParamNumber(nsub13,1)); aWeightsData = new TColStd_HArray2OfReal (1,nbi13,1,nbj13); for (Standard_Integer i13 = 1; i13 <= nbi13; i13 ++) { - Standard_Integer nsi13temp; + Standard_Integer nsi13temp = 0; if (data->ReadSubList (nsub13,i13,"sub-part(weights_data)",ach,nsi13temp)) { Standard_Integer nsi13 = data->ParamNumber(nsub13,i13); for (Standard_Integer j13 =1; j13 <= nbj13; j13 ++) { @@ -432,7 +434,7 @@ void RWStepGeom_RWBSplineSurfaceWithKnotsAndRationalBSplineSurface::Check const Interface_ShareTool& aShto, Handle(Interface_Check)& ach) const { - Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) aRationalBSS = ent; + const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)& aRationalBSS = ent; Handle(StepGeom_BSplineSurfaceWithKnots) aBSSWK = aRationalBSS->BSplineSurfaceWithKnots(); RWStepGeom_RWBSplineSurfaceWithKnots t1; diff --git a/src/RWStepGeom/RWStepGeom_RWBezierCurve.cxx b/src/RWStepGeom/RWStepGeom_RWBezierCurve.cxx index 05b4e4afc0..c78d933552 100644 --- a/src/RWStepGeom/RWStepGeom_RWBezierCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBezierCurve.cxx @@ -52,7 +52,7 @@ void RWStepGeom_RWBezierCurve::ReadStep // --- inherited field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"degree",ach,aDegree); @@ -60,7 +60,7 @@ void RWStepGeom_RWBezierCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb3); diff --git a/src/RWStepGeom/RWStepGeom_RWBezierCurveAndRationalBSplineCurve.cxx b/src/RWStepGeom/RWStepGeom_RWBezierCurveAndRationalBSplineCurve.cxx index 4e5c51589d..43a8c8a22e 100644 --- a/src/RWStepGeom/RWStepGeom_RWBezierCurveAndRationalBSplineCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBezierCurveAndRationalBSplineCurve.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -61,7 +63,7 @@ void RWStepGeom_RWBezierCurveAndRationalBSplineCurve::ReadStep // --- field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"degree",ach,aDegree); // --- field : controlPointsList --- @@ -69,7 +71,7 @@ void RWStepGeom_RWBezierCurveAndRationalBSplineCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"control_points_list",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb2); @@ -130,8 +132,8 @@ void RWStepGeom_RWBezierCurveAndRationalBSplineCurve::ReadStep // --- field : weightsData --- Handle(TColStd_HArray1OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub6; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub6 = 0; if (data->ReadSubList (num,1,"weights_data",ach,nsub6)) { Standard_Integer nb6 = data->NbParams(nsub6); aWeightsData = new TColStd_HArray1OfReal (1, nb6); diff --git a/src/RWStepGeom/RWStepGeom_RWBezierSurface.cxx b/src/RWStepGeom/RWStepGeom_RWBezierSurface.cxx index 99ed6a5ed1..20dbeeb8bb 100644 --- a/src/RWStepGeom/RWStepGeom_RWBezierSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBezierSurface.cxx @@ -57,13 +57,13 @@ void RWStepGeom_RWBezierSurface::ReadStep // --- inherited field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"u_degree",ach,aUDegree); // --- inherited field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"v_degree",ach,aVDegree); @@ -71,13 +71,13 @@ void RWStepGeom_RWBezierSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent4; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"control_points_list",ach,nsub4)) { Standard_Integer nbi4 = data->NbParams(nsub4); Standard_Integer nbj4 = data->NbParams(data->ParamNumber(nsub4,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi4, 1, nbj4); for (Standard_Integer i4 = 1; i4 <= nbi4; i4 ++) { - Standard_Integer nsi4; + Standard_Integer nsi4 = 0; if (data->ReadSubList (nsub4,i4,"sub-part(control_points_list)",ach,nsi4)) { for (Standard_Integer j4 =1; j4 <= nbj4; j4 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWBezierSurfaceAndRationalBSplineSurface.cxx b/src/RWStepGeom/RWStepGeom_RWBezierSurfaceAndRationalBSplineSurface.cxx index 6886954cb6..7ecafe3417 100644 --- a/src/RWStepGeom/RWStepGeom_RWBezierSurfaceAndRationalBSplineSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBezierSurfaceAndRationalBSplineSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -66,13 +68,13 @@ void RWStepGeom_RWBezierSurfaceAndRationalBSplineSurface::ReadStep // --- field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"u_degree",ach,aUDegree); // --- field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"v_degree",ach,aVDegree); // --- field : controlPointsList --- @@ -80,13 +82,13 @@ void RWStepGeom_RWBezierSurfaceAndRationalBSplineSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nbi3 = data->NbParams(nsub3); Standard_Integer nbj3 = data->NbParams(data->ParamNumber(nsub3,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi3, 1, nbj3); for (Standard_Integer i3 = 1; i3 <= nbi3; i3 ++) { - Standard_Integer nsi3; + Standard_Integer nsi3 = 0; if (data->ReadSubList (nsub3,i3,"sub-part(control_points_list)",ach,nsi3)) { for (Standard_Integer j3 =1; j3 <= nbj3; j3 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed @@ -152,14 +154,14 @@ void RWStepGeom_RWBezierSurfaceAndRationalBSplineSurface::ReadStep // --- field : weightsData --- Handle(TColStd_HArray2OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub8; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub8 = 0; if (data->ReadSubList (num,1,"items",ach,nsub8)) { Standard_Integer nbi8 = data->NbParams(nsub8); Standard_Integer nbj8 = data->NbParams(data->ParamNumber(nsub8,1)); aWeightsData = new TColStd_HArray2OfReal (1,nbi8,1,nbj8); for (Standard_Integer i8 = 1; i8 <= nbi8; i8 ++) { - Standard_Integer nsi8; + Standard_Integer nsi8 = 0; if (data->ReadSubList(nsub8,i8,"sub-part(weights_data)",ach,nsi8)){ for (Standard_Integer j8 =1; j8 <= nbj8; j8 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWBoundaryCurve.cxx b/src/RWStepGeom/RWStepGeom_RWBoundaryCurve.cxx index 26c7909c3c..2f01f54e95 100644 --- a/src/RWStepGeom/RWStepGeom_RWBoundaryCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWBoundaryCurve.cxx @@ -45,7 +45,7 @@ void RWStepGeom_RWBoundaryCurve::ReadStep Handle(StepGeom_HArray1OfCompositeCurveSegment) aSegments; Handle(StepGeom_CompositeCurveSegment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"segments",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aSegments = new StepGeom_HArray1OfCompositeCurveSegment (1, nb2); diff --git a/src/RWStepGeom/RWStepGeom_RWCartesianPoint.cxx b/src/RWStepGeom/RWStepGeom_RWCartesianPoint.cxx index 580d39438c..67ad71d3d3 100644 --- a/src/RWStepGeom/RWStepGeom_RWCartesianPoint.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCartesianPoint.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -48,8 +50,8 @@ void RWStepGeom_RWCartesianPoint::ReadStep // OPTIMISED : X Y Z directly read and set // Handle(TColStd_HArray1OfReal) aCoordinates; - Standard_Real aCoordinatesItem; - Standard_Integer nsub2, nbcoord=0; + Standard_Real aCoordinatesItem = NAN; + Standard_Integer nsub2 = 0, nbcoord=0; Standard_Real XYZ[3] = {0.,0.,0.}; if (data->ReadSubList (num,2,"coordinates",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); diff --git a/src/RWStepGeom/RWStepGeom_RWCartesianTransformationOperator.cxx b/src/RWStepGeom/RWStepGeom_RWCartesianTransformationOperator.cxx index fb4e7d1dcb..5467b18695 100644 --- a/src/RWStepGeom/RWStepGeom_RWCartesianTransformationOperator.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCartesianTransformationOperator.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -78,7 +80,7 @@ void RWStepGeom_RWCartesianTransformationOperator::ReadStep // --- own field : scale --- - Standard_Real aScale; + Standard_Real aScale = NAN; Standard_Boolean hasAscale = Standard_True; if (data->IsParamDefined(num,7)) { //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWCartesianTransformationOperator3d.cxx b/src/RWStepGeom/RWStepGeom_RWCartesianTransformationOperator3d.cxx index 0fff525e63..6059ada3f3 100644 --- a/src/RWStepGeom/RWStepGeom_RWCartesianTransformationOperator3d.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCartesianTransformationOperator3d.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -78,7 +80,7 @@ void RWStepGeom_RWCartesianTransformationOperator3d::ReadStep // --- inherited field : scale --- - Standard_Real aScale; + Standard_Real aScale = NAN; Standard_Boolean hasAscale = Standard_True; if (data->IsParamDefined(num,7)) { //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWCircle.cxx b/src/RWStepGeom/RWStepGeom_RWCircle.cxx index 63ba5708e8..f49e76acbd 100644 --- a/src/RWStepGeom/RWStepGeom_RWCircle.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCircle.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -46,7 +48,7 @@ void RWStepGeom_RWCircle::ReadStep // --- own field : radius --- - Standard_Real aRadius; + Standard_Real aRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"radius",ach,aRadius); diff --git a/src/RWStepGeom/RWStepGeom_RWCompositeCurve.cxx b/src/RWStepGeom/RWStepGeom_RWCompositeCurve.cxx index 49304aa7d6..61b5756a7f 100644 --- a/src/RWStepGeom/RWStepGeom_RWCompositeCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCompositeCurve.cxx @@ -45,7 +45,7 @@ void RWStepGeom_RWCompositeCurve::ReadStep Handle(StepGeom_HArray1OfCompositeCurveSegment) aSegments; Handle(StepGeom_CompositeCurveSegment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"segments",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aSegments = new StepGeom_HArray1OfCompositeCurveSegment (1, nb2); diff --git a/src/RWStepGeom/RWStepGeom_RWCompositeCurveOnSurface.cxx b/src/RWStepGeom/RWStepGeom_RWCompositeCurveOnSurface.cxx index 304d83a649..8719de47c5 100644 --- a/src/RWStepGeom/RWStepGeom_RWCompositeCurveOnSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCompositeCurveOnSurface.cxx @@ -45,7 +45,7 @@ void RWStepGeom_RWCompositeCurveOnSurface::ReadStep Handle(StepGeom_HArray1OfCompositeCurveSegment) aSegments; Handle(StepGeom_CompositeCurveSegment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"segments",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aSegments = new StepGeom_HArray1OfCompositeCurveSegment (1, nb2); diff --git a/src/RWStepGeom/RWStepGeom_RWCompositeCurveSegment.cxx b/src/RWStepGeom/RWStepGeom_RWCompositeCurveSegment.cxx index 70b22306cb..3e39dee749 100644 --- a/src/RWStepGeom/RWStepGeom_RWCompositeCurveSegment.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCompositeCurveSegment.cxx @@ -56,7 +56,7 @@ void RWStepGeom_RWCompositeCurveSegment::ReadStep // --- own field : sameSense --- - Standard_Boolean aSameSense; + Standard_Boolean aSameSense = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadBoolean (num,2,"same_sense",ach,aSameSense); diff --git a/src/RWStepGeom/RWStepGeom_RWConicalSurface.cxx b/src/RWStepGeom/RWStepGeom_RWConicalSurface.cxx index 93d2f593a3..ffa64c0b5a 100644 --- a/src/RWStepGeom/RWStepGeom_RWConicalSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWConicalSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,13 +49,13 @@ void RWStepGeom_RWConicalSurface::ReadStep // --- own field : radius --- - Standard_Real aRadius; + Standard_Real aRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"radius",ach,aRadius); // --- own field : semiAngle --- - Standard_Real aSemiAngle; + Standard_Real aSemiAngle = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"semi_angle",ach,aSemiAngle); diff --git a/src/RWStepGeom/RWStepGeom_RWCurveBoundedSurface.cxx b/src/RWStepGeom/RWStepGeom_RWCurveBoundedSurface.cxx index 34f9dba152..9f49e37360 100644 --- a/src/RWStepGeom/RWStepGeom_RWCurveBoundedSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCurveBoundedSurface.cxx @@ -70,7 +70,7 @@ void RWStepGeom_RWCurveBoundedSurface::ReadStep (const Handle(StepData_StepReade } } - Standard_Boolean aImplicitOuter; + Standard_Boolean aImplicitOuter = 0; data->ReadBoolean (num, 4, "implicit_outer", ach, aImplicitOuter); // Initialize entity diff --git a/src/RWStepGeom/RWStepGeom_RWCylindricalSurface.cxx b/src/RWStepGeom/RWStepGeom_RWCylindricalSurface.cxx index 4f11e645c5..e3a347e32c 100644 --- a/src/RWStepGeom/RWStepGeom_RWCylindricalSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWCylindricalSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ void RWStepGeom_RWCylindricalSurface::ReadStep // --- own field : radius --- - Standard_Real aRadius; + Standard_Real aRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"radius",ach,aRadius); diff --git a/src/RWStepGeom/RWStepGeom_RWDegenerateToroidalSurface.cxx b/src/RWStepGeom/RWStepGeom_RWDegenerateToroidalSurface.cxx index 09883e1e14..3edb7bf9a6 100644 --- a/src/RWStepGeom/RWStepGeom_RWDegenerateToroidalSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWDegenerateToroidalSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,19 +49,19 @@ void RWStepGeom_RWDegenerateToroidalSurface::ReadStep // --- inherited field : majorRadius --- - Standard_Real aMajorRadius; + Standard_Real aMajorRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"major_radius",ach,aMajorRadius); // --- inherited field : minorRadius --- - Standard_Real aMinorRadius; + Standard_Real aMinorRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"minor_radius",ach,aMinorRadius); // --- own field : selectOuter --- - Standard_Boolean aSelectOuter; + Standard_Boolean aSelectOuter = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadBoolean (num,5,"select_outer",ach,aSelectOuter); diff --git a/src/RWStepGeom/RWStepGeom_RWDirection.cxx b/src/RWStepGeom/RWStepGeom_RWDirection.cxx index 2e4fc49a37..380db3979b 100644 --- a/src/RWStepGeom/RWStepGeom_RWDirection.cxx +++ b/src/RWStepGeom/RWStepGeom_RWDirection.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -43,8 +45,8 @@ void RWStepGeom_RWDirection::ReadStep // --- own field : directionRatios --- Handle(TColStd_HArray1OfReal) aDirectionRatios; - Standard_Real aDirectionRatiosItem; - Standard_Integer nsub2; + Standard_Real aDirectionRatiosItem = NAN; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"direction_ratios",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aDirectionRatios = new TColStd_HArray1OfReal (1, nb2); @@ -87,7 +89,7 @@ void RWStepGeom_RWDirection::Check Handle(Interface_Check)& ach) const { Standard_Integer nbVal = ent->NbDirectionRatios(); - Standard_Integer i; + Standard_Integer i = 0; for(i=1; i<=nbVal; i++) { if(Abs(ent->DirectionRatiosValue(i)) >= RealEpsilon()) break; } diff --git a/src/RWStepGeom/RWStepGeom_RWEllipse.cxx b/src/RWStepGeom/RWStepGeom_RWEllipse.cxx index 7831cd01c8..c60dd5732c 100644 --- a/src/RWStepGeom/RWStepGeom_RWEllipse.cxx +++ b/src/RWStepGeom/RWStepGeom_RWEllipse.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,13 +49,13 @@ void RWStepGeom_RWEllipse::ReadStep // --- own field : semiAxis1 --- - Standard_Real aSemiAxis1; + Standard_Real aSemiAxis1 = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"semi_axis_1",ach,aSemiAxis1); // --- own field : semiAxis2 --- - Standard_Real aSemiAxis2; + Standard_Real aSemiAxis2 = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"semi_axis_2",ach,aSemiAxis2); diff --git a/src/RWStepGeom/RWStepGeom_RWGeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.cxx b/src/RWStepGeom/RWStepGeom_RWGeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.cxx index 08e5798e3f..83a229883d 100644 --- a/src/RWStepGeom/RWStepGeom_RWGeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.cxx +++ b/src/RWStepGeom/RWStepGeom_RWGeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.cxx @@ -38,7 +38,7 @@ void RWStepGeom_RWGeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::ReadS // --- field : coordinateSpaceDimension --- - Standard_Integer aCoordinateSpaceDimension; + Standard_Integer aCoordinateSpaceDimension = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"coordinate_space_dimension",ach,aCoordinateSpaceDimension); @@ -54,7 +54,7 @@ void RWStepGeom_RWGeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::ReadS Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit) aUncertainty; Handle(StepBasic_UncertaintyMeasureWithUnit) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,1,"uncertainty",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aUncertainty = new StepBasic_HArray1OfUncertaintyMeasureWithUnit (1, nb3); @@ -78,7 +78,7 @@ void RWStepGeom_RWGeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx::ReadS Handle(StepBasic_HArray1OfNamedUnit) aUnits; Handle(StepBasic_NamedUnit) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,1,"units",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aUnits = new StepBasic_HArray1OfNamedUnit (1, nb2); diff --git a/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContext.cxx b/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContext.cxx index b825e9367c..851ee0dc3b 100644 --- a/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContext.cxx +++ b/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContext.cxx @@ -45,7 +45,7 @@ void RWStepGeom_RWGeometricRepresentationContext::ReadStep // --- own field : coordinateSpaceDimension --- - Standard_Integer aCoordinateSpaceDimension; + Standard_Integer aCoordinateSpaceDimension = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"coordinate_space_dimension",ach,aCoordinateSpaceDimension); diff --git a/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContextAndGlobalUnitAssignedContext.cxx b/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContextAndGlobalUnitAssignedContext.cxx index 75877c9fc7..b51d6185f6 100644 --- a/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContextAndGlobalUnitAssignedContext.cxx +++ b/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContextAndGlobalUnitAssignedContext.cxx @@ -37,7 +37,7 @@ void RWStepGeom_RWGeometricRepresentationContextAndGlobalUnitAssignedContext::Re // --- field : coordinateSpaceDimension --- - Standard_Integer aCoordinateSpaceDimension; + Standard_Integer aCoordinateSpaceDimension = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"coordinate_space_dimension",ach,aCoordinateSpaceDimension); @@ -51,7 +51,7 @@ void RWStepGeom_RWGeometricRepresentationContextAndGlobalUnitAssignedContext::Re Handle(StepBasic_HArray1OfNamedUnit) aUnits; Handle(StepBasic_NamedUnit) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,1,"units",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aUnits = new StepBasic_HArray1OfNamedUnit (1, nb2); diff --git a/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext.cxx b/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext.cxx index d6375e17e7..eb09118c8c 100644 --- a/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext.cxx +++ b/src/RWStepGeom/RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext.cxx @@ -36,7 +36,7 @@ void RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationConte // --- field : coordinateSpaceDimension --- - Standard_Integer aCoordinateSpaceDimension; + Standard_Integer aCoordinateSpaceDimension = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"coordinate_space_dimension",ach,aCoordinateSpaceDimension); diff --git a/src/RWStepGeom/RWStepGeom_RWHyperbola.cxx b/src/RWStepGeom/RWStepGeom_RWHyperbola.cxx index 545b525494..a8a7c1a9d8 100644 --- a/src/RWStepGeom/RWStepGeom_RWHyperbola.cxx +++ b/src/RWStepGeom/RWStepGeom_RWHyperbola.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -46,13 +48,13 @@ void RWStepGeom_RWHyperbola::ReadStep // --- own field : semiAxis --- - Standard_Real aSemiAxis; + Standard_Real aSemiAxis = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"semi_axis",ach,aSemiAxis); // --- own field : semiImagAxis --- - Standard_Real aSemiImagAxis; + Standard_Real aSemiImagAxis = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"semi_imag_axis",ach,aSemiImagAxis); diff --git a/src/RWStepGeom/RWStepGeom_RWIntersectionCurve.cxx b/src/RWStepGeom/RWStepGeom_RWIntersectionCurve.cxx index b3d8b4a5c7..8611248a6e 100644 --- a/src/RWStepGeom/RWStepGeom_RWIntersectionCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWIntersectionCurve.cxx @@ -56,7 +56,7 @@ void RWStepGeom_RWIntersectionCurve::ReadStep Handle(StepGeom_HArray1OfPcurveOrSurface) aAssociatedGeometry; StepGeom_PcurveOrSurface aAssociatedGeometryItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"associated_geometry",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aAssociatedGeometry = new StepGeom_HArray1OfPcurveOrSurface (1, nb3); diff --git a/src/RWStepGeom/RWStepGeom_RWOffsetCurve3d.cxx b/src/RWStepGeom/RWStepGeom_RWOffsetCurve3d.cxx index dc2c1273a9..4165d0643b 100644 --- a/src/RWStepGeom/RWStepGeom_RWOffsetCurve3d.cxx +++ b/src/RWStepGeom/RWStepGeom_RWOffsetCurve3d.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ void RWStepGeom_RWOffsetCurve3d::ReadStep // --- own field : distance --- - Standard_Real aDistance; + Standard_Real aDistance = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"distance",ach,aDistance); diff --git a/src/RWStepGeom/RWStepGeom_RWOffsetSurface.cxx b/src/RWStepGeom/RWStepGeom_RWOffsetSurface.cxx index 38d9208713..3083aa3219 100644 --- a/src/RWStepGeom/RWStepGeom_RWOffsetSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWOffsetSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ void RWStepGeom_RWOffsetSurface::ReadStep // --- own field : distance --- - Standard_Real aDistance; + Standard_Real aDistance = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"distance",ach,aDistance); diff --git a/src/RWStepGeom/RWStepGeom_RWOrientedSurface.cxx b/src/RWStepGeom/RWStepGeom_RWOrientedSurface.cxx index e73a4e6f4c..71791e3745 100644 --- a/src/RWStepGeom/RWStepGeom_RWOrientedSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWOrientedSurface.cxx @@ -49,7 +49,7 @@ void RWStepGeom_RWOrientedSurface::ReadStep (const Handle(StepData_StepReaderDat // Own fields of OrientedSurface - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; data->ReadBoolean (num, 2, "orientation", ach, aOrientation); // Initialize entity diff --git a/src/RWStepGeom/RWStepGeom_RWOuterBoundaryCurve.cxx b/src/RWStepGeom/RWStepGeom_RWOuterBoundaryCurve.cxx index 4a1be87858..a52a23f2a0 100644 --- a/src/RWStepGeom/RWStepGeom_RWOuterBoundaryCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWOuterBoundaryCurve.cxx @@ -43,7 +43,7 @@ void RWStepGeom_RWOuterBoundaryCurve::ReadStep Handle(StepGeom_HArray1OfCompositeCurveSegment) aSegments; Handle(StepGeom_CompositeCurveSegment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"segments",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aSegments = new StepGeom_HArray1OfCompositeCurveSegment (1, nb2); diff --git a/src/RWStepGeom/RWStepGeom_RWParabola.cxx b/src/RWStepGeom/RWStepGeom_RWParabola.cxx index 835bfc0742..88529c4eae 100644 --- a/src/RWStepGeom/RWStepGeom_RWParabola.cxx +++ b/src/RWStepGeom/RWStepGeom_RWParabola.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -46,7 +48,7 @@ void RWStepGeom_RWParabola::ReadStep // --- own field : focalDist --- - Standard_Real aFocalDist; + Standard_Real aFocalDist = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"focal_dist",ach,aFocalDist); diff --git a/src/RWStepGeom/RWStepGeom_RWPointOnCurve.cxx b/src/RWStepGeom/RWStepGeom_RWPointOnCurve.cxx index 8b24e8713e..e7061b6d66 100644 --- a/src/RWStepGeom/RWStepGeom_RWPointOnCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWPointOnCurve.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ void RWStepGeom_RWPointOnCurve::ReadStep // --- own field : pointParameter --- - Standard_Real aPointParameter; + Standard_Real aPointParameter = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"point_parameter",ach,aPointParameter); diff --git a/src/RWStepGeom/RWStepGeom_RWPointOnSurface.cxx b/src/RWStepGeom/RWStepGeom_RWPointOnSurface.cxx index 3923126135..2662772cd8 100644 --- a/src/RWStepGeom/RWStepGeom_RWPointOnSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWPointOnSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,13 +49,13 @@ void RWStepGeom_RWPointOnSurface::ReadStep // --- own field : pointParameterU --- - Standard_Real aPointParameterU; + Standard_Real aPointParameterU = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"point_parameter_u",ach,aPointParameterU); // --- own field : pointParameterV --- - Standard_Real aPointParameterV; + Standard_Real aPointParameterV = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"point_parameter_v",ach,aPointParameterV); diff --git a/src/RWStepGeom/RWStepGeom_RWPolyline.cxx b/src/RWStepGeom/RWStepGeom_RWPolyline.cxx index 2db0c34ba7..08d2413360 100644 --- a/src/RWStepGeom/RWStepGeom_RWPolyline.cxx +++ b/src/RWStepGeom/RWStepGeom_RWPolyline.cxx @@ -43,7 +43,7 @@ void RWStepGeom_RWPolyline::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aPoints; Handle(StepGeom_CartesianPoint) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"points",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aPoints = new StepGeom_HArray1OfCartesianPoint (1, nb2); diff --git a/src/RWStepGeom/RWStepGeom_RWQuasiUniformCurve.cxx b/src/RWStepGeom/RWStepGeom_RWQuasiUniformCurve.cxx index fc8b9dafd2..819c0f59a8 100644 --- a/src/RWStepGeom/RWStepGeom_RWQuasiUniformCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWQuasiUniformCurve.cxx @@ -49,7 +49,7 @@ void RWStepGeom_RWQuasiUniformCurve::ReadStep // --- inherited field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"degree",ach,aDegree); @@ -57,7 +57,7 @@ void RWStepGeom_RWQuasiUniformCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb3); diff --git a/src/RWStepGeom/RWStepGeom_RWQuasiUniformCurveAndRationalBSplineCurve.cxx b/src/RWStepGeom/RWStepGeom_RWQuasiUniformCurveAndRationalBSplineCurve.cxx index c0ad975c19..a003729cac 100644 --- a/src/RWStepGeom/RWStepGeom_RWQuasiUniformCurveAndRationalBSplineCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWQuasiUniformCurveAndRationalBSplineCurve.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -52,7 +54,7 @@ void RWStepGeom_RWQuasiUniformCurveAndRationalBSplineCurve::ReadStep // --- field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"degree",ach,aDegree); // --- field : controlPointsList --- @@ -60,7 +62,7 @@ void RWStepGeom_RWQuasiUniformCurveAndRationalBSplineCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"control_points_list",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb2); @@ -127,8 +129,8 @@ void RWStepGeom_RWQuasiUniformCurveAndRationalBSplineCurve::ReadStep // --- field : weightsData --- Handle(TColStd_HArray1OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub6; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub6 = 0; if (data->ReadSubList (num,1,"weights_data",ach,nsub6)) { Standard_Integer nb6 = data->NbParams(nsub6); aWeightsData = new TColStd_HArray1OfReal (1, nb6); diff --git a/src/RWStepGeom/RWStepGeom_RWQuasiUniformSurface.cxx b/src/RWStepGeom/RWStepGeom_RWQuasiUniformSurface.cxx index 344e58c6e9..459f496a68 100644 --- a/src/RWStepGeom/RWStepGeom_RWQuasiUniformSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWQuasiUniformSurface.cxx @@ -54,13 +54,13 @@ void RWStepGeom_RWQuasiUniformSurface::ReadStep // --- inherited field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"u_degree",ach,aUDegree); // --- inherited field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"v_degree",ach,aVDegree); @@ -68,13 +68,13 @@ void RWStepGeom_RWQuasiUniformSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent4; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"control_points_list",ach,nsub4)) { Standard_Integer nbi4 = data->NbParams(nsub4); Standard_Integer nbj4 = data->NbParams(data->ParamNumber(nsub4,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi4, 1, nbj4); for (Standard_Integer i4 = 1; i4 <= nbi4; i4 ++) { - Standard_Integer nsi4; + Standard_Integer nsi4 = 0; if (data->ReadSubList (nsub4,i4,"sub-part(control_points_list)",ach,nsi4)) { for (Standard_Integer j4 =1; j4 <= nbj4; j4 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWQuasiUniformSurfaceAndRationalBSplineSurface.cxx b/src/RWStepGeom/RWStepGeom_RWQuasiUniformSurfaceAndRationalBSplineSurface.cxx index 5adb28f313..6cd98788dd 100644 --- a/src/RWStepGeom/RWStepGeom_RWQuasiUniformSurfaceAndRationalBSplineSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWQuasiUniformSurfaceAndRationalBSplineSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -57,13 +59,13 @@ void RWStepGeom_RWQuasiUniformSurfaceAndRationalBSplineSurface::ReadStep // --- field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"u_degree",ach,aUDegree); // --- field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"v_degree",ach,aVDegree); // --- field : controlPointsList --- @@ -71,13 +73,13 @@ void RWStepGeom_RWQuasiUniformSurfaceAndRationalBSplineSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nbi3 = data->NbParams(nsub3); Standard_Integer nbj3 = data->NbParams(data->ParamNumber(nsub3,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi3, 1, nbj3); for (Standard_Integer i3 = 1; i3 <= nbi3; i3 ++) { - Standard_Integer nsi3; + Standard_Integer nsi3 = 0; if (data->ReadSubList (nsub3,i3,"sub-part(control_points_list)",ach,nsi3)) { for (Standard_Integer j3 =1; j3 <= nbj3; j3 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed @@ -149,14 +151,14 @@ void RWStepGeom_RWQuasiUniformSurfaceAndRationalBSplineSurface::ReadStep // --- field : weightsData --- Handle(TColStd_HArray2OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub8; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub8 = 0; if (data->ReadSubList (num,1,"weights_data",ach,nsub8)) { Standard_Integer nbi8 = data->NbParams(nsub8); Standard_Integer nbj8 = data->NbParams(data->ParamNumber(nsub8,1)); aWeightsData = new TColStd_HArray2OfReal (1,nbi8,1,nbj8); for (Standard_Integer i8 = 1; i8 <= nbi8; i8 ++) { - Standard_Integer nsi8; + Standard_Integer nsi8 = 0; if (data->ReadSubList (nsub8,i8,"sub-part(weights_data)",ach,nsi8)) { for (Standard_Integer j8 =1; j8 <= nbj8; j8 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWRationalBSplineCurve.cxx b/src/RWStepGeom/RWStepGeom_RWRationalBSplineCurve.cxx index bae56fa1ef..e4f452ab8d 100644 --- a/src/RWStepGeom/RWStepGeom_RWRationalBSplineCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWRationalBSplineCurve.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -51,7 +53,7 @@ void RWStepGeom_RWRationalBSplineCurve::ReadStep // --- inherited field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"degree",ach,aDegree); @@ -59,7 +61,7 @@ void RWStepGeom_RWRationalBSplineCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb3); @@ -101,8 +103,8 @@ void RWStepGeom_RWRationalBSplineCurve::ReadStep // --- own field : weightsData --- Handle(TColStd_HArray1OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub7; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub7 = 0; if (data->ReadSubList (num,7,"weights_data",ach,nsub7)) { Standard_Integer nb7 = data->NbParams(nsub7); aWeightsData = new TColStd_HArray1OfReal (1, nb7); diff --git a/src/RWStepGeom/RWStepGeom_RWRationalBSplineSurface.cxx b/src/RWStepGeom/RWStepGeom_RWRationalBSplineSurface.cxx index b1d694e654..d2003b6c61 100644 --- a/src/RWStepGeom/RWStepGeom_RWRationalBSplineSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWRationalBSplineSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -56,13 +58,13 @@ void RWStepGeom_RWRationalBSplineSurface::ReadStep // --- inherited field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"u_degree",ach,aUDegree); // --- inherited field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"v_degree",ach,aVDegree); @@ -70,13 +72,13 @@ void RWStepGeom_RWRationalBSplineSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent4; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"control_points_list",ach,nsub4)) { Standard_Integer nbi4 = data->NbParams(nsub4); Standard_Integer nbj4 = data->NbParams(data->ParamNumber(nsub4,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi4, 1, nbj4); for (Standard_Integer i4 = 1; i4 <= nbi4; i4 ++) { - Standard_Integer nsi4; + Standard_Integer nsi4 = 0; if (data->ReadSubList (nsub4,i4,"sub-part(control_points_list)",ach,nsi4)) { for (Standard_Integer j4 =1; j4 <= nbj4; j4 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed @@ -129,14 +131,14 @@ void RWStepGeom_RWRationalBSplineSurface::ReadStep // --- own field : weightsData --- Handle(TColStd_HArray2OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub9; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub9 = 0; if (data->ReadSubList (num,9,"weights_data",ach,nsub9)) { Standard_Integer nbi9 = data->NbParams(nsub9); Standard_Integer nbj9 = data->NbParams(data->ParamNumber(nsub9,1)); aWeightsData = new TColStd_HArray2OfReal (1,nbi9,1,nbj9); for (Standard_Integer i9 = 1; i9 <= nbi9; i9 ++) { - Standard_Integer nsi9; + Standard_Integer nsi9 = 0; if (data->ReadSubList (nsub9,i9,"sub-part(weights_data)",ach,nsi9)) { for (Standard_Integer j9 =1; j9 <= nbj9; j9 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat9 =` not needed @@ -253,8 +255,8 @@ void RWStepGeom_RWRationalBSplineSurface::Check Standard_Integer nbWgtV = ent->NbWeightsDataJ(); Standard_Integer nbCPLU = ent->NbControlPointsListI(); Standard_Integer nbCPLV = ent->NbControlPointsListJ(); - Standard_Integer i; - Standard_Integer j; + Standard_Integer i = 0; + Standard_Integer j = 0; // std::cout << "RationalBSplineCurve: nbWgtU=" << nbWgtU << " nbCPLU: " << // nbCPLU << std::endl; // std::cout << " nbWgtV=" << nbWgtV << " nbCPLV: " << diff --git a/src/RWStepGeom/RWStepGeom_RWRectangularCompositeSurface.cxx b/src/RWStepGeom/RWStepGeom_RWRectangularCompositeSurface.cxx index 21d425955a..004a748ba0 100644 --- a/src/RWStepGeom/RWStepGeom_RWRectangularCompositeSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWRectangularCompositeSurface.cxx @@ -44,13 +44,13 @@ void RWStepGeom_RWRectangularCompositeSurface::ReadStep Handle(StepGeom_HArray2OfSurfacePatch) aSegments; Handle(StepGeom_SurfacePatch) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"segments",ach,nsub2)) { Standard_Integer nbi2 = data->NbParams(nsub2); Standard_Integer nbj2 = data->NbParams(data->ParamNumber(nsub2,1)); aSegments = new StepGeom_HArray2OfSurfacePatch (1, nbi2, 1, nbj2); for (Standard_Integer i2 = 1; i2 <= nbi2; i2 ++) { - Standard_Integer nsi2; + Standard_Integer nsi2 = 0; if (data->ReadSubList (nsub2,i2,"sub-part(segments)",ach,nsi2)) { for (Standard_Integer j2 =1; j2 <= nbj2; j2 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWRectangularTrimmedSurface.cxx b/src/RWStepGeom/RWStepGeom_RWRectangularTrimmedSurface.cxx index 853ff256d3..641f1b0d28 100644 --- a/src/RWStepGeom/RWStepGeom_RWRectangularTrimmedSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWRectangularTrimmedSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,37 +49,37 @@ void RWStepGeom_RWRectangularTrimmedSurface::ReadStep // --- own field : u1 --- - Standard_Real aU1; + Standard_Real aU1 = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"u1",ach,aU1); // --- own field : u2 --- - Standard_Real aU2; + Standard_Real aU2 = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"u2",ach,aU2); // --- own field : v1 --- - Standard_Real aV1; + Standard_Real aV1 = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadReal (num,5,"v1",ach,aV1); // --- own field : v2 --- - Standard_Real aV2; + Standard_Real aV2 = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat6 =` not needed data->ReadReal (num,6,"v2",ach,aV2); // --- own field : usense --- - Standard_Boolean aUsense; + Standard_Boolean aUsense = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat7 =` not needed data->ReadBoolean (num,7,"usense",ach,aUsense); // --- own field : vsense --- - Standard_Boolean aVsense; + Standard_Boolean aVsense = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed data->ReadBoolean (num,8,"vsense",ach,aVsense); diff --git a/src/RWStepGeom/RWStepGeom_RWReparametrisedCompositeCurveSegment.cxx b/src/RWStepGeom/RWStepGeom_RWReparametrisedCompositeCurveSegment.cxx index 25983b0ace..25dea2f2cf 100644 --- a/src/RWStepGeom/RWStepGeom_RWReparametrisedCompositeCurveSegment.cxx +++ b/src/RWStepGeom/RWStepGeom_RWReparametrisedCompositeCurveSegment.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -55,7 +57,7 @@ void RWStepGeom_RWReparametrisedCompositeCurveSegment::ReadStep // --- inherited field : sameSense --- - Standard_Boolean aSameSense; + Standard_Boolean aSameSense = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadBoolean (num,2,"same_sense",ach,aSameSense); @@ -67,7 +69,7 @@ void RWStepGeom_RWReparametrisedCompositeCurveSegment::ReadStep // --- own field : paramLength --- - Standard_Real aParamLength; + Standard_Real aParamLength = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"param_length",ach,aParamLength); diff --git a/src/RWStepGeom/RWStepGeom_RWSeamCurve.cxx b/src/RWStepGeom/RWStepGeom_RWSeamCurve.cxx index 5d2b073df7..a38439f0e6 100644 --- a/src/RWStepGeom/RWStepGeom_RWSeamCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWSeamCurve.cxx @@ -55,7 +55,7 @@ void RWStepGeom_RWSeamCurve::ReadStep Handle(StepGeom_HArray1OfPcurveOrSurface) aAssociatedGeometry; StepGeom_PcurveOrSurface aAssociatedGeometryItem; Handle(Standard_Transient) assgeomval; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"associated_geometry",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aAssociatedGeometry = new StepGeom_HArray1OfPcurveOrSurface (1, nb3); diff --git a/src/RWStepGeom/RWStepGeom_RWSphericalSurface.cxx b/src/RWStepGeom/RWStepGeom_RWSphericalSurface.cxx index 2dc774ebf1..516248e5bf 100644 --- a/src/RWStepGeom/RWStepGeom_RWSphericalSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWSphericalSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ void RWStepGeom_RWSphericalSurface::ReadStep // --- own field : radius --- - Standard_Real aRadius; + Standard_Real aRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"radius",ach,aRadius); diff --git a/src/RWStepGeom/RWStepGeom_RWSuParameters.cxx b/src/RWStepGeom/RWStepGeom_RWSuParameters.cxx index b299060c49..5e7be95ffb 100644 --- a/src/RWStepGeom/RWStepGeom_RWSuParameters.cxx +++ b/src/RWStepGeom/RWStepGeom_RWSuParameters.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -51,22 +53,22 @@ void RWStepGeom_RWSuParameters::ReadStep (const Handle(StepData_StepReaderData)& // Own fields of SuParameters - Standard_Real aA; + Standard_Real aA = NAN; theData->ReadReal (theNum, 2, "a", theAch, aA); - Standard_Real aAlpha; + Standard_Real aAlpha = NAN; theData->ReadReal (theNum, 3, "alpha", theAch, aAlpha); - Standard_Real aB; + Standard_Real aB = NAN; theData->ReadReal (theNum, 4, "b", theAch, aB); - Standard_Real aBeta; + Standard_Real aBeta = NAN; theData->ReadReal (theNum, 5, "beta", theAch, aBeta); - Standard_Real aC; + Standard_Real aC = NAN; theData->ReadReal (theNum, 6, "c", theAch, aC); - Standard_Real aGamma; + Standard_Real aGamma = NAN; theData->ReadReal (theNum, 7, "gamma", theAch, aGamma); // Initialize entity diff --git a/src/RWStepGeom/RWStepGeom_RWSurfaceCurve.cxx b/src/RWStepGeom/RWStepGeom_RWSurfaceCurve.cxx index 711996b177..08452d8304 100644 --- a/src/RWStepGeom/RWStepGeom_RWSurfaceCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWSurfaceCurve.cxx @@ -55,7 +55,7 @@ void RWStepGeom_RWSurfaceCurve::ReadStep Handle(StepGeom_HArray1OfPcurveOrSurface) aAssociatedGeometry; StepGeom_PcurveOrSurface aAssociatedGeometryItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"associated_geometry",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aAssociatedGeometry = new StepGeom_HArray1OfPcurveOrSurface (1, nb3); diff --git a/src/RWStepGeom/RWStepGeom_RWSurfaceCurveAndBoundedCurve.cxx b/src/RWStepGeom/RWStepGeom_RWSurfaceCurveAndBoundedCurve.cxx index 186c6173e9..f2b5a8e1b4 100644 --- a/src/RWStepGeom/RWStepGeom_RWSurfaceCurveAndBoundedCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWSurfaceCurveAndBoundedCurve.cxx @@ -70,7 +70,7 @@ void RWStepGeom_RWSurfaceCurveAndBoundedCurve::ReadStep // --- own field : associatedGeometry --- Handle(StepGeom_HArray1OfPcurveOrSurface) aAssociatedGeometry; StepGeom_PcurveOrSurface aAssociatedGeometryItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if ( data->ReadSubList ( num1, 2, "associated_geometry", ach, nsub3 ) ) { Standard_Integer nb3 = data->NbParams(nsub3); aAssociatedGeometry = new StepGeom_HArray1OfPcurveOrSurface (1, nb3); diff --git a/src/RWStepGeom/RWStepGeom_RWSurfacePatch.cxx b/src/RWStepGeom/RWStepGeom_RWSurfacePatch.cxx index 847f04c877..d2c4e5bda7 100644 --- a/src/RWStepGeom/RWStepGeom_RWSurfacePatch.cxx +++ b/src/RWStepGeom/RWStepGeom_RWSurfacePatch.cxx @@ -75,13 +75,13 @@ void RWStepGeom_RWSurfacePatch::ReadStep // --- own field : uSense --- - Standard_Boolean aUSense; + Standard_Boolean aUSense = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadBoolean (num,4,"u_sense",ach,aUSense); // --- own field : vSense --- - Standard_Boolean aVSense; + Standard_Boolean aVSense = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadBoolean (num,5,"v_sense",ach,aVSense); diff --git a/src/RWStepGeom/RWStepGeom_RWToroidalSurface.cxx b/src/RWStepGeom/RWStepGeom_RWToroidalSurface.cxx index e3978da45d..f8e458b2c3 100644 --- a/src/RWStepGeom/RWStepGeom_RWToroidalSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWToroidalSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -48,13 +50,13 @@ void RWStepGeom_RWToroidalSurface::ReadStep // --- own field : majorRadius --- - Standard_Real aMajorRadius; + Standard_Real aMajorRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"major_radius",ach,aMajorRadius); // --- own field : minorRadius --- - Standard_Real aMinorRadius; + Standard_Real aMinorRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"minor_radius",ach,aMinorRadius); diff --git a/src/RWStepGeom/RWStepGeom_RWTrimmedCurve.cxx b/src/RWStepGeom/RWStepGeom_RWTrimmedCurve.cxx index 7b8cb727f3..b9bf8ea6e4 100644 --- a/src/RWStepGeom/RWStepGeom_RWTrimmedCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWTrimmedCurve.cxx @@ -60,7 +60,7 @@ void RWStepGeom_RWTrimmedCurve::ReadStep //Standard_Real aParameterValue; //szv#4:S4163:12Mar99 unused Handle(StepGeom_HArray1OfTrimmingSelect) aTrim1; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"trim_1",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aTrim1 = new StepGeom_HArray1OfTrimmingSelect (1, nb3); @@ -75,7 +75,7 @@ void RWStepGeom_RWTrimmedCurve::ReadStep // --- own field : trim2 --- Handle(StepGeom_HArray1OfTrimmingSelect) aTrim2; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"trim_2",ach,nsub4)) { Standard_Integer nb4 = data->NbParams(nsub4); aTrim2 = new StepGeom_HArray1OfTrimmingSelect (1, nb4); @@ -90,7 +90,7 @@ void RWStepGeom_RWTrimmedCurve::ReadStep // --- own field : senseAgreement --- - Standard_Boolean aSenseAgreement; + Standard_Boolean aSenseAgreement = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadBoolean (num,5,"sense_agreement",ach,aSenseAgreement); diff --git a/src/RWStepGeom/RWStepGeom_RWUniformCurve.cxx b/src/RWStepGeom/RWStepGeom_RWUniformCurve.cxx index f8c3cff983..8dc63d442f 100644 --- a/src/RWStepGeom/RWStepGeom_RWUniformCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWUniformCurve.cxx @@ -49,7 +49,7 @@ void RWStepGeom_RWUniformCurve::ReadStep // --- inherited field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"degree",ach,aDegree); @@ -57,7 +57,7 @@ void RWStepGeom_RWUniformCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb3); diff --git a/src/RWStepGeom/RWStepGeom_RWUniformCurveAndRationalBSplineCurve.cxx b/src/RWStepGeom/RWStepGeom_RWUniformCurveAndRationalBSplineCurve.cxx index 55ea135840..710577a43d 100644 --- a/src/RWStepGeom/RWStepGeom_RWUniformCurveAndRationalBSplineCurve.cxx +++ b/src/RWStepGeom/RWStepGeom_RWUniformCurveAndRationalBSplineCurve.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -54,7 +56,7 @@ void RWStepGeom_RWUniformCurveAndRationalBSplineCurve::ReadStep // --- field : degree --- - Standard_Integer aDegree; + Standard_Integer aDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"degree",ach,aDegree); // --- field : controlPointsList --- @@ -62,7 +64,7 @@ void RWStepGeom_RWUniformCurveAndRationalBSplineCurve::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"control_points_list",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aControlPointsList = new StepGeom_HArray1OfCartesianPoint (1, nb2); @@ -123,8 +125,8 @@ void RWStepGeom_RWUniformCurveAndRationalBSplineCurve::ReadStep // --- field : weightsData --- Handle(TColStd_HArray1OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub6; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub6 = 0; if (data->ReadSubList (num,1,"weights_data",ach,nsub6)) { Standard_Integer nb6 = data->NbParams(nsub6); aWeightsData = new TColStd_HArray1OfReal (1, nb6); diff --git a/src/RWStepGeom/RWStepGeom_RWUniformSurface.cxx b/src/RWStepGeom/RWStepGeom_RWUniformSurface.cxx index cdc9caea6e..96e16d8203 100644 --- a/src/RWStepGeom/RWStepGeom_RWUniformSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWUniformSurface.cxx @@ -54,13 +54,13 @@ void RWStepGeom_RWUniformSurface::ReadStep // --- inherited field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"u_degree",ach,aUDegree); // --- inherited field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadInteger (num,3,"v_degree",ach,aVDegree); @@ -68,13 +68,13 @@ void RWStepGeom_RWUniformSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent4; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"control_points_list",ach,nsub4)) { Standard_Integer nbi4 = data->NbParams(nsub4); Standard_Integer nbj4 = data->NbParams(data->ParamNumber(nsub4,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi4, 1, nbj4); for (Standard_Integer i4 = 1; i4 <= nbi4; i4 ++) { - Standard_Integer nsi4; + Standard_Integer nsi4 = 0; if (data->ReadSubList (nsub4,i4,"sub-part(control_points_list)",ach,nsi4)) { for (Standard_Integer j4 =1; j4 <= nbj4; j4 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWUniformSurfaceAndRationalBSplineSurface.cxx b/src/RWStepGeom/RWStepGeom_RWUniformSurfaceAndRationalBSplineSurface.cxx index 5cef2b3806..b82d37deb2 100644 --- a/src/RWStepGeom/RWStepGeom_RWUniformSurfaceAndRationalBSplineSurface.cxx +++ b/src/RWStepGeom/RWStepGeom_RWUniformSurfaceAndRationalBSplineSurface.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -59,13 +61,13 @@ void RWStepGeom_RWUniformSurfaceAndRationalBSplineSurface::ReadStep // --- field : uDegree --- - Standard_Integer aUDegree; + Standard_Integer aUDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadInteger (num,1,"u_degree",ach,aUDegree); // --- field : vDegree --- - Standard_Integer aVDegree; + Standard_Integer aVDegree = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadInteger (num,2,"v_degree",ach,aVDegree); // --- field : controlPointsList --- @@ -73,13 +75,13 @@ void RWStepGeom_RWUniformSurfaceAndRationalBSplineSurface::ReadStep Handle(StepGeom_HArray2OfCartesianPoint) aControlPointsList; Handle(StepGeom_CartesianPoint) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"control_points_list",ach,nsub3)) { Standard_Integer nbi3 = data->NbParams(nsub3); Standard_Integer nbj3 = data->NbParams(data->ParamNumber(nsub3,1)); aControlPointsList = new StepGeom_HArray2OfCartesianPoint (1, nbi3, 1, nbj3); for (Standard_Integer i3 = 1; i3 <= nbi3; i3 ++) { - Standard_Integer nsi3; + Standard_Integer nsi3 = 0; if (data->ReadSubList (nsub3,i3,"sub-part(control_points_list)",ach,nsi3)) { for (Standard_Integer j3 =1; j3 <= nbj3; j3 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed @@ -145,14 +147,14 @@ void RWStepGeom_RWUniformSurfaceAndRationalBSplineSurface::ReadStep // --- field : weightsData --- Handle(TColStd_HArray2OfReal) aWeightsData; - Standard_Real aWeightsDataItem; - Standard_Integer nsub8; + Standard_Real aWeightsDataItem = NAN; + Standard_Integer nsub8 = 0; if (data->ReadSubList (num,1,"weights_data",ach,nsub8)) { Standard_Integer nbi8 = data->NbParams(nsub8); Standard_Integer nbj8 = data->NbParams(data->ParamNumber(nsub8,1)); aWeightsData = new TColStd_HArray2OfReal (1,nbi8,1,nbj8); for (Standard_Integer i8 = 1; i8 <= nbi8; i8 ++) { - Standard_Integer nsi8; + Standard_Integer nsi8 = 0; if (data->ReadSubList (nsub8,i8,"sub-part(weights_data)",ach,nsi8)) { for (Standard_Integer j8 =1; j8 <= nbj8; j8 ++) { //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed diff --git a/src/RWStepGeom/RWStepGeom_RWVector.cxx b/src/RWStepGeom/RWStepGeom_RWVector.cxx index 1417a3ace6..b06aa0e4c4 100644 --- a/src/RWStepGeom/RWStepGeom_RWVector.cxx +++ b/src/RWStepGeom/RWStepGeom_RWVector.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -48,7 +50,7 @@ void RWStepGeom_RWVector::ReadStep // --- own field : magnitude --- - Standard_Real aMagnitude; + Standard_Real aMagnitude = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"magnitude",ach,aMagnitude); diff --git a/src/RWStepKinematics/RWStepKinematics_RWActuatedKinPairAndOrderKinPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWActuatedKinPairAndOrderKinPair.cxx index c56c22a4a0..f8686bcaf0 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWActuatedKinPairAndOrderKinPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWActuatedKinPairAndOrderKinPair.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -268,7 +270,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep { // Own fields of revolute_pair_with_range aKinematicPair = new StepKinematics_RevolutePairWithRange; - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -280,7 +282,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -343,7 +345,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep // Own fields of cylindrical_pair_with_range aKinematicPair = new StepKinematics_CylindricalPairWithRange; - Standard_Real aLowerLimitActualTranslation; + Standard_Real aLowerLimitActualTranslation = NAN; Standard_Boolean hasLowerLimitActualTranslation = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -355,7 +357,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualTranslation = 0; } - Standard_Real aUpperLimitActualTranslation; + Standard_Real aUpperLimitActualTranslation = NAN; Standard_Boolean hasUpperLimitActualTranslation = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -367,7 +369,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitActualTranslation = 0; } - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 3)) { @@ -379,7 +381,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 4)) { @@ -446,7 +448,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep // Own fields of spherical_pair_with_range aKinematicPair = new StepKinematics_SphericalPairWithRange; - Standard_Real aLowerLimitYaw; + Standard_Real aLowerLimitYaw = NAN; Standard_Boolean hasLowerLimitYaw = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -458,7 +460,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitYaw = 0; } - Standard_Real aUpperLimitYaw; + Standard_Real aUpperLimitYaw = NAN; Standard_Boolean hasUpperLimitYaw = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -470,7 +472,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitYaw = 0; } - Standard_Real aLowerLimitPitch; + Standard_Real aLowerLimitPitch = NAN; Standard_Boolean hasLowerLimitPitch = Standard_True; if (theData->IsParamDefined(theNum, 3)) { @@ -482,7 +484,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitPitch = 0; } - Standard_Real aUpperLimitPitch; + Standard_Real aUpperLimitPitch = NAN; Standard_Boolean hasUpperLimitPitch = Standard_True; if (theData->IsParamDefined(theNum, 4)) { @@ -494,7 +496,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitPitch = 0; } - Standard_Real aLowerLimitRoll; + Standard_Real aLowerLimitRoll = NAN; Standard_Boolean hasLowerLimitRoll = Standard_True; if (theData->IsParamDefined(theNum, 5)) { @@ -506,7 +508,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitRoll = 0; } - Standard_Real aUpperLimitRoll; + Standard_Real aUpperLimitRoll = NAN; Standard_Boolean hasUpperLimitRoll = Standard_True; if (theData->IsParamDefined(theNum, 6)) { @@ -578,7 +580,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aKinematicPair = new StepKinematics_SphericalPairWithPinAndRange; - Standard_Real aLowerLimitYaw; + Standard_Real aLowerLimitYaw = NAN; Standard_Boolean hasLowerLimitYaw = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -590,7 +592,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitYaw = 0; } - Standard_Real aUpperLimitYaw; + Standard_Real aUpperLimitYaw = NAN; Standard_Boolean hasUpperLimitYaw = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -602,7 +604,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitYaw = 0; } - Standard_Real aLowerLimitRoll; + Standard_Real aLowerLimitRoll = NAN; Standard_Boolean hasLowerLimitRoll = Standard_True; if (theData->IsParamDefined(theNum, 3)) { @@ -614,7 +616,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitRoll = 0; } - Standard_Real aUpperLimitRoll; + Standard_Real aUpperLimitRoll = NAN; Standard_Boolean hasUpperLimitRoll = Standard_True; if (theData->IsParamDefined(theNum, 4)) { @@ -682,7 +684,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aKinematicPair = new StepKinematics_PrismaticPairWithRange; // Own fields of prismatic_pair_with_range - Standard_Real aLowerLimitActualTranslation; + Standard_Real aLowerLimitActualTranslation = NAN; Standard_Boolean hasLowerLimitActualTranslation = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -694,7 +696,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualTranslation = 0; } - Standard_Real aUpperLimitActualTranslation; + Standard_Real aUpperLimitActualTranslation = NAN; Standard_Boolean hasUpperLimitActualTranslation = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -751,7 +753,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep // Own fields of universal_pair aKinematicPair = new StepKinematics_UniversalPair; - Standard_Real aInputSkewAngle; + Standard_Real aInputSkewAngle = NAN; Standard_Boolean hasInputSkewAngle = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -769,7 +771,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep { // Own fields of universal_pair_with_range - Standard_Real aLowerLimitFirstRotation; + Standard_Real aLowerLimitFirstRotation = NAN; Standard_Boolean hasLowerLimitFirstRotation = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -781,7 +783,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitFirstRotation = 0; } - Standard_Real aUpperLimitFirstRotation; + Standard_Real aUpperLimitFirstRotation = NAN; Standard_Boolean hasUpperLimitFirstRotation = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -793,7 +795,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitFirstRotation = 0; } - Standard_Real aLowerLimitSecondRotation; + Standard_Real aLowerLimitSecondRotation = NAN; Standard_Boolean hasLowerLimitSecondRotation = Standard_True; if (theData->IsParamDefined(theNum, 3)) { @@ -805,7 +807,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitSecondRotation = 0; } - Standard_Real aUpperLimitSecondRotation; + Standard_Real aUpperLimitSecondRotation = NAN; Standard_Boolean hasUpperLimitSecondRotation = Standard_True; if (theData->IsParamDefined(theNum, 4)) { @@ -877,7 +879,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep // Own fields of universal_pair_with_range aKinematicPair = new StepKinematics_PlanarPairWithRange; - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -889,7 +891,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -901,7 +903,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitActualRotation = 0; } - Standard_Real aLowerLimitActualTranslationX; + Standard_Real aLowerLimitActualTranslationX = NAN; Standard_Boolean hasLowerLimitActualTranslationX = Standard_True; if (theData->IsParamDefined(theNum, 3)) { @@ -913,7 +915,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualTranslationX = 0; } - Standard_Real aUpperLimitActualTranslationX; + Standard_Real aUpperLimitActualTranslationX = NAN; Standard_Boolean hasUpperLimitActualTranslationX = Standard_True; if (theData->IsParamDefined(theNum, 4)) { @@ -925,7 +927,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitActualTranslationX = 0; } - Standard_Real aLowerLimitActualTranslationY; + Standard_Real aLowerLimitActualTranslationY = NAN; Standard_Boolean hasLowerLimitActualTranslationY = Standard_True; if (theData->IsParamDefined(theNum, 5)) { @@ -937,7 +939,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualTranslationY = 0; } - Standard_Real aUpperLimitActualTranslationY; + Standard_Real aUpperLimitActualTranslationY = NAN; Standard_Boolean hasUpperLimitActualTranslationY = Standard_True; if (theData->IsParamDefined(theNum, 6)) { @@ -1007,19 +1009,19 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep // Inherited fields of GearPair - Standard_Real aGearPair_RadiusFirstLink; + Standard_Real aGearPair_RadiusFirstLink = NAN; theData->ReadReal(theNum, 1, "gear_pair.radius_first_link", theArch, aGearPair_RadiusFirstLink); - Standard_Real aGearPair_RadiusSecondLink; + Standard_Real aGearPair_RadiusSecondLink = NAN; theData->ReadReal(theNum, 2, "gear_pair.radius_second_link", theArch, aGearPair_RadiusSecondLink); - Standard_Real aGearPair_Bevel; + Standard_Real aGearPair_Bevel = NAN; theData->ReadReal(theNum, 3, "gear_pair.bevel", theArch, aGearPair_Bevel); - Standard_Real aGearPair_HelicalAngle; + Standard_Real aGearPair_HelicalAngle = NAN; theData->ReadReal(theNum, 4, "gear_pair.helical_angle", theArch, aGearPair_HelicalAngle); - Standard_Real aGearPair_GearRatio; + Standard_Real aGearPair_GearRatio = NAN; theData->ReadReal(theNum, 5, "gear_pair.gear_ratio", theArch, aGearPair_GearRatio); if (theData->NamedForComplex("GEAR_PAIR_WITH_RANGE", "GPWR", num0, theNum, theArch)) @@ -1030,7 +1032,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aKinematicPair = new StepKinematics_GearPairWithRange; - Standard_Real aLowerLimitActualRotation1; + Standard_Real aLowerLimitActualRotation1 = NAN; Standard_Boolean hasLowerLimitActualRotation1 = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -1042,7 +1044,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualRotation1 = 0; } - Standard_Real aUpperLimitActualRotation1; + Standard_Real aUpperLimitActualRotation1 = NAN; Standard_Boolean hasUpperLimitActualRotation1 = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -1097,7 +1099,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep { // Inherited fields of RackAndPinionPair - Standard_Real aRackAndPinionPair_PinionRadius; + Standard_Real aRackAndPinionPair_PinionRadius = NAN; theData->ReadReal(theNum, 1, "rack_and_pinion_pair.pinion_radius", theArch, aRackAndPinionPair_PinionRadius); if (theData->NamedForComplex("RACK_AND_PINION_PAIR_WITH_RANGE", "RAPPWR", num0, theNum, theArch)) @@ -1109,7 +1111,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aKinematicPair = new StepKinematics_RackAndPinionPairWithRange; - Standard_Real aLowerLimitRackDisplacement; + Standard_Real aLowerLimitRackDisplacement = NAN; Standard_Boolean hasLowerLimitRackDisplacement = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -1121,7 +1123,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitRackDisplacement = 0; } - Standard_Real aUpperLimitRackDisplacement; + Standard_Real aUpperLimitRackDisplacement = NAN; Standard_Boolean hasUpperLimitRackDisplacement = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -1168,7 +1170,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep { // Inherited fields of ScrewPair - Standard_Real aScrewPair_Pitch; + Standard_Real aScrewPair_Pitch = NAN; theData->ReadReal(theNum, 1, "screw_pair.pitch", theArch, aScrewPair_Pitch); if (theData->NamedForComplex("SCREW_PAIR_WITH_RANGE", "SPWR", num0, theNum, theArch)) @@ -1178,7 +1180,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep // Own fields of ScrewPairWithRange aKinematicPair = new StepKinematics_ScrewPairWithRange; - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 1)) { @@ -1190,7 +1192,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -1246,7 +1248,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep Handle(StepGeom_Curve) aPointOnPlanarCurvePair_PairCurve; theData->ReadEntity(theNum, 1, "point_on_planar_curve_pair.pair_curve", theArch, STANDARD_TYPE(StepGeom_Curve), aPointOnPlanarCurvePair_PairCurve); - Standard_Boolean aPointOnPlanarCurvePair_Orientation; + Standard_Boolean aPointOnPlanarCurvePair_Orientation = 0; theData->ReadBoolean(theNum, 2, "point_on_planar_curve_pair.orientation", theArch, aPointOnPlanarCurvePair_Orientation); @@ -1261,7 +1263,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep Handle(StepGeom_TrimmedCurve) aRangeOnPairCurve; theData->ReadEntity(theNum, 1, "range_on_pair_curve", theArch, STANDARD_TYPE(StepGeom_TrimmedCurve), aRangeOnPairCurve); - Standard_Real aLowerLimitYaw; + Standard_Real aLowerLimitYaw = NAN; Standard_Boolean hasLowerLimitYaw = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -1273,7 +1275,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitYaw = 0; } - Standard_Real aUpperLimitYaw; + Standard_Real aUpperLimitYaw = NAN; Standard_Boolean hasUpperLimitYaw = Standard_True; if (theData->IsParamDefined(theNum, 3)) { @@ -1285,7 +1287,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitYaw = 0; } - Standard_Real aLowerLimitPitch; + Standard_Real aLowerLimitPitch = NAN; Standard_Boolean hasLowerLimitPitch = Standard_True; if (theData->IsParamDefined(theNum, 4)) { @@ -1297,7 +1299,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitPitch = 0; } - Standard_Real aUpperLimitPitch; + Standard_Real aUpperLimitPitch = NAN; Standard_Boolean hasUpperLimitPitch = Standard_True; if (theData->IsParamDefined(theNum, 5)) { @@ -1309,7 +1311,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitPitch = 0; } - Standard_Real aLowerLimitRoll; + Standard_Real aLowerLimitRoll = NAN; Standard_Boolean hasLowerLimitRoll = Standard_True; if (theData->IsParamDefined(theNum, 6)) { @@ -1321,7 +1323,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitRoll = 0; } - Standard_Real aUpperLimitRoll; + Standard_Real aUpperLimitRoll = NAN; Standard_Boolean hasUpperLimitRoll = Standard_True; if (theData->IsParamDefined(theNum, 7)) { @@ -1394,7 +1396,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep Handle(StepGeom_RectangularTrimmedSurface) aRangeOnPairSurface; theData->ReadEntity(theNum, 1, "range_on_pair_surface", theArch, STANDARD_TYPE(StepGeom_RectangularTrimmedSurface), aRangeOnPairSurface); - Standard_Real aLowerLimitYaw; + Standard_Real aLowerLimitYaw = NAN; Standard_Boolean hasLowerLimitYaw = Standard_True; if (theData->IsParamDefined(theNum, 2)) { @@ -1406,7 +1408,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitYaw = 0; } - Standard_Real aUpperLimitYaw; + Standard_Real aUpperLimitYaw = NAN; Standard_Boolean hasUpperLimitYaw = Standard_True; if (theData->IsParamDefined(theNum, 3)) { @@ -1418,7 +1420,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitYaw = 0; } - Standard_Real aLowerLimitPitch; + Standard_Real aLowerLimitPitch = NAN; Standard_Boolean hasLowerLimitPitch = Standard_True; if (theData->IsParamDefined(theNum, 4)) { @@ -1430,7 +1432,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitPitch = 0; } - Standard_Real aUpperLimitPitch; + Standard_Real aUpperLimitPitch = NAN; Standard_Boolean hasUpperLimitPitch = Standard_True; if (theData->IsParamDefined(theNum, 5)) { @@ -1442,7 +1444,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aUpperLimitPitch = 0; } - Standard_Real aLowerLimitRoll; + Standard_Real aLowerLimitRoll = NAN; Standard_Boolean hasLowerLimitRoll = Standard_True; if (theData->IsParamDefined(theNum, 6)) { @@ -1454,7 +1456,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitRoll = 0; } - Standard_Real aUpperLimitRoll; + Standard_Real aUpperLimitRoll = NAN; Standard_Boolean hasUpperLimitRoll = Standard_True; if (theData->IsParamDefined(theNum, 7)) { @@ -1515,7 +1517,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep Handle(StepGeom_Curve) aPlanarCurvePair_Curve2; theData->ReadEntity(theNum, 2, "planar_curve_pair.curve2", theArch, STANDARD_TYPE(StepGeom_Curve), aPlanarCurvePair_Curve2); - Standard_Boolean aPlanarCurvePair_Orientation; + Standard_Boolean aPlanarCurvePair_Orientation = 0; theData->ReadBoolean(theNum, 3, "planar_curve_pair.orientation", theArch, aPlanarCurvePair_Orientation); if (theData->NamedForComplex("PLANAR_CURVE_PAIR_RANGE", "PCPR", num0, theNum, theArch)) @@ -1575,7 +1577,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep Handle(StepGeom_Surface) aSurfacePair_Surface2; theData->ReadEntity(theNum, 2, "surface_pair.surface2", theArch, STANDARD_TYPE(StepGeom_Surface), aSurfacePair_Surface2); - Standard_Boolean aSurfacePair_Orientation; + Standard_Boolean aSurfacePair_Orientation = 0; theData->ReadBoolean(theNum, 3, "surface_pair.orientation", theArch, aSurfacePair_Orientation); if (theData->NamedForComplex("SURFACE_PAIR_WITH_RANGE", "SPW1", num0, theNum, theArch)) @@ -1591,7 +1593,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep Handle(StepGeom_RectangularTrimmedSurface) aRangeOnSurface2; theData->ReadEntity(theNum, 2, "range_on_surface2", theArch, STANDARD_TYPE(StepGeom_RectangularTrimmedSurface), aRangeOnSurface2); - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 3)) { @@ -1603,7 +1605,7 @@ void RWStepKinematics_RWActuatedKinPairAndOrderKinPair::ReadStep aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if (theData->IsParamDefined(theNum, 4)) { diff --git a/src/RWStepKinematics/RWStepKinematics_RWCylindricalPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWCylindricalPair.cxx index f1ee0e99a4..e10e93079b 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWCylindricalPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWCylindricalPair.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWCylindricalPair::ReadStep (const Handle(StepData_StepRea // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWCylindricalPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWCylindricalPairValue.cxx index 3b7583aa2c..317a5529aa 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWCylindricalPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWCylindricalPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,10 +57,10 @@ void RWStepKinematics_RWCylindricalPairValue::ReadStep (const Handle(StepData_St // Own fields of CylindricalPairValue - Standard_Real aActualTranslation; + Standard_Real aActualTranslation = NAN; theData->ReadReal (theNum, 3, "actual_translation", theArch, aActualTranslation); - Standard_Real aActualRotation; + Standard_Real aActualRotation = NAN; theData->ReadReal (theNum, 4, "actual_rotation", theArch, aActualRotation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWCylindricalPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWCylindricalPairWithRange.cxx index 540e9f9e2c..633424849b 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWCylindricalPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWCylindricalPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWCylindricalPairWithRange::ReadStep (const Handle(StepDat // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Own fields of CylindricalPairWithRange - Standard_Real aLowerLimitActualTranslation; + Standard_Real aLowerLimitActualTranslation = NAN; Standard_Boolean hasLowerLimitActualTranslation = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "lower_limit_actual_translation", theArch, aLowerLimitActualTranslation); @@ -108,7 +110,7 @@ void RWStepKinematics_RWCylindricalPairWithRange::ReadStep (const Handle(StepDat aLowerLimitActualTranslation = 0; } - Standard_Real aUpperLimitActualTranslation; + Standard_Real aUpperLimitActualTranslation = NAN; Standard_Boolean hasUpperLimitActualTranslation = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "upper_limit_actual_translation", theArch, aUpperLimitActualTranslation); @@ -118,7 +120,7 @@ void RWStepKinematics_RWCylindricalPairWithRange::ReadStep (const Handle(StepDat aUpperLimitActualTranslation = 0; } - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,15) ) { theData->ReadReal (theNum, 15, "lower_limit_actual_rotation", theArch, aLowerLimitActualRotation); @@ -128,7 +130,7 @@ void RWStepKinematics_RWCylindricalPairWithRange::ReadStep (const Handle(StepDat aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,16) ) { theData->ReadReal (theNum, 16, "upper_limit_actual_rotation", theArch, aUpperLimitActualRotation); diff --git a/src/RWStepKinematics/RWStepKinematics_RWFullyConstrainedPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWFullyConstrainedPair.cxx index 674f0794fc..5fdd459910 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWFullyConstrainedPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWFullyConstrainedPair.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWFullyConstrainedPair::ReadStep (const Handle(StepData_St // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWGearPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWGearPair.cxx index 3aa037d18b..23eb8e4526 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWGearPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWGearPair.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,19 +80,19 @@ void RWStepKinematics_RWGearPair::ReadStep (const Handle(StepData_StepReaderData // Own fields of GearPair - Standard_Real aRadiusFirstLink; + Standard_Real aRadiusFirstLink = NAN; theData->ReadReal (theNum, 7, "radius_first_link", theArch, aRadiusFirstLink); - Standard_Real aRadiusSecondLink; + Standard_Real aRadiusSecondLink = NAN; theData->ReadReal (theNum, 8, "radius_second_link", theArch, aRadiusSecondLink); - Standard_Real aBevel; + Standard_Real aBevel = NAN; theData->ReadReal (theNum, 9, "bevel", theArch, aBevel); - Standard_Real aHelicalAngle; + Standard_Real aHelicalAngle = NAN; theData->ReadReal (theNum, 10, "helical_angle", theArch, aHelicalAngle); - Standard_Real aGearRatio; + Standard_Real aGearRatio = NAN; theData->ReadReal (theNum, 11, "gear_ratio", theArch, aGearRatio); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWGearPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWGearPairValue.cxx index 74715d5a7e..cb5b64d21d 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWGearPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWGearPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,7 +57,7 @@ void RWStepKinematics_RWGearPairValue::ReadStep (const Handle(StepData_StepReade // Own fields of GearPairValue - Standard_Real aActualRotation1; + Standard_Real aActualRotation1 = NAN; theData->ReadReal (theNum, 3, "actual_rotation1", theArch, aActualRotation1); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWGearPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWGearPairWithRange.cxx index 292f3aa3f6..0af9d5e5f4 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWGearPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWGearPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,24 +80,24 @@ void RWStepKinematics_RWGearPairWithRange::ReadStep (const Handle(StepData_StepR // Inherited fields of GearPair - Standard_Real aGearPair_RadiusFirstLink; + Standard_Real aGearPair_RadiusFirstLink = NAN; theData->ReadReal (theNum, 7, "gear_pair.radius_first_link", theArch, aGearPair_RadiusFirstLink); - Standard_Real aGearPair_RadiusSecondLink; + Standard_Real aGearPair_RadiusSecondLink = NAN; theData->ReadReal (theNum, 8, "gear_pair.radius_second_link", theArch, aGearPair_RadiusSecondLink); - Standard_Real aGearPair_Bevel; + Standard_Real aGearPair_Bevel = NAN; theData->ReadReal (theNum, 9, "gear_pair.bevel", theArch, aGearPair_Bevel); - Standard_Real aGearPair_HelicalAngle; + Standard_Real aGearPair_HelicalAngle = NAN; theData->ReadReal (theNum, 10, "gear_pair.helical_angle", theArch, aGearPair_HelicalAngle); - Standard_Real aGearPair_GearRatio; + Standard_Real aGearPair_GearRatio = NAN; theData->ReadReal (theNum, 11, "gear_pair.gear_ratio", theArch, aGearPair_GearRatio); // Own fields of GearPairWithRange - Standard_Real aLowerLimitActualRotation1; + Standard_Real aLowerLimitActualRotation1 = NAN; Standard_Boolean hasLowerLimitActualRotation1 = Standard_True; if ( theData->IsParamDefined (theNum,12) ) { theData->ReadReal (theNum, 12, "lower_limit_actual_rotation1", theArch, aLowerLimitActualRotation1); @@ -105,7 +107,7 @@ void RWStepKinematics_RWGearPairWithRange::ReadStep (const Handle(StepData_StepR aLowerLimitActualRotation1 = 0; } - Standard_Real aUpperLimitActualRotation1; + Standard_Real aUpperLimitActualRotation1 = NAN; Standard_Boolean hasUpperLimitActualRotation1 = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "upper_limit_actual_rotation1", theArch, aUpperLimitActualRotation1); diff --git a/src/RWStepKinematics/RWStepKinematics_RWHomokineticPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWHomokineticPair.cxx index 5c59606fe0..e70e48a3af 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWHomokineticPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWHomokineticPair.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWHomokineticPair::ReadStep (const Handle(StepData_StepRea // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Inherited fields of UniversalPair - Standard_Real aUniversalPair_InputSkewAngle; + Standard_Real aUniversalPair_InputSkewAngle = NAN; Standard_Boolean hasUniversalPair_InputSkewAngle = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "universal_pair.input_skew_angle", theArch, aUniversalPair_InputSkewAngle); diff --git a/src/RWStepKinematics/RWStepKinematics_RWLinearFlexibleAndPinionPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWLinearFlexibleAndPinionPair.cxx index b6aca30c9c..4907105029 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWLinearFlexibleAndPinionPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWLinearFlexibleAndPinionPair.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,7 +80,7 @@ void RWStepKinematics_RWLinearFlexibleAndPinionPair::ReadStep (const Handle(Step // Own fields of LinearFlexibleAndPinionPair - Standard_Real aPinionRadius; + Standard_Real aPinionRadius = NAN; theData->ReadReal (theNum, 7, "pinion_radius", theArch, aPinionRadius); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWLinearFlexibleAndPlanarCurvePair.cxx b/src/RWStepKinematics/RWStepKinematics_RWLinearFlexibleAndPlanarCurvePair.cxx index bb4fa46f46..928dd3e859 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWLinearFlexibleAndPlanarCurvePair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWLinearFlexibleAndPlanarCurvePair.cxx @@ -81,7 +81,7 @@ void RWStepKinematics_RWLinearFlexibleAndPlanarCurvePair::ReadStep (const Handle Handle(StepGeom_Curve) aPairCurve; theData->ReadEntity (theNum, 7, "pair_curve", theArch, STANDARD_TYPE(StepGeom_Curve), aPairCurve); - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; theData->ReadBoolean (theNum, 8, "orientation", theArch, aOrientation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPair.cxx index 1f7da0c5b5..1b10d9fdb4 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPair.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWLowOrderKinematicPair::ReadStep (const Handle(StepData_S // Own fields of LowOrderKinematicPair - Standard_Boolean aTX; + Standard_Boolean aTX = 0; theData->ReadBoolean (theNum, 7, "t_x", theArch, aTX); - Standard_Boolean aTY; + Standard_Boolean aTY = 0; theData->ReadBoolean (theNum, 8, "t_y", theArch, aTY); - Standard_Boolean aTZ; + Standard_Boolean aTZ = 0; theData->ReadBoolean (theNum, 9, "t_z", theArch, aTZ); - Standard_Boolean aRX; + Standard_Boolean aRX = 0; theData->ReadBoolean (theNum, 10, "r_x", theArch, aRX); - Standard_Boolean aRY; + Standard_Boolean aRY = 0; theData->ReadBoolean (theNum, 11, "r_y", theArch, aRY); - Standard_Boolean aRZ; + Standard_Boolean aRZ = 0; theData->ReadBoolean (theNum, 12, "r_z", theArch, aRZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPairValue.cxx index 41a432b814..89ad9d1b9a 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,22 +57,22 @@ void RWStepKinematics_RWLowOrderKinematicPairValue::ReadStep (const Handle(StepD // Own fields of LowOrderKinematicPairValue - Standard_Real aActualTranslationX; + Standard_Real aActualTranslationX = NAN; theData->ReadReal (theNum, 3, "actual_translation_x", theArch, aActualTranslationX); - Standard_Real aActualTranslationY; + Standard_Real aActualTranslationY = NAN; theData->ReadReal (theNum, 4, "actual_translation_y", theArch, aActualTranslationY); - Standard_Real aActualTranslationZ; + Standard_Real aActualTranslationZ = NAN; theData->ReadReal (theNum, 5, "actual_translation_z", theArch, aActualTranslationZ); - Standard_Real aActualRotationX; + Standard_Real aActualRotationX = NAN; theData->ReadReal (theNum, 6, "actual_rotation_x", theArch, aActualRotationX); - Standard_Real aActualRotationY; + Standard_Real aActualRotationY = NAN; theData->ReadReal (theNum, 7, "actual_rotation_y", theArch, aActualRotationY); - Standard_Real aActualRotationZ; + Standard_Real aActualRotationZ = NAN; theData->ReadReal (theNum, 8, "actual_rotation_z", theArch, aActualRotationZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPairWithRange.cxx index 34572fcb39..4f3f741803 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWLowOrderKinematicPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Own fields of LowOrderKinematicPairWithRange - Standard_Real aLowerLimitActualRotationX; + Standard_Real aLowerLimitActualRotationX = NAN; Standard_Boolean hasLowerLimitActualRotationX = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "lower_limit_actual_rotation_x", theArch, aLowerLimitActualRotationX); @@ -108,7 +110,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aLowerLimitActualRotationX = 0; } - Standard_Real aUpperLimitActualRotationX; + Standard_Real aUpperLimitActualRotationX = NAN; Standard_Boolean hasUpperLimitActualRotationX = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "upper_limit_actual_rotation_x", theArch, aUpperLimitActualRotationX); @@ -118,7 +120,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aUpperLimitActualRotationX = 0; } - Standard_Real aLowerLimitActualRotationY; + Standard_Real aLowerLimitActualRotationY = NAN; Standard_Boolean hasLowerLimitActualRotationY = Standard_True; if ( theData->IsParamDefined (theNum,15) ) { theData->ReadReal (theNum, 15, "lower_limit_actual_rotation_y", theArch, aLowerLimitActualRotationY); @@ -128,7 +130,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aLowerLimitActualRotationY = 0; } - Standard_Real aUpperLimitActualRotationY; + Standard_Real aUpperLimitActualRotationY = NAN; Standard_Boolean hasUpperLimitActualRotationY = Standard_True; if ( theData->IsParamDefined (theNum,16) ) { theData->ReadReal (theNum, 16, "upper_limit_actual_rotation_y", theArch, aUpperLimitActualRotationY); @@ -138,7 +140,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aUpperLimitActualRotationY = 0; } - Standard_Real aLowerLimitActualRotationZ; + Standard_Real aLowerLimitActualRotationZ = NAN; Standard_Boolean hasLowerLimitActualRotationZ = Standard_True; if ( theData->IsParamDefined (theNum,17) ) { theData->ReadReal (theNum, 17, "lower_limit_actual_rotation_z", theArch, aLowerLimitActualRotationZ); @@ -148,7 +150,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aLowerLimitActualRotationZ = 0; } - Standard_Real aUpperLimitActualRotationZ; + Standard_Real aUpperLimitActualRotationZ = NAN; Standard_Boolean hasUpperLimitActualRotationZ = Standard_True; if ( theData->IsParamDefined (theNum,18) ) { theData->ReadReal (theNum, 18, "upper_limit_actual_rotation_z", theArch, aUpperLimitActualRotationZ); @@ -158,7 +160,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aUpperLimitActualRotationZ = 0; } - Standard_Real aLowerLimitActualTranslationX; + Standard_Real aLowerLimitActualTranslationX = NAN; Standard_Boolean hasLowerLimitActualTranslationX = Standard_True; if ( theData->IsParamDefined (theNum,19) ) { theData->ReadReal (theNum, 19, "lower_limit_actual_translation_x", theArch, aLowerLimitActualTranslationX); @@ -168,7 +170,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aLowerLimitActualTranslationX = 0; } - Standard_Real aUpperLimitActualTranslationX; + Standard_Real aUpperLimitActualTranslationX = NAN; Standard_Boolean hasUpperLimitActualTranslationX = Standard_True; if ( theData->IsParamDefined (theNum,20) ) { theData->ReadReal (theNum, 20, "upper_limit_actual_translation_x", theArch, aUpperLimitActualTranslationX); @@ -178,7 +180,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aUpperLimitActualTranslationX = 0; } - Standard_Real aLowerLimitActualTranslationY; + Standard_Real aLowerLimitActualTranslationY = NAN; Standard_Boolean hasLowerLimitActualTranslationY = Standard_True; if ( theData->IsParamDefined (theNum,21) ) { theData->ReadReal (theNum, 21, "lower_limit_actual_translation_y", theArch, aLowerLimitActualTranslationY); @@ -188,7 +190,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aLowerLimitActualTranslationY = 0; } - Standard_Real aUpperLimitActualTranslationY; + Standard_Real aUpperLimitActualTranslationY = NAN; Standard_Boolean hasUpperLimitActualTranslationY = Standard_True; if ( theData->IsParamDefined (theNum,22) ) { theData->ReadReal (theNum, 22, "upper_limit_actual_translation_y", theArch, aUpperLimitActualTranslationY); @@ -198,7 +200,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aUpperLimitActualTranslationY = 0; } - Standard_Real aLowerLimitActualTranslationZ; + Standard_Real aLowerLimitActualTranslationZ = NAN; Standard_Boolean hasLowerLimitActualTranslationZ = Standard_True; if ( theData->IsParamDefined (theNum,23) ) { theData->ReadReal (theNum, 23, "lower_limit_actual_translation_z", theArch, aLowerLimitActualTranslationZ); @@ -208,7 +210,7 @@ void RWStepKinematics_RWLowOrderKinematicPairWithRange::ReadStep (const Handle(S aLowerLimitActualTranslationZ = 0; } - Standard_Real aUpperLimitActualTranslationZ; + Standard_Real aUpperLimitActualTranslationZ = NAN; Standard_Boolean hasUpperLimitActualTranslationZ = Standard_True; if ( theData->IsParamDefined (theNum,24) ) { theData->ReadReal (theNum, 24, "upper_limit_actual_translation_z", theArch, aUpperLimitActualTranslationZ); diff --git a/src/RWStepKinematics/RWStepKinematics_RWMechanismStateRepresentation.cxx b/src/RWStepKinematics/RWStepKinematics_RWMechanismStateRepresentation.cxx index 5478b6874e..cfae1dfc9b 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWMechanismStateRepresentation.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWMechanismStateRepresentation.cxx @@ -49,7 +49,7 @@ void RWStepKinematics_RWMechanismStateRepresentation::ReadStep // Inherited field : items Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anEnt; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (theData->ReadSubList (theNum, 2, "items", theArch, nsub)) { Standard_Integer nb = theData->NbParams(nsub); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb); diff --git a/src/RWStepKinematics/RWStepKinematics_RWOrientedJoint.cxx b/src/RWStepKinematics/RWStepKinematics_RWOrientedJoint.cxx index 029d6c4073..e3cc891705 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWOrientedJoint.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWOrientedJoint.cxx @@ -61,7 +61,7 @@ void RWStepKinematics_RWOrientedJoint::ReadStep (const Handle(StepData_StepReade Handle(StepShape_Edge) aOrientedEdge_EdgeElement; theData->ReadEntity (theNum, 4, "oriented_edge.edge_element", theArch, STANDARD_TYPE(StepShape_Edge), aOrientedEdge_EdgeElement); - Standard_Boolean aOrientedEdge_Orientation; + Standard_Boolean aOrientedEdge_Orientation = 0; theData->ReadBoolean (theNum, 5, "oriented_edge.orientation", theArch, aOrientedEdge_Orientation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWPlanarCurvePair.cxx b/src/RWStepKinematics/RWStepKinematics_RWPlanarCurvePair.cxx index 8ae05a8cff..39e08bf284 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPlanarCurvePair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPlanarCurvePair.cxx @@ -84,7 +84,7 @@ void RWStepKinematics_RWPlanarCurvePair::ReadStep (const Handle(StepData_StepRea Handle(StepGeom_Curve) aCurve2; theData->ReadEntity (theNum, 8, "curve2", theArch, STANDARD_TYPE(StepGeom_Curve), aCurve2); - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; theData->ReadBoolean (theNum, 9, "orientation", theArch, aOrientation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWPlanarCurvePairRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWPlanarCurvePairRange.cxx index 746976d09d..e7a9540d3d 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPlanarCurvePairRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPlanarCurvePairRange.cxx @@ -85,7 +85,7 @@ void RWStepKinematics_RWPlanarCurvePairRange::ReadStep (const Handle(StepData_St Handle(StepGeom_Curve) aPlanarCurvePair_Curve2; theData->ReadEntity (theNum, 8, "planar_curve_pair.curve2", theArch, STANDARD_TYPE(StepGeom_Curve), aPlanarCurvePair_Curve2); - Standard_Boolean aPlanarCurvePair_Orientation; + Standard_Boolean aPlanarCurvePair_Orientation = 0; theData->ReadBoolean (theNum, 9, "planar_curve_pair.orientation", theArch, aPlanarCurvePair_Orientation); // Own fields of PlanarCurvePairRange diff --git a/src/RWStepKinematics/RWStepKinematics_RWPlanarPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWPlanarPair.cxx index 7097d7bd2a..05d0914ea0 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPlanarPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPlanarPair.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWPlanarPair::ReadStep (const Handle(StepData_StepReaderDa // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWPlanarPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWPlanarPairValue.cxx index f93b976eb3..8d0ef114cb 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPlanarPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPlanarPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,13 +57,13 @@ void RWStepKinematics_RWPlanarPairValue::ReadStep (const Handle(StepData_StepRea // Own fields of PlanarPairValue - Standard_Real aActualRotation; + Standard_Real aActualRotation = NAN; theData->ReadReal (theNum, 3, "actual_rotation", theArch, aActualRotation); - Standard_Real aActualTranslationX; + Standard_Real aActualTranslationX = NAN; theData->ReadReal (theNum, 4, "actual_translation_x", theArch, aActualTranslationX); - Standard_Real aActualTranslationY; + Standard_Real aActualTranslationY = NAN; theData->ReadReal (theNum, 5, "actual_translation_y", theArch, aActualTranslationY); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWPlanarPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWPlanarPairWithRange.cxx index 322a7b62db..7bd945bdc5 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPlanarPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPlanarPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWPlanarPairWithRange::ReadStep (const Handle(StepData_Ste // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Own fields of PlanarPairWithRange - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "lower_limit_actual_rotation", theArch, aLowerLimitActualRotation); @@ -108,7 +110,7 @@ void RWStepKinematics_RWPlanarPairWithRange::ReadStep (const Handle(StepData_Ste aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "upper_limit_actual_rotation", theArch, aUpperLimitActualRotation); @@ -118,7 +120,7 @@ void RWStepKinematics_RWPlanarPairWithRange::ReadStep (const Handle(StepData_Ste aUpperLimitActualRotation = 0; } - Standard_Real aLowerLimitActualTranslationX; + Standard_Real aLowerLimitActualTranslationX = NAN; Standard_Boolean hasLowerLimitActualTranslationX = Standard_True; if ( theData->IsParamDefined (theNum,15) ) { theData->ReadReal (theNum, 15, "lower_limit_actual_translation_x", theArch, aLowerLimitActualTranslationX); @@ -128,7 +130,7 @@ void RWStepKinematics_RWPlanarPairWithRange::ReadStep (const Handle(StepData_Ste aLowerLimitActualTranslationX = 0; } - Standard_Real aUpperLimitActualTranslationX; + Standard_Real aUpperLimitActualTranslationX = NAN; Standard_Boolean hasUpperLimitActualTranslationX = Standard_True; if ( theData->IsParamDefined (theNum,16) ) { theData->ReadReal (theNum, 16, "upper_limit_actual_translation_x", theArch, aUpperLimitActualTranslationX); @@ -138,7 +140,7 @@ void RWStepKinematics_RWPlanarPairWithRange::ReadStep (const Handle(StepData_Ste aUpperLimitActualTranslationX = 0; } - Standard_Real aLowerLimitActualTranslationY; + Standard_Real aLowerLimitActualTranslationY = NAN; Standard_Boolean hasLowerLimitActualTranslationY = Standard_True; if ( theData->IsParamDefined (theNum,17) ) { theData->ReadReal (theNum, 17, "lower_limit_actual_translation_y", theArch, aLowerLimitActualTranslationY); @@ -148,7 +150,7 @@ void RWStepKinematics_RWPlanarPairWithRange::ReadStep (const Handle(StepData_Ste aLowerLimitActualTranslationY = 0; } - Standard_Real aUpperLimitActualTranslationY; + Standard_Real aUpperLimitActualTranslationY = NAN; Standard_Boolean hasUpperLimitActualTranslationY = Standard_True; if ( theData->IsParamDefined (theNum,18) ) { theData->ReadReal (theNum, 18, "upper_limit_actual_translation_y", theArch, aUpperLimitActualTranslationY); diff --git a/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePair.cxx b/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePair.cxx index d288a84d9e..c2453a407a 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePair.cxx @@ -81,7 +81,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePair::ReadStep (const Handle(StepData_ Handle(StepGeom_Curve) aPairCurve; theData->ReadEntity (theNum, 7, "pair_curve", theArch, STANDARD_TYPE(StepGeom_Curve), aPairCurve); - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; theData->ReadBoolean (theNum, 8, "orientation", theArch, aOrientation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePairValue.cxx index c05ef8f6e6..56bf8e179a 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -69,7 +71,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePairValue::ReadStep (const Handle(Step aItems = new TColStd_HArray1OfReal(1, nb); Standard_Integer num2 = nsub; for (Standard_Integer i0 = 1; i0 <= nb; i0++) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; theData->ReadReal(num2, i0, "real", theArch, anIt0); aItems->SetValue(i0, anIt0); } diff --git a/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePairWithRange.cxx index 22f209ffa5..e705926b35 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPointOnPlanarCurvePairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -83,7 +85,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePairWithRange::ReadStep (const Handle( Handle(StepGeom_Curve) aPointOnPlanarCurvePair_PairCurve; theData->ReadEntity (theNum, 7, "point_on_planar_curve_pair.pair_curve", theArch, STANDARD_TYPE(StepGeom_Curve), aPointOnPlanarCurvePair_PairCurve); - Standard_Boolean aPointOnPlanarCurvePair_Orientation; + Standard_Boolean aPointOnPlanarCurvePair_Orientation = 0; theData->ReadBoolean (theNum, 8, "point_on_planar_curve_pair.orientation", theArch, aPointOnPlanarCurvePair_Orientation); // Own fields of PointOnPlanarCurvePairWithRange @@ -91,7 +93,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePairWithRange::ReadStep (const Handle( Handle(StepGeom_TrimmedCurve) aRangeOnPairCurve; theData->ReadEntity (theNum, 9, "range_on_pair_curve", theArch, STANDARD_TYPE(StepGeom_TrimmedCurve), aRangeOnPairCurve); - Standard_Real aLowerLimitYaw; + Standard_Real aLowerLimitYaw = NAN; Standard_Boolean hasLowerLimitYaw = Standard_True; if ( theData->IsParamDefined (theNum,10) ) { theData->ReadReal (theNum, 10, "lower_limit_yaw", theArch, aLowerLimitYaw); @@ -101,7 +103,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePairWithRange::ReadStep (const Handle( aLowerLimitYaw = 0; } - Standard_Real aUpperLimitYaw; + Standard_Real aUpperLimitYaw = NAN; Standard_Boolean hasUpperLimitYaw = Standard_True; if ( theData->IsParamDefined (theNum,11) ) { theData->ReadReal (theNum, 11, "upper_limit_yaw", theArch, aUpperLimitYaw); @@ -111,7 +113,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePairWithRange::ReadStep (const Handle( aUpperLimitYaw = 0; } - Standard_Real aLowerLimitPitch; + Standard_Real aLowerLimitPitch = NAN; Standard_Boolean hasLowerLimitPitch = Standard_True; if ( theData->IsParamDefined (theNum,12) ) { theData->ReadReal (theNum, 12, "lower_limit_pitch", theArch, aLowerLimitPitch); @@ -121,7 +123,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePairWithRange::ReadStep (const Handle( aLowerLimitPitch = 0; } - Standard_Real aUpperLimitPitch; + Standard_Real aUpperLimitPitch = NAN; Standard_Boolean hasUpperLimitPitch = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "upper_limit_pitch", theArch, aUpperLimitPitch); @@ -131,7 +133,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePairWithRange::ReadStep (const Handle( aUpperLimitPitch = 0; } - Standard_Real aLowerLimitRoll; + Standard_Real aLowerLimitRoll = NAN; Standard_Boolean hasLowerLimitRoll = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "lower_limit_roll", theArch, aLowerLimitRoll); @@ -141,7 +143,7 @@ void RWStepKinematics_RWPointOnPlanarCurvePairWithRange::ReadStep (const Handle( aLowerLimitRoll = 0; } - Standard_Real aUpperLimitRoll; + Standard_Real aUpperLimitRoll = NAN; Standard_Boolean hasUpperLimitRoll = Standard_True; if ( theData->IsParamDefined (theNum,15) ) { theData->ReadReal (theNum, 15, "upper_limit_roll", theArch, aUpperLimitRoll); diff --git a/src/RWStepKinematics/RWStepKinematics_RWPointOnSurfacePairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWPointOnSurfacePairValue.cxx index 94ae94355c..85ec91d30d 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPointOnSurfacePairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPointOnSurfacePairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -69,7 +71,7 @@ void RWStepKinematics_RWPointOnSurfacePairValue::ReadStep (const Handle(StepData aItems = new TColStd_HArray1OfReal(1, nb); Standard_Integer num2 = nsub; for (Standard_Integer i0 = 1; i0 <= nb; i0++) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; theData->ReadReal(num2, i0, "real", theArch, anIt0); aItems->SetValue(i0, anIt0); } diff --git a/src/RWStepKinematics/RWStepKinematics_RWPointOnSurfacePairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWPointOnSurfacePairWithRange.cxx index 91014584d9..c794941219 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPointOnSurfacePairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPointOnSurfacePairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -88,7 +90,7 @@ void RWStepKinematics_RWPointOnSurfacePairWithRange::ReadStep (const Handle(Step Handle(StepGeom_RectangularTrimmedSurface) aRangeOnPairSurface; theData->ReadEntity (theNum, 8, "range_on_pair_surface", theArch, STANDARD_TYPE(StepGeom_RectangularTrimmedSurface), aRangeOnPairSurface); - Standard_Real aLowerLimitYaw; + Standard_Real aLowerLimitYaw = NAN; Standard_Boolean hasLowerLimitYaw = Standard_True; if ( theData->IsParamDefined (theNum,9) ) { theData->ReadReal (theNum, 9, "lower_limit_yaw", theArch, aLowerLimitYaw); @@ -98,7 +100,7 @@ void RWStepKinematics_RWPointOnSurfacePairWithRange::ReadStep (const Handle(Step aLowerLimitYaw = 0; } - Standard_Real aUpperLimitYaw; + Standard_Real aUpperLimitYaw = NAN; Standard_Boolean hasUpperLimitYaw = Standard_True; if ( theData->IsParamDefined (theNum,10) ) { theData->ReadReal (theNum, 10, "upper_limit_yaw", theArch, aUpperLimitYaw); @@ -108,7 +110,7 @@ void RWStepKinematics_RWPointOnSurfacePairWithRange::ReadStep (const Handle(Step aUpperLimitYaw = 0; } - Standard_Real aLowerLimitPitch; + Standard_Real aLowerLimitPitch = NAN; Standard_Boolean hasLowerLimitPitch = Standard_True; if ( theData->IsParamDefined (theNum,11) ) { theData->ReadReal (theNum, 11, "lower_limit_pitch", theArch, aLowerLimitPitch); @@ -118,7 +120,7 @@ void RWStepKinematics_RWPointOnSurfacePairWithRange::ReadStep (const Handle(Step aLowerLimitPitch = 0; } - Standard_Real aUpperLimitPitch; + Standard_Real aUpperLimitPitch = NAN; Standard_Boolean hasUpperLimitPitch = Standard_True; if ( theData->IsParamDefined (theNum,12) ) { theData->ReadReal (theNum, 12, "upper_limit_pitch", theArch, aUpperLimitPitch); @@ -128,7 +130,7 @@ void RWStepKinematics_RWPointOnSurfacePairWithRange::ReadStep (const Handle(Step aUpperLimitPitch = 0; } - Standard_Real aLowerLimitRoll; + Standard_Real aLowerLimitRoll = NAN; Standard_Boolean hasLowerLimitRoll = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "lower_limit_roll", theArch, aLowerLimitRoll); @@ -138,7 +140,7 @@ void RWStepKinematics_RWPointOnSurfacePairWithRange::ReadStep (const Handle(Step aLowerLimitRoll = 0; } - Standard_Real aUpperLimitRoll; + Standard_Real aUpperLimitRoll = NAN; Standard_Boolean hasUpperLimitRoll = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "upper_limit_roll", theArch, aUpperLimitRoll); diff --git a/src/RWStepKinematics/RWStepKinematics_RWPrismaticPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWPrismaticPair.cxx index 51e71ac1f7..80a29445f1 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPrismaticPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPrismaticPair.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWPrismaticPair::ReadStep (const Handle(StepData_StepReade // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWPrismaticPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWPrismaticPairValue.cxx index 6c9d9052be..67b9647391 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPrismaticPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPrismaticPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,7 +57,7 @@ void RWStepKinematics_RWPrismaticPairValue::ReadStep (const Handle(StepData_Step // Own fields of PrismaticPairValue - Standard_Real aActualTranslation; + Standard_Real aActualTranslation = NAN; theData->ReadReal (theNum, 3, "actual_translation", theArch, aActualTranslation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWPrismaticPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWPrismaticPairWithRange.cxx index e7f21ebeb2..c5f97cf7ab 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWPrismaticPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWPrismaticPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWPrismaticPairWithRange::ReadStep (const Handle(StepData_ // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Own fields of PrismaticPairWithRange - Standard_Real aLowerLimitActualTranslation; + Standard_Real aLowerLimitActualTranslation = NAN; Standard_Boolean hasLowerLimitActualTranslation = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "lower_limit_actual_translation", theArch, aLowerLimitActualTranslation); @@ -108,7 +110,7 @@ void RWStepKinematics_RWPrismaticPairWithRange::ReadStep (const Handle(StepData_ aLowerLimitActualTranslation = 0; } - Standard_Real aUpperLimitActualTranslation; + Standard_Real aUpperLimitActualTranslation = NAN; Standard_Boolean hasUpperLimitActualTranslation = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "upper_limit_actual_translation", theArch, aUpperLimitActualTranslation); diff --git a/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPair.cxx index ebbd68bbf9..ad931a6871 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPair.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,7 +80,7 @@ void RWStepKinematics_RWRackAndPinionPair::ReadStep (const Handle(StepData_StepR // Own fields of RackAndPinionPair - Standard_Real aPinionRadius; + Standard_Real aPinionRadius = NAN; theData->ReadReal (theNum, 7, "pinion_radius", theArch, aPinionRadius); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPairValue.cxx index 650d333c57..208470f901 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,7 +57,7 @@ void RWStepKinematics_RWRackAndPinionPairValue::ReadStep (const Handle(StepData_ // Own fields of RackAndPinionPairValue - Standard_Real aActualDisplacement; + Standard_Real aActualDisplacement = NAN; theData->ReadReal (theNum, 3, "actual_displacement", theArch, aActualDisplacement); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPairWithRange.cxx index b97d8ba6f6..201f3f3a64 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRackAndPinionPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,12 +80,12 @@ void RWStepKinematics_RWRackAndPinionPairWithRange::ReadStep (const Handle(StepD // Inherited fields of RackAndPinionPair - Standard_Real aRackAndPinionPair_PinionRadius; + Standard_Real aRackAndPinionPair_PinionRadius = NAN; theData->ReadReal (theNum, 7, "rack_and_pinion_pair.pinion_radius", theArch, aRackAndPinionPair_PinionRadius); // Own fields of RackAndPinionPairWithRange - Standard_Real aLowerLimitRackDisplacement; + Standard_Real aLowerLimitRackDisplacement = NAN; Standard_Boolean hasLowerLimitRackDisplacement = Standard_True; if ( theData->IsParamDefined (theNum,8) ) { theData->ReadReal (theNum, 8, "lower_limit_rack_displacement", theArch, aLowerLimitRackDisplacement); @@ -93,7 +95,7 @@ void RWStepKinematics_RWRackAndPinionPairWithRange::ReadStep (const Handle(StepD aLowerLimitRackDisplacement = 0; } - Standard_Real aUpperLimitRackDisplacement; + Standard_Real aUpperLimitRackDisplacement = NAN; Standard_Boolean hasUpperLimitRackDisplacement = Standard_True; if ( theData->IsParamDefined (theNum,9) ) { theData->ReadReal (theNum, 9, "upper_limit_rack_displacement", theArch, aUpperLimitRackDisplacement); diff --git a/src/RWStepKinematics/RWStepKinematics_RWRevolutePair.cxx b/src/RWStepKinematics/RWStepKinematics_RWRevolutePair.cxx index 5eea8712d8..c9a1827ab1 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRevolutePair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRevolutePair.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWRevolutePair::ReadStep (const Handle(StepData_StepReader // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWRevolutePairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWRevolutePairValue.cxx index 98ae04859b..cb2561a14f 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRevolutePairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRevolutePairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,7 +57,7 @@ void RWStepKinematics_RWRevolutePairValue::ReadStep (const Handle(StepData_StepR // Own fields of RevolutePairValue - Standard_Real aActualRotation; + Standard_Real aActualRotation = NAN; theData->ReadReal (theNum, 3, "actual_rotation", theArch, aActualRotation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWRevolutePairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWRevolutePairWithRange.cxx index a2cf369909..8139bb8d44 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRevolutePairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRevolutePairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWRevolutePairWithRange::ReadStep (const Handle(StepData_S // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Own fields of RevolutePairWithRange - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "lower_limit_actual_rotation", theArch, aLowerLimitActualRotation); @@ -108,7 +110,7 @@ void RWStepKinematics_RWRevolutePairWithRange::ReadStep (const Handle(StepData_S aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "upper_limit_actual_rotation", theArch, aUpperLimitActualRotation); diff --git a/src/RWStepKinematics/RWStepKinematics_RWRollingCurvePair.cxx b/src/RWStepKinematics/RWStepKinematics_RWRollingCurvePair.cxx index 5aa9b984d5..120c16a57e 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRollingCurvePair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRollingCurvePair.cxx @@ -84,7 +84,7 @@ void RWStepKinematics_RWRollingCurvePair::ReadStep (const Handle(StepData_StepRe Handle(StepGeom_Curve) aPlanarCurvePair_Curve2; theData->ReadEntity (theNum, 8, "planar_curve_pair.curve2", theArch, STANDARD_TYPE(StepGeom_Curve), aPlanarCurvePair_Curve2); - Standard_Boolean aPlanarCurvePair_Orientation; + Standard_Boolean aPlanarCurvePair_Orientation = 0; theData->ReadBoolean (theNum, 9, "planar_curve_pair.orientation", theArch, aPlanarCurvePair_Orientation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWRollingSurfacePair.cxx b/src/RWStepKinematics/RWStepKinematics_RWRollingSurfacePair.cxx index 68c6596e36..6c250f3bdc 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRollingSurfacePair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRollingSurfacePair.cxx @@ -84,7 +84,7 @@ void RWStepKinematics_RWRollingSurfacePair::ReadStep (const Handle(StepData_Step Handle(StepGeom_Surface) aSurfacePair_Surface2; theData->ReadEntity (theNum, 8, "surface_pair.surface2", theArch, STANDARD_TYPE(StepGeom_Surface), aSurfacePair_Surface2); - Standard_Boolean aSurfacePair_Orientation; + Standard_Boolean aSurfacePair_Orientation = 0; theData->ReadBoolean (theNum, 9, "surface_pair.orientation", theArch, aSurfacePair_Orientation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWRollingSurfacePairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWRollingSurfacePairValue.cxx index 78851c7ee8..88630cd4d2 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRollingSurfacePairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRollingSurfacePairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -59,7 +61,7 @@ void RWStepKinematics_RWRollingSurfacePairValue::ReadStep (const Handle(StepData Handle(StepGeom_PointOnSurface) aActualPointOnSurface; theData->ReadEntity (theNum, 3, "actual_point_on_surface", theArch, STANDARD_TYPE(StepGeom_PointOnSurface), aActualPointOnSurface); - Standard_Real aActualRotation; + Standard_Real aActualRotation = NAN; theData->ReadReal (theNum, 4, "actual_rotation", theArch, aActualRotation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWRotationAboutDirection.cxx b/src/RWStepKinematics/RWStepKinematics_RWRotationAboutDirection.cxx index 65f3109391..eab4893b21 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWRotationAboutDirection.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWRotationAboutDirection.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -53,7 +55,7 @@ void RWStepKinematics_RWRotationAboutDirection::ReadStep (const Handle(StepData_ Handle(StepGeom_Direction) aDirectionOfAxis; theData->ReadEntity (theNum, 2, "direction_of_axis", theArch, STANDARD_TYPE(StepGeom_Direction), aDirectionOfAxis); - Standard_Real aRotationAngle; + Standard_Real aRotationAngle = NAN; theData->ReadReal (theNum, 3, "rotation_angle", theArch, aRotationAngle); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWScrewPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWScrewPair.cxx index 3bed0f9004..a7814e33de 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWScrewPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWScrewPair.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,7 +80,7 @@ void RWStepKinematics_RWScrewPair::ReadStep (const Handle(StepData_StepReaderDat // Own fields of ScrewPair - Standard_Real aPitch; + Standard_Real aPitch = NAN; theData->ReadReal (theNum, 7, "pitch", theArch, aPitch); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWScrewPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWScrewPairValue.cxx index 06343e4538..2515ad1772 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWScrewPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWScrewPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,7 +57,7 @@ void RWStepKinematics_RWScrewPairValue::ReadStep (const Handle(StepData_StepRead // Own fields of ScrewPairValue - Standard_Real aActualRotation; + Standard_Real aActualRotation = NAN; theData->ReadReal (theNum, 3, "actual_rotation", theArch, aActualRotation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWScrewPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWScrewPairWithRange.cxx index 7fe42958a9..41dd4a58a9 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWScrewPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWScrewPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,12 +80,12 @@ void RWStepKinematics_RWScrewPairWithRange::ReadStep (const Handle(StepData_Step // Inherited fields of ScrewPair - Standard_Real aScrewPair_Pitch; + Standard_Real aScrewPair_Pitch = NAN; theData->ReadReal (theNum, 7, "screw_pair.pitch", theArch, aScrewPair_Pitch); // Own fields of ScrewPairWithRange - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,8) ) { theData->ReadReal (theNum, 8, "lower_limit_actual_rotation", theArch, aLowerLimitActualRotation); @@ -93,7 +95,7 @@ void RWStepKinematics_RWScrewPairWithRange::ReadStep (const Handle(StepData_Step aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,9) ) { theData->ReadReal (theNum, 9, "upper_limit_actual_rotation", theArch, aUpperLimitActualRotation); diff --git a/src/RWStepKinematics/RWStepKinematics_RWSlidingCurvePair.cxx b/src/RWStepKinematics/RWStepKinematics_RWSlidingCurvePair.cxx index aba9c3dd05..40f5148f44 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSlidingCurvePair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSlidingCurvePair.cxx @@ -84,7 +84,7 @@ void RWStepKinematics_RWSlidingCurvePair::ReadStep (const Handle(StepData_StepRe Handle(StepGeom_Curve) aPlanarCurvePair_Curve2; theData->ReadEntity (theNum, 8, "planar_curve_pair.curve2", theArch, STANDARD_TYPE(StepGeom_Curve), aPlanarCurvePair_Curve2); - Standard_Boolean aPlanarCurvePair_Orientation; + Standard_Boolean aPlanarCurvePair_Orientation = 0; theData->ReadBoolean (theNum, 9, "planar_curve_pair.orientation", theArch, aPlanarCurvePair_Orientation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWSlidingSurfacePair.cxx b/src/RWStepKinematics/RWStepKinematics_RWSlidingSurfacePair.cxx index 9e134b8e33..ba58f4d986 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSlidingSurfacePair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSlidingSurfacePair.cxx @@ -84,7 +84,7 @@ void RWStepKinematics_RWSlidingSurfacePair::ReadStep (const Handle(StepData_Step Handle(StepGeom_Surface) aSurfacePair_Surface2; theData->ReadEntity (theNum, 8, "surface_pair.surface2", theArch, STANDARD_TYPE(StepGeom_Surface), aSurfacePair_Surface2); - Standard_Boolean aSurfacePair_Orientation; + Standard_Boolean aSurfacePair_Orientation = 0; theData->ReadBoolean (theNum, 9, "surface_pair.orientation", theArch, aSurfacePair_Orientation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWSlidingSurfacePairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWSlidingSurfacePairValue.cxx index fabe4bd53c..71119fda08 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSlidingSurfacePairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSlidingSurfacePairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -62,7 +64,7 @@ void RWStepKinematics_RWSlidingSurfacePairValue::ReadStep (const Handle(StepData Handle(StepGeom_PointOnSurface) aActualPointOnSurface2; theData->ReadEntity (theNum, 4, "actual_point_on_surface2", theArch, STANDARD_TYPE(StepGeom_PointOnSurface), aActualPointOnSurface2); - Standard_Real aActualRotation; + Standard_Real aActualRotation = NAN; theData->ReadReal (theNum, 5, "actual_rotation", theArch, aActualRotation); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWSphericalPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWSphericalPair.cxx index 16f8ac8504..dfa17f318e 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSphericalPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSphericalPair.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWSphericalPair::ReadStep (const Handle(StepData_StepReade // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWSphericalPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWSphericalPairValue.cxx index 5bf44d0d2f..966f776042 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSphericalPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSphericalPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -65,7 +67,7 @@ void RWStepKinematics_RWSphericalPairValue::ReadStep (const Handle(StepData_Step aItems = new TColStd_HArray1OfReal(1, nb); Standard_Integer num2 = nsub; for (Standard_Integer i0 = 1; i0 <= nb; i0++) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; theData->ReadReal(num2, i0, "real", theArch, anIt0); aItems->SetValue(i0, anIt0); } diff --git a/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithPin.cxx b/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithPin.cxx index 726c2ba0ba..febe7156f5 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithPin.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithPin.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWSphericalPairWithPin::ReadStep (const Handle(StepData_St // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithPinAndRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithPinAndRange.cxx index 4e47edddff..860b28ec3a 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithPinAndRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithPinAndRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWSphericalPairWithPinAndRange::ReadStep (const Handle(Ste // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Own fields of SphericalPairWithPinAndRange - Standard_Real aLowerLimitYaw; + Standard_Real aLowerLimitYaw = NAN; Standard_Boolean hasLowerLimitYaw = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "lower_limit_yaw", theArch, aLowerLimitYaw); @@ -108,7 +110,7 @@ void RWStepKinematics_RWSphericalPairWithPinAndRange::ReadStep (const Handle(Ste aLowerLimitYaw = 0; } - Standard_Real aUpperLimitYaw; + Standard_Real aUpperLimitYaw = NAN; Standard_Boolean hasUpperLimitYaw = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "upper_limit_yaw", theArch, aUpperLimitYaw); @@ -118,7 +120,7 @@ void RWStepKinematics_RWSphericalPairWithPinAndRange::ReadStep (const Handle(Ste aUpperLimitYaw = 0; } - Standard_Real aLowerLimitRoll; + Standard_Real aLowerLimitRoll = NAN; Standard_Boolean hasLowerLimitRoll = Standard_True; if ( theData->IsParamDefined (theNum,15) ) { theData->ReadReal (theNum, 15, "lower_limit_roll", theArch, aLowerLimitRoll); @@ -128,7 +130,7 @@ void RWStepKinematics_RWSphericalPairWithPinAndRange::ReadStep (const Handle(Ste aLowerLimitRoll = 0; } - Standard_Real aUpperLimitRoll; + Standard_Real aUpperLimitRoll = NAN; Standard_Boolean hasUpperLimitRoll = Standard_True; if ( theData->IsParamDefined (theNum,16) ) { theData->ReadReal (theNum, 16, "upper_limit_roll", theArch, aUpperLimitRoll); diff --git a/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithRange.cxx index f089f9d7e0..ee9852ec97 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSphericalPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWSphericalPairWithRange::ReadStep (const Handle(StepData_ // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Own fields of SphericalPairWithRange - Standard_Real aLowerLimitYaw; + Standard_Real aLowerLimitYaw = NAN; Standard_Boolean hasLowerLimitYaw = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "lower_limit_yaw", theArch, aLowerLimitYaw); @@ -108,7 +110,7 @@ void RWStepKinematics_RWSphericalPairWithRange::ReadStep (const Handle(StepData_ aLowerLimitYaw = 0; } - Standard_Real aUpperLimitYaw; + Standard_Real aUpperLimitYaw = NAN; Standard_Boolean hasUpperLimitYaw = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "upper_limit_yaw", theArch, aUpperLimitYaw); @@ -118,7 +120,7 @@ void RWStepKinematics_RWSphericalPairWithRange::ReadStep (const Handle(StepData_ aUpperLimitYaw = 0; } - Standard_Real aLowerLimitPitch; + Standard_Real aLowerLimitPitch = NAN; Standard_Boolean hasLowerLimitPitch = Standard_True; if ( theData->IsParamDefined (theNum,15) ) { theData->ReadReal (theNum, 15, "lower_limit_pitch", theArch, aLowerLimitPitch); @@ -128,7 +130,7 @@ void RWStepKinematics_RWSphericalPairWithRange::ReadStep (const Handle(StepData_ aLowerLimitPitch = 0; } - Standard_Real aUpperLimitPitch; + Standard_Real aUpperLimitPitch = NAN; Standard_Boolean hasUpperLimitPitch = Standard_True; if ( theData->IsParamDefined (theNum,16) ) { theData->ReadReal (theNum, 16, "upper_limit_pitch", theArch, aUpperLimitPitch); @@ -138,7 +140,7 @@ void RWStepKinematics_RWSphericalPairWithRange::ReadStep (const Handle(StepData_ aUpperLimitPitch = 0; } - Standard_Real aLowerLimitRoll; + Standard_Real aLowerLimitRoll = NAN; Standard_Boolean hasLowerLimitRoll = Standard_True; if ( theData->IsParamDefined (theNum,17) ) { theData->ReadReal (theNum, 17, "lower_limit_roll", theArch, aLowerLimitRoll); @@ -148,7 +150,7 @@ void RWStepKinematics_RWSphericalPairWithRange::ReadStep (const Handle(StepData_ aLowerLimitRoll = 0; } - Standard_Real aUpperLimitRoll; + Standard_Real aUpperLimitRoll = NAN; Standard_Boolean hasUpperLimitRoll = Standard_True; if ( theData->IsParamDefined (theNum,18) ) { theData->ReadReal (theNum, 18, "upper_limit_roll", theArch, aUpperLimitRoll); diff --git a/src/RWStepKinematics/RWStepKinematics_RWSurfacePairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWSurfacePairWithRange.cxx index 81d8dfeb88..294c5068e3 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWSurfacePairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWSurfacePairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -86,7 +88,7 @@ void RWStepKinematics_RWSurfacePairWithRange::ReadStep (const Handle(StepData_St Handle(StepGeom_Surface) aSurfacePair_Surface2; theData->ReadEntity (theNum, 8, "surface_pair.surface2", theArch, STANDARD_TYPE(StepGeom_Surface), aSurfacePair_Surface2); - Standard_Boolean aSurfacePair_Orientation; + Standard_Boolean aSurfacePair_Orientation = 0; theData->ReadBoolean (theNum, 9, "surface_pair.orientation", theArch, aSurfacePair_Orientation); // Own fields of SurfacePairWithRange @@ -97,7 +99,7 @@ void RWStepKinematics_RWSurfacePairWithRange::ReadStep (const Handle(StepData_St Handle(StepGeom_RectangularTrimmedSurface) aRangeOnSurface2; theData->ReadEntity (theNum, 11, "range_on_surface2", theArch, STANDARD_TYPE(StepGeom_RectangularTrimmedSurface), aRangeOnSurface2); - Standard_Real aLowerLimitActualRotation; + Standard_Real aLowerLimitActualRotation = NAN; Standard_Boolean hasLowerLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,12) ) { theData->ReadReal (theNum, 12, "lower_limit_actual_rotation", theArch, aLowerLimitActualRotation); @@ -107,7 +109,7 @@ void RWStepKinematics_RWSurfacePairWithRange::ReadStep (const Handle(StepData_St aLowerLimitActualRotation = 0; } - Standard_Real aUpperLimitActualRotation; + Standard_Real aUpperLimitActualRotation = NAN; Standard_Boolean hasUpperLimitActualRotation = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "upper_limit_actual_rotation", theArch, aUpperLimitActualRotation); diff --git a/src/RWStepKinematics/RWStepKinematics_RWUnconstrainedPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWUnconstrainedPair.cxx index e8f4b3319f..9f34780f3f 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWUnconstrainedPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWUnconstrainedPair.cxx @@ -77,22 +77,22 @@ void RWStepKinematics_RWUnconstrainedPair::ReadStep (const Handle(StepData_StepR // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWUniversalPair.cxx b/src/RWStepKinematics/RWStepKinematics_RWUniversalPair.cxx index 3cffe5357e..acb38a812c 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWUniversalPair.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWUniversalPair.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWUniversalPair::ReadStep (const Handle(StepData_StepReade // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Own fields of UniversalPair - Standard_Real aInputSkewAngle; + Standard_Real aInputSkewAngle = NAN; Standard_Boolean hasInputSkewAngle = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "input_skew_angle", theArch, aInputSkewAngle); diff --git a/src/RWStepKinematics/RWStepKinematics_RWUniversalPairValue.cxx b/src/RWStepKinematics/RWStepKinematics_RWUniversalPairValue.cxx index 45b86dbed6..ec4ce813f6 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWUniversalPairValue.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWUniversalPairValue.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -55,10 +57,10 @@ void RWStepKinematics_RWUniversalPairValue::ReadStep (const Handle(StepData_Step // Own fields of UniversalPairValue - Standard_Real aFirstRotationAngle; + Standard_Real aFirstRotationAngle = NAN; theData->ReadReal (theNum, 3, "first_rotation_angle", theArch, aFirstRotationAngle); - Standard_Real aSecondRotationAngle; + Standard_Real aSecondRotationAngle = NAN; theData->ReadReal (theNum, 4, "second_rotation_angle", theArch, aSecondRotationAngle); // Initialize entity diff --git a/src/RWStepKinematics/RWStepKinematics_RWUniversalPairWithRange.cxx b/src/RWStepKinematics/RWStepKinematics_RWUniversalPairWithRange.cxx index 496ee0bd01..9728b38967 100644 --- a/src/RWStepKinematics/RWStepKinematics_RWUniversalPairWithRange.cxx +++ b/src/RWStepKinematics/RWStepKinematics_RWUniversalPairWithRange.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -78,27 +80,27 @@ void RWStepKinematics_RWUniversalPairWithRange::ReadStep (const Handle(StepData_ // Inherited fields of LowOrderKinematicPair - Standard_Boolean aLowOrderKinematicPair_TX; + Standard_Boolean aLowOrderKinematicPair_TX = 0; theData->ReadBoolean (theNum, 7, "low_order_kinematic_pair.t_x", theArch, aLowOrderKinematicPair_TX); - Standard_Boolean aLowOrderKinematicPair_TY; + Standard_Boolean aLowOrderKinematicPair_TY = 0; theData->ReadBoolean (theNum, 8, "low_order_kinematic_pair.t_y", theArch, aLowOrderKinematicPair_TY); - Standard_Boolean aLowOrderKinematicPair_TZ; + Standard_Boolean aLowOrderKinematicPair_TZ = 0; theData->ReadBoolean (theNum, 9, "low_order_kinematic_pair.t_z", theArch, aLowOrderKinematicPair_TZ); - Standard_Boolean aLowOrderKinematicPair_RX; + Standard_Boolean aLowOrderKinematicPair_RX = 0; theData->ReadBoolean (theNum, 10, "low_order_kinematic_pair.r_x", theArch, aLowOrderKinematicPair_RX); - Standard_Boolean aLowOrderKinematicPair_RY; + Standard_Boolean aLowOrderKinematicPair_RY = 0; theData->ReadBoolean (theNum, 11, "low_order_kinematic_pair.r_y", theArch, aLowOrderKinematicPair_RY); - Standard_Boolean aLowOrderKinematicPair_RZ; + Standard_Boolean aLowOrderKinematicPair_RZ = 0; theData->ReadBoolean (theNum, 12, "low_order_kinematic_pair.r_z", theArch, aLowOrderKinematicPair_RZ); // Inherited fields of UniversalPair - Standard_Real aUniversalPair_InputSkewAngle; + Standard_Real aUniversalPair_InputSkewAngle = NAN; Standard_Boolean hasUniversalPair_InputSkewAngle = Standard_True; if ( theData->IsParamDefined (theNum,13) ) { theData->ReadReal (theNum, 13, "universal_pair.input_skew_angle", theArch, aUniversalPair_InputSkewAngle); @@ -110,7 +112,7 @@ void RWStepKinematics_RWUniversalPairWithRange::ReadStep (const Handle(StepData_ // Own fields of UniversalPairWithRange - Standard_Real aLowerLimitFirstRotation; + Standard_Real aLowerLimitFirstRotation = NAN; Standard_Boolean hasLowerLimitFirstRotation = Standard_True; if ( theData->IsParamDefined (theNum,14) ) { theData->ReadReal (theNum, 14, "lower_limit_first_rotation", theArch, aLowerLimitFirstRotation); @@ -120,7 +122,7 @@ void RWStepKinematics_RWUniversalPairWithRange::ReadStep (const Handle(StepData_ aLowerLimitFirstRotation = 0; } - Standard_Real aUpperLimitFirstRotation; + Standard_Real aUpperLimitFirstRotation = NAN; Standard_Boolean hasUpperLimitFirstRotation = Standard_True; if ( theData->IsParamDefined (theNum,15) ) { theData->ReadReal (theNum, 15, "upper_limit_first_rotation", theArch, aUpperLimitFirstRotation); @@ -130,7 +132,7 @@ void RWStepKinematics_RWUniversalPairWithRange::ReadStep (const Handle(StepData_ aUpperLimitFirstRotation = 0; } - Standard_Real aLowerLimitSecondRotation; + Standard_Real aLowerLimitSecondRotation = NAN; Standard_Boolean hasLowerLimitSecondRotation = Standard_True; if ( theData->IsParamDefined (theNum,16) ) { theData->ReadReal (theNum, 16, "lower_limit_second_rotation", theArch, aLowerLimitSecondRotation); @@ -140,7 +142,7 @@ void RWStepKinematics_RWUniversalPairWithRange::ReadStep (const Handle(StepData_ aLowerLimitSecondRotation = 0; } - Standard_Real aUpperLimitSecondRotation; + Standard_Real aUpperLimitSecondRotation = NAN; Standard_Boolean hasUpperLimitSecondRotation = Standard_True; if ( theData->IsParamDefined (theNum,17) ) { theData->ReadReal (theNum, 17, "upper_limit_second_rotation", theArch, aUpperLimitSecondRotation); diff --git a/src/RWStepRepr/RWStepRepr_RWCharacterizedRepresentation.cxx b/src/RWStepRepr/RWStepRepr_RWCharacterizedRepresentation.cxx index 449a1d4bdf..2b1d9b43b6 100644 --- a/src/RWStepRepr/RWStepRepr_RWCharacterizedRepresentation.cxx +++ b/src/RWStepRepr/RWStepRepr_RWCharacterizedRepresentation.cxx @@ -53,7 +53,7 @@ void RWStepRepr_RWCharacterizedRepresentation::ReadStep // items Handle(StepRepr_HArray1OfRepresentationItem) anItems; Handle(StepRepr_RepresentationItem) anItem; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (data->ReadSubList (num, 3, "items", ach, nsub)) { Standard_Integer nb = data->NbParams(nsub); anItems = new StepRepr_HArray1OfRepresentationItem (1, nb); diff --git a/src/RWStepRepr/RWStepRepr_RWCompoundRepresentationItem.cxx b/src/RWStepRepr/RWStepRepr_RWCompoundRepresentationItem.cxx index 1c8b6e2787..eaef8b4473 100644 --- a/src/RWStepRepr/RWStepRepr_RWCompoundRepresentationItem.cxx +++ b/src/RWStepRepr/RWStepRepr_RWCompoundRepresentationItem.cxx @@ -43,7 +43,7 @@ void RWStepRepr_RWCompoundRepresentationItem::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"item_element",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); @@ -78,6 +78,6 @@ void RWStepRepr_RWCompoundRepresentationItem::Share (const Handle(StepRepr_CompoundRepresentationItem)& ent, Interface_EntityIterator& iter) const { - Standard_Integer i, nb = ent->NbItemElement(); + Standard_Integer i = 0, nb = ent->NbItemElement(); for (i = 1; i <= nb; i ++) iter.AddItem (ent->ItemElementValue(i)); } diff --git a/src/RWStepRepr/RWStepRepr_RWConstructiveGeometryRepresentation.cxx b/src/RWStepRepr/RWStepRepr_RWConstructiveGeometryRepresentation.cxx index 48dbebb911..b1ce8df36a 100644 --- a/src/RWStepRepr/RWStepRepr_RWConstructiveGeometryRepresentation.cxx +++ b/src/RWStepRepr/RWStepRepr_RWConstructiveGeometryRepresentation.cxx @@ -49,7 +49,7 @@ void RWStepRepr_RWConstructiveGeometryRepresentation::ReadStep // Inherited field : items Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anEnt; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (data->ReadSubList (num, 2, "items", ach, nsub)) { Standard_Integer nb = data->NbParams(nsub); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb); diff --git a/src/RWStepRepr/RWStepRepr_RWDefinitionalRepresentation.cxx b/src/RWStepRepr/RWStepRepr_RWDefinitionalRepresentation.cxx index 0dd96f40eb..54df1e9857 100644 --- a/src/RWStepRepr/RWStepRepr_RWDefinitionalRepresentation.cxx +++ b/src/RWStepRepr/RWStepRepr_RWDefinitionalRepresentation.cxx @@ -46,7 +46,7 @@ void RWStepRepr_RWDefinitionalRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepRepr/RWStepRepr_RWGlobalUncertaintyAssignedContext.cxx b/src/RWStepRepr/RWStepRepr_RWGlobalUncertaintyAssignedContext.cxx index c871260a75..135a9390cf 100644 --- a/src/RWStepRepr/RWStepRepr_RWGlobalUncertaintyAssignedContext.cxx +++ b/src/RWStepRepr/RWStepRepr_RWGlobalUncertaintyAssignedContext.cxx @@ -50,7 +50,7 @@ void RWStepRepr_RWGlobalUncertaintyAssignedContext::ReadStep Handle(StepBasic_HArray1OfUncertaintyMeasureWithUnit) aUncertainty; Handle(StepBasic_UncertaintyMeasureWithUnit) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"uncertainty",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aUncertainty = new StepBasic_HArray1OfUncertaintyMeasureWithUnit (1, nb3); diff --git a/src/RWStepRepr/RWStepRepr_RWGlobalUnitAssignedContext.cxx b/src/RWStepRepr/RWStepRepr_RWGlobalUnitAssignedContext.cxx index b1a71745df..305357e299 100644 --- a/src/RWStepRepr/RWStepRepr_RWGlobalUnitAssignedContext.cxx +++ b/src/RWStepRepr/RWStepRepr_RWGlobalUnitAssignedContext.cxx @@ -50,7 +50,7 @@ void RWStepRepr_RWGlobalUnitAssignedContext::ReadStep Handle(StepBasic_HArray1OfNamedUnit) aUnits; Handle(StepBasic_NamedUnit) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"units",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aUnits = new StepBasic_HArray1OfNamedUnit (1, nb3); diff --git a/src/RWStepRepr/RWStepRepr_RWIntegerRepresentationItem.cxx b/src/RWStepRepr/RWStepRepr_RWIntegerRepresentationItem.cxx index 0b74ed08c9..d90ad2b029 100644 --- a/src/RWStepRepr/RWStepRepr_RWIntegerRepresentationItem.cxx +++ b/src/RWStepRepr/RWStepRepr_RWIntegerRepresentationItem.cxx @@ -36,7 +36,7 @@ void RWStepRepr_RWIntegerRepresentationItem::ReadStep data->ReadString (num,1,"name",ach,aName); // --- own field : value --- - Standard_Integer aValue; + Standard_Integer aValue = 0; data->ReadInteger (num,2,"value",ach,aValue); //--- Initialisation of the read entity --- diff --git a/src/RWStepRepr/RWStepRepr_RWMakeFromUsageOption.cxx b/src/RWStepRepr/RWStepRepr_RWMakeFromUsageOption.cxx index 785528b615..764c863b34 100644 --- a/src/RWStepRepr/RWStepRepr_RWMakeFromUsageOption.cxx +++ b/src/RWStepRepr/RWStepRepr_RWMakeFromUsageOption.cxx @@ -68,7 +68,7 @@ void RWStepRepr_RWMakeFromUsageOption::ReadStep (const Handle(StepData_StepReade // Own fields of MakeFromUsageOption - Standard_Integer aRanking; + Standard_Integer aRanking = 0; data->ReadInteger (num, 6, "ranking", ach, aRanking); Handle(TCollection_HAsciiString) aRankingRationale; diff --git a/src/RWStepRepr/RWStepRepr_RWReprItemAndLengthMeasureWithUnitAndQRI.cxx b/src/RWStepRepr/RWStepRepr_RWReprItemAndLengthMeasureWithUnitAndQRI.cxx index 2cf1e84e94..0b5d1b5dbf 100644 --- a/src/RWStepRepr/RWStepRepr_RWReprItemAndLengthMeasureWithUnitAndQRI.cxx +++ b/src/RWStepRepr/RWStepRepr_RWReprItemAndLengthMeasureWithUnitAndQRI.cxx @@ -58,7 +58,7 @@ void RWStepRepr_RWReprItemAndLengthMeasureWithUnitAndQRI::ReadStep if (!data->CheckNbParams(num,1,ach,"qualified_representation_item")) return; // --- own field : qualifiers --- Handle(StepShape_HArray1OfValueQualifier) quals; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (data->ReadSubList (num, 1, "qualifiers", ach, nsub)) { Standard_Integer nb = data->NbParams(nsub); quals = new StepShape_HArray1OfValueQualifier (1, nb); @@ -101,7 +101,7 @@ void RWStepRepr_RWReprItemAndLengthMeasureWithUnitAndQRI::WriteStep SW.Send(ent->GetMeasureWithUnit()->UnitComponent().Value()); SW.StartEntity ("QUALIFIED_REPRESENTATION_ITEM"); Handle(StepShape_QualifiedRepresentationItem) aQRI = ent->GetQualifiedRepresentationItem(); - Standard_Integer i, nbq = aQRI->NbQualifiers(); + Standard_Integer i = 0, nbq = aQRI->NbQualifiers(); SW.OpenSub(); for (i = 1; i <= nbq; i ++) SW.Send (aQRI->QualifiersValue(i).Value()); diff --git a/src/RWStepRepr/RWStepRepr_RWReprItemAndPlaneAngleMeasureWithUnitAndQRI.cxx b/src/RWStepRepr/RWStepRepr_RWReprItemAndPlaneAngleMeasureWithUnitAndQRI.cxx index 5e87c616d1..f3cf182866 100644 --- a/src/RWStepRepr/RWStepRepr_RWReprItemAndPlaneAngleMeasureWithUnitAndQRI.cxx +++ b/src/RWStepRepr/RWStepRepr_RWReprItemAndPlaneAngleMeasureWithUnitAndQRI.cxx @@ -58,7 +58,7 @@ void RWStepRepr_RWReprItemAndPlaneAngleMeasureWithUnitAndQRI::ReadStep if (!data->CheckNbParams(num,1,ach,"qualified_representation_item")) return; // --- own field : qualifiers --- Handle(StepShape_HArray1OfValueQualifier) quals; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (data->ReadSubList (num, 1, "qualifiers", ach, nsub)) { Standard_Integer nb = data->NbParams(nsub); quals = new StepShape_HArray1OfValueQualifier (1, nb); @@ -100,7 +100,7 @@ void RWStepRepr_RWReprItemAndPlaneAngleMeasureWithUnitAndQRI::WriteStep SW.StartEntity("PLANE_ANGLE_MEASURE_WITH_UNIT"); SW.StartEntity ("QUALIFIED_REPRESENTATION_ITEM"); Handle(StepShape_QualifiedRepresentationItem) aQRI = ent->GetQualifiedRepresentationItem(); - Standard_Integer i, nbq = aQRI->NbQualifiers(); + Standard_Integer i = 0, nbq = aQRI->NbQualifiers(); SW.OpenSub(); for (i = 1; i <= nbq; i ++) SW.Send (aQRI->QualifiersValue(i).Value()); diff --git a/src/RWStepRepr/RWStepRepr_RWRepresentation.cxx b/src/RWStepRepr/RWStepRepr_RWRepresentation.cxx index 2b2ce59a80..48ff4714b4 100644 --- a/src/RWStepRepr/RWStepRepr_RWRepresentation.cxx +++ b/src/RWStepRepr/RWStepRepr_RWRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepRepr_RWRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWAdvancedBrepShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWAdvancedBrepShapeRepresentation.cxx index 969bc1b640..b473626485 100644 --- a/src/RWStepShape/RWStepShape_RWAdvancedBrepShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWAdvancedBrepShapeRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWAdvancedBrepShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWAdvancedFace.cxx b/src/RWStepShape/RWStepShape_RWAdvancedFace.cxx index 0eac3d648a..fd22287a9c 100644 --- a/src/RWStepShape/RWStepShape_RWAdvancedFace.cxx +++ b/src/RWStepShape/RWStepShape_RWAdvancedFace.cxx @@ -46,7 +46,7 @@ void RWStepShape_RWAdvancedFace::ReadStep Handle(StepShape_HArray1OfFaceBound) aBounds; Handle(StepShape_FaceBound) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"bounds",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); if( nb2) diff --git a/src/RWStepShape/RWStepShape_RWBlock.cxx b/src/RWStepShape/RWStepShape_RWBlock.cxx index a90397a362..49a058822d 100644 --- a/src/RWStepShape/RWStepShape_RWBlock.cxx +++ b/src/RWStepShape/RWStepShape_RWBlock.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,19 +49,19 @@ void RWStepShape_RWBlock::ReadStep // --- own field : x --- - Standard_Real aX; + Standard_Real aX = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"x",ach,aX); // --- own field : y --- - Standard_Real aY; + Standard_Real aY = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"y",ach,aY); // --- own field : z --- - Standard_Real aZ; + Standard_Real aZ = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadReal (num,5,"z",ach,aZ); diff --git a/src/RWStepShape/RWStepShape_RWBoxDomain.cxx b/src/RWStepShape/RWStepShape_RWBoxDomain.cxx index 0e8d7aa521..2ba1bcbda0 100644 --- a/src/RWStepShape/RWStepShape_RWBoxDomain.cxx +++ b/src/RWStepShape/RWStepShape_RWBoxDomain.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -41,19 +43,19 @@ void RWStepShape_RWBoxDomain::ReadStep // --- own field : xlength --- - Standard_Real aXlength; + Standard_Real aXlength = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadReal (num,2,"xlength",ach,aXlength); // --- own field : ylength --- - Standard_Real aYlength; + Standard_Real aYlength = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"ylength",ach,aYlength); // --- own field : zlength --- - Standard_Real aZlength; + Standard_Real aZlength = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"zlength",ach,aZlength); diff --git a/src/RWStepShape/RWStepShape_RWBoxedHalfSpace.cxx b/src/RWStepShape/RWStepShape_RWBoxedHalfSpace.cxx index e855d6b082..0e78b1beb0 100644 --- a/src/RWStepShape/RWStepShape_RWBoxedHalfSpace.cxx +++ b/src/RWStepShape/RWStepShape_RWBoxedHalfSpace.cxx @@ -48,7 +48,7 @@ void RWStepShape_RWBoxedHalfSpace::ReadStep // --- inherited field : agreementFlag --- - Standard_Boolean aAgreementFlag; + Standard_Boolean aAgreementFlag = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadBoolean (num,3,"agreement_flag",ach,aAgreementFlag); diff --git a/src/RWStepShape/RWStepShape_RWBrepWithVoids.cxx b/src/RWStepShape/RWStepShape_RWBrepWithVoids.cxx index 2dc7fd0dcd..0b7877aef4 100644 --- a/src/RWStepShape/RWStepShape_RWBrepWithVoids.cxx +++ b/src/RWStepShape/RWStepShape_RWBrepWithVoids.cxx @@ -54,7 +54,7 @@ void RWStepShape_RWBrepWithVoids::ReadStep Handle(StepShape_HArray1OfOrientedClosedShell) aVoids; Handle(StepShape_OrientedClosedShell) anent3; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"voids",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); aVoids = new StepShape_HArray1OfOrientedClosedShell (1, nb3); diff --git a/src/RWStepShape/RWStepShape_RWClosedShell.cxx b/src/RWStepShape/RWStepShape_RWClosedShell.cxx index 11311f6ffa..1fa976c181 100644 --- a/src/RWStepShape/RWStepShape_RWClosedShell.cxx +++ b/src/RWStepShape/RWStepShape_RWClosedShell.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWClosedShell::ReadStep Handle(StepShape_HArray1OfFace) aCfsFaces; Handle(StepShape_Face) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"cfs_faces",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aCfsFaces = new StepShape_HArray1OfFace (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWConnectedFaceSet.cxx b/src/RWStepShape/RWStepShape_RWConnectedFaceSet.cxx index 142105f2af..d1fa29fa5d 100644 --- a/src/RWStepShape/RWStepShape_RWConnectedFaceSet.cxx +++ b/src/RWStepShape/RWStepShape_RWConnectedFaceSet.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWConnectedFaceSet::ReadStep Handle(StepShape_HArray1OfFace) aCfsFaces; Handle(StepShape_Face) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"cfs_faces",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aCfsFaces = new StepShape_HArray1OfFace (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWCsgShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWCsgShapeRepresentation.cxx index b3bd8a11cf..8d7373ed5b 100644 --- a/src/RWStepShape/RWStepShape_RWCsgShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWCsgShapeRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWCsgShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWDefinitionalRepresentationAndShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWDefinitionalRepresentationAndShapeRepresentation.cxx index 5a80f4be98..10b2257c39 100644 --- a/src/RWStepShape/RWStepShape_RWDefinitionalRepresentationAndShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWDefinitionalRepresentationAndShapeRepresentation.cxx @@ -50,7 +50,7 @@ void RWStepShape_RWDefinitionalRepresentationAndShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx b/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx index d6c8f9fd04..4bb2aec786 100644 --- a/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx +++ b/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx @@ -63,7 +63,7 @@ void RWStepShape_RWEdgeCurve::ReadStep // --- own field : sameSense --- - Standard_Boolean aSameSense; + Standard_Boolean aSameSense = 0; data->ReadBoolean (num,5,"same_sense",ach,aSameSense); //--- Initialisation of the read entity --- @@ -131,7 +131,7 @@ void RWStepShape_RWEdgeCurve::Check Standard_Boolean theFBOri2 = Standard_True; //Standard_Boolean theFSOri1 = Standard_True; //Standard_Boolean theFSOri2 = Standard_True; - Standard_Boolean Cumulated1, Cumulated2; + Standard_Boolean Cumulated1 = 0, Cumulated2 = 0; // 1- First Vertex != LastVertex but First VertexPoint == Last VertexPoint // Remark : time consuming process but useful ! @@ -169,7 +169,7 @@ void RWStepShape_RWEdgeCurve::Check // 2- Two-Manifold Topology Standard_Boolean sharEC = aShto.IsShared(ent); - Standard_Integer nbRef; + Standard_Integer nbRef = 0; if(!sharEC){ ach->AddFail("ERROR: EdgeCurve not referenced"); } diff --git a/src/RWStepShape/RWStepShape_RWEdgeLoop.cxx b/src/RWStepShape/RWStepShape_RWEdgeLoop.cxx index f6cc79a34f..db038e63bc 100644 --- a/src/RWStepShape/RWStepShape_RWEdgeLoop.cxx +++ b/src/RWStepShape/RWStepShape_RWEdgeLoop.cxx @@ -46,7 +46,7 @@ void RWStepShape_RWEdgeLoop::ReadStep Handle(StepShape_HArray1OfOrientedEdge) aEdgeList; Handle(StepShape_OrientedEdge) anent; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,2,"edge_list",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aEdgeList = new StepShape_HArray1OfOrientedEdge (1, nb1); diff --git a/src/RWStepShape/RWStepShape_RWExtrudedAreaSolid.cxx b/src/RWStepShape/RWStepShape_RWExtrudedAreaSolid.cxx index cfbd4d6b0b..4880311847 100644 --- a/src/RWStepShape/RWStepShape_RWExtrudedAreaSolid.cxx +++ b/src/RWStepShape/RWStepShape_RWExtrudedAreaSolid.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -54,7 +56,7 @@ void RWStepShape_RWExtrudedAreaSolid::ReadStep // --- own field : depth --- - Standard_Real aDepth; + Standard_Real aDepth = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"depth",ach,aDepth); diff --git a/src/RWStepShape/RWStepShape_RWExtrudedFaceSolid.cxx b/src/RWStepShape/RWStepShape_RWExtrudedFaceSolid.cxx index 39a56f257b..fa8a449060 100644 --- a/src/RWStepShape/RWStepShape_RWExtrudedFaceSolid.cxx +++ b/src/RWStepShape/RWStepShape_RWExtrudedFaceSolid.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -54,7 +56,7 @@ void RWStepShape_RWExtrudedFaceSolid::ReadStep // --- own field : depth --- - Standard_Real aDepth; + Standard_Real aDepth = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"depth",ach,aDepth); diff --git a/src/RWStepShape/RWStepShape_RWFace.cxx b/src/RWStepShape/RWStepShape_RWFace.cxx index b12537fa1a..8eac0591c6 100644 --- a/src/RWStepShape/RWStepShape_RWFace.cxx +++ b/src/RWStepShape/RWStepShape_RWFace.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWFace::ReadStep Handle(StepShape_HArray1OfFaceBound) aBounds; Handle(StepShape_FaceBound) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"bounds",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aBounds = new StepShape_HArray1OfFaceBound (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWFaceBound.cxx b/src/RWStepShape/RWStepShape_RWFaceBound.cxx index 4eb51377dc..5fb5b4bad9 100644 --- a/src/RWStepShape/RWStepShape_RWFaceBound.cxx +++ b/src/RWStepShape/RWStepShape_RWFaceBound.cxx @@ -50,7 +50,7 @@ void RWStepShape_RWFaceBound::ReadStep // --- own field : orientation --- - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadBoolean (num,3,"orientation",ach,aOrientation); diff --git a/src/RWStepShape/RWStepShape_RWFaceOuterBound.cxx b/src/RWStepShape/RWStepShape_RWFaceOuterBound.cxx index e7fbb2f1a5..3247462af1 100644 --- a/src/RWStepShape/RWStepShape_RWFaceOuterBound.cxx +++ b/src/RWStepShape/RWStepShape_RWFaceOuterBound.cxx @@ -47,7 +47,7 @@ void RWStepShape_RWFaceOuterBound::ReadStep // --- inherited field : orientation --- - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadBoolean (num,3,"orientation",ach,aOrientation); diff --git a/src/RWStepShape/RWStepShape_RWFaceSurface.cxx b/src/RWStepShape/RWStepShape_RWFaceSurface.cxx index 7fc0e162d8..a9d3f2a6de 100644 --- a/src/RWStepShape/RWStepShape_RWFaceSurface.cxx +++ b/src/RWStepShape/RWStepShape_RWFaceSurface.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWFaceSurface::ReadStep Handle(StepShape_HArray1OfFaceBound) aBounds; Handle(StepShape_FaceBound) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"bounds",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aBounds = new StepShape_HArray1OfFaceBound (1, nb2); @@ -64,7 +64,7 @@ void RWStepShape_RWFaceSurface::ReadStep // --- own field : sameSense --- - Standard_Boolean aSameSense; + Standard_Boolean aSameSense = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadBoolean (num,4,"same_sense",ach,aSameSense); diff --git a/src/RWStepShape/RWStepShape_RWFacetedBrepAndBrepWithVoids.cxx b/src/RWStepShape/RWStepShape_RWFacetedBrepAndBrepWithVoids.cxx index 7afda07613..5879528a69 100644 --- a/src/RWStepShape/RWStepShape_RWFacetedBrepAndBrepWithVoids.cxx +++ b/src/RWStepShape/RWStepShape_RWFacetedBrepAndBrepWithVoids.cxx @@ -43,7 +43,7 @@ void RWStepShape_RWFacetedBrepAndBrepWithVoids::ReadStep Handle(StepShape_HArray1OfOrientedClosedShell) aVoids; Handle(StepShape_OrientedClosedShell) anent; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"voids",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aVoids = new StepShape_HArray1OfOrientedClosedShell (1, nb1); diff --git a/src/RWStepShape/RWStepShape_RWFacetedBrepShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWFacetedBrepShapeRepresentation.cxx index a3c2e5a92f..c1713cb917 100644 --- a/src/RWStepShape/RWStepShape_RWFacetedBrepShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWFacetedBrepShapeRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWFacetedBrepShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWGeometricCurveSet.cxx b/src/RWStepShape/RWStepShape_RWGeometricCurveSet.cxx index e406789586..6bf25f19a3 100644 --- a/src/RWStepShape/RWStepShape_RWGeometricCurveSet.cxx +++ b/src/RWStepShape/RWStepShape_RWGeometricCurveSet.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWGeometricCurveSet::ReadStep Handle(StepShape_HArray1OfGeometricSetSelect) aElements; StepShape_GeometricSetSelect aElementsItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"elements",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aElements = new StepShape_HArray1OfGeometricSetSelect (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWGeometricSet.cxx b/src/RWStepShape/RWStepShape_RWGeometricSet.cxx index 2bca9aa09f..d38377e7eb 100644 --- a/src/RWStepShape/RWStepShape_RWGeometricSet.cxx +++ b/src/RWStepShape/RWStepShape_RWGeometricSet.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWGeometricSet::ReadStep Handle(StepShape_HArray1OfGeometricSetSelect) aElements; StepShape_GeometricSetSelect aElementsItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"elements",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aElements = new StepShape_HArray1OfGeometricSetSelect (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWGeometricallyBoundedSurfaceShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWGeometricallyBoundedSurfaceShapeRepresentation.cxx index b713e844cf..24f188b912 100644 --- a/src/RWStepShape/RWStepShape_RWGeometricallyBoundedSurfaceShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWGeometricallyBoundedSurfaceShapeRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWGeometricallyBoundedSurfaceShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation.cxx index f1f0193755..be1557f28c 100644 --- a/src/RWStepShape/RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWHalfSpaceSolid.cxx b/src/RWStepShape/RWStepShape_RWHalfSpaceSolid.cxx index d272a98bd8..61c30b542a 100644 --- a/src/RWStepShape/RWStepShape_RWHalfSpaceSolid.cxx +++ b/src/RWStepShape/RWStepShape_RWHalfSpaceSolid.cxx @@ -47,7 +47,7 @@ void RWStepShape_RWHalfSpaceSolid::ReadStep // --- own field : agreementFlag --- - Standard_Boolean aAgreementFlag; + Standard_Boolean aAgreementFlag = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadBoolean (num,3,"agreement_flag",ach,aAgreementFlag); diff --git a/src/RWStepShape/RWStepShape_RWLoopAndPath.cxx b/src/RWStepShape/RWStepShape_RWLoopAndPath.cxx index f7d36fdef8..24008d3bcb 100644 --- a/src/RWStepShape/RWStepShape_RWLoopAndPath.cxx +++ b/src/RWStepShape/RWStepShape_RWLoopAndPath.cxx @@ -46,7 +46,7 @@ void RWStepShape_RWLoopAndPath::ReadStep Handle(StepShape_HArray1OfOrientedEdge) aEdgeList; Handle(StepShape_OrientedEdge) anent1; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"edge_list",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aEdgeList = new StepShape_HArray1OfOrientedEdge (1, nb1); diff --git a/src/RWStepShape/RWStepShape_RWManifoldSurfaceShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWManifoldSurfaceShapeRepresentation.cxx index 0d6dda1bad..ab89686000 100644 --- a/src/RWStepShape/RWStepShape_RWManifoldSurfaceShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWManifoldSurfaceShapeRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWManifoldSurfaceShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWMeasureQualification.cxx b/src/RWStepShape/RWStepShape_RWMeasureQualification.cxx index 63555f2275..f31596ba9e 100644 --- a/src/RWStepShape/RWStepShape_RWMeasureQualification.cxx +++ b/src/RWStepShape/RWStepShape_RWMeasureQualification.cxx @@ -55,7 +55,7 @@ void RWStepShape_RWMeasureQualification::ReadStep // --- own field : qualifiers --- Handle(StepShape_HArray1OfValueQualifier) quals; - Standard_Integer nsub4; + Standard_Integer nsub4 = 0; if (data->ReadSubList (num,4,"qualifiers",ach,nsub4)) { Standard_Integer nb4 = data->NbParams(nsub4); quals = new StepShape_HArray1OfValueQualifier (1,nb4); @@ -79,7 +79,7 @@ void RWStepShape_RWMeasureQualification::WriteStep SW.Send(ent->Name()); SW.Send(ent->Description()); SW.Send(ent->QualifiedMeasure()); - Standard_Integer i, nbq = ent->NbQualifiers(); + Standard_Integer i = 0, nbq = ent->NbQualifiers(); SW.OpenSub(); for (i = 1; i <= nbq; i ++) SW.Send (ent->QualifiersValue(i).Value()); SW.CloseSub(); @@ -88,7 +88,7 @@ void RWStepShape_RWMeasureQualification::WriteStep void RWStepShape_RWMeasureQualification::Share(const Handle(StepShape_MeasureQualification)& ent, Interface_EntityIterator& iter) const { - Standard_Integer i, nbq = ent->NbQualifiers(); + Standard_Integer i = 0, nbq = ent->NbQualifiers(); for (i = 1; i <= nbq; i ++) iter.AddItem (ent->QualifiersValue(i).Value()); } diff --git a/src/RWStepShape/RWStepShape_RWMeasureRepresentationItemAndQualifiedRepresentationItem.cxx b/src/RWStepShape/RWStepShape_RWMeasureRepresentationItemAndQualifiedRepresentationItem.cxx index e5365ede65..e786b27449 100644 --- a/src/RWStepShape/RWStepShape_RWMeasureRepresentationItemAndQualifiedRepresentationItem.cxx +++ b/src/RWStepShape/RWStepShape_RWMeasureRepresentationItemAndQualifiedRepresentationItem.cxx @@ -63,7 +63,7 @@ void RWStepShape_RWMeasureRepresentationItemAndQualifiedRepresentationItem::Read // --- own field : qualifiers --- Handle(StepShape_HArray1OfValueQualifier) quals; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"qualifiers",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); quals = new StepShape_HArray1OfValueQualifier (1,nb1); @@ -113,7 +113,7 @@ void RWStepShape_RWMeasureRepresentationItemAndQualifiedRepresentationItem::Writ SW.StartEntity ("QUALIFIED_REPRESENTATION_ITEM"); // --- own field : qualifiers --- - Standard_Integer i, nbq = ent->NbQualifiers(); + Standard_Integer i = 0, nbq = ent->NbQualifiers(); SW.OpenSub(); for (i = 1; i <= nbq; i ++) SW.Send (ent->QualifiersValue(i).Value()); SW.CloseSub(); @@ -132,7 +132,7 @@ void RWStepShape_RWMeasureRepresentationItemAndQualifiedRepresentationItem::Shar { iter.AddItem(ent->Measure()->UnitComponent().Value()); - Standard_Integer i, nbq = ent->NbQualifiers(); + Standard_Integer i = 0, nbq = ent->NbQualifiers(); for (i = 1; i <= nbq; i ++) iter.AddItem (ent->QualifiersValue(i).Value()); } diff --git a/src/RWStepShape/RWStepShape_RWOpenShell.cxx b/src/RWStepShape/RWStepShape_RWOpenShell.cxx index 0b68bc6106..87f09a2ca6 100644 --- a/src/RWStepShape/RWStepShape_RWOpenShell.cxx +++ b/src/RWStepShape/RWStepShape_RWOpenShell.cxx @@ -43,7 +43,7 @@ void RWStepShape_RWOpenShell::ReadStep Handle(StepShape_HArray1OfFace) aCfsFaces; Handle(StepShape_Face) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"cfs_faces",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aCfsFaces = new StepShape_HArray1OfFace (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWOrientedClosedShell.cxx b/src/RWStepShape/RWStepShape_RWOrientedClosedShell.cxx index 029d9a07c7..a9bd2a3740 100644 --- a/src/RWStepShape/RWStepShape_RWOrientedClosedShell.cxx +++ b/src/RWStepShape/RWStepShape_RWOrientedClosedShell.cxx @@ -51,7 +51,7 @@ void RWStepShape_RWOrientedClosedShell::ReadStep // --- own field : orientation --- - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadBoolean (num,4,"orientation",ach,aOrientation); diff --git a/src/RWStepShape/RWStepShape_RWOrientedEdge.cxx b/src/RWStepShape/RWStepShape_RWOrientedEdge.cxx index c3624fad17..14cacbc6c0 100644 --- a/src/RWStepShape/RWStepShape_RWOrientedEdge.cxx +++ b/src/RWStepShape/RWStepShape_RWOrientedEdge.cxx @@ -57,7 +57,7 @@ void RWStepShape_RWOrientedEdge::ReadStep // --- own field : orientation --- - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadBoolean (num,5,"orientation",ach,aOrientation); diff --git a/src/RWStepShape/RWStepShape_RWOrientedFace.cxx b/src/RWStepShape/RWStepShape_RWOrientedFace.cxx index d601b084db..a3b0eb73c0 100644 --- a/src/RWStepShape/RWStepShape_RWOrientedFace.cxx +++ b/src/RWStepShape/RWStepShape_RWOrientedFace.cxx @@ -51,7 +51,7 @@ void RWStepShape_RWOrientedFace::ReadStep // --- own field : orientation --- - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadBoolean (num,4,"orientation",ach,aOrientation); diff --git a/src/RWStepShape/RWStepShape_RWOrientedOpenShell.cxx b/src/RWStepShape/RWStepShape_RWOrientedOpenShell.cxx index c4d41e3529..604fd1c7a2 100644 --- a/src/RWStepShape/RWStepShape_RWOrientedOpenShell.cxx +++ b/src/RWStepShape/RWStepShape_RWOrientedOpenShell.cxx @@ -51,7 +51,7 @@ void RWStepShape_RWOrientedOpenShell::ReadStep // --- own field : orientation --- - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadBoolean (num,4,"orientation",ach,aOrientation); diff --git a/src/RWStepShape/RWStepShape_RWOrientedPath.cxx b/src/RWStepShape/RWStepShape_RWOrientedPath.cxx index 0096f4aab0..f5e69a35a7 100644 --- a/src/RWStepShape/RWStepShape_RWOrientedPath.cxx +++ b/src/RWStepShape/RWStepShape_RWOrientedPath.cxx @@ -52,7 +52,7 @@ void RWStepShape_RWOrientedPath::ReadStep // --- own field : orientation --- - Standard_Boolean aOrientation; + Standard_Boolean aOrientation = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadBoolean (num,4,"orientation",ach,aOrientation); diff --git a/src/RWStepShape/RWStepShape_RWPath.cxx b/src/RWStepShape/RWStepShape_RWPath.cxx index c824f3a78b..51abaf644c 100644 --- a/src/RWStepShape/RWStepShape_RWPath.cxx +++ b/src/RWStepShape/RWStepShape_RWPath.cxx @@ -44,7 +44,7 @@ void RWStepShape_RWPath::ReadStep Handle(StepShape_HArray1OfOrientedEdge) aEdgeList; Handle(StepShape_OrientedEdge) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"edge_list",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aEdgeList = new StepShape_HArray1OfOrientedEdge (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWPolyLoop.cxx b/src/RWStepShape/RWStepShape_RWPolyLoop.cxx index b04199ff28..0e81d1ffa3 100644 --- a/src/RWStepShape/RWStepShape_RWPolyLoop.cxx +++ b/src/RWStepShape/RWStepShape_RWPolyLoop.cxx @@ -43,7 +43,7 @@ void RWStepShape_RWPolyLoop::ReadStep Handle(StepGeom_HArray1OfCartesianPoint) aPolygon; Handle(StepGeom_CartesianPoint) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"polygon",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aPolygon = new StepGeom_HArray1OfCartesianPoint (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWPrecisionQualifier.cxx b/src/RWStepShape/RWStepShape_RWPrecisionQualifier.cxx index 88f821bd72..717e1c6f9d 100644 --- a/src/RWStepShape/RWStepShape_RWPrecisionQualifier.cxx +++ b/src/RWStepShape/RWStepShape_RWPrecisionQualifier.cxx @@ -31,7 +31,7 @@ void RWStepShape_RWPrecisionQualifier::ReadStep // --- own field : precision_value --- - Standard_Integer PV; + Standard_Integer PV = 0; data->ReadInteger (num,1,"precision_value",ach,PV); //--- Initialisation of the read entity --- diff --git a/src/RWStepShape/RWStepShape_RWQualifiedRepresentationItem.cxx b/src/RWStepShape/RWStepShape_RWQualifiedRepresentationItem.cxx index c7ceec34a0..4201eccc6c 100644 --- a/src/RWStepShape/RWStepShape_RWQualifiedRepresentationItem.cxx +++ b/src/RWStepShape/RWStepShape_RWQualifiedRepresentationItem.cxx @@ -43,7 +43,7 @@ void RWStepShape_RWQualifiedRepresentationItem::ReadStep // --- own field : qualifiers --- Handle(StepShape_HArray1OfValueQualifier) quals; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"qualifiers",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); quals = new StepShape_HArray1OfValueQualifier (1,nb2); @@ -69,7 +69,7 @@ void RWStepShape_RWQualifiedRepresentationItem::WriteStep SW.Send(ent->Name()); // --- own field : qualifiers --- - Standard_Integer i, nbq = ent->NbQualifiers(); + Standard_Integer i = 0, nbq = ent->NbQualifiers(); SW.OpenSub(); for (i = 1; i <= nbq; i ++) SW.Send (ent->QualifiersValue(i).Value()); SW.CloseSub(); @@ -78,7 +78,7 @@ void RWStepShape_RWQualifiedRepresentationItem::WriteStep void RWStepShape_RWQualifiedRepresentationItem::Share(const Handle(StepShape_QualifiedRepresentationItem)& ent, Interface_EntityIterator& iter) const { - Standard_Integer i, nbq = ent->NbQualifiers(); + Standard_Integer i = 0, nbq = ent->NbQualifiers(); for (i = 1; i <= nbq; i ++) iter.AddItem (ent->QualifiersValue(i).Value()); } diff --git a/src/RWStepShape/RWStepShape_RWRevolvedAreaSolid.cxx b/src/RWStepShape/RWStepShape_RWRevolvedAreaSolid.cxx index 81bd0f95f2..0ebad081be 100644 --- a/src/RWStepShape/RWStepShape_RWRevolvedAreaSolid.cxx +++ b/src/RWStepShape/RWStepShape_RWRevolvedAreaSolid.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -54,7 +56,7 @@ void RWStepShape_RWRevolvedAreaSolid::ReadStep // --- own field : angle --- - Standard_Real aAngle; + Standard_Real aAngle = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"angle",ach,aAngle); diff --git a/src/RWStepShape/RWStepShape_RWRevolvedFaceSolid.cxx b/src/RWStepShape/RWStepShape_RWRevolvedFaceSolid.cxx index 9cbde9edb6..c76ca29648 100644 --- a/src/RWStepShape/RWStepShape_RWRevolvedFaceSolid.cxx +++ b/src/RWStepShape/RWStepShape_RWRevolvedFaceSolid.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -54,7 +56,7 @@ void RWStepShape_RWRevolvedFaceSolid::ReadStep // --- own field : angle --- - Standard_Real aAngle; + Standard_Real aAngle = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"angle",ach,aAngle); diff --git a/src/RWStepShape/RWStepShape_RWRightAngularWedge.cxx b/src/RWStepShape/RWStepShape_RWRightAngularWedge.cxx index 1547e3f209..69b5a3042e 100644 --- a/src/RWStepShape/RWStepShape_RWRightAngularWedge.cxx +++ b/src/RWStepShape/RWStepShape_RWRightAngularWedge.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,25 +49,25 @@ void RWStepShape_RWRightAngularWedge::ReadStep // --- own field : x --- - Standard_Real aX; + Standard_Real aX = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"x",ach,aX); // --- own field : y --- - Standard_Real aY; + Standard_Real aY = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"y",ach,aY); // --- own field : z --- - Standard_Real aZ; + Standard_Real aZ = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadReal (num,5,"z",ach,aZ); // --- own field : ltx --- - Standard_Real aLtx; + Standard_Real aLtx = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat6 =` not needed data->ReadReal (num,6,"ltx",ach,aLtx); diff --git a/src/RWStepShape/RWStepShape_RWRightCircularCone.cxx b/src/RWStepShape/RWStepShape_RWRightCircularCone.cxx index bbfb9d79b9..b99aa24f60 100644 --- a/src/RWStepShape/RWStepShape_RWRightCircularCone.cxx +++ b/src/RWStepShape/RWStepShape_RWRightCircularCone.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,19 +49,19 @@ void RWStepShape_RWRightCircularCone::ReadStep // --- own field : height --- - Standard_Real aHeight; + Standard_Real aHeight = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"height",ach,aHeight); // --- own field : radius --- - Standard_Real aRadius; + Standard_Real aRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"radius",ach,aRadius); // --- own field : semiAngle --- - Standard_Real aSemiAngle; + Standard_Real aSemiAngle = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadReal (num,5,"semi_angle",ach,aSemiAngle); diff --git a/src/RWStepShape/RWStepShape_RWRightCircularCylinder.cxx b/src/RWStepShape/RWStepShape_RWRightCircularCylinder.cxx index 12e315ad00..0473a4b8ce 100644 --- a/src/RWStepShape/RWStepShape_RWRightCircularCylinder.cxx +++ b/src/RWStepShape/RWStepShape_RWRightCircularCylinder.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,13 +49,13 @@ void RWStepShape_RWRightCircularCylinder::ReadStep // --- own field : height --- - Standard_Real aHeight; + Standard_Real aHeight = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"height",ach,aHeight); // --- own field : radius --- - Standard_Real aRadius; + Standard_Real aRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"radius",ach,aRadius); diff --git a/src/RWStepShape/RWStepShape_RWSeamEdge.cxx b/src/RWStepShape/RWStepShape_RWSeamEdge.cxx index 086dbc1c6d..1a8a619ce4 100644 --- a/src/RWStepShape/RWStepShape_RWSeamEdge.cxx +++ b/src/RWStepShape/RWStepShape_RWSeamEdge.cxx @@ -62,7 +62,7 @@ void RWStepShape_RWSeamEdge::ReadStep (const Handle(StepData_StepReaderData)& da Handle(StepShape_Edge) aOrientedEdge_EdgeElement; data->ReadEntity (num, 4, "oriented_edge.edge_element", ach, STANDARD_TYPE(StepShape_Edge), aOrientedEdge_EdgeElement); - Standard_Boolean aOrientedEdge_Orientation; + Standard_Boolean aOrientedEdge_Orientation = 0; data->ReadBoolean (num, 5, "oriented_edge.orientation", ach, aOrientedEdge_Orientation); // Own fields of SeamEdge diff --git a/src/RWStepShape/RWStepShape_RWShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWShapeRepresentation.cxx index 496402c784..4225fbdd7f 100644 --- a/src/RWStepShape/RWStepShape_RWShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWShapeRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWShellBasedSurfaceModel.cxx b/src/RWStepShape/RWStepShape_RWShellBasedSurfaceModel.cxx index 2857e203a5..7840c3e508 100644 --- a/src/RWStepShape/RWStepShape_RWShellBasedSurfaceModel.cxx +++ b/src/RWStepShape/RWStepShape_RWShellBasedSurfaceModel.cxx @@ -44,7 +44,7 @@ void RWStepShape_RWShellBasedSurfaceModel::ReadStep Handle(StepShape_HArray1OfShell) aSbsmBoundary; StepShape_Shell aSbsmBoundaryItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"sbsm_boundary",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aSbsmBoundary = new StepShape_HArray1OfShell (1, nb2); diff --git a/src/RWStepShape/RWStepShape_RWSphere.cxx b/src/RWStepShape/RWStepShape_RWSphere.cxx index a2b6ea9646..0ab9371aba 100644 --- a/src/RWStepShape/RWStepShape_RWSphere.cxx +++ b/src/RWStepShape/RWStepShape_RWSphere.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -41,7 +43,7 @@ void RWStepShape_RWSphere::ReadStep // --- own field : radius --- - Standard_Real aRadius; + Standard_Real aRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadReal (num,2,"radius",ach,aRadius); diff --git a/src/RWStepShape/RWStepShape_RWTorus.cxx b/src/RWStepShape/RWStepShape_RWTorus.cxx index 70192469d3..7dcba59f57 100644 --- a/src/RWStepShape/RWStepShape_RWTorus.cxx +++ b/src/RWStepShape/RWStepShape_RWTorus.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,13 +49,13 @@ void RWStepShape_RWTorus::ReadStep // --- own field : majorRadius --- - Standard_Real aMajorRadius; + Standard_Real aMajorRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"major_radius",ach,aMajorRadius); // --- own field : minorRadius --- - Standard_Real aMinorRadius; + Standard_Real aMinorRadius = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"minor_radius",ach,aMinorRadius); diff --git a/src/RWStepShape/RWStepShape_RWTransitionalShapeRepresentation.cxx b/src/RWStepShape/RWStepShape_RWTransitionalShapeRepresentation.cxx index 5467d28bfd..2cc6f935e3 100644 --- a/src/RWStepShape/RWStepShape_RWTransitionalShapeRepresentation.cxx +++ b/src/RWStepShape/RWStepShape_RWTransitionalShapeRepresentation.cxx @@ -45,7 +45,7 @@ void RWStepShape_RWTransitionalShapeRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationCurveOccurrence.cxx b/src/RWStepVisual/RWStepVisual_RWAnnotationCurveOccurrence.cxx index b61aa4bcce..991f98cc7b 100644 --- a/src/RWStepVisual/RWStepVisual_RWAnnotationCurveOccurrence.cxx +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationCurveOccurrence.cxx @@ -47,7 +47,7 @@ void RWStepVisual_RWAnnotationCurveOccurrence::ReadStep // Inherited field : styles Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationCurveOccurrenceAndGeomReprItem.cxx b/src/RWStepVisual/RWStepVisual_RWAnnotationCurveOccurrenceAndGeomReprItem.cxx index 4babfa7e98..ea3814e26e 100644 --- a/src/RWStepVisual/RWStepVisual_RWAnnotationCurveOccurrenceAndGeomReprItem.cxx +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationCurveOccurrenceAndGeomReprItem.cxx @@ -47,7 +47,7 @@ const Handle(StepVisual_AnnotationCurveOccurrenceAndGeomReprItem)& ent) const // Inherited field : styles Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anEnt; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (data->ReadSubList(num, 1, "styles", ach, nsub)) { Standard_Integer nb = data->NbParams(nsub); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment(1, nb); diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx b/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx index fb85f8cf5a..a9f3bdd4df 100644 --- a/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationFillArea.cxx @@ -51,7 +51,7 @@ const Handle(StepVisual_AnnotationFillArea)& ent) const // Own field : boundaries Handle(StepShape_HArray1OfGeometricSetSelect) aElements; StepShape_GeometricSetSelect aElementsItem; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (data->ReadSubList(num, 2, "boundaries", ach, nsub)) { Standard_Integer nb = data->NbParams(nsub); aElements = new StepShape_HArray1OfGeometricSetSelect(1, nb); diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx b/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx index ea27e61076..7a06d52a71 100644 --- a/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationFillAreaOccurrence.cxx @@ -48,7 +48,7 @@ const Handle(StepVisual_AnnotationFillAreaOccurrence)& ent) const // Inherited field : styles Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anent; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (data->ReadSubList(num, 2, "styles", ach, nsub)) { Standard_Integer nb = data->NbParams(nsub); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment(1, nb); diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationOccurrence.cxx b/src/RWStepVisual/RWStepVisual_RWAnnotationOccurrence.cxx index 43836de8b3..d21144396b 100644 --- a/src/RWStepVisual/RWStepVisual_RWAnnotationOccurrence.cxx +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationOccurrence.cxx @@ -47,7 +47,7 @@ void RWStepVisual_RWAnnotationOccurrence::ReadStep // Inherited field : styles Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWAnnotationPlane.cxx b/src/RWStepVisual/RWStepVisual_RWAnnotationPlane.cxx index f1556bbf83..d44f402437 100644 --- a/src/RWStepVisual/RWStepVisual_RWAnnotationPlane.cxx +++ b/src/RWStepVisual/RWStepVisual_RWAnnotationPlane.cxx @@ -47,7 +47,7 @@ void RWStepVisual_RWAnnotationPlane::ReadStep // Inherited field : styles Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2); @@ -65,7 +65,7 @@ void RWStepVisual_RWAnnotationPlane::ReadStep // Own field: elements Handle(StepVisual_HArray1OfAnnotationPlaneElement) anElements; StepVisual_AnnotationPlaneElement anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num, 4, "elements", ach, nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); anElements = new StepVisual_HArray1OfAnnotationPlaneElement (1, nbElements); @@ -123,7 +123,7 @@ void RWStepVisual_RWAnnotationPlane::Share(const Handle(StepVisual_AnnotationPla iter.GetOneItem(ent->Item()); // Own field: contents - Standard_Integer i, nb = ent->NbElements(); + Standard_Integer i = 0, nb = ent->NbElements(); for (i = 1; i <= nb; i++) iter.AddItem (ent->ElementsValue(i).Value()); } diff --git a/src/RWStepVisual/RWStepVisual_RWCameraModelD2.cxx b/src/RWStepVisual/RWStepVisual_RWCameraModelD2.cxx index a60a16efd9..3b8bf9fad1 100644 --- a/src/RWStepVisual/RWStepVisual_RWCameraModelD2.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCameraModelD2.cxx @@ -47,7 +47,7 @@ void RWStepVisual_RWCameraModelD2::ReadStep // --- own field : viewWindowClipping --- - Standard_Boolean aViewWindowClipping; + Standard_Boolean aViewWindowClipping = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadBoolean (num,3,"view_window_clipping",ach,aViewWindowClipping); diff --git a/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClipping.cxx b/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClipping.cxx index 697936572a..c7da505714 100644 --- a/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClipping.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClipping.cxx @@ -59,7 +59,7 @@ void RWStepVisual_RWCameraModelD3MultiClipping::ReadStep // Own field : shape_clipping Handle(StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect) aShapeClipping; StepVisual_CameraModelD3MultiClippingInterectionSelect anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList(num, 4, "shape_clipping", ach, nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); aShapeClipping = new StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect(1, nbElements); @@ -111,7 +111,7 @@ void RWStepVisual_RWCameraModelD3MultiClipping::Share // Inherited field : perspective_of_volume iter.GetOneItem(ent->PerspectiveOfVolume()); // Own field: shape_clipping - Standard_Integer i, nb = ent->ShapeClipping()->Length(); + Standard_Integer i = 0, nb = ent->ShapeClipping()->Length(); for (i = 1; i <= nb; i++) iter.AddItem(ent->ShapeClipping()->Value(i).Value()); } diff --git a/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClippingIntersection.cxx b/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClippingIntersection.cxx index 75cb3fe307..f5241abffc 100644 --- a/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClippingIntersection.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClippingIntersection.cxx @@ -49,7 +49,7 @@ void RWStepVisual_RWCameraModelD3MultiClippingIntersection::ReadStep // Own field : shape_clipping Handle(StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect) aShapeClipping; StepVisual_CameraModelD3MultiClippingInterectionSelect anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList(num, 2, "shape_clipping", ach, nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); aShapeClipping = new StepVisual_HArray1OfCameraModelD3MultiClippingInterectionSelect(1, nbElements); @@ -91,7 +91,7 @@ void RWStepVisual_RWCameraModelD3MultiClippingIntersection::Share Interface_EntityIterator& iter) const { // Own field: shape_clipping - Standard_Integer i, nb = ent->ShapeClipping()->Length(); + Standard_Integer i = 0, nb = ent->ShapeClipping()->Length(); for (i = 1; i <= nb; i++) iter.AddItem(ent->ShapeClipping()->Value(i).Value()); } diff --git a/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClippingUnion.cxx b/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClippingUnion.cxx index c6e41e2eab..c76a1f40e9 100644 --- a/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClippingUnion.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCameraModelD3MultiClippingUnion.cxx @@ -49,7 +49,7 @@ void RWStepVisual_RWCameraModelD3MultiClippingUnion::ReadStep // Own field : shape_clipping Handle(StepVisual_HArray1OfCameraModelD3MultiClippingUnionSelect) aShapeClipping; StepVisual_CameraModelD3MultiClippingUnionSelect anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList(num, 2, "shape_clipping", ach, nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); aShapeClipping = new StepVisual_HArray1OfCameraModelD3MultiClippingUnionSelect(1, nbElements); @@ -91,7 +91,7 @@ void RWStepVisual_RWCameraModelD3MultiClippingUnion::Share Interface_EntityIterator& iter) const { // Own field: shape_clipping - Standard_Integer i, nb = ent->ShapeClipping()->Length(); + Standard_Integer i = 0, nb = ent->ShapeClipping()->Length(); for (i = 1; i <= nb; i++) iter.AddItem(ent->ShapeClipping()->Value(i).Value()); } diff --git a/src/RWStepVisual/RWStepVisual_RWCharacterizedObjAndRepresentationAndDraughtingModel.cxx b/src/RWStepVisual/RWStepVisual_RWCharacterizedObjAndRepresentationAndDraughtingModel.cxx index c0b99640be..6c92f365a0 100644 --- a/src/RWStepVisual/RWStepVisual_RWCharacterizedObjAndRepresentationAndDraughtingModel.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCharacterizedObjAndRepresentationAndDraughtingModel.cxx @@ -53,7 +53,7 @@ void RWStepVisual_RWCharacterizedObjAndRepresentationAndDraughtingModel::ReadSte // items Handle(StepRepr_HArray1OfRepresentationItem) anItems; Handle(StepRepr_RepresentationItem) anItem; - Standard_Integer nsub; + Standard_Integer nsub = 0; if (data->ReadSubList(num, 2, "items", ach, nsub)) { Standard_Integer nb = data->NbParams(nsub); anItems = new StepRepr_HArray1OfRepresentationItem(1, nb); diff --git a/src/RWStepVisual/RWStepVisual_RWColourRgb.cxx b/src/RWStepVisual/RWStepVisual_RWColourRgb.cxx index 3e29593f93..c2b9f462ab 100644 --- a/src/RWStepVisual/RWStepVisual_RWColourRgb.cxx +++ b/src/RWStepVisual/RWStepVisual_RWColourRgb.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -39,19 +41,19 @@ void RWStepVisual_RWColourRgb::ReadStep // --- own field : red --- - Standard_Real aRed; + Standard_Real aRed = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadReal (num,2,"red",ach,aRed); // --- own field : green --- - Standard_Real aGreen; + Standard_Real aGreen = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"green",ach,aGreen); // --- own field : blue --- - Standard_Real aBlue; + Standard_Real aBlue = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"blue",ach,aBlue); diff --git a/src/RWStepVisual/RWStepVisual_RWComplexTriangulatedFace.cxx b/src/RWStepVisual/RWStepVisual_RWComplexTriangulatedFace.cxx index 266d02d91a..edefa36774 100644 --- a/src/RWStepVisual/RWStepVisual_RWComplexTriangulatedFace.cxx +++ b/src/RWStepVisual/RWStepVisual_RWComplexTriangulatedFace.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -64,7 +66,7 @@ void RWStepVisual_RWComplexTriangulatedFace::ReadStep (const Handle(StepData_Ste theData->ReadEntity(theNum, 2, "tessellated_face.coordinates", theCheck, STANDARD_TYPE(StepVisual_CoordinatesList), aTessellatedFace_Coordinates); - Standard_Integer aTessellatedFace_Pnmax; + Standard_Integer aTessellatedFace_Pnmax = 0; theData->ReadInteger(theNum, 3, "tessellated_face.pnmax", theCheck, aTessellatedFace_Pnmax); Handle(TColStd_HArray2OfReal) aTessellatedFace_Normals; @@ -81,7 +83,7 @@ void RWStepVisual_RWComplexTriangulatedFace::ReadStep (const Handle(StepData_Ste Standard_Integer num4 = subj4; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; theData->ReadReal(num4, j0, "real", theCheck, anIt0); aTessellatedFace_Normals->SetValue(i0,j0, anIt0); } @@ -112,7 +114,7 @@ void RWStepVisual_RWComplexTriangulatedFace::ReadStep (const Handle(StepData_Ste Standard_Integer num2 = sub6; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aPnindex->SetValue(i0, anIt0); } @@ -132,7 +134,7 @@ void RWStepVisual_RWComplexTriangulatedFace::ReadStep (const Handle(StepData_Ste Standard_Integer num4 = subj7; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num4, j0, "integer", theCheck, anIt0); aTriangleStrips->SetValue(i0,j0, anIt0); } @@ -154,7 +156,7 @@ void RWStepVisual_RWComplexTriangulatedFace::ReadStep (const Handle(StepData_Ste Standard_Integer num4 = subj8; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num4, j0, "integer", theCheck, anIt0); aTriangleFans->SetValue(i0,j0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWComplexTriangulatedSurfaceSet.cxx b/src/RWStepVisual/RWStepVisual_RWComplexTriangulatedSurfaceSet.cxx index e8a80734b9..d4f601cc52 100644 --- a/src/RWStepVisual/RWStepVisual_RWComplexTriangulatedSurfaceSet.cxx +++ b/src/RWStepVisual/RWStepVisual_RWComplexTriangulatedSurfaceSet.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -64,7 +66,7 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::ReadStep( theData->ReadEntity(theNum, 2, "tessellated_surface_set.coordinates", theCheck, STANDARD_TYPE(StepVisual_CoordinatesList), aTessellatedSurfaceSet_Coordinates); - Standard_Integer aTessellatedSurfaceSet_Pnmax; + Standard_Integer aTessellatedSurfaceSet_Pnmax = 0; theData->ReadInteger(theNum, 3, "tessellated_surface_set.pnmax", theCheck, aTessellatedSurfaceSet_Pnmax); Handle(TColStd_HArray2OfReal) aTessellatedSurfaceSet_Normals; @@ -81,7 +83,7 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::ReadStep( Standard_Integer num4 = subj4; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; theData->ReadReal(num4, j0, "real", theCheck, anIt0); aTessellatedSurfaceSet_Normals->SetValue(i0,j0, anIt0); } @@ -100,7 +102,7 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::ReadStep( Standard_Integer num2 = sub5; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aPnindex->SetValue(i0, anIt0); } @@ -120,7 +122,7 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::ReadStep( Standard_Integer num4 = subj6; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num4, j0, "integer", theCheck, anIt0); aTriangleStrips->SetValue(i0,j0, anIt0); } @@ -142,7 +144,7 @@ void RWStepVisual_RWComplexTriangulatedSurfaceSet::ReadStep( Standard_Integer num4 = subj7; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num4, j0, "integer", theCheck, anIt0); aTriangleFans->SetValue(i0,j0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWCompositeText.cxx b/src/RWStepVisual/RWStepVisual_RWCompositeText.cxx index 7991ebd7fe..9cf0b39fb7 100644 --- a/src/RWStepVisual/RWStepVisual_RWCompositeText.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCompositeText.cxx @@ -45,7 +45,7 @@ void RWStepVisual_RWCompositeText::ReadStep Handle(StepVisual_HArray1OfTextOrCharacter) aCollectedText; StepVisual_TextOrCharacter aCollectedTextItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; nsub2 = data->SubListNumber(num, 2, Standard_False); if (nsub2 !=0) { Standard_Integer nb2 = data->NbParams(nsub2); diff --git a/src/RWStepVisual/RWStepVisual_RWCompositeTextWithExtent.cxx b/src/RWStepVisual/RWStepVisual_RWCompositeTextWithExtent.cxx index d2711983dc..4cb592d77c 100644 --- a/src/RWStepVisual/RWStepVisual_RWCompositeTextWithExtent.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCompositeTextWithExtent.cxx @@ -46,7 +46,7 @@ void RWStepVisual_RWCompositeTextWithExtent::ReadStep Handle(StepVisual_HArray1OfTextOrCharacter) aCollectedText; StepVisual_TextOrCharacter aCollectedTextItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; nsub2 = data->SubListNumber(num, 2, Standard_False); if (nsub2 !=0) { Standard_Integer nb2 = data->NbParams(nsub2); diff --git a/src/RWStepVisual/RWStepVisual_RWContextDependentInvisibility.cxx b/src/RWStepVisual/RWStepVisual_RWContextDependentInvisibility.cxx index 1cfed084d1..d3fff8747b 100644 --- a/src/RWStepVisual/RWStepVisual_RWContextDependentInvisibility.cxx +++ b/src/RWStepVisual/RWStepVisual_RWContextDependentInvisibility.cxx @@ -40,7 +40,7 @@ void RWStepVisual_RWContextDependentInvisibility::ReadStep Handle(StepVisual_HArray1OfInvisibleItem) aInvisibleItems; StepVisual_InvisibleItem aInvisibleItemsItem; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"invisible_items",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aInvisibleItems = new StepVisual_HArray1OfInvisibleItem (1, nb1); diff --git a/src/RWStepVisual/RWStepVisual_RWContextDependentOverRidingStyledItem.cxx b/src/RWStepVisual/RWStepVisual_RWContextDependentOverRidingStyledItem.cxx index 92dd7c1455..4633fe042b 100644 --- a/src/RWStepVisual/RWStepVisual_RWContextDependentOverRidingStyledItem.cxx +++ b/src/RWStepVisual/RWStepVisual_RWContextDependentOverRidingStyledItem.cxx @@ -48,7 +48,7 @@ void RWStepVisual_RWContextDependentOverRidingStyledItem::ReadStep Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2); @@ -75,7 +75,7 @@ void RWStepVisual_RWContextDependentOverRidingStyledItem::ReadStep Handle(StepVisual_HArray1OfStyleContextSelect) aStyleContext; StepVisual_StyleContextSelect aStyleContextItem; - Standard_Integer nsub5; + Standard_Integer nsub5 = 0; if (data->ReadSubList (num,5,"style_context",ach,nsub5)) { Standard_Integer nb5 = data->NbParams(nsub5); aStyleContext = new StepVisual_HArray1OfStyleContextSelect (1, nb5); diff --git a/src/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx b/src/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx index 206101e4ee..53c6c23a3c 100644 --- a/src/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx @@ -49,7 +49,7 @@ void RWStepVisual_RWCoordinatesList::ReadStep data->ReadInteger(num, 2, "number_points", ach,nbP); Handle(TColgp_HArray1OfXYZ) aPoints;// = new TColgp_HArray1OfXYZ(1, nbP); - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,3,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); @@ -59,7 +59,7 @@ void RWStepVisual_RWCoordinatesList::ReadStep for (Standard_Integer i = 1; i <= nb2; i++) { gp_XYZ aXYZ(0.,0.,0.); - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (nsub2,i,"coordinates",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); if(nb3 > 3) { diff --git a/src/RWStepVisual/RWStepVisual_RWCubicBezierTessellatedEdge.cxx b/src/RWStepVisual/RWStepVisual_RWCubicBezierTessellatedEdge.cxx index b7a18ac584..bf138fc4e8 100644 --- a/src/RWStepVisual/RWStepVisual_RWCubicBezierTessellatedEdge.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCubicBezierTessellatedEdge.cxx @@ -82,7 +82,7 @@ void RWStepVisual_RWCubicBezierTessellatedEdge::ReadStep( Standard_Integer num2 = sub4; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aTessellatedEdge_LineStrip->SetValue(i0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWCubicBezierTriangulatedFace.cxx b/src/RWStepVisual/RWStepVisual_RWCubicBezierTriangulatedFace.cxx index 4cd7be5f92..f9b9fc1071 100644 --- a/src/RWStepVisual/RWStepVisual_RWCubicBezierTriangulatedFace.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCubicBezierTriangulatedFace.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -65,7 +67,7 @@ void RWStepVisual_RWCubicBezierTriangulatedFace::ReadStep( theData->ReadEntity(theNum, 2, "tessellated_face.coordinates", theCheck, STANDARD_TYPE(StepVisual_CoordinatesList), aTessellatedFace_Coordinates); - Standard_Integer aTessellatedFace_Pnmax; + Standard_Integer aTessellatedFace_Pnmax = 0; theData->ReadInteger(theNum, 3, "tessellated_face.pnmax", theCheck, aTessellatedFace_Pnmax); Handle(TColStd_HArray2OfReal) aTessellatedFace_Normals; @@ -82,7 +84,7 @@ void RWStepVisual_RWCubicBezierTriangulatedFace::ReadStep( Standard_Integer num4 = subj4; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; theData->ReadReal(num4, j0, "real", theCheck, anIt0); aTessellatedFace_Normals->SetValue(i0,j0, anIt0); } @@ -118,7 +120,7 @@ void RWStepVisual_RWCubicBezierTriangulatedFace::ReadStep( Standard_Integer num4 = subj6; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num4, j0, "integer", theCheck, anIt0); aCtriangles->SetValue(i0,j0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWCurveStyleFont.cxx b/src/RWStepVisual/RWStepVisual_RWCurveStyleFont.cxx index 65bb30dd30..0a5f8bc602 100644 --- a/src/RWStepVisual/RWStepVisual_RWCurveStyleFont.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCurveStyleFont.cxx @@ -45,7 +45,7 @@ void RWStepVisual_RWCurveStyleFont::ReadStep Handle(StepVisual_HArray1OfCurveStyleFontPattern) aPatternList; Handle(StepVisual_CurveStyleFontPattern) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"pattern_list",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aPatternList = new StepVisual_HArray1OfCurveStyleFontPattern (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWCurveStyleFontPattern.cxx b/src/RWStepVisual/RWStepVisual_RWCurveStyleFontPattern.cxx index f8a42c9049..ed793abe75 100644 --- a/src/RWStepVisual/RWStepVisual_RWCurveStyleFontPattern.cxx +++ b/src/RWStepVisual/RWStepVisual_RWCurveStyleFontPattern.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -33,13 +35,13 @@ void RWStepVisual_RWCurveStyleFontPattern::ReadStep // --- own field : visibleSegmentLength --- - Standard_Real aVisibleSegmentLength; + Standard_Real aVisibleSegmentLength = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed data->ReadReal (num,1,"visible_segment_length",ach,aVisibleSegmentLength); // --- own field : invisibleSegmentLength --- - Standard_Real aInvisibleSegmentLength; + Standard_Real aInvisibleSegmentLength = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadReal (num,2,"invisible_segment_length",ach,aInvisibleSegmentLength); diff --git a/src/RWStepVisual/RWStepVisual_RWDraughtingCallout.cxx b/src/RWStepVisual/RWStepVisual_RWDraughtingCallout.cxx index a5ebadd6d3..e37fedf28c 100644 --- a/src/RWStepVisual/RWStepVisual_RWDraughtingCallout.cxx +++ b/src/RWStepVisual/RWStepVisual_RWDraughtingCallout.cxx @@ -44,7 +44,7 @@ void RWStepVisual_RWDraughtingCallout::ReadStep(const Handle(StepData_StepReader // Own field: contents Handle(StepVisual_HArray1OfDraughtingCalloutElement) aContents; StepVisual_DraughtingCalloutElement anEnt; - Standard_Integer nbSub; + Standard_Integer nbSub = 0; if (data->ReadSubList (num, 2, "contents", ach, nbSub)) { Standard_Integer nbElements = data->NbParams(nbSub); aContents = new StepVisual_HArray1OfDraughtingCalloutElement (1, nbElements); @@ -86,7 +86,7 @@ void RWStepVisual_RWDraughtingCallout::Share (const Handle(StepVisual_Draughting Interface_EntityIterator& iter) const { // Own field: contents - Standard_Integer i, nb = ent->NbContents(); + Standard_Integer i = 0, nb = ent->NbContents(); for (i = 1; i <= nb; i++) iter.AddItem (ent->ContentsValue(i).Value()); } diff --git a/src/RWStepVisual/RWStepVisual_RWFillAreaStyle.cxx b/src/RWStepVisual/RWStepVisual_RWFillAreaStyle.cxx index d324b8387e..2d95322979 100644 --- a/src/RWStepVisual/RWStepVisual_RWFillAreaStyle.cxx +++ b/src/RWStepVisual/RWStepVisual_RWFillAreaStyle.cxx @@ -45,7 +45,7 @@ void RWStepVisual_RWFillAreaStyle::ReadStep Handle(StepVisual_HArray1OfFillStyleSelect) aFillStyles; StepVisual_FillStyleSelect aFillStylesItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"fill_styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aFillStyles = new StepVisual_HArray1OfFillStyleSelect (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWInvisibility.cxx b/src/RWStepVisual/RWStepVisual_RWInvisibility.cxx index 9fb550cc4d..4bcc95682d 100644 --- a/src/RWStepVisual/RWStepVisual_RWInvisibility.cxx +++ b/src/RWStepVisual/RWStepVisual_RWInvisibility.cxx @@ -38,7 +38,7 @@ void RWStepVisual_RWInvisibility::ReadStep Handle(StepVisual_HArray1OfInvisibleItem) aInvisibleItems; StepVisual_InvisibleItem aInvisibleItemsItem; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"invisible_items",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aInvisibleItems = new StepVisual_HArray1OfInvisibleItem (1, nb1); diff --git a/src/RWStepVisual/RWStepVisual_RWMechanicalDesignGeometricPresentationArea.cxx b/src/RWStepVisual/RWStepVisual_RWMechanicalDesignGeometricPresentationArea.cxx index 149a819e9a..62dd5e9e5d 100644 --- a/src/RWStepVisual/RWStepVisual_RWMechanicalDesignGeometricPresentationArea.cxx +++ b/src/RWStepVisual/RWStepVisual_RWMechanicalDesignGeometricPresentationArea.cxx @@ -44,7 +44,7 @@ void RWStepVisual_RWMechanicalDesignGeometricPresentationArea::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWMechanicalDesignGeometricPresentationRepresentation.cxx b/src/RWStepVisual/RWStepVisual_RWMechanicalDesignGeometricPresentationRepresentation.cxx index 57c695f590..9bf7715e3b 100644 --- a/src/RWStepVisual/RWStepVisual_RWMechanicalDesignGeometricPresentationRepresentation.cxx +++ b/src/RWStepVisual/RWStepVisual_RWMechanicalDesignGeometricPresentationRepresentation.cxx @@ -44,7 +44,7 @@ void RWStepVisual_RWMechanicalDesignGeometricPresentationRepresentation::ReadSte Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); if (nb2 > 0) aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWOverRidingStyledItem.cxx b/src/RWStepVisual/RWStepVisual_RWOverRidingStyledItem.cxx index 0d64196943..5ebc45b2cd 100644 --- a/src/RWStepVisual/RWStepVisual_RWOverRidingStyledItem.cxx +++ b/src/RWStepVisual/RWStepVisual_RWOverRidingStyledItem.cxx @@ -45,7 +45,7 @@ void RWStepVisual_RWOverRidingStyledItem::ReadStep Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWPlanarBox.cxx b/src/RWStepVisual/RWStepVisual_RWPlanarBox.cxx index 0893646eac..edfbe79100 100644 --- a/src/RWStepVisual/RWStepVisual_RWPlanarBox.cxx +++ b/src/RWStepVisual/RWStepVisual_RWPlanarBox.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -40,13 +42,13 @@ void RWStepVisual_RWPlanarBox::ReadStep // --- inherited field : sizeInX --- - Standard_Real aSizeInX; + Standard_Real aSizeInX = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadReal (num,2,"size_in_x",ach,aSizeInX); // --- inherited field : sizeInY --- - Standard_Real aSizeInY; + Standard_Real aSizeInY = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"size_in_y",ach,aSizeInY); diff --git a/src/RWStepVisual/RWStepVisual_RWPlanarExtent.cxx b/src/RWStepVisual/RWStepVisual_RWPlanarExtent.cxx index 4304d2feed..2caacec2a1 100644 --- a/src/RWStepVisual/RWStepVisual_RWPlanarExtent.cxx +++ b/src/RWStepVisual/RWStepVisual_RWPlanarExtent.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -39,13 +41,13 @@ void RWStepVisual_RWPlanarExtent::ReadStep // --- own field : sizeInX --- - Standard_Real aSizeInX; + Standard_Real aSizeInX = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed data->ReadReal (num,2,"size_in_x",ach,aSizeInX); // --- own field : sizeInY --- - Standard_Real aSizeInY; + Standard_Real aSizeInY = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"size_in_y",ach,aSizeInY); diff --git a/src/RWStepVisual/RWStepVisual_RWPresentationArea.cxx b/src/RWStepVisual/RWStepVisual_RWPresentationArea.cxx index 7b873799e7..078c6d96d6 100644 --- a/src/RWStepVisual/RWStepVisual_RWPresentationArea.cxx +++ b/src/RWStepVisual/RWStepVisual_RWPresentationArea.cxx @@ -44,7 +44,7 @@ void RWStepVisual_RWPresentationArea::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWPresentationLayerAssignment.cxx b/src/RWStepVisual/RWStepVisual_RWPresentationLayerAssignment.cxx index 9fa312bab1..03b6846b67 100644 --- a/src/RWStepVisual/RWStepVisual_RWPresentationLayerAssignment.cxx +++ b/src/RWStepVisual/RWStepVisual_RWPresentationLayerAssignment.cxx @@ -49,7 +49,7 @@ void RWStepVisual_RWPresentationLayerAssignment::ReadStep Handle(StepVisual_HArray1OfLayeredItem) aAssignedItems; StepVisual_LayeredItem aAssignedItemsItem; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (num,3,"assigned_items",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); if (nb3 > 0) diff --git a/src/RWStepVisual/RWStepVisual_RWPresentationRepresentation.cxx b/src/RWStepVisual/RWStepVisual_RWPresentationRepresentation.cxx index 361bc6dd97..844a9a4bcb 100644 --- a/src/RWStepVisual/RWStepVisual_RWPresentationRepresentation.cxx +++ b/src/RWStepVisual/RWStepVisual_RWPresentationRepresentation.cxx @@ -44,7 +44,7 @@ void RWStepVisual_RWPresentationRepresentation::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWPresentationStyleAssignment.cxx b/src/RWStepVisual/RWStepVisual_RWPresentationStyleAssignment.cxx index 9f650ae649..08805ba34a 100644 --- a/src/RWStepVisual/RWStepVisual_RWPresentationStyleAssignment.cxx +++ b/src/RWStepVisual/RWStepVisual_RWPresentationStyleAssignment.cxx @@ -39,7 +39,7 @@ void RWStepVisual_RWPresentationStyleAssignment::ReadStep Handle(StepVisual_HArray1OfPresentationStyleSelect) aStyles; StepVisual_PresentationStyleSelect aStylesItem; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"styles",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aStyles = new StepVisual_HArray1OfPresentationStyleSelect (1, nb1); diff --git a/src/RWStepVisual/RWStepVisual_RWPresentationStyleByContext.cxx b/src/RWStepVisual/RWStepVisual_RWPresentationStyleByContext.cxx index 5da048e6cc..d376f26e3d 100644 --- a/src/RWStepVisual/RWStepVisual_RWPresentationStyleByContext.cxx +++ b/src/RWStepVisual/RWStepVisual_RWPresentationStyleByContext.cxx @@ -40,7 +40,7 @@ void RWStepVisual_RWPresentationStyleByContext::ReadStep Handle(StepVisual_HArray1OfPresentationStyleSelect) aStyles; StepVisual_PresentationStyleSelect aStylesItem; - Standard_Integer nsub1; + Standard_Integer nsub1 = 0; if (data->ReadSubList (num,1,"styles",ach,nsub1)) { Standard_Integer nb1 = data->NbParams(nsub1); aStyles = new StepVisual_HArray1OfPresentationStyleSelect (1, nb1); diff --git a/src/RWStepVisual/RWStepVisual_RWPresentationView.cxx b/src/RWStepVisual/RWStepVisual_RWPresentationView.cxx index 1b94232775..9082931f80 100644 --- a/src/RWStepVisual/RWStepVisual_RWPresentationView.cxx +++ b/src/RWStepVisual/RWStepVisual_RWPresentationView.cxx @@ -44,7 +44,7 @@ void RWStepVisual_RWPresentationView::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx b/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx index 6f173e8a19..ef9666819e 100644 --- a/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx +++ b/src/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx @@ -48,7 +48,7 @@ void RWStepVisual_RWRepositionedTessellatedGeometricSet::ReadStep theData->NamedForComplex("TESSELLATED_GEOMETRIC_SET", theNum, aNum, theAch); NCollection_Handle anItems; - Standard_Integer aNSub2; + Standard_Integer aNSub2 = 0; if (theData->ReadSubList (aNum,1,"items",theAch,aNSub2)) { Standard_Integer aNb2 = theData->NbParams(aNSub2); anItems = new StepVisual_Array1OfTessellatedItem(1, aNb2); diff --git a/src/RWStepVisual/RWStepVisual_RWStyledItem.cxx b/src/RWStepVisual/RWStepVisual_RWStyledItem.cxx index 8548408906..2dee26d8b5 100644 --- a/src/RWStepVisual/RWStepVisual_RWStyledItem.cxx +++ b/src/RWStepVisual/RWStepVisual_RWStyledItem.cxx @@ -43,7 +43,7 @@ void RWStepVisual_RWStyledItem::ReadStep Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWSurfaceSideStyle.cxx b/src/RWStepVisual/RWStepVisual_RWSurfaceSideStyle.cxx index 85853902c9..8cad16f942 100644 --- a/src/RWStepVisual/RWStepVisual_RWSurfaceSideStyle.cxx +++ b/src/RWStepVisual/RWStepVisual_RWSurfaceSideStyle.cxx @@ -44,7 +44,7 @@ void RWStepVisual_RWSurfaceSideStyle::ReadStep Handle(StepVisual_HArray1OfSurfaceStyleElementSelect) aStyles; StepVisual_SurfaceStyleElementSelect aStylesItem; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aStyles = new StepVisual_HArray1OfSurfaceStyleElementSelect (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWSurfaceStyleParameterLine.cxx b/src/RWStepVisual/RWStepVisual_RWSurfaceStyleParameterLine.cxx index 4c5c323ddb..e2c43b86e6 100644 --- a/src/RWStepVisual/RWStepVisual_RWSurfaceStyleParameterLine.cxx +++ b/src/RWStepVisual/RWStepVisual_RWSurfaceStyleParameterLine.cxx @@ -47,16 +47,16 @@ void RWStepVisual_RWSurfaceStyleParameterLine::ReadStep // Par consequent, on doit trouver dans le fichier : // ... , (U_DIRECTION_COUNT(10), V_DIRECTION_COUNT(1)) ); - Standard_Integer numr, numpr; + Standard_Integer numr = 0, numpr = 0; TCollection_AsciiString UType("U_DIRECTION_COUNT"); TCollection_AsciiString VType("V_DIRECTION_COUNT"); TCollection_AsciiString TrueType; Handle(StepVisual_HArray1OfDirectionCountSelect) aDirectionCounts; - Standard_Integer aDirectionCountsItem; + Standard_Integer aDirectionCountsItem = 0; StepVisual_DirectionCountSelect aDirectionCountSelect; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"direction_counts",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aDirectionCounts = new StepVisual_HArray1OfDirectionCountSelect(1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWSurfaceStyleReflectanceAmbient.cxx b/src/RWStepVisual/RWStepVisual_RWSurfaceStyleReflectanceAmbient.cxx index 94f5b75358..77815d313c 100644 --- a/src/RWStepVisual/RWStepVisual_RWSurfaceStyleReflectanceAmbient.cxx +++ b/src/RWStepVisual/RWStepVisual_RWSurfaceStyleReflectanceAmbient.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -44,7 +46,7 @@ void RWStepVisual_RWSurfaceStyleReflectanceAmbient::ReadStep (const Handle(StepD // Own fields of SurfaceStyleReflectanceAmbient - Standard_Real aAmbientReflectance; + Standard_Real aAmbientReflectance = NAN; data->ReadReal (num, 1, "ambient_reflectance", ach, aAmbientReflectance); // Initialize entity diff --git a/src/RWStepVisual/RWStepVisual_RWSurfaceStyleTransparent.cxx b/src/RWStepVisual/RWStepVisual_RWSurfaceStyleTransparent.cxx index 30ca3fa32f..d9ccdc76ca 100644 --- a/src/RWStepVisual/RWStepVisual_RWSurfaceStyleTransparent.cxx +++ b/src/RWStepVisual/RWStepVisual_RWSurfaceStyleTransparent.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -44,7 +46,7 @@ void RWStepVisual_RWSurfaceStyleTransparent::ReadStep (const Handle(StepData_Ste // Own fields of SurfaceStyleTransparent - Standard_Real aTransparency; + Standard_Real aTransparency = NAN; data->ReadReal (num, 1, "transparency", ach, aTransparency); // Initialize entity diff --git a/src/RWStepVisual/RWStepVisual_RWTemplate.cxx b/src/RWStepVisual/RWStepVisual_RWTemplate.cxx index 0f86f7cd08..2c8805a0d9 100644 --- a/src/RWStepVisual/RWStepVisual_RWTemplate.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTemplate.cxx @@ -44,7 +44,7 @@ void RWStepVisual_RWTemplate::ReadStep Handle(StepRepr_HArray1OfRepresentationItem) aItems; Handle(StepRepr_RepresentationItem) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aItems = new StepRepr_HArray1OfRepresentationItem (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.cxx index 662bde0ae4..8f50cec49e 100644 --- a/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedAnnotationOccurrence.cxx @@ -47,7 +47,7 @@ void RWStepVisual_RWTessellatedAnnotationOccurrence::ReadStep // Inherited field : styles Handle(StepVisual_HArray1OfPresentationStyleAssignment) aStyles; Handle(StepVisual_PresentationStyleAssignment) anent2; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"styles",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); aStyles = new StepVisual_HArray1OfPresentationStyleAssignment (1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedConnectingEdge.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedConnectingEdge.cxx index ccf65f3995..390c66778f 100644 --- a/src/RWStepVisual/RWStepVisual_RWTessellatedConnectingEdge.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedConnectingEdge.cxx @@ -84,7 +84,7 @@ void RWStepVisual_RWTessellatedConnectingEdge::ReadStep( Standard_Integer num2 = sub4; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aTessellatedEdge_LineStrip->SetValue(i0, anIt0); } @@ -112,7 +112,7 @@ void RWStepVisual_RWTessellatedConnectingEdge::ReadStep( Standard_Integer num2 = sub8; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aLineStripFace1->SetValue(i0, anIt0); } @@ -127,7 +127,7 @@ void RWStepVisual_RWTessellatedConnectingEdge::ReadStep( Standard_Integer num2 = sub9; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aLineStripFace2->SetValue(i0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx index 520dfcc727..8b199724ea 100644 --- a/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx @@ -49,7 +49,7 @@ void RWStepVisual_RWTessellatedCurveSet::ReadStep Handle(StepVisual_CoordinatesList) aCoordList; data->ReadEntity (num, 2,"coord_list",ach,STANDARD_TYPE(StepVisual_CoordinatesList), aCoordList); //--- Initialisation of the read entity --- - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; NCollection_Handle aCurves = new StepVisual_VectorOfHSequenceOfInteger; if (data->ReadSubList (num,3,"curves",ach,nsub2)) { @@ -60,7 +60,7 @@ void RWStepVisual_RWTessellatedCurveSet::ReadStep for (Standard_Integer i = 1; i <= nb2; i++) { Handle(TColStd_HSequenceOfInteger) aCurve = new TColStd_HSequenceOfInteger; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; if (data->ReadSubList (nsub2,i,"number_coordinates",ach,nsub3)) { Standard_Integer nb3 = data->NbParams(nsub3); for (Standard_Integer j = 1; j <= nb3; j++) { diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedEdge.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedEdge.cxx index 0723e7c997..4f9b7d0f46 100644 --- a/src/RWStepVisual/RWStepVisual_RWTessellatedEdge.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedEdge.cxx @@ -81,7 +81,7 @@ void RWStepVisual_RWTessellatedEdge::ReadStep (const Handle(StepData_StepReaderD Standard_Integer num2 = sub4; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aLineStrip->SetValue(i0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.cxx index dc17e2cd37..9d4f4a91e0 100644 --- a/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedGeometricSet.cxx @@ -46,7 +46,7 @@ void RWStepVisual_RWTessellatedGeometricSet::ReadStep data->ReadString (num, 1, "name", ach, aName); NCollection_Handle anItems; - Standard_Integer nsub2; + Standard_Integer nsub2 = 0; if (data->ReadSubList (num,2,"items",ach,nsub2)) { Standard_Integer nb2 = data->NbParams(nsub2); anItems = new StepVisual_Array1OfTessellatedItem(1, nb2); diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedPointSet.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedPointSet.cxx index 6070e25aac..3755bdee5f 100644 --- a/src/RWStepVisual/RWStepVisual_RWTessellatedPointSet.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedPointSet.cxx @@ -68,7 +68,7 @@ void RWStepVisual_RWTessellatedPointSet::ReadStep (const Handle(StepData_StepRea Standard_Integer num2 = sub3; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aPointList->SetValue(i0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedShapeRepresentationWithAccuracyParameters.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedShapeRepresentationWithAccuracyParameters.cxx index e5f669c2e6..3bdc14fcb0 100644 --- a/src/RWStepVisual/RWStepVisual_RWTessellatedShapeRepresentationWithAccuracyParameters.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedShapeRepresentationWithAccuracyParameters.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -85,7 +87,7 @@ void RWStepVisual_RWTessellatedShapeRepresentationWithAccuracyParameters::ReadSt Standard_Integer num2 = sub4; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; theData->ReadReal(num2, i0, "tessellation_accuracy_parameter_item", theCheck, anIt0); aTessellationAccuracyParameters->SetValue(i0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWTessellatedVertex.cxx b/src/RWStepVisual/RWStepVisual_RWTessellatedVertex.cxx index 6c651afd60..e957501c82 100644 --- a/src/RWStepVisual/RWStepVisual_RWTessellatedVertex.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTessellatedVertex.cxx @@ -72,7 +72,7 @@ void RWStepVisual_RWTessellatedVertex::ReadStep (const Handle(StepData_StepReade aTopologicalLink.Nullify(); } - Standard_Integer aPointIndex; + Standard_Integer aPointIndex = 0; theData->ReadInteger(theNum, 4, "point_index", theCheck, aPointIndex); // Initialize entity diff --git a/src/RWStepVisual/RWStepVisual_RWTextStyleWithBoxCharacteristics.cxx b/src/RWStepVisual/RWStepVisual_RWTextStyleWithBoxCharacteristics.cxx index da3039aa2b..890b2e5745 100644 --- a/src/RWStepVisual/RWStepVisual_RWTextStyleWithBoxCharacteristics.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTextStyleWithBoxCharacteristics.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -50,7 +52,7 @@ void RWStepVisual_RWTextStyleWithBoxCharacteristics::ReadStep // --- own field : characteristics --- - Standard_Integer numr, numpr; + Standard_Integer numr = 0, numpr = 0; TCollection_AsciiString TypeHeigth("BOX_HEIGHT"); TCollection_AsciiString TypeWidth("BOX_WIDTH"); TCollection_AsciiString TypeSlant("BOX_SLANT_ANGLE"); @@ -58,10 +60,10 @@ void RWStepVisual_RWTextStyleWithBoxCharacteristics::ReadStep TCollection_AsciiString TrueType; Handle(StepVisual_HArray1OfBoxCharacteristicSelect) aCharacteristics; - Standard_Real aCharacteristicsItem; + Standard_Real aCharacteristicsItem = NAN; StepVisual_BoxCharacteristicSelect aBoxCharacteristicSelect; - Standard_Integer nsub3; + Standard_Integer nsub3 = 0; nsub3 = data->SubListNumber(num, 3, Standard_False); if (nsub3 !=0) { Standard_Integer nb3 = data->NbParams(nsub3); diff --git a/src/RWStepVisual/RWStepVisual_RWTriangulatedFace.cxx b/src/RWStepVisual/RWStepVisual_RWTriangulatedFace.cxx index c8acb6a064..e2aa5febd6 100644 --- a/src/RWStepVisual/RWStepVisual_RWTriangulatedFace.cxx +++ b/src/RWStepVisual/RWStepVisual_RWTriangulatedFace.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -64,7 +66,7 @@ void RWStepVisual_RWTriangulatedFace::ReadStep (const Handle(StepData_StepReader theData->ReadEntity(theNum, 2, "tessellated_face.coordinates", theCheck, STANDARD_TYPE(StepVisual_CoordinatesList), aTessellatedFace_Coordinates); - Standard_Integer aTessellatedFace_Pnmax; + Standard_Integer aTessellatedFace_Pnmax = 0; theData->ReadInteger(theNum, 3, "tessellated_face.pnmax", theCheck, aTessellatedFace_Pnmax); Handle(TColStd_HArray2OfReal) aTessellatedFace_Normals; @@ -81,7 +83,7 @@ void RWStepVisual_RWTriangulatedFace::ReadStep (const Handle(StepData_StepReader Standard_Integer num4 = subj4; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Real anIt0; + Standard_Real anIt0 = NAN; theData->ReadReal(num4, j0, "real", theCheck, anIt0); aTessellatedFace_Normals->SetValue(i0,j0, anIt0); } @@ -112,7 +114,7 @@ void RWStepVisual_RWTriangulatedFace::ReadStep (const Handle(StepData_StepReader Standard_Integer num2 = sub6; for (Standard_Integer i0 = 1; i0 <= nb0; i0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num2, i0, "integer", theCheck, anIt0); aPnindex->SetValue(i0, anIt0); } @@ -132,7 +134,7 @@ void RWStepVisual_RWTriangulatedFace::ReadStep (const Handle(StepData_StepReader Standard_Integer num4 = subj7; for (Standard_Integer j0 = 1; j0 <= nbj0; j0++) { - Standard_Integer anIt0; + Standard_Integer anIt0 = 0; theData->ReadInteger(num4, j0, "integer", theCheck, anIt0); aTriangles->SetValue(i0,j0, anIt0); } diff --git a/src/RWStepVisual/RWStepVisual_RWViewVolume.cxx b/src/RWStepVisual/RWStepVisual_RWViewVolume.cxx index 6dd227ef26..0922966598 100644 --- a/src/RWStepVisual/RWStepVisual_RWViewVolume.cxx +++ b/src/RWStepVisual/RWStepVisual_RWViewVolume.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -58,37 +60,37 @@ void RWStepVisual_RWViewVolume::ReadStep // --- own field : viewPlaneDistance --- - Standard_Real aViewPlaneDistance; + Standard_Real aViewPlaneDistance = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed data->ReadReal (num,3,"view_plane_distance",ach,aViewPlaneDistance); // --- own field : frontPlaneDistance --- - Standard_Real aFrontPlaneDistance; + Standard_Real aFrontPlaneDistance = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed data->ReadReal (num,4,"front_plane_distance",ach,aFrontPlaneDistance); // --- own field : frontPlaneClipping --- - Standard_Boolean aFrontPlaneClipping; + Standard_Boolean aFrontPlaneClipping = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed data->ReadBoolean (num,5,"front_plane_clipping",ach,aFrontPlaneClipping); // --- own field : backPlaneDistance --- - Standard_Real aBackPlaneDistance; + Standard_Real aBackPlaneDistance = NAN; //szv#4:S4163:12Mar99 `Standard_Boolean stat6 =` not needed data->ReadReal (num,6,"back_plane_distance",ach,aBackPlaneDistance); // --- own field : backPlaneClipping --- - Standard_Boolean aBackPlaneClipping; + Standard_Boolean aBackPlaneClipping = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat7 =` not needed data->ReadBoolean (num,7,"back_plane_clipping",ach,aBackPlaneClipping); // --- own field : viewVolumeSidesClipping --- - Standard_Boolean aViewVolumeSidesClipping; + Standard_Boolean aViewVolumeSidesClipping = 0; //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed data->ReadBoolean (num,8,"view_volume_sides_clipping",ach,aViewVolumeSidesClipping); diff --git a/src/Resource/Resource_Manager.cxx b/src/Resource/Resource_Manager.cxx index e773d624d6..c842433359 100644 --- a/src/Resource/Resource_Manager.cxx +++ b/src/Resource/Resource_Manager.cxx @@ -187,7 +187,7 @@ static Resource_KindOfLine WhatKindOfLine(OSD_File& aFile, TCollection_AsciiString& aToken2) { TCollection_AsciiString WhiteSpace = " \t" ; - Standard_Integer Pos1,Pos2,Pos ; + Standard_Integer Pos1 = 0,Pos2 = 0,Pos = 0 ; TCollection_AsciiString Line ; if (!GetLine(aFile,Line)) @@ -247,7 +247,7 @@ static Standard_Integer GetLine(OSD_File& aFile,TCollection_AsciiString& aLine) { TCollection_AsciiString Buffer; Standard_Integer BufSize = 10; - Standard_Integer Len; + Standard_Integer Len = 0; aLine.Clear(); do { @@ -340,7 +340,7 @@ Standard_Boolean Resource_Manager::Save() const TColStd_Array1OfAsciiString KeyArray(1,NbKey); Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString Iter(myUserMap); - Standard_Integer Index; + Standard_Integer Index = 0; for ( Index = 1; Iter.More(); Iter.Next()) KeyArray(Index++)= Iter.Key(); @@ -470,7 +470,7 @@ void Resource_Manager::SetResource(const Standard_CString aResourceName, void Resource_Manager::SetResource(const Standard_CString aResource, const Standard_ExtString aValue) { - Standard_PCharacter pStr; + Standard_PCharacter pStr = nullptr; TCollection_AsciiString Resource = aResource; TCollection_ExtendedString ExtValue = aValue; TCollection_AsciiString FormatStr(ExtValue.Length()*3+10, ' '); diff --git a/src/Resource/Resource_Unicode.cxx b/src/Resource/Resource_Unicode.cxx index 827a32e9ac..b362541578 100644 --- a/src/Resource/Resource_Unicode.cxx +++ b/src/Resource/Resource_Unicode.cxx @@ -42,7 +42,7 @@ void Resource_Unicode::ConvertSJISToUnicode(const Standard_CString fromstr,TColl tostr.Clear(); unsigned char* currentstr = ((unsigned char*) fromstr); - unsigned int pl,ph; + unsigned int pl = 0,ph = 0; // BIG INDIAN USED HERE while(*currentstr != '\0') { if (issjis1(*currentstr)) { @@ -74,7 +74,7 @@ void Resource_Unicode::ConvertEUCToUnicode(const Standard_CString fromstr,TColle tostr.Clear(); unsigned char* currentstr = ((unsigned char*) fromstr); - unsigned int pl,ph; + unsigned int pl = 0,ph = 0; // BIG INDIAN USED HERE while(*currentstr != '\0') { if (iseuc(*currentstr)) { @@ -105,7 +105,7 @@ void Resource_Unicode::ConvertGBToUnicode(const Standard_CString fromstr,TCollec tostr.Clear(); unsigned char* currentstr = ((unsigned char*) fromstr); - unsigned int pl,ph; + unsigned int pl = 0,ph = 0; // BIG INDIAN USED HERE while(*currentstr != '\0') { if (isshift(*currentstr)) { @@ -364,8 +364,8 @@ Standard_Boolean Resource_Unicode::ConvertUnicodeToSJIS(const TCollection_Extend Standard_Integer nbtrans = 0; Standard_Integer nbext = 1; Standard_Boolean finished = Standard_False; - Standard_ExtCharacter curcar; - unsigned int pl,ph; + Standard_ExtCharacter curcar = 0; + unsigned int pl = 0,ph = 0; // BIG INDIAN USED HERE while (!finished) { @@ -413,8 +413,8 @@ Standard_Boolean Resource_Unicode::ConvertUnicodeToEUC(const TCollection_Extende Standard_Integer nbtrans = 0; Standard_Integer nbext = 1; Standard_Boolean finished = Standard_False; - Standard_ExtCharacter curcar; - unsigned int pl,ph; + Standard_ExtCharacter curcar = 0; + unsigned int pl = 0,ph = 0; // BIG INDIAN USED HERE while (!finished) { @@ -462,8 +462,8 @@ Standard_Boolean Resource_Unicode::ConvertUnicodeToGB(const TCollection_Extended Standard_Integer nbtrans = 0; Standard_Integer nbext = 1; Standard_Boolean finished = Standard_False; - Standard_ExtCharacter curcar; - unsigned int pl,ph; + Standard_ExtCharacter curcar = 0; + unsigned int pl = 0,ph = 0; // BIG INDIAN USED HERE while (!finished) { @@ -511,8 +511,8 @@ Standard_Boolean Resource_Unicode::ConvertUnicodeToANSI(const TCollection_Extend Standard_Integer nbtrans = 0; Standard_Integer nbext = 1; Standard_Boolean finished = Standard_False; - Standard_ExtCharacter curcar; - unsigned int pl,ph; + Standard_ExtCharacter curcar = 0; + unsigned int pl = 0,ph = 0; // BIG INDIAN USED HERE while (!finished) { diff --git a/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx b/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx index 86da09c35a..26c4d7c38f 100644 --- a/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx +++ b/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx @@ -192,7 +192,7 @@ void STEPCAFControl_GDTProperty::GetDimClassOfTolerance(const Handle(StepShape_L Handle(TCollection_HAsciiString) aFormV = theLAF->FormVariance(); Handle(TCollection_HAsciiString) aGrade = theLAF->Grade(); theFV = XCAFDimTolObjects_DimensionFormVariance_None; - Standard_Boolean aFound; + Standard_Boolean aFound = 0; theHolle = Standard_False; //it is not verified information for(Standard_Integer c = 0; c <= 1 && !aFormV.IsNull(); c++) @@ -1166,7 +1166,7 @@ Handle(StepDimTol_HArray1OfDatumReferenceModifier) STEPCAFControl_GDTProperty:: GetDatumRefModifiers(const XCAFDimTolObjects_DatumModifiersSequence& theModifiers, const XCAFDimTolObjects_DatumModifWithValue& theModifWithVal, const Standard_Real theValue, - const StepBasic_Unit theUnit) + const StepBasic_Unit& theUnit) { if ((theModifiers.Length() == 0) && (theModifWithVal == XCAFDimTolObjects_DatumModifWithValue_None)) return NULL; @@ -1307,7 +1307,7 @@ Handle(TCollection_HAsciiString) STEPCAFControl_GDTProperty::GetTolValueType(con //function : GetTessellation //purpose : //======================================================================= -Handle(StepVisual_TessellatedGeometricSet) STEPCAFControl_GDTProperty::GetTessellation(const TopoDS_Shape theShape) +Handle(StepVisual_TessellatedGeometricSet) STEPCAFControl_GDTProperty::GetTessellation(const TopoDS_Shape& theShape) { // Build coordinate list and curves NCollection_Handle aCurves = new StepVisual_VectorOfHSequenceOfInteger; diff --git a/src/STEPCAFControl/STEPCAFControl_GDTProperty.hxx b/src/STEPCAFControl/STEPCAFControl_GDTProperty.hxx index 03631c61ca..c685b39edc 100644 --- a/src/STEPCAFControl/STEPCAFControl_GDTProperty.hxx +++ b/src/STEPCAFControl/STEPCAFControl_GDTProperty.hxx @@ -99,9 +99,9 @@ public: Standard_EXPORT static Handle(StepDimTol_HArray1OfDatumReferenceModifier) GetDatumRefModifiers(const XCAFDimTolObjects_DatumModifiersSequence& theModifiers, const XCAFDimTolObjects_DatumModifWithValue& theModifWithVal, const Standard_Real theValue, - const StepBasic_Unit theUnit); + const StepBasic_Unit& theUnit); - Standard_EXPORT static Handle(StepVisual_TessellatedGeometricSet) GetTessellation(const TopoDS_Shape theShape); + Standard_EXPORT static Handle(StepVisual_TessellatedGeometricSet) GetTessellation(const TopoDS_Shape& theShape); }; diff --git a/src/STEPCAFControl/STEPCAFControl_Provider.cxx b/src/STEPCAFControl/STEPCAFControl_Provider.cxx index c7078c397b..6eb2db9feb 100644 --- a/src/STEPCAFControl/STEPCAFControl_Provider.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Provider.cxx @@ -99,7 +99,7 @@ void STEPCAFControl_Provider::initStatic(const Handle(DE_ConfigurationNode)& the // function : setStatic // purpose : //======================================================================= -void STEPCAFControl_Provider::setStatic(const STEPCAFControl_ConfigurationNode::STEPCAFControl_InternalSection theParameter) +void STEPCAFControl_Provider::setStatic(const STEPCAFControl_ConfigurationNode::STEPCAFControl_InternalSection& theParameter) { Interface_Static::SetIVal("read.iges.bspline.continuity", theParameter.ReadBSplineContinuity); Interface_Static::SetIVal("read.precision.mode", theParameter.ReadPrecisionMode); diff --git a/src/STEPCAFControl/STEPCAFControl_Provider.hxx b/src/STEPCAFControl/STEPCAFControl_Provider.hxx index fb468efafa..d7774028b1 100644 --- a/src/STEPCAFControl/STEPCAFControl_Provider.hxx +++ b/src/STEPCAFControl/STEPCAFControl_Provider.hxx @@ -139,7 +139,7 @@ public: void initStatic(const Handle(DE_ConfigurationNode)& theNode); //! Initialize static variables - void setStatic(const STEPCAFControl_ConfigurationNode::STEPCAFControl_InternalSection theParameter); + void setStatic(const STEPCAFControl_ConfigurationNode::STEPCAFControl_InternalSection& theParameter); //! Reset used interface static variables void resetStatic(); diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx index cae2a1bf28..3b5e43eaa7 100644 --- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -527,7 +529,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader, reader.ClearShapes(); Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(reader.Model()); prepareUnits(aModel, doc); - Standard_Integer i; + Standard_Integer i = 0; // Read all shapes Standard_Integer num = reader.NbRootsForTransfer(); @@ -781,7 +783,7 @@ TDF_Label STEPCAFControl_Reader::AddShape(const TopoDS_Shape &S, // check whether it has associated external ref TColStd_SequenceOfHAsciiString SHAS; if (ShapePDMap.IsBound(S) && PDFileMap.IsBound(ShapePDMap.Find(S))) { - Handle(STEPCAFControl_ExternFile) EF = PDFileMap.Find(ShapePDMap.Find(S)); + const Handle(STEPCAFControl_ExternFile)& EF = PDFileMap.Find(ShapePDMap.Find(S)); if (!EF.IsNull()) { // (store information on extern refs in the document) SHAS.Append(EF->GetName()); @@ -955,7 +957,7 @@ static void SetAssemblyComponentStyle(const Handle(Transfer_TransientProcess) &t if (theStyle.IsNull()) return; Handle(StepVisual_Colour) aSurfCol, aBoundCol, aCurveCol, aRenderCol; - Standard_Real aRenderTransp; + Standard_Real aRenderTransp = NAN; // check if it is component style Standard_Boolean anIsComponent = Standard_False; if (!theStyles.GetColors(theStyle, aSurfCol, aBoundCol, aCurveCol, aRenderCol, aRenderTransp, anIsComponent)) @@ -977,7 +979,7 @@ static void SetAssemblyComponentStyle(const Handle(Transfer_TransientProcess) &t { // NB: C cast is used instead of DownCast() to improve performance on some cases. // This saves ~10% of elapsed time on "testgrid perf de bug29* -parallel 0". - aSRR = (StepRepr_ShapeRepresentationRelationship*)(aSubsVal.get()); + aSRR = dynamic_cast(aSubsVal.get()); } } @@ -1081,7 +1083,7 @@ static void SetStyle(const Handle(XSControl_WorkSession) &theWS, break; } Handle(StepVisual_Colour) aSurfCol, aBoundCol, aCurveCol, aRenderCol; - Standard_Real aRenderTransp; + Standard_Real aRenderTransp = NAN; // check if it is component style Standard_Boolean anIsComponent = Standard_False; if (!theStyles.GetColors(theStyle, aSurfCol, aBoundCol, aCurveCol, aRenderCol, aRenderTransp, anIsComponent) && anIsVisible) @@ -1315,7 +1317,7 @@ static TDF_Label GetLabelFromPD(const Handle(StepBasic_ProductDefinition) &PD, { TDF_Label L; if (PDFileMap.IsBound(PD)) { - Handle(STEPCAFControl_ExternFile) EF = PDFileMap.Find(PD); + const Handle(STEPCAFControl_ExternFile)& EF = PDFileMap.Find(PD); if (!EF.IsNull()) { L = EF->GetLabel(); if (!L.IsNull()) return L; @@ -1348,7 +1350,7 @@ TDF_Label STEPCAFControl_Reader::FindInstance(const Handle(StepRepr_NextAssembly TDF_Label L; // get shape resulting from CDSR (in fact, only location is interesting) - Handle(Transfer_TransientProcess) TP = Tool.TransientProcess(); + const Handle(Transfer_TransientProcess)& TP = Tool.TransientProcess(); Handle(Transfer_Binder) binder = TP->Find(NAUO); if (binder.IsNull() || !binder->HasResult()) { #ifdef OCCT_DEBUG @@ -1468,7 +1470,7 @@ static TDF_Label GetLabelFromPD(const Handle(StepBasic_ProductDefinition) &PD, { TDF_Label L; if (PDFileMap.IsBound(PD)) { - Handle(STEPCAFControl_ExternFile) EF = PDFileMap.Find(PD); + const Handle(STEPCAFControl_ExternFile)& EF = PDFileMap.Find(PD); if (!EF.IsNull()) { L = EF->GetLabel(); if (!L.IsNull()) return L; @@ -1600,8 +1602,8 @@ Standard_Boolean STEPCAFControl_Reader::ReadValProps(const Handle(XSControl_Work Handle(StepRepr_Representation) rep = PDR->UsedRepresentation(); for (Standard_Integer j = 1; j <= rep->NbItems(); j++) { Handle(StepRepr_RepresentationItem) ent = rep->ItemsValue(j); - Standard_Boolean isArea; - Standard_Real val; + Standard_Boolean isArea = 0; + Standard_Real val = NAN; gp_Pnt pos; if (Props.GetPropReal(ent, val, isArea)) { if (isArea) XCAFDoc_Area::Set(L, val); @@ -1830,7 +1832,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs(const Handle(XSControl_WorkSes } Handle(StepVisual_Colour) SurfCol, BoundCol, CurveCol, RenderCol; - Standard_Real RenderTransp; + Standard_Real RenderTransp = NAN; // check if it is component style Standard_Boolean IsComponent = Standard_False; if (!Styles.GetColors(style, SurfCol, BoundCol, CurveCol, RenderCol, RenderTransp, IsComponent) && IsVisible) @@ -2093,7 +2095,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen //function : readAnnotationPlane //purpose : read annotation plane //======================================================================= -Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane) theAnnotationPlane, +Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& theAnnotationPlane, gp_Ax2& thePlane) { if (theAnnotationPlane.IsNull()) @@ -2199,7 +2201,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR, // else set the center of bounding box to text position 0027372 if (!aBox.IsVoid()) { - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); if (isHasPlane && !aBox.IsOut(aPlaneAxes.Location())) { aPtext = aPlaneAxes.Location(); @@ -2239,7 +2241,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR, //purpose : read connection points for given dimension //======================================================================= void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR, - const Handle(Standard_Transient) theGDT, + const Handle(Standard_Transient)& theGDT, const Handle(XCAFDimTolObjects_DimensionObject)& theDimObject) { if (theGDT.IsNull() || theDimObject.IsNull()) @@ -2252,7 +2254,7 @@ void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR, Handle(StepShape_ShapeDimensionRepresentation) aSDR = NULL; for (Interface_EntityIterator anIt = aGraph.Sharings(theGDT); aSDR.IsNull() && anIt.More(); anIt.Next()) { - Handle(Standard_Transient) anEnt = anIt.Value(); + const Handle(Standard_Transient)& anEnt = anIt.Value(); Handle(StepShape_DimensionalCharacteristicRepresentation) aDCR = Handle(StepShape_DimensionalCharacteristicRepresentation)::DownCast(anEnt); if (!aDCR.IsNull()) @@ -2355,7 +2357,7 @@ static Standard_Boolean ReadDatums(const Handle(XCAFDoc_ShapeTool) &STool, const Interface_Graph &graph, const Handle(Transfer_TransientProcess) &TP, const TDF_Label TolerL, - const Handle(StepDimTol_GeometricToleranceWithDatumReference) GTWDR) + const Handle(StepDimTol_GeometricToleranceWithDatumReference)& GTWDR) { if (GTWDR.IsNull()) return Standard_False; Handle(StepDimTol_HArray1OfDatumReference) HADR = GTWDR->DatumSystem(); @@ -2772,14 +2774,14 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr Interface_EntityIterator anIter = aGraph.Shareds(theEnt); for (anIter.Start(); anIter.More(); anIter.Next()) { - Handle(Standard_Transient) anAtr = anIter.Value(); + const Handle(Standard_Transient)& anAtr = anIter.Value(); if (anAtr->IsKind(STANDARD_TYPE(StepDimTol_DatumSystem))) { Standard_Integer aPositionCounter = 0;//position on frame Handle(StepDimTol_DatumSystem) aDS = Handle(StepDimTol_DatumSystem)::DownCast(anAtr); Interface_EntityIterator anIterDS = aGraph.Sharings(aDS); for (anIterDS.Start(); anIterDS.More(); anIterDS.Next()) { - Handle(Standard_Transient) anAtrDS = anIterDS.Value(); + const Handle(Standard_Transient)& anAtrDS = anIterDS.Value(); if (anAtrDS->IsKind(STANDARD_TYPE(StepAP242_GeometricItemSpecificUsage))) { //get axis @@ -2957,7 +2959,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra // Collect all Shape_Aspect entities Interface_EntityIterator anIter = aGraph.Shareds(theEnt); for (anIter.Start(); anIter.More(); anIter.Next()) { - Handle(Standard_Transient) anAtr = anIter.Value(); + const Handle(Standard_Transient)& anAtr = anIter.Value(); NCollection_Sequence aSAs; if (anAtr->IsKind(STANDARD_TYPE(StepRepr_ProductDefinitionShape))) { @@ -2965,14 +2967,14 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra Interface_EntityIterator anIterSDR = aGraph.Sharings(anAtr); for (anIterSDR.Start(); anIterSDR.More(); anIterSDR.Next()) { - Handle(Standard_Transient) anAtrSDR = anIterSDR.Value(); + const Handle(Standard_Transient)& anAtrSDR = anIterSDR.Value(); if (anAtrSDR->IsKind(STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation))) { isAllOver = Standard_True; Interface_EntityIterator anIterABSR = aGraph.Shareds(anAtrSDR); for (anIterABSR.Start(); anIterABSR.More(); anIterABSR.Next()) { - Handle(Standard_Transient) anAtrABSR = anIterABSR.Value(); + const Handle(Standard_Transient)& anAtrABSR = anIterABSR.Value(); if (anAtrABSR->IsKind(STANDARD_TYPE(StepShape_AdvancedBrepShapeRepresentation))) { aSeqRI1.Append(anAtrABSR); @@ -4332,7 +4334,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadMaterials(const Handle(XSControl_Wor if (PDR.IsNull()) continue; Handle(StepRepr_Representation) Repr = PDR->UsedRepresentation(); if (Repr.IsNull()) continue; - Standard_Integer ir; + Standard_Integer ir = 0; for (ir = 1; ir <= Repr->NbItems(); ir++) { Handle(StepRepr_RepresentationItem) RI = Repr->ItemsValue(ir); if (RI.IsNull()) continue; @@ -4416,7 +4418,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadMaterials(const Handle(XSControl_Wor void collectViewShapes(const Handle(XSControl_WorkSession)& theWS, const Handle(TDocStd_Document)& theDoc, - const Handle(StepRepr_Representation) theRepr, + const Handle(StepRepr_Representation)& theRepr, TDF_LabelSequence& theShapes) { Handle(XSControl_TransferReader) aTR = theWS->TransferReader(); @@ -4451,7 +4453,7 @@ void collectViewShapes(const Handle(XSControl_WorkSession)& theWS, //======================================================================= Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_GeometricRepresentationItem)& theClippingCameraModel, TDF_LabelSequence& theClippingPlanes, - const Handle(XCAFDoc_ClippingPlaneTool) theTool) + const Handle(XCAFDoc_ClippingPlaneTool)& theTool) { Handle(TCollection_HAsciiString) anExpression = new TCollection_HAsciiString(); NCollection_Sequence aPlanes; @@ -4788,7 +4790,7 @@ void STEPCAFControl_Reader::ExpandSubShapes(const Handle(XCAFDoc_ShapeTool)& Sha // topological containers to expand for (Standard_Integer i = 1; i <= aReprItems.Length(); ++i) { - Handle(StepRepr_RepresentationItem) aTRepr = aReprItems.Value(i); + const Handle(StepRepr_RepresentationItem)& aTRepr = aReprItems.Value(i); if (aTRepr->IsKind(STANDARD_TYPE(StepShape_ManifoldSolidBrep))) aMSBSeq.Append(aTRepr); else if (aTRepr->IsKind(STANDARD_TYPE(StepShape_ShellBasedSurfaceModel))) diff --git a/src/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/STEPCAFControl/STEPCAFControl_Writer.cxx index b9c9a2bee7..9dd9b59ab5 100644 --- a/src/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -20,6 +20,8 @@ // (analysis of SDRs which the CDSR links should be done) // Names and validation props are supported for top-level shapes only +#include + #include #include @@ -318,7 +320,7 @@ IFSelect_ReturnStatus STEPCAFControl_Writer::Write(const Standard_CString theFil for (NCollection_DataMap::Iterator anExtFileIter(myFiles); anExtFileIter.More(); anExtFileIter.Next()) { - Handle(STEPCAFControl_ExternFile) anExtFile = anExtFileIter.Value(); + const Handle(STEPCAFControl_ExternFile)& anExtFile = anExtFileIter.Value(); if (anExtFile->GetWriteStatus() != IFSelect_RetVoid) { continue; @@ -1040,7 +1042,7 @@ static Standard_Boolean setDefaultInstanceColor(const Handle(StepVisual_StyledIt aFatherStyleIter.More(); aFatherStyleIter.Next()) { StepVisual_PresentationStyleSelect aPSS; - StepVisual_PresentationStyleSelect anOlDPSS = aFatherStyleIter.Value(); + const StepVisual_PresentationStyleSelect& anOlDPSS = aFatherStyleIter.Value(); if (!anOlDPSS.PointStyle().IsNull()) aPSS.SetValue(anOlDPSS.PointStyle()); else if (!anOlDPSS.CurveStyle().IsNull()) @@ -1090,7 +1092,7 @@ static void MakeSTEPStyles(STEPConstruct_Styles& theStyles, if (theInherit) aStyle = *theInherit; if (theSettings.Contains(theShape)) { - XCAFPrs_Style anOwnStyle = theSettings.FindFromKey(theShape); + const XCAFPrs_Style& anOwnStyle = theSettings.FindFromKey(theShape); if (!anOwnStyle.IsVisible()) aStyle.SetVisibility(Standard_False); if (anOwnStyle.IsSetColorCurv()) @@ -2315,7 +2317,7 @@ static StepBasic_Unit GetUnit(const Handle(StepRepr_RepresentationContext)& theR //purpose : auxiliary //====================================================================== static Handle(StepRepr_ReprItemAndMeasureWithUnit) CreateDimValue(const Standard_Real theValue, - const StepBasic_Unit theUnit, + const StepBasic_Unit& theUnit, const Handle(TCollection_HAsciiString)& theName, const Standard_CString theMeasureName, const Standard_Boolean theIsAngle, @@ -2375,7 +2377,7 @@ static Handle(StepRepr_ReprItemAndMeasureWithUnit) CreateDimValue(const Standard //======================================================================= Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::writeShapeAspect(const Handle(XSControl_WorkSession)& theWS, const TDF_Label theLabel, - const TopoDS_Shape theShape, + const TopoDS_Shape& theShape, Handle(StepRepr_RepresentationContext)& theRC, Handle(StepAP242_GeometricItemSpecificUsage)& theGISU) { @@ -2432,7 +2434,7 @@ Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::writeShapeAspect(const Handl for (Interface_EntityIterator aSharingIter = aGraph.Sharings(aPDS); aSharingIter.More() && aSDR.IsNull(); aSharingIter.Next()) { - Handle(Standard_Transient) anEntity = aSharingIter.Value(); + const Handle(Standard_Transient)& anEntity = aSharingIter.Value(); aSDR = Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(anEntity); } if (aSDR.IsNull()) @@ -2457,7 +2459,7 @@ void STEPCAFControl_Writer::writePresentation(const Handle(XSControl_WorkSession const Standard_Boolean theHasPlane, const gp_Ax2& theAnnotationPlane, const gp_Pnt& theTextPosition, - const Handle(Standard_Transient) theDimension) + const Handle(Standard_Transient)& theDimension) { if (thePresentation.IsNull()) return; @@ -2509,7 +2511,7 @@ void STEPCAFControl_Writer::writePresentation(const Handle(XSControl_WorkSession // Plane Handle(StepGeom_Plane) aPlane = new StepGeom_Plane(); GeomToStep_MakeAxis2Placement3d anAxisMaker(theAnnotationPlane); - Handle(StepGeom_Axis2Placement3d) anAxis = anAxisMaker.Value(); + const Handle(StepGeom_Axis2Placement3d)& anAxis = anAxisMaker.Value(); // Set text position to plane origin Handle(StepGeom_CartesianPoint) aTextPos = new StepGeom_CartesianPoint(); Handle(TColStd_HArray1OfReal) aCoords = new TColStd_HArray1OfReal(1, 3); @@ -2540,7 +2542,7 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC const TDF_LabelSequence& theShapeL, const TDF_Label& theDatumL, const Standard_Boolean theIsFirstDTarget, - const Handle(StepDimTol_Datum) theWrittenDatum) + const Handle(StepDimTol_Datum)& theWrittenDatum) { // Get working data const Handle(Interface_InterfaceModel)& aModel = theWS->Model(); @@ -2799,20 +2801,20 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC // qualifiers, modifiers, orientation and tolerance class) //====================================================================== static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS, - const Handle(XCAFDimTolObjects_DimensionObject) theObject, - const Handle(StepRepr_RepresentationContext) theRC, - const StepShape_DimensionalCharacteristic theDimension) + const Handle(XCAFDimTolObjects_DimensionObject)& theObject, + const Handle(StepRepr_RepresentationContext)& theRC, + const StepShape_DimensionalCharacteristic& theDimension) { // Get working data const Handle(Interface_InterfaceModel)& aModel = theWS->Model(); XCAFDimTolObjects_DimensionModifiersSequence aModifiers = theObject->GetModifiers(); - Handle(Standard_Transient) aDim = theDimension.Value(); + const Handle(Standard_Transient)& aDim = theDimension.Value(); Standard_Boolean isAngle = aDim->IsKind(STANDARD_TYPE(StepShape_AngularLocation)) || aDim->IsKind(STANDARD_TYPE(StepShape_AngularSize)); // Unit StepBasic_Unit aUnit = GetUnit(theRC, isAngle); - Standard_CString aMeasureName; + Standard_CString aMeasureName = nullptr; if (isAngle) aMeasureName = "POSITIVE_PLANE_ANGLE_MEASURE"; else @@ -2832,7 +2834,7 @@ static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS, // Nominal value Standard_Real aNominal = theObject->GetValue(); - Standard_Integer aLeftNbDigits, aRightNbDigits; + Standard_Integer aLeftNbDigits = 0, aRightNbDigits = 0; theObject->GetNbOfDecimalPlaces(aLeftNbDigits, aRightNbDigits); Standard_Integer aNbQualifiers = 0; if (theObject->HasQualifier() && !isAngle) @@ -2929,7 +2931,7 @@ static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS, gp_Dir aDir; theObject->GetDirection(aDir); GeomToStep_MakeCartesianPoint MkPoint(gp_Pnt(0, 0, 0)); - Handle(StepGeom_CartesianPoint) aLoc = MkPoint.Value(); + const Handle(StepGeom_CartesianPoint)& aLoc = MkPoint.Value(); Handle(StepGeom_Direction) anAxis = new StepGeom_Direction(); Handle(TColStd_HArray1OfReal) aCoords = new TColStd_HArray1OfReal(1, 3); aCoords->SetValue(1, aDir.X()); @@ -3001,7 +3003,7 @@ static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS, // Tolerance class if (theObject->IsDimWithClassOfTolerance()) { - Standard_Boolean isHole; + Standard_Boolean isHole = 0; XCAFDimTolObjects_DimensionFormVariance aFormVariance; XCAFDimTolObjects_DimensionGrade aGrade; if (!theObject->GetClassOfTolerance(isHole, aFormVariance, aGrade)) @@ -3022,7 +3024,7 @@ static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS, //====================================================================== static void WriteDerivedGeometry(const Handle(XSControl_WorkSession)& theWS, const Handle(XCAFDimTolObjects_DimensionObject)& theObject, - const Handle(StepRepr_ConstructiveGeometryRepresentation) theRepr, + const Handle(StepRepr_ConstructiveGeometryRepresentation)& theRepr, Handle(StepRepr_ShapeAspect)& theFirstSA, Handle(StepRepr_ShapeAspect)& theSecondSA, NCollection_Vector& thePnts) @@ -3078,8 +3080,8 @@ static void WriteDerivedGeometry(const Handle(XSControl_WorkSession)& theWS, //====================================================================== static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const Handle(XSControl_WorkSession)& theWS, const TDF_Label theGeomTolL, - const TDF_LabelSequence theDatumSeq, - const STEPConstruct_DataMapOfAsciiStringTransient theDatumMap, + const TDF_LabelSequence& theDatumSeq, + const STEPConstruct_DataMapOfAsciiStringTransient& theDatumMap, const Handle(StepRepr_RepresentationContext)& theRC) { // Get working data @@ -4321,7 +4323,7 @@ Standard_Boolean STEPCAFControl_Writer::writeMaterials(const Handle(XSControl_Wo TDF_Label aMatL = aNode->Father()->Label(); Handle(TCollection_HAsciiString) aName; Handle(TCollection_HAsciiString) aDescription; - Standard_Real aDensity; + Standard_Real aDensity = NAN; Handle(TCollection_HAsciiString) aDensName; Handle(TCollection_HAsciiString) aDensValType; Handle(StepRepr_Representation) aRepDRI; diff --git a/src/STEPCAFControl/STEPCAFControl_Writer.hxx b/src/STEPCAFControl/STEPCAFControl_Writer.hxx index 0a6438de7a..f35dafd28b 100644 --- a/src/STEPCAFControl/STEPCAFControl_Writer.hxx +++ b/src/STEPCAFControl/STEPCAFControl_Writer.hxx @@ -237,7 +237,7 @@ protected: Handle(StepRepr_ShapeAspect) writeShapeAspect(const Handle(XSControl_WorkSession)& theWS, const TDF_Label theLabel, - const TopoDS_Shape theShape, + const TopoDS_Shape& theShape, Handle(StepRepr_RepresentationContext)& theRC, Handle(StepAP242_GeometricItemSpecificUsage)& theGISU); @@ -248,13 +248,13 @@ protected: const Standard_Boolean theHasPlane, const gp_Ax2& theAnnotationPlane, const gp_Pnt& theTextPosition, - const Handle(Standard_Transient) theDimension); + const Handle(Standard_Transient)& theDimension); Handle(StepDimTol_Datum) writeDatumAP242(const Handle(XSControl_WorkSession)& theWS, const TDF_LabelSequence& theShapeL, const TDF_Label& theDatumL, const Standard_Boolean isFirstDTarget, - const Handle(StepDimTol_Datum) theWrittenDatum); + const Handle(StepDimTol_Datum)& theWrittenDatum); void writeToleranceZone(const Handle(XSControl_WorkSession)& theWS, const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObject, diff --git a/src/STEPConstruct/STEPConstruct_AP203Context.cxx b/src/STEPConstruct/STEPConstruct_AP203Context.cxx index 47f470b90a..130fe0890a 100644 --- a/src/STEPConstruct/STEPConstruct_AP203Context.cxx +++ b/src/STEPConstruct/STEPConstruct_AP203Context.cxx @@ -196,7 +196,7 @@ Handle(StepBasic_PersonAndOrganization) STEPConstruct_AP203Context::DefaultPerso Handle(TCollection_HAsciiString) lname = new TCollection_HAsciiString (""); Handle(Interface_HArray1OfHAsciiString) mname; TColStd_SequenceOfAsciiString names; - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for ( i=1; ; i++ ) { TCollection_AsciiString token = user.Token ( " \t", i ); if ( ! token.Length() ) break; diff --git a/src/STEPConstruct/STEPConstruct_Assembly.cxx b/src/STEPConstruct/STEPConstruct_Assembly.cxx index b6e180155e..3fe626dabc 100644 --- a/src/STEPConstruct/STEPConstruct_Assembly.cxx +++ b/src/STEPConstruct/STEPConstruct_Assembly.cxx @@ -195,7 +195,7 @@ Standard_Boolean STEPConstruct_Assembly::CheckSRRReversesNAUO(const Interface_Gr Handle(Standard_Type) tSDR = STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation); Interface_EntityIterator anIter = theGraph.Sharings(rep1); for (; anIter.More() && pd1.IsNull(); anIter.Next()) { - Handle(Standard_Transient) enti = anIter.Value(); + const Handle(Standard_Transient)& enti = anIter.Value(); if (enti->DynamicType() == tSDR) { Handle(StepShape_ShapeDefinitionRepresentation) SDR = Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(enti); @@ -206,7 +206,7 @@ Standard_Boolean STEPConstruct_Assembly::CheckSRRReversesNAUO(const Interface_Gr anIter = theGraph.Sharings(rep2); for (; anIter.More() && pd2.IsNull(); anIter.Next()) { - Handle(Standard_Transient) enti = anIter.Value(); + const Handle(Standard_Transient)& enti = anIter.Value(); if (enti->DynamicType() == tSDR) { Handle(StepShape_ShapeDefinitionRepresentation) SDR = Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(enti); diff --git a/src/STEPConstruct/STEPConstruct_ContextTool.cxx b/src/STEPConstruct/STEPConstruct_ContextTool.cxx index 873e91cf95..142940f884 100644 --- a/src/STEPConstruct/STEPConstruct_ContextTool.cxx +++ b/src/STEPConstruct/STEPConstruct_ContextTool.cxx @@ -70,7 +70,7 @@ void STEPConstruct_ContextTool::SetModel (const Handle(StepData_StepModel)& aSte { theAPD.Nullify(); //thePRPC.Nullify(); - Standard_Integer i, nb = aStepModel->NbEntities(); + Standard_Integer i = 0, nb = aStepModel->NbEntities(); for(i = 1; i<=nb && theAPD.IsNull(); i ++) { Handle(Standard_Transient) ent = aStepModel->Value(i); if (ent->IsKind(STANDARD_TYPE(StepBasic_ApplicationProtocolDefinition))) { diff --git a/src/STEPConstruct/STEPConstruct_ExternRefs.cxx b/src/STEPConstruct/STEPConstruct_ExternRefs.cxx index c8624171d4..4629cd4b0d 100644 --- a/src/STEPConstruct/STEPConstruct_ExternRefs.cxx +++ b/src/STEPConstruct/STEPConstruct_ExternRefs.cxx @@ -229,7 +229,7 @@ Standard_Boolean STEPConstruct_ExternRefs::LoadExternRefs () // for each DocumentFile, find associated with it data: Interface_EntityIterator subs = Graph().Sharings(DocFile); for (subs.Start(); subs.More(); subs.Next()) { - Handle(Standard_Transient) sub = subs.Value(); + const Handle(Standard_Transient)& sub = subs.Value(); // FORMAT - ??????? // @@ -343,7 +343,7 @@ Standard_CString STEPConstruct_ExternRefs::FileName (const Standard_Integer num) Handle(StepBasic_ProductDefinitionWithAssociatedDocuments)::DownCast(myShapes(num)); if ( aPDWAD.IsNull() || aPDWAD->DocIds().IsNull() ) return ""; - Standard_Integer i; + Standard_Integer i = 0; for ( i=1; i <= aPDWAD->NbDocIds(); i++ ) { Handle(StepBasic_Document) Doc = aPDWAD->DocIdsValue(i); Handle(TCollection_HAsciiString) aFilename = Doc->Name(); @@ -659,7 +659,7 @@ Standard_Integer STEPConstruct_ExternRefs::AddExternRef (const Standard_CString // Handle(Standard_Transient) sub = subs.Value(); Interface_EntityIterator subs = Graph().Sharings(PD); for (subs.Start(); subs.More(); subs.Next()) { - Handle(Standard_Transient) sub = subs.Value(); + const Handle(Standard_Transient)& sub = subs.Value(); if (!sub->IsKind(STANDARD_TYPE(StepRepr_ProductDefinitionShape))) continue; Handle(StepRepr_ProductDefinitionShape) ProdDefSh = Handle(StepRepr_ProductDefinitionShape)::DownCast ( sub ); @@ -682,7 +682,7 @@ Standard_Integer STEPConstruct_ExternRefs::AddExternRef (const Standard_CString // Interface_EntityIterator subs2 = Graph().Sharings(ProdDef); Interface_EntityIterator subs2 = Graph().Sharings(PD); for (subs2.Start(); subs2.More(); subs2.Next()) { - Handle(Standard_Transient) sub2 = subs2.Value(); + const Handle(Standard_Transient)& sub2 = subs2.Value(); if (sub2->IsKind(STANDARD_TYPE(StepRepr_NextAssemblyUsageOccurrence))) { Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO = diff --git a/src/STEPConstruct/STEPConstruct_Part.cxx b/src/STEPConstruct/STEPConstruct_Part.cxx index 73156f8057..5323812ad9 100644 --- a/src/STEPConstruct/STEPConstruct_Part.cxx +++ b/src/STEPConstruct/STEPConstruct_Part.cxx @@ -44,9 +44,9 @@ //function : STEPConstruct_Part //purpose : //======================================================================= -STEPConstruct_Part::STEPConstruct_Part() +STEPConstruct_Part::STEPConstruct_Part() : myDone(Standard_False) { - myDone = Standard_False; + } //======================================================================= diff --git a/src/STEPConstruct/STEPConstruct_UnitContext.cxx b/src/STEPConstruct/STEPConstruct_UnitContext.cxx index 665e80292a..3225d0c4ec 100644 --- a/src/STEPConstruct/STEPConstruct_UnitContext.cxx +++ b/src/STEPConstruct/STEPConstruct_UnitContext.cxx @@ -17,6 +17,8 @@ //abv 17.11.99: renamed from StepPDR_MakeUnitAndToleranceContext and merged with STEPControl_Unit //abv 30.02.00: ability to write file in units other than MM +#include + #include #include #include @@ -49,13 +51,13 @@ STEPConstruct_UnitContext::STEPConstruct_UnitContext() lengthFactor(0.0), planeAngleFactor(0.0), solidAngleFactor(0.0), - areaFactor(0.0), + theUncertainty(RealLast()), areaFactor(0.0), volumeFactor(0.0) { lengthDone = planeAngleDone = solidAngleDone = hasUncertainty = areaDone = volumeDone = Standard_False; //pdn file r_47-sd.stp initialize field. - theUncertainty = RealLast(); + } //======================================================================= @@ -408,7 +410,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasi } // end of SolidAngleUnit else if (aUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndAreaUnit)) || aUnit->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndAreaUnit))) { - Standard_Real af; + Standard_Real af = NAN; #ifdef METER af = parameter; #else @@ -419,7 +421,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasi } else if (aUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndVolumeUnit)) || aUnit->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndVolumeUnit))) { - Standard_Real af; + Standard_Real af = NAN; #ifdef METER af = parameter; #else diff --git a/src/STEPControl/STEPControl_ActorRead.cxx b/src/STEPControl/STEPControl_ActorRead.cxx index 2abe2e3a73..752e358014 100644 --- a/src/STEPControl/STEPControl_ActorRead.cxx +++ b/src/STEPControl/STEPControl_ActorRead.cxx @@ -236,7 +236,7 @@ Standard_Boolean STEPControl_ActorRead::Recognize DeclareAndCast(StepShape_ShapeRepresentation,sr,start); if (!sr.IsNull()) { - Standard_Integer i,nb = sr->NbItems(); + Standard_Integer i = 0,nb = sr->NbItems(); for (i = 1; i <= nb; i ++) { if (Recognize (sr->ItemsValue(i)) ) return Standard_True; } @@ -589,7 +589,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS, TopoDS_Iterator it(Result1); for ( ; it.More(); it.Next() ) { - TopoDS_Shape aSubShape = it.Value(); + const TopoDS_Shape& aSubShape = it.Value(); B.Add(Cund, aSubShape); } } @@ -639,7 +639,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS, TopoDS_Iterator it(Result1); for ( ; it.More(); it.Next() ) { - TopoDS_Shape aSubShape = it.Value(); + const TopoDS_Shape& aSubShape = it.Value(); B.Add(Cund, aSubShape); } } @@ -657,7 +657,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS, Interface_EntityIterator subs1 = graph.Sharings(rep); Handle(Standard_Type) tSRR = STANDARD_TYPE(StepRepr_ShapeRepresentationRelationship); for (subs1.Start(); subs1.More(); subs1.Next()) { - Handle(Standard_Transient) anitem = subs1.Value(); + const Handle(Standard_Transient)& anitem = subs1.Value(); if( !anitem->IsKind(STANDARD_TYPE(StepRepr_RepresentationRelationship))) continue; if (anitem->DynamicType() == tSRR) @@ -761,7 +761,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity { // NB: C cast is used instead of DownCast() to improve performance on some cases. // This saves ~10% of elapsed time on "testgrid perf de bug29* -parallel 0". - SRR = (StepRepr_ShapeRepresentationRelationship*)(aSubs3Val.get()); + SRR = dynamic_cast(aSubs3Val.get()); } } } @@ -991,7 +991,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity( // Put not suspected open Shells as they are (updated 23.11.2010) TopExp_Explorer allShellsExp(comp, TopAbs_SHELL); for ( ; allShellsExp.More(); allShellsExp.Next() ) { - TopoDS_Shape aCurrentShell = allShellsExp.Current(); + const TopoDS_Shape& aCurrentShell = allShellsExp.Current(); if ( !myNMTool.IsPureNMShell(aCurrentShell) && !shellClosingsMap.Contains(aCurrentShell) ) brepBuilder.Add(compWithClosings, aCurrentShell); } @@ -1005,7 +1005,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity( TopExp_Explorer exp(comp, TopAbs_SHELL); for (; exp.More(); exp.Next()) { - TopoDS_Shape aSubShape = exp.Current(); + const TopoDS_Shape& aSubShape = exp.Current(); if (aSubShape.ShapeType() == TopAbs_SHELL && aSubShape.Closed()) { TopoDS_Solid nextSolid; brepBuilder.MakeSolid(nextSolid); @@ -1259,7 +1259,7 @@ static Standard_Boolean IsNeedRepresentation(const Handle(StepRepr_ShapeAspect)& if ( SRR.IsNull() ) continue; rep2 = ( sdrA->UsedRepresentation() == SRR->Rep1() ? SRR->Rep2() : SRR->Rep1() ); } - Standard_Integer i, j; // svv Jan 11 2000 : porting on DEC + Standard_Integer i = 0, j = 0; // svv Jan 11 2000 : porting on DEC for ( i=1; i <= repA->NbItems(); i++ ) { Handle(StepRepr_RepresentationItem) it = repA->ItemsValue(i); for ( j=1; j <= rep2->NbItems(); j++ ) @@ -1348,7 +1348,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::OldWay for (subs.Start(); subs.More() && PS.More(); subs.Next()) { Message_ProgressRange aRange = PS.Next(); - Handle(Standard_Transient) anitem = subs.Value(); + const Handle(Standard_Transient)& anitem = subs.Value(); if ( anitem->DynamicType() != tCDSR && anitem->DynamicType() != tSRR ) continue; // DeclareAndCast(StepShape_ContextDependentShapeRepresentation,anitem,subs.Value()); // if (anitem.IsNull()) continue; @@ -1749,7 +1749,7 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)& { mySRContext = rep; - Standard_Integer stat1, stat2 = 0; // sera alimente par STEPControl_Unit + Standard_Integer stat1 = 0, stat2 = 0; // sera alimente par STEPControl_Unit if (rep.IsNull()) { ResetUnits(); return; @@ -2026,12 +2026,12 @@ void STEPControl_ActorRead::computeIDEASClosings(const TopoDS_Compound& comp, TopExp_Explorer shellExpA(comp, TopAbs_SHELL); for ( ; shellExpA.More(); shellExpA.Next() ) { - TopoDS_Shape shellA = shellExpA.Current(); + const TopoDS_Shape& shellA = shellExpA.Current(); TopExp_Explorer shellExpB(comp, TopAbs_SHELL); TopTools_ListOfShape closingShells; for ( ; shellExpB.More(); shellExpB.Next() ) { - TopoDS_Shape shellB = shellExpB.Current(); + const TopoDS_Shape& shellB = shellExpB.Current(); if ( shellA.IsSame(shellB) ) continue; // Check whether ShellB is non-manifold and adjacent to ShellA. diff --git a/src/STEPControl/STEPControl_ActorWrite.cxx b/src/STEPControl/STEPControl_ActorWrite.cxx index 3caee36941..06944d9a3c 100644 --- a/src/STEPControl/STEPControl_ActorWrite.cxx +++ b/src/STEPControl/STEPControl_ActorWrite.cxx @@ -17,6 +17,8 @@ // PTV 22.08.2002 OCC609 transfer solo vertices into step file. // PTV 16.09.2002 OCC725 transfer compound of vertices into one geometrical curve set. +#include + #include #include #include @@ -228,7 +230,7 @@ static Standard_Boolean IsManifoldShape(const TopoDS_Shape& theShape) { TopoDS_Iterator anIt(theShape); for ( ; anIt.More(); anIt.Next() ) { - TopoDS_Shape aDirectChild = anIt.Value(); + const TopoDS_Shape& aDirectChild = anIt.Value(); if (aDirectChild.ShapeType() != TopAbs_COMPOUND) aBrepBuilder.Add(aDirectShapes, aDirectChild); } @@ -498,7 +500,7 @@ Standard_Boolean STEPControl_ActorWrite::Recognize (const Handle(Transfer_Finde } for (TopExp_Explorer fedg(theShape,TopAbs_EDGE); fedg.More(); fedg.Next()) { const TopoDS_Edge& E = TopoDS::Edge (fedg.Current()); - TopLoc_Location locbid; Standard_Real first,last; + TopLoc_Location locbid; Standard_Real first = NAN,last = NAN; Handle(Geom_Curve) curv = BRep_Tool::Curve (E,locbid,first,last); if (curv.IsNull() || !curv->IsKind(STANDARD_TYPE(Geom_Line)) ) return Standard_False; } @@ -791,7 +793,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape // Transfer Solids to closed Shells. Prepare RepItemSeq & NonManifoldGroup for ( TopoDS_Iterator iter(aNMCompound); iter.More(); iter.Next() ) { - TopoDS_Shape aSubShape = iter.Value(); + const TopoDS_Shape& aSubShape = iter.Value(); if (aSubShape.ShapeType() == TopAbs_SOLID) { for ( TopoDS_Iterator aSubIter(aSubShape); aSubIter.More(); aSubIter.Next() ) { TopoDS_Shell aSubShell = TopoDS::Shell( aSubIter.Value() ); @@ -1191,7 +1193,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape aGCSet->SetName(empty); // iterates on compound with vertices and traces each vertex for ( anExp.ReInit() ; anExp.More(); anExp.Next() ) { - TopoDS_Shape aVertex = anExp.Current(); + const TopoDS_Shape& aVertex = anExp.Current(); if ( aVertex.ShapeType() != TopAbs_VERTEX ) continue; curNb++; @@ -1276,7 +1278,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape if (isManifold) shapeRep = new StepShape_ManifoldSurfaceShapeRepresentation; else { - Standard_Boolean isNewNMSSRCreated; + Standard_Boolean isNewNMSSRCreated = 0; shapeRep = this->getNMSSRForGroup(shapeGroup, FP, isNewNMSSRCreated); useExistingNMSSR = !isNewNMSSRCreated; } @@ -1294,7 +1296,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape if (isManifold) shapeRep = new StepShape_ManifoldSurfaceShapeRepresentation; else { - Standard_Boolean isNewNMSSRCreated; + Standard_Boolean isNewNMSSRCreated = 0; shapeRep = this->getNMSSRForGroup(shapeGroup, FP, isNewNMSSRCreated); useExistingNMSSR = !isNewNMSSRCreated; } @@ -1459,7 +1461,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound // Inspect non-manifold topology case (ssv; 10.11.2010) Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; - Standard_Boolean isManifold; + Standard_Boolean isManifold = 0; if (isNMMode) isManifold = IsManifoldShape(theShape); else @@ -1483,7 +1485,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound #endif for (TopoDS_Iterator iter(theShape); iter.More(); iter.Next()) { - TopoDS_Shape aSubShape = iter.Value(); + const TopoDS_Shape& aSubShape = iter.Value(); if (aSubShape.ShapeType() != TopAbs_VERTEX || !isSeparateVertices) { // Store non-manifold topology as shells (ssv; 10.11.2010) @@ -1526,7 +1528,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound binder->AddResult ( TransientResult(shapeRep) ); // translate components - Standard_Integer i, nbs = RepItemSeq->Length(); + Standard_Integer i = 0, nbs = RepItemSeq->Length(); Handle(TColStd_HSequenceOfTransient) ItemSeq = new TColStd_HSequenceOfTransient(); ItemSeq->Append (myContext.GetDefaultAxis()); myContext.NextLevel(); @@ -1597,7 +1599,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape gp_Trsf aLoc; Standard_Boolean isShapeLocated = Standard_False; if ( GroupMode() >0) { - TopLoc_Location shloc = shape.Location(); + const TopLoc_Location& shloc = shape.Location(); isShapeLocated = !shloc.IsIdentity(); aLoc = shloc.Transformation(); TopLoc_Location shident; @@ -1643,7 +1645,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape // make location for assembly placement GeomToStep_MakeAxis2Placement3d mkax (aLoc); - Handle(StepGeom_Axis2Placement3d) AxLoc = mkax.Value(); + const Handle(StepGeom_Axis2Placement3d)& AxLoc = mkax.Value(); AX1 = AxLoc; // create assembly structures (CDSR, NAUO etc.) diff --git a/src/STEPSelections/STEPSelections_AssemblyComponent.cxx b/src/STEPSelections/STEPSelections_AssemblyComponent.cxx index 6bb365da7d..0af6206d48 100644 --- a/src/STEPSelections/STEPSelections_AssemblyComponent.cxx +++ b/src/STEPSelections/STEPSelections_AssemblyComponent.cxx @@ -25,8 +25,8 @@ STEPSelections_AssemblyComponent::STEPSelections_AssemblyComponent() } STEPSelections_AssemblyComponent::STEPSelections_AssemblyComponent(const Handle(StepShape_ShapeDefinitionRepresentation)& sdr, - const Handle(STEPSelections_HSequenceOfAssemblyLink)& list) + const Handle(STEPSelections_HSequenceOfAssemblyLink)& list) : mySDR(sdr), myList(list) { - mySDR = sdr; - myList = list; + + } diff --git a/src/STEPSelections/STEPSelections_AssemblyLink.cxx b/src/STEPSelections/STEPSelections_AssemblyLink.cxx index 7f0820854a..32aeca7124 100644 --- a/src/STEPSelections/STEPSelections_AssemblyLink.cxx +++ b/src/STEPSelections/STEPSelections_AssemblyLink.cxx @@ -28,9 +28,9 @@ STEPSelections_AssemblyLink::STEPSelections_AssemblyLink() STEPSelections_AssemblyLink::STEPSelections_AssemblyLink(const Handle(StepRepr_NextAssemblyUsageOccurrence)& nauo, const Handle(Standard_Transient)& item, - const Handle(STEPSelections_AssemblyComponent)& part) + const Handle(STEPSelections_AssemblyComponent)& part) : myNAUO(nauo), myItem(item), myComponent(part) { - myNAUO = nauo; - myItem = item; - myComponent = part; + + + } diff --git a/src/STEPSelections/STEPSelections_Counter.cxx b/src/STEPSelections/STEPSelections_Counter.cxx index 9fe036fb75..7a3628e33a 100644 --- a/src/STEPSelections/STEPSelections_Counter.cxx +++ b/src/STEPSelections/STEPSelections_Counter.cxx @@ -44,13 +44,13 @@ #include #include -STEPSelections_Counter::STEPSelections_Counter() +STEPSelections_Counter::STEPSelections_Counter() : myNbFaces(0), myNbShells(0), myNbSolids(0), myNbEdges(0), myNbWires(0) { - myNbFaces = 0; - myNbShells = 0; - myNbSolids = 0; - myNbWires = 0; - myNbEdges =0; + + + + + } void STEPSelections_Counter::Count(const Interface_Graph& graph, @@ -137,7 +137,7 @@ void STEPSelections_Counter::Count(const Interface_Graph& graph, Standard_Integer nbElem = gs->NbElements(); for (Standard_Integer i = 1; i <= nbElem ; i++) { StepShape_GeometricSetSelect aGSS = gs->ElementsValue(i); - Handle(Standard_Transient) ent = aGSS.Value(); + const Handle(Standard_Transient)& ent = aGSS.Value(); Handle(StepGeom_CompositeCurve) ccurve = Handle(StepGeom_CompositeCurve)::DownCast(ent); if(!ccurve.IsNull()) { myNbWires++; diff --git a/src/STEPSelections/STEPSelections_SelectDerived.cxx b/src/STEPSelections/STEPSelections_SelectDerived.cxx index 6a39a1f974..d52a02f68d 100644 --- a/src/STEPSelections/STEPSelections_SelectDerived.cxx +++ b/src/STEPSelections/STEPSelections_SelectDerived.cxx @@ -51,7 +51,7 @@ Standard_Boolean STEPSelections_SelectDerived::Matches(const Handle(Standard_Tra const TCollection_AsciiString& text, const Standard_Boolean /*exact*/) const { - Standard_Integer CN; + Standard_Integer CN = 0; Handle(StepData_ReadWriteModule) module; Standard_Boolean ok = thelib.Select (ent,module,CN); if(!ok) return Standard_False; diff --git a/src/Select3D/Select3D_SensitiveBox.cxx b/src/Select3D/Select3D_SensitiveBox.cxx index 82fce79bc1..66daf10ea6 100644 --- a/src/Select3D/Select3D_SensitiveBox.cxx +++ b/src/Select3D/Select3D_SensitiveBox.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveBox,Select3D_SensitiveEntity) @@ -26,8 +28,8 @@ Select3D_SensitiveBox::Select3D_SensitiveBox (const Handle(SelectMgr_EntityOwner const Bnd_Box& theBox) : Select3D_SensitiveEntity (theOwnerId) { - Standard_Real aXMax, aYMax, aZMax; - Standard_Real aXMin, aYMin, aZMin; + Standard_Real aXMax = NAN, aYMax = NAN, aZMax = NAN; + Standard_Real aXMin = NAN, aYMin = NAN, aZMin = NAN; theBox.Get (aXMin, aYMin, aZMin, aXMax, aYMax, aZMax); myBox = Select3D_BndBox3d (SelectMgr_Vec3 (aXMin, aYMin, aZMin), SelectMgr_Vec3 (aXMax, aYMax, aZMax)); diff --git a/src/Select3D/Select3D_SensitiveCircle.cxx b/src/Select3D/Select3D_SensitiveCircle.cxx index 1e24dd8ba7..65eb99ca32 100644 --- a/src/Select3D/Select3D_SensitiveCircle.cxx +++ b/src/Select3D/Select3D_SensitiveCircle.cxx @@ -27,12 +27,12 @@ IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveCircle, Select3D_SensitiveEntity) Select3D_SensitiveCircle::Select3D_SensitiveCircle (const Handle(SelectMgr_EntityOwner)& theOwnerId, const gp_Circ& theCircle, const Standard_Boolean theIsFilled) -: Select3D_SensitiveEntity (theOwnerId) +: Select3D_SensitiveEntity (theOwnerId), mySensType(theIsFilled ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY), myRadius(theCircle.Radius()) { - myRadius = theCircle.Radius(); + myTrsf.SetTransformation (theCircle.Position(), gp::XOY()); - mySensType = theIsFilled ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY; + if (mySensType == Select3D_TOS_BOUNDARY) { SetSensitivityFactor (6); diff --git a/src/Select3D/Select3D_SensitivePoint.cxx b/src/Select3D/Select3D_SensitivePoint.cxx index b7fc5c9c1f..be7d436781 100644 --- a/src/Select3D/Select3D_SensitivePoint.cxx +++ b/src/Select3D/Select3D_SensitivePoint.cxx @@ -24,10 +24,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitivePoint,Select3D_SensitiveEntity) //================================================== Select3D_SensitivePoint::Select3D_SensitivePoint (const Handle(SelectMgr_EntityOwner)& theOwner, const gp_Pnt& thePoint) -: Select3D_SensitiveEntity (theOwner) +: Select3D_SensitiveEntity (theOwner), myPoint(thePoint) { SetSensitivityFactor (12); - myPoint = thePoint; + } //================================================== diff --git a/src/Select3D/Select3D_SensitivePoly.cxx b/src/Select3D/Select3D_SensitivePoly.cxx index 162af349ff..c380466006 100644 --- a/src/Select3D/Select3D_SensitivePoly.cxx +++ b/src/Select3D/Select3D_SensitivePoly.cxx @@ -197,8 +197,14 @@ Select3D_SensitivePoly::Select3D_SensitivePoly (const Handle(SelectMgr_EntityOwn const Standard_Integer theNbPnts) : Select3D_SensitivePoly (theOwnerId, !theIsFilled, GetCircleNbPoints (theCircle, theNbPnts, theU1, theU2, theIsFilled)) { - mySensType = theIsFilled ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY; - + if (theIsFilled) + { + mySensType = Select3D_TOS_INTERIOR; + } + else + { + mySensType = Select3D_TOS_BOUNDARY; + } if (myPolyg.Size() != 1) { initCircle (myPolyg, theCircle, Min (theU1, theU2), Max (theU1, theU2), theIsFilled, theNbPnts); diff --git a/src/Select3D/Select3D_SensitiveSegment.cxx b/src/Select3D/Select3D_SensitiveSegment.cxx index 84e3a6edce..a8ef04906c 100644 --- a/src/Select3D/Select3D_SensitiveSegment.cxx +++ b/src/Select3D/Select3D_SensitiveSegment.cxx @@ -28,11 +28,11 @@ IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveSegment,Select3D_SensitiveEntity) Select3D_SensitiveSegment::Select3D_SensitiveSegment (const Handle(SelectMgr_EntityOwner)& theOwnerId, const gp_Pnt& theFirstPnt, const gp_Pnt& theLastPnt) -: Select3D_SensitiveEntity (theOwnerId) +: Select3D_SensitiveEntity (theOwnerId), myStart(theFirstPnt), myEnd(theLastPnt) { mySFactor = 3; - myStart = theFirstPnt; - myEnd = theLastPnt; + + } // ======================================================================= diff --git a/src/Select3D/Select3D_SensitiveTriangulation.cxx b/src/Select3D/Select3D_SensitiveTriangulation.cxx index a74516447b..e8c3aacf92 100644 --- a/src/Select3D/Select3D_SensitiveTriangulation.cxx +++ b/src/Select3D/Select3D_SensitiveTriangulation.cxx @@ -59,10 +59,10 @@ Select3D_SensitiveTriangulation::Select3D_SensitiveTriangulation (const Handle(S : Select3D_SensitiveSet (theOwnerId), myTriangul (theTrg), myInitLocation (theInitLoc), - myPrimitivesNb (0) + mySensType(theIsInterior ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY), myPrimitivesNb (0) { myInvInitLocation = myInitLocation.Transformation().Inverted(); - mySensType = theIsInterior ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY; + Standard_Integer aNbTriangles = 0; gp_XYZ aCenter (0.0, 0.0, 0.0); if (!theTrg->HasGeometry()) @@ -157,10 +157,10 @@ Select3D_SensitiveTriangulation::Select3D_SensitiveTriangulation (const Handle(S myInitLocation (theInitLoc), myCDG3D (theCOG), myFreeEdges (theFreeEdges), - myPrimitivesNb (0) + mySensType(theIsInterior ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY), myPrimitivesNb (0) { myInvInitLocation = myInitLocation.Transformation().Inverted(); - mySensType = theIsInterior ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY; + if (theTrg->HasGeometry()) { myPrimitivesNb = theIsInterior ? theTrg->NbTriangles() : theFreeEdges->Length() / 2; @@ -205,7 +205,7 @@ Select3D_BndBox3d Select3D_SensitiveTriangulation::Box (const Standard_Integer t if (mySensType == Select3D_TOS_INTERIOR) { - Standard_Integer aNode1, aNode2, aNode3; + Standard_Integer aNode1 = 0, aNode2 = 0, aNode3 = 0; myTriangul->Triangle (aPrimIdx + 1).Get (aNode1, aNode2, aNode3); const gp_Pnt aPnt1 = myTriangul->Node (aNode1); @@ -360,7 +360,7 @@ Standard_Boolean Select3D_SensitiveTriangulation::overlapsElement (SelectBasics_ } else { - Standard_Integer aNode1, aNode2, aNode3; + Standard_Integer aNode1 = 0, aNode2 = 0, aNode3 = 0; myTriangul->Triangle (aPrimitiveIdx + 1).Get (aNode1, aNode2, aNode3); const gp_Pnt aPnt1 = myTriangul->Node (aNode1); const gp_Pnt aPnt2 = myTriangul->Node (aNode2); @@ -396,7 +396,7 @@ Standard_Boolean Select3D_SensitiveTriangulation::elementIsInside (SelectBasics_ } else { - Standard_Integer aNode1, aNode2, aNode3; + Standard_Integer aNode1 = 0, aNode2 = 0, aNode3 = 0; myTriangul->Triangle (aPrimitiveIdx + 1).Get (aNode1, aNode2, aNode3); const gp_Pnt aPnt1 = myTriangul->Node (aNode1); diff --git a/src/SelectMgr/SelectMgr_AxisIntersector.cxx b/src/SelectMgr/SelectMgr_AxisIntersector.cxx index 44ff25b752..9f4a19454e 100644 --- a/src/SelectMgr/SelectMgr_AxisIntersector.cxx +++ b/src/SelectMgr/SelectMgr_AxisIntersector.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -230,7 +232,7 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox (const SelectMgr_Vec3& t "Error! SelectMgr_AxisIntersector::OverlapsBox() should be called after selection axis initialization"); (void )theInside; - Standard_Real aTimeEnter, aTimeLeave; + Standard_Real aTimeEnter = NAN, aTimeLeave = NAN; if (!hasIntersection (theBoxMin, theBoxMax, aTimeEnter, aTimeLeave)) { return Standard_False; @@ -254,7 +256,7 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox (const SelectMgr_Vec3& t Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point, "Error! SelectMgr_AxisIntersector::OverlapsBox() should be called after selection axis initialization"); - Standard_Real aTimeEnter, aTimeLeave; + Standard_Real aTimeEnter = NAN, aTimeLeave = NAN; if (!hasIntersection (theBoxMin, theBoxMax, aTimeEnter, aTimeLeave)) { return Standard_False; diff --git a/src/SelectMgr/SelectMgr_BaseFrustum.cxx b/src/SelectMgr/SelectMgr_BaseFrustum.cxx index f7cca23b14..028d04be83 100644 --- a/src/SelectMgr/SelectMgr_BaseFrustum.cxx +++ b/src/SelectMgr/SelectMgr_BaseFrustum.cxx @@ -26,9 +26,9 @@ IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_BaseFrustum, SelectMgr_BaseIntersector) // purpose : //======================================================================= SelectMgr_BaseFrustum::SelectMgr_BaseFrustum() -: myPixelTolerance (2) +: myPixelTolerance (2), myBuilder(new SelectMgr_FrustumBuilder()) { - myBuilder = new SelectMgr_FrustumBuilder(); + } //======================================================================= diff --git a/src/SelectMgr/SelectMgr_RectangularFrustum.cxx b/src/SelectMgr/SelectMgr_RectangularFrustum.cxx index 0031c5f275..3d20100954 100644 --- a/src/SelectMgr/SelectMgr_RectangularFrustum.cxx +++ b/src/SelectMgr/SelectMgr_RectangularFrustum.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -50,7 +52,7 @@ void SelectMgr_RectangularFrustum::segmentSegmentDistance (const gp_Pnt& theSegP Standard_Real anE = aV.Dot (aW); Standard_Real aCoef = anA * aC - aB * aB; Standard_Real aSn = aCoef; - Standard_Real aTc, aTn, aTd = aCoef; + Standard_Real aTc = NAN, aTn = NAN, aTd = aCoef; if (aCoef < gp::Resolution()) { @@ -493,7 +495,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsBox (const SelectMgr_Vec3 Standard_Real aDepth = 0.0; BVH_Ray aRay(SelectMgr_Vec3(myNearPickedPnt.X(), myNearPickedPnt.Y(), myNearPickedPnt.Z()), SelectMgr_Vec3(myViewRayDir.X(), myViewRayDir.Y(), myViewRayDir.Z())); - Standard_Real aTimeEnter, aTimeLeave; + Standard_Real aTimeEnter = NAN, aTimeLeave = NAN; if (!BVH_Tools::RayBoxIntersection (aRay, theBoxMin, theBoxMax, aTimeEnter, aTimeLeave)) { gp_Pnt aNearestPnt (RealLast(), RealLast(), RealLast()); diff --git a/src/SelectMgr/SelectMgr_SelectableObjectSet.cxx b/src/SelectMgr/SelectMgr_SelectableObjectSet.cxx index 8739f8c289..b3c49468be 100644 --- a/src/SelectMgr/SelectMgr_SelectableObjectSet.cxx +++ b/src/SelectMgr/SelectMgr_SelectableObjectSet.cxx @@ -39,7 +39,7 @@ namespace BVHBuilderAdaptorRegular (ObjectsMap& theObjects) : myObjects (theObjects) {}; //! Returns bounding box of object with index theIndex - virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE + Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE { const Handle(SelectMgr_SelectableObject)& anObject = myObjects.FindKey (theIndex + 1); Bnd_Box aBox; @@ -52,7 +52,7 @@ namespace } //! Returns bounding box of the whole subset. - virtual Select3D_BndBox3d Box() const Standard_OVERRIDE + Select3D_BndBox3d Box() const Standard_OVERRIDE { if (!myBox.IsValid()) { @@ -66,7 +66,7 @@ namespace //! Returns center of object with index theIndex in the set //! along the given axis theAxis - virtual Standard_Real Center (const Standard_Integer theIndex, + Standard_Real Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const Standard_OVERRIDE { const Select3D_BndBox3d aBndBox = Box (theIndex); @@ -76,19 +76,19 @@ namespace } //! Returns size of objects set. - virtual Standard_Integer Size() const Standard_OVERRIDE + Standard_Integer Size() const Standard_OVERRIDE { return myObjects.Size(); } //! Swaps items with indexes theIndex1 and theIndex2 in the set - virtual void Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2) Standard_OVERRIDE + void Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2) Standard_OVERRIDE { myObjects.Swap (theIndex1 + 1, theIndex2 + 1); } private: - BVHBuilderAdaptorRegular& operator=(BVHBuilderAdaptorRegular) { return *this; } + BVHBuilderAdaptorRegular& operator=(const BVHBuilderAdaptorRegular&) { return *this; } private: ObjectsMap& myObjects; @@ -178,13 +178,13 @@ namespace } //! Returns bounding box of object with index theIndex - virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE + Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE { return *myBoundings (theIndex + 1); } //! Returns bounding box of the whole subset. - virtual Select3D_BndBox3d Box() const Standard_OVERRIDE + Select3D_BndBox3d Box() const Standard_OVERRIDE { if (!myBox.IsValid()) { @@ -198,7 +198,7 @@ namespace //! Returns center of object with index theIndex in the set //! along the given axis theAxis - virtual Standard_Real Center (const Standard_Integer theIndex, + Standard_Real Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const Standard_OVERRIDE { const Select3D_BndBox3d& aBoundingBox = *myBoundings (theIndex + 1); @@ -207,13 +207,13 @@ namespace } //! Returns size of objects set. - virtual Standard_Integer Size() const Standard_OVERRIDE + Standard_Integer Size() const Standard_OVERRIDE { return myObjects.Size(); } //! Swaps items with indexes theIndex1 and theIndex2 in the set - virtual void Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2) Standard_OVERRIDE + void Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2) Standard_OVERRIDE { const Standard_Integer aStructIdx1 = theIndex1 + 1; const Standard_Integer aStructIdx2 = theIndex2 + 1; @@ -223,7 +223,7 @@ namespace } private: - BVHBuilderAdaptorPersistent& operator=(BVHBuilderAdaptorPersistent) { return *this; } + BVHBuilderAdaptorPersistent& operator=(const BVHBuilderAdaptorPersistent&) { return *this; } private: ObjectsMap& myObjects; diff --git a/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx b/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx index c8cb188fcf..ccf1174945 100644 --- a/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx +++ b/src/SelectMgr/SelectMgr_SelectableObjectSet.hxx @@ -220,7 +220,7 @@ private: NCollection_IndexedMap myObjects[BVHSubsetNb]; //!< Map of objects for each subset opencascade::handle > myBVH[BVHSubsetNb]; //!< BVH tree computed for each subset Handle(Select3D_BVHBuilder3d) myBuilder[BVHSubsetNb]; //!< Builder allocated for each subset - Standard_Boolean myIsDirty[BVHSubsetNb]; //!< Dirty flag for each subset + Standard_Boolean myIsDirty[BVHSubsetNb]{}; //!< Dirty flag for each subset Graphic3d_WorldViewProjState myLastViewState; //!< Last view-projection state used for construction of BVH Graphic3d_Vec2i myLastWinSize; //!< Last viewport's (window's) width used for construction of BVH friend class Iterator; diff --git a/src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx b/src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx index df3159d98f..71298ce19e 100644 --- a/src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx +++ b/src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx @@ -98,7 +98,7 @@ const Handle(Graphic3d_Camera)& SelectMgr_SelectingVolumeManager::Camera() const // function : SetCamera // purpose : //======================================================================= -void SelectMgr_SelectingVolumeManager::SetCamera (const Handle(Graphic3d_Camera) theCamera) +void SelectMgr_SelectingVolumeManager::SetCamera (const Handle(Graphic3d_Camera)& theCamera) { Standard_ASSERT_RAISE(!myActiveSelectingVolume.IsNull(), "SelectMgr_SelectingVolumeManager::SetCamera() should be called after initialization of selection volume "); @@ -546,7 +546,7 @@ const gp_Pnt* SelectMgr_SelectingVolumeManager::GetVertices() const return NULL; } const SelectMgr_RectangularFrustum* aRectFrustum = - static_cast (myActiveSelectingVolume.get()); + dynamic_cast (myActiveSelectingVolume.get()); if (aRectFrustum == NULL) { return NULL; diff --git a/src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx b/src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx index 708e7a885f..aed25cd94a 100644 --- a/src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx +++ b/src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx @@ -89,7 +89,7 @@ public: //! Updates camera projection and orientation matrices in all selecting volumes //! Note: this method should be called after selection volume building //! else exception will be thrown - Standard_EXPORT void SetCamera (const Handle(Graphic3d_Camera) theCamera); + Standard_EXPORT void SetCamera (const Handle(Graphic3d_Camera)& theCamera); //! Updates viewport in all selecting volumes //! Note: this method should be called after selection volume building diff --git a/src/SelectMgr/SelectMgr_SelectionImageFiller.cxx b/src/SelectMgr/SelectMgr_SelectionImageFiller.cxx index 5436525f6e..b747387290 100644 --- a/src/SelectMgr/SelectMgr_SelectionImageFiller.cxx +++ b/src/SelectMgr/SelectMgr_SelectionImageFiller.cxx @@ -46,7 +46,7 @@ namespace } } - virtual void Fill (const Standard_Integer theCol, + void Fill (const Standard_Integer theCol, const Standard_Integer theRow, const Standard_Integer thePicked) Standard_OVERRIDE { @@ -96,7 +96,7 @@ namespace } } - virtual void Fill (const Standard_Integer theCol, + void Fill (const Standard_Integer theCol, const Standard_Integer theRow, const Standard_Integer thePicked) Standard_OVERRIDE { @@ -133,7 +133,7 @@ namespace } //! Accumulate the data. - virtual void Fill (const Standard_Integer theCol, + void Fill (const Standard_Integer theCol, const Standard_Integer theRow, const Standard_Integer thePicked) Standard_OVERRIDE { @@ -156,7 +156,7 @@ namespace } //! Normalize the depth values. - virtual void Flush() Standard_OVERRIDE + void Flush() Standard_OVERRIDE { float aFrom = 0.0f; float aDelta = 1.0f; @@ -208,7 +208,7 @@ namespace SelectMgr_ViewerSelector* theSelector) : SelectMgr_SelectionImageFiller (thePixMap, theSelector) {} - virtual void Fill (const Standard_Integer theCol, + void Fill (const Standard_Integer theCol, const Standard_Integer theRow, const Standard_Integer thePicked) Standard_OVERRIDE { @@ -255,7 +255,7 @@ namespace } } - virtual void Fill (const Standard_Integer theCol, + void Fill (const Standard_Integer theCol, const Standard_Integer theRow, const Standard_Integer thePicked) Standard_OVERRIDE { @@ -300,7 +300,7 @@ namespace myMapSelectionModeColors.Bind (0x0100, Quantity_NOC_GOLD); // MeshVS_SMF_Group } - virtual void Fill (const Standard_Integer theCol, + void Fill (const Standard_Integer theCol, const Standard_Integer theRow, const Standard_Integer thePicked) Standard_OVERRIDE { @@ -355,7 +355,7 @@ namespace SelectMgr_ViewerSelector* theSelector) : SelectMgr_SelectionImageFiller (thePixMap, theSelector) {} - virtual void Fill (const Standard_Integer theCol, + void Fill (const Standard_Integer theCol, const Standard_Integer theRow, const Standard_Integer thePicked) Standard_OVERRIDE { @@ -378,7 +378,7 @@ namespace SelectMgr_ViewerSelector* theSelector) : SelectMgr_SelectionImageFiller (thePixMap, theSelector) {} - virtual void Fill (const Standard_Integer theCol, + void Fill (const Standard_Integer theCol, const Standard_Integer theRow, const Standard_Integer thePicked) Standard_OVERRIDE { diff --git a/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx b/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx index 41cf732333..fc24486a3f 100644 --- a/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx +++ b/src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx @@ -91,7 +91,7 @@ private: SelectMgr_IndexedMapOfHSensitive mySensitives; //!< Map of entities and its corresponding index in BVH SelectMgr_MapOfOwners myOwnersMap; //!< Map of entity owners and its corresponding number of sensitives - Standard_Boolean myHasEntityWithPersistence; //!< flag if some of sensitive entity has own transform persistence + Standard_Boolean myHasEntityWithPersistence{}; //!< flag if some of sensitive entity has own transform persistence }; #endif // _SelectMgr_SensitiveEntitySet_HeaderFile diff --git a/src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx b/src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx index 907a854061..e2a4699d75 100644 --- a/src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx +++ b/src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -549,7 +551,7 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsCylinder (const Standar const Standard_Real anAngle = aCylNorm.Angle (aDirNorm); const Standard_Real aCosAngle = Cos (anAngle); const gp_Pln aPln (myFrustums.First()->myVertices[0], aDirNorm); - Standard_Real aCoefA, aCoefB, aCoefC, aCoefD; + Standard_Real aCoefA = NAN, aCoefB = NAN, aCoefC = NAN, aCoefD = NAN; aPln.Coefficients (aCoefA, aCoefB, aCoefC, aCoefD); const Standard_Real aTBottom = -(aBottomCenter.XYZ().Dot (aDirNorm.XYZ()) + aCoefD) / aDirNorm.Dot (aDirNorm); @@ -659,7 +661,7 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsCircle (const Standard_ const gp_Dir aDirNorm (aVecPlane1.Crossed (aVecPlane2)); const gp_Pln aPln (myFrustums.First()->myVertices[0], aDirNorm); - Standard_Real aCoefA, aCoefB, aCoefC, aCoefD; + Standard_Real aCoefA = NAN, aCoefB = NAN, aCoefC = NAN, aCoefD = NAN; aPln.Coefficients (aCoefA, aCoefB, aCoefC, aCoefD); const Standard_Real aT = -(aCenter.XYZ().Dot (aDirNorm.XYZ()) + aCoefD) / aDirNorm.Dot (aDirNorm); @@ -903,7 +905,7 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::segmentTriangleIntersection (co const gp_Pnt& theV1, const gp_Pnt& theV2, const gp_Pnt& theV3) { gp_Vec aPVec, aTVec, aQVec; - Standard_Real aD, aInvD, anU, aV, aT; + Standard_Real aD = NAN, aInvD = NAN, anU = NAN, aV = NAN, aT = NAN; gp_Vec anEdge1 = theV2.XYZ() - theV1.XYZ(); gp_Vec anEdge2 = theV3.XYZ() - theV1.XYZ(); diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/SelectMgr/SelectMgr_ViewerSelector.cxx index 5f86073410..cb9e25042d 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -165,12 +165,12 @@ SelectMgr_ViewerSelector::SelectMgr_ViewerSelector() : myDepthTolerance (0.0), myDepthTolType (SelectMgr_TypeOfDepthTolerance_SensitivityFactor), myToPreferClosest (Standard_True), - myCameraScale (1.0), + myEntitySetBuilder(new BVH_BinnedBuilder (BVH_Constants_LeafNodeSizeSingle, BVH_Constants_MaxTreeDepth, Standard_True)), myCameraScale (1.0), myToPrebuildBVH (Standard_False), myIsSorted (Standard_False), myIsLeftChildQueuedFirst (Standard_False) { - myEntitySetBuilder = new BVH_BinnedBuilder (BVH_Constants_LeafNodeSizeSingle, BVH_Constants_MaxTreeDepth, Standard_True); + } //======================================================================= @@ -1044,8 +1044,7 @@ void SelectMgr_ViewerSelector::MoveSelectableObject (const Handle(SelectMgr_Sele //======================================================================= void SelectMgr_ViewerSelector::RemoveSelectableObject (const Handle(SelectMgr_SelectableObject)& theObject) { - Handle(SelectMgr_SelectableObject) anObj = theObject; - if (myMapOfObjectSensitives.UnBind (theObject)) + if (myMapOfObjectSensitives.UnBind (theObject)) { RemovePicked (theObject); mySelectableObjects.Remove (theObject); diff --git a/src/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx b/src/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx index 9b635a45fe..7391963623 100644 --- a/src/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx +++ b/src/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -55,9 +57,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeAlgo_AlgoContainer,Standard_Transient) //function : ShapeAlgo_AlgoContainer //purpose : //======================================================================= -ShapeAlgo_AlgoContainer::ShapeAlgo_AlgoContainer() +ShapeAlgo_AlgoContainer::ShapeAlgo_AlgoContainer() : myTC(new ShapeAlgo_ToolContainer) { - myTC = new ShapeAlgo_ToolContainer; + } //======================================================================= @@ -83,7 +85,7 @@ Standard_Boolean ShapeAlgo_AlgoContainer::ConnectNextWire (const Handle(ShapeAna return Standard_True; } - Standard_Real tailhead, tailtail, headtail, headhead; + Standard_Real tailhead = NAN, tailtail = NAN, headtail = NAN, headhead = NAN; saw->CheckShapeConnect (tailhead, tailtail, headtail, headhead, nextsewd->Wire(), maxtol); distmin = tailhead; Standard_Real precision = saw->Precision(); @@ -149,7 +151,7 @@ void ShapeAlgo_AlgoContainer::ApproxBSplineCurve (const Handle(Geom_BSplineCurve Standard_Integer deg = bspline->Degree(); Standard_Integer jpole = 1; - Standard_Integer j, PoleIndex, I1; + Standard_Integer j = 0, PoleIndex = 0, I1 = 0; PoleIndex = 1; I1 = 1; for ( Standard_Integer ipole = 1; ipole < NbPoles; ipole++) { @@ -200,7 +202,7 @@ void ShapeAlgo_AlgoContainer::ApproxBSplineCurve (const Handle(Geom_BSplineCurve TColgp_Array1OfPnt newP(1,jpole); mycurve->Poles(newP); Handle(IntSurf_LineOn2S) R = new IntSurf_LineOn2S(); - Standard_Real u1,v1,u2,v2; + Standard_Real u1 = NAN,v1 = NAN,u2 = NAN,v2 = NAN; u1 = v1 = 0.; u2 = v2 = 1.; for( j=1; j<=jpole; j++) { @@ -281,7 +283,7 @@ void ShapeAlgo_AlgoContainer::ApproxBSplineCurve (const Handle(Geom2d_BSplineCur Standard_Integer deg = bspline->Degree(); Standard_Integer jpole = 1; - Standard_Integer j, PoleIndex, I1; + Standard_Integer j = 0, PoleIndex = 0, I1 = 0; PoleIndex = 1; I1 = 1; for ( Standard_Integer ipole = 1; ipole < NbPoles; ipole++) { @@ -333,7 +335,7 @@ void ShapeAlgo_AlgoContainer::ApproxBSplineCurve (const Handle(Geom2d_BSplineCur TColgp_Array1OfPnt2d newP(1,jpole); mycurve->Poles(newP); Handle(IntSurf_LineOn2S) R = new IntSurf_LineOn2S(); - Standard_Real u2,v2; + Standard_Real u2 = NAN,v2 = NAN; u2 = v2 = 1.; for( j=1; j<=jpole; j++) { IntSurf_PntOn2S POn2S; @@ -423,12 +425,12 @@ void ShapeAlgo_AlgoContainer::ApproxBSplineCurve (const Handle(Geom2d_BSplineCur TopLoc_Location loc1, loc2; // BRepBuilderAPI_MakeWire makeWire1, makeWire2; ShapeExtend_WireData makeWire1, makeWire2; - Standard_Boolean iterCook, iterPerry; - Standard_Integer nEdges1, nEdges2; - Standard_Real length1, length2; - Standard_Real first1, first2; - Standard_Real last1, last2; - Standard_Real delta1, delta2; + Standard_Boolean iterCook = 0, iterPerry = 0; + Standard_Integer nEdges1 = 0, nEdges2 = 0; + Standard_Real length1 = NAN, length2 = NAN; + Standard_Real first1 = NAN, first2 = NAN; + Standard_Real last1 = NAN, last2 = NAN; + Standard_Real delta1 = NAN, delta2 = NAN; Handle (Geom_Curve) crv1; Handle (Geom_Curve) crv2; diff --git a/src/ShapeAnalysis/ShapeAnalysis.cxx b/src/ShapeAnalysis/ShapeAnalysis.cxx index 5517a17b35..9d664cbd95 100644 --- a/src/ShapeAnalysis/ShapeAnalysis.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -126,12 +128,12 @@ static inline void ReverseSeq (HSequence& Seq) Standard_Real ShapeAnalysis::TotCross2D(const Handle(ShapeExtend_WireData)& sewd, const TopoDS_Face& aFace) { - Standard_Integer i, nbc = 0; + Standard_Integer i = 0, nbc = 0; gp_Pnt2d fuv,luv, uv0; Standard_Real totcross=0; for(i=1; i<=sewd->NbEdges(); i++) { TopoDS_Edge edge = sewd->Edge(i); - Standard_Real f2d, l2d; + Standard_Real f2d = NAN, l2d = NAN; Handle(Geom2d_Curve) c2d = BRep_Tool::CurveOnSurface(edge,aFace,f2d,l2d); if ( !c2d.IsNull() ) { nbc++; @@ -172,7 +174,7 @@ Standard_Real ShapeAnalysis::ContourArea(const TopoDS_Wire& theWire) //for(i=1; i<=sewd->NbEdges(); i++) { for( ; aIte.More(); aIte.Next()) { TopoDS_Edge edge = TopoDS::Edge(aIte.Value()); //sewd->Edge(i); - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,first, last); if ( !c3d.IsNull() ) { @@ -282,7 +284,7 @@ void ShapeAnalysis::GetFaceUVBounds (const TopoDS_Face& F, for (;ex.More();ex.Next()) { TopoDS_Edge edge = TopoDS::Edge(ex.Current()); Handle(Geom2d_Curve) c2d; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; if ( ! sae.PCurve ( edge, F, c2d, f, l, Standard_False ) ) continue; sac.FillBndBox ( c2d, f, l, 20, Standard_True, B ); } diff --git a/src/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx b/src/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx index 821fabc107..6d0eb25e40 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -104,7 +106,7 @@ Standard_Boolean ShapeAnalysis_BoxBndTreeSelector:: gp_Pnt p1 = BRep_Tool::Pnt(V1); gp_Pnt p2 = BRep_Tool::Pnt(V2); - Standard_Real tailhead, tailtail, headhead, headtail; + Standard_Real tailhead = NAN, tailtail = NAN, headhead = NAN, headtail = NAN; tailhead = p1.Distance(myLPnt); tailtail = p2.Distance(myLPnt); headhead = p1.Distance(myFPnt); @@ -114,7 +116,7 @@ Standard_Boolean ShapeAnalysis_BoxBndTreeSelector:: if (tailhead > tailtail) {res1 = 1; dm1 = tailtail;} if (headtail > headhead) {res2 = 1; dm2 = headhead;} Standard_Integer result = res1; - Standard_Real min3d; + Standard_Real min3d = NAN; min3d = Min (dm1, dm2); if (min3d > myMin3d) return Standard_False; diff --git a/src/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx b/src/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx index 9fa226eb37..3683aae3c2 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -615,7 +617,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface(const TopoDS } gp_Ax3 aPos; TColStd_Array1OfReal aParams(1, Max(1, GetNbPars(theTarget))); - Standard_Boolean isOK; + Standard_Boolean isOK = 0; for (; anIter.More(); anIter.Next()) { Handle(Geom_Surface) anElemSurf1 = GetSurface(TopoDS::Face(anIter.Value()), theTol, @@ -656,7 +658,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface(const TopoDS Handle(Geom_Surface) aSurf; TopLoc_Location aLoc; Handle(Geom2d_Curve) aPCurve; - Standard_Real ff, ll; + Standard_Real ff = NAN, ll = NAN; BRep_Tool::CurveOnSurface(theEdge, aPCurve, aSurf, aLoc, ff, ll, j); if (aSurf.IsNull()) { break; @@ -685,7 +687,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface(const TopoDS Standard_Integer aNbPars = Max(1, GetNbPars(theTarget)); TColStd_Array1OfReal aParams(1, aNbPars); - Standard_Integer ifit = -1, i; + Standard_Integer ifit = -1, i = 0; Standard_Real aMinDev = RealLast(); if (aSurfs.Size() == 1) { @@ -744,8 +746,8 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface(const TopoDS gp_Ax3 aPos1 = thePos; Standard_Integer aNbPars = GetNbPars(theTarget); TColStd_Array1OfReal aParams1(1, Max(1, aNbPars)); - Standard_Real aGap1; - Standard_Integer i; + Standard_Real aGap1 = NAN; + Standard_Integer i = 0; for (i = 1; i <= aNbPars; ++i) { aParams1(i) = theParams(i); @@ -766,7 +768,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface(const TopoDS { aParams(i) = aParams1(i); } - Standard_Real aGap; + Standard_Real aGap = NAN; const TopoDS_Edge& anEdge = TopoDS::Edge(anIter.Value()); Handle(Geom_Surface) anElemSurf = GetSurface(anEdge, theTol, theType, theTarget, aPos, aParams, aGap, theStatus); @@ -833,7 +835,7 @@ Standard_Boolean ShapeAnalysis_CanonicalRecognition::GetSurfaceByLS(const TopoDS // Standard_Real aTol = Precision::Confusion(); - math_MultipleVarFunction* aPFunc; + math_MultipleVarFunction* aPFunc = nullptr; GeomConvert_FuncSphereLSDist aFuncSph(aPoints); GeomConvert_FuncCylinderLSDist aFuncCyl(aPoints, thePos.Direction()); GeomConvert_FuncConeLSDist aFuncCon(aPoints, thePos.Direction()); @@ -854,13 +856,13 @@ Standard_Boolean ShapeAnalysis_CanonicalRecognition::GetSurfaceByLS(const TopoDS // math_Vector aSteps(1, aNbVar); Standard_Integer aNbInt = 10; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= aNbVar; ++i) { aSteps(i) = (aLBnd(i) - aFBnd(i)) / aNbInt; } math_PSO aGlobSolver(aPFunc, aFBnd, aLBnd, aSteps); - Standard_Real aLSDist; + Standard_Real aLSDist = NAN; aGlobSolver.Perform(aSteps, aLSDist, aStartPoint); SetCanonicParameters(theTarget, aStartPoint, thePos, theParams); @@ -924,7 +926,7 @@ Handle(Geom_Curve) ShapeAnalysis_CanonicalRecognition::GetCurve(const TopoDS_Edg { theStatus = 0; TopLoc_Location aLoc; - Standard_Real f, l, nf, nl; + Standard_Real f = NAN, l = NAN, nf = NAN, nl = NAN; const Handle(Geom_Curve)& aCurv = BRep_Tool::Curve(theEdge, aLoc, f, l); if (aCurv.IsNull()) { @@ -1049,7 +1051,7 @@ Standard_Boolean CompareConicParams(const GeomAbs_CurveType theTarget, const Sta const gp_Ax2& theRefPos, const TColStd_Array1OfReal& theRefParams, const gp_Ax2& thePos, const TColStd_Array1OfReal& theParams) { - Standard_Integer i, aNbPars = GetNbPars(theTarget); + Standard_Integer i = 0, aNbPars = GetNbPars(theTarget); for (i = 1; i <= aNbPars; ++i) { @@ -1243,7 +1245,7 @@ Standard_Boolean GetSamplePoints(const TopoDS_Wire& theWire, if(aTotalLength < theTol) return Standard_False; - Standard_Integer i, aNb = aLengths.Length(); + Standard_Integer i = 0, aNb = aLengths.Length(); for (i = 0; i < aNb; ++i) { const BRepAdaptor_Curve& aC = aCurves(i); @@ -1254,7 +1256,7 @@ Standard_Boolean GetSamplePoints(const TopoDS_Wire& theWire, if (!aPointGen.IsDone()) continue; aNbPoints = aPointGen.NbPoints(); - Standard_Integer j; + Standard_Integer j = 0; for (j = 1; j <= aNbPoints; ++j) { Standard_Real t = aPointGen.Parameter(j); @@ -1290,7 +1292,7 @@ static Standard_Real GetLSGap(const Handle(TColgp_HArray1OfXYZ)& thePoints, cons gp_Vec aDir(thePos.Direction()); - Standard_Integer i; + Standard_Integer i = 0; if (theTarget == GeomAbs_Sphere) { Standard_Real anR = theParams(1); @@ -1316,7 +1318,7 @@ static Standard_Real GetLSGap(const Handle(TColgp_HArray1OfXYZ)& thePoints, cons Standard_Real anR = theParams(2); for (i = thePoints->Lower(); i <= thePoints->Upper(); ++i) { - Standard_Real u, v; + Standard_Real u = NAN, v = NAN; gp_Pnt aPi(thePoints->Value(i)); ElSLib::ConeParameters(thePos, anR, anAng, aPi, u, v); gp_Pnt aPp; @@ -1347,7 +1349,7 @@ void FillSolverData(const GeomAbs_SurfaceType theTarget, theStartPoint(4) = theParams(1); Standard_Real aDR = theRelDev * theParams(1); Standard_Real aDXYZ = aDR; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= 3; ++i) { theFBnd(i) = theStartPoint(i) - aDXYZ; @@ -1370,7 +1372,7 @@ void FillSolverData(const GeomAbs_SurfaceType theTarget, } Standard_Real aDXYZ = aDR; Standard_Real aDAng = theRelDev * Abs(theParams(1)); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= 3; ++i) { theFBnd(i) = theStartPoint(i) - aDXYZ; diff --git a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx index 97528b8911..f056e26f63 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -60,13 +62,13 @@ //function : ShapeAnalysis_CheckSmallFace //purpose : //======================================================================= -ShapeAnalysis_CheckSmallFace::ShapeAnalysis_CheckSmallFace() +ShapeAnalysis_CheckSmallFace::ShapeAnalysis_CheckSmallFace() : myStatusSpot(ShapeExtend::EncodeStatus ( ShapeExtend_OK )), myStatusStrip(ShapeExtend::EncodeStatus ( ShapeExtend_OK )), myStatusPin(ShapeExtend::EncodeStatus ( ShapeExtend_OK )), myStatusTwisted(ShapeExtend::EncodeStatus ( ShapeExtend_OK )), myStatusSplitVert(ShapeExtend::EncodeStatus ( ShapeExtend_OK )) { - myStatusSpot = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); - myStatusStrip = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); - myStatusPin = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); - myStatusTwisted = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); - myStatusSplitVert = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); + + + + + } static void MinMaxPnt @@ -74,7 +76,7 @@ static void MinMaxPnt Standard_Real& minx, Standard_Real& miny, Standard_Real& minz, Standard_Real& maxx, Standard_Real& maxy, Standard_Real& maxz) { - Standard_Real x,y,z; + Standard_Real x = NAN,y = NAN,z = NAN; p.Coord (x,y,z); if (nb < 1) { minx = maxx = x; miny = maxy = y; minz = maxz = z; } else @@ -152,7 +154,7 @@ static Standard_Boolean MinMaxSmall // By picking intermediate point on each one for (TopExp_Explorer ie(F,TopAbs_EDGE); ie.More(); ie.Next()) { TopoDS_Edge E = TopoDS::Edge (ie.Current()); - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; Handle(Geom_Curve) C3D = BRep_Tool::Curve (E,cf,cl); if (C3D.IsNull()) continue; gp_Pnt debut = C3D->Value (cf); @@ -177,7 +179,7 @@ static Standard_Boolean MinMaxSmall Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckSpotFace(const TopoDS_Face& F,const Standard_Real tol) { gp_Pnt spot; - Standard_Real spotol; + Standard_Real spotol = NAN; Standard_Integer stat = IsSpotFace (F,spot,spotol,tol); if(!stat) return Standard_False; switch(stat) { @@ -213,7 +215,7 @@ static Standard_Boolean MinMaxSmall // Standard_Integer stat = 2; // 2 : small in V direction if (!bs.IsNull() || !bz.IsNull()) { Standard_Boolean cbz = (!bz.IsNull()); - Standard_Integer iu,iv, nbu, nbv; + Standard_Integer iu = 0,iv = 0, nbu = 0, nbv = 0; if (cbz) { nbu = bz->NbUPoles(), nbv = bz->NbVPoles(); } else { nbu = bs->NbUPoles(), nbv = bs->NbVPoles(); } // Standard_Real dx = 0, dy = 0, dz = 0; @@ -275,7 +277,7 @@ static Standard_Boolean MinMaxSmall Standard_Integer nbint = 10; ShapeAnalysis_Curve SAC; - Standard_Real cf1,cl1,cf2,cl2,u; dmax = 0; + Standard_Real cf1 = NAN,cl1 = NAN,cf2 = NAN,cl2 = NAN,u = NAN; dmax = 0; Handle(Geom_Curve) C1,C2; C1 = BRep_Tool::Curve (E1,cf1,cl1); C2 = BRep_Tool::Curve (E2,cf2,cl2); @@ -295,7 +297,7 @@ static Standard_Boolean MinMaxSmall Standard_Real cd1 = (cl1 - cf1)/nbint; Standard_Real cd2 = (cl2 - cf2)/nbint; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; f = cf2; l = cl2; for (int numcur = 0; numcur < 2; numcur ++) { u = cf1; @@ -306,7 +308,7 @@ static Standard_Boolean MinMaxSmall } for (int nump = 0; nump <= nbint; nump ++) { gp_Pnt p2, p1 = C1T->Value (u); - Standard_Real para; + Standard_Real para = NAN; //pdn Adaptor curve is used to avoid of enhancing of domain. GeomAdaptor_Curve GAC(C2T); Standard_Real dist = SAC.Project (GAC,p1,toler,p2,para); @@ -344,7 +346,7 @@ static Standard_Boolean MinMaxSmall // Extremities Standard_Real dist = p1.Distance(p2); // Middle point - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; Handle(Geom_Curve) CC; CC = BRep_Tool::Curve (E,cf,cl); Standard_Boolean isNullLength = Standard_True; @@ -379,7 +381,7 @@ static Standard_Boolean MinMaxSmall TopoDS_Edge& E1, TopoDS_Edge& E2,const Standard_Real tol) { Standard_Real toler = tol; - Standard_Real minx,miny,minz,maxx,maxy,maxz; + Standard_Real minx = NAN,miny = NAN,minz = NAN,maxx = NAN,maxy = NAN,maxz = NAN; // In this case, we have 2 vertices and 2 great edges. Plus possibly 2 small // edges, one on each vertex @@ -404,7 +406,7 @@ static Standard_Boolean MinMaxSmall TopoDS_Vertex VA,VB; TopExp::Vertices (E,VA,VB); if (tol < 0) { - Standard_Real tolv; + Standard_Real tolv = NAN; tolv = BRep_Tool::Tolerance (VA); if (toler < tolv) toler = tolv; tolv = BRep_Tool::Tolerance (VB); @@ -442,7 +444,7 @@ static Standard_Boolean MinMaxSmall if (nb < 2) return Standard_False; // only one vertex : cannot be a strip ... // Checking if E1 and E2 define a Strip - Standard_Real dmax; + Standard_Real dmax = NAN; if (!CheckStripEdges (E1,E2,tol,dmax)) return Standard_False; myStatusStrip = ShapeExtend::EncodeStatus (ShapeExtend_DONE3); return Standard_True; @@ -468,7 +470,7 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckStripFace(const TopoDS_Face& // ?? Record Diagnostic "StripFace", no data (should be "Edges1" "Edges2") // but direction is known (1:U 2:V) // TopoDS_Edge E1,E2; - Standard_Real dmax; + Standard_Real dmax = NAN; if(FindStripEdges (F,E1,E2,tol,dmax)) return Standard_True; // Now, trying edges : if there are 2 and only 2 edges greater than tolerance @@ -527,20 +529,20 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckStripFace(const TopoDS_Face& TopoDS_Edge E = TopoDS::Edge (ite.Current()); TopoDS_Vertex V1,V2; TopExp::Vertices (E,V1,V2); - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; Handle(Geom_Curve) C3D = BRep_Tool::Curve (E,cf,cl); if (C3D.IsNull()) continue; if (V.IsSame(V1) || V.IsSame(V2)) continue; gp_Pnt unp = vtp.Value(iv); Standard_Real unt = vto.Value(iv); gp_Pnt proj; - Standard_Real param; + Standard_Real param = NAN; Standard_Real dist = SAC.Project (C3D,unp,unt*10.,proj,param,cf,cl); if (dist == 0.0) continue; //smh // Splitting Vertex to record ? if (dist < unt) { // If Split occurs at beginning or end, it is not a split ... - Standard_Real fpar, lpar, eps = 1.e-06; + Standard_Real fpar = NAN, lpar = NAN, eps = 1.e-06; if (param >=cl || param <= cf) continue; // Out of range fpar = param - cf; lpar = param - cl; if ((Abs(fpar) < eps) || (Abs(lpar) < eps)) continue; // Near end or start @@ -568,7 +570,7 @@ static Standard_Integer IsoStat const Standard_Integer uorv, const Standard_Integer rank, const Standard_Real tolpin, const Standard_Real toler) { - Standard_Integer i, np = 0; + Standard_Integer i = 0, np = 0; Standard_Integer i0 = (uorv == 1 ? poles.LowerCol() : poles.LowerRow()); Standard_Integer i1 = (uorv == 1 ? poles.UpperCol() : poles.UpperRow()); Standard_Real xmin = 0.,ymin = 0.,zmin = 0., xmax = 0.,ymax = 0.,zmax = 0.; @@ -686,8 +688,8 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckTwisted (const TopoDS_Face& TColStd_Array2OfReal nx (1,nbint+1,1,nbint+1); TColStd_Array2OfReal ny (1,nbint+1,1,nbint+1); TColStd_Array2OfReal nz (1,nbint+1,1,nbint+1); - Standard_Integer iu,iv; - Standard_Real umin,umax,vmin,vmax; + Standard_Integer iu = 0,iv = 0; + Standard_Real umin = NAN,umax = NAN,vmin = NAN,vmax = NAN; surf->Bounds (umin,umax,vmin,vmax); Standard_Real u = umin, du = (umax-umin)/nbint; Standard_Real v = vmin, dv = (umax-umin)/nbint; @@ -745,7 +747,7 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckTwisted (const TopoDS_Face& //ShapeFix_Wire sfw; TopExp_Explorer exp_w (F,TopAbs_WIRE); exp_w.More(); - Standard_Real coef1=0, coef2; // =0 for deleting warning (skl) + Standard_Real coef1=0, coef2 = NAN; // =0 for deleting warning (skl) TopoDS_Wire theCurWire = TopoDS::Wire (exp_w.Current()); ShapeAnalysis_WireOrder wi; ShapeAnalysis_Wire sfw; @@ -837,7 +839,7 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckTwisted (const TopoDS_Face& const Standard_Real coef2,const Standard_Real toler) const { - Standard_Real cf1,cl1,cf2,cl2; + Standard_Real cf1 = NAN,cl1 = NAN,cf2 = NAN,cl2 = NAN; Handle(Geom_Curve) C1,C2,C3; C1 = BRep_Tool::Curve (theFirstEdge,cf1,cl1); C2 = BRep_Tool::Curve (theSecondEdge,cf2,cl2); @@ -850,7 +852,7 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckTwisted (const TopoDS_Face& p2 = C1->Value(cl1); pp1 = C2->Value(cf2); pp2 = C2->Value(cl2); - Standard_Real tol; + Standard_Real tol = NAN; Standard_Real paramc1=0, paramc2=0; // =0 for deleting warning (skl) TopoDS_Vertex theSharedV = TopExp::LastVertex(theFirstEdge); if (toler == -1) tol = BRep_Tool::Tolerance(theSharedV); else tol = toler; @@ -896,7 +898,7 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckTwisted (const TopoDS_Face& //proj = C2->Value(paramc2 + 9*d2); //else proj = C2->Value(paramc2 -d2); } - Standard_Real param; + Standard_Real param = NAN; GeomAdaptor_Curve GAC(C3); Standard_Real f = C3->FirstParameter(); Standard_Real l = C3->LastParameter(); diff --git a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.hxx b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.hxx index a6fe1506c6..86e25a9789 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.hxx @@ -188,15 +188,15 @@ private: TopoDS_Shape myComp; - Standard_Integer myStatus; + Standard_Integer myStatus{}; Standard_Integer myStatusSpot; Standard_Integer myStatusStrip; Standard_Integer myStatusPin; Standard_Integer myStatusTwisted; Standard_Integer myStatusSplitVert; - Standard_Integer myStatusPinFace; - Standard_Integer myStatusPinEdges; - Standard_Real myPrecision; + Standard_Integer myStatusPinFace{}; + Standard_Integer myStatusPinEdges{}; + Standard_Real myPrecision{}; }; diff --git a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx index 26ae1e8286..0cb858aa29 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx @@ -20,6 +20,8 @@ // gka 21.06.99 S4208: adding method NextProject(Adaptor_Curve) // msv 30.05.00 correct IsPlanar for a conic curve +#include + #include #include #include @@ -67,7 +69,7 @@ static void ProjectOnSegments (const Adaptor3d_Curve& AC, const gp_Pnt& P3D, // On considere points sur [uMin,uMax] // Quel est le plus proche. Et quel est le nouvel intervalle // (il ne peut pas deborder l ancien) - Standard_Real u, dist2, delta = (nbseg == 0)? 0 : (uMax-uMin)/nbseg; //szv#4:S4163:12Mar99 anti-exception + Standard_Real u = NAN, dist2 = NAN, delta = (nbseg == 0)? 0 : (uMax-uMin)/nbseg; //szv#4:S4163:12Mar99 anti-exception Standard_Real distmin2 = distmin * distmin; Standard_Boolean aHasChanged = Standard_False; for (Standard_Integer i = 0; i <= nbseg; i ++) { @@ -119,7 +121,7 @@ Standard_Real ShapeAnalysis_Curve::Project(const Handle(Geom_Curve)& C3D, const Standard_Real cl, const Standard_Boolean AdjustToEnds) const { - Standard_Real distmin; + Standard_Real distmin = NAN; Standard_Real uMin = (cf < cl ? cf : cl); Standard_Real uMax = (cf < cl ? cl : cf); @@ -232,7 +234,7 @@ Standard_Real ShapeAnalysis_Curve::ProjectAct(const Adaptor3d_Curve& C3D, try { OCC_CATCH_SIGNALS Extrema_ExtPC myExtPC(P3D,C3D); - Standard_Real dist2Min = RealLast() , dist2; + Standard_Real dist2Min = RealLast() , dist2 = NAN; Standard_Integer index = 0; if ( myExtPC.IsDone() && ( myExtPC.NbExt() > 0) ) { @@ -388,7 +390,7 @@ Standard_Real ShapeAnalysis_Curve::ProjectAct(const Adaptor3d_Curve& C3D, if (IsHaveOldSol) { // PTV 29.05.2002 Compare old solution and new; - Standard_Real adist1, adist2; + Standard_Real adist1 = NAN, adist2 = NAN; adist1 = anOldProj.SquareDistance(P3D); adist2 = proj.SquareDistance (P3D); if (adist1 < adist2) { @@ -636,7 +638,7 @@ static Standard_Integer SearchForExtremum (const Handle(Geom2d_Curve)& C2d, Standard_Real &par, gp_Pnt2d &res) { - Standard_Real prevpar; + Standard_Real prevpar = NAN; Standard_Integer nbOut = 0; for (Standard_Integer i = 0; i <10; i++) { prevpar = par; @@ -753,7 +755,7 @@ Standard_Integer ShapeAnalysis_Curve::SelectForwardSeam(const Handle(Geom2d_Curv L2 = new Geom2d_Line(StartBC2, VecBC2); } - Standard_Boolean UdirPos, UdirNeg, VdirPos, VdirNeg; + Standard_Boolean UdirPos = 0, UdirNeg = 0, VdirPos = 0, VdirNeg = 0; UdirPos = UdirNeg = VdirPos = VdirNeg = Standard_False; gp_Dir2d theDir = L1->Direction(); @@ -939,7 +941,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts, } Normal = Normal / nrm; - Standard_Real mind = RealLast(), maxd = -RealLast(), dev; + Standard_Real mind = RealLast(), maxd = -RealLast(), dev = NAN; for (Standard_Integer i = 1; i <= pnts.Length(); i++) { dev = pnts(i).XYZ() * Normal; if (dev < mind) mind = dev; @@ -1017,7 +1019,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar (const TColgp_Array1OfPnt& pnts, //DeclareAndCast(ShapeExtend_ComplexCurve, Complex, curve); Handle(ShapeExtend_ComplexCurve) Complex = Handle(ShapeExtend_ComplexCurve)::DownCast (curve); TColgp_SequenceOfPnt sequence; - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <= Complex->NbCurves(); i++) AppendControlPoles(sequence,Complex->Curve(i)); TColgp_Array1OfPnt Poles(1,sequence.Length()); @@ -1193,7 +1195,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsClosed(const Handle(Geom_Curve)& theCurv Standard_Real prec = Max (preci, Precision::Confusion()); - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; f = theCurve->FirstParameter(); l = theCurve->LastParameter(); diff --git a/src/ShapeAnalysis/ShapeAnalysis_Edge.cxx b/src/ShapeAnalysis/ShapeAnalysis_Edge.cxx index 3a77d8d02f..a3bdfea9ed 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Edge.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Edge.cxx @@ -18,6 +18,8 @@ //:s4 abv 26.04.99: sim6049.igs 21677: copy of curve is necessary to get True SP // abv 06.05.99: S4137: adding methods GetTangent2d() +#include + #include #include #include @@ -53,9 +55,9 @@ //function : ShapeAnalysis_Edge //purpose : //======================================================================= -ShapeAnalysis_Edge::ShapeAnalysis_Edge() +ShapeAnalysis_Edge::ShapeAnalysis_Edge() : myStatus(0) { - myStatus = 0;//ShapeExtend::EncodeStatus (ShapeExtend_OK); + //ShapeExtend::EncodeStatus (ShapeExtend_OK); } @@ -85,7 +87,7 @@ Standard_Boolean ShapeAnalysis_Edge::BoundUV (const TopoDS_Edge& edge, gp_Pnt2d& first, gp_Pnt2d& last) const { Handle(Geom2d_Curve) c2d; - Standard_Real uf,ul; + Standard_Real uf = NAN,ul = NAN; if (!PCurve (edge, surface, location, c2d, uf, ul)) return Standard_False; first = c2d->Value (uf); last = c2d->Value (ul); @@ -100,7 +102,7 @@ Standard_Boolean ShapeAnalysis_Edge::BoundUV (const TopoDS_Edge& edge, Standard_Boolean ShapeAnalysis_Edge::HasCurve3d (const TopoDS_Edge& edge) const { - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve (edge, cf, cl); return !c3d.IsNull(); } @@ -138,7 +140,7 @@ Standard_Boolean ShapeAnalysis_Edge::Curve3d (const TopoDS_Edge& edge, Standard_Boolean ShapeAnalysis_Edge::IsClosed3d (const TopoDS_Edge& edge) const { - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve (edge,cf,cl); if (c3d.IsNull()) return Standard_False; if (!c3d->IsClosed()) return Standard_False; @@ -170,7 +172,7 @@ Standard_Boolean ShapeAnalysis_Edge::HasPCurve (const TopoDS_Edge& edge, const TopLoc_Location& location) const { //try { //szv#4:S4163:12Mar99 waste try - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) c2d = BRep_Tool::CurveOnSurface (edge, surface, location, cf, cl); return !c2d.IsNull(); /* } @@ -329,7 +331,7 @@ Standard_Boolean ShapeAnalysis_Edge::GetEndTangent2d (const TopoDS_Edge &edge, gp_Vec2d &v, const Standard_Real dparam) const { - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) c2d; if ( ! PCurve ( edge, S, L, c2d, cf, cl ) ) { v = gp_Vec2d(0,0); @@ -339,7 +341,7 @@ Standard_Boolean ShapeAnalysis_Edge::GetEndTangent2d (const TopoDS_Edge &edge, if(dpnew>Precision::Confusion()) { gp_Pnt2d ptmp; - Standard_Real par1,par2,delta=(cl-cf)*dpnew; + Standard_Real par1 = NAN,par2 = NAN,delta=(cl-cf)*dpnew; if(Abs(delta)SameParameter(); // Get 3D curve of the edge - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; TopLoc_Location aCurveLoc; Handle(Geom_Curve) aC3D = BRep_Tool::Curve(edge, aCurveLoc, aFirst, aLast); if (aC3D.IsNull()) { @@ -770,7 +772,7 @@ Standard_Boolean ShapeAnalysis_Edge::CheckSameParameter (const TopoDS_Edge& edge Handle(Geom2d_Curve) aPC; Handle(Geom_Surface) aS; TopLoc_Location aLoc; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; BRep_Tool::CurveOnSurface(edge, aPC, aS, aLoc, f, l, i); @@ -815,7 +817,7 @@ Standard_Boolean ShapeAnalysis_Edge::CheckSameParameter (const TopoDS_Edge& edge // check the deviation for the projection of the 3d curve on plane if (!IsPCurveFound && !aFaceSurf.IsNull()) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom2d_Curve) aPC = BRep_Tool::CurveOnPlane(edge, aFaceSurf, aFaceLoc, f, l); if (!aPC.IsNull()) { @@ -930,7 +932,7 @@ Standard_Boolean ShapeAnalysis_Edge::CheckOverlapping(const TopoDS_Edge& theEdge Standard_Integer NbSol = aMinDist.NbSolution(); for(Standard_Integer i =1; i<= NbSol && !isOverlap; i++) { BRepExtrema_SupportType aType1 = aMinDist.SupportTypeShape1(i); - Standard_Real aEndLength, aStartLength, aLengthP; + Standard_Real aEndLength = NAN, aStartLength = NAN, aLengthP = NAN; if(aType1 == BRepExtrema_IsVertex) { TopoDS_Shape aSupportShape1 = aMinDist.SupportOnShape1(i); TopoDS_Vertex aV1,aV2; @@ -941,7 +943,7 @@ Standard_Boolean ShapeAnalysis_Edge::CheckOverlapping(const TopoDS_Edge& theEdge aLengthP =aLength; } else if(aType1 == BRepExtrema_IsOnEdge) { - Standard_Real aParam1, aFirst, aLast; + Standard_Real aParam1 = NAN, aFirst = NAN, aLast = NAN; aMinDist.ParOnEdgeS1 ( i, aParam1 ); BRep_Tool::Range(aFirstEdge,aFirst,aLast); BRepAdaptor_Curve anAdaptor(aFirstEdge); diff --git a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundData.cxx b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundData.cxx index b1fb20db84..85b4805624 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundData.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundData.cxx @@ -27,9 +27,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeAnalysis_FreeBoundData,Standard_Transient) //function : ShapeAnalysis_FreeBoundData //purpose : Empty constructor //======================================================================= -ShapeAnalysis_FreeBoundData::ShapeAnalysis_FreeBoundData() +ShapeAnalysis_FreeBoundData::ShapeAnalysis_FreeBoundData() : myNotches(new TopTools_HSequenceOfShape()) { - myNotches = new TopTools_HSequenceOfShape(); + Clear(); } @@ -38,9 +38,9 @@ ShapeAnalysis_FreeBoundData::ShapeAnalysis_FreeBoundData() //purpose : Creates object with contour given in the form of TopoDS_Wire //======================================================================= -ShapeAnalysis_FreeBoundData::ShapeAnalysis_FreeBoundData(const TopoDS_Wire& freebound) +ShapeAnalysis_FreeBoundData::ShapeAnalysis_FreeBoundData(const TopoDS_Wire& freebound) : myNotches(new TopTools_HSequenceOfShape()) { - myNotches = new TopTools_HSequenceOfShape(); + Clear(); SetFreeBound(freebound); } diff --git a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundData.hxx b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundData.hxx index 98a28b67d9..4207453dde 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundData.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundData.hxx @@ -126,10 +126,10 @@ private: TopoDS_Wire myBound; - Standard_Real myArea; - Standard_Real myPerimeter; - Standard_Real myRatio; - Standard_Real myWidth; + Standard_Real myArea{}; + Standard_Real myPerimeter{}; + Standard_Real myRatio{}; + Standard_Real myWidth{}; Handle(TopTools_HSequenceOfShape) myNotches; TopTools_DataMapOfShapeReal myNotchesParams; diff --git a/src/ShapeAnalysis/ShapeAnalysis_FreeBounds.cxx b/src/ShapeAnalysis/ShapeAnalysis_FreeBounds.cxx index 5f88528942..0ea9300cdc 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_FreeBounds.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_FreeBounds.cxx @@ -140,7 +140,7 @@ ShapeAnalysis_FreeBounds::ShapeAnalysis_FreeBounds(const TopoDS_Shape& shape, Handle(TopTools_HSequenceOfShape) iwires = new TopTools_HSequenceOfShape; BRep_Builder B; - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for (i = 1; i <= edges->Length(); i++) { TopoDS_Wire wire; B.MakeWire (wire); @@ -183,7 +183,7 @@ ShapeAnalysis_FreeBounds::ShapeAnalysis_FreeBounds(const TopoDS_Shape& shape, if (iwires.IsNull() || !iwires->Length()) return; Handle(TopTools_HArray1OfShape) arrwires = new TopTools_HArray1OfShape(1, iwires->Length()); //amv - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= arrwires->Length(); i++) arrwires->SetValue(i, iwires->Value(i)); owires = new TopTools_HSequenceOfShape; @@ -224,7 +224,7 @@ ShapeAnalysis_FreeBounds::ShapeAnalysis_FreeBounds(const TopoDS_Shape& shape, } aTreeFiller.Fill(); - Standard_Integer nsel; + Standard_Integer nsel = 0; ShapeAnalysis_Edge sae; //szv#4:S4163:12Mar99 moved Standard_Boolean done = Standard_False; @@ -414,14 +414,14 @@ static void SplitWire(const TopoDS_Wire& wire, statuses.Init (0); //building closed wires - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for (i = 1; i <= nbedges; i++) if (statuses.Value (i) == 0) { ces.Append (i); statuses.SetValue (i, 1); //putting into CES Standard_Boolean SearchBackward = Standard_True; for(;;) { - Standard_Boolean found; + Standard_Boolean found = 0; TopoDS_Edge edge; TopoDS_Vertex lvertex; gp_Pnt lpoint; @@ -433,7 +433,7 @@ static void SplitWire(const TopoDS_Wire& wire, edge = sewd->Edge (ces.Last()); lvertex = sae.LastVertex (edge); lpoint = BRep_Tool::Pnt (lvertex); - Standard_Integer j; // svv #1 + Standard_Integer j = 0; // svv #1 for (j = ces.Length(); (j >= 1) && !found; j--) { TopoDS_Vertex fv = sae.FirstVertex (sewd->Edge (ces.Value (j)) ); gp_Pnt fp = BRep_Tool::Pnt (fv); @@ -463,7 +463,7 @@ static void SplitWire(const TopoDS_Wire& wire, edge = sewd->Edge (ces.Last()); lvertex = sae.LastVertex (edge); lpoint = BRep_Tool::Pnt (lvertex); - Standard_Integer j; // svv #1 + Standard_Integer j = 0; // svv #1 for (j = 1; (j <= nbedges) && !found; j++) if (statuses.Value (j) == 0) { TopoDS_Vertex fv = sae.FirstVertex (sewd->Edge (j)); diff --git a/src/ShapeAnalysis/ShapeAnalysis_FreeBounds.hxx b/src/ShapeAnalysis/ShapeAnalysis_FreeBounds.hxx index 4d2ca9d490..f694c899cf 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_FreeBounds.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_FreeBounds.hxx @@ -158,10 +158,10 @@ private: TopoDS_Compound myWires; TopoDS_Compound myEdges; - Standard_Real myTolerance; - Standard_Boolean myShared; - Standard_Boolean mySplitClosed; - Standard_Boolean mySplitOpen; + Standard_Real myTolerance{}; + Standard_Boolean myShared{}; + Standard_Boolean mySplitClosed{}; + Standard_Boolean mySplitOpen{}; }; diff --git a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx index c176ed0d1c..a8c64551b0 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx @@ -17,6 +17,8 @@ // 25.12.98 pdn renaming of ShapeAnalysis_FreeBounds and ShapeAnalysis_Wire methods //szv#4 S4163 +#include + #include #include #include @@ -39,7 +41,7 @@ #define NbControl 23 -static void ContourProperties(TopoDS_Wire wire, +static void ContourProperties(const TopoDS_Wire& wire, Standard_Real& countourArea, Standard_Real& countourLength) { @@ -49,9 +51,9 @@ static void ContourProperties(TopoDS_Wire wire, gp_XYZ prev, cont; for (BRepTools_WireExplorer exp(wire); exp.More(); exp.Next()) { - TopoDS_Edge Edge = exp.Current(); nbe++; + const TopoDS_Edge& Edge = exp.Current(); nbe++; - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; Handle(Geom_Curve) c3d; ShapeAnalysis_Edge sae; if (!sae.Curve3d(Edge,c3d,First,Last)) continue; @@ -85,11 +87,11 @@ static void ContourProperties(TopoDS_Wire wire, //purpose : Empty constructor //======================================================================= -ShapeAnalysis_FreeBoundsProperties::ShapeAnalysis_FreeBoundsProperties() +ShapeAnalysis_FreeBoundsProperties::ShapeAnalysis_FreeBoundsProperties() : myTolerance(0.), myClosedFreeBounds(new ShapeAnalysis_HSequenceOfFreeBounds()), myOpenFreeBounds(new ShapeAnalysis_HSequenceOfFreeBounds()) { - myClosedFreeBounds = new ShapeAnalysis_HSequenceOfFreeBounds(); - myOpenFreeBounds = new ShapeAnalysis_HSequenceOfFreeBounds(); - myTolerance = 0.; + + + } //======================================================================= @@ -101,10 +103,10 @@ ShapeAnalysis_FreeBoundsProperties::ShapeAnalysis_FreeBoundsProperties() ShapeAnalysis_FreeBoundsProperties::ShapeAnalysis_FreeBoundsProperties(const TopoDS_Shape& shape, const Standard_Real tolerance, const Standard_Boolean splitclosed, - const Standard_Boolean splitopen) + const Standard_Boolean splitopen) : myClosedFreeBounds(new ShapeAnalysis_HSequenceOfFreeBounds()), myOpenFreeBounds(new ShapeAnalysis_HSequenceOfFreeBounds()) { - myClosedFreeBounds = new ShapeAnalysis_HSequenceOfFreeBounds(); - myOpenFreeBounds = new ShapeAnalysis_HSequenceOfFreeBounds(); + + Init(shape, tolerance, splitclosed, splitopen); } @@ -116,11 +118,11 @@ ShapeAnalysis_FreeBoundsProperties::ShapeAnalysis_FreeBoundsProperties(const Top ShapeAnalysis_FreeBoundsProperties::ShapeAnalysis_FreeBoundsProperties(const TopoDS_Shape& shape, const Standard_Boolean splitclosed, - const Standard_Boolean splitopen) + const Standard_Boolean splitopen) : myTolerance(0.), myClosedFreeBounds(new ShapeAnalysis_HSequenceOfFreeBounds()), myOpenFreeBounds(new ShapeAnalysis_HSequenceOfFreeBounds()) { - myClosedFreeBounds = new ShapeAnalysis_HSequenceOfFreeBounds(); - myOpenFreeBounds = new ShapeAnalysis_HSequenceOfFreeBounds(); - myTolerance =0.; + + + Init(shape, splitclosed, splitopen); } @@ -205,7 +207,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::DispatchBounds() ShapeExtend_Explorer shexpl; Handle(TopTools_HSequenceOfShape) tmpSeq = shexpl.SeqFromCompound(tmpClosedBounds,Standard_False); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i<=tmpSeq->Length(); i++) { TopoDS_Wire wire = TopoDS::Wire(tmpSeq->Value(i)); Handle(ShapeAnalysis_FreeBoundData) fbData= new ShapeAnalysis_FreeBoundData() ; @@ -232,7 +234,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::DispatchBounds() Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(const Standard_Real prec) { - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for(i = 1; i <= myClosedFreeBounds->Length(); i++) { Handle(ShapeAnalysis_FreeBoundData) fbData = myClosedFreeBounds->Value(i); CheckNotches(fbData, prec); @@ -257,7 +259,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(Handle(ShapeAn if (swd.NbEdges() > 1) for (Standard_Integer j=1; j <= swd.NbEdges(); j++) { TopoDS_Wire notch; - Standard_Real dMax; + Standard_Real dMax = NAN; if (CheckNotches(fbData->FreeBound(), j, notch, dMax, prec)) fbData->AddNotch(notch, dMax); } @@ -273,7 +275,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(Handle(ShapeAn Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckContours(const Standard_Real prec) { Standard_Boolean status = Standard_False; - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for( i = 1; i <= myClosedFreeBounds->Length(); i++) { Handle(ShapeAnalysis_FreeBoundData) fbData = myClosedFreeBounds->Value(i); status |= FillProperties(fbData,prec); @@ -322,7 +324,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(const TopoDS_W TopoDS_Edge E2 = wdt->Edge(n2); B.Add(notch,E2); - Standard_Real First1, Last1, First2, Last2; + Standard_Real First1 = NAN, Last1 = NAN, First2 = NAN, Last2 = NAN; Handle(Geom_Curve) c3d1, c3d2; ShapeAnalysis_Edge sae; //szv#4:S4163:12Mar99 optimized @@ -343,7 +345,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(const TopoDS_W Standard_Real prm = ((NbControl-1-i)*First1 + i*Last1)/(NbControl-1); gp_Pnt pntCurr = c3d1->Value(prm); - Standard_Real p1, p2; + Standard_Real p1 = NAN, p2 = NAN; if ( First2 < Last2 ) { p1 = First2; p2 = Last2; @@ -374,7 +376,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(const TopoDS_W Standard_Boolean ShapeAnalysis_FreeBoundsProperties::FillProperties(Handle(ShapeAnalysis_FreeBoundData)& fbData, const Standard_Real /*prec*/) { - Standard_Real area, length; + Standard_Real area = NAN, length = NAN; ContourProperties(fbData->FreeBound(), area, length); Standard_Real r = 0; diff --git a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.hxx b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.hxx index c85ba5cfd9..2b62ace0f0 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.hxx @@ -143,9 +143,9 @@ private: TopoDS_Shape myShape; - Standard_Real myTolerance; - Standard_Boolean mySplitClosed; - Standard_Boolean mySplitOpen; + Standard_Real myTolerance{}; + Standard_Boolean mySplitClosed{}; + Standard_Boolean mySplitOpen{}; Handle(ShapeAnalysis_HSequenceOfFreeBounds) myClosedFreeBounds; Handle(ShapeAnalysis_HSequenceOfFreeBounds) myOpenFreeBounds; diff --git a/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx b/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx index e87e2840e4..a36e2595e2 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx @@ -13,6 +13,8 @@ //szv#4 S4163 +#include + #include #include #include @@ -34,21 +36,21 @@ Standard_Boolean ShapeAnalysis_Geom::NearestPlane(const TColgp_Array1OfPnt& Pnts //szv#4:S4163:12Mar99 warning GProp_PGProps Pmat(Pnts); gp_Pnt g = Pmat.CentreOfMass(); - Standard_Real Xg,Yg,Zg; + Standard_Real Xg = NAN,Yg = NAN,Zg = NAN; g.Coord(Xg,Yg,Zg); GProp_PrincipalProps Pp = Pmat.PrincipalProperties(); gp_Vec V1 = Pp.FirstAxisOfInertia(); - Standard_Real Xv1,Yv1,Zv1; + Standard_Real Xv1 = NAN,Yv1 = NAN,Zv1 = NAN; V1.Coord(Xv1,Yv1,Zv1); gp_Vec V2 = Pp.SecondAxisOfInertia(); - Standard_Real Xv2,Yv2,Zv2; + Standard_Real Xv2 = NAN,Yv2 = NAN,Zv2 = NAN; V2.Coord(Xv2,Yv2,Zv2); gp_Vec V3 = Pp.ThirdAxisOfInertia(); - Standard_Real Xv3,Yv3,Zv3; + Standard_Real Xv3 = NAN,Yv3 = NAN,Zv3 = NAN; V3.Coord(Xv3,Yv3,Zv3); - Standard_Real D,X,Y,Z; + Standard_Real D = NAN,X = NAN,Y = NAN,Z = NAN; Standard_Real Dmx1 = RealFirst(); Standard_Real Dmn1 = RealLast(); Standard_Real Dmx2 = RealFirst(); @@ -57,7 +59,7 @@ Standard_Boolean ShapeAnalysis_Geom::NearestPlane(const TColgp_Array1OfPnt& Pnts Standard_Real Dmn3 = RealLast(); Standard_Integer ilow = Pnts.Lower(), iup = Pnts.Upper(); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = ilow; i <= iup; i ++) { Pnts(i).Coord(X,Y,Z); D = (X-Xg)*Xv1 +(Y-Yg)*Yv1 + (Z-Zg)*Zv1; diff --git a/src/ShapeAnalysis/ShapeAnalysis_ShapeContents.cxx b/src/ShapeAnalysis/ShapeAnalysis_ShapeContents.cxx index 44335d996f..c0218c1e5c 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_ShapeContents.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_ShapeContents.cxx @@ -16,6 +16,8 @@ //szv#4 S4163 +#include + #include #include #include @@ -41,14 +43,14 @@ #include #include -ShapeAnalysis_ShapeContents::ShapeAnalysis_ShapeContents() +ShapeAnalysis_ShapeContents::ShapeAnalysis_ShapeContents() : myBigSplineSec(new TopTools_HSequenceOfShape), myIndirectSec(new TopTools_HSequenceOfShape), myOffsetSurfaceSec(new TopTools_HSequenceOfShape), myTrimmed3dSec(new TopTools_HSequenceOfShape), myOffsetCurveSec(new TopTools_HSequenceOfShape), myTrimmed2dSec(new TopTools_HSequenceOfShape) { - myBigSplineSec = new TopTools_HSequenceOfShape; - myIndirectSec = new TopTools_HSequenceOfShape; - myOffsetSurfaceSec = new TopTools_HSequenceOfShape; - myTrimmed3dSec = new TopTools_HSequenceOfShape; - myOffsetCurveSec = new TopTools_HSequenceOfShape; - myTrimmed2dSec = new TopTools_HSequenceOfShape; + + + + + + ClearFlags(); } @@ -200,7 +202,7 @@ void ShapeAnalysis_ShapeContents::Perform(const TopoDS_Shape& Shape) nbwires ++; for (TopExp_Explorer edg(wire,TopAbs_EDGE); edg.More(); edg.Next()) { TopoDS_Edge edge = TopoDS::Edge (edg.Current()); - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; if (BRep_Tool::IsClosed (edge,face)) nbseam ++; Handle(Geom_Curve) c3d = BRep_Tool::Curve (edge,first,last); if (!c3d.IsNull()) { @@ -247,7 +249,7 @@ void ShapeAnalysis_ShapeContents::Perform(const TopoDS_Shape& Shape) edge.Location(TopLoc_Location()); mapsh.Add (edge); TopLoc_Location loc; - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; myNbEdges++; Handle(Geom_Curve) c3d = BRep_Tool::Curve (edge,loc,first,last); if (!c3d.IsNull() && c3d->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) { diff --git a/src/ShapeAnalysis/ShapeAnalysis_ShapeContents.hxx b/src/ShapeAnalysis/ShapeAnalysis_ShapeContents.hxx index d589d1a94b..a9c5c43d3b 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_ShapeContents.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_ShapeContents.hxx @@ -154,45 +154,45 @@ public: private: - Standard_Integer myNbSolids; - Standard_Integer myNbShells; - Standard_Integer myNbFaces; - Standard_Integer myNbWires; - Standard_Integer myNbEdges; - Standard_Integer myNbVertices; - Standard_Integer myNbSolidsWithVoids; - Standard_Integer myNbBigSplines; - Standard_Integer myNbC0Surfaces; - Standard_Integer myNbC0Curves; - Standard_Integer myNbOffsetSurf; - Standard_Integer myNbIndirectSurf; - Standard_Integer myNbOffsetCurves; - Standard_Integer myNbTrimmedCurve2d; - Standard_Integer myNbTrimmedCurve3d; - Standard_Integer myNbBSplibeSurf; - Standard_Integer myNbBezierSurf; - Standard_Integer myNbTrimSurf; - Standard_Integer myNbWireWitnSeam; - Standard_Integer myNbWireWithSevSeams; - Standard_Integer myNbFaceWithSevWires; - Standard_Integer myNbNoPCurve; - Standard_Integer myNbFreeFaces; - Standard_Integer myNbFreeWires; - Standard_Integer myNbFreeEdges; - Standard_Integer myNbSharedSolids; - Standard_Integer myNbSharedShells; - Standard_Integer myNbSharedFaces; - Standard_Integer myNbSharedWires; - Standard_Integer myNbSharedFreeWires; - Standard_Integer myNbSharedFreeEdges; - Standard_Integer myNbSharedEdges; - Standard_Integer myNbSharedVertices; - Standard_Boolean myBigSplineMode; - Standard_Boolean myIndirectMode; - Standard_Boolean myOffsetSurfaceMode; - Standard_Boolean myTrimmed3dMode; - Standard_Boolean myOffsetCurveMode; - Standard_Boolean myTrimmed2dMode; + Standard_Integer myNbSolids{}; + Standard_Integer myNbShells{}; + Standard_Integer myNbFaces{}; + Standard_Integer myNbWires{}; + Standard_Integer myNbEdges{}; + Standard_Integer myNbVertices{}; + Standard_Integer myNbSolidsWithVoids{}; + Standard_Integer myNbBigSplines{}; + Standard_Integer myNbC0Surfaces{}; + Standard_Integer myNbC0Curves{}; + Standard_Integer myNbOffsetSurf{}; + Standard_Integer myNbIndirectSurf{}; + Standard_Integer myNbOffsetCurves{}; + Standard_Integer myNbTrimmedCurve2d{}; + Standard_Integer myNbTrimmedCurve3d{}; + Standard_Integer myNbBSplibeSurf{}; + Standard_Integer myNbBezierSurf{}; + Standard_Integer myNbTrimSurf{}; + Standard_Integer myNbWireWitnSeam{}; + Standard_Integer myNbWireWithSevSeams{}; + Standard_Integer myNbFaceWithSevWires{}; + Standard_Integer myNbNoPCurve{}; + Standard_Integer myNbFreeFaces{}; + Standard_Integer myNbFreeWires{}; + Standard_Integer myNbFreeEdges{}; + Standard_Integer myNbSharedSolids{}; + Standard_Integer myNbSharedShells{}; + Standard_Integer myNbSharedFaces{}; + Standard_Integer myNbSharedWires{}; + Standard_Integer myNbSharedFreeWires{}; + Standard_Integer myNbSharedFreeEdges{}; + Standard_Integer myNbSharedEdges{}; + Standard_Integer myNbSharedVertices{}; + Standard_Boolean myBigSplineMode{}; + Standard_Boolean myIndirectMode{}; + Standard_Boolean myOffsetSurfaceMode{}; + Standard_Boolean myTrimmed3dMode{}; + Standard_Boolean myOffsetCurveMode{}; + Standard_Boolean myTrimmed2dMode{}; Handle(TopTools_HSequenceOfShape) myBigSplineSec; Handle(TopTools_HSequenceOfShape) myIndirectSec; Handle(TopTools_HSequenceOfShape) myOffsetSurfaceSec; diff --git a/src/ShapeAnalysis/ShapeAnalysis_ShapeTolerance.cxx b/src/ShapeAnalysis/ShapeAnalysis_ShapeTolerance.cxx index 722bf7f383..6c26fa386a 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_ShapeTolerance.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_ShapeTolerance.cxx @@ -14,6 +14,8 @@ //#76 rln 11.03.99 S4135: compute average without weights according to tolerances //szv#4 S4163 +#include + #include #include #include @@ -86,7 +88,7 @@ Standard_Real ShapeAnalysis_ShapeTolerance::Tolerance(const TopoDS_Shape& shape, Handle(TopTools_HSequenceOfShape) ShapeAnalysis_ShapeTolerance::InTolerance(const TopoDS_Shape& shape,const Standard_Real valmin,const Standard_Real valmax,const TopAbs_ShapeEnum type) const { - Standard_Real tol; + Standard_Real tol = NAN; Standard_Boolean over = (valmax < valmin); // pas de liminite max Handle(TopTools_HSequenceOfShape) sl = new TopTools_HSequenceOfShape (); @@ -191,7 +193,7 @@ Standard_Real ShapeAnalysis_ShapeTolerance::Tolerance(const TopoDS_Shape& shape, void ShapeAnalysis_ShapeTolerance::AddTolerance(const TopoDS_Shape& shape,const TopAbs_ShapeEnum type) { Standard_Integer nbt = 0; - Standard_Real tol, cmin = 0.,cmoy = 0.,cmax = 0.; + Standard_Real tol = NAN, cmin = 0.,cmoy = 0.,cmax = 0.; TopExp_Explorer myExp; diff --git a/src/ShapeAnalysis/ShapeAnalysis_ShapeTolerance.hxx b/src/ShapeAnalysis/ShapeAnalysis_ShapeTolerance.hxx index 47dcd78de1..823d4c3160 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_ShapeTolerance.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_ShapeTolerance.hxx @@ -89,7 +89,7 @@ private: - Standard_Real myTols[3]; + Standard_Real myTols[3]{}; Standard_Integer myNbTol; diff --git a/src/ShapeAnalysis/ShapeAnalysis_Shell.cxx b/src/ShapeAnalysis/ShapeAnalysis_Shell.cxx index 344be5a6e1..014bf580d1 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Shell.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Shell.cxx @@ -56,7 +56,7 @@ void ShapeAnalysis_Shell::Clear() if (shape.ShapeType() == TopAbs_SHELL) myShells.Add (shape); //szv#4:S4163:12Mar99 i = else { for (TopExp_Explorer exs (shape,TopAbs_SHELL); exs.More(); exs.Next()) { - TopoDS_Shape sh = exs.Current(); + const TopoDS_Shape& sh = exs.Current(); myShells.Add (sh); //szv#4:S4163:12Mar99 i = } } @@ -120,7 +120,7 @@ Standard_Boolean ShapeAnalysis_Shell::CheckOrientedShells(const TopoDS_Shape& sh TopTools_IndexedMapOfShape dirs, revs, ints; for (TopExp_Explorer exs(shape,TopAbs_SHELL); exs.More(); exs.Next()) { - TopoDS_Shape sh = exs.Current(); + const TopoDS_Shape& sh = exs.Current(); //szv#4:S4163:12Mar99 optimized if (CheckEdges (sh,myBad,dirs,revs,ints)) if (myShells.Add (sh)) res = Standard_True; @@ -132,9 +132,9 @@ Standard_Boolean ShapeAnalysis_Shell::CheckOrientedShells(const TopoDS_Shape& sh // Free Edges . Ce sont les edges d une map pas dans l autre // et lycee de Versailles (les maps dirs et revs) Standard_Integer nb = dirs.Extent(); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <= nb; i ++) { - TopoDS_Shape sh = dirs.FindKey (i); + const TopoDS_Shape& sh = dirs.FindKey (i); if (!myBad.Contains(sh)) { if (!revs.Contains(sh)) { if(checkinternaledges) { @@ -154,7 +154,7 @@ Standard_Boolean ShapeAnalysis_Shell::CheckOrientedShells(const TopoDS_Shape& sh nb = revs.Extent(); for (i = 1; i <= nb; i ++) { - TopoDS_Shape sh = revs.FindKey (i); + const TopoDS_Shape& sh = revs.FindKey (i); if (!myBad.Contains(sh)) { if (!dirs.Contains(sh)) { if(checkinternaledges) { diff --git a/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx b/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx index 63fbb24801..c3bbef319d 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx @@ -27,6 +27,8 @@ //:r9 abv 09.04.99: id_turbine-C.stp #3865: check degenerated 2d point by recomputing to 3d instead of Resolution //:s5 abv 22.04.99 Adding debug printouts in catch {} blocks +#include + #include #include #include @@ -95,14 +97,14 @@ namespace //======================================================================= ShapeAnalysis_Surface::ShapeAnalysis_Surface(const Handle(Geom_Surface)& S) : mySurf(S), - myExtOK(Standard_False), //:30 + myAdSur(new GeomAdaptor_Surface(mySurf)), myExtOK(Standard_False), //:30 myNbDeg(-1), myIsos(Standard_False), myIsoBoxes(Standard_False), myGap(0.), myUDelt(0.01), myVDelt(0.01), myUCloseVal(-1), myVCloseVal(-1) { mySurf->Bounds(myUF, myUL, myVF, myVL); - myAdSur = new GeomAdaptor_Surface(mySurf); + } //======================================================================= @@ -162,7 +164,7 @@ void ShapeAnalysis_Surface::ComputeSingularities() //CKY 27-FEV-98 : en appel direct on peut forcer. En appel interne on optimise if (mySurf.IsNull()) return; - Standard_Real su1, sv1, su2, sv2; + Standard_Real su1 = NAN, sv1 = NAN, su2 = NAN, sv2 = NAN; // mySurf->Bounds(su1, su2, sv1, sv2); Bounds(su1, su2, sv1, sv2);//modified by rln on 12/11/97 mySurf-> is deleted @@ -429,7 +431,7 @@ Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const Standard_Intege myGap = Sqrt(gapMin); gp_Pnt2d pk; - Standard_Integer k; // svv Jan11 2000 : porting on DEC + Standard_Integer k = 0; // svv Jan11 2000 : porting on DEC for (k = j + step; k <= nbrPnt && k >= 1; k += step) { pk = pnt2d(k); gp_Pnt P1 = points(k); @@ -564,7 +566,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci) if (myUCloseVal < 0) { // Faut calculer : calculs minimaux - Standard_Real uf, ul, vf, vl; + Standard_Real uf = NAN, ul = NAN, vf = NAN, vl = NAN; Bounds(uf, ul, vf, vl);//modified by rln on 12/11/97 mySurf-> is deleted //mySurf->Bounds (uf,ul,vf,vl); RestrictBounds (uf, ul, vf, vl); @@ -777,7 +779,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci) if (myVCloseVal < 0) { // Faut calculer : calculs minimaux - Standard_Real uf, ul, vf, vl; + Standard_Real uf = NAN, ul = NAN, vf = NAN, vl = NAN; Bounds(uf, ul, vf, vl);//modified by rln on 12/11/97 mySurf-> is deleted // mySurf->Bounds (uf,ul,vf,vl); RestrictBounds (uf, ul, vf, vl); @@ -980,7 +982,7 @@ Standard_Integer ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev, gp_Pnt2d &sol) { GeomAdaptor_Surface& SurfAdapt = *Adaptor3d(); - Standard_Real uf, ul, vf, vl; + Standard_Real uf = NAN, ul = NAN, vf = NAN, vl = NAN; Bounds(uf, ul, vf, vl); Standard_Real du = SurfAdapt.UResolution(preci); Standard_Real dv = SurfAdapt.VResolution(preci); @@ -1137,7 +1139,7 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D, const Standard_Real myGap = -1.; // devra etre calcule Standard_Boolean computed = Standard_True; // a priori - Standard_Real uf, ul, vf, vl; + Standard_Real uf = NAN, ul = NAN, vf = NAN, vl = NAN; Bounds(uf, ul, vf, vl);//modified by rln on 12/11/97 mySurf-> is deleted { //:c9 abv 3 Mar 98: UKI60107-1 #350: to prevent 'catch' from catching exception raising below it @@ -1379,7 +1381,7 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d, const Standard Standard_Real theMin = RealLast(); gp_Pnt pntres; - Standard_Real Cf, Cl, UU, VV; + Standard_Real Cf = NAN, Cl = NAN, UU = NAN, VV = NAN; // Initialisation des recherches : point deja trouve (?) UU = U; VV = V; diff --git a/src/ShapeAnalysis/ShapeAnalysis_Surface.hxx b/src/ShapeAnalysis/ShapeAnalysis_Surface.hxx index e14e17454f..1c6a053510 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Surface.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Surface.hxx @@ -315,18 +315,18 @@ protected: Extrema_ExtPS myExtPS; Standard_Boolean myExtOK; Standard_Integer myNbDeg; - Standard_Real myPreci[4]; + Standard_Real myPreci[4]{}; gp_Pnt myP3d[4]; gp_Pnt2d myFirstP2d[4]; gp_Pnt2d myLastP2d[4]; - Standard_Real myFirstPar[4]; - Standard_Real myLastPar[4]; - Standard_Boolean myUIsoDeg[4]; + Standard_Real myFirstPar[4]{}; + Standard_Real myLastPar[4]{}; + Standard_Boolean myUIsoDeg[4]{}; Standard_Boolean myIsos; - Standard_Real myUF; - Standard_Real myUL; - Standard_Real myVF; - Standard_Real myVL; + Standard_Real myUF{}; + Standard_Real myUL{}; + Standard_Real myVF{}; + Standard_Real myVL{}; Handle(Geom_Curve) myIsoUF; Handle(Geom_Curve) myIsoUL; Handle(Geom_Curve) myIsoVF; diff --git a/src/ShapeAnalysis/ShapeAnalysis_TransferParameters.cxx b/src/ShapeAnalysis/ShapeAnalysis_TransferParameters.cxx index ada07d4c72..efb6015510 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_TransferParameters.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_TransferParameters.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -29,10 +31,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeAnalysis_TransferParameters,Standard_Transient) //function : ShapeAnalysis_TransferParameters //purpose : //======================================================================= -ShapeAnalysis_TransferParameters::ShapeAnalysis_TransferParameters() +ShapeAnalysis_TransferParameters::ShapeAnalysis_TransferParameters() : myShift(0.), myScale(1.) { - myScale = 1.; - myShift = 0.; + + } @@ -56,7 +58,7 @@ void ShapeAnalysis_TransferParameters::Init(const TopoDS_Edge& E, const TopoDS_F { myScale = 1.; myShift = 0.; - Standard_Real l,f,l2d = 0.0,f2d = 0.0; + Standard_Real l = NAN,f = NAN,l2d = 0.0,f2d = 0.0; TopLoc_Location L; myEdge = E; ShapeAnalysis_Edge sae; @@ -117,7 +119,7 @@ Handle(TColStd_HSequenceOfReal) ShapeAnalysis_TransferParameters::Perform Standard_Real ShapeAnalysis_TransferParameters::Perform(const Standard_Real Param, const Standard_Boolean To2d) { - Standard_Real NewParam; + Standard_Real NewParam = NAN; if(To2d) NewParam = myShift + Param*myScale; else @@ -139,7 +141,7 @@ void ShapeAnalysis_TransferParameters::TransferRange(TopoDS_Edge& newEdge, ShapeBuild_Edge sbe; if(Is2d) { Standard_Real span2d = myLast2d - myFirst2d; - Standard_Real tmp1,tmp2; + Standard_Real tmp1 = NAN,tmp2 = NAN; if(prevPar > currPar) { tmp1 = currPar; tmp2 = prevPar; diff --git a/src/ShapeAnalysis/ShapeAnalysis_TransferParameters.hxx b/src/ShapeAnalysis/ShapeAnalysis_TransferParameters.hxx index 477584834b..30be45b88e 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_TransferParameters.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_TransferParameters.hxx @@ -87,19 +87,19 @@ public: protected: - Standard_Real myFirst; - Standard_Real myLast; + Standard_Real myFirst{}; + Standard_Real myLast{}; TopoDS_Edge myEdge; - Standard_Real myMaxTolerance; + Standard_Real myMaxTolerance{}; private: - Standard_Real myShift; - Standard_Real myScale; - Standard_Real myFirst2d; - Standard_Real myLast2d; + Standard_Real myShift{}; + Standard_Real myScale{}; + Standard_Real myFirst2d{}; + Standard_Real myLast2d{}; TopoDS_Face myFace; diff --git a/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx b/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx index 326c062a1e..b13bf323aa 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -50,11 +52,11 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeAnalysis_TransferParametersProj,ShapeAnalysis_Tr //purpose : //======================================================================= ShapeAnalysis_TransferParametersProj::ShapeAnalysis_TransferParametersProj() -: myPrecision(0.0) +: myPrecision(0.0), myForceProj(Standard_False), myInitOK(Standard_False) { myMaxTolerance = 1; //Precision::Infinite(); ?? pdn - myForceProj = Standard_False; - myInitOK = Standard_False; + + } @@ -64,10 +66,10 @@ ShapeAnalysis_TransferParametersProj::ShapeAnalysis_TransferParametersProj() //======================================================================= ShapeAnalysis_TransferParametersProj::ShapeAnalysis_TransferParametersProj(const TopoDS_Edge& E, - const TopoDS_Face& F) + const TopoDS_Face& F) : myForceProj(Standard_False) { myMaxTolerance = 1; //Precision::Infinite(); ?? pdn - myForceProj = Standard_False; + Init(E,F); } @@ -91,7 +93,7 @@ void ShapeAnalysis_TransferParametersProj::Init(const TopoDS_Edge& E, if ( F.IsNull() ) return; - Standard_Real f2d, l2d; + Standard_Real f2d = NAN, l2d = NAN; ShapeAnalysis_Edge sae; if(sae.PCurve (E, F, myCurve2d, f2d, l2d, Standard_False)) { @@ -131,7 +133,7 @@ Handle(TColStd_HSequenceOfReal) ShapeAnalysis_TransferParametersProj::Perform Standard_Real lastPar = last; Standard_Real prevPar = maxPar; - Standard_Integer j; // svv Jan 10 2000 : porting on DEC + Standard_Integer j = 0; // svv Jan 10 2000 : porting on DEC for(j = 1; j <= len; j++) { Standard_Real par = PreformSegment(Knots->Value(j),To2d,prevPar,lastPar); prevPar = par; @@ -175,11 +177,11 @@ Standard_Real ShapeAnalysis_TransferParametersProj::PreformSegment(const Standar (! myForceProj && myPrecision < myMaxTolerance && BRep_Tool::SameParameter(myEdge))) return linPar; - Standard_Real linDev, projDev; + Standard_Real linDev = NAN, projDev = NAN; ShapeAnalysis_Curve sac; gp_Pnt pproj; - Standard_Real ppar; + Standard_Real ppar = NAN; if(To2d) { gp_Pnt p1 = myCurve->Value(Param).Transformed(myLocation.Inverted()); Handle(Adaptor3d_Surface) AdS = myAC3d.GetSurface(); @@ -212,7 +214,7 @@ Standard_Real ShapeAnalysis_TransferParametersProj::Perform(const Standard_Real (! myForceProj && myPrecision < myMaxTolerance && BRep_Tool::SameParameter(myEdge))) return ShapeAnalysis_TransferParameters::Perform(Knot, To2d); - Standard_Real res; + Standard_Real res = NAN; if(To2d) res = PreformSegment(Knot,To2d,myAC3d.FirstParameter(),myAC3d.LastParameter()); else @@ -231,7 +233,7 @@ Standard_Real ShapeAnalysis_TransferParametersProj::Perform(const Standard_Real //function : CorrectParameter //purpose : auxiliary //======================================================================= -static Standard_Real CorrectParameter(const Handle(Geom2d_Curve) crv, +static Standard_Real CorrectParameter(const Handle(Geom2d_Curve)& crv, const Standard_Real param) { if(crv->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) { @@ -278,7 +280,7 @@ void ShapeAnalysis_TransferParametersProj::TransferRange(TopoDS_Edge& newEdge, gp_Pnt p2; Standard_Real alpha = 0, beta = 1; Standard_Real preci = Precision::PConfusion(); - Standard_Real firstPar, lastPar; + Standard_Real firstPar = NAN, lastPar = NAN; if(prevPar < currPar) { firstPar = prevPar; lastPar = currPar; @@ -334,7 +336,7 @@ void ShapeAnalysis_TransferParametersProj::TransferRange(TopoDS_Edge& newEdge, TopLoc_Location EdgeLoc = myEdge.Location(); ShapeAnalysis_Curve sac; gp_Pnt pproj; - Standard_Real ppar1,ppar2; + Standard_Real ppar1 = NAN,ppar2 = NAN; BRep_ListOfCurveRepresentation& tolist = (*((Handle(BRep_TEdge)*)&newEdge.TShape()))->ChangeCurves(); Handle(BRep_GCurve) toGC; for (BRep_ListIteratorOfListOfCurveRepresentation toitcr (tolist); toitcr.More(); toitcr.Next()) { @@ -498,11 +500,11 @@ TopoDS_Vertex ShapeAnalysis_TransferParametersProj::CopyNMVertex (const TopoDS_V return anewV; TopLoc_Location fromLoc; - Standard_Real f1,l1; + Standard_Real f1 = NAN,l1 = NAN; const Handle(Geom_Curve)& C1 = BRep_Tool::Curve(fromedge,fromLoc,f1,l1); fromLoc = fromLoc.Predivided(theV.Location()); - Standard_Real f2,l2; + Standard_Real f2 = NAN,l2 = NAN; Handle(Geom_Curve) C2 = BRep_Tool::Curve(toedge,f2,l2); anewV = TopoDS::Vertex(theV.EmptyCopied()); @@ -580,7 +582,7 @@ TopoDS_Vertex ShapeAnalysis_TransferParametersProj::CopyNMVertex (const TopoDS_V //update tolerance Standard_Boolean needUpdate = Standard_False; gp_Pnt aPV = (*((Handle(BRep_TVertex)*)&anewV.TShape()))->Pnt(); - TopLoc_Location toLoc = toedge.Location(); + const TopLoc_Location& toLoc = toedge.Location(); BRep_ListIteratorOfListOfCurveRepresentation toitcr ((*((Handle(BRep_TEdge)*)&toedge.TShape()))->ChangeCurves()); diff --git a/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.hxx b/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.hxx index b62a1687ba..94352710f6 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.hxx @@ -101,10 +101,10 @@ private: Handle(Geom_Curve) myCurve; Handle(Geom2d_Curve) myCurve2d; Adaptor3d_CurveOnSurface myAC3d; - Standard_Real myPrecision; + Standard_Real myPrecision{}; TopLoc_Location myLocation; Standard_Boolean myForceProj; - Standard_Boolean myInitOK; + Standard_Boolean myInitOK{}; }; diff --git a/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx b/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx index 633917eb4b..6ca3f54980 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx @@ -32,6 +32,8 @@ //:s1 abv 22.04.99: PRO7226 #489490: ensure fixing of degenerated edge //#9 smh 14.12.99 BUC60615 Using tolerance of verteces during checking degenerated edge. +#include + #include #include #include @@ -89,10 +91,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeAnalysis_Wire,Standard_Transient) //function : ShapeAnalysis_Wire //purpose : //======================================================================= -ShapeAnalysis_Wire::ShapeAnalysis_Wire() +ShapeAnalysis_Wire::ShapeAnalysis_Wire() : myPrecision(::Precision::Confusion()) { ClearStatuses(); - myPrecision = ::Precision::Confusion(); + } //======================================================================= @@ -299,7 +301,7 @@ void ShapeAnalysis_Wire::SetSurface (const Handle(Geom_Surface)& surface, myStatusEdgeCurves = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); if ( ! IsReady() ) return Standard_False; - Standard_Integer i, nb = myWire->NbEdges(); + Standard_Integer i = 0, nb = myWire->NbEdges(); ShapeAnalysis_Edge SAE; for (i = 1; i <= nb; i++) { @@ -374,7 +376,7 @@ void ShapeAnalysis_Wire::SetSurface (const Handle(Geom_Surface)& surface, { myStatusSelfIntersection = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); if (!IsReady()) return Standard_False; - Standard_Integer i, nb = myWire->NbEdges(); + Standard_Integer i = 0, nb = myWire->NbEdges(); for (i = 1; i <= nb; i++) { CheckSelfIntersectingEdge (i); if (LastCheckStatus (ShapeExtend_DONE)) @@ -393,7 +395,7 @@ void ShapeAnalysis_Wire::SetSurface (const Handle(Geom_Surface)& surface, TopLoc_Location L; const Handle(Geom_Surface)& S = BRep_Tool::Surface(Face(), L); Handle(Geom2d_Curve) c2d; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; ShapeAnalysis_Edge sae; Handle(ShapeExtend_WireData) sbwd = WireData(); for(i = 1; i <= nb; i++){ @@ -476,7 +478,7 @@ void ShapeAnalysis_Wire::SetSurface (const Handle(Geom_Surface)& surface, myStatusGaps3d = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); if (!IsLoaded() || NbEdges() < 1) return Standard_False; //gka IsLoaded - Standard_Real dist, maxdist = 0.; + Standard_Real dist = NAN, maxdist = 0.; for (Standard_Integer i = 1; i <= NbEdges(); i++) { CheckGap3d(i); @@ -501,7 +503,7 @@ void ShapeAnalysis_Wire::SetSurface (const Handle(Geom_Surface)& surface, myStatusGaps2d = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); if (!IsReady() || NbEdges() < 1) return Standard_False; - Standard_Real dist, maxdist = 0.; + Standard_Real dist = NAN, maxdist = 0.; for (Standard_Integer i = 1; i <= NbEdges(); i++) { CheckGap2d(i); @@ -526,7 +528,7 @@ void ShapeAnalysis_Wire::SetSurface (const Handle(Geom_Surface)& surface, myStatusCurveGaps = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); if (!IsReady() || NbEdges() < 1) return Standard_False; - Standard_Real dist, maxdist = 0.; + Standard_Real dist = NAN, maxdist = 0.; for (Standard_Integer i = 1; i <= NbEdges(); i++) { CheckCurveGap(i); @@ -583,7 +585,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckOrder(ShapeAnalysis_WireOrder &sawo, } if (!theMode3D || theModeBoth) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom2d_Curve) c2d; TopoDS_Shape tmpF = myFace.Oriented (TopAbs_FORWARD); if (!EA.PCurve(E, TopoDS::Face (tmpF), c2d, f, l)) @@ -731,7 +733,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckSmall (const Standard_Integer num, // Si pas de C3D, on essaie la C2D ... gp_Pnt Pm; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; Handle(Geom_Curve) c3d; if ( sae.Curve3d (E,c3d,cf,cl,Standard_False) ) Pm = c3d->Value ( (cf+cl)/2. ); else { @@ -794,7 +796,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckSmall (const Standard_Integer num, Standard_Boolean ShapeAnalysis_Wire::CheckSeam(const Standard_Integer num) { Handle(Geom2d_Curve) C1, C2; - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; return CheckSeam (num, C1, C2, cf, cl); } @@ -823,7 +825,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu // skl 30.12.2004 for OCC7630 - we have to check pcurve if( sae.HasPCurve(E1,Face()) && sae.HasPCurve(E3,Face()) ) { Handle(Geom2d_Curve) c2d; - Standard_Real fp,lp; + Standard_Real fp = NAN,lp = NAN; sae.PCurve ( E2, myFace, c2d, fp, lp, Standard_True ); gp_Pnt2d p21 = c2d->Value(fp); gp_Pnt2d p22 = c2d->Value(lp); @@ -863,7 +865,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu gp_Pnt p0 = BRep_Tool::Pnt (V0); gp_Pnt p1 = BRep_Tool::Pnt (V1); gp_Pnt p2 = BRep_Tool::Pnt (V2); - Standard_Real par1, par2; + Standard_Real par1 = NAN, par2 = NAN; Standard_Boolean lack = Standard_False; Standard_Boolean dgnr = Standard_False; //pdn 12.03.99 minimal value processing first @@ -877,7 +879,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu if (p1.Distance(p2) <= precFirst) { // edge DGNR dgnr = mySurf->DegeneratedValues ( p1, precVtx, p2d1, p2d2, par1, par2, forward ); //smh#9 if ( dgnr ) { // abv 24 Feb 00: trj3_as1-ac-214.stp #6065: avoid making closed edge degenerated - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle(Geom_Curve) C3d = BRep_Tool::Curve ( E2, a, b ); if ( ! C3d.IsNull() ) { gp_Pnt p = C3d->Value ( 0.5 * ( a + b ) ); @@ -899,9 +901,9 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu if ( p0.Distance ( p1 ) <= precFin ) {// ou DGNR manquante ? //rln S4135 singularity with precision = 2 * prec, but distance <= prec //lack = mySurf->DegeneratedValues ( p1, prec, p2d1, p2d2, par1, par2, forward); - Standard_Real tmpPreci; + Standard_Real tmpPreci = NAN; gp_Pnt tmpP3d; - Standard_Boolean tmpUIsoDeg; + Standard_Boolean tmpUIsoDeg = 0; //#77 rln S4135: using singularity which has minimum gap between singular point and input 3D point Standard_Integer indMin = -1; Standard_Real gapMin2 = RealLast(); @@ -940,7 +942,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu // make degenerative pcurve parametrized exactly from end of pcurve of the // previous edge to the start of the next one if ( lack || n1 != n2 ) { //:i8 abv 18 Sep 98: ProSTEP TR9 r0501-ug.stp #182180: single degedge is a wire at apex of a cone - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle(Geom2d_Curve) c2d; if ( sae.PCurve ( E1, myFace, c2d, a, b, Standard_True ) ) { p2d1 = c2d->Value ( b ); @@ -1012,7 +1014,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu Standard_Integer n1 = ( n2 >1 ? n2-1 : NbEdges() ); TopoDS_Edge E1 = myWire->Edge(n1); TopoDS_Edge E2 = myWire->Edge(n2); - Standard_Real uf1,ul1,uf2,ul2; + Standard_Real uf1 = NAN,ul1 = NAN,uf2 = NAN,ul2 = NAN; Handle(Geom_Curve) C1,C2; ShapeAnalysis_Edge SAE; if (!SAE.Curve3d (E1,C1,uf1,ul1) || !SAE.Curve3d (E2,C2,uf2,ul2)) { @@ -1041,7 +1043,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu Standard_Integer n1 = ( n2 >1 ? n2-1 : NbEdges() ); TopoDS_Edge E1 = myWire->Edge(n1); TopoDS_Edge E2 = myWire->Edge(n2); - Standard_Real uf1,ul1,uf2,ul2; + Standard_Real uf1 = NAN,ul1 = NAN,uf2 = NAN,ul2 = NAN; Handle(Geom2d_Curve) C1,C2; ShapeAnalysis_Edge SAE; if (!SAE.PCurve (E1,myFace,C1,uf1,ul1) || !SAE.PCurve (E2,myFace,C2,uf2,ul2)) { @@ -1068,7 +1070,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu if ( !IsLoaded() || NbEdges() < 1 ) return Standard_False; Standard_Integer n = ( num >0 ? num : NbEdges() ); TopoDS_Edge E = myWire->Edge(n); - Standard_Real cuf,cul,pcuf,pcul; + Standard_Real cuf = NAN,cul = NAN,pcuf = NAN,pcul = NAN; Handle(Geom_Curve) c; ShapeAnalysis_Edge SAE; if (!SAE.Curve3d (E,c,cuf,cul,Standard_False)) { @@ -1085,7 +1087,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu Adaptor3d_CurveOnSurface ACS(AC,AS); gp_Pnt cpnt, pcpnt; Standard_Integer nbp = 45; - Standard_Real dist, maxdist=0.; + Standard_Real dist = NAN, maxdist=0.; for (Standard_Integer i=0; iValue(cuf + i*(cul-cuf)/(nbp-1)); pcpnt = ACS.Value(pcuf + i*(pcul-pcuf)/(nbp-1)); @@ -1112,7 +1114,7 @@ static gp_Pnt GetPointOnEdge ( const TopoDS_Edge &edge, const Standard_Real param ) { if ( BRep_Tool::SameParameter ( edge ) ) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; TopLoc_Location L; const Handle(Geom_Curve) ConS = BRep_Tool::Curve ( edge, L, f, l ); if ( ! ConS.IsNull() ) @@ -1139,7 +1141,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckSelfIntersectingEdge (const Standard_I TopoDS_Edge edge = WireData()->Edge ( num >0 ? num : NbEdges() ); ShapeAnalysis_Edge sae; - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle(Geom2d_Curve) Crv; if ( ! sae.PCurve ( edge, myFace, Crv, a, b, Standard_False ) ) { myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_FAIL1); @@ -1237,7 +1239,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges (const Standard_Inte TopoDS_Vertex Vp = sae.FirstVertex ( edge1 ); TopoDS_Vertex Vn = sae.LastVertex ( edge2 ); - Standard_Real a1, b1, a2, b2; + Standard_Real a1 = NAN, b1 = NAN, a2 = NAN, b2 = NAN; Handle(Geom2d_Curve) Crv1, Crv2; if ( ! sae.PCurve ( edge1, myFace, Crv1, a1, b1, Standard_False ) ) { myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_FAIL3); @@ -1312,7 +1314,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges (const Standard_Inte if ( Tr1.PositionOnCurve() != IntRes2d_Middle && Tr2.PositionOnCurve() != IntRes2d_Middle ) continue; - Standard_Real param1, param2; + Standard_Real param1 = NAN, param2 = NAN; param1 = ( num ==1 ? IP.ParamOnSecond() : IP.ParamOnFirst() ); param2 = ( num ==1 ? IP.ParamOnFirst() : IP.ParamOnSecond() ); @@ -1390,7 +1392,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges(const Standard_Integ TopoDS_Edge edge2 = sbwd->Edge ( n2 ); ShapeAnalysis_Edge sae; - Standard_Real a1, b1, a2, b2; + Standard_Real a1 = NAN, b1 = NAN, a2 = NAN, b2 = NAN; Handle(Geom2d_Curve) Crv1, Crv2; if(!sae.PCurve ( edge1, myFace, Crv1, a1, b1, Standard_False )){ myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_FAIL3); @@ -1528,7 +1530,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckLacking (const Standard_Integer num, return Standard_False; } - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; gp_Vec2d v1, v2, v12; Handle(Geom2d_Curve) c2d; if ( ! sae.PCurve ( E1, myFace, c2d, a, b, Standard_True ) ) { @@ -1662,7 +1664,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckNotchedEdges(const Standard_Integer nu return Standard_False; } - Standard_Real a1, b1, a2, b2; + Standard_Real a1 = NAN, b1 = NAN, a2 = NAN, b2 = NAN; gp_Pnt2d p2d1, p2d2; gp_Vec2d v1, v2; Handle(Geom2d_Curve) c2d1, c2d2; @@ -1704,7 +1706,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckNotchedEdges(const Standard_Integer nu Adaptor3d_CurveOnSurface Ad2(AC2d2,AdS2); Adaptor3d_CurveOnSurface longAD, shortAD; - Standard_Real lenP, firstP; + Standard_Real lenP = NAN, firstP = NAN; ShapeAnalysis_Curve sac; @@ -1760,7 +1762,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckSmallArea(const TopoDS_Wire& theWire) return Standard_False; myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); - Standard_Real aF, aL, aLength(0.0); + Standard_Real aF = NAN, aL = NAN, aLength(0.0); const Standard_Real anInv = 1.0 / static_cast(aNbControl - 1); gp_XY aCenter2d(0., 0.); @@ -1854,7 +1856,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckSmallArea(const TopoDS_Wire& theWire) Standard_Boolean ShapeAnalysis_Wire::CheckShapeConnect(const TopoDS_Shape& shape,const Standard_Real prec) { - Standard_Real tailhead, tailtail, headhead, headtail; + Standard_Real tailhead = NAN, tailtail = NAN, headhead = NAN, headtail = NAN; return CheckShapeConnect (tailhead, tailtail, headtail, headhead, shape, prec); } diff --git a/src/ShapeAnalysis/ShapeAnalysis_Wire.hxx b/src/ShapeAnalysis/ShapeAnalysis_Wire.hxx index edb403eca4..bf5b38dab1 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Wire.hxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Wire.hxx @@ -528,24 +528,24 @@ protected: Handle(ShapeExtend_WireData) myWire; TopoDS_Face myFace; Handle(ShapeAnalysis_Surface) mySurf; - Standard_Real myPrecision; - Standard_Real myMin3d; - Standard_Real myMin2d; - Standard_Real myMax3d; - Standard_Real myMax2d; - Standard_Integer myStatusOrder; - Standard_Integer myStatusConnected; - Standard_Integer myStatusEdgeCurves; - Standard_Integer myStatusDegenerated; - Standard_Integer myStatusClosed; - Standard_Integer myStatusSmall; - Standard_Integer myStatusSelfIntersection; - Standard_Integer myStatusLacking; - Standard_Integer myStatusGaps3d; - Standard_Integer myStatusGaps2d; - Standard_Integer myStatusCurveGaps; - Standard_Integer myStatusLoop; - Standard_Integer myStatus; + Standard_Real myPrecision{}; + Standard_Real myMin3d{}; + Standard_Real myMin2d{}; + Standard_Real myMax3d{}; + Standard_Real myMax2d{}; + Standard_Integer myStatusOrder{}; + Standard_Integer myStatusConnected{}; + Standard_Integer myStatusEdgeCurves{}; + Standard_Integer myStatusDegenerated{}; + Standard_Integer myStatusClosed{}; + Standard_Integer myStatusSmall{}; + Standard_Integer myStatusSelfIntersection{}; + Standard_Integer myStatusLacking{}; + Standard_Integer myStatusGaps3d{}; + Standard_Integer myStatusGaps2d{}; + Standard_Integer myStatusCurveGaps{}; + Standard_Integer myStatusLoop{}; + Standard_Integer myStatus{}; private: diff --git a/src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx b/src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx index 0b8b34c4f0..c57ed5e48a 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx @@ -16,6 +16,8 @@ //szv#4 S4163 // pdn 09.05.99: S4174: preserve order of edges for complete torus +#include + #include #include #include @@ -33,9 +35,9 @@ //purpose : //======================================================================= ShapeAnalysis_WireOrder::ShapeAnalysis_WireOrder() - : myGap (0.0), myStat (0), myKeepLoops (Standard_False), myMode (Mode3D) + : myTol(Precision::Confusion()), myGap (0.0), myStat (0), myKeepLoops (Standard_False), myMode (Mode3D) { - myTol = Precision::Confusion(); + Clear(); } @@ -303,16 +305,16 @@ void ShapeAnalysis_WireOrder::Perform (const Standard_Boolean /*closed*/) } // find minimum distance and joint type for 3D and 2D (if necessary) modes - Standard_Integer aCurJointType; - Standard_Real aCurMin; + Standard_Integer aCurJointType = 0; + Standard_Real aCurMin = NAN; // distance for four possible cases Standard_Real aSeqTailEdgeHead = aLastPnt3D.SquareDistance (aBegins3D (i)); Standard_Real aSeqTailEdgeTail = aLastPnt3D.SquareDistance (anEnds3D (i)); Standard_Real aSeqHeadEdgeTail = aFirstPnt3D.SquareDistance (anEnds3D (i)); Standard_Real aSeqHeadEdgeHead = aFirstPnt3D.SquareDistance (aBegins3D (i)); // the best distances for joints with head and tail of sequence - Standard_Real aMinDistToTail, aMinDistToHead; - Standard_Integer aTailJoinType, aHeadJointType; + Standard_Real aMinDistToTail = NAN, aMinDistToHead = NAN; + Standard_Integer aTailJoinType = 0, aHeadJointType = 0; if (aSeqTailEdgeHead <= aSeqTailEdgeTail) { aTailJoinType = 0; @@ -594,7 +596,7 @@ void ShapeAnalysis_WireOrder::Perform (const Standard_Boolean /*closed*/) Standard_Real aReverseDist = aCurLoopFirst.SquareDistance (aMainLoopLast) + aCurLoopLast.SquareDistance (aMainLoopFirst); // take the best result - Standard_Real aJoinDist; + Standard_Real aJoinDist = NAN; if ((aDirectDist < aTol2) || (aDirectDist < 2.0 * aReverseDist)) { aJoinDist = aDirectDist; @@ -667,7 +669,7 @@ void ShapeAnalysis_WireOrder::Perform (const Standard_Boolean /*closed*/) // check if edges were only shifted in reverse or forward, not reordered Standard_Boolean isShiftReverse = Standard_True; Standard_Boolean isShiftForward = Standard_True; - Standard_Integer aFirstIdx, aSecondIdx; + Standard_Integer aFirstIdx = 0, aSecondIdx = 0; Standard_Integer aLength = aMainLoop->Length(); for (Standard_Integer i = 1; i <= aLength - 1; i++) { @@ -788,7 +790,7 @@ Standard_Real ShapeAnalysis_WireOrder::Gap (const Standard_Integer num) const void ShapeAnalysis_WireOrder::SetChains (const Standard_Real gap) { - Standard_Integer n0, n1, n2, nb = NbEdges(); //szv#4:S4163:12Mar99 o0,o1,o2 not needed + Standard_Integer n0 = 0, n1 = 0, n2 = 0, nb = NbEdges(); //szv#4:S4163:12Mar99 o0,o1,o2 not needed if (nb == 0) return; TColStd_SequenceOfInteger chain; n0 = 0; diff --git a/src/ShapeAnalysis/ShapeAnalysis_WireVertex.cxx b/src/ShapeAnalysis/ShapeAnalysis_WireVertex.cxx index 9fde3b198f..c765b71469 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_WireVertex.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_WireVertex.cxx @@ -13,6 +13,8 @@ //szv#4 S4163 +#include + #include #include #include @@ -31,10 +33,10 @@ //function : ShapeAnalysis_WireVertex //purpose : //======================================================================= -ShapeAnalysis_WireVertex::ShapeAnalysis_WireVertex() +ShapeAnalysis_WireVertex::ShapeAnalysis_WireVertex() : myDone(Standard_False), myPreci(Precision::Confusion()) { - myDone = Standard_False; - myPreci = Precision::Confusion(); + + } //======================================================================= @@ -106,8 +108,8 @@ ShapeAnalysis_WireVertex::ShapeAnalysis_WireVertex() myDone = Standard_True; // Analyse des vertex qui se suivent Handle(Geom_Curve) c1, c2; - Standard_Real cf, cl, upre, ufol; - Standard_Integer i, j, nb = myStat->Length(), stat; + Standard_Real cf = NAN, cl = NAN, upre = NAN, ufol = NAN; + Standard_Integer i = 0, j = 0, nb = myStat->Length(), stat = 0; ShapeAnalysis_Edge EA; for (i = 1; i <= nb; i ++) { stat = -1; // au depart @@ -141,7 +143,7 @@ ShapeAnalysis_WireVertex::ShapeAnalysis_WireVertex() // Une edge se termine sur l autre : il faudra simplement relimiter // Projection calculee sur une demi-edge (pour eviter les pbs de couture) gp_Pnt PJ1,PJ2; - Standard_Real U1,U2; + Standard_Real U1 = NAN,U2 = NAN; Standard_Real dj1 = ShapeAnalysis_Curve().Project (c1,P2,myPreci,PJ1,U1,(cf+upre)/2,upre); Standard_Real dj2 = ShapeAnalysis_Curve().Project (c2,P1,myPreci,PJ2,U2,ufol,(ufol+cl)/2); if (dj1 <= myPreci) { SetStart (i,PJ1.XYZ(),U1); continue; } @@ -335,7 +337,7 @@ const Handle(ShapeExtend_WireData)& ShapeAnalysis_WireVertex::WireData() const { //szv#4:S4163:12Mar99 optimized if (!myStat.IsNull()) { - Standard_Integer i,nb = myStat->Length(); + Standard_Integer i = 0,nb = myStat->Length(); for (i = num+1; i <= nb; i ++) if (myStat->Value(i) == stat) return i; } return 0; @@ -351,7 +353,7 @@ const Handle(ShapeExtend_WireData)& ShapeAnalysis_WireVertex::WireData() const { //szv#4:S4163:12Mar99 optimized if (!myStat.IsNull()) { - Standard_Integer i,nb = myStat->Length(); + Standard_Integer i = 0,nb = myStat->Length(); for (i = num+1; i <= nb; i ++) { Standard_Integer stat = myStat->Value(i); if ((crit == -1 && stat < 0) || diff --git a/src/ShapeBuild/ShapeBuild_Edge.cxx b/src/ShapeBuild/ShapeBuild_Edge.cxx index 34b2d5ff52..ba0513f951 100644 --- a/src/ShapeBuild/ShapeBuild_Edge.cxx +++ b/src/ShapeBuild/ShapeBuild_Edge.cxx @@ -15,6 +15,8 @@ // pdn 20.04.99 S4181 Moving algorithm for transforming pcurves from IGES processor // abv 05.05.99 S4137: adding methods for copying ranges, reassigning pcurves etc. +#include + #include #include #include @@ -288,8 +290,8 @@ void ShapeBuild_Edge::SetRange3d (const TopoDS_Edge& edge, void ShapeBuild_Edge::CopyPCurves (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge) const { - TopLoc_Location fromLoc = fromedge.Location(); - TopLoc_Location toLoc = toedge.Location(); + const TopLoc_Location& fromLoc = fromedge.Location(); + const TopLoc_Location& toLoc = toedge.Location(); for (BRep_ListIteratorOfListOfCurveRepresentation fromitcr ((*((Handle(BRep_TEdge)*)&fromedge.TShape()))->ChangeCurves()); fromitcr.More(); fromitcr.Next()) { Handle(BRep_GCurve) fromGC = Handle(BRep_GCurve)::DownCast(fromitcr.Value()); @@ -392,7 +394,7 @@ void ShapeBuild_Edge::ReplacePCurve (const TopoDS_Edge& edge, const TopoDS_Face& face) const { BRep_Builder B; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; TopoDS_Shape dummy = edge.Reversed(); TopoDS_Edge edgerev = TopoDS::Edge(dummy); // reverse face to take second pcurve for seams like SA_Edge::PCurve() does @@ -443,7 +445,7 @@ Standard_Boolean ShapeBuild_Edge::ReassignPCurve (const TopoDS_Edge& edge, Standard_Integer npcurves = CountPCurves ( edge, old ); //if ( npcurves <1 ) return Standard_False; //gka - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom2d_Curve) pc; pc = BRep_Tool::CurveOnSurface ( edge, old, f, l ); if ( pc.IsNull() ) return Standard_False; @@ -470,7 +472,7 @@ Standard_Boolean ShapeBuild_Edge::ReassignPCurve (const TopoDS_Edge& edge, //smh#8 Porting AIX TopoDS_Shape tmpshape = edge.Reversed(); TopoDS_Edge erev = TopoDS::Edge (tmpshape); - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) pcs = BRep_Tool::CurveOnSurface ( erev, sub, cf, cl ); if ( edge.Orientation() == TopAbs_REVERSED ) // because B.UpdateEdge does not check edge orientation B.UpdateEdge ( edge, pcs, pc, sub, 0. ); @@ -604,12 +606,12 @@ Standard_Boolean ShapeBuild_Edge::BuildCurve3d (const TopoDS_Edge& edge) const //#50 S4054 rln 14.12.98 write cylinder in BRep mode into IGES and read back //with 2DUse_Forced - pcurve and removed 3D curves have different ranges if (BRep_Tool::SameRange (edge)) { - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_Tool::Range (edge, first, last); BRep_Builder().Range (edge, first, last);//explicit setting for all reps } Handle(Geom_Curve) c3d; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; c3d = BRep_Tool::Curve(edge,f,l); if (c3d.IsNull()) return Standard_False; diff --git a/src/ShapeBuild/ShapeBuild_ReShape.cxx b/src/ShapeBuild/ShapeBuild_ReShape.cxx index 89b9d69223..1745e74488 100644 --- a/src/ShapeBuild/ShapeBuild_ReShape.cxx +++ b/src/ShapeBuild/ShapeBuild_ReShape.cxx @@ -59,7 +59,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape, TopoDS_Compound C; B.MakeCompound (C); for (TopoDS_Iterator it (shape); it.More(); it.Next()) { - TopoDS_Shape sh = it.Value(); + const TopoDS_Shape& sh = it.Value(); Standard_Integer stat = Status (sh,newsh,Standard_False); if (stat != 0) modif = 1; if (stat >= 0) B.Add (C,newsh); @@ -75,7 +75,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape, TopoDS_Solid S; B.MakeSolid (S); for (TopoDS_Iterator it (shape); it.More(); it.Next()) { - TopoDS_Shape sh = it.Value(); + const TopoDS_Shape& sh = it.Value(); newsh = Apply (sh,until,buildmode); if (newsh.IsNull()) { modif = -1; @@ -83,7 +83,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape, else if (newsh.ShapeType() != TopAbs_SHELL) { Standard_Integer nbsub = 0; for (TopExp_Explorer exh(newsh,TopAbs_SHELL); exh.More(); exh.Next()) { - TopoDS_Shape onesh = exh.Current (); + const TopoDS_Shape& onesh = exh.Current (); B.Add (S,onesh); nbsub ++; } @@ -110,7 +110,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape, TopoDS_Shell S; B.MakeShell (S); for (TopoDS_Iterator it (shape); it.More(); it.Next()) { - TopoDS_Shape sh = it.Value(); + const TopoDS_Shape& sh = it.Value(); newsh = Apply (sh,until,buildmode); if (newsh.IsNull()) { modif = -1; @@ -118,7 +118,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape, else if (newsh.ShapeType() != TopAbs_FACE) { Standard_Integer nbsub = 0; for (TopExp_Explorer exf(newsh,TopAbs_FACE); exf.More(); exf.Next()) { - TopoDS_Shape onesh = exf.Current (); + const TopoDS_Shape& onesh = exf.Current (); B.Add (S,onesh); nbsub ++; } @@ -189,7 +189,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape, // apply recorded modifications to subshapes for ( TopoDS_Iterator it(shape,Standard_False); it.More(); it.Next() ) { - TopoDS_Shape sh = it.Value(); + const TopoDS_Shape& sh = it.Value(); newsh = Apply ( sh, until ); if ( newsh != sh ) { if ( ShapeExtend::DecodeStatus ( myStatus, ShapeExtend_DONE4 ) ) @@ -207,7 +207,7 @@ TopoDS_Shape ShapeBuild_ReShape::Apply (const TopoDS_Shape& shape, } Standard_Integer nitems = 0; for ( TopoDS_Iterator subit(newsh); subit.More(); subit.Next(), nitems++ ) { - TopoDS_Shape subsh = subit.Value(); + const TopoDS_Shape& subsh = subit.Value(); if ( subsh.ShapeType() == sh.ShapeType() ) B.Add ( result, subsh ); else locStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL1 ); } diff --git a/src/ShapeBuild/ShapeBuild_Vertex.cxx b/src/ShapeBuild/ShapeBuild_Vertex.cxx index b053b17126..05503a98ad 100644 --- a/src/ShapeBuild/ShapeBuild_Vertex.cxx +++ b/src/ShapeBuild/ShapeBuild_Vertex.cxx @@ -14,6 +14,8 @@ // rln 22.03.99: syntax correction in CombineVertex //szv#4 S4163 +#include + #include #include #include @@ -45,7 +47,7 @@ TopoDS_Vertex ShapeBuild_Vertex::CombineVertex (const gp_Pnt& pnt1, const Standard_Real tolFactor) const { gp_Pnt pos; - Standard_Real tol; + Standard_Real tol = NAN; gp_Vec v = pnt2.XYZ() - pnt1.XYZ(); Standard_Real dist = v.Magnitude(); diff --git a/src/ShapeConstruct/ShapeConstruct.cxx b/src/ShapeConstruct/ShapeConstruct.cxx index d2a9ae3a34..499c645145 100644 --- a/src/ShapeConstruct/ShapeConstruct.cxx +++ b/src/ShapeConstruct/ShapeConstruct.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -309,7 +311,7 @@ Standard_Boolean ShapeConstruct::JoinPCurves(const Handle(TopTools_HSequenceOfSh resOrient = TopAbs_FORWARD; Handle(Geom2d_Curve) c2d,c2d2; - Standard_Real first, last,first2, last2; + Standard_Real first = NAN, last = NAN,first2 = NAN, last2 = NAN; if(!sae.PCurve ( Edge, theFace, c2d, first, last, Standard_False )) break; @@ -329,7 +331,7 @@ Standard_Boolean ShapeConstruct::JoinPCurves(const Handle(TopTools_HSequenceOfSh } else { Handle(Geom2d_Curve) newCrv; - Standard_Boolean isRev1,isRev2; + Standard_Boolean isRev1 = 0,isRev2 = 0; if(!JoinCurves(aCrvRes1,c2d,resOrient,Edge.Orientation(),newf,newl,first, last,newCrv,isRev1,isRev2)) break; diff --git a/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx b/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx index 66fd7791a7..034a10e120 100644 --- a/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx +++ b/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -46,7 +48,7 @@ Standard_Boolean IsRightContour (const TColgp_SequenceOfPnt& pts, const Standard if (len < 4) return Standard_True; TColgp_Array1OfPnt thePts(1,len); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <= len; i++) thePts(i) = pts(i); gp_XYZ Norm(0,0,0); @@ -89,7 +91,7 @@ Standard_Boolean IsRightContour (const TColgp_SequenceOfPnt& pts, const Standard Standard_Integer len = pts.Length(); if (len < 3) return gp_Vec(0,0,0); - Standard_Integer i; + Standard_Integer i = 0; gp_XYZ theCenter(0,0,0); for (i = 1; i <= len; i++) theCenter += pts(i).XYZ(); theCenter /= len; @@ -110,9 +112,9 @@ Standard_Boolean IsRightContour (const TColgp_SequenceOfPnt& pts, const Standard //======================================================================= ShapeConstruct_MakeTriangulation::ShapeConstruct_MakeTriangulation (const TColgp_Array1OfPnt& pnts, - const Standard_Real prec) + const Standard_Real prec) : myPrecision((prec > 0.0)? prec : Precision::Confusion()) { - myPrecision = (prec > 0.0)? prec : Precision::Confusion(); + // Make polygonal wire from points BRepBuilderAPI_MakePolygon mkPoly; for (Standard_Integer i = pnts.Lower(); i <= pnts.Upper(); i++) mkPoly.Add(pnts(i)); @@ -130,10 +132,10 @@ ShapeConstruct_MakeTriangulation::ShapeConstruct_MakeTriangulation (const TColgp //======================================================================= ShapeConstruct_MakeTriangulation::ShapeConstruct_MakeTriangulation (const TopoDS_Wire& wire, - const Standard_Real prec) + const Standard_Real prec) : myPrecision((prec > 0.0)? prec : Precision::Confusion()), myWire(wire) { - myPrecision = (prec > 0.0)? prec : Precision::Confusion(); - myWire = wire; + + Build(); } @@ -263,9 +265,9 @@ ShapeConstruct_MakeTriangulation::ShapeConstruct_MakeTriangulation (const TopoDS if (cindex%4 == 0) { gp_Vec theBaseNorm = MeanNormal(theAPnt->Array1()); // Identify sequence of matching facets - Standard_Integer len = cindex/2, lindex, rindex, seqlen, j; - Standard_Real theC, theC1 = 0.0, theC2 = 0.0; - Standard_Integer ii; // svv Jan11 2000 : porting on DEC + Standard_Integer len = cindex/2, lindex = 0, rindex = 0, seqlen = 0, j = 0; + Standard_Real theC = NAN, theC1 = 0.0, theC2 = 0.0; + Standard_Integer ii = 0; // svv Jan11 2000 : porting on DEC // skl : change "i" to "ii" for (ii = 0; ii < len; ii++) { // Compute normal collinearity for facet @@ -360,11 +362,11 @@ ShapeConstruct_MakeTriangulation::ShapeConstruct_MakeTriangulation (const TopoDS TColgp_SequenceOfPnt pts; for (TopoDS_Iterator ite(wire); ite.More(); ite.Next()) pts.Append(BRep_Tool::Pnt(sae.FirstVertex(TopoDS::Edge(ite.Value())))); - Standard_Integer i, nbp = pts.Length(); + Standard_Integer i = 0, nbp = pts.Length(); if (nbp < 3) return; // Create mean plane - Standard_Real cMod, maxMod = 0.0; + Standard_Real cMod = NAN, maxMod = 0.0; gp_XYZ maxVec, Normal(0,0,0); for (i = 1; i <= nbp; i++) { gp_XYZ vb(pts(i).XYZ()); diff --git a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx index d37d601ac7..a51b008c32 100644 --- a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx +++ b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx @@ -29,6 +29,8 @@ //:s5 abv 22.04.99 Adding debug printouts in catch {} blocks //#1 svv 11.01.00 Porting on DEC +#include + #include #include #include @@ -106,12 +108,12 @@ static void AdjustSecondPointToFirstPoint(const gp_Pnt2d& theFirstPoint, //purpose : //======================================================================= -ShapeConstruct_ProjectCurveOnSurface::ShapeConstruct_ProjectCurveOnSurface() +ShapeConstruct_ProjectCurveOnSurface::ShapeConstruct_ProjectCurveOnSurface() : myPreci(Precision::Confusion()), myBuild(Standard_False), myAdjustOverDegen(1), myNbCashe(0) { - myPreci = Precision::Confusion(); - myBuild = Standard_False; - myAdjustOverDegen = 1; //:c0 //szv#4:S4163:12Mar99 was boolean - myNbCashe = 0; //:q9 + + + //:c0 //szv#4:S4163:12Mar99 was boolean + //:q9 } //======================================================================= @@ -232,7 +234,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv // discretize the 3d curve - Standard_Integer nbrPnt; + Standard_Integer nbrPnt = 0; // $$$$ :92 abv 28 Jan 98 see PRO10107, big BSplineCurve C0 Standard_Integer nbPini = NCONTROL; // as in BRepCheck_Edge (RLN/Nijni) @@ -268,7 +270,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv TColStd_SequenceOfReal params; NCollection_Sequence aKnotCoeffs; gp_Pnt p3d; - Standard_Integer iPnt; + Standard_Integer iPnt = 0; // In case of bspline compute parametrization speed on each // knot interval inside [aFirstParam, aLastParam]. @@ -311,7 +313,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv } } Standard_Real aStep = (aLastParam - aFirstParam) / (aNbIntPnts - 1); - Standard_Integer anIntIdx; + Standard_Integer anIntIdx = 0; gp_Pnt p3d1, p3d2; // Start filling from first point. aC3DAdaptor.D0(aFirstParam, p3d1); @@ -354,7 +356,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv } } - Standard_Real deltaT, t; + Standard_Real deltaT = NAN, t = NAN; deltaT = (Last - First) / (nbPini-1); nbrPnt = nbPini; for (iPnt = 1; iPnt <= nbPini; iPnt ++) @@ -538,8 +540,8 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G Standard_Integer theSavedPoint, // Point number to choose period Standard_Real theSavedParam) // Param from cache to choose period { - Standard_Real aSavedParam; - Standard_Integer aSavedPoint; + Standard_Real aSavedParam = NAN; + Standard_Integer aSavedPoint = 0; Standard_Real aMinParam = 0.0, aMaxParam = thePeriod; if (theSavedPoint < 0) { // normalize to first period by default @@ -674,7 +676,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G // project first and last points for( ; i < 4; i +=3) { - Standard_Integer j; + Standard_Integer j = 0; for (j = 0; j < myNbCashe; j++) { if ( myCashe3d[j].SquareDistance (aP[i] ) < aTol2) @@ -702,7 +704,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G // Compute second and last but one c2d points. for(i = 1; i < 3; i++) { - Standard_Integer j; + Standard_Integer j = 0; for (j = 0; j < myNbCashe; j++) { if ( myCashe3d[j].SquareDistance (aP[i] ) < aTol2) @@ -865,15 +867,15 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G // test if the curve 3d is a boundary of the surface // (only for Bezier or BSpline surface) - Standard_Boolean isoParam, isoPar2d3d, isoTypeU, p1OnIso, p2OnIso, isoclosed; + Standard_Boolean isoParam = 0, isoPar2d3d = 0, isoTypeU = 0, p1OnIso = 0, p2OnIso = 0, isoclosed = 0; gp_Pnt2d valueP1, valueP2; Handle(Geom_Curve) cIso; - Standard_Real t1, t2; + Standard_Real t1 = NAN, t2 = NAN; Handle(Standard_Type) sType = mySurf->Surface()->DynamicType(); Standard_Boolean isAnalytic = Standard_True; if (sType == STANDARD_TYPE(Geom_BezierSurface) || sType == STANDARD_TYPE(Geom_BSplineSurface)) isAnalytic = Standard_False; - Standard_Real uf, ul, vf, vl; + Standard_Real uf = NAN, ul = NAN, vf = NAN, vl = NAN; mySurf->Surface()->Bounds(uf, ul, vf, vl); isoclosed = Standard_False; TColStd_Array1OfReal pout(1, nbrPnt); @@ -886,8 +888,8 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G gp_Pnt p3d; gp_Pnt2d p2d; - Standard_Real isoValue=0., isoPar1=0., isoPar2=0., tPar=0., tdeb,tfin; - Standard_Real Cf, Cl, parf, parl; //szv#4:S4163:12Mar99 dist not needed + Standard_Real isoValue=0., isoPar1=0., isoPar2=0., tPar=0., tdeb = NAN,tfin = NAN; + Standard_Real Cf = NAN, Cl = NAN, parf = NAN, parl = NAN; //szv#4:S4163:12Mar99 dist not needed // Le calcul part-il dans le bon sens, c-a-d deb et fin dans le bon ordre ? // Si uclosed et iso en V, attention isoPar1 ET/OU 2 peut toucher la fermeture @@ -1037,7 +1039,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G else { //:q9 abv 23 Mar 99: use cache as 1st approach - Standard_Integer j; // svv #1 + Standard_Integer j = 0; // svv #1 for (j = 0; j < myNbCashe; ++j) { if (myCashe3d[j].SquareDistance(p3d) < myPreci*myPreci) @@ -1102,10 +1104,10 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G Standard_Real aTolLast = (TolLast == -1)? Precision::Confusion() : TolLast; for (Standard_Integer i = 1; ; i++) { - Standard_Real aPreci, aFirstPar, aLastPar; + Standard_Real aPreci = NAN, aFirstPar = NAN, aLastPar = NAN; gp_Pnt aP3d; gp_Pnt2d aFirstP2d, aLastP2d; - Standard_Boolean IsUiso; + Standard_Boolean IsUiso = 0; if (!mySurf->Singularity(i, aPreci, aP3d, aFirstP2d, aLastP2d, aFirstPar, aLastPar, IsUiso)) break; if (aPreci <= Precision::Confusion() && @@ -1140,7 +1142,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G // algo un peu complique, on retarde l implementation //Standard_Real Up = ul - uf; //Standard_Real Vp = vl - vf; - Standard_Real dist2d; + Standard_Real dist2d = NAN; const Standard_Real TolOnUPeriod = Precision::Confusion() * Up; const Standard_Real TolOnVPeriod = Precision::Confusion() * Vp; #ifdef OCCT_DEBUG @@ -1151,7 +1153,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G // Si la surface est UCLosed, on recadre les points if (mySurf->IsUClosed(myPreci) || needResolveUJump) {//#78 rln 12.03.99 S4135 // Premier point dans le domain [uf, ul] - Standard_Real prevX, firstX = pnt2d (1).X(); + Standard_Real prevX = NAN, firstX = pnt2d (1).X(); if (!isFromCashe) { // do not shift 2dcurve, if it connects to previous while (firstX < uf) { firstX += Up; pnt2d (1).SetX(firstX); } @@ -1219,7 +1221,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G if (mySurf->IsVClosed(myPreci) || needResolveVJump || mySurf->Surface()->IsKind (STANDARD_TYPE (Geom_SphericalSurface))) { // Premier point dans le domain [vf, vl] - Standard_Real prevY, firstY = pnt2d (1).Y(); + Standard_Real prevY = NAN, firstY = pnt2d (1).Y(); if (!isFromCashe) { // do not shift 2dcurve, if it connects to previous while (firstY < vf) { firstY += Vp; pnt2d (1).SetY(firstY); } @@ -1379,7 +1381,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G // 1st, find gap point (degenerated pole) Standard_Real PrevX=0.; Standard_Integer OnBound=0, PrevOnBound=0; - Standard_Integer ind; // svv #1 + Standard_Integer ind = 0; // svv #1 Standard_Boolean start = Standard_True; for ( ind=1; ind <= pnt2d.Length(); ind++ ) { Standard_Real CurX = pnt2d(ind).X(); @@ -1424,7 +1426,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G // 1st, find gap point (degenerated pole) Standard_Real PrevY=0.; Standard_Integer OnBound=0, PrevOnBound=0; - Standard_Integer ind; // svv #1 + Standard_Integer ind = 0; // svv #1 Standard_Boolean start = Standard_True; for ( ind=1; ind <= pnt2d.Length(); ind++ ) { Standard_Real CurY = pnt2d(ind).Y(); @@ -1505,7 +1507,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con TColgp_Array1OfPnt points3d(1,numberPnt); gp_Pnt2d pnt2d; gp_Pnt pnt; - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for( i = 1; i <= numberPnt; i++) { pnt2d = points2d->Value(i); pnt.SetCoord(pnt2d.X(),pnt2d.Y(),0); @@ -1513,7 +1515,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con } GeomAPI_PointsToBSpline appr(points3d, params->Array1(), 1, 10, GeomAbs_C1, theTolerance2d); - Handle(Geom_BSplineCurve) crv3d = appr.Curve(); + const Handle(Geom_BSplineCurve)& crv3d = appr.Curve(); Standard_Integer NbPoles = crv3d->NbPoles(); TColgp_Array1OfPnt poles3d (1, NbPoles); TColgp_Array1OfPnt2d poles2d (1, NbPoles); @@ -1659,7 +1661,7 @@ void ShapeConstruct_ProjectCurveOnSurface::CorrectExtremity(const Handle(Geom_Cu mySurf->Surface()->IsVPeriodic() : mySurf->Surface()->IsUPeriodic(); gp_Pnt2d FirstPointOfLine, SecondPointOfLine; - Standard_Real FinishParam, FirstParam, SecondParam; + Standard_Real FinishParam = NAN, FirstParam = NAN, SecondParam = NAN; if (theIsFirstPoint) { @@ -1842,7 +1844,7 @@ InsertAdditionalPointOrAdjust(Standard_Boolean& ToAdjust, { Standard_Integer firstElem = points->Lower(); Standard_Integer lastElem = points->Upper(); - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer nbPntDropped = 0; Standard_Integer lastValid = firstElem; // indice of last undropped point @@ -1912,7 +1914,7 @@ InsertAdditionalPointOrAdjust(Standard_Boolean& ToAdjust, { Standard_Integer firstElem = points->Lower(); Standard_Integer lastElem = points->Upper(); - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer nbPntDropped = 0; Standard_Integer lastValid = firstElem; // indice of last undropped point @@ -2015,7 +2017,7 @@ InsertAdditionalPointOrAdjust(Standard_Boolean& ToAdjust, Standard_Boolean isoParam = Standard_False; isoPar2d3d = Standard_False; - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; mySurf->Bounds(U1, U2, V1, V2); if ( mySurf->Surface()->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { @@ -2026,8 +2028,8 @@ InsertAdditionalPointOrAdjust(Standard_Boolean& ToAdjust, gp_Pnt pt; Standard_Integer mpt[2]; mpt[0] = mpt[1] = 0; - Standard_Real t, tpar[2] = { 0.0, 0.0 }, isoValue=0.; - Standard_Real mindist2; + Standard_Real t = NAN, tpar[2] = { 0.0, 0.0 }, isoValue=0.; + Standard_Real mindist2 = NAN; Standard_Real mind2[2]; mindist2 = mind2[0] = mind2[1] = 4*prec*prec; @@ -2039,7 +2041,7 @@ InsertAdditionalPointOrAdjust(Standard_Boolean& ToAdjust, Standard_Real isoVal=0.; Standard_Boolean isoU=Standard_False; //szv#4:S4163:12Mar99 `isoU` must be Standard_Boolean Handle(Geom_Curve) cI; - Standard_Real tt1, tt2; + Standard_Real tt1 = NAN, tt2 = NAN; if (j == 1 ) { if (Precision::IsInfinite(U1)) continue; @@ -2198,7 +2200,7 @@ InsertAdditionalPointOrAdjust(Standard_Boolean& ToAdjust, if (isoPar2d3d) isoParam = Standard_True; else { Standard_Real prevParam = tpar[0]; - Standard_Real Cf, Cl; + Standard_Real Cf = NAN, Cl = NAN; Standard_Boolean isoByDistance = Standard_True; Cf = cIso->FirstParameter(); Cl = cIso->LastParameter(); diff --git a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.hxx b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.hxx index dd8c679e7f..180c14d265 100644 --- a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.hxx +++ b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.hxx @@ -158,7 +158,7 @@ protected: Handle(ShapeAnalysis_Surface) mySurf; Standard_Real myPreci; Standard_Boolean myBuild; - Standard_Integer myStatus; + Standard_Integer myStatus{}; Standard_Integer myAdjustOverDegen; Standard_Integer myNbCashe; gp_Pnt myCashe3d[2]; diff --git a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx index ebab162cbe..e38ab328a1 100644 --- a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx +++ b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -241,25 +243,25 @@ static Standard_Boolean IsConvertCurve2d(const Handle(Geom2d_Curve)& aCurve, //purpose : //======================================================================= -ShapeCustom_BSplineRestriction::ShapeCustom_BSplineRestriction() +ShapeCustom_BSplineRestriction::ShapeCustom_BSplineRestriction() : myApproxSurfaceFlag(Standard_True), myApproxCurve3dFlag(Standard_True), myApproxCurve2dFlag(Standard_True), myTol3d(0.01), myTol2d(1E-6), myContinuity3d(GeomAbs_C1), myContinuity2d(GeomAbs_C2), myMaxDegree(9), myNbMaxSeg(10000), mySurfaceError(Precision::Confusion()), myCurve3dError(Precision::Confusion()), myCurve2dError(Precision::PConfusion()), myNbOfSpan(0), myConvert(Standard_False), myDeg(Standard_True), myRational(Standard_False), myParameters(new ShapeCustom_RestrictionParameters) { - myApproxSurfaceFlag = Standard_True; - myApproxCurve3dFlag = Standard_True; - myApproxCurve2dFlag = Standard_True; - myTol3d = 0.01; - myTol2d = 1E-6; - myContinuity3d = GeomAbs_C1; - myContinuity2d =GeomAbs_C2 ; - myMaxDegree = 9; - myNbMaxSeg = 10000; - mySurfaceError = Precision::Confusion(); - myCurve3dError = Precision::Confusion(); - myCurve2dError = Precision::PConfusion(); - myNbOfSpan = 0; - myConvert = Standard_False; - myDeg =Standard_True; - myRational = Standard_False; - myParameters = new ShapeCustom_RestrictionParameters; + + + + + + + + + + + + + + + + + } @@ -273,25 +275,25 @@ ShapeCustom_BSplineRestriction::ShapeCustom_BSplineRestriction(const Standard_Bo const Standard_Integer aMaxDegree, const Standard_Integer aNbMaxSeg, const Standard_Boolean Deg, - const Standard_Boolean Rational) + const Standard_Boolean Rational) : myApproxSurfaceFlag(anApproxSurfaceFlag), myApproxCurve3dFlag(anApproxCurve3dFlag), myApproxCurve2dFlag(anApproxCurve2dFlag), myTol3d(aTol3d), myTol2d(aTol2d), myMaxDegree(aMaxDegree), myContinuity3d(aContinuity3d), myContinuity2d(aContinuity2d), myNbMaxSeg(aNbMaxSeg), mySurfaceError(Precision::Confusion()), myCurve3dError(Precision::Confusion()), myCurve2dError(Precision::PConfusion()), myNbOfSpan(0), myConvert(Standard_False), myDeg(Deg), myRational(Rational), myParameters(new ShapeCustom_RestrictionParameters) { - myApproxSurfaceFlag = anApproxSurfaceFlag; - myApproxCurve3dFlag = anApproxCurve3dFlag; - myApproxCurve2dFlag = anApproxCurve2dFlag; - myTol3d = aTol3d; - myTol2d = aTol2d; - myMaxDegree = aMaxDegree; - myContinuity3d = aContinuity3d; - myContinuity2d = aContinuity2d; - myNbMaxSeg = aNbMaxSeg; - mySurfaceError = Precision::Confusion(); - myCurve3dError = Precision::Confusion(); - myCurve2dError = Precision::PConfusion(); - myNbOfSpan = 0; - myConvert = Standard_False; - myDeg = Deg; - myRational = Rational; - myParameters = new ShapeCustom_RestrictionParameters; + + + + + + + + + + + + + + + + + } @@ -306,25 +308,25 @@ ShapeCustom_BSplineRestriction::ShapeCustom_BSplineRestriction(const Standard_Bo const Standard_Integer aNbMaxSeg, const Standard_Boolean Deg, const Standard_Boolean Rational, - const Handle(ShapeCustom_RestrictionParameters)& aModes) + const Handle(ShapeCustom_RestrictionParameters)& aModes) : myApproxSurfaceFlag(anApproxSurfaceFlag), myApproxCurve3dFlag(anApproxCurve3dFlag), myApproxCurve2dFlag(anApproxCurve2dFlag), myTol3d(aTol3d), myTol2d(aTol2d), myMaxDegree(aMaxDegree), myContinuity3d(aContinuity3d), myContinuity2d(aContinuity2d), myNbMaxSeg(aNbMaxSeg), mySurfaceError(Precision::Confusion()), myCurve3dError(Precision::Confusion()), myCurve2dError(Precision::PConfusion()), myNbOfSpan(0), myConvert(Standard_False), myDeg(Deg), myRational(Rational), myParameters(aModes) { - myApproxSurfaceFlag = anApproxSurfaceFlag; - myApproxCurve3dFlag = anApproxCurve3dFlag; - myApproxCurve2dFlag = anApproxCurve2dFlag; - myTol3d = aTol3d; - myTol2d = aTol2d; - myMaxDegree = aMaxDegree; - myContinuity3d = aContinuity3d; - myContinuity2d = aContinuity2d; - myNbMaxSeg = aNbMaxSeg; - mySurfaceError = Precision::Confusion(); - myCurve3dError = Precision::Confusion(); - myCurve2dError = Precision::PConfusion(); - myNbOfSpan = 0; - myConvert = Standard_False; - myDeg = Deg; - myRational = Rational; - myParameters = aModes; + + + + + + + + + + + + + + + + + } @@ -349,9 +351,9 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewSurface(const TopoDS_Face& F if(aSurface.IsNull()) return Standard_False; Standard_Boolean IsOf = Standard_True; if(myParameters->ConvertOffsetSurf()) IsOf = Standard_False; - Standard_Real UF,UL,VF,VL; + Standard_Real UF = NAN,UL = NAN,VF = NAN,VL = NAN; aSurface->Bounds(UF,UL,VF,VL); - Standard_Real Umin, Umax, Vmin, Vmax; + Standard_Real Umin = NAN, Umax = NAN, Vmin = NAN, Vmax = NAN; BRepTools::UVBounds(F,Umin, Umax, Vmin, Vmax); if(myParameters->SegmentSurfaceMode()) { UF = Umin; UL = Umax; @@ -515,7 +517,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { Handle(Geom_RectangularTrimmedSurface) tmp = Handle(Geom_RectangularTrimmedSurface):: DownCast (aSurf); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; tmp->Bounds(U1,U2,V1,V2); Handle(Geom_Surface) theSurf = tmp->BasisSurface(); Handle(Geom_Surface) ResSurface; @@ -609,11 +611,11 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo }*/ - Standard_Real aTol3d; - Standard_Integer nbOfSpan,imax=10; + Standard_Real aTol3d = NAN; + Standard_Integer nbOfSpan = 0,imax=10; Standard_Integer MaxSeg = myNbMaxSeg; Standard_Integer MaxDeg = myMaxDegree; - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; aSurf->Bounds(u1,u2,v1,v2); Standard_Real ShiftU = 0, ShiftV = 0; if( Abs(u1-UF) > Precision::PConfusion() || Abs(u2- UL) > Precision::PConfusion() || @@ -641,7 +643,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo if(isTrim && (u1 != u2) && (v1 != v2)) { Handle(Geom_RectangularTrimmedSurface) trSurface = new Geom_RectangularTrimmedSurface(aSurf,u1,u2,v1,v2); - Standard_Real ur1,ur2,vr1,vr2; + Standard_Real ur1 = NAN,ur2 = NAN,vr1 = NAN,vr2 = NAN; trSurface->Bounds(ur1,ur2,vr1,vr2); ShiftU = u1-ur1; ShiftV = v1-vr1; @@ -781,7 +783,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewCurve(const TopoDS_Edge& E, { if ( ! myApproxCurve3dFlag ) return Standard_False; - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(E,L,First, Last); Standard_Real TolCur = BRep_Tool::Tolerance(E); //if(aCurve.IsNull()) return Standard_False; @@ -1089,7 +1091,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewCurve2d(const TopoDS_Edge& E { if ( ! myApproxCurve2dFlag && !myApproxSurfaceFlag) return Standard_False; - Standard_Real First, Last,F1,L1; + Standard_Real First = NAN, Last = NAN,F1 = NAN,L1 = NAN; TopLoc_Location L,Loc1; Handle(Geom_Surface) aSurface = BRep_Tool::Surface(F,L); GeomAdaptor_Surface AdS(aSurface); diff --git a/src/ShapeCustom/ShapeCustom_ConvertToBSpline.cxx b/src/ShapeCustom/ShapeCustom_ConvertToBSpline.cxx index ce500b8e32..93370384e0 100644 --- a/src/ShapeCustom/ShapeCustom_ConvertToBSpline.cxx +++ b/src/ShapeCustom/ShapeCustom_ConvertToBSpline.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -96,9 +98,9 @@ Standard_Boolean ShapeCustom_ConvertToBSpline::NewSurface (const TopoDS_Face& F, Standard_Boolean& RevFace) { S = BRep_Tool::Surface(F,L); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; S->Bounds(U1,U2,V1,V2); - Standard_Real Umin, Umax,Vmin,Vmax; + Standard_Real Umin = NAN, Umax = NAN,Vmin = NAN,Vmax = NAN; BRepTools::UVBounds(F,Umin, Umax, Vmin, Vmax); if(Precision::IsInfinite(U1) || Precision::IsInfinite(U2)) { U1 = Umin; @@ -133,7 +135,7 @@ Standard_Boolean ShapeCustom_ConvertToBSpline::NewSurface (const TopoDS_Face& F, if(S->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)) ) { Handle(Geom_RectangularTrimmedSurface) RTS = Handle(Geom_RectangularTrimmedSurface)::DownCast ( S ); - Standard_Real UF, UL, VF, VL; + Standard_Real UF = NAN, UL = NAN, VF = NAN, VL = NAN; RTS->Bounds ( UF, UL, VF, VL ); S = new Geom_RectangularTrimmedSurface ( res, UF, UL, VF, VL ); } @@ -169,7 +171,7 @@ Standard_Boolean ShapeCustom_ConvertToBSpline::NewCurve (const TopoDS_Edge& E, Handle(Geom_Surface) S = GC->Surface(); Handle(Geom_Surface) ES; if ( ! IsToConvert ( S, ES ) ) continue; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; C = BRep_Tool::Curve ( E, L, f, l ); if ( ! C.IsNull() ) C = Handle(Geom_Curve)::DownCast ( C->Copy() ); Tol = BRep_Tool::Tolerance ( E ); @@ -209,7 +211,7 @@ Standard_Boolean ShapeCustom_ConvertToBSpline::NewCurve2d (const TopoDS_Edge& E, // just copy pcurve if either its surface is changing or edge was copied if ( ! IsToConvert ( S, ES ) && E.IsSame ( NewE ) ) return Standard_False; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; C = BRep_Tool::CurveOnSurface(E,F,f,l); if ( ! C.IsNull() ) C = Handle(Geom2d_Curve)::DownCast ( C->Copy() ); diff --git a/src/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx b/src/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx index be7eb83ede..240180091f 100644 --- a/src/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx +++ b/src/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -156,7 +158,7 @@ Standard_Boolean ShapeCustom_ConvertToRevolution::NewSurface (const TopoDS_Face& if ( S->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)) ) { Handle(Geom_RectangularTrimmedSurface) RTS = Handle(Geom_RectangularTrimmedSurface)::DownCast ( S ); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; RTS->Bounds ( U1, U2, V1, V2 ); S = new Geom_RectangularTrimmedSurface ( Rev, U1, U2, V1, V2 ); } @@ -195,7 +197,7 @@ Standard_Boolean ShapeCustom_ConvertToRevolution::NewCurve (const TopoDS_Edge& E Handle(Geom_Surface) S = GC->Surface(); Handle(Geom_ElementarySurface) ES; if ( ! IsToConvert ( S, ES ) ) continue; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; C = BRep_Tool::Curve ( E, L, f, l ); if ( ! C.IsNull() ) C = Handle(Geom_Curve)::DownCast ( C->Copy() ); Tol = BRep_Tool::Tolerance ( E ); @@ -235,7 +237,7 @@ Standard_Boolean ShapeCustom_ConvertToRevolution::NewCurve2d (const TopoDS_Edge& // just copy pcurve if either its surface is changing or edge was copied if ( ! IsToConvert ( S, ES ) && E.IsSame ( NewE ) ) return Standard_False; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; C = BRep_Tool::CurveOnSurface(E,F,f,l); if ( ! C.IsNull() ) { C = Handle(Geom2d_Curve)::DownCast ( C->Copy() ); diff --git a/src/ShapeCustom/ShapeCustom_Curve2d.cxx b/src/ShapeCustom/ShapeCustom_Curve2d.cxx index 319d2bd015..83c5af322c 100644 --- a/src/ShapeCustom/ShapeCustom_Curve2d.cxx +++ b/src/ShapeCustom/ShapeCustom_Curve2d.cxx @@ -61,7 +61,7 @@ Standard_Boolean ShapeCustom_Curve2d::IsLinear(const TColgp_Array1OfPnt2d& thePo Standard_Real dMax = 0; Standard_Integer iMax1=0,iMax2=0; - Standard_Integer i; + Standard_Integer i = 0; for(i = 1; i < nbPoles; i++) for(Standard_Integer j = i+1; j <= nbPoles; j++) { Standard_Real dist = thePoles(i).SquareDistance(thePoles(j)); @@ -149,7 +149,7 @@ Handle(Geom2d_Line) ShapeCustom_Curve2d::ConvertToLine2d (const Handle(Geom2d_Cu Standard_Boolean ShapeCustom_Curve2d::SimplifyBSpline2d (Handle(Geom2d_BSplineCurve)& theBSpline2d, const Standard_Real theTolerance) { - Standard_Integer aInitNbK; + Standard_Integer aInitNbK = 0; Standard_Integer NbK = aInitNbK = theBSpline2d->NbKnots(); // search knot to remove Standard_Boolean IsToRemove = Standard_True; diff --git a/src/ShapeCustom/ShapeCustom_DirectModification.cxx b/src/ShapeCustom/ShapeCustom_DirectModification.cxx index 19ec660ce2..b286b41eb3 100644 --- a/src/ShapeCustom/ShapeCustom_DirectModification.cxx +++ b/src/ShapeCustom/ShapeCustom_DirectModification.cxx @@ -18,6 +18,8 @@ // locations into account //szv 03.01.01 PositiveCones merged in +#include + #include #include #include @@ -147,7 +149,7 @@ Standard_Boolean ShapeCustom_DirectModification::NewCurve (const TopoDS_Edge& E, Handle(Geom_Surface) S = GC->Surface(); TopLoc_Location Loc = GC->Location(); if ( ! IsIndirectSurface ( S, Loc ) ) continue; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; C = BRep_Tool::Curve ( E, L, f, l ); if ( ! C.IsNull() ) C = Handle(Geom_Curve)::DownCast ( C->Copy() ); Tol = BRep_Tool::Tolerance(E); @@ -187,7 +189,7 @@ Standard_Boolean ShapeCustom_DirectModification::NewCurve2d (const TopoDS_Edge& Standard_Integer result = IsIndirectSurface ( S, L ); if ( !result && E.IsSame(NewE) ) return Standard_False; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; C = BRep_Tool::CurveOnSurface( E, F, f, l ); Tol = BRep_Tool::Tolerance(E); diff --git a/src/ShapeCustom/ShapeCustom_RestrictionParameters.cxx b/src/ShapeCustom/ShapeCustom_RestrictionParameters.cxx index 4e3bca9707..23f88426ac 100644 --- a/src/ShapeCustom/ShapeCustom_RestrictionParameters.cxx +++ b/src/ShapeCustom/ShapeCustom_RestrictionParameters.cxx @@ -23,27 +23,27 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeCustom_RestrictionParameters,Standard_Transient) //function : ShapeCustom_RestrictionParameters //purpose : //======================================================================= -ShapeCustom_RestrictionParameters::ShapeCustom_RestrictionParameters() +ShapeCustom_RestrictionParameters::ShapeCustom_RestrictionParameters() : myGMaxSeg(10000), myGMaxDegree(15), myConvPlane(Standard_False), myConvConicalSurf(Standard_False), myConvSphericalSurf(Standard_False), myConvCylindricalSurf(Standard_False), myConvToroidalSurf(Standard_False), myConvBezierSurf(Standard_False), myConvRevolSurf(Standard_True), myConvExtrSurf(Standard_True), myConvOffsetSurf(Standard_True), mySegmentSurfaceMode(Standard_True), myConvCurve3d(Standard_True), myConvOffsetCurv3d(Standard_True), myConvCurve2d(Standard_True), myConvOffsetCurv2d(Standard_True) { - myGMaxSeg = 10000; - myGMaxDegree = 15; - myConvPlane = Standard_False; + + + //myConvElementarySurf = Standard_False; //conversion of elementary surfaces are off by default - myConvConicalSurf = Standard_False; - myConvSphericalSurf = Standard_False; - myConvCylindricalSurf = Standard_False; - myConvToroidalSurf = Standard_False; - - myConvBezierSurf = Standard_False; - myConvRevolSurf = Standard_True; - myConvExtrSurf = Standard_True; - myConvOffsetSurf = Standard_True; - mySegmentSurfaceMode= Standard_True; - myConvCurve3d = Standard_True; - myConvOffsetCurv3d = Standard_True; - myConvCurve2d = Standard_True; - myConvOffsetCurv2d = Standard_True; + + + + + + + + + + + + + + } diff --git a/src/ShapeCustom/ShapeCustom_Surface.cxx b/src/ShapeCustom/ShapeCustom_Surface.cxx index b2704aa783..0667b2e28a 100644 --- a/src/ShapeCustom/ShapeCustom_Surface.cxx +++ b/src/ShapeCustom/ShapeCustom_Surface.cxx @@ -14,6 +14,8 @@ //abv 06.01.99 fix of misprint //:p6 abv 26.02.99: make ConvertToPeriodic() return Null if nothing done +#include + #include #include @@ -78,8 +80,8 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToAnalytical (const Standard_Re { Handle(Geom_Surface) newSurf; - Standard_Integer nUP, nVP, nCP, i, j , UDeg, VDeg; - Standard_Real U1, U2, V1, V2, C1, C2, DU, DV, U=0, V=0; + Standard_Integer nUP = 0, nVP = 0, nCP = 0, i = 0, j = 0 , UDeg = 0, VDeg = 0; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN, C1 = NAN, C2 = NAN, DU = NAN, DV = NAN, U=0, V=0; Handle(Geom_Curve) iso; Standard_Boolean uClosed = Standard_True; @@ -283,7 +285,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToAnalytical (const Standard_Re 0.5*(p3(1).Z()+p3(2).Z())); gp_Vec aVec(p10, p3(1)); gp_Vec aVec2(p10, p3(3)); - Standard_Real RR1 = R(1), RR2 = R(2), RR3; + Standard_Real RR1 = R(1), RR2 = R(2), RR3 = NAN; aVec ^= aVec2; if (aVec.Magnitude() <= gp::Resolution()) aVec.SetCoord(0., 0., 1.); @@ -322,7 +324,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToAnalytical (const Standard_Re gp_Pnt P3d, P3d2; Standard_Boolean onSurface = Standard_True; - Standard_Real dis; myGap = 0.; + Standard_Real dis = NAN; myGap = 0.; DU = (U2-U1)/(NP-1); DV = (V2-V1)/(NP-1); diff --git a/src/ShapeCustom/ShapeCustom_SweptToElementary.cxx b/src/ShapeCustom/ShapeCustom_SweptToElementary.cxx index 6205e4bd9b..2840b4c3d6 100644 --- a/src/ShapeCustom/ShapeCustom_SweptToElementary.cxx +++ b/src/ShapeCustom/ShapeCustom_SweptToElementary.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -192,7 +194,7 @@ Standard_Boolean ShapeCustom_SweptToElementary::NewCurve(const TopoDS_Edge& E, Handle(Geom_Surface) S = GC->Surface(); Handle(Geom_SweptSurface) SS; if(!IsToConvert(S,SS)) continue; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; C = BRep_Tool::Curve ( E, L, f, l ); if ( ! C.IsNull() ) C = Handle(Geom_Curve)::DownCast ( C->Copy() ); Tol = BRep_Tool::Tolerance ( E ); @@ -234,7 +236,7 @@ Standard_Boolean ShapeCustom_SweptToElementary::NewCurve2d(const TopoDS_Edge& E, // just copy pcurve if either its surface is changing or edge was copied if ( !IsToConvert(S,SS) && E.IsSame(NewE) ) return Standard_False; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; C = BRep_Tool::CurveOnSurface(E,F,f,l); if ( ! C.IsNull() ) { C = Handle(Geom2d_Curve)::DownCast ( C->Copy() ); @@ -242,7 +244,7 @@ Standard_Boolean ShapeCustom_SweptToElementary::NewCurve2d(const TopoDS_Edge& E, if ( !NS.IsNull() && NS->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)) ) { if(SS->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) { Handle(Geom_SurfaceOfRevolution) SR = Handle(Geom_SurfaceOfRevolution)::DownCast(SS); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; SR->Bounds(U1,U2,V1,V2); gp_Pnt P0; SR->D0(U1,V1,P0); @@ -257,10 +259,10 @@ Standard_Boolean ShapeCustom_SweptToElementary::NewCurve2d(const TopoDS_Edge& E, Handle(Geom_SurfaceOfRevolution) SR = Handle(Geom_SurfaceOfRevolution)::DownCast(SS); gp_Pnt PR,PS; Handle(Geom_SphericalSurface) SPH = Handle(Geom_SphericalSurface)::DownCast(NS); - Standard_Real US1,US2,VS1,VS2; + Standard_Real US1 = NAN,US2 = NAN,VS1 = NAN,VS2 = NAN; SPH->Bounds(US1,US2,VS1,VS2); SPH->D0(US1,VS1,PS); - Standard_Real UR1,UR2,VR1,VR2; + Standard_Real UR1 = NAN,UR2 = NAN,VR1 = NAN,VR2 = NAN; SR->Bounds(UR1,UR2,VR1,VR2); SR->D0(UR1,VR1,PR); gp_Pnt P0 = SPH->Location(); diff --git a/src/ShapeExtend/ShapeExtend_ComplexCurve.cxx b/src/ShapeExtend/ShapeExtend_ComplexCurve.cxx index 883334815c..980beb8433 100644 --- a/src/ShapeExtend/ShapeExtend_ComplexCurve.cxx +++ b/src/ShapeExtend/ShapeExtend_ComplexCurve.cxx @@ -16,6 +16,8 @@ // pdn 13.07.99 Derivatives are scaled in accordance with local/global parameter transition +#include + #include #include #include @@ -28,9 +30,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeExtend_ComplexCurve,Geom_Curve) //function : ShapeExtend_ComplexCurve //purpose : //======================================================================= -ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve() +ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve() : myClosed(Standard_False) { - myClosed = Standard_False; + } //======================================================================= @@ -51,7 +53,7 @@ ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve() void ShapeExtend_ComplexCurve::D0(const Standard_Real U,gp_Pnt& P) const { - Standard_Real UOut; + Standard_Real UOut = NAN; Standard_Integer ind = LocateParameter (U, UOut); Curve(ind)->D0(UOut, P); } @@ -63,7 +65,7 @@ ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve() void ShapeExtend_ComplexCurve::D1(const Standard_Real U,gp_Pnt& P,gp_Vec& V1) const { - Standard_Real UOut; + Standard_Real UOut = NAN; Standard_Integer ind = LocateParameter (U, UOut); Curve(ind)->D1(UOut, P, V1); TransformDN(V1,ind,1); @@ -76,7 +78,7 @@ ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve() void ShapeExtend_ComplexCurve::D2(const Standard_Real U,gp_Pnt& P,gp_Vec& V1,gp_Vec& V2) const { - Standard_Real UOut; + Standard_Real UOut = NAN; Standard_Integer ind = LocateParameter (U, UOut); Curve(ind)->D2(UOut, P, V1, V2); TransformDN(V1,ind,1); @@ -90,7 +92,7 @@ ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve() void ShapeExtend_ComplexCurve::D3(const Standard_Real U,gp_Pnt& P,gp_Vec& V1,gp_Vec& V2,gp_Vec& V3) const { - Standard_Real UOut; + Standard_Real UOut = NAN; Standard_Integer ind = LocateParameter (U, UOut); Curve(ind)->D3(UOut, P, V1, V2, V3); TransformDN(V1,ind,1); @@ -105,7 +107,7 @@ ShapeExtend_ComplexCurve::ShapeExtend_ComplexCurve() gp_Vec ShapeExtend_ComplexCurve::DN(const Standard_Real U,const Standard_Integer N) const { - Standard_Real UOut; + Standard_Real UOut = NAN; Standard_Integer ind = LocateParameter (U, UOut); gp_Vec res = Curve(ind)->DN(UOut, N); if(N) diff --git a/src/ShapeExtend/ShapeExtend_CompositeSurface.cxx b/src/ShapeExtend/ShapeExtend_CompositeSurface.cxx index b4994f3c0c..c442de7230 100644 --- a/src/ShapeExtend/ShapeExtend_CompositeSurface.cxx +++ b/src/ShapeExtend/ShapeExtend_CompositeSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -319,7 +321,7 @@ Standard_Real ShapeExtend_CompositeSurface::ULocalToGlobal (const Standard_Integ const Standard_Integer j, const Standard_Real u) const { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; myPatches->Value(i,j)->Bounds ( u1, u2, v1, v2 ); Standard_Real scale = ( myUJointValues->Value(i+1) - myUJointValues->Value(i) ) / ( u2 - u1 ); return u * scale + ( myUJointValues->Value(i) - u1 * scale ); // ! this formula is stable if u1 is infinite @@ -334,7 +336,7 @@ Standard_Real ShapeExtend_CompositeSurface::VLocalToGlobal (const Standard_Integ const Standard_Integer j, const Standard_Real v) const { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; myPatches->Value(i,j)->Bounds ( u1, u2, v1, v2 ); Standard_Real scale = ( myVJointValues->Value(j+1) - myVJointValues->Value(j) ) / ( v2 - v1 ); return v * scale + ( myVJointValues->Value(j) - v1 * scale ); // ! this formula is stable if v1 is infinite @@ -349,7 +351,7 @@ gp_Pnt2d ShapeExtend_CompositeSurface::LocalToGlobal (const Standard_Integer i, const Standard_Integer j, const gp_Pnt2d &uv) const { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; myPatches->Value(i,j)->Bounds ( u1, u2, v1, v2 ); Standard_Real scaleu = ( myUJointValues->Value(i+1) - myUJointValues->Value(i) ) / ( u2 - u1 ); Standard_Real scalev = ( myVJointValues->Value(j+1) - myVJointValues->Value(j) ) / ( v2 - v1 ); @@ -366,7 +368,7 @@ Standard_Real ShapeExtend_CompositeSurface::UGlobalToLocal (const Standard_Integ const Standard_Integer j, const Standard_Real U) const { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; myPatches->Value(i,j)->Bounds ( u1, u2, v1, v2 ); Standard_Real scale = ( u2 - u1 ) / ( myUJointValues->Value(i+1) - myUJointValues->Value(i) ); return U * scale + ( u1 - myUJointValues->Value(i) * scale ); // ! this formula is stable if u1 is infinite @@ -381,7 +383,7 @@ Standard_Real ShapeExtend_CompositeSurface::VGlobalToLocal (const Standard_Integ const Standard_Integer j, const Standard_Real V) const { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; myPatches->Value(i,j)->Bounds ( u1, u2, v1, v2 ); Standard_Real scale = ( v2 - v1 ) / ( myVJointValues->Value(j+1) - myVJointValues->Value(j) ); return V * scale + ( v1 - myVJointValues->Value(j) * scale ); // ! this formula is stable if v1 is infinite @@ -396,7 +398,7 @@ gp_Pnt2d ShapeExtend_CompositeSurface::GlobalToLocal (const Standard_Integer i, const Standard_Integer j, const gp_Pnt2d &UV) const { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; myPatches->Value(i,j)->Bounds ( u1, u2, v1, v2 ); Standard_Real scaleu = ( u2 - u1 ) / ( myUJointValues->Value(i+1) - myUJointValues->Value(i) ); Standard_Real scalev = ( v2 - v1 ) / ( myVJointValues->Value(j+1) - myVJointValues->Value(j) ); @@ -414,7 +416,7 @@ Standard_Boolean ShapeExtend_CompositeSurface::GlobalToLocalTransformation (cons Standard_Real &uFact, gp_Trsf2d &Trsf) const { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; myPatches->Value(i,j)->Bounds ( u1, u2, v1, v2 ); Standard_Real scaleu = ( u2 - u1 ) / ( myUJointValues->Value(i+1) - myUJointValues->Value(i) ); @@ -732,8 +734,8 @@ void ShapeExtend_CompositeSurface::ComputeJointValues (const ShapeExtend_Paramet myVJointValues = new TColStd_HArray1OfReal(1,NbV+1); if ( param == ShapeExtend_Natural ) { - Standard_Real U1, U2, V1, V2, U=0, V=0; - Standard_Integer i; // svv Jan 10 2000 : porting on DEC + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN, U=0, V=0; + Standard_Integer i = 0; // svv Jan 10 2000 : porting on DEC for ( i = 1; i <= NbU; i++ ) { myPatches->Value(i,1)->Bounds(U1,U2,V1,V2); if ( i ==1 ) myUJointValues->SetValue ( 1, U = U1 ); @@ -753,7 +755,7 @@ void ShapeExtend_CompositeSurface::ComputeJointValues (const ShapeExtend_Paramet stepu /= NbU; stepv /= NbV; } - Standard_Integer i; // svv Jan 10 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan 10 2000 : porting on DEC for ( i=0; i <= NbU; i++ ) myUJointValues->SetValue ( i+1, i * stepu ); for ( i=0; i <= NbV; i++ ) @@ -790,15 +792,15 @@ Standard_Boolean ShapeExtend_CompositeSurface::CheckConnectivity (const Standard Standard_Integer NbV = NbVPatches(); // check in u direction - Standard_Integer i,j; // svv Jan 10 2000 : porting on DEC + Standard_Integer i = 0,j = 0; // svv Jan 10 2000 : porting on DEC for ( i=1, j = NbU; i <= NbU; j = i++ ) { Standard_Real maxdist2 = 0.; for ( Standard_Integer k=1; k <= NbV; k++ ) { Handle(Geom_Surface) sj = myPatches->Value(j,k); Handle(Geom_Surface) si = myPatches->Value(i,k); - Standard_Real Uj1, Uj2, Vj1, Vj2; + Standard_Real Uj1 = NAN, Uj2 = NAN, Vj1 = NAN, Vj2 = NAN; GetLimitedBounds ( sj, Uj1, Uj2, Vj1, Vj2 ); - Standard_Real Ui1, Ui2, Vi1, Vi2; + Standard_Real Ui1 = NAN, Ui2 = NAN, Vi1 = NAN, Vi2 = NAN; GetLimitedBounds ( si, Ui1, Ui2, Vi1, Vi2 ); Standard_Real stepj = ( Vj2 - Vj1 ) / ( NPOINTS - 1 ); Standard_Real stepi = ( Vi2 - Vi1 ) / ( NPOINTS - 1 ); @@ -819,9 +821,9 @@ Standard_Boolean ShapeExtend_CompositeSurface::CheckConnectivity (const Standard for ( Standard_Integer k=1; k <= NbU; k++ ) { Handle(Geom_Surface) sj = myPatches->Value(k,j); Handle(Geom_Surface) si = myPatches->Value(k,i); - Standard_Real Uj1, Uj2, Vj1, Vj2; + Standard_Real Uj1 = NAN, Uj2 = NAN, Vj1 = NAN, Vj2 = NAN; GetLimitedBounds ( sj, Uj1, Uj2, Vj1, Vj2 ); - Standard_Real Ui1, Ui2, Vi1, Vi2; + Standard_Real Ui1 = NAN, Ui2 = NAN, Vi1 = NAN, Vi2 = NAN; GetLimitedBounds ( si, Ui1, Ui2, Vi1, Vi2 ); Standard_Real stepj = ( Uj2 - Uj1 ) / ( NPOINTS - 1 ); Standard_Real stepi = ( Ui2 - Ui1 ) / ( NPOINTS - 1 ); diff --git a/src/ShapeExtend/ShapeExtend_CompositeSurface.hxx b/src/ShapeExtend/ShapeExtend_CompositeSurface.hxx index 032ba50397..ddd6bfb87a 100644 --- a/src/ShapeExtend/ShapeExtend_CompositeSurface.hxx +++ b/src/ShapeExtend/ShapeExtend_CompositeSurface.hxx @@ -302,8 +302,8 @@ private: Handle(TColGeom_HArray2OfSurface) myPatches; Handle(TColStd_HArray1OfReal) myUJointValues; Handle(TColStd_HArray1OfReal) myVJointValues; - Standard_Boolean myUClosed; - Standard_Boolean myVClosed; + Standard_Boolean myUClosed{}; + Standard_Boolean myVClosed{}; }; diff --git a/src/ShapeExtend/ShapeExtend_Explorer.cxx b/src/ShapeExtend/ShapeExtend_Explorer.cxx index 97a99eed4b..0b69a60915 100644 --- a/src/ShapeExtend/ShapeExtend_Explorer.cxx +++ b/src/ShapeExtend/ShapeExtend_Explorer.cxx @@ -42,7 +42,7 @@ TopoDS_Shape ShapeExtend_Explorer::CompoundFromSeq BRep_Builder B; TopoDS_Compound C; B.MakeCompound(C); - Standard_Integer i,n = seqval->Length(); + Standard_Integer i = 0,n = seqval->Length(); for (i = 1; i <= n ; i ++) B.Add(C,seqval->Value(i)); return C; } @@ -56,7 +56,7 @@ static void FillList (const Handle(TopTools_HSequenceOfShape)& list, const TopoDS_Shape& comp, const Standard_Boolean expcomp) { for (TopoDS_Iterator it (comp); it.More(); it.Next()) { - TopoDS_Shape sub = it.Value(); + const TopoDS_Shape& sub = it.Value(); if (sub.ShapeType() != TopAbs_COMPOUND) list->Append (sub); else if (!expcomp) list->Append (sub); else FillList (list,sub,expcomp); @@ -87,7 +87,7 @@ void ShapeExtend_Explorer::ListFromSeq (const Handle(TopTools_HSequenceOfShape)& { if (clear) lisval.Clear(); if (seqval.IsNull()) return; - Standard_Integer i, nb = seqval->Length(); + Standard_Integer i = 0, nb = seqval->Length(); for (i = 1; i <= nb; i ++) lisval.Append (seqval->Value(i)); } @@ -118,7 +118,7 @@ TopAbs_ShapeEnum ShapeExtend_Explorer::ShapeType (const TopoDS_Shape& shape, if (!compound || res != TopAbs_COMPOUND) return res; res = TopAbs_SHAPE; for (TopoDS_Iterator iter(shape); iter.More(); iter.Next()) { - TopoDS_Shape sh = iter.Value(); + const TopoDS_Shape& sh = iter.Value(); if (sh.IsNull()) continue; TopAbs_ShapeEnum typ = sh.ShapeType(); if (typ == TopAbs_COMPOUND) typ = ShapeType (sh,compound); @@ -248,7 +248,7 @@ void ShapeExtend_Explorer::DispatchList (const Handle(TopTools_HSequenceOfShape) if (compsols.IsNull()) compsols = new TopTools_HSequenceOfShape(); if (compounds.IsNull()) compounds = new TopTools_HSequenceOfShape(); - Standard_Integer i,nb = list->Length(); + Standard_Integer i = 0,nb = list->Length(); for (i = 1; i <= nb; i ++) { TopoDS_Shape sh = list->Value(i); if (sh.IsNull()) continue; diff --git a/src/ShapeExtend/ShapeExtend_WireData.cxx b/src/ShapeExtend/ShapeExtend_WireData.cxx index 4ef48536af..d145adca96 100644 --- a/src/ShapeExtend/ShapeExtend_WireData.cxx +++ b/src/ShapeExtend/ShapeExtend_WireData.cxx @@ -15,6 +15,8 @@ // abv 28.04.99 S4137: added method Add(WireData), method SetLast fixed // abv 05.05.99 S4174: protection against INTERNAL/EXTERNAL edges +#include + #include #include #include @@ -63,7 +65,7 @@ ShapeExtend_WireData::ShapeExtend_WireData (const TopoDS_Wire& wire, void ShapeExtend_WireData::Init (const Handle(ShapeExtend_WireData)& other) { Clear(); - Standard_Integer i, nb = other->NbEdges(); + Standard_Integer i = 0, nb = other->NbEdges(); for (i = 1; i <= nb; i++) Add ( other->Edge(i) ); nb = other->NbNonManifoldEdges(); for (i = 1; i <= nb; i++) Add ( other->NonmanifoldEdge(i) ); @@ -155,7 +157,7 @@ void ShapeExtend_WireData::ComputeSeams (const Standard_Boolean enforce) mySeams = new TColStd_HSequenceOfInteger(); mySeamF = mySeamR = 0; TopoDS_Shape S; - Standard_Integer i, nb = NbEdges(); + Standard_Integer i = 0, nb = NbEdges(); TopTools_IndexedMapOfShape ME; Standard_Integer* SE = new Standard_Integer [nb+1]; @@ -191,7 +193,7 @@ void ShapeExtend_WireData::ComputeSeams (const Standard_Boolean enforce) void ShapeExtend_WireData::SetLast (const Standard_Integer num) { if (num == 0) return; - Standard_Integer i, nb = NbEdges(); + Standard_Integer i = 0, nb = NbEdges(); for (i = nb; i > num; i--) { TopoDS_Edge edge = TopoDS::Edge ( myEdges->Value(nb) ); myEdges->Remove (nb); @@ -207,7 +209,7 @@ void ShapeExtend_WireData::SetLast (const Standard_Integer num) void ShapeExtend_WireData::SetDegeneratedLast() { - Standard_Integer i, nb = NbEdges(); + Standard_Integer i = 0, nb = NbEdges(); for (i = 1; i <= nb; i ++) { if ( BRep_Tool::Degenerated ( Edge(i) ) ) { SetLast ( i ); @@ -412,7 +414,7 @@ void ShapeExtend_WireData::Set (const TopoDS_Edge& edge, void ShapeExtend_WireData::Reverse () { - Standard_Integer i, nb = NbEdges(); + Standard_Integer i = 0, nb = NbEdges(); // inverser les edges + les permuter pour inverser le wire for (i = 1; i <= nb/2; i ++) { @@ -447,7 +449,7 @@ static void SwapSeam (const TopoDS_Shape& S, const TopoDS_Face& F) //:S4136 Standard_Real Tol = BRep_Tool::Tolerance(theface); Handle(Geom2d_Curve) c2df,c2dr; - Standard_Real uff,ulf,ufr,ulr; + Standard_Real uff = NAN,ulf = NAN,ufr = NAN,ulr = NAN; // d abord FWD puis REV c2df = BRep_Tool::CurveOnSurface (E,theface,uff,ulf); @@ -552,7 +554,7 @@ Standard_Boolean ShapeExtend_WireData::IsSeam (const Standard_Integer num) if (num == mySeamF || num == mySeamR) return Standard_True; // Pas suffisant : on regarde dans la liste - Standard_Integer i, nb = mySeams->Length(); + Standard_Integer i = 0, nb = mySeams->Length(); for (i = 1; i <= nb; i ++) { if (num == mySeams->Value(i)) return Standard_True; } @@ -569,7 +571,7 @@ TopoDS_Wire ShapeExtend_WireData::Wire() const TopoDS_Wire W; BRep_Builder B; B.MakeWire (W); - Standard_Integer i, nb = NbEdges(); + Standard_Integer i = 0, nb = NbEdges(); Standard_Boolean ismanifold = Standard_True; for (i = 1; i <= nb; i ++) { TopoDS_Edge aE = Edge(i); @@ -599,7 +601,7 @@ TopoDS_Wire ShapeExtend_WireData::WireAPIMake() const { TopoDS_Wire W; BRepBuilderAPI_MakeWire MW; - Standard_Integer i, nb = NbEdges(); + Standard_Integer i = 0, nb = NbEdges(); for (i = 1; i <= nb; i ++) MW.Add (Edge(i)); if(myManifoldMode) { nb = NbNonManifoldEdges(); diff --git a/src/ShapeExtend/ShapeExtend_WireData.hxx b/src/ShapeExtend/ShapeExtend_WireData.hxx index d4d747552f..324625e36d 100644 --- a/src/ShapeExtend/ShapeExtend_WireData.hxx +++ b/src/ShapeExtend/ShapeExtend_WireData.hxx @@ -232,9 +232,9 @@ private: Handle(TopTools_HSequenceOfShape) myEdges; Handle(TopTools_HSequenceOfShape) myNonmanifoldEdges; Handle(TColStd_HSequenceOfInteger) mySeams; - Standard_Integer mySeamF; - Standard_Integer mySeamR; - Standard_Boolean myManifoldMode; + Standard_Integer mySeamF{}; + Standard_Integer mySeamR{}; + Standard_Boolean myManifoldMode{}; }; diff --git a/src/ShapeFix/ShapeFix.cxx b/src/ShapeFix/ShapeFix.cxx index 6f710fac39..e27da3309a 100644 --- a/src/ShapeFix/ShapeFix.cxx +++ b/src/ShapeFix/ShapeFix.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include //:k2 abv 16.12.98: eliminating code duplication //pdn 18.12.98: checking deviation for SP edges @@ -188,7 +190,7 @@ Standard_Boolean ShapeFix::SameParameter(const TopoDS_Shape& shape, Handle(GeomAdaptor_Surface) AS = new GeomAdaptor_Surface ( plane ); for ( TopExp_Explorer ed ( face, TopAbs_EDGE ); ed.More(); ed.Next() ) { TopoDS_Edge edge = TopoDS::Edge ( ed.Current() ); - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) crv = BRep_Tool::Curve ( edge, f, l ); if ( crv.IsNull() ) continue; @@ -356,7 +358,7 @@ static Standard_Real getNearPoint(const TColgp_SequenceOfPnt& aSeq1, //purpose : auxiliary for FixVertexPosition //======================================================================= static Standard_Boolean getNearestEdges(TopTools_ListOfShape& theLEdges, - const TopoDS_Vertex theVert, + const TopoDS_Vertex& theVert, TopTools_SequenceOfShape& theSuitEdges, TopTools_SequenceOfShape& theRejectEdges, const Standard_Real theTolerance, @@ -375,7 +377,7 @@ static Standard_Boolean getNearestEdges(TopTools_ListOfShape& theLEdges, TopoDS_Vertex aVert11,aVert12; TopExp::Vertices(aEdge1, aVert11,aVert12 ); aMapEdges.Add(aEdge1); - Standard_Real aFirst1,aLast1; + Standard_Real aFirst1 = NAN,aLast1 = NAN; Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(aEdge1,aFirst1,aLast1); gp_Pnt p11; gp_Pnt p12; @@ -416,7 +418,7 @@ static Standard_Boolean getNearestEdges(TopTools_ListOfShape& theLEdges, continue; } aMapEdges.Add(aEdge); - Standard_Real aFirst,aLast; + Standard_Real aFirst = NAN,aLast = NAN; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge,aFirst,aLast); if( !aCurve.IsNull()) { gp_Pnt p1; @@ -505,7 +507,7 @@ Standard_Boolean ShapeFix::FixVertexPosition(TopoDS_Shape& theshape, Standard_Integer nV =1; TopoDS_Iterator aExp3(aExp1.Current()); for( ; aExp3.More(); aExp3.Next(),nV++) { - TopoDS_Shape aVert = aExp3.Value(); + const TopoDS_Shape& aVert = aExp3.Value(); if(nV ==1) aVert1 = aVert; else if(aVert1.IsSame(aVert)) @@ -557,7 +559,7 @@ Standard_Boolean ShapeFix::FixVertexPosition(TopoDS_Shape& theshape, Standard_Boolean isLast = (aVert2.IsSame(aVert)); if(!isFirst && !isLast) continue; - Standard_Real aFirst,aLast; + Standard_Real aFirst = NAN,aLast = NAN; Handle(Geom_Curve) aCurve; TopoDS_Edge aEdge = TopoDS::Edge(thecontext->Apply(aEdgeOld)); @@ -645,7 +647,7 @@ Standard_Boolean ShapeFix::FixVertexPosition(TopoDS_Shape& theshape, TopoDS_Vertex aVert1n,aVert2n; TopExp::Vertices(aEdge, aVert1n,aVert2n ); - Standard_Real aFirst,aLast; + Standard_Real aFirst = NAN,aLast = NAN; aCurve = BRep_Tool::Curve(aEdge,aFirst,aLast); if( !aCurve.IsNull()) { gp_Pnt p1 = aCurve->Value(aFirst); @@ -686,14 +688,14 @@ Standard_Real ShapeFix::LeastEdgeSize(TopoDS_Shape& theShape) Standard_Real aRes = RealLast(); for(TopExp_Explorer exp(theShape,TopAbs_EDGE); exp.More(); exp.Next()) { TopoDS_Edge edge = TopoDS::Edge ( exp.Current() ); - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge, first, last); if(!c3d.IsNull()) { Bnd_Box bb; bb.Add(c3d->Value(first)); bb.Add(c3d->Value(last)); bb.Add(c3d->Value((last+first)/2.)); - Standard_Real x1,x2,y1,y2,z1,z2,size; + Standard_Real x1 = NAN,x2 = NAN,y1 = NAN,y2 = NAN,z1 = NAN,z2 = NAN,size = NAN; bb.Get(x1,y1,z1,x2,y2,z2); size = (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1); if(size + #include #include #include @@ -83,14 +85,14 @@ ShapeFix_ComposeShell::ShapeFix_ComposeShell () : myStatus(0), myUResolution(RealLast()), myVResolution(RealLast()), - myInvertEdgeStatus(Standard_True), + myTransferParamTool(new ShapeAnalysis_TransferParametersProj), myInvertEdgeStatus(Standard_True), myClosedMode(Standard_False), myUClosed(Standard_False), myVClosed(Standard_False), myUPeriod(0.), myVPeriod(0.) { - myTransferParamTool = new ShapeAnalysis_TransferParametersProj; + } @@ -118,7 +120,7 @@ void ShapeFix_ComposeShell::Init (const Handle(ShapeExtend_CompositeSurface) &Gr myUClosed = myUClosed && theSurface->IsUClosed(); myVClosed = myVClosed && theSurface->IsVClosed(); } else { - Standard_Real U0,U1,V0,V1,GU0 = 0.,GU1 = 0.,GV0 = 0.,GV1 = 0.; + Standard_Real U0 = NAN,U1 = NAN,V0 = NAN,V1 = NAN,GU0 = 0.,GU1 = 0.,GV0 = 0.,GV1 = 0.; theSurface->Bounds(U0,U1,V0,V1); if (::Precision::IsInfinite (U0) || ::Precision::IsInfinite (U1) || ::Precision::IsInfinite (V0) || ::Precision::IsInfinite (V1)) @@ -157,7 +159,7 @@ void ShapeFix_ComposeShell::Init (const Handle(ShapeExtend_CompositeSurface) &Gr Standard_Real uRange = myGrid->UJointValue(i+1)-myGrid->UJointValue(i); for ( Standard_Integer j=1; j <= myGrid->NbVPatches(); j++ ) { Standard_Real vRange = myGrid->VJointValue(j+1)-myGrid->VJointValue(j); - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; myGrid->Patch(i,j)->Bounds(u1,u2,v1,v2); GeomAdaptor_Surface GAS ( myGrid->Patch(i,j) ); Standard_Real ures = GAS.UResolution ( 1. )*uRange/(u2-u1); @@ -307,7 +309,7 @@ static Standard_Integer PointLinePosition (const gp_Pnt2d &p, const gp_Lin2d &li // Define position of point relative to line static Standard_Integer PointLinePosition (const gp_Pnt2d &p, const gp_Lin2d &line) { - Standard_Real dev; + Standard_Real dev = NAN; return PointLinePosition ( p, line, dev ); } @@ -390,7 +392,7 @@ static Standard_Integer ApplyContext (ShapeFix_WireSegment &wire, // add edges into the wire in correct order if ( segw->NbEdges() >0 ) { - Standard_Integer ind, iumin, iumax, ivmin, ivmax; + Standard_Integer ind = 0, iumin = 0, iumax = 0, ivmin = 0, ivmax = 0; wire.GetPatchIndex ( iedge, iumin, iumax, ivmin, ivmax ); Standard_Integer nbEdges = segw->NbEdges(); for ( Standard_Integer i=1; i <= nbEdges; i++, index++ ) { @@ -444,7 +446,7 @@ static Standard_Integer GetPatchIndex (const Standard_Real Param, Standard_Real p = Param + shift; // locate patch: the same algo as in SE_CS::LocateParameter() - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for ( i = 2; i < NP; i++ ) { // Standard_Real par = Params->Value(i); if ( p < Params->Value(i) ) break; @@ -547,7 +549,7 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con ShapeAnalysis_WireOrder sawo(Standard_False, 0); ShapeAnalysis_Edge sae; for(Standard_Integer i = 1; i <= nbMEdges; i++) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Handle(Geom2d_Curve) c2d; //smh#8 TopoDS_Shape tmpF = myFace.Oriented(TopAbs_FORWARD); @@ -626,13 +628,13 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode (const Handle(ShapeExtend_Wi Standard_Integer nb = wire->NbEdges(); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for ( i=begInd; ; i++ ) { if ( i > nb ) i = 1; TopoDS_Edge edge = wire->Edge ( i ); Handle(Geom2d_Curve) c2d; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; if ( ! sae.PCurve ( edge, myFace, c2d, f, l, Standard_False ) ) { myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL3 ); continue; @@ -644,7 +646,7 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode (const Handle(ShapeExtend_Wi Standard_Real par2 = ( i == endInd && special <=0 ? endPar : ( isreversed ? f : l ) ); Standard_Real dpar = ( par2 - par1 ) / ( NPOINTS - 1 ); Standard_Integer np = ( Abs ( dpar ) < ::Precision::PConfusion() ? 1 : NPOINTS ); - Standard_Integer j; // svv #1 + Standard_Integer j = 0; // svv #1 for ( j=0; j < np; j++ ) { Standard_Real par = par1 + dpar * j; gp_Pnt2d p2d = c2d->Value ( par ); @@ -721,7 +723,7 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode (const Handle(ShapeExtend_Wi // After applying context to (seam) edge, distribute its indices on new edges, // according to their parameters on that edge static void DistributeSplitPoints (const Handle(ShapeExtend_WireData) &sbwd, - const TopoDS_Face myFace, + const TopoDS_Face& myFace, const Standard_Integer index, const Standard_Integer nsplit, TColStd_SequenceOfInteger& indexes, @@ -730,9 +732,9 @@ static void DistributeSplitPoints (const Handle(ShapeExtend_WireData) &sbwd, Standard_Boolean isreversed = ( nsplit >0 && sbwd->Edge(index).Orientation() == TopAbs_REVERSED ); TColStd_Array1OfReal params(0,nsplit); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for ( i=0; i < nsplit; i++ ) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; BRep_Tool::Range ( sbwd->Edge(index+i), myFace, f, l ); params.SetValue ( i, ( isreversed ? l : f ) ); } @@ -785,7 +787,7 @@ static void DefinePatch (ShapeFix_WireSegment &wire, const Standard_Integer code //function : GetGridResolution //purpose : auxiliary //======================================================================= -static Standard_Real GetGridResolution(const Handle(TColStd_HArray1OfReal) SplitValues, +static Standard_Real GetGridResolution(const Handle(TColStd_HArray1OfReal)& SplitValues, const Standard_Integer cutIndex) { Standard_Integer nb = SplitValues->Length(); @@ -837,7 +839,7 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir } TopoDS_Edge edge = wire.Edge(i); - Standard_Integer iumin, iumax, ivmin, ivmax; + Standard_Integer iumin = 0, iumax = 0, ivmin = 0, ivmax = 0; wire.GetPatchIndex ( i, iumin, iumax, ivmin, ivmax ); // Position code for first segment of edge @@ -875,13 +877,13 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir } Handle(Geom_Curve) c3d; - Standard_Real f3d, l3d; + Standard_Real f3d = NAN, l3d = NAN; if ( ! sae.Curve3d ( edge, c3d, f3d, l3d ) ) { // not a crime c3d.Nullify(); f3d = l3d = 0; } - Standard_Real firstPar, lastPar; + Standard_Real firstPar = NAN, lastPar = NAN; Handle(Geom2d_Curve) C2d; if ( ! sae.PCurve ( edge, myFace, C2d, firstPar, lastPar ) ) { myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL2 ); @@ -1249,7 +1251,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, TopoDS_Edge E= sewd->Edge ( iedge ); Standard_Boolean isreversed = ( E.Orientation() == TopAbs_REVERSED ); - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom2d_Curve) c2d; if ( ! sae.PCurve ( E, myFace, c2d, f, l, Standard_False ) ) continue; Handle(Geom2d_Curve) c2d_sav = c2d; @@ -1269,7 +1271,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, Bnd_Box2d box; const Standard_Integer aNbPoints = 41; sac.FillBndBox ( c2d, f, l, aNbPoints, Standard_True, box ); - Standard_Real umin, vmin, umax, vmax; + Standard_Real umin = NAN, vmin = NAN, umax = NAN, vmax = NAN; box.Get ( umin, vmin, umax, vmax ); // compute shifts and adjust points adjust @@ -1313,7 +1315,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, // detect intersections at junction of two edges gp_Pnt2d pos = ( isreversed ? posl : posf ); - Standard_Real dev; + Standard_Real dev = NAN; Standard_Integer code = PointLinePosition ( pos, line, dev ); if ( iedge ==1 ) { firstCode = code; firstPos = pos; firstDev = dev; } else if ( code == IOR_UNDEF || code != prevCode ) { @@ -1341,7 +1343,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, // Fill arrays with new intersection points if ( Inter.IsDone() ) { - Standard_Integer i; + Standard_Integer i = 0; for ( i = 1; i <= Inter.NbPoints(); i++ ) { IntRes2d_IntersectionPoint IP = Inter.Point (i); if (IP.TransitionOfSecond().PositionOnCurve() == IntRes2d_Middle || (code != IOR_UNDEF && prevCode != IOR_UNDEF) ) @@ -1375,7 +1377,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, Standard_Integer start = IntEdgeInd.Length() + 1; // first of the new points // Move all points into range [f,l] (intersector sometimes gives params out of range) - Standard_Integer i; + Standard_Integer i = 0; for ( i = start; i <= IntEdgePar.Length(); i++ ) { if ( IntEdgePar(i) < f ) IntEdgePar.SetValue ( i, f ); else if ( IntEdgePar(i) > l ) IntEdgePar.SetValue ( i, l ); @@ -1418,7 +1420,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, TColStd_SequenceOfInteger SegmentCodes; // classification codes for segments of wire // remove duplicated points to ensure correct results of ComputeCode - Standard_Integer i, j = IntEdgePar.Length(); + Standard_Integer i = 0, j = IntEdgePar.Length(); if ( myClosedMode && j >1 ) { for ( i = 1; i <= IntEdgePar.Length(); ) { if ( i == j ) break; @@ -1433,7 +1435,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, else if ( nbe ==1 || IntEdgeInd(i) == (IntEdgeInd(j)%nbe)+1 ) { TopoDS_Edge E1 = sewd->Edge ( IntEdgeInd(j) ); TopoDS_Edge E2 = sewd->Edge ( IntEdgeInd(i) ); - Standard_Real a1, b1, a2, b2; + Standard_Real a1 = NAN, b1 = NAN, a2 = NAN, b2 = NAN; BRep_Tool::Range ( E1, myFace, a1, b1 ); BRep_Tool::Range ( E2, myFace, a2, b2 ); if ( Abs ( IntEdgePar(j) - ( E1.Orientation() == TopAbs_FORWARD ? b1 : a1 ) ) < ::Precision::PConfusion() && @@ -1567,7 +1569,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires, TopTools_SequenceOfShape SplitLineVertex; // split wires one by one, collecting data on intersection points - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for ( i=1; i <= wires.Length(); i++ ) { SplitByLine ( wires(i), line, isCutByU, cutIndex, SplitLinePar, SplitLineCode, SplitLineVertex ); @@ -1722,9 +1724,9 @@ void ShapeFix_ComposeShell::SplitByGrid (ShapeFix_SequenceOfWireSegment &seqw) { // process splitting by U- anv V-seams (i.e. U=const and V=const curves) // closed composite surface is processed as periodic - Standard_Real Uf,Ul,Vf,Vl; + Standard_Real Uf = NAN,Ul = NAN,Vf = NAN,Vl = NAN; BRepTools::UVBounds(myFace,Uf,Ul,Vf,Vl); - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; myGrid->Bounds(Umin,Umax,Vmin,Vmax); //value of precision to define number of patch should be the same as used in the definitin position of point relatively to seam edge (TOLINT) @@ -1744,7 +1746,7 @@ void ShapeFix_ComposeShell::SplitByGrid (ShapeFix_SequenceOfWireSegment &seqw) BRep_Builder aB; atmpF.Orientation(TopAbs_FORWARD); aB.Add(atmpF, wire.WireData()->Wire()); - Standard_Real Uf1,Ul1,Vf1,Vl1; + Standard_Real Uf1 = NAN,Ul1 = NAN,Vf1 = NAN,Vl1 = NAN; ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(atmpF),Uf1,Ul1,Vf1,Vl1); //for closed mode it is necessary to move wire segment in the interval defined by first and last grid UV values @@ -1845,7 +1847,7 @@ void ShapeFix_ComposeShell::BreakWires (ShapeFix_SequenceOfWireSegment &seqw) ShapeAnalysis_Edge sae; // first collect splitting vertices - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for ( i=1; i <= seqw.Length(); i++ ) { TopAbs_Orientation ori_wire = seqw(i).Orientation(); if ( ori_wire != TopAbs_EXTERNAL && @@ -1869,10 +1871,10 @@ void ShapeFix_ComposeShell::BreakWires (ShapeFix_SequenceOfWireSegment &seqw) ShapeFix_WireSegment wire = seqw(i); if(wire.IsVertex()) continue; - Handle(ShapeExtend_WireData) sbwd = wire.WireData(); + const Handle(ShapeExtend_WireData)& sbwd = wire.WireData(); // find first vertex for split - Standard_Integer j; // svv #1 + Standard_Integer j = 0; // svv #1 for ( j=1; j <= sbwd->NbEdges(); j++ ) { TopoDS_Vertex V = sae.FirstVertex ( sbwd->Edge(j) ); if ( splitVertices.Contains ( V ) ) break; @@ -1906,7 +1908,7 @@ void ShapeFix_ComposeShell::BreakWires (ShapeFix_SequenceOfWireSegment &seqw) newwire.Clear(); curOri = ori; } - Standard_Integer iumin, iumax, ivmin, ivmax; + Standard_Integer iumin = 0, iumax = 0, ivmin = 0, ivmax = 0; wire.GetPatchIndex ( j, iumin, iumax, ivmin, ivmax ); if(ori == TopAbs_INTERNAL && edge.Orientation() == TopAbs_EXTERNAL ) { curOri = TopAbs_EXTERNAL; @@ -1933,7 +1935,7 @@ void ShapeFix_ComposeShell::BreakWires (ShapeFix_SequenceOfWireSegment &seqw) // -1 - short in 3d but not in 2d (to be checked after algo and atteching to // another wire if alone) static Standard_Integer IsShortSegment (const ShapeFix_WireSegment &seg, - const TopoDS_Face myFace, + const TopoDS_Face& myFace, const Handle(Geom_Surface)& myGrid, const TopLoc_Location &myLoc, const Standard_Real UResolution, @@ -1948,12 +1950,12 @@ static Standard_Integer IsShortSegment (const ShapeFix_WireSegment &seg, Standard_Integer code = 1; ShapeAnalysis_Edge sae; - Handle(ShapeExtend_WireData) sbwd = seg.WireData(); + const Handle(ShapeExtend_WireData)& sbwd = seg.WireData(); for ( Standard_Integer i=1; i <= sbwd->NbEdges(); i++ ) { TopoDS_Edge edge = sbwd->Edge ( i ); if ( ! Vf.IsSame ( sae.LastVertex ( edge ) ) ) return 0; Handle(Geom2d_Curve) c2d; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; if ( ! sae.PCurve ( edge, myFace, c2d, f, l ) ) continue; // check 2d @@ -1983,7 +1985,7 @@ static Standard_Boolean IsSamePatch (const ShapeFix_WireSegment& wire, const Standard_Boolean extend=Standard_False) { // get patch indices for current segment - Standard_Integer jumin, jumax, jvmin, jvmax; + Standard_Integer jumin = 0, jumax = 0, jvmin = 0, jvmax = 0; wire.GetPatchIndex ( 1, jumin, jumax, jvmin, jvmax ); // shift to the same period @@ -2015,7 +2017,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, ShapeFix_SequenceOfWireSegment &seqw) { ShapeAnalysis_Edge sae; - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 // Collect information on short closed segments TColStd_Array1OfInteger shorts(1,seqw.Length()); for ( i=1; i <= seqw.Length(); i++ ) { @@ -2065,7 +2067,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, // find next segment to connect (or first if sbwd is NULL) for ( i = 1; i <= seqw.Length(); i++ ) { - ShapeFix_WireSegment seg = seqw.Value(i); + const ShapeFix_WireSegment& seg = seqw.Value(i); if(seg.IsVertex()) continue; TopAbs_Orientation anOr = seg.Orientation(); @@ -2101,7 +2103,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, // distance 2 // short auto // angle ->> PI 1 - Handle(ShapeExtend_WireData) wire = seg.WireData(); + const Handle(ShapeExtend_WireData)& wire = seg.WireData(); for ( Standard_Integer j=0; j <2; j++ ) { if ( ! endV.IsSame ( j ? seg.LastVertex() : seg.FirstVertex() ) ) continue; @@ -2126,7 +2128,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, // compute starting tangent gp_Pnt2d lPnt; gp_Vec2d lVec; - Standard_Integer k; + Standard_Integer k = 0; Standard_Real edgeTol = 0; for ( k=1; k <= wire->NbEdges(); k++ ) { TopoDS_Shape tmpE = wire->Edge(wire->NbEdges()-k+1).Reversed(); @@ -2229,7 +2231,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, endV = sae.LastVertex ( lastEdge ); tol = BRep_Tool::Tolerance ( endV ); // BUC60035 2053: iteration on edges is required - Standard_Integer k; // svv #1 + Standard_Integer k = 0; // svv #1 for ( k=sbwd->NbEdges(); k >=1; k-- ) //if ( sae.GetEndTangent2d ( sbwd->Edge ( k ), myFace, Standard_True, endPnt, endTan ) ) if ( sae.GetEndTangent2d ( sbwd->Edge ( k ), myFace, Standard_True, endPnt, endTan, 1.e-3 ) ) @@ -2341,10 +2343,10 @@ static gp_Pnt2d GetMiddlePoint (const ShapeFix_WireSegment& wire, Bnd_Box2d box; ShapeAnalysis_Edge sae; ShapeAnalysis_Curve sac; - Handle(ShapeExtend_WireData) wd = wire.WireData(); + const Handle(ShapeExtend_WireData)& wd = wire.WireData(); for(Standard_Integer i = 1; i <= wd->NbEdges(); i++) { TopoDS_Edge E = wd->Edge (i); - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; Handle(Geom2d_Curve) c2d; if(sae.PCurve (E,face,c2d,cf,cl,Standard_False)) { sac.FillBndBox ( c2d, cf, cl, 3, Standard_False, box ); @@ -2354,7 +2356,7 @@ static gp_Pnt2d GetMiddlePoint (const ShapeFix_WireSegment& wire, } } if ( box.IsVoid() ) return gp_Pnt2d(0.,0.); - Standard_Real aXmin, aYmin, aXmax, aYmax; + Standard_Real aXmin = NAN, aYmin = NAN, aXmax = NAN, aYmax = NAN; box.Get(aXmin, aYmin, aXmax, aYmax); return gp_Pnt2d ( 0.5 * ( aXmax + aXmin ), 0.5 * ( aYmax + aYmin ) ); } @@ -2374,7 +2376,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces, if ( loops.Length() == 1 ) { TopoDS_Face newFace; B.MakeFace ( newFace, surf, myLoc, ::Precision::Confusion() ); - TopoDS_Shape aSH = loops.Value(1); + const TopoDS_Shape& aSH = loops.Value(1); if( aSH.ShapeType() != TopAbs_WIRE) return; TopoDS_Wire wire = TopoDS::Wire ( loops.Value(1) ); @@ -2401,7 +2403,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces, Handle(ShapeAnalysis_Surface) aSurfTool = new ShapeAnalysis_Surface(atSurf); TopTools_SequenceOfShape roots; - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for ( i = 1; i <= loops.Length(); i++ ) { gp_Pnt2d unp; TopoDS_Wire wr; @@ -2424,12 +2426,12 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces, break; } if ( ! ew.More() ) continue; - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) cw = BRep_Tool::CurveOnSurface ( ed, pf, cf, cl ); if ( cw.IsNull() ) continue; unp = cw->Value ( 0.5 * ( cf + cl ) ); - Standard_Integer j; // svv #1 + Standard_Integer j = 0; // svv #1 for ( j = 1; j <= loops.Length(); j++ ) { if ( i == j ) continue; TopoDS_Shape aShape2 = loops(j); @@ -2460,7 +2462,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces, if(stPoint == TopAbs_ON || stPoint == TopAbs_UNKNOWN) { TopoDS_Edge anEdge = TopoDS::Edge ( ew.Value() ); - Standard_Real aCF, aCL; + Standard_Real aCF = NAN, aCL = NAN; Handle(Geom2d_Curve) aCW = BRep_Tool::CurveOnSurface ( anEdge, pf, aCF, aCL); // handle tangential case (ON) while ( stPoint == TopAbs_ON || stPoint == TopAbs_UNKNOWN ) { @@ -2518,7 +2520,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces, // find all holes for that loop TopTools_SequenceOfShape holes; // holes in holes not supported - Standard_Integer j; // svv #1 + Standard_Integer j = 0; // svv #1 for ( j=1; j <= loops.Length(); j++ ) { gp_Pnt2d unp; if(loops(j).ShapeType() == TopAbs_WIRE) { @@ -2526,7 +2528,7 @@ void ShapeFix_ComposeShell::MakeFacesOnPatch (TopTools_SequenceOfShape &faces, TopoDS_Iterator ew ( bw ); if ( ! ew.More() ) continue; TopoDS_Edge ed = TopoDS::Edge ( ew.Value() ); - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) cw = BRep_Tool::CurveOnSurface ( ed, pf, cf, cl ); if ( cw.IsNull() ) continue; unp = cw->Value ( 0.5 * ( cf + cl ) ); @@ -2594,7 +2596,7 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces, sfw.SetPrecision ( Precision() ); // pdn: shift pcurves in the seam to make OK shape w/o fixshifted - Standard_Integer i; + Standard_Integer i = 0; for ( i=1; i <= wires.Length(); i++ ) { if(wires(i).IsVertex()) continue; @@ -2603,7 +2605,7 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces, for(Standard_Integer jL=1; jL <= sbwd->NbEdges(); jL++ ) { TopoDS_Edge E = sbwd->Edge(jL); if ( E.Orientation() == TopAbs_REVERSED && BRep_Tool::IsClosed(E,myFace) ) { - Standard_Real f1,l1, f2, l2; + Standard_Real f1 = NAN,l1 = NAN, f2 = NAN, l2 = NAN; Handle(Geom2d_Curve) c21 = BRep_Tool::CurveOnSurface(E,myFace,f1,l1); TopoDS_Shape dummy = E.Reversed(); Handle(Geom2d_Curve) c22 = BRep_Tool::CurveOnSurface(TopoDS::Edge(dummy),myFace,f2,l2); @@ -2660,7 +2662,7 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces, if(nb == 0) return; - Standard_Integer i; //svv #1 + Standard_Integer i = 0; //svv #1 for ( i = 1; i <= nb; i++ ) mPnts.Append ( GetMiddlePoint ( wires(i), myFace ) ); @@ -2671,7 +2673,7 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces, ShapeAnalysis_Edge sae; Handle(ShapeFix_Edge) sfe = new ShapeFix_Edge; - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; myGrid->Bounds(U1,U2,V1,V2); for ( i = 1; i <= nb; i++ ) { gp_Pnt2d pnt = mPnts(i); @@ -2737,13 +2739,13 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces, // transform pcurve to parametric space of patch if ( needT ) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom2d_Curve) c2d; if ( sae.PCurve ( newEdge, face, c2d, f, l, Standard_False ) ) { Standard_Real newf = f, newl = l; Handle(Geom2d_Curve) c2dnew = sbe.TransformPCurve ( c2d, T, uFact, newf, newl ); if ( BRep_Tool::IsClosed ( newEdge, face ) ) { - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) c2d2; //smh#8 TopoDS_Shape tmpE = newEdge.Reversed(); @@ -2771,7 +2773,7 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces, else etmp = sbe.Copy ( newEdge, Standard_False ); sfe->FixAddCurve3d ( etmp ); - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom_Curve) c3d; if(sae.Curve3d(etmp,c3d,cf,cl,Standard_False)) { B.UpdateEdge ( newEdge, c3d, 0. ); @@ -2804,7 +2806,7 @@ void ShapeFix_ComposeShell::DispatchWires (TopTools_SequenceOfShape &faces, loops.Append(wires(i).GetVertex()); } else { - Handle(ShapeExtend_WireData) aWD = aSeg.WireData(); + const Handle(ShapeExtend_WireData)& aWD = aSeg.WireData(); if(!aWD.IsNull()) loops.Append ( aWD->Wire() ); } diff --git a/src/ShapeFix/ShapeFix_Edge.cxx b/src/ShapeFix/ShapeFix_Edge.cxx index cebe39c89f..d402725c2f 100644 --- a/src/ShapeFix/ShapeFix_Edge.cxx +++ b/src/ShapeFix/ShapeFix_Edge.cxx @@ -22,6 +22,8 @@ //:s5 abv 22.04.99 Adding debug printouts in catch {} blocks // abv 05.05.99 S4137: method CopyPCurves moved to ShapeBuild_Edge +#include + #include #include #include @@ -62,10 +64,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_Edge,Standard_Transient) //function : ShapeFix_Edge //purpose : //======================================================================= -ShapeFix_Edge::ShapeFix_Edge() +ShapeFix_Edge::ShapeFix_Edge() : myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK)), myProjector(new ShapeConstruct_ProjectCurveOnSurface) { - myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); - myProjector = new ShapeConstruct_ProjectCurveOnSurface; + + } //======================================================================= @@ -194,7 +196,7 @@ static Handle(Geom2d_Curve) TranslatePCurve (const Handle(Geom_Surface)& aSurf, Handle(Geom2d_Curve)& aC2d, const Standard_Real& aTol) { - Standard_Real uf,ul,vf,vl; + Standard_Real uf = NAN,ul = NAN,vf = NAN,vl = NAN; aSurf->Bounds(uf,ul,vf,vl); // cas d une ligne @@ -342,9 +344,9 @@ static Handle(Geom2d_Curve) TranslatePCurve (const Handle(Geom_Surface)& aSurf, TopLoc_Location LocalLoc ; //Standard_Boolean IsSameRange = Standard_True //skl - Standard_Boolean first_time_in = Standard_True, has_curve, has_closed_curve; + Standard_Boolean first_time_in = Standard_True, has_curve = 0, has_closed_curve = 0; Handle(BRep_GCurve) geometric_representation_ptr; - Standard_Real first, current_first, last, current_last; + Standard_Real first = NAN, current_first = NAN, last = NAN, current_last = NAN; const Handle(Geom_Curve) C = BRep_Tool::Curve(AnEdge, LocalLoc, current_first, current_last); @@ -460,7 +462,7 @@ Standard_Boolean ShapeFix_Edge::FixAddPCurve (const TopoDS_Edge& edge, // Standard_Real step = 0; try { OCC_CATCH_SIGNALS - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; BRep_Builder B; @@ -482,7 +484,7 @@ Standard_Boolean ShapeFix_Edge::FixAddPCurve (const TopoDS_Edge& edge, // A present, on projette // stat : 0 pas pu faire, 1 analytique, 2 approx Handle(Geom2d_Curve) c2d; - Standard_Real a1, b1; + Standard_Real a1 = NAN, b1 = NAN; if ( ! sae.HasPCurve (edge, surf, location)) { Standard_Real TolFirst = -1, TolLast = -1; TopoDS_Vertex V1, V2; @@ -513,7 +515,7 @@ Standard_Boolean ShapeFix_Edge::FixAddPCurve (const TopoDS_Edge& edge, // ATTENTION : TranslatePCurve reconstruit une Line // bords, en // intuitant U ou V ... // Ici, on exploite les infos deja connues - Standard_Real uf,ul,vf,vl; + Standard_Real uf = NAN,ul = NAN,vf = NAN,vl = NAN; surf->Bounds (uf,ul,vf,vl); //#4 rln 19/02/98 ProSTEP ug_exhaust-A.stp entity #284920 (thoroidal surface) //#13 rln 17/03/98 (updating fix #4) call to TranslatePCurve in the case @@ -600,7 +602,7 @@ Standard_Boolean ShapeFix_Edge::FixVertexTolerance(const TopoDS_Edge& edge, anEdgeCopy = TopoDS::Edge(Context()->Apply(edge)); } - Standard_Real toler1, toler2; + Standard_Real toler1 = NAN, toler2 = NAN; if (!sae.CheckVertexTolerance (anEdgeCopy, face, toler1, toler2)) return Standard_False; if (sae.Status (ShapeExtend_DONE1)) myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE1); @@ -636,7 +638,7 @@ Standard_Boolean ShapeFix_Edge::FixVertexTolerance(const TopoDS_Edge& edge) { anEdgeCopy = TopoDS::Edge(Context()->Apply(edge)); } - Standard_Real toler1, toler2; + Standard_Real toler1 = NAN, toler2 = NAN; if (!sae.CheckVertexTolerance (anEdgeCopy, toler1, toler2)) return Standard_False; if (sae.Status (ShapeExtend_DONE1)) myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE1); @@ -691,7 +693,7 @@ Standard_Boolean ShapeFix_Edge::FixReversed2d (const TopoDS_Edge& edge, if ( ! EA.Status (ShapeExtend_DONE) ) return Standard_False; Handle(Geom2d_Curve) c2d; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; EA.PCurve (edge, surface, location, c2d, f, l, Standard_False); //#46 rln 01.12.98 buc40130, entity 272 (4-th curve) Standard_Real newf = c2d->ReversedParameter (l), newl = c2d->ReversedParameter (f); @@ -702,7 +704,7 @@ Standard_Boolean ShapeFix_Edge::FixReversed2d (const TopoDS_Edge& edge, //#51 rln 15.12.98 pro6562 entity 2788 //Because of numerical accuracy the range on B-Splines (moreover, on any curve!) //the range is changed - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_Tool::Range (edge, first, last); if (first != newf || last != newl) { B.SameRange (edge, Standard_False); @@ -772,7 +774,7 @@ Standard_Boolean ShapeFix_Edge::FixSameParameter(const TopoDS_Edge& edge, // In this case pcurves in BRepLib::SameParameter() will be changed as well // and later ShapeBuild_Edge::CopyPCurves() will copy pcurves keeping original range. // To prevent this discrepancy we enforce original 3D range. - Standard_Real aF, aL; + Standard_Real aF = NAN, aL = NAN; BRep_Tool::Range (edge, aF, aL); B.Range (copyedge, aF, aL, Standard_True); // only 3D BRepLib::SameParameter ( copyedge, ( tolerance >= Precision::Confusion() ? tolerance : tol ) ); @@ -791,7 +793,7 @@ Standard_Boolean ShapeFix_Edge::FixSameParameter(const TopoDS_Edge& edge, } // compute deviation on the original pcurves - Standard_Real maxdev; + Standard_Real maxdev = NAN; B.SameParameter ( edge, Standard_True ); // Should check all pcurves in case of non-sameparametrization input. @@ -809,7 +811,7 @@ Standard_Boolean ShapeFix_Edge::FixSameParameter(const TopoDS_Edge& edge, // if BRepLib was OK, compare and select the best variant if ( SP ) { - Standard_Real BRLTol = BRep_Tool::Tolerance ( copyedge ), BRLDev; + Standard_Real BRLTol = BRep_Tool::Tolerance ( copyedge ), BRLDev = NAN; sae.CheckSameParameter ( copyedge, BRLDev ); myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 ); if ( BRLTol < BRLDev ) BRLTol = BRLDev; diff --git a/src/ShapeFix/ShapeFix_EdgeConnect.cxx b/src/ShapeFix/ShapeFix_EdgeConnect.cxx index fbabd618b0..a37d6d2bc3 100644 --- a/src/ShapeFix/ShapeFix_EdgeConnect.cxx +++ b/src/ShapeFix/ShapeFix_EdgeConnect.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -149,7 +151,7 @@ void ShapeFix_EdgeConnect::Build () TColgp_SequenceOfXYZ thePositions; gp_XYZ thePosition; - Standard_Real theMaxDev; + Standard_Real theMaxDev = NAN; BRep_Builder theBuilder; // Iterate on shared vertices @@ -182,7 +184,7 @@ void ShapeFix_EdgeConnect::Build () Handle(BRep_GCurve) GC = Handle(BRep_GCurve)::DownCast(theCIterator.Value()); if ( GC.IsNull() ) continue; // Calculate vertex position for this curve - Standard_Real theFParam, theLParam; + Standard_Real theFParam = NAN, theLParam = NAN; GC->Range( theFParam, theLParam ); gp_Pnt thePoint; if (use_start) { @@ -196,7 +198,7 @@ void ShapeFix_EdgeConnect::Build () } } - Standard_Integer i, theNbPos = thePositions.Length(); + Standard_Integer i = 0, theNbPos = thePositions.Length(); // Calculate vertex position thePosition = gp_XYZ(0.,0.,0.); diff --git a/src/ShapeFix/ShapeFix_EdgeProjAux.cxx b/src/ShapeFix/ShapeFix_EdgeProjAux.cxx index 1afc7a1a69..566bc9aa89 100644 --- a/src/ShapeFix/ShapeFix_EdgeProjAux.cxx +++ b/src/ShapeFix/ShapeFix_EdgeProjAux.cxx @@ -14,6 +14,8 @@ //:r5 abv 06.04.99: ec_turbine-A.stp, #4313: protect against null curve // abv 09.04.99 S4136: add parameter preci (to eliminate BRepAPI::Precision) +#include + #include #include @@ -239,7 +241,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci) gp_Pnt Pt1,Pt2; // pdn 28.12.98: r_39-db.stp #605: use ends of 3d curve instead of vertices ShapeAnalysis_Edge sae; - Standard_Real a,b; + Standard_Real a = NAN,b = NAN; Handle(Geom_Curve) C3d; if(sae.Curve3d(myEdge,C3d,a,b,Standard_False)) { Pt1 = C3d->Value(a); @@ -254,7 +256,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci) if (V1.IsSame(V2)) { Handle(ShapeAnalysis_Surface) stsu = new ShapeAnalysis_Surface (theSurface); gp_Pnt2d aPt1,aPt2; - Standard_Real firstpar,lastpar; + Standard_Real firstpar = NAN,lastpar = NAN; if (stsu->DegeneratedValues(Pt1,preci,aPt1,aPt2,firstpar,lastpar)){ if(theCurve2d->IsKind(STANDARD_TYPE(Geom2d_Line))) { @@ -282,7 +284,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci) //pdn cutting pcurve by surface bounds if (Precision::IsInfinite(cf)||Precision::IsInfinite(cl)) { if(theCurve2d->IsKind(STANDARD_TYPE(Geom2d_Line))) { - Standard_Real uf,ul,vf,vl; + Standard_Real uf = NAN,ul = NAN,vf = NAN,vl = NAN; theSurface->Bounds(uf,ul,vf,vl); //Correct surface limits for extrusion/revolution surfaces based on hyperbola //23 is ln(1.0e+10) @@ -304,7 +306,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci) } if(!Precision::IsInfinite(uf)&&!Precision::IsInfinite(ul)&& !Precision::IsInfinite(vf)&&!Precision::IsInfinite(vl)) { - Standard_Real cfi,cli; + Standard_Real cfi = NAN,cli = NAN; Handle(Geom2d_Line) lin = Handle(Geom2d_Line)::DownCast(theCurve2d); gp_Pnt2d pnt = lin->Location(); gp_Dir2d dir = lin->Direction(); @@ -319,7 +321,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci) cli = (vl-pnt.Y())/dir.Y(); } else {//common case - Standard_Real xfi, xli, yfi, yli; + Standard_Real xfi = NAN, xli = NAN, yfi = NAN, yli = NAN; xfi = (uf-pnt.X())/dir.X(); xli = (ul-pnt.X())/dir.X(); yfi = (vf-pnt.Y())/dir.Y(); @@ -441,7 +443,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci) //pdn adjust parameters in periodic case if(parU || parV) { - Standard_Real uf,ul,vf,vl; + Standard_Real uf = NAN,ul = NAN,vf = NAN,vl = NAN; theSurface->Bounds(uf,ul,vf,vl); Standard_Real period = (parU ? ul-uf : vl-vf); w1+=ShapeAnalysis::AdjustToPeriod(w1,0,period); @@ -454,7 +456,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci) return; } gp_Pnt mid = C3d1->Value((cf+cl)/2); - Standard_Real wmid; + Standard_Real wmid = NAN; sac.Project(COnS,mid,preci,pnt,wmid,Standard_False); wmid+=ShapeAnalysis::AdjustToPeriod(wmid,0,period); if(w1>=w2) { @@ -492,7 +494,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci) void ShapeFix_EdgeProjAux::Init3d (const Standard_Real preci) { - Standard_Real cl, cf; + Standard_Real cl = NAN, cf = NAN; // Extract Geometries Handle(Geom_Surface) theSurface = BRep_Tool::Surface(myFace); diff --git a/src/ShapeFix/ShapeFix_EdgeProjAux.hxx b/src/ShapeFix/ShapeFix_EdgeProjAux.hxx index 471f3c6495..c1b289483e 100644 --- a/src/ShapeFix/ShapeFix_EdgeProjAux.hxx +++ b/src/ShapeFix/ShapeFix_EdgeProjAux.hxx @@ -71,10 +71,10 @@ protected: TopoDS_Face myFace; TopoDS_Edge myEdge; - Standard_Real myFirstParam; - Standard_Real myLastParam; - Standard_Boolean myFirstDone; - Standard_Boolean myLastDone; + Standard_Real myFirstParam{}; + Standard_Real myLastParam{}; + Standard_Boolean myFirstDone{}; + Standard_Boolean myLastDone{}; private: diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx index 15016761eb..44d914135b 100644 --- a/src/ShapeFix/ShapeFix_Face.cxx +++ b/src/ShapeFix/ShapeFix_Face.cxx @@ -28,6 +28,8 @@ // abv 19.10.2001 FixAddNaturalBound improved and extracted as separate fix // skl,pdn 14.05.2002 OCC55 (correction precision for small faces) +#include + #include #include #include @@ -95,7 +97,7 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_Face,ShapeFix_Root) static Standard_Boolean IsSurfaceUVInfinite(const Handle(Geom_Surface)& theSurf) { - Standard_Real UMin,UMax,VMin,VMax; + Standard_Real UMin = NAN,UMax = NAN,VMin = NAN,VMax = NAN; theSurf->Bounds(UMin,UMax,VMin,VMax); return (Precision::IsInfinite(UMin) || @@ -114,11 +116,11 @@ static Standard_Boolean IsSurfaceUVPeriodic(const Handle(GeomAdaptor_Surface)& t //purpose : //======================================================================= -ShapeFix_Face::ShapeFix_Face() +ShapeFix_Face::ShapeFix_Face() : myFixWire(new ShapeFix_Wire), myFwd(Standard_True), myStatus(0) { - myFwd = Standard_True; - myStatus = 0; - myFixWire = new ShapeFix_Wire; + + + ClearModes(); } @@ -127,11 +129,11 @@ ShapeFix_Face::ShapeFix_Face() //purpose : //======================================================================= -ShapeFix_Face::ShapeFix_Face(const TopoDS_Face &face) +ShapeFix_Face::ShapeFix_Face(const TopoDS_Face &face) : myFixWire(new ShapeFix_Wire), myFwd(Standard_True), myStatus(0) { - myFwd = Standard_True; - myStatus = 0; - myFixWire = new ShapeFix_Wire; + + + ClearModes(); Init( face ); } @@ -273,7 +275,7 @@ static Standard_Boolean SplitWire(const TopoDS_Face &face, const TopoDS_Wire& wi { TColStd_MapOfInteger UsedEdges; Handle(ShapeExtend_WireData) sewd = new ShapeExtend_WireData(wire); - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; ShapeAnalysis_Edge sae; for(i=1; i<=sewd->NbEdges(); i++) { if(UsedEdges.Contains(i)) continue; @@ -305,7 +307,7 @@ static Standard_Boolean SplitWire(const TopoDS_Face &face, const TopoDS_Wire& wi } if(V1.IsSame(V0)) { //check that V0 and V1 are same in 2d too - Standard_Real a1,b1,a2,b2; + Standard_Real a1 = NAN,b1 = NAN,a2 = NAN,b2 = NAN; Handle (Geom2d_Curve) curve1 = BRep_Tool::CurveOnSurface(E1,face,a1,b1); Handle (Geom2d_Curve) curve2 = BRep_Tool::CurveOnSurface(E2,face,a2,b2); gp_Pnt2d v0,v1; @@ -691,7 +693,7 @@ Standard_Boolean ShapeFix_Face::Perform() TopoDS_Shape aCurW = aItW.Value(); while(aMapReorderedWires.IsBound(aCurW)) { - TopoDS_Shape aFixW = aMapReorderedWires.Find(aCurW); + const TopoDS_Shape& aFixW = aMapReorderedWires.Find(aCurW); Context()->Replace(aCurW, aFixW); aCurW = aFixW; } @@ -715,7 +717,7 @@ Standard_Boolean ShapeFix_Face::Perform() // Shift all pcurves of edges in the given wire on the given face // to vector -static void Shift2dWire(const TopoDS_Wire w, const TopoDS_Face f, +static void Shift2dWire(const TopoDS_Wire& w, const TopoDS_Face& f, const gp_Vec2d vec, const Handle(ShapeAnalysis_Surface)& mySurf, Standard_Boolean recompute3d = Standard_False) @@ -728,7 +730,7 @@ static void Shift2dWire(const TopoDS_Wire w, const TopoDS_Face f, for (TopoDS_Iterator ei (w,Standard_False); ei.More(); ei.Next()){ TopoDS_Edge edge = TopoDS::Edge(ei.Value()); Handle (Geom2d_Curve) C2d; - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; if ( ! sae.PCurve(edge, f, C2d, cf, cl, Standard_True) ) continue; C2d->Transform(tr2d); if ( recompute3d ) { @@ -847,15 +849,15 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound() // Collect information on free intervals in U and V TColgp_SequenceOfPnt2d intU, intV, centers; - Standard_Real SUF, SUL, SVF, SVL; + Standard_Real SUF = NAN, SUL = NAN, SVF = NAN, SVL = NAN; mySurf->Bounds(SUF, SUL, SVF, SVL); intU.Append ( gp_Pnt2d(SUF, SUL) ); intV.Append ( gp_Pnt2d(SVF, SVL) ); Standard_Integer nb = ws.Length(); - Standard_Integer i; + Standard_Integer i = 0; for ( i=1; i <= nb; i ++) { - Standard_Real Umin, Vmin, Umax, Vmax; + Standard_Real Umin = NAN, Vmin = NAN, Umax = NAN, Vmax = NAN; // Bnd_Box2d B; TopoDS_Wire aw = TopoDS::Wire (ws.Value(i)); // PTV 01.11.2002 ACIS907, OCC921 begin @@ -947,7 +949,7 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound() // find corresponding place in boundary ShapeAnalysis_Edge sae; TopoDS_Vertex V = sae.FirstVertex ( sbwd->Edge(j) ); - Standard_Integer k; + Standard_Integer k = 0; for ( k=1; k <= bnd->NbEdges(); k++ ) { if ( ! BRep_Tool::Degenerated ( bnd->Edge(k) ) ) continue; if ( BRepTools::Compare ( V, sae.FirstVertex ( bnd->Edge(k) ) ) ) break; @@ -1082,7 +1084,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap ei.Next(); if ( ! ei.More() ) { length = 0; - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; Handle(Geom_Curve) c3d; ShapeAnalysis_Edge sae; if ( sae.Curve3d(anEdge,c3d,First,Last) ) { @@ -1157,7 +1159,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap // Standard_Real toluv = Min ( Ads.UResolution(Precision()), Ads.VResolution(Precision()) ); Standard_Boolean uclosed = mySurf->IsUClosed(); Standard_Boolean vclosed = mySurf->IsVClosed(); - Standard_Real SUF, SUL, SVF, SVL; + Standard_Real SUF = NAN, SUL = NAN, SVF = NAN, SVL = NAN; mySurf->Bounds(SUF, SUL, SVF, SVL); Standard_Real uRange = SUL - SUF; Standard_Real vRange = SVL - SVF; @@ -1169,7 +1171,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap SI.Clear(); MapIntWires.Clear(); Standard_Integer NbOuts=0; - Standard_Integer i; + Standard_Integer i = 0; NCollection_Array1 aWireBoxes(1, nb); Standard_Real uMiddle = 0, vMiddle = 0; @@ -1179,7 +1181,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap TopoDS_Shape aShape = ws.Value(i); TopoDS_Wire aWire = TopoDS::Wire (aShape); Bnd_Box2d aBox; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; TopoDS_Iterator ew (aWire); for(;ew.More(); ew.Next()) { TopoDS_Edge ed = TopoDS::Edge (ew.Value()); @@ -1200,7 +1202,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap BndLib_Add2dCurve::Add(gac,::Precision::Confusion(),aBox); } - Standard_Real aXMin, aXMax, aYMin, aYMax; + Standard_Real aXMin = NAN, aXMax = NAN, aYMin = NAN, aYMax = NAN; aBox.Get(aXMin, aYMin, aXMax, aYMax); if (isFirst) { isFirst = Standard_False; @@ -1273,7 +1275,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap TopoDS_Iterator ew (bw); for(;ew.More(); ew.Next()) { TopoDS_Edge ed = TopoDS::Edge (ew.Value()); - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; Handle(Geom2d_Curve) cw = BRep_Tool::CurveOnSurface (ed,myFace,cf,cl); if (cw.IsNull()) continue; gp_Pnt2d unp = cw->Value ((cf+cl)/2.); @@ -1418,7 +1420,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap if(nb < nbAll) { for( i =1; i <= nbAll;i++) { - TopoDS_Shape aS2 = allSubShapes.Value(i); + const TopoDS_Shape& aS2 = allSubShapes.Value(i); if(aS2.ShapeType() != TopAbs_WIRE || (aS2.Orientation() != TopAbs_FORWARD && aS2.Orientation() != TopAbs_REVERSED)) B.Add ( S,aS2); @@ -1467,7 +1469,7 @@ static Standard_Boolean CheckWire (const TopoDS_Wire &wire, TopoDS_Edge edge = TopoDS::Edge ( ed.Value() ); if ( ! BRep_Tool::Degenerated ( edge ) ) isDeg = Standard_False; Handle(Geom2d_Curve) c2d; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; if ( ! sae.PCurve ( edge, face, c2d, f, l, Standard_True ) ) return Standard_False; vec += c2d->Value(l).XY() - c2d->Value(f).XY(); @@ -1533,9 +1535,9 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() return Standard_False; } - Standard_Real URange, VRange, SUF, SUL, SVF, SVL; + Standard_Real URange = NAN, VRange = NAN, SUF = NAN, SUL = NAN, SVF = NAN, SVL = NAN; mySurf->Bounds ( SUF, SUL, SVF, SVL ); - Standard_Real fU1,fU2,fV1,fV2; + Standard_Real fU1 = NAN,fU2 = NAN,fV1 = NAN,fV2 = NAN; BRepTools::UVBounds(myFace,fU1,fU2,fV1,fV2); //pdn OCC55 fix to faces without the wires to avoid identical first and last parameters @@ -1574,11 +1576,11 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() } TopoDS_Wire w1, w2; - Standard_Integer i; + Standard_Integer i = 0; for ( i=1; i <= ws.Length(); i++ ) { TopoDS_Wire wire = TopoDS::Wire ( ws.Value(i) ); - Standard_Integer isuopen, isvopen; - Standard_Boolean isdeg; + Standard_Integer isuopen = 0, isvopen = 0; + Standard_Boolean isdeg = 0; if ( ! CheckWire ( wire, myFace, URange, VRange, isuopen, isvopen, isdeg ) ) continue; if ( w1.IsNull() ) { w1 = wire; ismodeu = isuopen; ismodev = isvopen; isdeg1 = isdeg ? i : 0; } @@ -1637,7 +1639,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() // then usual procedure applied gp_Pnt2d p; gp_Dir2d d; - Standard_Real aRange; + Standard_Real aRange = NAN; if( ismodeu && anIsDegeneratedTor ) { @@ -1657,7 +1659,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() aRange = 2.*M_PI; } else if ( ismodev && mySurf->Surface()->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) { - Standard_Real uCoord; + Standard_Real uCoord = NAN; if (mySurf->Value(SUF, SVF).Distance(mySurf->Value(SUF, (SVF + SVL) / 2)) < ::Precision::Confusion()) uCoord = SUF; else if (mySurf->Value(SUL, SVF).Distance(mySurf->Value(SUL, (SVF + SVL) / 2)) < ::Precision::Confusion()) @@ -1669,7 +1671,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() aRange = VRange; } else if ( ismodeu && mySurf->Surface()->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) { - Standard_Real vCoord; + Standard_Real vCoord = NAN; if (mySurf->Value(SUF, SVF).Distance(mySurf->Value((SUF + SUL) / 2, SVF)) < ::Precision::Confusion()) vCoord = SVF; else if (mySurf->Value(SUL, SVL).Distance(mySurf->Value((SUF + SUL) / 2, SVL)) < ::Precision::Confusion()) @@ -1779,7 +1781,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() continue; TopoDS_Wire w = TopoDS::Wire ( it.Value() ); if ( w == w11 ) continue; - Standard_Real shift; + Standard_Real shift = NAN; if ( w == w21 ) shift = shiftw2; else { @@ -1796,7 +1798,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() for ( TopoDS_Iterator iw(w); iw.More(); iw.Next() ) { TopoDS_Edge E = TopoDS::Edge ( iw.Value() ); Handle(Geom2d_Curve) C; - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; if ( ! sae.PCurve ( E, tmpF, C, a, b ) ) continue; C->Translate ( V ); } @@ -1820,7 +1822,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() for ( Standard_Integer i1 = 1; i1 <= nb1 + nb2; i1++ ) { TopoDS_Edge edge1 = ( i1 <= nb1 ? wd1->Edge ( i1 ) : wd2->Edge ( i1-nb1 ) ); Handle(Geom2d_Curve) c2d; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; if ( ! sae.PCurve ( edge1, tmpF, c2d, f, l, Standard_True ) ) return Standard_False; gp_Pnt2d pos1 = c2d->Value(l).XY(); // the best place is end of edge which is nearest to 0 @@ -2288,7 +2290,7 @@ Standard_Boolean ShapeFix_Face::SplitEdge(const Handle(ShapeExtend_WireData)& se TopLoc_Location L; const Handle(Geom_Surface)& S = BRep_Tool::Surface(myFace,L); Handle(Geom2d_Curve) c2d; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; ShapeAnalysis_Edge sae; if(sae.PCurve(newE1,S,L,c2d,cf,cl,Standard_False)) { Bnd_Box2d box; @@ -2364,7 +2366,7 @@ Standard_Boolean ShapeFix_Face::SplitEdge(const Handle(ShapeExtend_WireData)& se TopLoc_Location L; const Handle(Geom_Surface)& S = BRep_Tool::Surface(myFace,L); Handle(Geom2d_Curve) c2d; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; ShapeAnalysis_Edge sae; if(sae.PCurve(newE1,S,L,c2d,cf,cl,Standard_False)) { Bnd_Box2d box; @@ -2486,7 +2488,7 @@ Standard_Boolean ShapeFix_Face::FixSplitFace(const TopTools_DataMapOfShapeListOf TopoDS_Shape S = myFace; if ( ! Context().IsNull() ) S = Context()->Apply ( myFace ); - Standard_Integer NbWires=0, NbWiresNew=0, NbEdges; + Standard_Integer NbWires=0, NbWiresNew=0, NbEdges = 0; for(TopoDS_Iterator iter(S,Standard_False); iter.More(); iter.Next()) { const TopoDS_Shape& aShape = iter.Value(); if(aShape.ShapeType() != TopAbs_WIRE || @@ -2597,7 +2599,7 @@ static Standard_Boolean IsPeriodicConicalLoop(const Handle(Geom_ConicalSurface)& { const TopoDS_Edge& aCurrentEdge = TopoDS::Edge(aWireIter.Value()); Handle(Geom2d_Curve) aC2d; - Standard_Real aPFirst, aPLast; + Standard_Real aPFirst = NAN, aPLast = NAN; aSAE.PCurve(aCurrentEdge, theSurf, aLoc, aC2d, aPFirst, aPLast, Standard_True); diff --git a/src/ShapeFix/ShapeFix_Face.hxx b/src/ShapeFix/ShapeFix_Face.hxx index 3e9af25533..6c6f079af3 100644 --- a/src/ShapeFix/ShapeFix_Face.hxx +++ b/src/ShapeFix/ShapeFix_Face.hxx @@ -268,17 +268,17 @@ private: Standard_EXPORT Standard_Boolean SplitEdge (const Handle(ShapeExtend_WireData)& sewd, const Standard_Integer num, const Standard_Real param1, const Standard_Real param2, const TopoDS_Vertex& vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d& boxes); - Standard_Integer myFixWireMode; - Standard_Integer myFixOrientationMode; - Standard_Integer myFixAddNaturalBoundMode; - Standard_Integer myFixMissingSeamMode; - Standard_Integer myFixSmallAreaWireMode; - Standard_Integer myRemoveSmallAreaFaceMode; - Standard_Integer myFixLoopWiresMode; - Standard_Integer myFixIntersectingWiresMode; - Standard_Integer myFixSplitFaceMode; - Standard_Integer myAutoCorrectPrecisionMode; - Standard_Integer myFixPeriodicDegenerated; + Standard_Integer myFixWireMode{}; + Standard_Integer myFixOrientationMode{}; + Standard_Integer myFixAddNaturalBoundMode{}; + Standard_Integer myFixMissingSeamMode{}; + Standard_Integer myFixSmallAreaWireMode{}; + Standard_Integer myRemoveSmallAreaFaceMode{}; + Standard_Integer myFixLoopWiresMode{}; + Standard_Integer myFixIntersectingWiresMode{}; + Standard_Integer myFixSplitFaceMode{}; + Standard_Integer myAutoCorrectPrecisionMode{}; + Standard_Integer myFixPeriodicDegenerated{}; }; diff --git a/src/ShapeFix/ShapeFix_FaceConnect.cxx b/src/ShapeFix/ShapeFix_FaceConnect.cxx index 1d3593a4cd..b39e6d3eb3 100644 --- a/src/ShapeFix/ShapeFix_FaceConnect.cxx +++ b/src/ShapeFix/ShapeFix_FaceConnect.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -374,7 +376,7 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {} TopoDS_Wire theNewW; TopoDS_Vertex theOldV1, theOldV2, theNewV1, theNewV2, theNewV; gp_Pnt theOldP1, theOldP2; - Standard_Real dist1, dist2, curdist1, curdist2; + Standard_Real dist1 = NAN, dist2 = NAN, curdist1 = NAN, curdist2 = NAN; for ( TopTools_DataMapIteratorOfDataMapOfShapeListOfShape theOEIter( myOriFreeEdges ); theOEIter.More(); theOEIter.Next() ) { // Iterate on original free edges @@ -487,7 +489,7 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {} Handle(ShapeFix_Wire) SFW = new ShapeFix_Wire; Handle(ShapeFix_Face) SFF = new ShapeFix_Face; ShapeAnalysis_Edge SAE; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; Handle(Geom2d_Curve) c2d; Handle(ShapeExtend_WireData) sewd; @@ -603,7 +605,7 @@ ShapeFix_FaceConnect::ShapeFix_FaceConnect() {} else if ( val > theRBound.Z() ) theRBound.SetZ( val ); } thePosition = gp_Pnt((theLBound.XYZ() + theRBound.XYZ())/2.); - Standard_Real theTolerance = 0., curtoler; + Standard_Real theTolerance = 0., curtoler = NAN; // Calculate the vertex tolerance for ( theN2Iter.Initialize(theRV2Iter.Value()); theN2Iter.More(); theN2Iter.Next() ) { theOldVert = TopoDS::Vertex(theN2Iter.Value()); diff --git a/src/ShapeFix/ShapeFix_FixSmallFace.cxx b/src/ShapeFix/ShapeFix_FixSmallFace.cxx index a3365808b1..36c542061b 100644 --- a/src/ShapeFix/ShapeFix_FixSmallFace.cxx +++ b/src/ShapeFix/ShapeFix_FixSmallFace.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -52,9 +54,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_FixSmallFace,ShapeFix_Root) //#include //#include //#include -ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() +ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() : myStatus(ShapeExtend::EncodeStatus ( ShapeExtend_OK )) { - myStatus = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); + SetPrecision(Precision::Confusion()); } @@ -129,7 +131,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() TColgp_SequenceOfXYZ thePositions; gp_XYZ thePosition; BRep_Builder theBuilder; - Standard_Real theMaxDev; + Standard_Real theMaxDev = NAN; Standard_Real theMaxTol = 0.0; thePositions.Clear(); gp_Pnt thePoint; @@ -156,7 +158,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() //Calculate common vertex position thePosition = gp_XYZ(0.,0.,0.); Standard_Integer theNbPos = thePositions.Length(); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for ( i = 1; i <= theNbPos; i++ ) thePosition += thePositions.Value(i); if ( theNbPos > 1 ) thePosition /= theNbPos; @@ -334,7 +336,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() TopExp::Vertices (E1,V1,V2); TopExp::Vertices (E2,V3,V4); gp_Pnt p1, p2; - Standard_Real dev; + Standard_Real dev = NAN; p1 = BRep_Tool::Pnt(V1); p2 = BRep_Tool::Pnt(V3); dev = p1.Distance(p2); @@ -444,7 +446,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() if (theFirstVer.IsNull() || theSecondVer.IsNull()) return theNewEdge; //Create new edge theBuilder.MakeEdge(theNewEdge); - Standard_Real f, l, fp1, lp1/*, fp2, lp2*/; + Standard_Real f = NAN, l = NAN, fp1 = NAN, lp1 = NAN/*, fp2, lp2*/; TopLoc_Location loc; Handle(Geom_Curve) the3dcurve; the3dcurve = BRep_Tool::Curve(E1, f, l); @@ -461,7 +463,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() if(!the2dcurve2.IsNull()) GeomLib::SameRange(Precision::Confusion(), the2dcurve2, fp2, lp2, f, l, thenew2); }*/ - Standard_Real maxdev; + Standard_Real maxdev = NAN; if ((BRep_Tool::Tolerance(theFirstVer))<=(BRep_Tool::Tolerance(theSecondVer))) maxdev = (BRep_Tool::Tolerance(theSecondVer)); else maxdev = (BRep_Tool::Tolerance(theFirstVer)); @@ -554,12 +556,12 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() E = TopoDS::Edge (ite.Current()); TopoDS_Vertex V1,V2; TopExp::Vertices (E,V1,V2); - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; Handle(Geom_Curve) C3D = BRep_Tool::Curve (E,cf,cl); if (C3D.IsNull()) continue; if (V.IsSame(V1) || V.IsSame(V2)) continue; Standard_Real vt = BRep_Tool::Tolerance (V); - Standard_Real param; + Standard_Real param = NAN; Standard_Real dist = SAC.Project (C3D,vp,vt*10.,proj,param,cf,cl); if (dist==0) continue; //Projection on same curve but on other edge ? if ( dist <= vt ) @@ -568,7 +570,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace() theBuilder.UpdateVertex(theNewVertex, proj, Precision::Confusion()); theBuilder.MakeEdge(theFirstEdge); theBuilder.MakeEdge(theSecondEdge); - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) the3dcurve = BRep_Tool::Curve(E, f, l); theBuilder.UpdateEdge(theFirstEdge, the3dcurve,Precision::Confusion()); theBuilder.UpdateEdge(theSecondEdge, the3dcurve,Precision::Confusion()); diff --git a/src/ShapeFix/ShapeFix_FreeBounds.cxx b/src/ShapeFix/ShapeFix_FreeBounds.cxx index df9618e7e8..08c3b812a3 100644 --- a/src/ShapeFix/ShapeFix_FreeBounds.cxx +++ b/src/ShapeFix/ShapeFix_FreeBounds.cxx @@ -53,10 +53,10 @@ ShapeFix_FreeBounds::ShapeFix_FreeBounds(const TopoDS_Shape& shape, const Standard_Real closetoler, const Standard_Boolean splitclosed, const Standard_Boolean splitopen) : - myShared (Standard_False), mySewToler (sewtoler), myCloseToler (closetoler), + myShape(shape), myShared (Standard_False), mySewToler (sewtoler), myCloseToler (closetoler), mySplitClosed (splitclosed), mySplitOpen (splitopen) { - myShape = shape; + Perform(); } @@ -69,10 +69,10 @@ ShapeFix_FreeBounds::ShapeFix_FreeBounds(const TopoDS_Shape& shape, const Standard_Real closetoler, const Standard_Boolean splitclosed, const Standard_Boolean splitopen): - myShared (Standard_True), mySewToler (0.), myCloseToler (closetoler), + myShape(shape), myShared (Standard_True), mySewToler (0.), myCloseToler (closetoler), mySplitClosed (splitclosed), mySplitOpen (splitopen) { - myShape = shape; + Perform(); } diff --git a/src/ShapeFix/ShapeFix_IntersectionTool.cxx b/src/ShapeFix/ShapeFix_IntersectionTool.cxx index b98d4bb2c5..1fdb6ce028 100644 --- a/src/ShapeFix/ShapeFix_IntersectionTool.cxx +++ b/src/ShapeFix/ShapeFix_IntersectionTool.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -53,11 +55,11 @@ //======================================================================= ShapeFix_IntersectionTool::ShapeFix_IntersectionTool(const Handle(ShapeBuild_ReShape)& context, const Standard_Real preci, - const Standard_Real maxtol) + const Standard_Real maxtol) : myContext(context), myPreci(preci), myMaxTol(maxtol) { - myContext = context; - myPreci = preci; - myMaxTol = maxtol; + + + } @@ -73,7 +75,7 @@ static gp_Pnt GetPointOnEdge(const TopoDS_Edge &edge, const Standard_Real param ) { if( BRep_Tool::SameParameter(edge) ) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; TopLoc_Location L; const Handle(Geom_Curve) ConS = BRep_Tool::Curve ( edge, L, f, l ); if( !ConS.IsNull() ) @@ -97,7 +99,7 @@ Standard_Boolean ShapeFix_IntersectionTool::SplitEdge(const TopoDS_Edge& edge, TopoDS_Edge& newE2, const Standard_Real preci) const { - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; ShapeAnalysis_Edge sae; TopoDS_Vertex V1 = sae.FirstVertex(edge); @@ -113,7 +115,7 @@ Standard_Boolean ShapeFix_IntersectionTool::SplitEdge(const TopoDS_Edge& edge, gp_Pnt P1; TopLoc_Location L; if(BRep_Tool::SameParameter(edge) && !BRep_Tool::Degenerated(edge)) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; const Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,L,f,l); if(c3d.IsNull()) return Standard_False; @@ -137,7 +139,7 @@ Standard_Boolean ShapeFix_IntersectionTool::SplitEdge(const TopoDS_Edge& edge, new ShapeAnalysis_TransferParametersProj; transferParameters->SetMaxTolerance(preci); transferParameters->Init(edge,face); - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; if (a < b ) { first = a; last = b; @@ -188,7 +190,7 @@ Standard_Boolean ShapeFix_IntersectionTool::CutEdge(const TopoDS_Edge &edge, { if( Abs(cut-pend)<10.*Precision::PConfusion() ) return Standard_False; Standard_Real aRange = Abs(cut-pend); - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; BRep_Tool::Range(edge, a, b); if( aRange<10.*Precision::PConfusion() ) return Standard_False; @@ -197,7 +199,7 @@ Standard_Boolean ShapeFix_IntersectionTool::CutEdge(const TopoDS_Edge &edge, if( !BRep_Tool::SameParameter(edge) ) { ShapeAnalysis_Edge sae; Handle(Geom2d_Curve) Crv; - Standard_Real fp,lp; + Standard_Real fp = NAN,lp = NAN; if ( sae.PCurve(edge,face,Crv,fp,lp,Standard_False) ) { if(Crv->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) { Handle(Geom2d_TrimmedCurve) tc = Handle(Geom2d_TrimmedCurve)::DownCast(Crv); @@ -276,7 +278,7 @@ Standard_Boolean ShapeFix_IntersectionTool::SplitEdge1(const Handle(ShapeExtend_ TopLoc_Location L; const Handle(Geom_Surface)& S = BRep_Tool::Surface(face,L); Handle(Geom2d_Curve) c2d; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; ShapeAnalysis_Edge sae; if(sae.PCurve(newE1,S,L,c2d,cf,cl,Standard_False)) { Bnd_Box2d box; @@ -334,9 +336,9 @@ Standard_Boolean ShapeFix_IntersectionTool::SplitEdge2(const Handle(ShapeExtend_ Standard_Real param = (param1+param2)/2; if(!SplitEdge(edge,param,vert,face,newE1,newE2,preci)) return Standard_False; // cut new edges by param1 and param2 - Standard_Boolean IsCutLine; + Standard_Boolean IsCutLine = 0; Handle(Geom2d_Curve) Crv1, Crv2; - Standard_Real fp1,lp1,fp2,lp2; + Standard_Real fp1 = NAN,lp1 = NAN,fp2 = NAN,lp2 = NAN; ShapeAnalysis_Edge sae; if(sae.PCurve ( newE1, face, Crv1, fp1, lp1, Standard_False )) { if(sae.PCurve ( newE2, face, Crv2, fp2, lp2, Standard_False )) { @@ -385,7 +387,7 @@ Standard_Boolean ShapeFix_IntersectionTool::SplitEdge2(const Handle(ShapeExtend_ TopLoc_Location L; const Handle(Geom_Surface)& S = BRep_Tool::Surface(face,L); Handle(Geom2d_Curve) c2d; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; if(sae.PCurve(newE1,S,L,c2d,cf,cl,Standard_False)) { Bnd_Box2d box; Geom2dAdaptor_Curve gac; @@ -468,7 +470,7 @@ Standard_Boolean ShapeFix_IntersectionTool::UnionVertexes(const Handle(ShapeExte edge2 = NewE; boxes.Bind(NewE,B2); // update boxes // replace vertex in other edge - Standard_Integer num21,num22; + Standard_Integer num21 = 0,num22 = 0; if(num2>1) num21=num2-1; else num21=sewd->NbEdges(); if(num2NbEdges()) num22=num2+1; @@ -532,7 +534,7 @@ Standard_Boolean ShapeFix_IntersectionTool::UnionVertexes(const Handle(ShapeExte //boxes.Bind(NewE,boxes.Find(edge2)); // update boxes boxes.Bind(NewE,B2); // update boxes // replace vertex in other edge - Standard_Integer num21,num22; + Standard_Integer num21 = 0,num22 = 0; if(num2>1) num21=num2-1; else num21=sewd->NbEdges(); if(num2NbEdges()) num22=num2+1; @@ -595,7 +597,7 @@ Standard_Boolean ShapeFix_IntersectionTool::UnionVertexes(const Handle(ShapeExte edge2 = NewE; boxes.Bind(NewE,B2); // update boxes // replace vertex in other edge - Standard_Integer num21,num22; + Standard_Integer num21 = 0,num22 = 0; if(num2>1) num21=num2-1; else num21=sewd->NbEdges(); if(num2NbEdges()) num22=num2+1; @@ -658,7 +660,7 @@ Standard_Boolean ShapeFix_IntersectionTool::UnionVertexes(const Handle(ShapeExte edge2 = NewE; boxes.Bind(NewE,B2); // update boxes // replace vertex in other edge - Standard_Integer num21,num22; + Standard_Integer num21 = 0,num22 = 0; if(num2>1) num21=num2-1; else num21=sewd->NbEdges(); if(num2NbEdges()) num22=num2+1; @@ -722,7 +724,7 @@ static Bnd_Box2d CreateBoxes2d(const Handle(ShapeExtend_WireData)& sewd, TopLoc_Location L; const Handle(Geom_Surface)& S = BRep_Tool::Surface(face,L); Handle(Geom2d_Curve) c2d; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; ShapeAnalysis_Edge sae; for(Standard_Integer i=1; i<=sewd->NbEdges(); i++){ TopoDS_Edge E = sewd->Edge(i); @@ -799,7 +801,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FindVertAndSplitEdge gp_Pnt pi1 = GetPointOnEdge(edge1,sas,Crv1,param1); BRep_Builder B; TopoDS_Vertex V; - Standard_Real tolV; + Standard_Real tolV = NAN; TopoDS_Vertex V1 = sae.FirstVertex(edge2); gp_Pnt PV1 = BRep_Tool::Pnt(V1); TopoDS_Vertex V2 = sae.LastVertex(edge2); @@ -884,7 +886,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire Bnd_Box2d B2 = boxes.Find(edge2); if(!B1.IsOut(B2)) { // intersection is possible... - Standard_Real a1, b1, a2, b2; + Standard_Real a1 = NAN, b1 = NAN, a2 = NAN, b2 = NAN; Handle(Geom2d_Curve) Crv1, Crv2; if( !sae.PCurve(edge1, face, Crv1, a1, b1, Standard_False) ) return Standard_False; if( !sae.PCurve(edge2, face, Crv2, a2, b2, Standard_False) ) return Standard_False; @@ -931,7 +933,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire Standard_Real dista = Abs(a1-param1); Standard_Real distb = Abs(b1-param1); - Standard_Boolean IsCutLine; + Standard_Boolean IsCutLine = 0; ModifE1 = CutEdge(edge1, (( dista > distb ) ? a1 : b1 ), param1, face, IsCutLine); if (ModifE1) NbCut++; @@ -960,7 +962,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire Standard_Real dista = Abs(a2-param2); Standard_Real distb = Abs(b2-param2); - Standard_Boolean IsCutLine; + Standard_Boolean IsCutLine = 0; ModifE2 = CutEdge(edge2, (( dista > distb ) ? a2 : b2 ), param2, face, IsCutLine); if (ModifE2) NbCut++; @@ -1062,7 +1064,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire Standard_Real dist1 = Pnt11.Distance(PV1); Standard_Real dist2 = Pnt12.Distance(PV1); Standard_Real maxdist = Max(dist1,dist2); - Standard_Real pdist; + Standard_Real pdist = NAN; if(edge1.Orientation()==TopAbs_REVERSED) pdist = Max(Abs(b1-p11),Abs(b1-p12)); else @@ -1092,12 +1094,12 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire // cut edge1 and update tolerance NewV Standard_Real dista = Abs(a1-p11)+Abs(a1-p12); Standard_Real distb = Abs(b1-p11)+Abs(b1-p12); - Standard_Real pend,cut; + Standard_Real pend = NAN,cut = NAN; if(dista>distb) pend=a1; else pend=b1; if(Abs(pend-p11)>Abs(pend-p12)) cut=p12; else cut=p11; - Standard_Boolean IsCutLine; + Standard_Boolean IsCutLine = 0; if (CutEdge(edge1, pend, cut, face, IsCutLine)) NbCut++; if(newtol>BRep_Tool::Tolerance(NewV)) { @@ -1145,12 +1147,12 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire // cut edge1 and update tolerance NewV Standard_Real dista = Abs(a2-p21)+Abs(a2-p22); Standard_Real distb = Abs(b2-p21)+Abs(b2-p22); - Standard_Real pend,cut; + Standard_Real pend = NAN,cut = NAN; if(dista>distb) pend=a2; else pend=b2; if(Abs(pend-p21)>Abs(pend-p22)) cut=p22; else cut=p21; - Standard_Boolean IsCutLine; + Standard_Boolean IsCutLine = 0; if (CutEdge(edge2, pend, cut, face, IsCutLine)) NbCut++; if(newtol>BRep_Tool::Tolerance(NewV)) { @@ -1236,7 +1238,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire TopoDS_Edge tmpE,SegE; // split edge1 Standard_Integer akey1=0, akey2=0; - Standard_Real newTolerance; + Standard_Real newTolerance = NAN; // analysis fo P01 newTolerance = Max(tolV1,BRep_Tool::Tolerance(V1)); if(P01.Distance(PV1)Edge(num1); - Standard_Real a,b; + Standard_Real a = NAN,b = NAN; Handle(Geom2d_Curve) c2d; sae.PCurve(tmpE,face,c2d,a,b,Standard_False); if( (a-p12)*(b-p12)>0 ) { // p12 - external for [a,b] => split next edge @@ -1413,7 +1415,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire dnum2=1; } tmpE = sewd->Edge(num2+dnum1); - Standard_Real a,b; + Standard_Real a = NAN,b = NAN; Handle(Geom2d_Curve) c2d; sae.PCurve(tmpE,face,c2d,a,b,Standard_False); if( (a-p22)*(b-p22)>0 ) { // p22 - external for [a,b] => split next edge @@ -1530,7 +1532,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires Bnd_Box2d B2 = boxes2.Find(edge2); if(!B1.IsOut(B2)) { // intersection is possible... - Standard_Real a1, b1, a2, b2; + Standard_Real a1 = NAN, b1 = NAN, a2 = NAN, b2 = NAN; Handle(Geom2d_Curve) Crv1, Crv2; if( !sae.PCurve(edge1, face, Crv1, a1, b1, Standard_False) ) continue; //return Standard_False; gka 06.09.04 @@ -1631,7 +1633,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires Standard_Real dist1 = Pnt11.Distance(PV1); Standard_Real dist2 = Pnt12.Distance(PV1); Standard_Real maxdist = Max(dist1,dist2); - Standard_Real pdist; + Standard_Real pdist = NAN; if(edge1.Orientation()==TopAbs_REVERSED) pdist = Max(Abs(b1-p11),Abs(b1-p12)); else @@ -1659,12 +1661,12 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires // cut edge1 and update tolerance NewV Standard_Real dista = Abs(a1-p11)+Abs(a1-p12); Standard_Real distb = Abs(b1-p11)+Abs(b1-p12); - Standard_Real pend,cut; + Standard_Real pend = NAN,cut = NAN; if(dista>distb) pend=a1; else pend=b1; if(Abs(pend-p11)>Abs(pend-p12)) cut=p12; else cut=p11; - Standard_Boolean IsCutLine; + Standard_Boolean IsCutLine = 0; if(!CutEdge(edge1, pend, cut, face, IsCutLine)) { IsModified1 = Standard_False; @@ -1710,12 +1712,12 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires // cut edge1 and update tolerance NewV Standard_Real dista = Abs(a2-p21)+Abs(a2-p22); Standard_Real distb = Abs(b2-p21)+Abs(b2-p22); - Standard_Real pend,cut; + Standard_Real pend = NAN,cut = NAN; if(dista>distb) pend=a2; else pend=b2; if(Abs(pend-p21)>Abs(pend-p22)) cut=p22; else cut=p21; - Standard_Boolean IsCutLine; + Standard_Boolean IsCutLine = 0; if(!CutEdge(edge2, pend, cut, face, IsCutLine)) { IsModified2 = Standard_False; @@ -1802,7 +1804,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires if(SplitEdge1(sewd1, face, num1, p11, NewV1, tolV1, boxes1)) { NbModif++; tmpE = sewd1->Edge (num1); - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle (Geom2d_Curve) c2d; sae.PCurve (tmpE, face, c2d, a, b, Standard_False); if ((a - p12)*(b - p12) > 0) @@ -1885,7 +1887,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires NbModif++; numseg2=num2+1; tmpE = sewd2->Edge (num2); - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle (Geom2d_Curve) c2d; sae.PCurve (tmpE, face, c2d, a, b, Standard_False); if ((a - p22)*(b - p22) > 0) @@ -1974,7 +1976,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires B.Add(newface,wire); } for(i=1 ; i<=SeqNMShapes.Length(); i++) { - TopoDS_Shape aNMS = SeqNMShapes.Value(i); + const TopoDS_Shape& aNMS = SeqNMShapes.Value(i); B.Add(newface,aNMS); } newface.Orientation(ori); diff --git a/src/ShapeFix/ShapeFix_Root.cxx b/src/ShapeFix/ShapeFix_Root.cxx index 5794c9b309..18be53084c 100644 --- a/src/ShapeFix/ShapeFix_Root.cxx +++ b/src/ShapeFix/ShapeFix_Root.cxx @@ -24,10 +24,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_Root,Standard_Transient) //function : ShapeFix_Root //purpose : //======================================================================= -ShapeFix_Root::ShapeFix_Root() +ShapeFix_Root::ShapeFix_Root() : myMsgReg(new ShapeExtend_BasicMsgRegistrator) { myPrecision = myMinTol = myMaxTol = Precision::Confusion(); - myMsgReg = new ShapeExtend_BasicMsgRegistrator; + } //======================================================================= diff --git a/src/ShapeFix/ShapeFix_Shape.cxx b/src/ShapeFix/ShapeFix_Shape.cxx index 1e45f0b469..391b366acd 100644 --- a/src/ShapeFix/ShapeFix_Shape.cxx +++ b/src/ShapeFix/ShapeFix_Shape.cxx @@ -39,17 +39,17 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_Shape,ShapeFix_Root) //function : ShapeFix_Shape //purpose : //======================================================================= -ShapeFix_Shape::ShapeFix_Shape() +ShapeFix_Shape::ShapeFix_Shape() : myFixSolid(new ShapeFix_Solid), myFixSolidMode(-1), myFixShellMode(-1), myFixFaceMode(-1), myFixWireMode(-1), myFixSameParameterMode(-1), myFixVertexPositionMode(0), myFixVertexTolMode(-1), myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK)) { - myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); - myFixSolidMode = -1; - myFixShellMode = -1; - myFixFaceMode = -1; - myFixWireMode = -1; - myFixSameParameterMode = -1; - myFixVertexPositionMode =0; - myFixVertexTolMode = -1; - myFixSolid = new ShapeFix_Solid; + + + + + + + + + } //======================================================================= @@ -57,17 +57,17 @@ ShapeFix_Shape::ShapeFix_Shape() //purpose : //======================================================================= -ShapeFix_Shape::ShapeFix_Shape(const TopoDS_Shape& shape) +ShapeFix_Shape::ShapeFix_Shape(const TopoDS_Shape& shape) : myFixSolid(new ShapeFix_Solid), myFixSolidMode(-1), myFixShellMode(-1), myFixFaceMode(-1), myFixWireMode(-1), myFixSameParameterMode(-1), myFixVertexPositionMode(0), myFixVertexTolMode(-1), myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK)) { - myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); - myFixSolidMode = -1; - myFixShellMode = -1; - myFixFaceMode = -1; - myFixWireMode = -1; - myFixSameParameterMode = -1; - myFixSolid = new ShapeFix_Solid; - myFixVertexPositionMode =0; - myFixVertexTolMode = -1; + + + + + + + + + Init(shape); } diff --git a/src/ShapeFix/ShapeFix_ShapeTolerance.cxx b/src/ShapeFix/ShapeFix_ShapeTolerance.cxx index 7e10589d81..36749f5984 100644 --- a/src/ShapeFix/ShapeFix_ShapeTolerance.cxx +++ b/src/ShapeFix/ShapeFix_ShapeTolerance.cxx @@ -13,6 +13,8 @@ // 25.12.98 pdn: adding empty constructor +#include + #include #include #include @@ -46,7 +48,7 @@ Standard_Boolean ShapeFix_ShapeTolerance::LimitTolerance(const TopoDS_Shape& sha { if (shape.IsNull() || tmin < 0) return Standard_False; Standard_Boolean iamax = (tmax >= tmin); - Standard_Real prec; + Standard_Real prec = NAN; Standard_Boolean fait = Standard_False; if (styp == TopAbs_VERTEX || styp == TopAbs_EDGE || styp == TopAbs_FACE) { for (TopExp_Explorer ex(shape,styp); ex.More(); ex.Next()) { diff --git a/src/ShapeFix/ShapeFix_Shell.cxx b/src/ShapeFix/ShapeFix_Shell.cxx index fe2ba6e754..ecce75d9cb 100644 --- a/src/ShapeFix/ShapeFix_Shell.cxx +++ b/src/ShapeFix/ShapeFix_Shell.cxx @@ -16,6 +16,8 @@ // pdn 17.12.98 ie_exhaust-A.stp +#include + #include #include #include @@ -54,14 +56,14 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_Shell,ShapeFix_Root) //function : ShapeFix_Shell //purpose : //======================================================================= -ShapeFix_Shell::ShapeFix_Shell() +ShapeFix_Shell::ShapeFix_Shell() : myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK)), myFixFaceMode(-1), myFixOrientationMode(-1), myFixFace(new ShapeFix_Face), myNbShells(0), myNonManifold(Standard_False) { - myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); - myFixFaceMode = -1; - myFixOrientationMode = -1; - myFixFace = new ShapeFix_Face; - myNbShells =0; - myNonManifold = Standard_False; + + + + + + } //======================================================================= @@ -69,14 +71,14 @@ ShapeFix_Shell::ShapeFix_Shell() //purpose : //======================================================================= -ShapeFix_Shell::ShapeFix_Shell(const TopoDS_Shell& shape) +ShapeFix_Shell::ShapeFix_Shell(const TopoDS_Shell& shape) : myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK)), myFixFaceMode(-1), myFixOrientationMode(-1), myFixFace(new ShapeFix_Face), myNonManifold(Standard_False) { - myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); - myFixFaceMode = -1; - myFixOrientationMode = -1; - myFixFace = new ShapeFix_Face; + + + + Init(shape); - myNonManifold = Standard_False; + } //======================================================================= @@ -339,7 +341,7 @@ static Standard_Boolean AddMultiConexityFaces(TopTools_SequenceOfShape& Lface, TopTools_SequenceOfShape AddShapes; for(Standard_Integer i1 = 1 ; i1<=Lface.Length();i1++ ) { - TopoDS_Shape aShape = Lface.Value(i1); + const TopoDS_Shape& aShape = Lface.Value(i1); Standard_Integer aNbMultEdges =0; @@ -347,7 +349,7 @@ static Standard_Boolean AddMultiConexityFaces(TopTools_SequenceOfShape& Lface, for(TopoDS_Iterator aItWires(aShape,Standard_False); aItWires.More(); aItWires.Next()) { Standard_Integer aNbEdges =0; for(TopoDS_Iterator aItEdges(aItWires.Value(),Standard_False); aItEdges.More(); aItEdges.Next(),aNbEdges++) { - TopoDS_Shape edge = aItEdges.Value(); + const TopoDS_Shape& edge = aItEdges.Value(); if(!aMapMultiConnectEdges.Contains(edge)) continue; aNbMultEdges++; } @@ -367,7 +369,7 @@ static Standard_Boolean AddMultiConexityFaces(TopTools_SequenceOfShape& Lface, TopTools_DataMapOfShapeShape aTmpFaceShell; if(GetShells(llPosibleShells,aMap,aTmpShells,aTmpFaceShell,aTmp)) { for(Standard_Integer kk =1; kk <= aTmpShells.Length(); kk++) { - TopoDS_Shape aSh = aTmpShells.Value(kk); + const TopoDS_Shape& aSh = aTmpShells.Value(kk); TopTools_MapOfShape mapEdges; if(GetFreeEdges(aSh,mapEdges)) { Standard_Integer nbedge =0; @@ -386,7 +388,7 @@ static Standard_Boolean AddMultiConexityFaces(TopTools_SequenceOfShape& Lface, for(Standard_Integer k1 =1; k1 <= AddShapes.Length(); k1++) { TopTools_DataMapOfShapeInteger MapOtherShells; TopTools_MapOfShape dire,reve; - TopoDS_Shape aSh = AddShapes.Value(k1); + const TopoDS_Shape& aSh = AddShapes.Value(k1); TopTools_MapOfShape mapEdges; if(!GetFreeEdges(aSh,mapEdges)) continue; TopTools_ListOfShape lfaces; @@ -498,7 +500,7 @@ static Standard_Boolean AddMultiConexityFaces(TopTools_SequenceOfShape& Lface, static Standard_Integer BoxIn(const Bnd_Box& theBox1,const Bnd_Box& theBox2) { Standard_Integer aNumIn = 0; - Standard_Real aXmin1,aYmin1,aXmax1,aYmax1,aXmin2,aYmin2,aXmax2,aYmax2,aZmin1,aZmax1,aZmin2,aZmax2; + Standard_Real aXmin1 = NAN,aYmin1 = NAN,aXmax1 = NAN,aYmax1 = NAN,aXmin2 = NAN,aYmin2 = NAN,aXmax2 = NAN,aYmax2 = NAN,aZmin1 = NAN,aZmax1 = NAN,aZmin2 = NAN,aZmax2 = NAN; theBox1.Get(aXmin1,aYmin1,aZmin1,aXmax1,aYmax1,aZmax1); theBox2.Get(aXmin2,aYmin2,aZmin2,aXmax2,aYmax2,aZmax2); if(aXmin1 == aXmin2 && aXmax1 == aXmax2 && aYmin1 == aYmin2 && aYmax1 == aYmax2 && @@ -573,7 +575,7 @@ static void GlueClosedCandidate(TopTools_SequenceOfShape& OpenShells, Standard_Boolean isReversed = Standard_False; Standard_Integer nbedge =0; TopTools_MapOfShape mapEdges2; - TopoDS_Shape aShell2 = OpenShells.Value(j); + const TopoDS_Shape& aShell2 = OpenShells.Value(j); if(!GetFreeEdges(aShell2,mapEdges2)) continue; for(TopTools_MapIteratorOfMapOfShape aIte2( mapEdges2);aIte2.More() && isAddShell;aIte2.Next()) { TopoDS_Edge edge2 = TopoDS::Edge(aIte2.Key()); @@ -675,13 +677,13 @@ static void CreateNonManifoldShells(TopTools_SequenceOfShape& SeqShells, { TopTools_IndexedDataMapOfShapeListOfShape aMap; for(Standard_Integer i =1 ; i <= SeqShells.Length(); i++) { - TopoDS_Shape aShell = SeqShells.Value(i); + const TopoDS_Shape& aShell = SeqShells.Value(i); TopTools_IndexedMapOfShape medeg; TopExp::MapShapes(aShell,TopAbs_EDGE,medeg); for(TopTools_MapIteratorOfMapOfShape mit(aMapMultiConnectEdges); mit.More(); mit.Next()) { //for(TopExp_Explorer aExp(aShell,TopAbs_EDGE); aExp.More(); aExp.Next(),nbe++) { //TopoDS_Shape ae = aExp.Current(); - TopoDS_Shape ae =mit.Key(); + const TopoDS_Shape& ae =mit.Key(); //if( aMapMultiConnectEdges.Contains(aExp.Current())) { if(medeg.Contains(ae)) { if(aMap.Contains(ae)) @@ -714,7 +716,7 @@ static void CreateNonManifoldShells(TopTools_SequenceOfShape& SeqShells, else if(ismerged) { TopoDS_Shape arshell = aMapShells.FindFromKey(alit.Value()); while(aMapShells.Contains(arshell)){ - TopoDS_Shape ss = aMapShells.FindFromKey(arshell); + const TopoDS_Shape& ss = aMapShells.FindFromKey(arshell); if(ss.IsSame(arshell)) break; arshell = ss; } @@ -729,7 +731,7 @@ static void CreateNonManifoldShells(TopTools_SequenceOfShape& SeqShells, else { TopoDS_Shape arshell = aMapShells.FindFromKey(alit.Value()); while(aMapShells.Contains(arshell)) { - TopoDS_Shape ss = aMapShells.FindFromKey(arshell); + const TopoDS_Shape& ss = aMapShells.FindFromKey(arshell); if(ss.IsSame(arshell)) break; arshell = ss; } @@ -749,7 +751,7 @@ static void CreateNonManifoldShells(TopTools_SequenceOfShape& SeqShells, } if(mapmerge.Extent() >1 || ismerged) { for(TopTools_MapIteratorOfMapOfShape alit1(mapmerge); alit1.More();alit1.Next()) { - TopoDS_Shape oldShell = alit1.Key(); + const TopoDS_Shape& oldShell = alit1.Key(); //while(aMapShells.Contains(oldShell)) { // TopoDS_Shape ss = aMapShells.FindFromKey(oldShell); // if(ss.IsSame(oldShell)) break; @@ -764,7 +766,7 @@ static void CreateNonManifoldShells(TopTools_SequenceOfShape& SeqShells, if(aMapShells.Contains(SeqShells.Value(nn))) { TopoDS_Shape aNewShell = aMapShells.FindFromKey(SeqShells.Value(nn)); while(aMapShells.Contains(aNewShell)) { - TopoDS_Shape ss = aMapShells.FindFromKey(aNewShell); + const TopoDS_Shape& ss = aMapShells.FindFromKey(aNewShell); if(ss.IsSame(aNewShell)) break; aNewShell = ss; } diff --git a/src/ShapeFix/ShapeFix_Shell.hxx b/src/ShapeFix/ShapeFix_Shell.hxx index 4942e07c35..29ac7573ba 100644 --- a/src/ShapeFix/ShapeFix_Shell.hxx +++ b/src/ShapeFix/ShapeFix_Shell.hxx @@ -132,7 +132,7 @@ protected: Handle(ShapeFix_Face) myFixFace; Standard_Integer myFixFaceMode; Standard_Integer myFixOrientationMode; - Standard_Integer myNbShells; + Standard_Integer myNbShells{}; Standard_Boolean myNonManifold; private: diff --git a/src/ShapeFix/ShapeFix_Solid.cxx b/src/ShapeFix/ShapeFix_Solid.cxx index 7a553995b5..6a9df82dc4 100644 --- a/src/ShapeFix/ShapeFix_Solid.cxx +++ b/src/ShapeFix/ShapeFix_Solid.cxx @@ -52,13 +52,13 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_Solid,ShapeFix_Root) //function : ShapeFix_Solid //purpose : //======================================================================= -ShapeFix_Solid::ShapeFix_Solid() +ShapeFix_Solid::ShapeFix_Solid() : myFixShell(new ShapeFix_Shell), myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK)), myFixShellMode(-1), myFixShellOrientationMode(-1), myCreateOpenSolidMode(Standard_False) { - myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); - myFixShellMode = -1; - myFixShellOrientationMode = -1; - myFixShell = new ShapeFix_Shell; - myCreateOpenSolidMode = Standard_False; + + + + + } //======================================================================= @@ -66,13 +66,13 @@ ShapeFix_Solid::ShapeFix_Solid() //purpose : //======================================================================= -ShapeFix_Solid::ShapeFix_Solid(const TopoDS_Solid& solid) +ShapeFix_Solid::ShapeFix_Solid(const TopoDS_Solid& solid) : myFixShell(new ShapeFix_Shell), myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK)), myFixShellMode(-1), myFixShellOrientationMode(-1), myCreateOpenSolidMode(Standard_False) { - myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); - myFixShellMode = -1; - myFixShellOrientationMode = -1; - myFixShell = new ShapeFix_Shell; - myCreateOpenSolidMode = Standard_False; + + + + + Init(solid); } @@ -167,7 +167,7 @@ static void CollectSolids(const TopTools_SequenceOfShape& aSeqShells , if(!st) continue; for ( Standard_Integer j = 1; j <= aSeqShells.Length(); j++ ) { if(i==j) continue; - TopoDS_Shape aShell2 = aSeqShells.Value(j); + const TopoDS_Shape& aShell2 = aSeqShells.Value(j); if(!BRep_Tool::IsClosed(aShell2)) continue; if(aMapHoles.Contains(aShell2)) continue; if(aMapShellHoles.IsBound(aShell2)) { @@ -245,7 +245,7 @@ static void CollectSolids(const TopTools_SequenceOfShape& aSeqShells , //purpose : //======================================================================= -static Standard_Boolean CreateSolids(const TopoDS_Shape theShape,TopTools_IndexedMapOfShape& aMapSolids) +static Standard_Boolean CreateSolids(const TopoDS_Shape& theShape,TopTools_IndexedMapOfShape& aMapSolids) { TopTools_SequenceOfShape aSeqShells; Standard_Boolean isDone = Standard_False; @@ -432,8 +432,8 @@ Standard_Boolean ShapeFix_Solid::Perform(const Message_ProgressRange& theProgres if(aExp.More()) { TopoDS_Shell aShtmp = TopoDS::Shell(aExp.Current()); ShapeAnalysis_FreeBounds sfb(aShtmp); - TopoDS_Compound aC1 = sfb.GetClosedWires(); - TopoDS_Compound aC2 = sfb.GetOpenWires(); + const TopoDS_Compound& aC1 = sfb.GetClosedWires(); + const TopoDS_Compound& aC2 = sfb.GetOpenWires(); Standard_Integer numedge =0; TopExp_Explorer aExp1(aC1,TopAbs_EDGE); for( ; aExp1.More(); aExp1.Next()) @@ -474,7 +474,7 @@ Standard_Boolean ShapeFix_Solid::Perform(const Message_ProgressRange& theProgres if(CreateSolids(aResShape,aMapSolids)) { SendWarning (Message_Msg ("FixAdvSolid.FixOrientation.MSG20"));// Orientation of shell was corrected.. if(aMapSolids.Extent() ==1) { - TopoDS_Shape aResSol = aMapSolids.FindKey(1); + const TopoDS_Shape& aResSol = aMapSolids.FindKey(1); if(aResShape.ShapeType() == TopAbs_SHELL && myCreateOpenSolidMode) { TopoDS_Solid solid; BRep_Builder B; diff --git a/src/ShapeFix/ShapeFix_SplitCommonVertex.cxx b/src/ShapeFix/ShapeFix_SplitCommonVertex.cxx index b2dd1d72fa..755fa36dfe 100644 --- a/src/ShapeFix/ShapeFix_SplitCommonVertex.cxx +++ b/src/ShapeFix/ShapeFix_SplitCommonVertex.cxx @@ -40,9 +40,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_SplitCommonVertex,ShapeFix_Root) //function : ShapeFix_SplitCommonVertex //purpose : //======================================================================= -ShapeFix_SplitCommonVertex::ShapeFix_SplitCommonVertex() +ShapeFix_SplitCommonVertex::ShapeFix_SplitCommonVertex() : myStatus(ShapeExtend::EncodeStatus ( ShapeExtend_OK )) { - myStatus = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); + SetPrecision(Precision::Confusion()); } diff --git a/src/ShapeFix/ShapeFix_SplitTool.cxx b/src/ShapeFix/ShapeFix_SplitTool.cxx index b50cdebdd0..88624ad2c4 100644 --- a/src/ShapeFix/ShapeFix_SplitTool.cxx +++ b/src/ShapeFix/ShapeFix_SplitTool.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -61,7 +63,7 @@ Standard_Boolean ShapeFix_SplitTool::SplitEdge(const TopoDS_Edge& edge, const Standard_Real tol3d, const Standard_Real tol2d) const { - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; ShapeAnalysis_Edge sae; Handle(Geom2d_Curve) c2d; sae.PCurve(edge,face,c2d,a,b,Standard_True ); @@ -71,7 +73,7 @@ Standard_Boolean ShapeFix_SplitTool::SplitEdge(const TopoDS_Edge& edge, gp_Pnt P1; TopLoc_Location L; if(BRep_Tool::SameParameter(edge)) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; const Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,L,f,l); if(c3d.IsNull()) return Standard_False; @@ -95,7 +97,7 @@ Standard_Boolean ShapeFix_SplitTool::SplitEdge(const TopoDS_Edge& edge, new ShapeAnalysis_TransferParametersProj; transferParameters->SetMaxTolerance(tol3d); transferParameters->Init(edge,face); - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; if (a < b ) { first = a; last = b; @@ -154,9 +156,9 @@ Standard_Boolean ShapeFix_SplitTool::SplitEdge(const TopoDS_Edge& edge, Standard_Real param = (param1+param2)/2; if(SplitEdge(edge,param,vert,face,newE1,newE2,tol3d,tol2d)) { // cut new edges by param1 and param2 - Standard_Boolean IsCutLine; + Standard_Boolean IsCutLine = 0; Handle(Geom2d_Curve) Crv1, Crv2; - Standard_Real fp1,lp1,fp2,lp2; + Standard_Real fp1 = NAN,lp1 = NAN,fp2 = NAN,lp2 = NAN; ShapeAnalysis_Edge sae; if(sae.PCurve ( newE1, face, Crv1, fp1, lp1, Standard_False )) { if(sae.PCurve ( newE2, face, Crv2, fp2, lp2, Standard_False )) { @@ -201,7 +203,7 @@ Standard_Boolean ShapeFix_SplitTool::CutEdge(const TopoDS_Edge &edge, { if( Abs(cut-pend)<10.*Precision::PConfusion() ) return Standard_False; Standard_Real aRange = Abs(cut-pend); - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; BRep_Tool::Range(edge, a, b); iscutline = Standard_False; if( aRange<10.*Precision::PConfusion() ) return Standard_False; @@ -210,7 +212,7 @@ Standard_Boolean ShapeFix_SplitTool::CutEdge(const TopoDS_Edge &edge, if( !BRep_Tool::SameParameter(edge) ) { ShapeAnalysis_Edge sae; Handle(Geom2d_Curve) Crv; - Standard_Real fp,lp; + Standard_Real fp = NAN,lp = NAN; if ( sae.PCurve(edge,face,Crv,fp,lp,Standard_False) ) { if(Crv->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) { Handle(Geom2d_TrimmedCurve) tc = Handle(Geom2d_TrimmedCurve)::DownCast(Crv); @@ -291,7 +293,7 @@ Standard_Boolean ShapeFix_SplitTool::SplitEdge(const TopoDS_Edge& edge, aNum = 0; SeqE.Clear(); BRep_Builder B; - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; ShapeAnalysis_Edge sae; Handle(Geom2d_Curve) c2d; sae.PCurve(edge,face,c2d,a,b,Standard_True); @@ -306,7 +308,7 @@ Standard_Boolean ShapeFix_SplitTool::SplitEdge(const TopoDS_Edge& edge, gp_Pnt PV1 = BRep_Tool::Pnt(V1); gp_Pnt PV2 = BRep_Tool::Pnt(V2); - Standard_Real par1,par2; + Standard_Real par1 = NAN,par2 = NAN; Standard_Boolean IsReverse = Standard_False; if( (b-a)*(lp-fp)>0 ) { par1 = fp; diff --git a/src/ShapeFix/ShapeFix_Wire.cxx b/src/ShapeFix/ShapeFix_Wire.cxx index f03fd76f01..8a2d848fad 100644 --- a/src/ShapeFix/ShapeFix_Wire.cxx +++ b/src/ShapeFix/ShapeFix_Wire.cxx @@ -43,6 +43,8 @@ // one pcurve we make replace pcurve) // PTV 26.06.2002 Remove regressions after fix OCC450 +#include + #include #include @@ -117,13 +119,13 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_Wire,ShapeFix_Root) //function : ShapeFix_Wire //purpose : //======================================================================= -ShapeFix_Wire::ShapeFix_Wire() : myMaxTailAngleSine(0), myMaxTailWidth(-1) +ShapeFix_Wire::ShapeFix_Wire() : myFixEdge(new ShapeFix_Edge), myAnalyzer(new ShapeAnalysis_Wire), myStatusRemovedSegment(Standard_False), myMaxTailAngleSine(0), myMaxTailWidth(-1) { - myFixEdge = new ShapeFix_Edge; - myAnalyzer = new ShapeAnalysis_Wire; + + ClearModes(); ClearStatuses(); - myStatusRemovedSegment = Standard_False; + } //======================================================================= @@ -134,13 +136,13 @@ ShapeFix_Wire::ShapeFix_Wire() : myMaxTailAngleSine(0), myMaxTailWidth(-1) ShapeFix_Wire::ShapeFix_Wire ( const TopoDS_Wire& wire, const TopoDS_Face &face, - const Standard_Real prec) : myMaxTailAngleSine(0), myMaxTailWidth(-1) + const Standard_Real prec) : myFixEdge(new ShapeFix_Edge), myAnalyzer(new ShapeAnalysis_Wire), myStatusRemovedSegment(Standard_False), myMaxTailAngleSine(0), myMaxTailWidth(-1) { - myFixEdge = new ShapeFix_Edge; - myAnalyzer = new ShapeAnalysis_Wire; + + ClearModes(); SetMaxTolerance ( prec ); - myStatusRemovedSegment = Standard_False; + Init ( wire, face, prec ); } @@ -524,7 +526,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() Standard_Boolean isReady = IsReady(); Handle(ShapeExtend_WireData) sbwd = WireData(); - Standard_Integer i, nb = sbwd->NbEdges(); + Standard_Integer i = 0, nb = sbwd->NbEdges(); TopoDS_Face face = Face(); Handle(ShapeFix_Edge) theAdvFixEdge = myFixEdge; if (theAdvFixEdge.IsNull()) myFixReversed2dMode = Standard_False; @@ -569,23 +571,23 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() ShapeBuild_Edge sbe; TopoDS_Edge E = sbwd->Edge ( i ); ShapeAnalysis_Curve SAC; - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle(Geom_Curve) C = BRep_Tool::Curve ( E, a, b ); Handle(ShapeAnalysis_Surface) S = myAnalyzer->Surface(); Standard_Integer nbs = S->NbSingularities(MinTolerance()); GeomAdaptor_Curve GAC ( C, a, b ); TColStd_SequenceOfReal seq; for (Standard_Integer j=1; j <= nbs; j++) { - Standard_Real Preci; + Standard_Real Preci = NAN; gp_Pnt2d pd1, pd2; gp_Pnt P3d, pr; - Standard_Real par1, par2, split; - Standard_Boolean tmpUIsoDeg; + Standard_Real par1 = NAN, par2 = NAN, split = NAN; + Standard_Boolean tmpUIsoDeg = 0; S->Singularity (j, Preci, P3d, pd1, pd2, par1, par2, tmpUIsoDeg); if ( SAC.Project ( GAC, P3d, MinTolerance(), pr, split, Standard_True ) < Max(Preci,MinTolerance()) ) { if ( split - a > ::Precision::PConfusion() && b - split > ::Precision::PConfusion() ) { - Standard_Integer k; + Standard_Integer k = 0; for ( k=1; k <= seq.Length(); k++ ) { if ( split < seq(k)-::Precision::PConfusion() ) { seq.InsertBefore ( k, split ); @@ -614,7 +616,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() else { if(sae.HasPCurve(E,face)) { Handle(Geom2d_Curve) C2d; - Standard_Real fp2d,lp2d; + Standard_Real fp2d = NAN,lp2d = NAN; if(sae.PCurve(E,face,C2d,fp2d,lp2d)) { if( !C2d->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)) ) sbe.RemovePCurve(E,face); @@ -696,14 +698,14 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() //:c0 abv 20 Feb 98: treat case of curve going over degenerated pole and seam if ( overdegen && myAnalyzer->Surface()->IsUClosed(Precision()) ) { ShapeBuild_Edge sbe; - Standard_Real URange, SUF, SUL, SVF, SVL; + Standard_Real URange = NAN, SUF = NAN, SUL = NAN, SVF = NAN, SVL = NAN; myAnalyzer->Surface()->Bounds(SUF, SUL, SVF, SVL); URange = (Abs(SUL - SUF)); gp_XY vec(0,0); ShapeAnalysis_Edge sae; - Standard_Integer k; + Standard_Integer k = 0; for ( k = 1; k <= nb; k++) { - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) c2d; if ( ! sae.PCurve ( sbwd->Edge(k), face, c2d, cf, cl, Standard_True ) ) break; vec += c2d->Value(cl).XY() - c2d->Value(cf).XY(); @@ -787,11 +789,11 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() for ( i=1; i <= nb; i++ ) { // skl 28.10.2004 for OCC6366 - check SameRange ShapeAnalysis_Edge sae; - Standard_Real First, Last; + Standard_Real First = NAN, Last = NAN; Handle(Geom_Curve) tmpc3d = BRep_Tool::Curve(sbwd->Edge(i), First, Last); if(sae.HasPCurve(sbwd->Edge(i),face)) { Handle(Geom2d_Curve) C2d; - Standard_Real fp2d,lp2d; + Standard_Real fp2d = NAN,lp2d = NAN; if(sae.PCurve(sbwd->Edge(i),face,C2d,fp2d,lp2d, Standard_False)) { if( fabs(First-fp2d)>Precision::PConfusion() || fabs(Last-lp2d)>Precision::PConfusion() ) @@ -1117,7 +1119,7 @@ Standard_Boolean ShapeFix_Wire::FixReorder (const ShapeAnalysis_WireOrder& wi) } Handle(ShapeExtend_WireData) sbwd = WireData(); - Standard_Integer i, nb = sbwd->NbEdges(); + Standard_Integer i = 0, nb = sbwd->NbEdges(); if ( nb != wi.NbEdges() ) { myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL2 ); return Standard_False; @@ -1311,7 +1313,7 @@ Standard_Boolean ShapeFix_Wire::FixSeam (const Standard_Integer num) if ( ! IsReady() ) return Standard_False; Handle(Geom2d_Curve) C1, C2; - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; if ( ! myAnalyzer->CheckSeam (num, C1, C2, cf, cl) ) return Standard_False; BRep_Builder B; @@ -1338,7 +1340,7 @@ Standard_Boolean ShapeFix_Wire::FixSeam (const Standard_Integer num) //:p4 abv 23.02.99: PRO9234 #15720: update UV points of edge static void UpdateEdgeUVPoints (TopoDS_Edge &E, const TopoDS_Face &F) { - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; BRep_Tool::Range ( E, F, first, last ); BRep_Builder().Range ( E, F, first, last ); } @@ -1386,9 +1388,9 @@ Standard_Boolean ShapeFix_Wire::FixShifted() // PTV 26.06.2002 end if ( ! uclosed && ! vclosed ) return Standard_False; - Standard_Real URange, /*VRange,*/ SUF, SUL, SVF, SVL; + Standard_Real URange = NAN, /*VRange,*/ SUF = NAN, SUL = NAN, SVF = NAN, SVL = NAN; surf->Surface()->Bounds ( SUF, SUL, SVF, SVL ); - Standard_Real SUMid, SVMid; + Standard_Real SUMid = NAN, SVMid = NAN; SUMid = 0.5*(SUF+SUL); SVMid = 0.5*(SVF+SVL); if (uclosed) URange = Abs ( SUL - SUF ); @@ -1451,7 +1453,7 @@ Standard_Boolean ShapeFix_Wire::FixShifted() // Standard_Boolean isDeg = surf->IsDegenerated ( p, Max ( Precision(), BRep_Tool::Tolerance(V) ) ); Standard_Integer isDeg = 0; gp_Pnt2d degP1, degP2; - Standard_Real degT1, degT2; + Standard_Real degT1 = NAN, degT2 = NAN; if ( surf->DegeneratedValues ( p, Max ( Precision(), BRep_Tool::Tolerance(V) ), degP1, degP2, degT1, degT2 ) ) isDeg = ( Abs ( degP1.X() - degP2.X() ) > Abs ( degP1.Y() - degP2.Y() ) ? 1 : 2 ); @@ -1514,7 +1516,7 @@ Standard_Boolean ShapeFix_Wire::FixShifted() gp_Pnt2d pn1 = c2d1->Value ( b1 ); gp_Pnt2d pn2 = c2d2->Value ( a2 ); gp_Vec2d x(0.,0.); // shift vector - Standard_Real period; + Standard_Real period = NAN; if ( uclosed ) { x.SetX ( 1. ); period = URange; } else { x.SetY ( 1. ); period = VRange; } Standard_Real rot1 = ( pn1.XY() - pd2.XY() ) ^ x.XY(); @@ -1643,16 +1645,16 @@ Standard_Boolean ShapeFix_Wire::FixShifted() } if ( box.IsVoid() ) return Standard_False; //#3 smh 01.04.99. S4163: Overflow, when box is void. - Standard_Real umin, vmin, umax, vmax; + Standard_Real umin = NAN, vmin = NAN, umax = NAN, vmax = NAN; box.Get ( umin, vmin, umax, vmax ); if ( Abs ( umin + umax - SUF - SUL ) < URange && Abs ( vmin + vmax - SVF - SVL ) < VRange && ! LastFixStatus ( ShapeExtend_DONE ) ) return Standard_False; box.SetVoid(); - Standard_Integer n; // svv Jan11 2000 : porting on DEC + Standard_Integer n = 0; // svv Jan11 2000 : porting on DEC for ( n=1; n <= nb; n++ ) { - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle(Geom2d_Curve) c2d; if ( ! sae.PCurve ( sbwd->Edge(n), Face(), c2d, a, b, Standard_True ) ) continue; box.Add ( c2d->Value ( a ) ); @@ -1683,7 +1685,7 @@ Standard_Boolean ShapeFix_Wire::FixShifted() Shift.SetTranslation ( gp_Vec2d ( du, dv ) ); for ( n=1; n <= sbwdOring->NbEdges(); n++ ) { - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle(Geom2d_Curve) c2d; TopoDS_Edge ed = sbwdOring->Edge(n); if ( ! sae.PCurve ( ed, Face(), c2d, a, b, Standard_True ) ) continue; @@ -1780,7 +1782,7 @@ static Standard_Boolean TryNewPCurve (const TopoDS_Edge &E, const TopoDS_Face &f Standard_Real &last, Standard_Real &tol) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) crv = BRep_Tool::Curve ( E, f, l ); if ( crv.IsNull() ) return Standard_False; @@ -1843,10 +1845,10 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face, const Standard_Real prec, const Standard_Boolean RemoveLoop3d) { - Standard_Boolean loopRemoved3d; + Standard_Boolean loopRemoved3d = 0; if ( BRep_Tool::IsClosed ( E, face ) ) return Standard_False; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) crv = BRep_Tool::Curve ( E, f, l ); Standard_Real t1 = IP.ParamOnFirst(); @@ -1854,7 +1856,7 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face, if ( t1 > t2 ) { Standard_Real t = t1; t1 = t2; t2 = t; } ShapeAnalysis_Edge sae; - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle(Geom2d_Curve) c2d; if ( ! sae.PCurve ( E, face, c2d, a, b, Standard_False ) ) return Standard_False; @@ -1976,7 +1978,7 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face, Standard_Real dist1 = pcurPnt.Distance(crv->Value(Seq3d->Value(1)));// correting Seq3d already project Standard_Real dist2 = pcurPnt.Distance(crv->Value(Seq3d->Value(2))); Standard_Real dist3 = pcurPnt.Distance(crv->Value(Seq3d->Value(3))); - Standard_Real ftrim,ltrim; + Standard_Real ftrim = NAN,ltrim = NAN; if(dist3>Max(dist1,dist2)) { loopRemoved3d = Standard_False; } @@ -2051,7 +2053,7 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face, if ( BRep_Tool::IsClosed ( E, face ) ) return Standard_False; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) crv = BRep_Tool::Curve ( E, f, l ); Standard_Real t1 = IP2d.ParamOnFirst(); @@ -2071,7 +2073,7 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face, Vlast = sae.LastVertex(E); // find a 2d curve and parameters from edge E - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; Handle (Geom2d_Curve) c2d; if ( ! sae.PCurve ( E, face, c2d, a, b, Standard_False ) ) return Standard_False; @@ -2108,7 +2110,7 @@ static Standard_Boolean RemoveLoop (TopoDS_Edge &E, const TopoDS_Face &face, Standard_Real dist1 = pcurPnt.Distance(crv->Value(Seq3d->Value(1)));// correting Seq3d already project Standard_Real dist2 = pcurPnt.Distance(crv->Value(Seq3d->Value(2))); Standard_Real dist3 = pcurPnt.Distance(crv->Value(Seq3d->Value(3))); - Standard_Real ftrim,ltrim; + Standard_Real ftrim = NAN,ltrim = NAN; if ( dist3 > Max(dist1, dist2)) { // is loop in 3d ftrim = Seq3d->Value(1); ltrim = Seq3d->Value(2); @@ -2291,7 +2293,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersectingEdge (const Standard_Integer //=============================================== if (myRemoveLoopMode == 1) { // after fixing will be nb+1 edges - Standard_Boolean loopRemoved; + Standard_Boolean loopRemoved = 0; // create a sequence of resulting edges Handle (TopTools_HSequenceOfShape) TTSS = new TopTools_HSequenceOfShape; TopoDS_Edge E2; @@ -2355,13 +2357,13 @@ static Standard_Real ComputeLocalDeviation (const TopoDS_Edge &edge, { ShapeAnalysis_Edge sae; Handle(Geom_Curve) c3d; - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; if ( ! sae.Curve3d ( edge, c3d, a, b, Standard_False ) ) return RealLast(); gp_Lin line ( pint, gp_Vec ( pint, pnt ) ); Handle(Geom2d_Curve) Crv; - Standard_Real fp,lp; + Standard_Real fp = NAN,lp = NAN; if ( sae.PCurve(edge,face,Crv,fp,lp,Standard_False) ) { if(Crv->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) { Handle(Geom2d_TrimmedCurve) tc = Handle(Geom2d_TrimmedCurve)::DownCast(Crv); @@ -2423,7 +2425,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num Standard_Boolean isForward1 = ( E1.Orientation() == TopAbs_FORWARD ); Standard_Boolean isForward2 = ( E2.Orientation() == TopAbs_FORWARD ); - Standard_Real a1, b1, a2, b2; + Standard_Real a1 = NAN, b1 = NAN, a2 = NAN, b2 = NAN; BRep_Tool::Range ( E1, Face(), a1, b1 ); BRep_Tool::Range ( E2, Face(), a2, b2 ); @@ -2686,7 +2688,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num vertices(3) = sae.FirstVertex(edge2); vertices(4) = sae.LastVertex(edge2); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <=4; i++) { vertexPoints(i) = BRep_Tool::Pnt(TopoDS::Vertex(vertices(i))); vertexTolers(i) = BRep_Tool::Tolerance(TopoDS::Vertex(vertices(i))); @@ -2699,7 +2701,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num // searching for the nearest vertexies to the intersection point Standard_Real aVtx1Param=0., aVtx2Param=0.; - Standard_Integer aVC1, aVC2; + Standard_Integer aVC1 = 0, aVC2 = 0; Standard_Real aMinDist = RealLast(); gp_Pnt aNearestVertex; Standard_Real aNecessaryVtxTole = 0.0; @@ -2723,7 +2725,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num Standard_Real param1 = IP.ParamOnFirst(); Standard_Real param2 = IP.ParamOnSecond(); Handle(Geom_Curve) aCurve1, aCurve2; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; TopLoc_Location L1, L2; aCurve1 = BRep_Tool::Curve(edge1, L1, f, l); aCurve2 = BRep_Tool::Curve(edge2, L2, f, l); @@ -2736,7 +2738,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num if(aMinDist < RealLast() && !aCurve1.IsNull() && !aCurve2.IsNull()) { gp_Lin aLig(aNearestVertex, gp_Vec(aNearestVertex, pint)); - Standard_Integer aPointsC; + Standard_Integer aPointsC = 0; Standard_Real du1 = 0.05*(param1 - aVtx1Param); Standard_Real du2 = 0.05*(param2 - aVtx2Param); Standard_Real tole1=BRep_Tool::Tolerance(edge1); @@ -3010,7 +3012,7 @@ Standard_Boolean ShapeFix_Wire::FixLacking (const Standard_Integer num, // analyze the 3d space btw edges: is it enough to add long 3d edge? if ( myTopoMode ) { Handle(Geom_Curve) c3d; - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; if ( ! sae.Curve3d ( E1, c3d, a, b, Standard_True ) ) { // cannot work myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL1 ); return Standard_False; @@ -3204,8 +3206,8 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges() Handle(ShapeExtend_WireData) sewd = WireData(); for (Standard_Integer i = 1; i <= NbEdges() && NbEdges() > 2; i++) { - Standard_Real param; - Standard_Integer toRemove; + Standard_Real param = NAN; + Standard_Integer toRemove = 0; if(theAdvAnalyzer->CheckNotchedEdges(i,toRemove,param,MinTolerance())){ Standard_Integer n2 = (i > 0) ? i : NbEdges(); Standard_Integer n1 = (n2 > 1) ? n2-1 : NbEdges(); @@ -3214,7 +3216,7 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges() TopoDS_Edge splitE = sewd->Edge ( toSplit ); ShapeAnalysis_Edge sae; Handle(Geom2d_Curve) c2d; - Standard_Real a, b; + Standard_Real a = NAN, b = NAN; sae.PCurve ( splitE, face, c2d, a, b, Standard_True ); ShapeBuild_Edge sbe; TopAbs_Orientation orient = splitE.Orientation(); @@ -3240,7 +3242,7 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges() new ShapeAnalysis_TransferParametersProj; transferParameters->SetMaxTolerance(MaxTolerance()); transferParameters->Init(splitE,face); - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; if (a < b ) { first = a; last = b; @@ -3306,8 +3308,8 @@ static void CopyReversePcurves(const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge, const Standard_Boolean reverse) { - TopLoc_Location fromLoc = fromedge.Location(); - TopLoc_Location toLoc = toedge.Location(); + const TopLoc_Location& fromLoc = fromedge.Location(); + const TopLoc_Location& toLoc = toedge.Location(); for (BRep_ListIteratorOfListOfCurveRepresentation fromitcr ((*((Handle(BRep_TEdge)*)&fromedge.TShape()))->ChangeCurves()); fromitcr.More(); fromitcr.Next()) { Handle(BRep_GCurve) fromGC = Handle(BRep_GCurve)::DownCast(fromitcr.Value()); @@ -3444,7 +3446,7 @@ void ShapeFix_Wire::FixDummySeam(const Standard_Integer num) if ( !Context().IsNull() ) Context()->Replace ( nextE, tmpE1); //removing edges from wire - Standard_Integer n1, n2; + Standard_Integer n1 = 0, n2 = 0; if ( num < num1 ) { n1 = num; n2 = num1; } else { diff --git a/src/ShapeFix/ShapeFix_Wire.hxx b/src/ShapeFix/ShapeFix_Wire.hxx index e90a0cf659..77b7fd4876 100644 --- a/src/ShapeFix/ShapeFix_Wire.hxx +++ b/src/ShapeFix/ShapeFix_Wire.hxx @@ -464,49 +464,49 @@ protected: Handle(ShapeFix_Edge) myFixEdge; Handle(ShapeAnalysis_Wire) myAnalyzer; - Standard_Boolean myGeomMode; - Standard_Boolean myTopoMode; - Standard_Boolean myClosedMode; - Standard_Boolean myPreference2d; - Standard_Boolean myFixGapsByRanges; - Standard_Integer myFixReversed2dMode; - Standard_Integer myFixRemovePCurveMode; - Standard_Integer myFixAddPCurveMode; - Standard_Integer myFixRemoveCurve3dMode; - Standard_Integer myFixAddCurve3dMode; - Standard_Integer myFixSeamMode; - Standard_Integer myFixShiftedMode; - Standard_Integer myFixSameParameterMode; - Standard_Integer myFixVertexToleranceMode; - Standard_Integer myFixNotchedEdgesMode; - Standard_Integer myFixSelfIntersectingEdgeMode; - Standard_Integer myFixIntersectingEdgesMode; - Standard_Integer myFixNonAdjacentIntersectingEdgesMode; - Standard_Integer myFixTailMode; - Standard_Integer myRemoveLoopMode; - Standard_Integer myFixReorderMode; - Standard_Integer myFixSmallMode; - Standard_Integer myFixConnectedMode; - Standard_Integer myFixEdgeCurvesMode; - Standard_Integer myFixDegeneratedMode; - Standard_Integer myFixSelfIntersectionMode; - Standard_Integer myFixLackingMode; - Standard_Integer myFixGaps3dMode; - Standard_Integer myFixGaps2dMode; - Standard_Integer myLastFixStatus; - Standard_Integer myStatusReorder; - Standard_Integer myStatusSmall; - Standard_Integer myStatusConnected; - Standard_Integer myStatusEdgeCurves; - Standard_Integer myStatusDegenerated; - Standard_Integer myStatusClosed; - Standard_Integer myStatusSelfIntersection; - Standard_Integer myStatusLacking; - Standard_Integer myStatusGaps3d; - Standard_Integer myStatusGaps2d; + Standard_Boolean myGeomMode{}; + Standard_Boolean myTopoMode{}; + Standard_Boolean myClosedMode{}; + Standard_Boolean myPreference2d{}; + Standard_Boolean myFixGapsByRanges{}; + Standard_Integer myFixReversed2dMode{}; + Standard_Integer myFixRemovePCurveMode{}; + Standard_Integer myFixAddPCurveMode{}; + Standard_Integer myFixRemoveCurve3dMode{}; + Standard_Integer myFixAddCurve3dMode{}; + Standard_Integer myFixSeamMode{}; + Standard_Integer myFixShiftedMode{}; + Standard_Integer myFixSameParameterMode{}; + Standard_Integer myFixVertexToleranceMode{}; + Standard_Integer myFixNotchedEdgesMode{}; + Standard_Integer myFixSelfIntersectingEdgeMode{}; + Standard_Integer myFixIntersectingEdgesMode{}; + Standard_Integer myFixNonAdjacentIntersectingEdgesMode{}; + Standard_Integer myFixTailMode{}; + Standard_Integer myRemoveLoopMode{}; + Standard_Integer myFixReorderMode{}; + Standard_Integer myFixSmallMode{}; + Standard_Integer myFixConnectedMode{}; + Standard_Integer myFixEdgeCurvesMode{}; + Standard_Integer myFixDegeneratedMode{}; + Standard_Integer myFixSelfIntersectionMode{}; + Standard_Integer myFixLackingMode{}; + Standard_Integer myFixGaps3dMode{}; + Standard_Integer myFixGaps2dMode{}; + Standard_Integer myLastFixStatus{}; + Standard_Integer myStatusReorder{}; + Standard_Integer myStatusSmall{}; + Standard_Integer myStatusConnected{}; + Standard_Integer myStatusEdgeCurves{}; + Standard_Integer myStatusDegenerated{}; + Standard_Integer myStatusClosed{}; + Standard_Integer myStatusSelfIntersection{}; + Standard_Integer myStatusLacking{}; + Standard_Integer myStatusGaps3d{}; + Standard_Integer myStatusGaps2d{}; Standard_Boolean myStatusRemovedSegment; - Standard_Integer myStatusNotches; - Standard_Integer myStatusFixTails; + Standard_Integer myStatusNotches{}; + Standard_Integer myStatusFixTails{}; Standard_Real myMaxTailAngleSine; Standard_Real myMaxTailWidth; diff --git a/src/ShapeFix/ShapeFix_WireSegment.cxx b/src/ShapeFix/ShapeFix_WireSegment.cxx index 3dfef90508..7f9ec63207 100644 --- a/src/ShapeFix/ShapeFix_WireSegment.cxx +++ b/src/ShapeFix/ShapeFix_WireSegment.cxx @@ -25,10 +25,10 @@ //function : ShapeFix_WireSegment //purpose : //======================================================================= -ShapeFix_WireSegment::ShapeFix_WireSegment() +ShapeFix_WireSegment::ShapeFix_WireSegment() : myOrient(TopAbs_FORWARD) { Clear(); - myOrient = TopAbs_FORWARD; + } //======================================================================= @@ -37,10 +37,10 @@ ShapeFix_WireSegment::ShapeFix_WireSegment() //======================================================================= ShapeFix_WireSegment::ShapeFix_WireSegment(const Handle(ShapeExtend_WireData)& wire, - const TopAbs_Orientation ori) + const TopAbs_Orientation ori) : myOrient(ori) { Load ( wire ); - myOrient = ori; + } //======================================================================= diff --git a/src/ShapeFix/ShapeFix_WireVertex.cxx b/src/ShapeFix/ShapeFix_WireVertex.cxx index 80eca5c760..5eb5a52cd3 100644 --- a/src/ShapeFix/ShapeFix_WireVertex.cxx +++ b/src/ShapeFix/ShapeFix_WireVertex.cxx @@ -13,6 +13,8 @@ //szv#4 S4163 +#include + #include #include #include @@ -115,7 +117,7 @@ Standard_Integer ShapeFix_WireVertex::FixSame() BRep_Builder B; Handle(ShapeExtend_WireData) sbwd = myAnalyzer.WireData(); - Standard_Integer i, nb = sbwd->NbEdges(); + Standard_Integer i = 0, nb = sbwd->NbEdges(); for (i = 1; i <= nb; i ++) { Standard_Integer j = (i == nb ? 1 : i+1); @@ -135,7 +137,7 @@ Standard_Integer ShapeFix_WireVertex::FixSame() if (stat == 2) { // OK mais en reprenant les tolerances Handle(Geom_Curve) crv; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; sae.Curve3d ( sbwd->Edge(i), crv, cf, cl ); B.UpdateVertex (V1,cl,E1,myAnalyzer.Precision()); sae.Curve3d ( sbwd->Edge(j), crv, cf, cl ); @@ -171,7 +173,7 @@ Standard_Integer ShapeFix_WireVertex::Fix() Handle(ShapeExtend_WireData) sbwd = myAnalyzer.WireData(); - Standard_Integer i, nb = sbwd->NbEdges(); + Standard_Integer i = 0, nb = sbwd->NbEdges(); Standard_Integer nbfix = 0; for (i = 1; i <= nb; i ++) { // On note les valeurs @@ -210,7 +212,7 @@ Standard_Integer ShapeFix_WireVertex::Fix() Standard_Real ufol = myAnalyzer.UFollowing(j); Handle(Geom_Curve) crv; - Standard_Real cf,cl; + Standard_Real cf = NAN,cl = NAN; //szv#4:S4163:12Mar99 optimized if (stat < 4) { sae.Curve3d ( sbwd->Edge(i), crv, cf, cl ); diff --git a/src/ShapeFix/ShapeFix_Wire_1.cxx b/src/ShapeFix/ShapeFix_Wire_1.cxx index 901cbad65d..533f3c988e 100644 --- a/src/ShapeFix/ShapeFix_Wire_1.cxx +++ b/src/ShapeFix/ShapeFix_Wire_1.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. // szv 19.08.99: new methods for fixing gaps between edges (3d curves and pcurves) +#include + #include #include @@ -79,7 +81,7 @@ Standard_Boolean ShapeFix_Wire::FixGaps3d () myStatusGaps3d = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); // if ( !IsReady() ) return Standard_False; - Standard_Integer i, start = ( myClosedMode ? 1 : 2 ); + Standard_Integer i = 0, start = ( myClosedMode ? 1 : 2 ); if (myFixGapsByRanges) { for ( i = start; i <= NbEdges(); i++ ) @@ -107,7 +109,7 @@ Standard_Boolean ShapeFix_Wire::FixGaps3d () myStatusGaps2d = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); // if ( !IsReady() ) return Standard_False; - Standard_Integer i, start = ( myClosedMode ? 1 : 2 ); + Standard_Integer i = 0, start = ( myClosedMode ? 1 : 2 ); if (myFixGapsByRanges) { for ( i = start; i <= NbEdges(); i++ ) @@ -173,7 +175,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, // TopoDS_Face face = myAnalyzer->Face(); // comment by enk // Retrieve curves on edges - Standard_Real cfirst1, clast1, cfirst2, clast2; + Standard_Real cfirst1 = NAN, clast1 = NAN, cfirst2 = NAN, clast2 = NAN; Handle(Geom_Curve) C1, C2; ShapeAnalysis_Edge SAE; if (!SAE.Curve3d(E1,C1,cfirst1,clast1) || @@ -199,7 +201,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, gp_Pnt vpnt = (V1.IsSame(V2))? BRep_Tool::Pnt(V1) : gp_Pnt((BRep_Tool::Pnt(V1).XYZ()+BRep_Tool::Pnt(V2).XYZ())*0.5); - Standard_Real first1, last1, first2, last2; + Standard_Real first1 = NAN, last1 = NAN, first2 = NAN, last2 = NAN; if (reversed1) { first1 = clast1; last1 = cfirst1; @@ -272,7 +274,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, Handle(Geom_BSplineCurve) bsp1, bsp2; Handle(Geom_Curve) c; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; // iterate on curves Standard_Integer nbcurv = (n1==n2? 1 : 2); @@ -446,7 +448,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, if (Proj.NbPoints()) { Standard_Integer index = 1; - Standard_Real dist, mindist=-1.; + Standard_Real dist = NAN, mindist=-1.; for (Standard_Integer i=1; i<=Proj.NbPoints(); i++) { dist = vpnt.Distance(Proj.Point(i)); @@ -461,7 +463,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, if (Proj.NbPoints()) { Standard_Integer index = 1; - Standard_Real dist, mindist=-1.; + Standard_Real dist = NAN, mindist=-1.; for (Standard_Integer i=1; i<=Proj.NbPoints(); i++) { dist = vpnt.Distance(Proj.Point(i)); @@ -518,7 +520,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, // First find all intersections gp_Pnt pp1, pp2; Standard_Integer index1=0, index2=0; - Standard_Real uu1, uu2, pardist, pardist1=-1., pardist2=-1.; + Standard_Real uu1 = NAN, uu2 = NAN, pardist = NAN, pardist1=-1., pardist2=-1.; for (Standard_Integer i=1; i<=Extr.NbExtrema(); i++) { Extr.Parameters(i,uu1,uu2); @@ -766,7 +768,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, TopoDS_Face face = myAnalyzer->Face(); // Retrieve pcurves on edges - Standard_Real cfirst1, clast1, cfirst2, clast2; + Standard_Real cfirst1 = NAN, clast1 = NAN, cfirst2 = NAN, clast2 = NAN; Handle(Geom2d_Curve) PC1, PC2; ShapeAnalysis_Edge SAE; if (!SAE.PCurve(E1,face,PC1,cfirst1,clast1) || @@ -789,7 +791,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, Standard_Boolean reversed1 = (E1.Orientation()==TopAbs_REVERSED), reversed2 = (E2.Orientation()==TopAbs_REVERSED); - Standard_Real first1, last1, first2, last2; + Standard_Real first1 = NAN, last1 = NAN, first2 = NAN, last2 = NAN; if (reversed1) { first1 = clast1; last1 = cfirst1; @@ -860,7 +862,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, Handle(Geom2d_BSplineCurve) bsp1, bsp2; Handle(Geom2d_Curve) pc; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; // iterate on pcurves Standard_Integer nbcurv = (n1==n2? 1 : 2); @@ -1038,8 +1040,8 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, { if (Inter.NbPoints() || Inter.NbSegments()) { - Standard_Integer i, index1 = 0, index2 = 0; - Standard_Real pardist, pardist1=-1., pardist2=-1.; + Standard_Integer i = 0, index1 = 0, index2 = 0; + Standard_Real pardist = NAN, pardist1=-1., pardist2=-1.; // iterate on intersection points IntRes2d_IntersectionPoint IP; for ( i=1; i<=Inter.NbPoints(); i++ ) @@ -1148,7 +1150,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, Geom2dAPI_ExtremaCurveCurve Extr(pc1,pc2,domfirst1,domlast1,domfirst2,domlast2); if (Extr.NbExtrema()) { - Standard_Real u1, u2; + Standard_Real u1 = NAN, u2 = NAN; Extr.LowerDistanceParameters(u1,u2); // Adjust parameters on periodic curves u1 = AdjustOnPeriodic2d(pc1,reversed1,first1,last1,u1); @@ -1177,7 +1179,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, if (Proj.NbPoints()) { Standard_Integer index = 1; - Standard_Real dist, mindist=-1.; + Standard_Real dist = NAN, mindist=-1.; for (Standard_Integer i=1; i<=Proj.NbPoints(); i++) { dist = cpnt2.Distance(Proj.Point(i)); @@ -1193,7 +1195,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, if (Proj.NbPoints()) { Standard_Integer index = 1; - Standard_Real dist, mindist=-1.; + Standard_Real dist = NAN, mindist=-1.; for (Standard_Integer i=1; i<=Proj.NbPoints(); i++) { dist = cpnt1.Distance(Proj.Point(i)); @@ -1222,7 +1224,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, if (Proj.NbPoints()) { Standard_Integer index = 1; - Standard_Real dist, mindist=-1.; + Standard_Real dist = NAN, mindist=-1.; for (Standard_Integer i=1; i<=Proj.NbPoints(); i++) { dist = mpnt.Distance(Proj.Point(i)); @@ -1238,7 +1240,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, if (Proj.NbPoints()) { Standard_Integer index = 1; - Standard_Real dist, mindist=-1.; + Standard_Real dist = NAN, mindist=-1.; for (Standard_Integer i=1; i<=Proj.NbPoints(); i++) { dist = mpnt.Distance(Proj.Point(i)); @@ -1279,12 +1281,12 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, { // Check whether new points lie inside the surface bounds - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; myAnalyzer->Surface()->Surface()->Bounds(umin,umax,vmin,vmax); if (::Precision::IsInfinite(umin) || ::Precision::IsInfinite(umax) || ::Precision::IsInfinite(vmin) || ::Precision::IsInfinite(vmax)) { - Standard_Real fumin, fumax, fvmin, fvmax; + Standard_Real fumin = NAN, fumax = NAN, fvmin = NAN, fvmax = NAN; BRepTools::UVBounds(face,fumin,fumax,fvmin,fvmax); if (::Precision::IsInfinite(umin)) umin = fumin-preci; if (::Precision::IsInfinite(umax)) umax = fumax+preci; @@ -1293,8 +1295,8 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, } gp_Pnt2d ipnt, P1, P2; - Standard_Real u, v; - Standard_Boolean out; + Standard_Real u = NAN, v = NAN; + Standard_Boolean out = 0; // iterate on curves for (Standard_Integer j=1; j<=2; j++) { @@ -1350,7 +1352,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, IntRes2d_Domain dlin(P1,0.,tolint,P2,P1.Distance(P2),tolint); Handle(Geom2d_Curve) pc; - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; if (j==1) { if (cfirst1 + #include #include #include @@ -55,11 +57,11 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeFix_Wireframe,ShapeFix_Root) //function : ShapeFix_Wireframe //purpose : //======================================================================= -ShapeFix_Wireframe::ShapeFix_Wireframe() +ShapeFix_Wireframe::ShapeFix_Wireframe() : myModeDrop(Standard_False), myLimitAngle(-1) { ClearStatuses(); - myModeDrop = Standard_False; - myLimitAngle = -1; + + } //======================================================================= @@ -67,12 +69,12 @@ ShapeFix_Wireframe::ShapeFix_Wireframe() //purpose : //======================================================================= -ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape) +ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape) : myShape(shape), myModeDrop(Standard_False), myLimitAngle(-1) { ClearStatuses(); - myShape = shape; - myModeDrop = Standard_False; - myLimitAngle = -1; + + + } //======================================================================= @@ -282,7 +284,7 @@ ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape) Standard_Boolean isSame = (V11.IsSame(V12) || V22.IsSame(V21)); BRep_Builder B; B.MakeEdge(newedge); - Standard_Real cf1,cf2,cl1,cl2,first1,first2,last1,last2; + Standard_Real cf1 = NAN,cf2 = NAN,cl1 = NAN,cl2 = NAN,first1 = NAN,first2 = NAN,last1 = NAN,last2 = NAN; newedge.Orientation(TopAbs_FORWARD); try { @@ -295,7 +297,7 @@ ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape) B.Add(newedge,V22.Oriented(TopAbs_REVERSED)); Handle(Geom_Curve) CRes; - Standard_Boolean isRev1,isRev2; + Standard_Boolean isRev1 = 0,isRev2 = 0; // Standard_Real newf,newl; if(!ShapeConstruct::JoinCurves(c3d1,c3d2,E1.Orientation(),E2.Orientation(),cf1, cl1,cf2, cl2,CRes,isRev1,isRev2)) return ReplaceFirst; @@ -335,7 +337,7 @@ ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape) if(!sae.PCurve ( E2, face, c2d2, first2, last2, Standard_False )) return ReplaceFirst; Handle(Geom2d_Curve) C2dRes; - Standard_Boolean isRev12,isRev22; + Standard_Boolean isRev12 = 0,isRev22 = 0; if(!ShapeConstruct::JoinCurves(c2d1,c2d2,OrEdge1,OrEdge2,first1, last1,first2, last2,C2dRes,isRev12,isRev22,isSame)) return ReplaceFirst; @@ -490,7 +492,7 @@ Standard_Boolean ShapeFix_Wireframe::CheckSmallEdges(TopTools_MapOfShape& theSma SAW.Init(aswd,face,Precision()); // pnd protection on seam edges TopTools_DataMapOfShapeInteger EdgeMap; - Standard_Integer i; + Standard_Integer i = 0; for (i=1; i<=SAW.NbEdges(); i++) { edge = SAW.WireData()->Edge(i); @@ -541,7 +543,7 @@ Standard_Boolean ShapeFix_Wireframe::CheckSmallEdges(TopTools_MapOfShape& theSma { SAW.SetPrecision(Precision()); TopTools_DataMapOfShapeInteger EdgeMap; - Standard_Integer i; + Standard_Integer i = 0; TopoDS_Wire theWire=TopoDS::Wire(expw1.Current()); TopTools_ListOfShape theEdgeList; SAW.Load(theWire); @@ -655,7 +657,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma //SFW->Load(aWire); SFW->Load(aswd); SFW->FixReorder(); - Standard_Integer prev, next, index = 1; + Standard_Integer prev = 0, next = 0, index = 1; while (index <= SFW->WireData()->NbEdges() && SFW->NbEdges()>1) { @@ -683,7 +685,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma Standard_Boolean take_next = IsAnyJoin; //Standard_False; Standard_Boolean isLimAngle = Standard_False; Handle(Geom_Curve) C1, C2, C3; - Standard_Real aux, last1, first2, last2, first3; + Standard_Real aux = NAN, last1 = NAN, first2 = NAN, last2 = NAN, first3 = NAN; Standard_Real Ang1 = 0., Ang2 =0.; if (SAE.Curve3d(edge1,C1,aux,last1) && SAE.Curve3d(edge2,C2,first2,last2) && @@ -1017,7 +1019,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma TopoDS_Edge ed = (take_next ? edge1 : edge2); ShapeAnalysis_Edge sae; Handle(Geom_Curve) c3d; - Standard_Real f1,l1; + Standard_Real f1 = NAN,l1 = NAN; if(sae.Curve3d(ed,c3d,f1,l1,Standard_False)) { gp_Pnt p1,p2,p3; @@ -1105,7 +1107,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma TopoDS_Wire aWire = TopoDS::Wire(expw1.Current()); SFW->Load(aWire); SFW->FixReorder(); - Standard_Integer prev, next, index = 1; + Standard_Integer prev = 0, next = 0, index = 1; while (index <= SFW->NbEdges() && SFW->NbEdges()>1) { prev = (index==1)? SFW->NbEdges() : index-1; @@ -1132,7 +1134,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma Standard_Boolean take_next = IsAnyJoin; //Standard_False; Standard_Boolean isLimAngle = Standard_False; Handle(Geom_Curve) C1, C2, C3; - Standard_Real aux, last1, first2, last2, first3; + Standard_Real aux = NAN, last1 = NAN, first2 = NAN, last2 = NAN, first3 = NAN; Standard_Real Ang1 = 0., Ang2 =0.; if (SAE.Curve3d(edge1,C1,aux,last1) && SAE.Curve3d(edge2,C2,first2,last2) && @@ -1465,7 +1467,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma TopoDS_Edge ed = (take_next ? edge1 : edge2); ShapeAnalysis_Edge sae; Handle(Geom_Curve) c3d; - Standard_Real f1,l1; + Standard_Real f1 = NAN,l1 = NAN; if(sae.Curve3d(ed,c3d,f1,l1,Standard_False)) { gp_Pnt p1,p2,p3; diff --git a/src/ShapeFix/ShapeFix_Wireframe.hxx b/src/ShapeFix/ShapeFix_Wireframe.hxx index f5cbc076b7..f7db78776f 100644 --- a/src/ShapeFix/ShapeFix_Wireframe.hxx +++ b/src/ShapeFix/ShapeFix_Wireframe.hxx @@ -111,8 +111,8 @@ private: Standard_Boolean myModeDrop; Standard_Real myLimitAngle; - Standard_Integer myStatusWireGaps; - Standard_Integer myStatusSmallEdges; + Standard_Integer myStatusWireGaps{}; + Standard_Integer myStatusSmallEdges{}; }; diff --git a/src/ShapeProcess/ShapeProcess.cxx b/src/ShapeProcess/ShapeProcess.cxx index e38395aec5..dfdda507d6 100644 --- a/src/ShapeProcess/ShapeProcess.cxx +++ b/src/ShapeProcess/ShapeProcess.cxx @@ -89,7 +89,7 @@ Standard_Boolean ShapeProcess::Perform (const Handle(ShapeProcess_Context)& cont } TColStd_SequenceOfAsciiString sequenceOfOperators; TCollection_AsciiString oper; - Standard_Integer i; + Standard_Integer i = 0; for ( i=1; ; i++ ) { oper = sequence.Token ( " \t,;", i ); if ( oper.Length() <=0 ) break; diff --git a/src/ShapeProcess/ShapeProcess_Context.cxx b/src/ShapeProcess/ShapeProcess_Context.cxx index 1e9d891ef4..3081cdc6a9 100644 --- a/src/ShapeProcess/ShapeProcess_Context.cxx +++ b/src/ShapeProcess/ShapeProcess_Context.cxx @@ -25,6 +25,7 @@ #include #include +#include #include IMPLEMENT_STANDARD_RTTIEXT(ShapeProcess_Context,Standard_Transient) @@ -34,10 +35,10 @@ static Standard_Mutex THE_SHAPE_PROCESS_MUTEX; //function : ShapeProcess_Context //purpose : //======================================================================= -ShapeProcess_Context::ShapeProcess_Context() +ShapeProcess_Context::ShapeProcess_Context() : myMessenger(Message::DefaultMessenger()), myTraceLev(1) { - myMessenger = Message::DefaultMessenger(); - myTraceLev = 1; + + } //======================================================================= @@ -46,11 +47,11 @@ ShapeProcess_Context::ShapeProcess_Context() //======================================================================= ShapeProcess_Context::ShapeProcess_Context (const Standard_CString file, - const Standard_CString scope) + const Standard_CString scope) : myMessenger(Message::DefaultMessenger()), myTraceLev(1) { Init ( file, scope ); - myMessenger = Message::DefaultMessenger(); - myTraceLev = 1; + + } //======================================================================= @@ -92,7 +93,7 @@ Handle(Resource_Manager) ShapeProcess_Context::LoadResourceManager (const Standa static Standard_Time sMtime, sUMtime; static TCollection_AsciiString sName; - struct stat buf; + struct stat buf{}; Standard_Time aMtime(0), aUMtime(0); TCollection_AsciiString aPath,aUserPath; Resource_Manager::GetResourcePath(aPath,name,Standard_False); @@ -344,7 +345,7 @@ Standard_Boolean ShapeProcess_Context::GetBoolean (const Standard_CString param, Standard_Real ShapeProcess_Context::RealVal (const Standard_CString param, const Standard_Real def) const { - Standard_Real val; + Standard_Real val = NAN; return GetReal ( param, val ) ? val : def; } @@ -356,7 +357,7 @@ Standard_Real ShapeProcess_Context::RealVal (const Standard_CString param, Standard_Boolean ShapeProcess_Context::BooleanVal (const Standard_CString param, const Standard_Boolean def) const { - Standard_Boolean val; + Standard_Boolean val = 0; return GetBoolean ( param, val ) ? val : def; } @@ -368,7 +369,7 @@ Standard_Boolean ShapeProcess_Context::BooleanVal (const Standard_CString param, Standard_Integer ShapeProcess_Context::IntegerVal (const Standard_CString param, const Standard_Integer def) const { - Standard_Integer val; + Standard_Integer val = 0; return GetInteger ( param, val ) ? val : def; } diff --git a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx index 71be9188df..871e245af1 100644 --- a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx +++ b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -166,7 +168,7 @@ static Standard_Boolean settol (const Handle(ShapeProcess_Context)& context, Handle(ShapeProcess_ShapeContext) ctx = Handle(ShapeProcess_ShapeContext)::DownCast ( context ); if ( ctx.IsNull() ) return Standard_False; - Standard_Real val; + Standard_Real val = NAN; if ( ctx->IntegerVal ( "Mode", 0 ) >0 && ctx->GetReal ( "Value", val ) ) { Standard_Real rat = ctx->RealVal ( "Ratio", 1. ); if ( rat >= 1 ) { @@ -177,7 +179,7 @@ static Standard_Boolean settol (const Handle(ShapeProcess_Context)& context, BRepLib::UpdateTolerances (ctx->Result(),Standard_True); - Standard_Real reg; + Standard_Real reg = NAN; if ( ctx->GetReal ("Regularity", reg) ) BRepLib::EncodeRegularity (ctx->Result(), reg); @@ -377,11 +379,11 @@ static Standard_Boolean shapetobezier (const Handle(ShapeProcess_Context)& conte SCB.SetBSplineMode(BSplineMode); } - Standard_Real maxTol, minTol; + Standard_Real maxTol = NAN, minTol = NAN; if ( ctx->GetReal ( "MaxTolerance", maxTol ) ) SCB.SetMaxTolerance(maxTol); if ( ctx->GetReal ( "MinCurveLength", minTol ) ) SCB.SetMinTolerance(minTol); - Standard_Boolean EdgeMode; + Standard_Boolean EdgeMode = 0; if ( ctx->GetBoolean ( "EdgeMode", EdgeMode ) ) SCB.SetEdgeMode(EdgeMode); if ( ! SCB.Perform() && SCB.Status (ShapeExtend_FAIL) ) { @@ -459,7 +461,7 @@ static Standard_Boolean splitcontinuity (const Handle(ShapeProcess_Context)& con tool.SetMsgRegistrator( msg ); - Standard_Real maxTol; + Standard_Real maxTol = NAN; if ( ctx->GetReal ( "MaxTolerance", maxTol ) ) tool.SetMaxTolerance(maxTol); if ( ! tool.Perform() && tool.Status (ShapeExtend_FAIL) ) { @@ -493,10 +495,10 @@ static Standard_Boolean splitclosedfaces (const Handle(ShapeProcess_Context)& co ShapeUpgrade_ShapeDivideClosed tool ( ctx->Result() ); tool.SetMsgRegistrator( msg ); - Standard_Real closeTol; + Standard_Real closeTol = NAN; if ( ctx->GetReal ( "CloseTolerance", closeTol ) ) tool.SetPrecision(closeTol); - Standard_Real maxTol; + Standard_Real maxTol = NAN; if ( ctx->GetReal ( "MaxTolerance", maxTol ) ) tool.SetMaxTolerance(maxTol); Standard_Integer num = ctx->IntegerVal ( "NbSplitPoints", 1 ); @@ -539,7 +541,7 @@ static Standard_Boolean fixfacesize (const Handle(ShapeProcess_Context)& context FSC.Init(ctx->Result()); FSC.SetMsgRegistrator ( msg ); - Standard_Real aTol; + Standard_Real aTol = NAN; if ( ctx->GetReal ( "Tolerance", aTol ) ) FSC.SetPrecision (aTol); FSC.Perform(); @@ -605,8 +607,8 @@ static Standard_Boolean dropsmallsolids (const Handle(ShapeProcess_Context)& con ShapeFix_FixSmallSolid FSS; FSS.SetMsgRegistrator( msg ); - Standard_Real aThreshold; - Standard_Integer aMode; + Standard_Real aThreshold = NAN; + Standard_Integer aMode = 0; if (ctx->GetInteger ("FixMode", aMode)) FSS.SetFixMode (aMode); if (ctx->GetReal ("VolumeThreshold", aThreshold)) diff --git a/src/ShapeProcess/ShapeProcess_ShapeContext.cxx b/src/ShapeProcess/ShapeProcess_ShapeContext.cxx index e24d82e595..7cf4ab7661 100644 --- a/src/ShapeProcess/ShapeProcess_ShapeContext.cxx +++ b/src/ShapeProcess/ShapeProcess_ShapeContext.cxx @@ -177,7 +177,7 @@ static void RecModif (const TopoDS_Shape &S, { TopoDS_Shape r = S; //gka -modification to keep history for shape with location (OCC21617) - TopLoc_Location aShLoc = S.Location(); + const TopLoc_Location& aShLoc = S.Location(); TopLoc_Location aNullLoc; r.Location(aNullLoc); @@ -204,9 +204,9 @@ static void RecModif (const TopoDS_Shape &S, Standard_Boolean modif = Standard_False; BRep_Builder B; for ( TopoDS_Iterator it(r,Standard_False); it.More(); it.Next() ) { - TopoDS_Shape sh = it.Value(); + const TopoDS_Shape& sh = it.Value(); if ( repl.IsBound(sh) ) { - TopoDS_Shape newsh = repl.Find(sh); + const TopoDS_Shape& newsh = repl.Find(sh); if ( ! newsh.IsNull() ) B.Add ( result, newsh ); modif = Standard_True; } @@ -366,7 +366,7 @@ static void ExplodeModifier (const TopoDS_Shape &S, TopTools_DataMapOfShapeShape &map, const TopAbs_ShapeEnum until) { - TopoDS_Shape res = repl.ModifiedShape ( S ); + const TopoDS_Shape& res = repl.ModifiedShape ( S ); if ( res != S ) { diff --git a/src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx b/src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx index bc42326382..c7ecadc728 100644 --- a/src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx +++ b/src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx @@ -30,10 +30,10 @@ //purpose : //======================================================================= ShapeProcessAPI_ApplySequence::ShapeProcessAPI_ApplySequence(const Standard_CString rscName, - const Standard_CString seqName) + const Standard_CString seqName) : myContext(new ShapeProcess_ShapeContext(rscName)) { - myContext = new ShapeProcess_ShapeContext(rscName); + myContext->SetDetalisation ( TopAbs_FACE ); TCollection_AsciiString str ( seqName ); diff --git a/src/ShapeUpgrade/ShapeUpgrade.cxx b/src/ShapeUpgrade/ShapeUpgrade.cxx index 2c3d838d8f..1e8b8b2134 100644 --- a/src/ShapeUpgrade/ShapeUpgrade.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade.cxx @@ -65,7 +65,7 @@ Standard_Boolean ShapeUpgrade::Debug() BS->Multiplicities(Mults); BS->KnotSequence (KnotSequence); - Standard_Integer StartKnotIndex, EndKnotIndex, j; + Standard_Integer StartKnotIndex = 0, EndKnotIndex = 0, j = 0; StartKnotIndex = BS->FirstUKnotIndex(); for ( EndKnotIndex = StartKnotIndex + 1; EndKnotIndex <= BS->LastUKnotIndex(); EndKnotIndex++ ) { diff --git a/src/ShapeUpgrade/ShapeUpgrade_ClosedEdgeDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_ClosedEdgeDivide.cxx index 38b5dc6e53..5e008764b7 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ClosedEdgeDivide.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ClosedEdgeDivide.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -56,7 +58,7 @@ Standard_Boolean ShapeUpgrade_ClosedEdgeDivide::Compute(const TopoDS_Edge& anEdg gp_Pnt pntV = BRep_Tool::Pnt(V1); Standard_Real TolV1 = LimitTolerance( BRep_Tool::Tolerance(V1) ); TolV1=TolV1*TolV1; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) curve3d = BRep_Tool::Curve (anEdge, f, l); myHasCurve3d = !curve3d.IsNull(); Standard_Real f2d = 0., l2d = 0.; diff --git a/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx index 5f06125da1..a0d746dfb2 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ClosedFaceDivide.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -46,9 +48,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_ClosedFaceDivide,ShapeUpgrade_FaceDivide //purpose : //======================================================================= ShapeUpgrade_ClosedFaceDivide::ShapeUpgrade_ClosedFaceDivide(): - ShapeUpgrade_FaceDivide() + ShapeUpgrade_FaceDivide(), myNbSplit(1) { - myNbSplit = 1; + } //======================================================================= @@ -57,9 +59,9 @@ ShapeUpgrade_ClosedFaceDivide::ShapeUpgrade_ClosedFaceDivide(): //======================================================================= ShapeUpgrade_ClosedFaceDivide::ShapeUpgrade_ClosedFaceDivide(const TopoDS_Face& F): - ShapeUpgrade_FaceDivide(F) + ShapeUpgrade_FaceDivide(F), myNbSplit(1) { - myNbSplit = 1; + } //======================================================================= @@ -78,7 +80,7 @@ Standard_Boolean ShapeUpgrade_ClosedFaceDivide::SplitSurface(const Standard_Real } TopoDS_Face face = TopoDS::Face ( myResult ); - Standard_Real Uf,Ul,Vf,Vl; + Standard_Real Uf = NAN,Ul = NAN,Vf = NAN,Vl = NAN; ShapeAnalysis::GetFaceUVBounds ( myFace, Uf, Ul, Vf, Vl ); // 01.10.99 pdn Porting on DEC if( ::Precision::IsInfinite(Uf) || ::Precision::IsInfinite(Ul) || @@ -104,7 +106,7 @@ Standard_Boolean ShapeUpgrade_ClosedFaceDivide::SplitSurface(const Standard_Real TopoDS_Edge edge = sewd->Edge(i); ShapeAnalysis_Edge sae; Handle(Geom2d_Curve) c1, c2; - Standard_Real f1,f2,l1,l2; + Standard_Real f1 = NAN,f2 = NAN,l1 = NAN,l2 = NAN; if(!sae.PCurve(edge,face,c1,f1,l1,Standard_False)) continue; //smh#8 @@ -117,11 +119,11 @@ Standard_Boolean ShapeUpgrade_ClosedFaceDivide::SplitSurface(const Standard_Real Bnd_Box2d B1, B2; sac.FillBndBox ( c1, f1, l1, 20, Standard_True, B1 ); sac.FillBndBox ( c2, f2, l2, 20, Standard_True, B2 ); - Standard_Real x1min,y1min,x1max,y1max; - Standard_Real x2min,y2min,x2max,y2max; + Standard_Real x1min = NAN,y1min = NAN,x1max = NAN,y1max = NAN; + Standard_Real x2min = NAN,y2min = NAN,x2max = NAN,y2max = NAN; B1.Get(x1min,y1min,x1max,y1max); B2.Get(x2min,y2min,x2max,y2max); - Standard_Real xf,xl,yf,yl; + Standard_Real xf = NAN,xl = NAN,yf = NAN,yl = NAN; if(x1min < x2min) { xf = x1max; xl = x2min; @@ -161,7 +163,7 @@ Standard_Boolean ShapeUpgrade_ClosedFaceDivide::SplitSurface(const Standard_Real Handle(ShapeAnalysis_Surface) sas = new ShapeAnalysis_Surface( surf ); Standard_Boolean uclosed = sas->IsUClosed(Precision()); Standard_Boolean vclosed = sas->IsVClosed(Precision()); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; if(uclosed) { surf -> Bounds(U1, U2, V1, V2); GeomAdaptor_Surface GAS ( surf ); diff --git a/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx b/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx index cf2aefafdd..279b72a827 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -34,10 +36,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_ConvertCurve2dToBezier,ShapeUpgrade_SplitCurve2d) -ShapeUpgrade_ConvertCurve2dToBezier::ShapeUpgrade_ConvertCurve2dToBezier() +ShapeUpgrade_ConvertCurve2dToBezier::ShapeUpgrade_ConvertCurve2dToBezier() : mySegments(new TColGeom2d_HSequenceOfCurve), mySplitParams(new TColStd_HSequenceOfReal) { - mySegments = new TColGeom2d_HSequenceOfCurve; - mySplitParams = new TColStd_HSequenceOfReal; + + } static Handle(Geom2d_BezierCurve) MakeBezier2d(const Handle(Geom2d_Curve)& theCurve2d, @@ -70,7 +72,7 @@ void ShapeUpgrade_ConvertCurve2dToBezier::Compute() myCurve->IsKind(STANDARD_TYPE(Geom2d_BezierCurve)) ) { // static function`s code getted from ShapeConvert - Standard_Real tmpF, tmpL, aDeviation; + Standard_Real tmpF = NAN, tmpL = NAN, aDeviation = NAN; Handle(Geom2d_Line) aTmpLine2d = ShapeCustom_Curve2d::ConvertToLine2d(myCurve, First, Last, Precision::Approximation(), tmpF, tmpL, aDeviation); @@ -179,7 +181,7 @@ void ShapeUpgrade_ConvertCurve2dToBezier::Compute() TColStd_Array1OfReal knots(1,nbArcs+1); tool.Knots(knots); mySplitParams->Append(First+Shift); - Standard_Integer j; // svv Jan 10 2000 : porting on DEC + Standard_Integer j = 0; // svv Jan 10 2000 : porting on DEC Standard_Real newFirst = First+Shift; Standard_Real newLast = First+Shift; @@ -192,7 +194,7 @@ void ShapeUpgrade_ConvertCurve2dToBezier::Compute() { newFirst = newLast; newLast = nextKnot; - Standard_Real tmpF, tmpL, aDeviation; + Standard_Real tmpF = NAN, tmpL = NAN, aDeviation = NAN; Handle(Geom2d_Line) aTmpLine2d = ShapeCustom_Curve2d::ConvertToLine2d(aCrv2d, newFirst, newLast, Precision::Approximation(), tmpF, tmpL, aDeviation); diff --git a/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx b/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx index d7745ed114..e9727f6094 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx @@ -34,13 +34,13 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_ConvertCurve3dToBezier,ShapeUpgrade_SplitCurve3d) -ShapeUpgrade_ConvertCurve3dToBezier::ShapeUpgrade_ConvertCurve3dToBezier() +ShapeUpgrade_ConvertCurve3dToBezier::ShapeUpgrade_ConvertCurve3dToBezier() : mySegments(new TColGeom_HSequenceOfCurve), mySplitParams(new TColStd_HSequenceOfReal), myLineMode(Standard_True), myCircleMode(Standard_True), myConicMode(Standard_True) { - mySegments = new TColGeom_HSequenceOfCurve; - mySplitParams = new TColStd_HSequenceOfReal; - myLineMode = Standard_True; - myCircleMode = Standard_True; - myConicMode = Standard_True; + + + + + } //======================================================================= @@ -161,7 +161,7 @@ void ShapeUpgrade_ConvertCurve3dToBezier::Compute() TColStd_Array1OfReal knots(1,nbArcs+1); tool.Knots(knots); mySplitParams->Append(First+Shift); - Standard_Integer j; // svv Jan 10 2000 : porting on DEC + Standard_Integer j = 0; // svv Jan 10 2000 : porting on DEC for(j = 1; j <=nbArcs; j++) { Standard_Real nextKnot = knots(j+1)+Shift; if(nextKnot - mySplitParams->Value(mySplitParams->Length()) > precision) { diff --git a/src/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx b/src/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx index ff0c54fe2b..273901bfd6 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx @@ -16,6 +16,8 @@ // svv 10.01.00 porting on DEC +#include + #include #include #include @@ -44,12 +46,12 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_ConvertSurfaceToBezierBasis,ShapeUpgrade_SplitSurface) -ShapeUpgrade_ConvertSurfaceToBezierBasis::ShapeUpgrade_ConvertSurfaceToBezierBasis() +ShapeUpgrade_ConvertSurfaceToBezierBasis::ShapeUpgrade_ConvertSurfaceToBezierBasis() : myPlaneMode(Standard_True), myRevolutionMode(Standard_True), myExtrusionMode(Standard_True), myBSplineMode(Standard_True) { - myPlaneMode = Standard_True; - myRevolutionMode = Standard_True; - myExtrusionMode = Standard_True; - myBSplineMode = Standard_True; + + + + } //======================================================================= @@ -60,7 +62,7 @@ ShapeUpgrade_ConvertSurfaceToBezierBasis::ShapeUpgrade_ConvertSurfaceToBezierBas void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Segment) { if(!Segment) { - Standard_Real UF,UL,VF,VL; + Standard_Real UF = NAN,UL = NAN,VF = NAN,VL = NAN; mySurface->Bounds(UF,UL,VF,VL); if(!Precision::IsInfinite(UF)) myUSplitValues->SetValue(1,UF); if(!Precision::IsInfinite(UL)) myUSplitValues->SetValue(myUSplitValues->Length(),UL); @@ -148,7 +150,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se } else if(mySurface->IsKind(STANDARD_TYPE(Geom_BSplineSurface))&&myBSplineMode) { Handle(Geom_BSplineSurface) bspline = Handle(Geom_BSplineSurface)::DownCast(mySurface); //pdn - Standard_Real u1,u2,v1,v2; + Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN; bspline->Bounds(u1,u2,v1,v2); GeomConvert_BSplineSurfaceToBezierSurface converter(bspline);//,UFirst,ULast,VFirst,VLast,precision; Standard_Integer nbUPatches = converter.NbUPatches(); @@ -165,7 +167,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se converter.UKnots(UJoints); TColStd_SequenceOfReal UFilteredJoints; UFilteredJoints.Append(UJoints(1)); - Standard_Integer i; + Standard_Integer i = 0; for(i = 2; i <= nbUPatches+1; i++) if(UJoints(i)-UJoints(i-1) < precision) { NbUFiltered++; @@ -216,7 +218,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se mySegments = new ShapeExtend_CompositeSurface(srf,uj,vj); - Standard_Integer j; // svv #1 + Standard_Integer j = 0; // svv #1 for(j = 2; j <= myUSplitValues->Length(); j++) { ULast = myUSplitValues->Value(j); for(Standard_Integer ii = 2; ii <= nbUPatches+1; ii++) { @@ -247,7 +249,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se basis = tc->BasisCurve(); } Handle(TColGeom_HArray1OfCurve) curves; - Standard_Integer nbCurves; + Standard_Integer nbCurves = 0; Handle(TColStd_HSequenceOfReal) vPar = new TColStd_HSequenceOfReal; Handle(TColStd_HSequenceOfReal) vSVal= new TColStd_HSequenceOfReal; if(basis->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) { @@ -288,9 +290,9 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se gp_Ax1 axis = revol->Axis(); Handle(TColGeom_HArray2OfSurface) surf = new TColGeom_HArray2OfSurface(1,1,1,nbCurves); - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; mySurface->Bounds(Umin,Umax,Vmin,Vmax); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for(i = 1; i <= nbCurves; i++) { Handle(Geom_SurfaceOfRevolution) rev = new Geom_SurfaceOfRevolution(curves->Value(i),axis); if( UFirst-Umin < Precision::PConfusion() && @@ -326,7 +328,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se //gp_Dir direction = extr->Direction(); // direction not used (skl) Handle(TColGeom_HArray1OfCurve) curves; - Standard_Integer nbCurves; + Standard_Integer nbCurves = 0; Handle(TColStd_HSequenceOfReal) uPar = new TColStd_HSequenceOfReal; Handle(TColStd_HSequenceOfReal) uSVal= new TColStd_HSequenceOfReal; ShapeUpgrade_ConvertCurve3dToBezier converter; @@ -342,7 +344,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se shiftL.SetTranslation(extr->Value(UFirst,0),extr->Value(UFirst,VLast)); Handle(TColGeom_HArray2OfSurface) surf = new TColGeom_HArray2OfSurface(1,nbCurves,1,1); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for(i = 1; i <= nbCurves; i++) { Handle(Geom_BezierCurve) bez = Handle(Geom_BezierCurve)::DownCast(curves->Value(i)); Standard_Integer nbPoles = bez->NbPoles(); @@ -384,7 +386,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se TColStd_Array1OfReal VJoints(1,2); VJoints(1) = VFirst; VJoints(2) = VLast; Handle(TColGeom_HArray2OfSurface) surf = new TColGeom_HArray2OfSurface(1,1,1,1); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; mySurface->Bounds(U1,U2,V1,V2); Handle(Geom_Surface) S; if(U1-UFirst < precision && ULast - U2 < precision && @@ -406,7 +408,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Compute(const Standard_Boolean Se //purpose : //======================================================================= -static Handle(Geom_Surface) GetSegment(const Handle(Geom_Surface) surf, +static Handle(Geom_Surface) GetSegment(const Handle(Geom_Surface)& surf, const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, @@ -440,7 +442,7 @@ static Handle(Geom_Surface) GetSegment(const Handle(Geom_Surface) surf, if(S->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) { Handle(Geom_SurfaceOfRevolution) revol = Handle(Geom_SurfaceOfRevolution)::DownCast(S->Copy()); - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; revol->Bounds(Umin,Umax,Vmin,Vmax); Handle(Geom_Curve) basis = revol->BasisCurve(); if(basis->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) { @@ -464,7 +466,7 @@ static Handle(Geom_Surface) GetSegment(const Handle(Geom_Surface) surf, return res; } else { - Standard_Real Umin,Umax,Vmin,Vmax; + Standard_Real Umin = NAN,Umax = NAN,Vmin = NAN,Vmax = NAN; surf->Bounds(Umin,Umax,Vmin,Vmax); if( U1-Umin < Precision::PConfusion() && Umax-U2 < Precision::PConfusion() && @@ -523,7 +525,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Build(const Standard_Boolean /*Se break; Handle(Geom_Surface) patch = mySegments->Patch(j1-1,j2-1); - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; patch->Bounds(U1,U2,V1,V2); //linear recomputation of part: Standard_Real uFirst = myUSplitParams->Value(j1-1); @@ -549,7 +551,7 @@ void ShapeUpgrade_ConvertSurfaceToBezierBasis::Build(const Standard_Boolean /*Se } TColStd_Array1OfReal UJoints(1,nbU); - Standard_Integer i; // svv #1 + Standard_Integer i = 0; // svv #1 for(i = 1; i <= nbU; i++) UJoints(i) = myUSplitValues->Value(i); diff --git a/src/ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx index 1a477dfe32..314337b7b4 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_EdgeDivide.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -30,10 +32,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_EdgeDivide,ShapeUpgrade_Tool) //purpose : //======================================================================= ShapeUpgrade_EdgeDivide::ShapeUpgrade_EdgeDivide(): - ShapeUpgrade_Tool() + ShapeUpgrade_Tool(), mySplitCurve3dTool(new ShapeUpgrade_SplitCurve3d), mySplitCurve2dTool(new ShapeUpgrade_SplitCurve2d) { - mySplitCurve3dTool = new ShapeUpgrade_SplitCurve3d; - mySplitCurve2dTool = new ShapeUpgrade_SplitCurve2d; + + } @@ -59,7 +61,7 @@ Standard_Boolean ShapeUpgrade_EdgeDivide::Compute(const TopoDS_Edge& anEdge) { Clear(); - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; Handle(Geom_Curve) curve3d = BRep_Tool::Curve (anEdge, f, l); myHasCurve3d = !curve3d.IsNull(); diff --git a/src/ShapeUpgrade/ShapeUpgrade_EdgeDivide.hxx b/src/ShapeUpgrade/ShapeUpgrade_EdgeDivide.hxx index 6198c8d0d6..122d21f0e4 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_EdgeDivide.hxx +++ b/src/ShapeUpgrade/ShapeUpgrade_EdgeDivide.hxx @@ -76,8 +76,8 @@ protected: TopoDS_Face myFace; - Standard_Boolean myHasCurve2d; - Standard_Boolean myHasCurve3d; + Standard_Boolean myHasCurve2d{}; + Standard_Boolean myHasCurve3d{}; Handle(TColStd_HSequenceOfReal) myKnots2d; Handle(TColStd_HSequenceOfReal) myKnots3d; diff --git a/src/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx index 39249cc8d6..9efd20f6de 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx @@ -16,6 +16,8 @@ // gka 01.06.99 S4205: changing order of splitting surface/curves for converting to bezier +#include + #include #include #include @@ -44,11 +46,11 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_FaceDivide,ShapeUpgrade_Tool) //purpose : //======================================================================= ShapeUpgrade_FaceDivide::ShapeUpgrade_FaceDivide(): - ShapeUpgrade_Tool(), myStatus(0) + ShapeUpgrade_Tool(), mySegmentMode(Standard_True), myStatus(0), mySplitSurfaceTool(new ShapeUpgrade_SplitSurface), myWireDivideTool(new ShapeUpgrade_WireDivide) { - mySegmentMode = Standard_True; - mySplitSurfaceTool = new ShapeUpgrade_SplitSurface; - myWireDivideTool = new ShapeUpgrade_WireDivide; + + + } //======================================================================= @@ -57,11 +59,11 @@ ShapeUpgrade_FaceDivide::ShapeUpgrade_FaceDivide(): //======================================================================= ShapeUpgrade_FaceDivide::ShapeUpgrade_FaceDivide (const TopoDS_Face &F): - ShapeUpgrade_Tool(), myStatus(0) + ShapeUpgrade_Tool(), mySegmentMode(Standard_True), myStatus(0), mySplitSurfaceTool(new ShapeUpgrade_SplitSurface), myWireDivideTool(new ShapeUpgrade_WireDivide) { - mySegmentMode = Standard_True; - mySplitSurfaceTool = new ShapeUpgrade_SplitSurface; - myWireDivideTool = new ShapeUpgrade_WireDivide; + + + Init ( F ); } @@ -123,7 +125,7 @@ Standard_Boolean ShapeUpgrade_FaceDivide::SplitSurface (const Standard_Real theA Handle(Geom_Surface) surf; surf = BRep_Tool::Surface ( face, L ); - Standard_Real Uf,Ul,Vf,Vl; + Standard_Real Uf = NAN,Ul = NAN,Vf = NAN,Vl = NAN; // BRepTools::UVBounds(myFace,Uf,Ul,Vf,Vl); ShapeAnalysis::GetFaceUVBounds ( face, Uf, Ul, Vf, Vl ); if(Precision::IsInfinite(Uf) || Precision::IsInfinite(Ul) || @@ -131,7 +133,7 @@ Standard_Boolean ShapeUpgrade_FaceDivide::SplitSurface (const Standard_Real theA return Standard_False; // make little extension to ensure all pcurves fit inside new surface bounds - Standard_Real aSUf, aSUl, aSVf, aSVl; + Standard_Real aSUf = NAN, aSUl = NAN, aSVf = NAN, aSVl = NAN; surf->Bounds(aSUf, aSUl, aSVf, aSVl); if (!surf->IsUPeriodic()) { Standard_Real dU = (Ul - Uf) * 0.01; diff --git a/src/ShapeUpgrade/ShapeUpgrade_FaceDivideArea.cxx b/src/ShapeUpgrade/ShapeUpgrade_FaceDivideArea.cxx index 03ca53df1f..a9e20cb644 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_FaceDivideArea.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_FaceDivideArea.cxx @@ -32,12 +32,12 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_FaceDivideArea,ShapeUpgrade_FaceDivide) //function : ShapeUpgrade_FaceDivideArea //purpose : //======================================================================= -ShapeUpgrade_FaceDivideArea::ShapeUpgrade_FaceDivideArea() +ShapeUpgrade_FaceDivideArea::ShapeUpgrade_FaceDivideArea() : myMaxArea(Precision::Infinite()), myNbParts(0), myIsSplittingByNumber(Standard_False) { - myMaxArea = Precision::Infinite(); - myNbParts = 0; + + myUnbSplit = myVnbSplit = -1; - myIsSplittingByNumber = Standard_False; + SetPrecision(1.e-5); SetSplitSurfaceTool (new ShapeUpgrade_SplitSurfaceArea); } @@ -47,12 +47,12 @@ ShapeUpgrade_FaceDivideArea::ShapeUpgrade_FaceDivideArea() //purpose : //======================================================================= -ShapeUpgrade_FaceDivideArea::ShapeUpgrade_FaceDivideArea(const TopoDS_Face& F) +ShapeUpgrade_FaceDivideArea::ShapeUpgrade_FaceDivideArea(const TopoDS_Face& F) : myMaxArea(Precision::Infinite()), myNbParts(0), myIsSplittingByNumber(Standard_False) { - myMaxArea = Precision::Infinite(); - myNbParts = 0; + + myUnbSplit = myVnbSplit = -1; - myIsSplittingByNumber = Standard_False; + SetPrecision(1.e-5); SetSplitSurfaceTool (new ShapeUpgrade_SplitSurfaceArea); Init(F); diff --git a/src/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx b/src/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx index 280556d335..6bb249de76 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -53,7 +55,7 @@ Standard_Boolean ShapeUpgrade_FixSmallBezierCurves::Approx(Handle(Geom_Curve)& C ShapeAnalysis_Edge sae; Handle(Geom_Curve) c3d; - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; if(sae.Curve3d(myEdge,c3d,f,l,Standard_False)) { if(First < f) First = f; @@ -127,7 +129,7 @@ Standard_Boolean ShapeUpgrade_FixSmallBezierCurves::Approx(Handle(Geom_Curve)& C Standard_Boolean isSeam = BRep_Tool::IsClosed ( myEdge, myFace ); if ( isSeam ) { Handle(Geom2d_Curve) c2; - Standard_Real f2, l2; + Standard_Real f2 = NAN, l2 = NAN; //smh#8 TopoDS_Shape tmpE = myEdge.Reversed(); TopoDS_Edge erev = TopoDS::Edge (tmpE ); diff --git a/src/ShapeUpgrade/ShapeUpgrade_FixSmallCurves.cxx b/src/ShapeUpgrade/ShapeUpgrade_FixSmallCurves.cxx index 16f579355c..50074b1ce7 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_FixSmallCurves.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_FixSmallCurves.cxx @@ -34,9 +34,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_FixSmallCurves,ShapeUpgrade_Tool) //purpose : //======================================================================= -ShapeUpgrade_FixSmallCurves::ShapeUpgrade_FixSmallCurves() +ShapeUpgrade_FixSmallCurves::ShapeUpgrade_FixSmallCurves() : myStatus(ShapeExtend::EncodeStatus ( ShapeExtend_OK )) { - myStatus = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); + } //======================================================================= //function : Init diff --git a/src/ShapeUpgrade/ShapeUpgrade_RemoveInternalWires.cxx b/src/ShapeUpgrade/ShapeUpgrade_RemoveInternalWires.cxx index 1b000c1366..1afdf9fe5d 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_RemoveInternalWires.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_RemoveInternalWires.cxx @@ -37,11 +37,11 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_RemoveInternalWires,ShapeUpgrade_Tool) //function : ShapeUpgrade_RemoveInternalWires //purpose : //======================================================================= -ShapeUpgrade_RemoveInternalWires::ShapeUpgrade_RemoveInternalWires() +ShapeUpgrade_RemoveInternalWires::ShapeUpgrade_RemoveInternalWires() : myMinArea(0.), myRemoveFacesMode(Standard_True), myStatus(ShapeExtend::EncodeStatus ( ShapeExtend_OK )) { - myMinArea =0.; - myRemoveFacesMode = Standard_True; - myStatus = ShapeExtend::EncodeStatus ( ShapeExtend_OK ); + + + Handle(ShapeBuild_ReShape) aContext = new ShapeBuild_ReShape; SetContext(aContext); @@ -113,7 +113,7 @@ ShapeUpgrade_RemoveInternalWires::ShapeUpgrade_RemoveInternalWires(const TopoDS_ TopTools_IndexedDataMapOfShapeListOfShape aWireFaces; Standard_Integer i =1, nb = theSeqShapes.Length(); for( ; i <= nb; i++) { - TopoDS_Shape aS = theSeqShapes.Value(i); + const TopoDS_Shape& aS = theSeqShapes.Value(i); if(aS.ShapeType() == TopAbs_FACE) removeSmallWire(aS,TopoDS_Wire()); else if(aS.ShapeType() == TopAbs_WIRE) { @@ -163,7 +163,7 @@ void ShapeUpgrade_RemoveInternalWires::removeSmallWire (const TopoDS_Shape& theF TopoDS_Iterator aIte(aW,Standard_False); for( ; aIte.More(); aIte.Next()) { - TopoDS_Shape aE = aIte.Value(); + const TopoDS_Shape& aE = aIte.Value(); if(myRemoveEdges.IsBound(aE)) myRemoveEdges.ChangeFind(aE).Append(aF); else { @@ -193,7 +193,7 @@ void ShapeUpgrade_RemoveInternalWires::removeSmallFaces () //collecting all faces containing edges from removed wire for( ; aIte.More(); aIte.Next()) { - TopoDS_Shape aEdge = aIte.Value(); + const TopoDS_Shape& aEdge = aIte.Value(); if(!myEdgeFaces.Contains(aEdge)) { myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_FAIL2); continue; diff --git a/src/ShapeUpgrade/ShapeUpgrade_RemoveInternalWires.hxx b/src/ShapeUpgrade/ShapeUpgrade_RemoveInternalWires.hxx index 77c0483cc5..df6a57f41c 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_RemoveInternalWires.hxx +++ b/src/ShapeUpgrade/ShapeUpgrade_RemoveInternalWires.hxx @@ -94,7 +94,7 @@ protected: //! Clear all sequences and temporary map; Standard_EXPORT void Clear(); - Standard_Integer myStatus; + Standard_Integer myStatus{}; private: @@ -109,8 +109,8 @@ private: TopoDS_Shape myShape; TopoDS_Shape myResult; - Standard_Real myMinArea; - Standard_Boolean myRemoveFacesMode; + Standard_Real myMinArea{}; + Standard_Boolean myRemoveFacesMode{}; TopTools_IndexedDataMapOfShapeListOfShape myEdgeFaces; TopTools_DataMapOfShapeListOfShape myRemoveEdges; TopTools_SequenceOfShape myRemovedFaces; diff --git a/src/ShapeUpgrade/ShapeUpgrade_RemoveLocations.cxx b/src/ShapeUpgrade/ShapeUpgrade_RemoveLocations.cxx index caba9bfb61..19102c45aa 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_RemoveLocations.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_RemoveLocations.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -40,9 +42,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_RemoveLocations,Standard_Transient) //function : ShapeUpgrade_RemoveLocations //purpose : //======================================================================= -ShapeUpgrade_RemoveLocations::ShapeUpgrade_RemoveLocations() +ShapeUpgrade_RemoveLocations::ShapeUpgrade_RemoveLocations() : myLevelRemoving(TopAbs_SHAPE) { - myLevelRemoving = TopAbs_SHAPE; + } //======================================================================= @@ -52,7 +54,7 @@ ShapeUpgrade_RemoveLocations::ShapeUpgrade_RemoveLocations() Standard_Boolean ShapeUpgrade_RemoveLocations::Remove(const TopoDS_Shape& theShape) { - TopoDS_Shape aShape = theShape; + const TopoDS_Shape& aShape = theShape; myShape = aShape; TopAbs_ShapeEnum shtype = theShape.ShapeType(); Standard_Boolean isRemoveLoc = ((shtype != TopAbs_COMPOUND && myLevelRemoving == TopAbs_SHAPE) || @@ -94,7 +96,7 @@ static Standard_Boolean RebuildShape(const TopoDS_Edge& theEdge, TopoDS_Edge& th if(!isBound) { Handle(Geom_Curve) C3d; TopLoc_Location aLoc; - Standard_Real First3d,Last3d; + Standard_Real First3d = NAN,Last3d = NAN; C3d = BRep_Tool::Curve( theEdge,aLoc,First3d,Last3d); aB.MakeEdge(theNewEdge); if(!C3d.IsNull()) { @@ -115,7 +117,7 @@ static Standard_Boolean RebuildShape(const TopoDS_Edge& theEdge, TopoDS_Edge& th Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace); if(!aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) { Handle(Geom2d_Curve) c2d,c2d1; - Standard_Real First2d,Last2d; + Standard_Real First2d = NAN,Last2d = NAN; c2d= BRep_Tool::CurveOnSurface( theEdge,theFace,First2d,Last2d); if(BRep_Tool::IsClosed(theEdge,theFace)) { @@ -179,7 +181,7 @@ Standard_Boolean ShapeUpgrade_RemoveLocations::MakeNewShape(const TopoDS_Shape& aNewShape= myMapNewShapes.Find(aShape); aNewShape.Orientation(theShape.Orientation()); if(!theRemoveLoc && !theShape.Location().IsIdentity()) { - TopLoc_Location aL = theShape.Location(); + const TopLoc_Location& aL = theShape.Location(); aNewShape.Location(aL); } if(shtype != TopAbs_EDGE) { @@ -256,7 +258,7 @@ Standard_Boolean ShapeUpgrade_RemoveLocations::MakeNewShape(const TopoDS_Shape& aNewShape.Orientation(TopAbs_FORWARD); TopoDS_Iterator aIt(aShape,Standard_False,isRemoveLoc); for( ; aIt.More(); aIt.Next()) { - TopoDS_Shape subshape = aIt.Value(); + const TopoDS_Shape& subshape = aIt.Value(); TopoDS_Shape anewsubshape; Standard_Boolean isDoneSubShape = MakeNewShape(subshape,anAncShape,anewsubshape,isRemoveLoc); isDone = (isDone || isDoneSubShape); diff --git a/src/ShapeUpgrade/ShapeUpgrade_ShapeConvertToBezier.cxx b/src/ShapeUpgrade/ShapeUpgrade_ShapeConvertToBezier.cxx index 58ef035a1c..c79ad5b7dd 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ShapeConvertToBezier.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ShapeConvertToBezier.cxx @@ -16,6 +16,8 @@ // 15.06 2000 gka fix against small edges ; merging ends pcurves and 3d curves +#include + #include #include #include @@ -50,20 +52,20 @@ //function : ShapeUpgrade_ShapeConvertToBezier //purpose : //======================================================================= -ShapeUpgrade_ShapeConvertToBezier::ShapeUpgrade_ShapeConvertToBezier() +ShapeUpgrade_ShapeConvertToBezier::ShapeUpgrade_ShapeConvertToBezier() : my2dMode(Standard_False), my3dMode(Standard_False), mySurfaceMode(Standard_False), my3dLineMode(Standard_True), my3dCircleMode(Standard_True), my3dConicMode(Standard_True), myPlaneMode(Standard_True), myRevolutionMode(Standard_True), myExtrusionMode(Standard_True), myBSplineMode(Standard_True), myLevel(0) { - myLevel = 0; - my2dMode = Standard_False; - my3dMode = Standard_False; - mySurfaceMode = Standard_False; + + + + //set spesial flags to true - my3dLineMode = Standard_True; - my3dCircleMode = Standard_True; - my3dConicMode = Standard_True; - myPlaneMode = Standard_True; - myRevolutionMode = Standard_True; - myExtrusionMode = Standard_True; - myBSplineMode = Standard_True; + + + + + + + } //======================================================================= @@ -72,20 +74,20 @@ ShapeUpgrade_ShapeConvertToBezier::ShapeUpgrade_ShapeConvertToBezier() //======================================================================= ShapeUpgrade_ShapeConvertToBezier::ShapeUpgrade_ShapeConvertToBezier(const TopoDS_Shape& S): - ShapeUpgrade_ShapeDivide(S) + ShapeUpgrade_ShapeDivide(S), my2dMode(Standard_False), my3dMode(Standard_False), mySurfaceMode(Standard_False), my3dLineMode(Standard_True), my3dCircleMode(Standard_True), my3dConicMode(Standard_True), myPlaneMode(Standard_True), myRevolutionMode(Standard_True), myExtrusionMode(Standard_True), myBSplineMode(Standard_True), myLevel(0) { - myLevel = 0; - my2dMode = Standard_False; - my3dMode = Standard_False; - mySurfaceMode = Standard_False; + + + + //set spesial flags to true - my3dLineMode = Standard_True; - my3dCircleMode = Standard_True; - my3dConicMode = Standard_True; - myPlaneMode = Standard_True; - myRevolutionMode = Standard_True; - myExtrusionMode = Standard_True; - myBSplineMode = Standard_True; + + + + + + + } //======================================================================= @@ -141,7 +143,7 @@ Standard_Boolean ShapeUpgrade_ShapeConvertToBezier::Perform (const Standard_Bool TopoDS_Edge edge = sewd->Edge(i); //TopoDS_Edge edge = TopoDS::Edge(exp1.Current()); Handle(Geom_Curve) c3d; - Standard_Real first, last; + Standard_Real first = NAN, last = NAN; TopoDS_Vertex V1,V2; TopExp::Vertices(edge,V1,V2); if(sae.Curve3d(edge,c3d,first,last,Standard_False)) { @@ -214,7 +216,7 @@ Standard_Boolean ShapeUpgrade_ShapeConvertToBezier::Perform (const Standard_Bool TopoDS_Edge edgenext = sewd->Edge((i == sewd->NbEdges() ? 1 : i+1)); Handle(Geom2d_Curve) c2dnext,c2drevnext,newnextCurve; - Standard_Real first2,last2; + Standard_Real first2 = NAN,last2 = NAN; Handle(Geom2d_BezierCurve) beziernext,bezierRnext; if(!sae.PCurve(edgenext,face,c2dnext,first2,last2,Standard_False)) continue ; if(!c2dnext->IsKind(STANDARD_TYPE(Geom2d_BezierCurve)) ) continue; @@ -255,7 +257,7 @@ Standard_Boolean ShapeUpgrade_ShapeConvertToBezier::Perform (const Standard_Bool } if(bezier.IsNull() || beziernext.IsNull() ) continue; //gka fix against small edges ; merging ends of pcurves - Standard_Real f1,l1,f2,l2; + Standard_Real f1 = NAN,l1 = NAN,f2 = NAN,l2 = NAN; f1 = bezier->FirstParameter(); l1 = bezier->LastParameter(); f2 = beziernext->FirstParameter(); diff --git a/src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx index a271dbdd7c..444c846aeb 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ShapeDivide.cxx @@ -42,15 +42,15 @@ //function : ShapeUpgrade_ShapeDivide //purpose : //======================================================================= -ShapeUpgrade_ShapeDivide::ShapeUpgrade_ShapeDivide() : myStatus(0) +ShapeUpgrade_ShapeDivide::ShapeUpgrade_ShapeDivide() : myMaxTol(1), myContext(new ShapeBuild_ReShape), mySegmentMode(Standard_True), myStatus(0), mySplitFaceTool(new ShapeUpgrade_FaceDivide), myEdgeMode(2) { myPrecision = myMinTol = Precision::Confusion(); - myMaxTol = 1; //Precision::Infinite() ?? pdn - mySplitFaceTool = new ShapeUpgrade_FaceDivide; - myContext = new ShapeBuild_ReShape; + //Precision::Infinite() ?? pdn + + //myMsgReg = new ShapeExtend_BasicMsgRegistrator; - mySegmentMode = Standard_True; - myEdgeMode = 2; + + } //======================================================================= @@ -58,14 +58,14 @@ ShapeUpgrade_ShapeDivide::ShapeUpgrade_ShapeDivide() : myStatus(0) //purpose : //======================================================================= -ShapeUpgrade_ShapeDivide::ShapeUpgrade_ShapeDivide(const TopoDS_Shape &S) : myStatus(0) +ShapeUpgrade_ShapeDivide::ShapeUpgrade_ShapeDivide(const TopoDS_Shape &S) : myMaxTol(1), myContext(new ShapeBuild_ReShape), mySegmentMode(Standard_True), myStatus(0), mySplitFaceTool(new ShapeUpgrade_FaceDivide), myEdgeMode(2) { myPrecision = myMinTol = Precision::Confusion(); - myMaxTol = 1; //Precision::Infinite() ?? pdn - mySplitFaceTool = new ShapeUpgrade_FaceDivide; - myContext = new ShapeBuild_ReShape; - mySegmentMode = Standard_True; - myEdgeMode = 2; + //Precision::Infinite() ?? pdn + + + + Init(S); } diff --git a/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideArea.cxx b/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideArea.cxx index 0e9ac2917e..71e2160590 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideArea.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideArea.cxx @@ -23,12 +23,12 @@ //purpose : //======================================================================= ShapeUpgrade_ShapeDivideArea::ShapeUpgrade_ShapeDivideArea(): - ShapeUpgrade_ShapeDivide() + ShapeUpgrade_ShapeDivide(), myMaxArea(Precision::Infinite()), myNbParts(0), myIsSplittingByNumber(Standard_False) { - myMaxArea = Precision::Infinite(); - myNbParts = 0; + + myUnbSplit = myVnbSplit = -1; - myIsSplittingByNumber = Standard_False; + } //======================================================================= @@ -37,13 +37,13 @@ ShapeUpgrade_ShapeDivideArea::ShapeUpgrade_ShapeDivideArea(): //======================================================================= ShapeUpgrade_ShapeDivideArea::ShapeUpgrade_ShapeDivideArea(const TopoDS_Shape& S): - ShapeUpgrade_ShapeDivide(S) + ShapeUpgrade_ShapeDivide(S), myMaxArea(Precision::Infinite()), myNbParts(0), myIsSplittingByNumber(Standard_False) { - myMaxArea = Precision::Infinite(); - myNbParts = 0; + + myUnbSplit = myVnbSplit = -1; - myIsSplittingByNumber = Standard_False; + } //======================================================================= diff --git a/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideContinuity.cxx b/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideContinuity.cxx index 4bdb685088..1051949504 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideContinuity.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ShapeDivideContinuity.cxx @@ -28,13 +28,13 @@ //function : ShapeUpgrade_ShapeDivideContinuity //purpose : //======================================================================= -ShapeUpgrade_ShapeDivideContinuity::ShapeUpgrade_ShapeDivideContinuity() +ShapeUpgrade_ShapeDivideContinuity::ShapeUpgrade_ShapeDivideContinuity() : myCurve3dCriterion(GeomAbs_C1), myCurve2dCriterion(GeomAbs_C1), mySurfaceCriterion(GeomAbs_C1), myTolerance3d(Precision::Confusion()), myTolerance2d(Precision::PConfusion()) { - myCurve3dCriterion = GeomAbs_C1; - myCurve2dCriterion = GeomAbs_C1; - mySurfaceCriterion = GeomAbs_C1; - myTolerance3d = Precision::Confusion(); - myTolerance2d = Precision::PConfusion(); + + + + + } //======================================================================= @@ -43,13 +43,13 @@ ShapeUpgrade_ShapeDivideContinuity::ShapeUpgrade_ShapeDivideContinuity() //======================================================================= ShapeUpgrade_ShapeDivideContinuity::ShapeUpgrade_ShapeDivideContinuity(const TopoDS_Shape& S): - ShapeUpgrade_ShapeDivide(S) + ShapeUpgrade_ShapeDivide(S), myCurve3dCriterion(GeomAbs_C1), myCurve2dCriterion(GeomAbs_C1), mySurfaceCriterion(GeomAbs_C1), myTolerance3d(Precision::Confusion()), myTolerance2d(Precision::PConfusion()) { - myCurve3dCriterion = GeomAbs_C1; - myCurve2dCriterion = GeomAbs_C1; - mySurfaceCriterion = GeomAbs_C1; - myTolerance3d = Precision::Confusion(); - myTolerance2d = Precision::PConfusion(); + + + + + } //======================================================================= diff --git a/src/ShapeUpgrade/ShapeUpgrade_ShellSewing.cxx b/src/ShapeUpgrade/ShapeUpgrade_ShellSewing.cxx index 73001b62a7..8f19e66bdd 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_ShellSewing.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_ShellSewing.cxx @@ -28,9 +28,9 @@ //function : ShapeUpgrade_ShellSewing //purpose : //======================================================================= -ShapeUpgrade_ShellSewing::ShapeUpgrade_ShellSewing() +ShapeUpgrade_ShellSewing::ShapeUpgrade_ShellSewing() : myReShape(new ShapeBuild_ReShape) { - myReShape = new ShapeBuild_ReShape; + } //======================================================================= diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2dContinuity.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2dContinuity.cxx index e58fec2990..55910c597e 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2dContinuity.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve2dContinuity.cxx @@ -33,11 +33,11 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_SplitCurve2dContinuity,ShapeUpgrade_Spli //function : ShapeUpgrade_SplitCurve2dContinuity //purpose : //======================================================================= -ShapeUpgrade_SplitCurve2dContinuity::ShapeUpgrade_SplitCurve2dContinuity() +ShapeUpgrade_SplitCurve2dContinuity::ShapeUpgrade_SplitCurve2dContinuity() : myCriterion(GeomAbs_C1), myTolerance(Precision::PConfusion()), myCont(1) { - myCriterion = GeomAbs_C1; - myTolerance = Precision::PConfusion(); - myCont =1; + + + } //======================================================================= diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3dContinuity.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3dContinuity.cxx index ebaf87e030..8bd940f480 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3dContinuity.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_SplitCurve3dContinuity.cxx @@ -34,11 +34,11 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_SplitCurve3dContinuity,ShapeUpgrade_Spli //function : ShapeUpgrade_SplitCurve3dContinuity //purpose : //======================================================================= -ShapeUpgrade_SplitCurve3dContinuity::ShapeUpgrade_SplitCurve3dContinuity() +ShapeUpgrade_SplitCurve3dContinuity::ShapeUpgrade_SplitCurve3dContinuity() : myCriterion(GeomAbs_C1), myTolerance(Precision::Confusion()), myCont(1) { - myCriterion = GeomAbs_C1; - myTolerance = Precision::Confusion(); - myCont =1; + + + } //======================================================================= diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx index 9bac8b4458..5181ce2dfc 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx @@ -16,6 +16,8 @@ // gka 30.04.99 S4137: extended for all types of surfaces +#include + #include #include #include @@ -68,7 +70,7 @@ void ShapeUpgrade_SplitSurface::Init(const Handle(Geom_Surface)& S) myResSurfaces = new ShapeExtend_CompositeSurface(); myNbResultingRow =1; myNbResultingCol =1; - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; mySurface->Bounds(U1,U2,V1,V2); myUSplitValues->Append(U1); @@ -100,14 +102,14 @@ void ShapeUpgrade_SplitSurface::Init(const Handle(Geom_Surface)& S, myArea = theArea; - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; mySurface->Bounds(U1,U2,V1,V2); Standard_Real precision = Precision::PConfusion(); if ( mySurface->IsUPeriodic() && ULast - UFirst <= U2 - U1 + precision ) { U1 = UFirst; U2 = U1 + mySurface->UPeriod(); } if ( mySurface->IsVPeriodic() && VLast - VFirst <= V2 - V1 + precision ) { V1 = VFirst; V2 = V1 + mySurface->VPeriod(); } - Standard_Real UF,UL,VF,VL; + Standard_Real UF = NAN,UL = NAN,VF = NAN,VL = NAN; if( UFirst > U2-precision || ULast < U1-precision ) { UF =U1; UL = U2; @@ -225,7 +227,7 @@ void ShapeUpgrade_SplitSurface::Build(const Standard_Boolean Segment) if(myUSplitValues->Length() > 2 || myVSplitValues->Length() > 2) myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE1); - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; mySurface->Bounds(U1, U2, V1, V2); if (mySurface->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) { Handle(Geom_SurfaceOfRevolution) Surface = Handle(Geom_SurfaceOfRevolution)::DownCast(mySurface); @@ -242,7 +244,7 @@ void ShapeUpgrade_SplitSurface::Build(const Standard_Boolean Segment) for(Standard_Integer nc =1; nc <= myNbResultingCol; nc++) { Handle(Geom_SurfaceOfRevolution) NewSurfaceRev = new Geom_SurfaceOfRevolution(spc.GetCurves()->Value(nc),Surface->Axis()); - Standard_Real U1p,U2p,V1p,V2p; + Standard_Real U1p = NAN,U2p = NAN,V1p = NAN,V2p = NAN; NewSurfaceRev->Bounds(U1p,U2p,V1p,V2p); for(Standard_Integer nc1 =1; nc1 <= myNbResultingRow; nc1++) { Handle(Geom_RectangularTrimmedSurface) NewSurf = @@ -295,7 +297,7 @@ void ShapeUpgrade_SplitSurface::Build(const Standard_Boolean Segment) for(Standard_Integer nc1 =1; nc1 <= myNbResultingRow; nc1++) { Handle(Geom_SurfaceOfLinearExtrusion) NewSurfaceEx = new Geom_SurfaceOfLinearExtrusion(spc.GetCurves()->Value(nc1), Surface->Direction()); - Standard_Real U1p,U2p,V1p,V2p; + Standard_Real U1p = NAN,U2p = NAN,V1p = NAN,V2p = NAN; NewSurfaceEx->Bounds(U1p,U2p,V1p,V2p); for(Standard_Integer nc2 =1; nc2 <= myNbResultingCol; nc2++) { Handle(Geom_RectangularTrimmedSurface) NewSurf = new Geom_RectangularTrimmedSurface @@ -489,7 +491,7 @@ void ShapeUpgrade_SplitSurface::Build(const Standard_Boolean Segment) } Standard_Integer nbU = myUSplitValues->Length(); TColStd_Array1OfReal UJoints(1,nbU); - Standard_Integer i;//svv Jan 10 2000 : porting on DEC + Standard_Integer i = 0;//svv Jan 10 2000 : porting on DEC for(i = 1; i <= nbU; i++) UJoints(i) = myUSplitValues->Value(i); diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.hxx b/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.hxx index 61f726b145..6a545da7ca 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.hxx +++ b/src/ShapeUpgrade/ShapeUpgrade_SplitSurface.hxx @@ -112,9 +112,9 @@ protected: Handle(Geom_Surface) mySurface; Standard_Integer myStatus; Handle(ShapeExtend_CompositeSurface) myResSurfaces; - Standard_Real myArea; - Standard_Real myUsize; - Standard_Real myVsize; + Standard_Real myArea{}; + Standard_Real myUsize{}; + Standard_Real myVsize{}; private: diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceAngle.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceAngle.cxx index b8ab399aad..79ce8428da 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceAngle.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceAngle.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -34,9 +36,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_SplitSurfaceAngle,ShapeUpgrade_SplitSurf //function : ShapeUpgrade_SplitSurfaceAngle //purpose : //======================================================================= -ShapeUpgrade_SplitSurfaceAngle::ShapeUpgrade_SplitSurfaceAngle (const Standard_Real MaxAngle) +ShapeUpgrade_SplitSurfaceAngle::ShapeUpgrade_SplitSurfaceAngle (const Standard_Real MaxAngle) : myMaxAngle(MaxAngle) { - myMaxAngle = MaxAngle; + } //======================================================================= @@ -73,7 +75,7 @@ void ShapeUpgrade_SplitSurfaceAngle::Compute(const Standard_Boolean /*Segment*/) Handle(Geom_RectangularTrimmedSurface) rts = Handle(Geom_RectangularTrimmedSurface)::DownCast(mySurface); isRect = Standard_True; - Standard_Real V1,V2; + Standard_Real V1 = NAN,V2 = NAN; rts->Bounds(U1,U2,V1,V2); S = rts->BasisSurface(); } diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceArea.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceArea.cxx index 72941c2bcb..3d3a227229 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceArea.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceArea.cxx @@ -24,11 +24,11 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_SplitSurfaceArea,ShapeUpgrade_SplitSurfa //purpose : //======================================================================= ShapeUpgrade_SplitSurfaceArea::ShapeUpgrade_SplitSurfaceArea(): - ShapeUpgrade_SplitSurface() + ShapeUpgrade_SplitSurface(), myNbParts(1), myIsSplittingIntoSquares(Standard_False) { - myNbParts = 1; + myUnbSplit = myVnbSplit = -1; - myIsSplittingIntoSquares = Standard_False; + } //======================================================================= @@ -59,7 +59,7 @@ ShapeUpgrade_SplitSurfaceArea::ShapeUpgrade_SplitSurfaceArea(): aNbUV = 1./aNbUV; Standard_Boolean anIsFixedUVnbSplits = (myUnbSplit > 0 && myVnbSplit > 0); - Standard_Integer nbSplitF, nbSplitS; + Standard_Integer nbSplitF = 0, nbSplitS = 0; if (myIsSplittingIntoSquares && myNbParts > 0) { if (!anIsFixedUVnbSplits) //(myUnbSplit <= 0 || myVnbSplit <= 0) diff --git a/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx b/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx index eb252bddc0..4e54b79c57 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -35,10 +37,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_SplitSurfaceContinuity,ShapeUpgrade_Spli //purpose : //======================================================================= ShapeUpgrade_SplitSurfaceContinuity::ShapeUpgrade_SplitSurfaceContinuity() -: myCont(0) +: myCriterion(GeomAbs_C1), myTolerance(Precision::Confusion()), myCont(0) { - myCriterion = GeomAbs_C1; - myTolerance = Precision::Confusion(); + + } @@ -77,7 +79,7 @@ ShapeUpgrade_SplitSurfaceContinuity::ShapeUpgrade_SplitSurfaceContinuity() void ShapeUpgrade_SplitSurfaceContinuity::Compute(const Standard_Boolean Segment) { if(!Segment) { - Standard_Real UF,UL,VF,VL; + Standard_Real UF = NAN,UL = NAN,VF = NAN,VL = NAN; mySurface->Bounds(UF,UL,VF,VL); if(!Precision::IsInfinite(UF)) myUSplitValues->SetValue(1,UF); if(!Precision::IsInfinite(UL)) myUSplitValues->SetValue(myUSplitValues->Length(),UL); @@ -138,7 +140,7 @@ ShapeUpgrade_SplitSurfaceContinuity::ShapeUpgrade_SplitSurfaceContinuity() myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 ); if ( spc.Status ( ShapeExtend_DONE3 ) ) { myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 ); - Handle(Geom_Curve) aNewBascurve = spc.GetCurve(); + const Handle(Geom_Curve)& aNewBascurve = spc.GetCurve(); Surface->SetBasisCurve(aNewBascurve); } return; @@ -149,7 +151,7 @@ ShapeUpgrade_SplitSurfaceContinuity::ShapeUpgrade_SplitSurfaceContinuity() if(tmp->Continuity() >= myCriterion && myUSplitValues->Length() ==2 && myVSplitValues->Length() == 2) { return; } - Standard_Real U1,U2,V1,V2; + Standard_Real U1 = NAN,U2 = NAN,V1 = NAN,V2 = NAN; tmp->Bounds(U1,U2,V1,V2); Handle(Geom_Surface) theSurf = tmp->BasisSurface(); ShapeUpgrade_SplitSurfaceContinuity sps; diff --git a/src/ShapeUpgrade/ShapeUpgrade_Tool.cxx b/src/ShapeUpgrade/ShapeUpgrade_Tool.cxx index a617df4a72..18ca5e3f91 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_Tool.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_Tool.cxx @@ -26,10 +26,10 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_Tool,Standard_Transient) //function : ShapeUpgrade_Tool //purpose : //======================================================================= -ShapeUpgrade_Tool::ShapeUpgrade_Tool() +ShapeUpgrade_Tool::ShapeUpgrade_Tool() : myMaxTol(1) { myPrecision = myMinTol = Precision::Confusion(); - myMaxTol = 1; //Precision::Infinite() ?? pdn + //Precision::Infinite() ?? pdn } //======================================================================= diff --git a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx index 7d603b2dae..9d40819aa3 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -324,7 +326,7 @@ static Standard_Real ComputeMinEdgeSize(const TopTools_SequenceOfShape& theEdges BRepAdaptor_Curve2d BAcurve2d(anEdge, theRefFace); gp_Pnt2d FirstP2d = BAcurve2d.Value(BAcurve2d.FirstParameter()); gp_Pnt2d LastP2d = BAcurve2d.Value(BAcurve2d.LastParameter()); - Standard_Real aSqDist; + Standard_Real aSqDist = NAN; if (V1.IsSame(V2) && !BRep_Tool::Degenerated(anEdge)) { @@ -370,7 +372,7 @@ static void FindCoordBounds(const TopTools_SequenceOfShape& theFaces, const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current()); if (!theEdgesMap.Contains(anEdge)) continue; - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, theRefFace, fpar, lpar); UpdateBoundaries (aPCurve, fpar, lpar, theIndCoord, aMinCoord, aMaxCoord); } @@ -470,7 +472,7 @@ static void RelocatePCurvesToNewUorigin(const TopTools_SequenceOfShape& theEdges { StartEdge = anEdge; BRepAdaptor_Curve2d StartBAcurve(StartEdge, theRefFace); - Standard_Real aFirstParam, aLastParam; + Standard_Real aFirstParam = NAN, aLastParam = NAN; if (StartEdge.Orientation() == TopAbs_FORWARD) { aFirstParam = StartBAcurve.FirstParameter(); @@ -497,7 +499,7 @@ static void RelocatePCurvesToNewUorigin(const TopTools_SequenceOfShape& theEdges else { BRepAdaptor_Curve2d aBAcurve(anEdge, theRefFace); - Standard_Real aFirstParam, aLastParam; + Standard_Real aFirstParam = NAN, aLastParam = NAN; if (anEdge.Orientation() == TopAbs_FORWARD) { aFirstParam = aBAcurve.FirstParameter(); @@ -532,7 +534,7 @@ static void RelocatePCurvesToNewUorigin(const TopTools_SequenceOfShape& theEdges TopoDS_Vertex StartVertex = (anOr == TopAbs_FORWARD)? TopExp::FirstVertex(StartEdge, Standard_True) : TopExp::LastVertex(StartEdge, Standard_True); TopoDS_Edge CurEdge = StartEdge; - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom2d_Curve) CurPCurve = BRep_Tool::CurveOnSurface(CurEdge, theRefFace, fpar, lpar); CurPCurve = new Geom2d_TrimmedCurve(CurPCurve, fpar, lpar); theEdgeNewPCurve.Bind(CurEdge, CurPCurve); @@ -688,7 +690,7 @@ static Standard_Boolean FindClosestPoints(const TopoDS_Edge& theEdge1, if (theCommonFace.IsNull()) return Standard_False; - Standard_Real fpar1, lpar1, fpar2, lpar2; + Standard_Real fpar1 = NAN, lpar1 = NAN, fpar2 = NAN, lpar2 = NAN; Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(theEdge1, theCommonFace, fpar1, lpar1); Handle(Geom2d_Curve) PCurve2 = BRep_Tool::CurveOnSurface(theEdge2, theCommonFace, fpar2, lpar2); PointsOnEdge1[0] = PCurve1->Value(fpar1); @@ -734,7 +736,7 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theRemovedEdge TopoDS_Edge anEdge = TopoDS::Edge(theRemovedEdges(i)); if (anEdge.IsSame (theCurEdge)) continue; - Standard_Real Param1, Param2; + Standard_Real Param1 = NAN, Param2 = NAN; Handle(Geom2d_Curve) aPC = BRep_Tool::CurveOnSurface(anEdge, theFrefFace, Param1, Param2); if (aPC.IsNull()) continue; @@ -793,7 +795,7 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theRemovedEdge if (!theSeamEdge.IsNull()) { - Standard_Real Param1, Param2; + Standard_Real Param1 = NAN, Param2 = NAN; Handle(Geom2d_Curve) aPC = BRep_Tool::CurveOnSurface(theSeamEdge, theFrefFace, Param1, Param2); Standard_Real aParam = (theSeamEdge.Orientation() == TopAbs_FORWARD)? Param2 : Param1; theNextPoint = aPC->Value (aParam); @@ -808,7 +810,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, const Handle { static Standard_Real aCoefs[2] = { 0.3399811, 0.7745966 }; - Standard_Real uf1, ul1, vf1, vl1, uf2, ul2, vf2, vl2; + Standard_Real uf1 = NAN, ul1 = NAN, vf1 = NAN, vl1 = NAN, uf2 = NAN, ul2 = NAN, vf2 = NAN, vl2 = NAN; theS1->Bounds(uf1, ul1, vf1, vl1); theS2->Bounds(uf2, ul2, vf2, vl2); Standard_Real aPTol = Precision::PConfusion(); @@ -917,8 +919,8 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, const Handle } // - Standard_Real u, v, du = (ul1 - uf1), dv = (vl1 - vf1); - Standard_Integer i, j; + Standard_Real u = NAN, v = NAN, du = (ul1 - uf1), dv = (vl1 - vf1); + Standard_Integer i = 0, j = 0; for (i = 0; i < 2; ++i) { u = uf1 + aCoefs[i] * du; @@ -1032,7 +1034,7 @@ static void TransformPCurves(const TopoDS_Face& theRefFace, TopAbs_Orientation anOr = anEdge.Orientation(); - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom2d_Curve) PCurveOnRef = BRep_Tool::CurveOnSurface(anEdge, theRefFace, fpar, lpar); Handle(Geom2d_Curve) PCurve2; if (!PCurveOnRef.IsNull()/* && !(ToModify || ToProject)*/) @@ -1091,7 +1093,7 @@ static void TransformPCurves(const TopoDS_Face& theRefFace, else { //check: may be it is the same pcurve - Standard_Real aUmin, aUmax, aVmin, aVmax; + Standard_Real aUmin = NAN, aUmax = NAN, aVmin = NAN, aVmax = NAN; RefSurf->Bounds (aUmin, aUmax, aVmin, aVmax); Standard_Real aUperiod = (RefSurf->IsUClosed())? (aUmax - aUmin) : 0.; Standard_Real aVperiod = (RefSurf->IsVClosed())? (aVmax - aVmin) : 0.; @@ -1154,7 +1156,7 @@ static void AddPCurves(const TopTools_SequenceOfShape& theFaces, // seams and equal edges are dropped // Returns true if one of original edges dropped static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges, - const TopoDS_Shape aShape, + const TopoDS_Shape& aShape, Standard_Integer& anIndex, TopTools_SequenceOfShape& theRemovedEdges) { @@ -1162,7 +1164,7 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges, TopTools_IndexedMapOfShape aNewEdges; //add edges without seams for(TopExp_Explorer exp(aShape,TopAbs_EDGE); exp.More(); exp.Next()) { - TopoDS_Shape edge = exp.Current(); + const TopoDS_Shape& edge = exp.Current(); if(aNewEdges.Contains(edge)) { aNewEdges.RemoveKey(edge); @@ -1174,7 +1176,7 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges, Standard_Boolean isDropped = Standard_False; //merge edges and drop seams - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= edges.Length(); i++) { TopoDS_Shape current = edges(i); if(aNewEdges.Contains(current)) { @@ -1281,7 +1283,7 @@ static Standard_Boolean GetNormalToSurface(const TopoDS_Face& theFace, const Standard_Real theP, gp_Dir& theNormal) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; // get 2d curve to get point in 2d Handle(Geom2d_Curve) aC2d; if (BRep_Tool::IsClosed(theEdge, theFace)) @@ -1474,7 +1476,7 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain, const TopoDS_Vertex& FirstVertex, const TopoDS_Vertex& LastVertex) { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; TopoDS_Edge FirstEdge = TopoDS::Edge(aChain(1)); TColGeom_SequenceOfSurface SurfSeq; @@ -1485,7 +1487,7 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain, Handle(Geom2d_Curve) aCurve; Handle(Geom_Surface) aSurface; TopLoc_Location aLocation; - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; BRep_Tool::CurveOnSurface (FirstEdge, aCurve, aSurface, aLocation, aFirst, aLast, aCurveIndex); if (aCurve.IsNull()) break; @@ -1494,7 +1496,7 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain, LocSeq.Append(aLocation); } - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; BRep_Tool::Range(FirstEdge, fpar, lpar); TopoDS_Edge PrevEdge = FirstEdge; TopoDS_Vertex CV; @@ -1632,7 +1634,7 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain, void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape& theChain, TopoDS_Edge& theEdge) { - Standard_Real aFirst3d, aLast3d; + Standard_Real aFirst3d = NAN, aLast3d = NAN; Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aFirst3d, aLast3d); Standard_Real aTolEdge = BRep_Tool::Tolerance(theEdge); Standard_Real aMaxTol = aTolEdge; @@ -1691,7 +1693,7 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape& TColStd_SequenceOfBoolean aForwardsSeq; GeomAbs_CurveType aCurrentType = GeomAbs_OtherCurve; - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; for (Standard_Integer i = 1; i <= theChain.Length(); i++) { TopoDS_Edge anEdge = TopoDS::Edge(theChain.Value(i)); @@ -1829,7 +1831,7 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape& } Handle(Geom2d_Curve) aResPCurve; - Standard_Real aResFirst, aResLast; + Standard_Real aResFirst = NAN, aResLast = NAN; if (aPCurveSeq.Length() == 1) { aResPCurve = aPCurveSeq.Last(); aResFirst = aFirstsSeq.Last(); @@ -2007,8 +2009,8 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeSubSeq(const TopTools_Sequen ShapeAnalysis_Edge sae; BRep_Builder B; // union edges in chain - int j; - Standard_Real fp1,lp1,fp2,lp2; + int j = 0; + Standard_Real fp1 = NAN,lp1 = NAN,fp2 = NAN,lp2 = NAN; Standard_Boolean IsUnionOfLinesPossible = Standard_True; Standard_Boolean IsUnionOfCirclesPossible = Standard_True; Handle(Geom_Curve) c3d1, c3d2; @@ -2024,9 +2026,9 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeSubSeq(const TopTools_Sequen TopoDS_Edge edgeFirst = TopoDS::Edge(theChain.First()); TopoDS_Edge edgeLast = TopoDS::Edge(theChain.Last()); TopoDS_Face CommonFace; - Standard_Real MinSqDist; + Standard_Real MinSqDist = NAN; TopAbs_Orientation OrOfE1OnFace, OrOfE2OnFace; - Standard_Integer IndOnE1, IndOnE2; + Standard_Integer IndOnE1 = 0, IndOnE2 = 0; gp_Pnt2d PointsOnEdge1 [2], PointsOnEdge2 [2]; if (!FindClosestPoints(edgeFirst, edgeLast, theVFmap, CommonFace, MinSqDist, OrOfE1OnFace, OrOfE2OnFace, @@ -2139,7 +2141,7 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeSubSeq(const TopTools_Sequen if (IsUnionOfCirclesPossible) { - double f,l; + double f = NAN,l = NAN; TopoDS_Edge FE = TopoDS::Edge(theChain.First()); Handle(Geom_Curve) c3d = BRep_Tool::Curve(FE,f,l); @@ -2172,7 +2174,7 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeSubSeq(const TopTools_Sequen // closed chain BRepAdaptor_Curve adef(FE); Handle(Geom_Circle) Cir1; - double FP, LP; + double FP = NAN, LP = NAN; if ( FE.Orientation() == TopAbs_FORWARD) { FP = adef.FirstParameter(); @@ -2307,9 +2309,9 @@ static Standard_Boolean IsMergingPossible(const TopoDS_Edge& edge1, const TopoDS { //Find connstion point in 2d TopoDS_Face CommonFace; - Standard_Real MinSqDist; + Standard_Real MinSqDist = NAN; TopAbs_Orientation OrOfE1OnFace, OrOfE2OnFace; - Standard_Integer IndOnE1, IndOnE2; + Standard_Integer IndOnE1 = 0, IndOnE2 = 0; gp_Pnt2d PointsOnEdge1 [2], PointsOnEdge2 [2]; if (!FindClosestPoints(edge1, edge2, theVFmap, CommonFace, MinSqDist, OrOfE1OnFace, OrOfE2OnFace, @@ -2395,7 +2397,7 @@ static Standard_Boolean IsMergingPossible(const TopoDS_Edge& edge1, const TopoDS //======================================================================= static Standard_Boolean GetLineEdgePoints(const TopoDS_Edge& theInpEdge, gp_Pnt& theFirstPoint, gp_Vec& theDirectionVec) { - double f, l; + double f = NAN, l = NAN; Handle(Geom_Curve) aCur = BRep_Tool::Curve(theInpEdge, f, l); if(aCur.IsNull()) return Standard_False; @@ -2487,7 +2489,7 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeEdges(TopTools_SequenceOfSha const TopTools_MapOfShape& NonMergVrt) { TopTools_IndexedDataMapOfShapeListOfShape aMapVE; - Standard_Integer j; + Standard_Integer j = 0; TopTools_MapOfShape VerticesToAvoid; const Standard_Integer aNbE = SeqEdges.Length(); for (j = 1; j <= aNbE; j++) @@ -2496,7 +2498,7 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeEdges(TopTools_SequenceOfSha // fill in the map V-E for (TopoDS_Iterator it(anEdge.Oriented(TopAbs_FORWARD)); it.More(); it.Next()) { - TopoDS_Shape aV = it.Value(); + const TopoDS_Shape& aV = it.Value(); if (aV.Orientation() == TopAbs_FORWARD || aV.Orientation() == TopAbs_REVERSED) { if (!aMapVE.Contains(aV)) @@ -2652,9 +2654,9 @@ ShapeUpgrade_UnifySameDomain::ShapeUpgrade_UnifySameDomain() myConcatBSplines (Standard_False), myAllowInternal (Standard_False), mySafeInputMode(Standard_True), - myHistory(new BRepTools_History) + myContext(new ShapeBuild_ReShape), myHistory(new BRepTools_History) { - myContext = new ShapeBuild_ReShape; + } //======================================================================= @@ -2675,9 +2677,9 @@ ShapeUpgrade_UnifySameDomain::ShapeUpgrade_UnifySameDomain(const TopoDS_Shape& a myAllowInternal (Standard_False), mySafeInputMode (Standard_True), myShape (aShape), - myHistory(new BRepTools_History) + myContext(new ShapeBuild_ReShape), myHistory(new BRepTools_History) { - myContext = new ShapeBuild_ReShape; + } //======================================================================= @@ -2909,7 +2911,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape TopTools_SequenceOfShape edges; TopTools_SequenceOfShape RemovedEdges; - Standard_Integer dummy; + Standard_Integer dummy = 0; AddOrdinaryEdges(edges, aFace, dummy, RemovedEdges); // Faces to get unified with the current faces @@ -2939,7 +2941,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape const TopTools_MapOfShape* pFShells1 = theGMapFaceShells.Seek (aFace); // find adjacent faces to union - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= edges.Length(); i++) { TopoDS_Edge edge = TopoDS::Edge(edges(i)); if (BRep_Tool::Degenerated(edge)) @@ -2969,7 +2971,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape gp_Dir aDN1; // // take intermediate point on edge to compute the normal - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; BRep_Tool::Range(edge, f, l); Standard_Real aTMid = (f + l) * .5; // @@ -3072,7 +3074,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape Standard_Boolean hasConnectAnotherFaces = Standard_False; TopExp_Explorer ex(faces(i), TopAbs_EDGE); for (; ex.More() && !hasConnectAnotherFaces; ex.Next()) { - TopoDS_Shape aE = ex.Current(); + const TopoDS_Shape& aE = ex.Current(); const TopTools_ListOfShape& aLF = aMapEF.FindFromKey(aE); if (aLF.Extent() > 1) { for (it.Init(aLF); it.More() && !hasConnectAnotherFaces; it.Next()) { @@ -3221,7 +3223,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape if (aIsEdgeWith2pcurvesSmooth) { Handle(Geom2d_Curve) aPC1, aPC2; - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; aPC1 = BRep_Tool::CurveOnSurface (EdgeWith2pcurves, F_RefFace, aFirst, aLast); EdgeWith2pcurves.Reverse(); aPC2 = BRep_Tool::CurveOnSurface (EdgeWith2pcurves, F_RefFace, aFirst, aLast); @@ -3295,8 +3297,8 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape { //try to find the origin of U in 2d space //so that all the faces are in [origin, origin + Uperiod] - Standard_Real aMinCoord, aMaxCoord; //Umin, Umax; - Standard_Integer aNumberOfIntervals, i_face_max; + Standard_Real aMinCoord = NAN, aMaxCoord = NAN; //Umin, Umax; + Standard_Integer aNumberOfIntervals = 0, i_face_max = 0; FindCoordBounds (faces, F_RefFace, aMapEF, edgesMap, ii+1, aPeriods[ii], aMinCoord, aMaxCoord, aNumberOfIntervals, i_face_max); @@ -3318,7 +3320,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape const TopoDS_Edge& anEdge = TopoDS::Edge(edges(ind)); if (!UsedEdges.Contains(anEdge)) { - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, F_RefFace, fpar, lpar); aPCurve = new Geom2d_TrimmedCurve(aPCurve, fpar, lpar); EdgeNewPCurve.Bind(anEdge, aPCurve); @@ -3389,7 +3391,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape Handle(Geom_Surface) aSurf = BRep_Tool::Surface(RefFace, aLoc); if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) aSurf = (Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf))->BasisSurface(); - Standard_Real Ufirst, Ulast, Vfirst, Vlast; + Standard_Real Ufirst = NAN, Ulast = NAN, Vfirst = NAN, Vlast = NAN; aSurf->Bounds(Ufirst, Ulast, Vfirst, Vlast); if (Uperiod == 0 && aSurf->IsUClosed()) Uperiod = Ulast - Ufirst; @@ -3439,11 +3441,11 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape RemoveEdgeFromMap(StartEdge, VEmap); TopTools_IndexedMapOfShape SplittingVertices; - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom2d_Curve) StartPCurve = BRep_Tool::CurveOnSurface(StartEdge, F_RefFace, fpar, lpar); TopoDS_Vertex StartVertex, CurVertex; TopExp::Vertices(StartEdge, StartVertex, CurVertex, Standard_True); //with orientation - Standard_Real StartParam, CurParam; + Standard_Real StartParam = NAN, CurParam = NAN; if (StartEdge.Orientation() == TopAbs_FORWARD) { StartParam = fpar; CurParam = lpar; @@ -3760,7 +3762,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape if (BRep_Tool::Degenerated(anEdge) || BRep_Tool::IsClosed(anEdge, RefFace)) continue; - Standard_Integer jj; + Standard_Integer jj = 0; for (jj = 1; jj <= Emaps.Length(); jj++) if (Emaps(jj).Contains(anEdge)) break; @@ -3942,7 +3944,7 @@ void ShapeUpgrade_UnifySameDomain::FillHistory() TopExp::MapShapes(myShape, TopAbs_SOLID , aMapResultShapes); // Iterate on all input shapes and get their modifications - Standard_Integer i, aNb = aMapInputShape.Extent(); + Standard_Integer i = 0, aNb = aMapInputShape.Extent(); for (i = 1; i <= aNb; ++i) { const TopoDS_Shape& aS = aMapInputShape(i); @@ -4054,7 +4056,7 @@ void SplitWire (const TopoDS_Wire& theWire, } else { - Standard_Real fpar, lpar; + Standard_Real fpar = NAN, lpar = NAN; Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(CurEdge, theFace, fpar, lpar); Standard_Real aParam = (CurEdge.Orientation() == TopAbs_FORWARD)? lpar : fpar; gp_Pnt2d aPoint; diff --git a/src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx b/src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx index 0bd2850378..1fcac73cd1 100644 --- a/src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx @@ -19,6 +19,8 @@ // abv 14.07.99 dealing with edges without 3d curve // svv 10.01.00 porting on DEC +#include + #include #include #include @@ -67,15 +69,15 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_WireDivide,ShapeUpgrade_Tool) //purpose : //======================================================================= ShapeUpgrade_WireDivide::ShapeUpgrade_WireDivide(): - ShapeUpgrade_Tool(), myStatus(0) + ShapeUpgrade_Tool(), myStatus(0), mySplitCurve3dTool(new ShapeUpgrade_SplitCurve3d), mySplitCurve2dTool(new ShapeUpgrade_SplitCurve2d), myTransferParamTool(new ShapeAnalysis_TransferParametersProj), myEdgeMode(2), myFixSmallCurveTool(new ShapeUpgrade_FixSmallCurves), myEdgeDivide(new ShapeUpgrade_EdgeDivide) { // if (ShapeUpgrade::Debug()) std::cout <<"ShapeUpgrade_WireDivide"<Value(len3d); Standard_Real Last2d = orig2d->Value(len2d); - Standard_Integer i;// svv #1 + Standard_Integer i = 0;// svv #1 for( i = 1; i <= len3d ; i++) { Standard_Real par = new2d->Value(i); Standard_Integer index = 0; @@ -232,7 +234,7 @@ static void CorrectSplitValues(const Handle(TColStd_HSequenceOfReal) orig3d, } } if(new2d->Value(len3d) > Last3d) { - Standard_Integer ind; // svv #1 + Standard_Integer ind = 0; // svv #1 for( ind = len3d; ind > 1 && !fixNew2d(ind); ind--); Standard_Real lastFix = new2d->Value(ind); for(i = len3d; i >= ind; i--) { @@ -257,7 +259,7 @@ static void CorrectSplitValues(const Handle(TColStd_HSequenceOfReal) orig3d, } } if(new3d->Value(len2d) > Last2d) { - Standard_Integer ind; // svv #1 + Standard_Integer ind = 0; // svv #1 for(ind = len2d; ind > 1 && !fixNew3d(ind); ind--); Standard_Real lastFix = new3d->Value(ind); for(i = len2d; i >= ind; i--) { @@ -364,7 +366,7 @@ void ShapeUpgrade_WireDivide::Perform () Handle(TColGeom2d_HArray1OfCurve) theSegments2dR; if ( isSeam ) { Handle(Geom2d_Curve) c2; - Standard_Real f2, l2; + Standard_Real f2 = NAN, l2 = NAN; //smh#8 TopoDS_Shape tmpE = E.Reversed(); TopoDS_Edge erev = TopoDS::Edge (tmpE ); @@ -436,7 +438,7 @@ void ShapeUpgrade_WireDivide::Perform () TopoDS_Vertex aVold = TopoDS::Vertex(aItv.Value()); aSeqNMVertices.Append(aVold); gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(aVold)); - Standard_Real ppar; + Standard_Real ppar = NAN; gp_Pnt pproj; if(!c3d.IsNull()) sac.Project(c3d,aP,Precision(),pproj,ppar,af,al,Standard_False); @@ -490,7 +492,7 @@ void ShapeUpgrade_WireDivide::Perform () FixSmallCurveTool->SetSplitCurve2dTool(theSplit2dTool); FixSmallCurveTool->SetPrecision(MinTolerance()); Standard_Integer Savnum =0; - Standard_Real SavParf; + Standard_Real SavParf = NAN; Standard_Integer Small = 0; for ( Standard_Integer icurv = 1; icurv <= nbc; icurv++ ) { @@ -505,7 +507,7 @@ void ShapeUpgrade_WireDivide::Perform () // construction of the intermediate Vertex TopoDS_Vertex V; if ( icurv <= nbc && nbc != 1 && ! isDeg ) { - Standard_Real par,parf /*,SavParl*/; + Standard_Real par = NAN,parf = NAN /*,SavParl*/; //Standard_Real SaveParf; // SaveParf not used - see below (skl) gp_Pnt P,P1,PM; // if edge has 3d curve, take point from it @@ -629,7 +631,7 @@ void ShapeUpgrade_WireDivide::Perform () Standard_Real f3d = 0., l3d =0.; if(!Savnum) Savnum = icurv; - Standard_Boolean srNew; + Standard_Boolean srNew = 0; if(!theNewCurve3d.IsNull()) { if(theNewCurve3d->IsKind(STANDARD_TYPE(Geom_BoundedCurve))) { f3d = theNewCurve3d->FirstParameter(); @@ -668,7 +670,7 @@ void ShapeUpgrade_WireDivide::Perform () sbe.CopyRanges(newEdge,E, alpha, beta);*/ Savnum =0; Handle(Geom2d_Curve) c2dTmp; - Standard_Real setF, setL; + Standard_Real setF = NAN, setL = NAN; if( ! myFace.IsNull() && sae.PCurve (newEdge, myFace, c2dTmp, setF, setL, Standard_False)) srNew &= ( (setF==f2d) && (setL==l2d) ); diff --git a/src/Standard/Standard.cxx b/src/Standard/Standard.cxx index bc601165c6..8302f55ccc 100644 --- a/src/Standard/Standard.cxx +++ b/src/Standard/Standard.cxx @@ -97,7 +97,7 @@ Standard_MMgrFactory::Standard_MMgrFactory() Standard_STATIC_ASSERT(sizeof(Standard_WideChar) == sizeof(Standard_Utf16Char)); #endif - char* aVar; + char* aVar = nullptr; aVar = getenv ("MMGT_OPT"); Standard_Integer anAllocId = (aVar ? atoi (aVar): OCCT_MMGT_OPT_DEFAULT); diff --git a/src/Standard/Standard_Condition.cxx b/src/Standard/Standard_Condition.cxx index 232ae2b2ec..b3325aa37d 100644 --- a/src/Standard/Standard_Condition.cxx +++ b/src/Standard/Standard_Condition.cxx @@ -134,8 +134,8 @@ bool Standard_Condition::Wait (int theTimeMilliseconds) pthread_mutex_lock (&myMutex); if (!myFlag) { - struct timespec aNow; - struct timespec aTimeout; + struct timespec aNow{}; + struct timespec aTimeout{}; conditionGetRealTime (aNow); aTimeout.tv_sec = (theTimeMilliseconds / 1000); aTimeout.tv_nsec = (theTimeMilliseconds - aTimeout.tv_sec * 1000) * 1000000; @@ -166,8 +166,8 @@ bool Standard_Condition::Check() pthread_mutex_lock (&myMutex); if (!myFlag) { - struct timespec aNow; - struct timespec aTimeout; + struct timespec aNow{}; + struct timespec aTimeout{}; conditionGetRealTime (aNow); aTimeout.tv_sec = aNow.tv_sec; aTimeout.tv_nsec = aNow.tv_nsec + 100; @@ -193,8 +193,8 @@ bool Standard_Condition::CheckReset() bool wasSignalled = myFlag; if (!myFlag) { - struct timespec aNow; - struct timespec aTimeout; + struct timespec aNow{}; + struct timespec aTimeout{}; conditionGetRealTime (aNow); aTimeout.tv_sec = aNow.tv_sec; aTimeout.tv_nsec = aNow.tv_nsec + 100; diff --git a/src/Standard/Standard_Condition.hxx b/src/Standard/Standard_Condition.hxx index d5c81913b3..4a976a9104 100644 --- a/src/Standard/Standard_Condition.hxx +++ b/src/Standard/Standard_Condition.hxx @@ -76,8 +76,8 @@ private: #ifdef _WIN32 void* myEvent; #else - pthread_mutex_t myMutex; - pthread_cond_t myCond; + pthread_mutex_t myMutex{}; + pthread_cond_t myCond{}; bool myFlag; #endif diff --git a/src/Standard/Standard_ErrorHandler.cxx b/src/Standard/Standard_ErrorHandler.cxx index 3fc6c189d9..3729eb9641 100644 --- a/src/Standard/Standard_ErrorHandler.cxx +++ b/src/Standard/Standard_ErrorHandler.cxx @@ -65,13 +65,13 @@ static inline Standard_ThreadId GetThreadID() //============================================================================ Standard_ErrorHandler::Standard_ErrorHandler () : - myStatus(Standard_HandlerVoid), myCallbackPtr(0) + myPrevious(Top), myStatus(Standard_HandlerVoid), myThread(GetThreadID()), myCallbackPtr(0) { - myThread = GetThreadID(); + memset (&myLabel, 0, sizeof(myLabel)); GetMutex().Lock(); - myPrevious = Top; + Top = this; GetMutex().Unlock(); } diff --git a/src/Standard/Standard_ErrorHandler.hxx b/src/Standard/Standard_ErrorHandler.hxx index 85b5ff9fe2..8db6cdf917 100644 --- a/src/Standard/Standard_ErrorHandler.hxx +++ b/src/Standard/Standard_ErrorHandler.hxx @@ -197,7 +197,7 @@ private: Standard_PErrorHandler myPrevious; Handle(Standard_Failure) myCaughtError; - Standard_JmpBuf myLabel; + Standard_JmpBuf myLabel{}; Standard_HandlerStatus myStatus; Standard_ThreadId myThread; Callback* myCallbackPtr; diff --git a/src/Standard/Standard_Failure.cxx b/src/Standard/Standard_Failure.cxx index 002c42a426..5820ebaa8f 100644 --- a/src/Standard/Standard_Failure.cxx +++ b/src/Standard/Standard_Failure.cxx @@ -112,10 +112,9 @@ Standard_Failure::Standard_Failure() // purpose : // ======================================================================= Standard_Failure::Standard_Failure (const Standard_CString theDesc) -: myMessage (NULL), - myStackTrace (NULL) +: myMessage(StringRef::allocate_message (theDesc)), myStackTrace (NULL) { - myMessage = StringRef::allocate_message (theDesc); + const Standard_Integer aStackLength = Standard_Failure_DefaultStackTraceLength; if (aStackLength > 0) { @@ -136,12 +135,8 @@ Standard_Failure::Standard_Failure (const Standard_CString theDesc) // ======================================================================= Standard_Failure::Standard_Failure (const Standard_CString theDesc, const Standard_CString theStackTrace) -: myMessage (NULL), - myStackTrace (NULL) -{ - myMessage = StringRef::allocate_message (theDesc); - myStackTrace = StringRef::allocate_message (theStackTrace); -} +: myMessage(StringRef::allocate_message (theDesc)), myStackTrace(StringRef::allocate_message (theStackTrace)) +{} // ======================================================================= // function : Standard_Failure @@ -149,11 +144,10 @@ Standard_Failure::Standard_Failure (const Standard_CString theDesc, // ======================================================================= Standard_Failure::Standard_Failure (const Standard_Failure& theFailure) : Standard_Transient (theFailure), - myMessage (NULL), - myStackTrace (NULL) + myMessage(StringRef::copy_message (theFailure.myMessage)), myStackTrace(StringRef::copy_message (theFailure.myStackTrace)) { - myMessage = StringRef::copy_message (theFailure.myMessage); - myStackTrace = StringRef::copy_message (theFailure.myStackTrace); + + } // ======================================================================= diff --git a/src/Standard/Standard_GUID.cxx b/src/Standard/Standard_GUID.cxx index 6383445f88..827a6876b4 100644 --- a/src/Standard/Standard_GUID.cxx +++ b/src/Standard/Standard_GUID.cxx @@ -104,7 +104,7 @@ Standard_Boolean Standard_GUID::CheckGUIDFormat(const Standard_CString aGuid) if (aGuid == NULL) return Standard_False; if (strlen(aGuid) == Standard_GUID_SIZE) { - Standard_Integer i; + Standard_Integer i = 0; for (i = 0; i < 8 && result; i++) { if (!IsXDigit(aGuid[i])) { @@ -244,32 +244,32 @@ Standard_GUID::Standard_GUID(const Standard_Integer a32b, const Standard_Byte a8b3, const Standard_Byte a8b4, const Standard_Byte a8b5, - const Standard_Byte a8b6) + const Standard_Byte a8b6) : my32b(a32b), my16b1(a16b1), my16b2(a16b2), my16b3(a16b3), my8b1(a8b1), my8b2(a8b2), my8b3(a8b3), my8b4(a8b4), my8b5(a8b5), my8b6(a8b6) { - my32b = a32b; - my16b1 = a16b1; - my16b2 = a16b2; - my16b3 = a16b3; - my8b1 = a8b1; - my8b2 = a8b2; - my8b3 = a8b3; - my8b4 = a8b4; - my8b5 = a8b5; - my8b6 = a8b6; + + + + + + + + + + } -Standard_GUID::Standard_GUID(const Standard_GUID& aGuid) +Standard_GUID::Standard_GUID(const Standard_GUID& aGuid) : my32b(aGuid.my32b), my16b1(aGuid.my16b1), my16b2(aGuid.my16b2), my16b3(aGuid.my16b3), my8b1(aGuid.my8b1), my8b2(aGuid.my8b2), my8b3(aGuid.my8b3), my8b4(aGuid.my8b4), my8b5(aGuid.my8b5), my8b6(aGuid.my8b6) { - my32b = aGuid.my32b; - my16b1 = aGuid.my16b1; - my16b2 = aGuid.my16b2; - my16b3 = aGuid.my16b3; - my8b1 = aGuid.my8b1; - my8b2 = aGuid.my8b2; - my8b3 = aGuid.my8b3; - my8b4 = aGuid.my8b4; - my8b5 = aGuid.my8b5; - my8b6 = aGuid.my8b6; + + + + + + + + + + } Standard_GUID::Standard_GUID (const Standard_UUID& theUUID) @@ -328,7 +328,7 @@ void Standard_GUID::ToExtString(const Standard_PExtCharacter aStrGuid) const Standard_UUID Standard_GUID::ToUUID() const { - Standard_UUID result ; + Standard_UUID result{} ; result.Data1 = my32b ; result.Data2 = my16b1 ; diff --git a/src/Standard/Standard_GUID.hxx b/src/Standard/Standard_GUID.hxx index 148e511161..236475b253 100644 --- a/src/Standard/Standard_GUID.hxx +++ b/src/Standard/Standard_GUID.hxx @@ -130,16 +130,16 @@ private: - Standard_Integer my32b; - Standard_ExtCharacter my16b1; - Standard_ExtCharacter my16b2; - Standard_ExtCharacter my16b3; - Standard_Byte my8b1; - Standard_Byte my8b2; - Standard_Byte my8b3; - Standard_Byte my8b4; - Standard_Byte my8b5; - Standard_Byte my8b6; + Standard_Integer my32b{}; + Standard_ExtCharacter my16b1{}; + Standard_ExtCharacter my16b2{}; + Standard_ExtCharacter my16b3{}; + Standard_Byte my8b1{}; + Standard_Byte my8b2{}; + Standard_Byte my8b3{}; + Standard_Byte my8b4{}; + Standard_Byte my8b5{}; + Standard_Byte my8b6{}; }; diff --git a/src/Standard/Standard_MMgrOpt.cxx b/src/Standard/Standard_MMgrOpt.cxx index e28d94ba23..325504803a 100644 --- a/src/Standard/Standard_MMgrOpt.cxx +++ b/src/Standard/Standard_MMgrOpt.cxx @@ -531,7 +531,7 @@ Standard_Integer Standard_MMgrOpt::Purge(Standard_Boolean ) while (aNextPool) { // fill the table of pools - Standard_Integer iPool; + Standard_Integer iPool = 0; for (iPool = 0; aNextPool && iPool < NB_POOLS_WIN; iPool++) { aPools[iPool] = aNextPool; aFreeSize[iPool] = 0; @@ -574,7 +574,7 @@ Standard_Integer Standard_MMgrOpt::Purge(Standard_Boolean ) // scan free blocks again, and remove those of them // that belong to free pools - Standard_Integer j; + Standard_Integer j = 0; for (i = 0; i <= nCells; i++ ) { Standard_Size * aFree = myFreeList[i]; Standard_Size * aPrevFree = NULL; diff --git a/src/Standard/Standard_MMgrRaw.cxx b/src/Standard/Standard_MMgrRaw.cxx index 83ec139446..ca08f4d4bf 100644 --- a/src/Standard/Standard_MMgrRaw.cxx +++ b/src/Standard/Standard_MMgrRaw.cxx @@ -21,9 +21,9 @@ //purpose : //======================================================================= -Standard_MMgrRaw::Standard_MMgrRaw(const Standard_Boolean aClear) +Standard_MMgrRaw::Standard_MMgrRaw(const Standard_Boolean aClear) : myClear(aClear) { - myClear = aClear; + } //======================================================================= diff --git a/src/Standard/Standard_MMgrTBBalloc.cxx b/src/Standard/Standard_MMgrTBBalloc.cxx index 8c7a2df17a..d3f12adb05 100644 --- a/src/Standard/Standard_MMgrTBBalloc.cxx +++ b/src/Standard/Standard_MMgrTBBalloc.cxx @@ -33,9 +33,9 @@ using namespace tbb; //purpose : //======================================================================= -Standard_MMgrTBBalloc::Standard_MMgrTBBalloc(const Standard_Boolean aClear) +Standard_MMgrTBBalloc::Standard_MMgrTBBalloc(const Standard_Boolean aClear) : myClear(aClear) { - myClear = aClear; + } //======================================================================= diff --git a/src/Standard/Standard_Mutex.hxx b/src/Standard/Standard_Mutex.hxx index 7197979d4d..d855174741 100644 --- a/src/Standard/Standard_Mutex.hxx +++ b/src/Standard/Standard_Mutex.hxx @@ -166,7 +166,7 @@ private: #if (defined(_WIN32) || defined(__WIN32__)) CRITICAL_SECTION myMutex; #else - pthread_mutex_t myMutex; + pthread_mutex_t myMutex{}; #endif }; diff --git a/src/Standard/Standard_OutOfMemory.hxx b/src/Standard/Standard_OutOfMemory.hxx index 0edcc3c366..23b02135c3 100644 --- a/src/Standard/Standard_OutOfMemory.hxx +++ b/src/Standard/Standard_OutOfMemory.hxx @@ -75,7 +75,7 @@ public: DEFINE_STANDARD_RTTIEXT(Standard_OutOfMemory,Standard_ProgramError) protected: - char myBuffer[1024]; + char myBuffer[1024]{}; }; #endif // _Standard_OutOfMemory_HeaderFile diff --git a/src/Standard/Standard_Real.cxx b/src/Standard/Standard_Real.cxx index f43762aeed..c642207377 100644 --- a/src/Standard/Standard_Real.cxx +++ b/src/Standard/Standard_Real.cxx @@ -13,6 +13,7 @@ // commercial license or contractual agreement. #include +#include #include #include #include @@ -34,7 +35,7 @@ Standard_Integer HashCode (const Standard_Real theReal, const Standard_Integer t { Standard_Real R; Standard_Integer I[2]; - } U; + } U{}; // U.R = Abs(me); // Treat me = -0.0 ADN 27/11/97 U.R = theReal; @@ -78,7 +79,7 @@ inline Standard_Real apx_for_ACosApprox (const Standard_Real x) Standard_Real ACosApprox (const Standard_Real Value) { - double XX; + double XX = NAN; if (Value < 0.) { XX = 1.+Value; if (XX < RealSmall()) @@ -157,7 +158,7 @@ union RealMap { //-------------------------------------------------------------------- static int HardwareHighBitsOfDouble() { - RealMap MaxDouble; + RealMap MaxDouble{}; MaxDouble.real = DBL_MAX; //========================================================= // representation of the max double in IEEE is @@ -179,7 +180,7 @@ static int HardwareHighBitsOfDouble() //-------------------------------------------------------------------- static int HardwareLowBitsOfDouble() { - RealMap MaxDouble; + RealMap MaxDouble{}; MaxDouble.real = DBL_MAX; //========================================================= // representation of the max double in IEEE is @@ -199,7 +200,7 @@ static int LowBitsOfDouble = HardwareLowBitsOfDouble(); double NextAfter(const double x, const double y) { - RealMap res; + RealMap res{}; res.real=x; diff --git a/src/Standard/Standard_ShortReal.cxx b/src/Standard/Standard_ShortReal.cxx index f3c123e13c..b705c33edc 100644 --- a/src/Standard/Standard_ShortReal.cxx +++ b/src/Standard/Standard_ShortReal.cxx @@ -29,7 +29,7 @@ Standard_Integer HashCode (const Standard_ShortReal theShortReal, const Standard { Standard_ShortReal R; Standard_Integer I; - } U; + } U{}; U.R = theShortReal; return HashCode (U.I, theUpperBound); diff --git a/src/Standard/Standard_Strtod.cxx b/src/Standard/Standard_Strtod.cxx index 0189619256..50e7e5c6ca 100644 --- a/src/Standard/Standard_Strtod.cxx +++ b/src/Standard/Standard_Strtod.cxx @@ -29,6 +29,8 @@ */ +#include + #include #define IEEE_8087 1 @@ -1599,10 +1601,10 @@ get_TI(void) static Bigint * Balloc(int k MTd) { - int x; - Bigint *rv; + int x = 0; + Bigint *rv = nullptr; #ifndef Omit_Private_Memory - unsigned int len; + unsigned int len = 0; #endif #ifdef MULTIPLE_THREADS ThInfo *TI; @@ -1677,17 +1679,17 @@ y->wds*sizeof(Long) + 2*sizeof(int)) static Bigint * multadd(Bigint *b, int m, int a MTd) /* multiply by m and add a */ { - int i, wds; + int i = 0, wds = 0; #ifdef ULLong - ULong *x; - ULLong carry, y; + ULong *x = nullptr; + ULLong carry = 0, y = 0; #else ULong carry, *x, y; #ifdef Pack_32 ULong xi, z; #endif #endif - Bigint *b1; + Bigint *b1 = nullptr; wds = b->wds; x = b->x; @@ -1729,9 +1731,9 @@ multadd(Bigint *b, int m, int a MTd) /* multiply by m and add a */ static Bigint * s2b(const char *s, int nd0, int nd, ULong y9, int dplen MTd) { - Bigint *b; - int i, k; - Long x, y; + Bigint *b = nullptr; + int i = 0, k = 0; + Long x = 0, y = 0; x = (nd + 8) / 9; for(k = 0, y = 1; x > y; y <<= 1, k++) ; @@ -1791,7 +1793,7 @@ hi0bits(ULong x) static int lo0bits(ULong *y) { - int k; + int k = 0; ULong x = *y; if (x & 7) { @@ -1834,7 +1836,7 @@ lo0bits(ULong *y) static Bigint * i2b(int i MTd) { - Bigint *b; + Bigint *b = nullptr; b = Balloc(1 MTa); b->x[0] = i; @@ -1845,12 +1847,12 @@ i2b(int i MTd) static Bigint * mult(Bigint *a, Bigint *b MTd) { - Bigint *c; - int k, wa, wb, wc; - ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; - ULong y; + Bigint *c = nullptr; + int k = 0, wa = 0, wb = 0, wc = 0; + ULong *x = nullptr, *xa = nullptr, *xae = nullptr, *xb = nullptr, *xbe = nullptr, *xc = nullptr, *xc0 = nullptr; + ULong y = 0; #ifdef ULLong - ULLong carry, z; + ULLong carry = 0, z = 0; #else ULong carry, z; #ifdef Pack_32 @@ -1950,11 +1952,11 @@ mult(Bigint *a, Bigint *b MTd) static Bigint * pow5mult(Bigint *b, int k MTd) { - Bigint *b1, *p5, *p51; + Bigint *b1 = nullptr, *p5 = nullptr, *p51 = nullptr; #ifdef MULTIPLE_THREADS ThInfo *TI; #endif - int i; + int i = 0; static int p05[3] = { 5, 25, 125 }; if ((i = k & 3)) @@ -2017,9 +2019,9 @@ pow5mult(Bigint *b, int k MTd) static Bigint * lshift(Bigint *b, int k MTd) { - int i, k1, n, n1; - Bigint *b1; - ULong *x, *x1, *xe, z; + int i = 0, k1 = 0, n = 0, n1 = 0; + Bigint *b1 = nullptr; + ULong *x = nullptr, *x1 = nullptr, *xe = nullptr, z = 0; #ifdef Pack_32 n = k >> 5; @@ -2072,8 +2074,8 @@ lshift(Bigint *b, int k MTd) static int cmp(Bigint *a, Bigint *b) { - ULong *xa, *xa0, *xb, *xb0; - int i, j; + ULong *xa = nullptr, *xa0 = nullptr, *xb = nullptr, *xb0 = nullptr; + int i = 0, j = 0; i = a->wds; j = b->wds; @@ -2101,11 +2103,11 @@ cmp(Bigint *a, Bigint *b) static Bigint * diff(Bigint *a, Bigint *b MTd) { - Bigint *c; - int i, wa, wb; - ULong *xa, *xae, *xb, *xbe, *xc; + Bigint *c = nullptr; + int i = 0, wa = 0, wb = 0; + ULong *xa = nullptr, *xae = nullptr, *xb = nullptr, *xbe = nullptr, *xc = nullptr; #ifdef ULLong - ULLong borrow, y; + ULLong borrow = 0, y = 0; #else ULong borrow, y; #ifdef Pack_32 @@ -2190,7 +2192,7 @@ diff(Bigint *a, Bigint *b MTd) static double ulp(U *x) { - Long L; + Long L = 0; U u; L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; @@ -2227,8 +2229,8 @@ ulp(U *x) static double b2d(Bigint *a, int *e) { - ULong *xa, *xa0, w, y, z; - int k; + ULong *xa = nullptr, *xa0 = nullptr, w = 0, y = 0, z = 0; + int k = 0; U d; #ifdef VAX ULong d0, d1; @@ -2292,11 +2294,11 @@ b2d(Bigint *a, int *e) static Bigint * d2b(U *d, int *e, int *bits MTd) { - Bigint *b; - int de, k; - ULong *x, y, z; + Bigint *b = nullptr; + int de = 0, k = 0; + ULong *x = nullptr, y = 0, z = 0; #ifndef Sudden_Underflow - int i; + int i = 0; #endif #ifdef VAX ULong d0, d1; @@ -2422,7 +2424,7 @@ d2b(U *d, int *e, int *bits MTd) ratio(Bigint *a, Bigint *b) { U da, db; - int k, ka, kb; + int k = 0, ka = 0, kb = 0; dval(&da) = b2d(a, &ka); dval(&db) = b2d(b, &kb); @@ -2560,7 +2562,7 @@ static unsigned char hexdig[256] = { static int match(const char **sp, const char *t) { - int c, d; + int c = 0, d = 0; const char *s = *sp; while((d = *t++)) { @@ -2577,9 +2579,9 @@ match(const char **sp, const char *t) static void hexnan(U *rvp, const char **sp) { - ULong c, x[2]; - const char *s; - int c1, havedig, udx0, xshift; + ULong c = 0, x[2]; + const char *s = nullptr; + int c1 = 0, havedig = 0, udx0 = 0, xshift = 0; /**** if (!hexdig['0']) hexdig_init(); ****/ x[0] = x[1] = 0; @@ -2651,8 +2653,8 @@ hexnan(U *rvp, const char **sp) static Bigint * increment(Bigint *b MTd) { - ULong *x, *xe; - Bigint *b1; + ULong *x = nullptr, *xe = nullptr; + Bigint *b1 = nullptr; x = b->x; xe = x + b->wds; @@ -2682,8 +2684,8 @@ increment(Bigint *b MTd) static void rshift(Bigint *b, int k) { - ULong *x, *x1, *xe, y; - int n; + ULong *x = nullptr, *x1 = nullptr, *xe = nullptr, y = 0; + int n = 0; x = x1 = b->x; n = k >> kshift; @@ -2711,8 +2713,8 @@ rshift(Bigint *b, int k) static ULong any_on(Bigint *b, int k) { - int n, nwds; - ULong *x, *x0, x1, x2; + int n = 0, nwds = 0; + ULong *x = nullptr, *x0 = nullptr, x1 = 0, x2 = 0; x = b->x; nwds = b->wds; @@ -2744,11 +2746,11 @@ enum { /* rounding values: same as FLT_ROUNDS */ void gethex( const char **sp, U *rvp, int rounding, int sign MTd) { - Bigint *b; - const unsigned char *decpt, *s0, *s, *s1; - Long e, e1; - ULong L, lostbits, *x; - int big, denorm, esign, havedig, k, n, nbits, up, zret; + Bigint *b = nullptr; + const unsigned char *decpt = nullptr, *s0 = nullptr, *s = nullptr, *s1 = nullptr; + Long e = 0, e1 = 0; + ULong L = 0, lostbits = 0, *x = nullptr; + int big = 0, denorm = 0, esign = 0, havedig = 0, k = 0, n = 0, nbits = 0, up = 0, zret = 0; #ifdef IBM int j; #endif @@ -3118,10 +3120,10 @@ dshift(Bigint *b, int p2) static int quorem(Bigint *b, Bigint *S) { - int n; - ULong *bx, *bxe, q, *sx, *sxe; + int n = 0; + ULong *bx = nullptr, *bxe = nullptr, q = 0, *sx = nullptr, *sxe = nullptr; #ifdef ULLong - ULLong borrow, carry, y, ys; + ULLong borrow = 0, carry = 0, y = 0, ys = 0; #else ULong borrow, carry, y, ys; #ifdef Pack_32 @@ -3239,8 +3241,8 @@ quorem(Bigint *b, Bigint *S) sulp(U *x, BCinfo *bc) { U u; - double rv; - int i; + double rv = NAN; + int i = 0; rv = ulp(x); if (!bc->scale || (i = 2*P + 1 - ((word0(x) & Exp_mask) >> Exp_shift)) <= 0) @@ -3255,8 +3257,8 @@ sulp(U *x, BCinfo *bc) static void bigcomp(U *rv, const char *s0, BCinfo *bc MTd) { - Bigint *b, *d; - int b2, bbits, d2, dd=0, dig, dsign, i, j, nd, nd0, p2, p5, speccase; + Bigint *b = nullptr, *d = nullptr; + int b2 = 0, bbits = 0, d2 = 0, dd=0, dig = 0, dsign = 0, i = 0, j = 0, nd = 0, nd0 = 0, p2 = 0, p5 = 0, speccase = 0; dsign = bc->dsign; nd = bc->nd; @@ -3458,22 +3460,22 @@ retlow1: double Strtod(const char *s00, char **se) { - int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, e, e1; - int esign, i, j, k, nd, nd0, nf, nz, nz0, nz1, sign; - const char *s, *s0, *s1; - double aadj, aadj1; - Long L; + int bb2 = 0, bb5 = 0, bbe = 0, bd2 = 0, bd5 = 0, bbbits = 0, bs2 = 0, c = 0, e = 0, e1 = 0; + int esign = 0, i = 0, j = 0, k = 0, nd = 0, nd0 = 0, nf = 0, nz = 0, nz0 = 0, nz1 = 0, sign = 0; + const char *s = nullptr, *s0 = nullptr, *s1 = nullptr; + double aadj = NAN, aadj1 = NAN; + Long L = 0; U aadj2, adj, rv, rv0; - ULong y, z; + ULong y = 0, z = 0; BCinfo bc; Bigint *bb=0, *bb1=0, *bd=0, *bd0=0, *bs=0, *delta=0; #ifdef USE_BF96 - ULLong bhi, blo, brv, t00, t01, t02, t10, t11, terv, tg, tlo, yz; - const BF96 *p10; - int bexact, erv; + ULLong bhi = 0, blo = 0, brv = 0, t00 = 0, t01 = 0, t02 = 0, t10 = 0, t11 = 0, terv = 0, tg = 0, tlo = 0, yz = 0; + const BF96 *p10 = nullptr; + int bexact = 0, erv = 0; #endif #ifdef Avoid_Underflow - ULong Lsb, Lsb1; + ULong Lsb = 0, Lsb1 = 0; #endif #ifdef SET_INEXACT int oldinexact; diff --git a/src/StdPrs/StdPrs_Curve.cxx b/src/StdPrs/StdPrs_Curve.cxx index cde1d4ec4d..a2da424787 100644 --- a/src/StdPrs/StdPrs_Curve.cxx +++ b/src/StdPrs/StdPrs_Curve.cxx @@ -17,6 +17,8 @@ // Great zoom leads to non-coincidence of // a point and non-infinite lines passing through this point: +#include + #include #include #include @@ -84,7 +86,7 @@ static void FindLimits(const Adaptor3d_Curve& aCurve, // purpose: //================================================================== static void DrawCurve (const Adaptor3d_Curve& aCurve, - const Handle(Graphic3d_Group) aGroup, + const Handle(Graphic3d_Group)& aGroup, const Standard_Integer NbP, const Standard_Real U1, const Standard_Real U2, @@ -153,7 +155,7 @@ static Standard_Boolean MatchCurve ( const Standard_Real U1, const Standard_Real U2) { - Standard_Real retdist; + Standard_Real retdist = NAN; switch (aCurve.GetType()) { case GeomAbs_Line: @@ -219,7 +221,7 @@ void StdPrs_Curve::Add (const Handle (Prs3d_Presentation)& aPresentation, { aPresentation->CurrentGroup()->SetPrimitivesAspect(aDrawer->LineAspect()->Aspect()); - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; FindLimits(aCurve, aDrawer->MaximalParameterValue(), V1, V2); const Standard_Integer NbPoints = aDrawer->Discretisation(); @@ -247,7 +249,7 @@ void StdPrs_Curve::Add (const Handle (Prs3d_Presentation)& aPresentation, TColgp_SequenceOfPnt& Points, const Standard_Boolean drawCurve) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; FindLimits(aCurve, aDrawer->MaximalParameterValue(), V1, V2); const Standard_Integer NbPoints = aDrawer->Discretisation(); @@ -315,7 +317,7 @@ Standard_Boolean StdPrs_Curve::Match const Adaptor3d_Curve& aCurve, const Handle (Prs3d_Drawer)& aDrawer) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; FindLimits(aCurve, aDrawer->MaximalParameterValue(), V1, V2); const Standard_Integer NbPoints = aDrawer->Discretisation(); @@ -339,7 +341,7 @@ Standard_Boolean StdPrs_Curve::Match const Standard_Real aLimit, const Standard_Integer NbPoints) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; FindLimits(aCurve, aLimit, V1, V2); return MatchCurve(X,Y,Z,aDistance,aCurve, diff --git a/src/StdPrs/StdPrs_DeflectionCurve.cxx b/src/StdPrs/StdPrs_DeflectionCurve.cxx index 4b16d010a4..c0be98f4d6 100644 --- a/src/StdPrs/StdPrs_DeflectionCurve.cxx +++ b/src/StdPrs/StdPrs_DeflectionCurve.cxx @@ -15,6 +15,8 @@ // Great zoom leads to non-coincidence of // a point and non-infinite lines passing through this point: +#include + #include #include #include @@ -42,14 +44,14 @@ static Standard_Real GetDeflection(const Adaptor3d_Curve& aCurve, const Standard_Real U2, const Handle(Prs3d_Drawer)& aDrawer) { - Standard_Real TheDeflection; + Standard_Real TheDeflection = NAN; if (aDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE) { // On calcule la fleche en fonction des min max globaux de la piece: Bnd_Box Total; BndLib_Add3dCurve::Add(aCurve, U1, U2, 0.,Total); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; Total.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); Standard_Real m = RealLast(); if ( ! (Total.IsOpenXmin() || Total.IsOpenXmax() )) @@ -156,8 +158,8 @@ static void drawCurve (Adaptor3d_Curve& aCurve, TColStd_Array1OfReal T(1, nbinter+1); aCurve.Intervals(T, GeomAbs_C1); - Standard_Real theU1, theU2; - Standard_Integer NumberOfPoints, i, j; + Standard_Real theU1 = NAN, theU2 = NAN; + Standard_Integer NumberOfPoints = 0, i = 0, j = 0; TColgp_SequenceOfPnt SeqP; for (j = 1; j <= nbinter; j++) { @@ -212,7 +214,7 @@ static Standard_Boolean MatchCurve ( const Standard_Real U1, const Standard_Real U2) { - Standard_Real retdist; + Standard_Real retdist = NAN; switch (aCurve.GetType()) { case GeomAbs_Line: @@ -288,7 +290,7 @@ void StdPrs_DeflectionCurve::Add (const Handle (Prs3d_Presentation)& aPresentati aGroup->SetPrimitivesAspect (aDrawer->LineAspect()->Aspect()); } - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; if (FindLimits(aCurve, aDrawer->MaximalParameterValue(), V1, V2)) { TColgp_SequenceOfPnt Points; @@ -392,7 +394,7 @@ void StdPrs_DeflectionCurve::Add (const Handle (Prs3d_Presentation)& aPresentati const Standard_Real anAngle, const Standard_Boolean theToDrawCurve) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; if (!FindLimits(aCurve, aLimit, V1, V2)) { return; @@ -420,7 +422,7 @@ void StdPrs_DeflectionCurve::Add (const Handle (Prs3d_Presentation)& aPresentati TColgp_SequenceOfPnt& Points, const Standard_Boolean theToDrawCurve) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; if (!FindLimits(aCurve, aDrawer->MaximalParameterValue(), V1, V2)) { return; @@ -447,7 +449,7 @@ Standard_Boolean StdPrs_DeflectionCurve::Match const Adaptor3d_Curve& aCurve, const Handle (Prs3d_Drawer)& aDrawer) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; if (FindLimits(aCurve, aDrawer->MaximalParameterValue(), V1, V2)) { return MatchCurve(X,Y,Z,aDistance,aCurve, @@ -515,7 +517,7 @@ Standard_Boolean StdPrs_DeflectionCurve::Match const Standard_Real aLimit, const Standard_Real anAngle) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; if (FindLimits(aCurve, aLimit, V1, V2)) { return MatchCurve(X,Y,Z,aDistance,aCurve,aDeflection,anAngle,V1,V2); diff --git a/src/StdPrs/StdPrs_HLRPolyShape.cxx b/src/StdPrs/StdPrs_HLRPolyShape.cxx index ef2de23a70..e99594d313 100644 --- a/src/StdPrs/StdPrs_HLRPolyShape.cxx +++ b/src/StdPrs/StdPrs_HLRPolyShape.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -75,12 +77,12 @@ void StdPrs_HLRPolyShape::ComputeHLR (const Handle(Prs3d_Presentation)& aPresent Handle(HLRBRep_PolyAlgo) hider = new HLRBRep_PolyAlgo(aShape); hider->Projector (aProj); hider->Update(); - Standard_Real sta,end,dx,dy,dz; - Standard_ShortReal tolsta, tolend; + Standard_Real sta = NAN,end = NAN,dx = NAN,dy = NAN,dz = NAN; + Standard_ShortReal tolsta = NAN, tolend = NAN; HLRAlgo_EdgeStatus status; HLRAlgo_EdgeIterator It; - Standard_Boolean reg1,regn,outl, intl; - Standard_Address Coordinates; + Standard_Boolean reg1 = 0,regn = 0,outl = 0, intl = 0; + Standard_Address Coordinates = nullptr; TopoDS_Shape S; HLRBRep_ListOfBPoint BiPntVis, BiPntHid; diff --git a/src/StdPrs/StdPrs_HLRShape.cxx b/src/StdPrs/StdPrs_HLRShape.cxx old mode 100755 new mode 100644 index 8c10e81bcc..3ea9e7ef67 --- a/src/StdPrs/StdPrs_HLRShape.cxx +++ b/src/StdPrs/StdPrs_HLRShape.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -43,8 +45,8 @@ void StdPrs_HLRShape::ComputeHLR (const Handle(Prs3d_Presentation)& thePresentat StdPrs_HLRToolShape aTool(theShape, aProj); Standard_Integer aNbEdges = aTool.NbEdges(); - Standard_Integer anI; - Standard_Real anU1, anU2; + Standard_Integer anI = 0; + Standard_Real anU1 = NAN, anU2 = NAN; BRepAdaptor_Curve aCurve; Standard_Real aDeviation = theDrawer->MaximalChordialDeviation(); Handle(Graphic3d_Group) aGroup = thePresentation->CurrentGroup(); diff --git a/src/StdPrs/StdPrs_HLRToolShape.cxx b/src/StdPrs/StdPrs_HLRToolShape.cxx index be3b1a47d0..f89929c5aa 100644 --- a/src/StdPrs/StdPrs_HLRToolShape.cxx +++ b/src/StdPrs/StdPrs_HLRToolShape.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -20,7 +22,7 @@ StdPrs_HLRToolShape::StdPrs_HLRToolShape ( const TopoDS_Shape& TheShape, - const HLRAlgo_Projector& TheProjector) + const HLRAlgo_Projector& TheProjector) : MyCurrentEdgeNumber(0) { Handle(HLRBRep_Algo) Hider = new HLRBRep_Algo(); Standard_Integer nbIso = 0; // 5; @@ -29,7 +31,7 @@ StdPrs_HLRToolShape::StdPrs_HLRToolShape ( Hider->Update(); Hider->Hide(); MyData = Hider->DataStructure(); - MyCurrentEdgeNumber = 0; + } Standard_Integer StdPrs_HLRToolShape::NbEdges() const { @@ -54,7 +56,7 @@ void StdPrs_HLRToolShape::Visible(BRepAdaptor_Curve& TheEdge, .ChangeValue(MyCurrentEdgeNumber) .ChangeGeometry() .Curve(); - Standard_ShortReal t1,t2; + Standard_ShortReal t1 = NAN,t2 = NAN; myEdgeIterator.Visible(U1,t1,U2,t2); } void StdPrs_HLRToolShape::InitHidden(const Standard_Integer EdgeNumber) { @@ -76,6 +78,6 @@ void StdPrs_HLRToolShape::Hidden (BRepAdaptor_Curve& TheEdge, .ChangeValue(MyCurrentEdgeNumber) .ChangeGeometry() .Curve(); - Standard_ShortReal t1,t2; + Standard_ShortReal t1 = NAN,t2 = NAN; myEdgeIterator.Hidden(U1,t1,U2,t2); } diff --git a/src/StdPrs/StdPrs_Isolines.cxx b/src/StdPrs/StdPrs_Isolines.cxx index ca64927abd..58748f70ae 100644 --- a/src/StdPrs/StdPrs_Isolines.cxx +++ b/src/StdPrs/StdPrs_Isolines.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -199,7 +201,7 @@ void StdPrs_Isolines::AddOnTriangulation (const TopoDS_Face& theFace, const Handle(Standard_Type)& TheType = aSurface->DynamicType(); if (TheType == STANDARD_TYPE(Geom_OffsetSurface)) { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; aSurface->Bounds(u1, u2, v1, v2); //Isolines of Offset surfaces are calculated by approximation and //cannot be calculated for infinite limits. diff --git a/src/StdPrs/StdPrs_Plane.cxx b/src/StdPrs/StdPrs_Plane.cxx index 40d1bcc7a5..5f8823846a 100644 --- a/src/StdPrs/StdPrs_Plane.cxx +++ b/src/StdPrs/StdPrs_Plane.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -40,7 +42,7 @@ void StdPrs_Plane::Add (const Handle (Prs3d_Presentation)& aPresentation, Handle(Prs3d_PlaneAspect) theaspect = aDrawer->PlaneAspect(); gp_Pnt p1; - Standard_Real Xmax,Ymax; + Standard_Real Xmax = NAN,Ymax = NAN; Xmax = 0.5*Standard_Real(theaspect->PlaneXLength()); Ymax = 0.5*Standard_Real(theaspect->PlaneYLength()); if (theaspect->DisplayEdges()) { @@ -61,7 +63,7 @@ void StdPrs_Plane::Add (const Handle (Prs3d_Presentation)& aPresentation, const Standard_Integer nbx = Standard_Integer(Abs(2.*Xmax) / dist) - 1; const Standard_Integer nby = Standard_Integer(Abs(2.*Ymax) / dist) - 1; Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2*(nbx+nby)); - Standard_Integer i; + Standard_Integer i = 0; Standard_Real cur = -Xmax+dist; for (i = 0; i < nbx; i++, cur += dist) { aPrims->AddVertex(thegeom->Value(cur, Ymax)); diff --git a/src/StdPrs/StdPrs_PoleCurve.cxx b/src/StdPrs/StdPrs_PoleCurve.cxx index 787ef66dd5..e96a863e7f 100644 --- a/src/StdPrs/StdPrs_PoleCurve.cxx +++ b/src/StdPrs/StdPrs_PoleCurve.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -42,7 +44,7 @@ void StdPrs_PoleCurve::Add (const Handle (Prs3d_Presentation)& aPresentation, GeomAbs_CurveType CType = aCurve.GetType(); if (CType == GeomAbs_BezierCurve || CType == GeomAbs_BSplineCurve) { - Standard_Integer i, Nb; + Standard_Integer i = 0, Nb = 0; if (CType == GeomAbs_BezierCurve) { Handle(Geom_BezierCurve) Bz = aCurve.Bezier(); Nb = Bz->NbPoles(); @@ -87,8 +89,8 @@ Standard_Boolean StdPrs_PoleCurve::Match(const Standard_Real X, const Handle (Prs3d_Drawer)& /*aDrawer*/) { GeomAbs_CurveType CType = aCurve.GetType(); - Standard_Integer i, Nb = 0; - Standard_Real x,y,z; + Standard_Integer i = 0, Nb = 0; + Standard_Real x = NAN,y = NAN,z = NAN; if (CType == GeomAbs_BezierCurve) { Handle(Geom_BezierCurve) Bz = aCurve.Bezier(); Nb = Bz->NbPoles(); @@ -123,9 +125,9 @@ Standard_Integer StdPrs_PoleCurve::Pick const Adaptor3d_Curve& aCurve, const Handle(Prs3d_Drawer)& /*aDrawer*/) { - Standard_Real x, y, z, DistMin = RealLast(); - Standard_Integer num = 0, i, Nb = 0; - Standard_Real dist; + Standard_Real x = NAN, y = NAN, z = NAN, DistMin = RealLast(); + Standard_Integer num = 0, i = 0, Nb = 0; + Standard_Real dist = NAN; GeomAbs_CurveType CType = aCurve.GetType(); if (CType == GeomAbs_BezierCurve) { diff --git a/src/StdPrs/StdPrs_ShadedSurface.cxx b/src/StdPrs/StdPrs_ShadedSurface.cxx index ab0e9dddcb..92f9a62be7 100644 --- a/src/StdPrs/StdPrs_ShadedSurface.cxx +++ b/src/StdPrs/StdPrs_ShadedSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -52,7 +54,7 @@ void StdPrs_ShadedSurface::Add (const Handle(Prs3d_Presentation)& thePrs, theSurface.UIntervals (anInterU, GeomAbs_C1); theSurface.VIntervals (anInterV, GeomAbs_C1); - Standard_Real U1, U2, V1, V2, DU, DV; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN, DU = NAN, DV = NAN; gp_Pnt P1, P2; gp_Vec D1U, D1V, D1, D2; diff --git a/src/StdPrs/StdPrs_ShapeTool.hxx b/src/StdPrs/StdPrs_ShapeTool.hxx index 6411fd6d64..abf21db1ae 100644 --- a/src/StdPrs/StdPrs_ShapeTool.hxx +++ b/src/StdPrs/StdPrs_ShapeTool.hxx @@ -99,8 +99,8 @@ private: TopExp_Explorer myFaceExplorer; TopTools_IndexedDataMapOfShapeListOfShape myEdgeMap; TopTools_IndexedMapOfShape myVertexMap; - Standard_Integer myEdge; - Standard_Integer myVertex; + Standard_Integer myEdge{}; + Standard_Integer myVertex{}; }; diff --git a/src/StdPrs/StdPrs_ToolRFace.cxx b/src/StdPrs/StdPrs_ToolRFace.cxx index 4f40be4844..db68055bf6 100644 --- a/src/StdPrs/StdPrs_ToolRFace.cxx +++ b/src/StdPrs/StdPrs_ToolRFace.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -53,7 +55,7 @@ const TopoDS_Edge& StdPrs_ToolRFace::Edge() const //======================================================================= void StdPrs_ToolRFace::next() { - Standard_Real aParamU1, aParamU2; + Standard_Real aParamU1 = NAN, aParamU2 = NAN; for (; myExplorer.More(); myExplorer.Next()) { // skip INTERNAL and EXTERNAL edges diff --git a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx index 4cbe46d26c..8aceae538a 100644 --- a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx +++ b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -123,7 +125,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add // update min max for the hatcher. gp_Pnt2d P1,P2; - Standard_Real U1, U2; + Standard_Real U1 = NAN, U2 = NAN; gp_Pnt dummypnt; Standard_Real ddefle= Max(UMax-UMin, VMax-VMin) * aDrawer->DeviationCoefficient(); TColgp_SequenceOfPnt2d tabP; @@ -401,9 +403,9 @@ Standard_Boolean StdPrs_WFDeflectionRestrictedFace::Match const Standard_Real aLimit = aDrawer->MaximalParameterValue(); // compute bounds of the restriction - Standard_Real UMin,UMax,VMin,VMax; - Standard_Real u,v,step; - Standard_Integer i,nbPoints = 10; + Standard_Real UMin = NAN,UMax = NAN,VMin = NAN,VMax = NAN; + Standard_Real u = NAN,v = NAN,step = NAN; + Standard_Integer i = 0,nbPoints = 10; UMin = VMin = RealLast(); UMax = VMax = RealFirst(); diff --git a/src/StdPrs/StdPrs_WFDeflectionSurface.cxx b/src/StdPrs/StdPrs_WFDeflectionSurface.cxx index e063112371..9ae64697bf 100644 --- a/src/StdPrs/StdPrs_WFDeflectionSurface.cxx +++ b/src/StdPrs/StdPrs_WFDeflectionSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -43,7 +45,7 @@ static void FindLimits(const Handle(Adaptor3d_Surface)& surf , if (UfirstInf || UlastInf) { gp_Pnt P1,P2; - Standard_Real v; + Standard_Real v = NAN; if (VfirstInf && VlastInf) v = 0; else if (VfirstInf) @@ -130,14 +132,14 @@ void StdPrs_WFDeflectionSurface::Add ( const Handle(Adaptor3d_Surface)& aSurface, const Handle (Prs3d_Drawer)& aDrawer) { - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; Standard_Real MaxP = aDrawer->MaximalParameterValue(); FindLimits(aSurface, MaxP, U1, U2, V1, V2); Standard_Boolean UClosed = aSurface->IsUClosed(); Standard_Boolean VClosed = aSurface->IsVClosed(); - Standard_Real TheDeflection; + Standard_Real TheDeflection = NAN; Aspect_TypeOfDeflection TOD = aDrawer->TypeOfDeflection(); if (TOD == Aspect_TOD_RELATIVE) { // On calcule la fleche en fonction des min max globaux de la piece: @@ -145,7 +147,7 @@ void StdPrs_WFDeflectionSurface::Add ( BndLib_AddSurface::Add (*aSurface, U1, U2, V1, V2, 0., Total); Standard_Real m = aDrawer->MaximalChordialDeviation()/ aDrawer->DeviationCoefficient(); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; Total.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); if ( ! (Total.IsOpenXmin() || Total.IsOpenXmax() )) m = Min ( m , Abs (aXmax-aXmin)); diff --git a/src/StdPrs/StdPrs_WFPoleSurface.cxx b/src/StdPrs/StdPrs_WFPoleSurface.cxx index 1a180a26d1..7ffe876934 100644 --- a/src/StdPrs/StdPrs_WFPoleSurface.cxx +++ b/src/StdPrs/StdPrs_WFPoleSurface.cxx @@ -28,7 +28,7 @@ static void AddPoles(const Handle (Prs3d_Presentation)& aPresentation, const TColgp_Array2OfPnt& A, const Handle (Prs3d_Drawer)& aDrawer) { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; const Standard_Integer n = A.ColLength(); const Standard_Integer m = A.RowLength(); @@ -64,7 +64,7 @@ void StdPrs_WFPoleSurface::Add (const Handle (Prs3d_Presentation)& aPresentation GeomAbs_SurfaceType SType = aSurface.GetType(); if (SType == GeomAbs_BezierSurface || SType == GeomAbs_BSplineSurface) { - Standard_Integer n , m; + Standard_Integer n = 0 , m = 0; if (SType == GeomAbs_BezierSurface) { Handle(Geom_BezierSurface) B = aSurface.Bezier(); n = aSurface.NbUPoles(); diff --git a/src/StdPrs/StdPrs_WFRestrictedFace.cxx b/src/StdPrs/StdPrs_WFRestrictedFace.cxx old mode 100755 new mode 100644 index 52f176cf91..d74dcecdec --- a/src/StdPrs/StdPrs_WFRestrictedFace.cxx +++ b/src/StdPrs/StdPrs_WFRestrictedFace.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -46,8 +48,8 @@ void StdPrs_WFRestrictedFace::Add StdPrs_ToolRFace aToolRst (theFace); // Compute bounds of the restriction - Standard_Real aUMin,aUMax,aVMin,aVMax; - Standard_Integer anI; + Standard_Real aUMin = NAN,aUMax = NAN,aVMin = NAN,aVMax = NAN; + Standard_Integer anI = 0; gp_Pnt2d aPoint1,aPoint2; Bnd_Box2d aBndBox; @@ -109,7 +111,7 @@ void StdPrs_WFRestrictedFace::Add } // Trim the isos - Standard_Real anU1, anU2, anU, aDU; + Standard_Real anU1 = NAN, anU2 = NAN, anU = NAN, aDU = NAN; for (aToolRst.Init(); aToolRst.More(); aToolRst.Next()) { @@ -229,9 +231,9 @@ Standard_Boolean StdPrs_WFRestrictedFace::Match StdPrs_ToolRFace aToolRst (theFace); // Compute bounds of the restriction - Standard_Real anUMin,anUMax,aVMin,aVMax; - Standard_Real anU,aV,aStep; - Standard_Integer anI,anNbP = 10; + Standard_Real anUMin = NAN,anUMax = NAN,aVMin = NAN,aVMax = NAN; + Standard_Real anU = NAN,aV = NAN,aStep = NAN; + Standard_Integer anI = 0,anNbP = 10; anUMin = aVMin = RealLast(); anUMax = aVMax = RealFirst(); gp_Pnt2d aPoint1,aPoint2; @@ -309,7 +311,7 @@ Standard_Boolean StdPrs_WFRestrictedFace::Match } // Trim the isos - Standard_Real anU1, anU2, aDU; + Standard_Real anU1 = NAN, anU2 = NAN, aDU = NAN; for (aToolRst.Init(); aToolRst.More(); aToolRst.Next()) { diff --git a/src/StdPrs/StdPrs_WFSurface.cxx b/src/StdPrs/StdPrs_WFSurface.cxx index d69d2fcfb0..df375dd669 100644 --- a/src/StdPrs/StdPrs_WFSurface.cxx +++ b/src/StdPrs/StdPrs_WFSurface.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -45,7 +47,7 @@ static void FindLimits(const Handle(Adaptor3d_Surface)& surf , if (UfirstInf || UlastInf) { gp_Pnt P1,P2; - Standard_Real v; + Standard_Real v = NAN; if (VfirstInf && VlastInf) v = 0; else if (VfirstInf) @@ -129,7 +131,7 @@ void StdPrs_WFSurface::Add (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer) { - Standard_Real U1, U2, V1, V2; + Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN; Standard_Real MaxP = aDrawer->MaximalParameterValue(); FindLimits(aSurface, MaxP, U1, U2, V1, V2); diff --git a/src/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/StdSelect/StdSelect_BRepSelectionTool.cxx index 07b5a96543..93e932dc32 100644 --- a/src/StdSelect/StdSelect_BRepSelectionTool.cxx +++ b/src/StdSelect/StdSelect_BRepSelectionTool.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -503,8 +505,8 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive (const TopoDS_Shape& theShape Standard_Integer aNbIntervals = cu3d.NbIntervals (GeomAbs_C1); TColStd_Array1OfReal anIntervals (1, aNbIntervals + 1); cu3d.Intervals (anIntervals, GeomAbs_C1); - Standard_Real aV1, aV2; - Standard_Integer aNumberOfPoints; + Standard_Real aV1 = NAN, aV2 = NAN; + Standard_Integer aNumberOfPoints = 0; TColgp_SequenceOfPnt aPointsSeq; for (Standard_Integer anIntervalId = 1; anIntervalId <= aNbIntervals; ++anIntervalId) { @@ -546,7 +548,7 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive (const TopoDS_Shape& theShape nbintervals = Max (1, nbintervals / 3); } - Standard_Real aParam; + Standard_Real aParam = NAN; Standard_Integer aPntNb = Max (2, theNbPOnEdge * nbintervals); Standard_Real aParamDelta = (aParamLast - aParamFirst) / (aPntNb - 1); Handle(TColgp_HArray1OfPnt) aPointArray = new TColgp_HArray1OfPnt (1, aPntNb); @@ -668,7 +670,7 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace (const TopoDS_ gp_Trsf aTrsf; aTrsf.SetTransformation (aCone.Position(), gp::XOY()); - Standard_Real aRad2; + Standard_Real aRad2 = NAN; if (aRad1 == 0.0) { aRad2 = Tan (aCone.SemiAngle()) * aHeight; diff --git a/src/StepAP209/StepAP209_Construct.cxx b/src/StepAP209/StepAP209_Construct.cxx index c189307ce5..e00718b1d3 100644 --- a/src/StepAP209/StepAP209_Construct.cxx +++ b/src/StepAP209/StepAP209_Construct.cxx @@ -597,7 +597,7 @@ Handle(StepFEA_HSequenceOfElementRepresentation) StepAP209_Construct::GetFeaElem aSequence = new StepFEA_HSequenceOfElementRepresentation; for (; anIter.More(); anIter.Next()) { - Handle(Standard_Transient) anEntity = anIter.Value(); + const Handle(Standard_Transient)& anEntity = anIter.Value(); if(anEntity->IsKind(theType)) { Handle(StepFEA_ElementRepresentation) anElement = Handle(StepFEA_ElementRepresentation)::DownCast(anEntity); diff --git a/src/StepBasic/StepBasic_Action.cxx b/src/StepBasic/StepBasic_Action.cxx index bd3ed79ace..aef6e6b125 100644 --- a/src/StepBasic/StepBasic_Action.cxx +++ b/src/StepBasic/StepBasic_Action.cxx @@ -26,9 +26,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_Action,Standard_Transient) //function : StepBasic_Action //purpose : //======================================================================= -StepBasic_Action::StepBasic_Action () +StepBasic_Action::StepBasic_Action () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_ActionMethod.cxx b/src/StepBasic/StepBasic_ActionMethod.cxx index 01a8d4e0a4..7ff1bfcd36 100644 --- a/src/StepBasic/StepBasic_ActionMethod.cxx +++ b/src/StepBasic/StepBasic_ActionMethod.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_ActionMethod,Standard_Transient) //function : StepBasic_ActionMethod //purpose : //======================================================================= -StepBasic_ActionMethod::StepBasic_ActionMethod () +StepBasic_ActionMethod::StepBasic_ActionMethod () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_Address.hxx b/src/StepBasic/StepBasic_Address.hxx index 2cf4b6d653..0eb7a4b2b6 100644 --- a/src/StepBasic/StepBasic_Address.hxx +++ b/src/StepBasic/StepBasic_Address.hxx @@ -161,18 +161,18 @@ private: Handle(TCollection_HAsciiString) telephoneNumber; Handle(TCollection_HAsciiString) electronicMailAddress; Handle(TCollection_HAsciiString) telexNumber; - Standard_Boolean hasInternalLocation; - Standard_Boolean hasStreetNumber; - Standard_Boolean hasStreet; - Standard_Boolean hasPostalBox; - Standard_Boolean hasTown; - Standard_Boolean hasRegion; - Standard_Boolean hasPostalCode; - Standard_Boolean hasCountry; - Standard_Boolean hasFacsimileNumber; - Standard_Boolean hasTelephoneNumber; - Standard_Boolean hasElectronicMailAddress; - Standard_Boolean hasTelexNumber; + Standard_Boolean hasInternalLocation{}; + Standard_Boolean hasStreetNumber{}; + Standard_Boolean hasStreet{}; + Standard_Boolean hasPostalBox{}; + Standard_Boolean hasTown{}; + Standard_Boolean hasRegion{}; + Standard_Boolean hasPostalCode{}; + Standard_Boolean hasCountry{}; + Standard_Boolean hasFacsimileNumber{}; + Standard_Boolean hasTelephoneNumber{}; + Standard_Boolean hasElectronicMailAddress{}; + Standard_Boolean hasTelexNumber{}; }; diff --git a/src/StepBasic/StepBasic_ApplicationProtocolDefinition.hxx b/src/StepBasic/StepBasic_ApplicationProtocolDefinition.hxx index 296d5e3bc7..92f73d04fd 100644 --- a/src/StepBasic/StepBasic_ApplicationProtocolDefinition.hxx +++ b/src/StepBasic/StepBasic_ApplicationProtocolDefinition.hxx @@ -76,7 +76,7 @@ private: Handle(TCollection_HAsciiString) status; Handle(TCollection_HAsciiString) applicationInterpretedModelSchemaName; - Standard_Integer applicationProtocolYear; + Standard_Integer applicationProtocolYear{}; Handle(StepBasic_ApplicationContext) application; diff --git a/src/StepBasic/StepBasic_CalendarDate.hxx b/src/StepBasic/StepBasic_CalendarDate.hxx index 5c347f4162..660a5ade3d 100644 --- a/src/StepBasic/StepBasic_CalendarDate.hxx +++ b/src/StepBasic/StepBasic_CalendarDate.hxx @@ -60,8 +60,8 @@ protected: private: - Standard_Integer dayComponent; - Standard_Integer monthComponent; + Standard_Integer dayComponent{}; + Standard_Integer monthComponent{}; }; diff --git a/src/StepBasic/StepBasic_CharacterizedObject.cxx b/src/StepBasic/StepBasic_CharacterizedObject.cxx index f13065c0e3..4b00d84f40 100644 --- a/src/StepBasic/StepBasic_CharacterizedObject.cxx +++ b/src/StepBasic/StepBasic_CharacterizedObject.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_CharacterizedObject,Standard_Transient) //function : StepBasic_CharacterizedObject //purpose : //======================================================================= -StepBasic_CharacterizedObject::StepBasic_CharacterizedObject () +StepBasic_CharacterizedObject::StepBasic_CharacterizedObject () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_CoordinatedUniversalTimeOffset.hxx b/src/StepBasic/StepBasic_CoordinatedUniversalTimeOffset.hxx index 4cbd412583..14cded78a6 100644 --- a/src/StepBasic/StepBasic_CoordinatedUniversalTimeOffset.hxx +++ b/src/StepBasic/StepBasic_CoordinatedUniversalTimeOffset.hxx @@ -69,10 +69,10 @@ protected: private: - Standard_Integer hourOffset; - Standard_Integer minuteOffset; + Standard_Integer hourOffset{}; + Standard_Integer minuteOffset{}; StepBasic_AheadOrBehind sense; - Standard_Boolean hasMinuteOffset; + Standard_Boolean hasMinuteOffset{}; }; diff --git a/src/StepBasic/StepBasic_Date.hxx b/src/StepBasic/StepBasic_Date.hxx index fdc7b09fe3..170d98c5ed 100644 --- a/src/StepBasic/StepBasic_Date.hxx +++ b/src/StepBasic/StepBasic_Date.hxx @@ -56,7 +56,7 @@ protected: private: - Standard_Integer yearComponent; + Standard_Integer yearComponent{}; }; diff --git a/src/StepBasic/StepBasic_DerivedUnitElement.hxx b/src/StepBasic/StepBasic_DerivedUnitElement.hxx index 016986861f..9a147eb3df 100644 --- a/src/StepBasic/StepBasic_DerivedUnitElement.hxx +++ b/src/StepBasic/StepBasic_DerivedUnitElement.hxx @@ -60,7 +60,7 @@ private: Handle(StepBasic_NamedUnit) theUnit; - Standard_Real theExponent; + Standard_Real theExponent{}; }; diff --git a/src/StepBasic/StepBasic_DimensionalExponents.hxx b/src/StepBasic/StepBasic_DimensionalExponents.hxx index 7a21dc8ef4..94451069c2 100644 --- a/src/StepBasic/StepBasic_DimensionalExponents.hxx +++ b/src/StepBasic/StepBasic_DimensionalExponents.hxx @@ -79,13 +79,13 @@ protected: private: - Standard_Real lengthExponent; - Standard_Real massExponent; - Standard_Real timeExponent; - Standard_Real electricCurrentExponent; - Standard_Real thermodynamicTemperatureExponent; - Standard_Real amountOfSubstanceExponent; - Standard_Real luminousIntensityExponent; + Standard_Real lengthExponent{}; + Standard_Real massExponent{}; + Standard_Real timeExponent{}; + Standard_Real electricCurrentExponent{}; + Standard_Real thermodynamicTemperatureExponent{}; + Standard_Real amountOfSubstanceExponent{}; + Standard_Real luminousIntensityExponent{}; }; diff --git a/src/StepBasic/StepBasic_Document.cxx b/src/StepBasic/StepBasic_Document.cxx index 7a827763fa..efa67e902c 100644 --- a/src/StepBasic/StepBasic_Document.cxx +++ b/src/StepBasic/StepBasic_Document.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_Document,Standard_Transient) //function : StepBasic_Document //purpose : //======================================================================= -StepBasic_Document::StepBasic_Document () +StepBasic_Document::StepBasic_Document () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_DocumentFile.cxx b/src/StepBasic/StepBasic_DocumentFile.cxx index 681b8f44f5..ed194fb839 100644 --- a/src/StepBasic/StepBasic_DocumentFile.cxx +++ b/src/StepBasic/StepBasic_DocumentFile.cxx @@ -27,9 +27,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_DocumentFile,StepBasic_Document) //function : StepBasic_DocumentFile //purpose : //======================================================================= -StepBasic_DocumentFile::StepBasic_DocumentFile () +StepBasic_DocumentFile::StepBasic_DocumentFile () : theCharacterizedObject(new StepBasic_CharacterizedObject) { - theCharacterizedObject = new StepBasic_CharacterizedObject; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_DocumentProductAssociation.cxx b/src/StepBasic/StepBasic_DocumentProductAssociation.cxx index acefef1ad8..d7bcc7c4f2 100644 --- a/src/StepBasic/StepBasic_DocumentProductAssociation.cxx +++ b/src/StepBasic/StepBasic_DocumentProductAssociation.cxx @@ -26,9 +26,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_DocumentProductAssociation,Standard_Transie //function : StepBasic_DocumentProductAssociation //purpose : //======================================================================= -StepBasic_DocumentProductAssociation::StepBasic_DocumentProductAssociation () +StepBasic_DocumentProductAssociation::StepBasic_DocumentProductAssociation () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_GeneralProperty.cxx b/src/StepBasic/StepBasic_GeneralProperty.cxx index 037df4b366..a099bbad7c 100644 --- a/src/StepBasic/StepBasic_GeneralProperty.cxx +++ b/src/StepBasic/StepBasic_GeneralProperty.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_GeneralProperty,Standard_Transient) //function : StepBasic_GeneralProperty //purpose : //======================================================================= -StepBasic_GeneralProperty::StepBasic_GeneralProperty () +StepBasic_GeneralProperty::StepBasic_GeneralProperty () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_Group.cxx b/src/StepBasic/StepBasic_Group.cxx index ab65434ebf..099727f46d 100644 --- a/src/StepBasic/StepBasic_Group.cxx +++ b/src/StepBasic/StepBasic_Group.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_Group,Standard_Transient) //function : StepBasic_Group //purpose : //======================================================================= -StepBasic_Group::StepBasic_Group () +StepBasic_Group::StepBasic_Group () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_GroupRelationship.cxx b/src/StepBasic/StepBasic_GroupRelationship.cxx index 8e907e2f8b..f60aefea38 100644 --- a/src/StepBasic/StepBasic_GroupRelationship.cxx +++ b/src/StepBasic/StepBasic_GroupRelationship.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_GroupRelationship,Standard_Transient) //function : StepBasic_GroupRelationship //purpose : //======================================================================= -StepBasic_GroupRelationship::StepBasic_GroupRelationship () +StepBasic_GroupRelationship::StepBasic_GroupRelationship () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_IdentificationRole.cxx b/src/StepBasic/StepBasic_IdentificationRole.cxx index 58a3e8b241..fb57e0af28 100644 --- a/src/StepBasic/StepBasic_IdentificationRole.cxx +++ b/src/StepBasic/StepBasic_IdentificationRole.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_IdentificationRole,Standard_Transient) //function : StepBasic_IdentificationRole //purpose : //======================================================================= -StepBasic_IdentificationRole::StepBasic_IdentificationRole () +StepBasic_IdentificationRole::StepBasic_IdentificationRole () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_LocalTime.hxx b/src/StepBasic/StepBasic_LocalTime.hxx index 970da885c1..40e3e9bd1b 100644 --- a/src/StepBasic/StepBasic_LocalTime.hxx +++ b/src/StepBasic/StepBasic_LocalTime.hxx @@ -77,12 +77,12 @@ protected: private: - Standard_Integer hourComponent; - Standard_Integer minuteComponent; - Standard_Real secondComponent; + Standard_Integer hourComponent{}; + Standard_Integer minuteComponent{}; + Standard_Real secondComponent{}; Handle(StepBasic_CoordinatedUniversalTimeOffset) zone; - Standard_Boolean hasMinuteComponent; - Standard_Boolean hasSecondComponent; + Standard_Boolean hasMinuteComponent{}; + Standard_Boolean hasSecondComponent{}; }; diff --git a/src/StepBasic/StepBasic_MeasureValueMember.cxx b/src/StepBasic/StepBasic_MeasureValueMember.cxx index b4814dd362..01a7e30e4c 100644 --- a/src/StepBasic/StepBasic_MeasureValueMember.cxx +++ b/src/StepBasic/StepBasic_MeasureValueMember.cxx @@ -21,9 +21,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_MeasureValueMember,StepData_SelectReal) //function : StepBasic_MeasureValueMember //purpose : //======================================================================= -StepBasic_MeasureValueMember::StepBasic_MeasureValueMember() +StepBasic_MeasureValueMember::StepBasic_MeasureValueMember() : thecase(0) { - thecase = 0; + } diff --git a/src/StepBasic/StepBasic_ObjectRole.cxx b/src/StepBasic/StepBasic_ObjectRole.cxx index ae405707c7..312d551fd0 100644 --- a/src/StepBasic/StepBasic_ObjectRole.cxx +++ b/src/StepBasic/StepBasic_ObjectRole.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_ObjectRole,Standard_Transient) //function : StepBasic_ObjectRole //purpose : //======================================================================= -StepBasic_ObjectRole::StepBasic_ObjectRole () +StepBasic_ObjectRole::StepBasic_ObjectRole () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_OrdinalDate.hxx b/src/StepBasic/StepBasic_OrdinalDate.hxx index 4204c2858f..f1bddbb842 100644 --- a/src/StepBasic/StepBasic_OrdinalDate.hxx +++ b/src/StepBasic/StepBasic_OrdinalDate.hxx @@ -56,7 +56,7 @@ protected: private: - Standard_Integer dayComponent; + Standard_Integer dayComponent{}; }; diff --git a/src/StepBasic/StepBasic_Organization.hxx b/src/StepBasic/StepBasic_Organization.hxx index 2dff7a0345..ad91b524a8 100644 --- a/src/StepBasic/StepBasic_Organization.hxx +++ b/src/StepBasic/StepBasic_Organization.hxx @@ -72,7 +72,7 @@ private: Handle(TCollection_HAsciiString) id; Handle(TCollection_HAsciiString) name; Handle(TCollection_HAsciiString) description; - Standard_Boolean hasId; + Standard_Boolean hasId{}; }; diff --git a/src/StepBasic/StepBasic_Person.hxx b/src/StepBasic/StepBasic_Person.hxx index 9eb5de333b..b51f726f16 100644 --- a/src/StepBasic/StepBasic_Person.hxx +++ b/src/StepBasic/StepBasic_Person.hxx @@ -116,11 +116,11 @@ private: Handle(Interface_HArray1OfHAsciiString) middleNames; Handle(Interface_HArray1OfHAsciiString) prefixTitles; Handle(Interface_HArray1OfHAsciiString) suffixTitles; - Standard_Boolean hasLastName; - Standard_Boolean hasFirstName; - Standard_Boolean hasMiddleNames; - Standard_Boolean hasPrefixTitles; - Standard_Boolean hasSuffixTitles; + Standard_Boolean hasLastName{}; + Standard_Boolean hasFirstName{}; + Standard_Boolean hasMiddleNames{}; + Standard_Boolean hasPrefixTitles{}; + Standard_Boolean hasSuffixTitles{}; }; diff --git a/src/StepBasic/StepBasic_ProductCategory.hxx b/src/StepBasic/StepBasic_ProductCategory.hxx index f4e543ea8a..3704f81423 100644 --- a/src/StepBasic/StepBasic_ProductCategory.hxx +++ b/src/StepBasic/StepBasic_ProductCategory.hxx @@ -67,7 +67,7 @@ private: Handle(TCollection_HAsciiString) name; Handle(TCollection_HAsciiString) description; - Standard_Boolean hasDescription; + Standard_Boolean hasDescription{}; }; diff --git a/src/StepBasic/StepBasic_ProductCategoryRelationship.cxx b/src/StepBasic/StepBasic_ProductCategoryRelationship.cxx index 75168c9915..9f8691394c 100644 --- a/src/StepBasic/StepBasic_ProductCategoryRelationship.cxx +++ b/src/StepBasic/StepBasic_ProductCategoryRelationship.cxx @@ -26,9 +26,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_ProductCategoryRelationship,Standard_Transi //function : StepBasic_ProductCategoryRelationship //purpose : //======================================================================= -StepBasic_ProductCategoryRelationship::StepBasic_ProductCategoryRelationship () +StepBasic_ProductCategoryRelationship::StepBasic_ProductCategoryRelationship () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_ProductDefinitionReference.hxx b/src/StepBasic/StepBasic_ProductDefinitionReference.hxx index df986ef3e9..38b364eb0a 100644 --- a/src/StepBasic/StepBasic_ProductDefinitionReference.hxx +++ b/src/StepBasic/StepBasic_ProductDefinitionReference.hxx @@ -123,7 +123,7 @@ private: Handle(TCollection_HAsciiString) myProductDefinitionFormationId; Handle(TCollection_HAsciiString) myProductDefinitionId; Handle(TCollection_HAsciiString) myIdOwningOrganizationName; - Standard_Boolean hasIdOwningOrganizationName; + Standard_Boolean hasIdOwningOrganizationName{}; }; #endif // _StepBasic_ProductDefinitionReference_HeaderFile diff --git a/src/StepBasic/StepBasic_ProductDefinitionRelationship.cxx b/src/StepBasic/StepBasic_ProductDefinitionRelationship.cxx index 7406fa04fb..db451e3e0c 100644 --- a/src/StepBasic/StepBasic_ProductDefinitionRelationship.cxx +++ b/src/StepBasic/StepBasic_ProductDefinitionRelationship.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_ProductDefinitionRelationship,Standard_Tran //function : StepBasic_ProductDefinitionRelationship //purpose : //======================================================================= -StepBasic_ProductDefinitionRelationship::StepBasic_ProductDefinitionRelationship () +StepBasic_ProductDefinitionRelationship::StepBasic_ProductDefinitionRelationship () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_SiUnit.hxx b/src/StepBasic/StepBasic_SiUnit.hxx index a9c676aa5f..cd55b0cccf 100644 --- a/src/StepBasic/StepBasic_SiUnit.hxx +++ b/src/StepBasic/StepBasic_SiUnit.hxx @@ -72,7 +72,7 @@ private: StepBasic_SiPrefix prefix; StepBasic_SiUnitName name; - Standard_Boolean hasPrefix; + Standard_Boolean hasPrefix{}; }; diff --git a/src/StepBasic/StepBasic_VersionedActionRequest.cxx b/src/StepBasic/StepBasic_VersionedActionRequest.cxx index f6cd25dba1..1b283e6b9f 100644 --- a/src/StepBasic/StepBasic_VersionedActionRequest.cxx +++ b/src/StepBasic/StepBasic_VersionedActionRequest.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepBasic_VersionedActionRequest,Standard_Transient) //function : StepBasic_VersionedActionRequest //purpose : //======================================================================= -StepBasic_VersionedActionRequest::StepBasic_VersionedActionRequest () +StepBasic_VersionedActionRequest::StepBasic_VersionedActionRequest () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepBasic/StepBasic_WeekOfYearAndDayDate.hxx b/src/StepBasic/StepBasic_WeekOfYearAndDayDate.hxx index 444896f558..ee0a2e5df1 100644 --- a/src/StepBasic/StepBasic_WeekOfYearAndDayDate.hxx +++ b/src/StepBasic/StepBasic_WeekOfYearAndDayDate.hxx @@ -64,9 +64,9 @@ protected: private: - Standard_Integer weekComponent; - Standard_Integer dayComponent; - Standard_Boolean hasDayComponent; + Standard_Integer weekComponent{}; + Standard_Integer dayComponent{}; + Standard_Boolean hasDayComponent{}; }; diff --git a/src/StepData/StepData_ECDescr.cxx b/src/StepData/StepData_ECDescr.cxx index 83141f07b5..b47c07ea59 100644 --- a/src/StepData/StepData_ECDescr.cxx +++ b/src/StepData/StepData_ECDescr.cxx @@ -45,7 +45,7 @@ StepData_ECDescr::StepData_ECDescr () { } Handle(TColStd_HSequenceOfAsciiString) StepData_ECDescr::TypeList () const { Handle(TColStd_HSequenceOfAsciiString) tl = new TColStd_HSequenceOfAsciiString(); - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { TCollection_AsciiString nam (Member(i)->TypeName()); tl->Append(nam); @@ -56,7 +56,7 @@ StepData_ECDescr::StepData_ECDescr () { } Standard_Boolean StepData_ECDescr::Matches (const Standard_CString name) const { - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { Handle(StepData_ESDescr) member = Member(i); if (member->Matches(name)) return Standard_True; @@ -70,7 +70,7 @@ StepData_ECDescr::StepData_ECDescr () { } Handle(StepData_Described) StepData_ECDescr::NewEntity () const { Handle(StepData_Plex) ent = new StepData_Plex (this); - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { Handle(StepData_ESDescr) member = Member(i); Handle(StepData_Simple) mem = Handle(StepData_Simple)::DownCast(member->NewEntity()); diff --git a/src/StepData/StepData_ESDescr.cxx b/src/StepData/StepData_ESDescr.cxx index 7084493623..2b29567ba7 100644 --- a/src/StepData/StepData_ESDescr.cxx +++ b/src/StepData/StepData_ESDescr.cxx @@ -26,7 +26,7 @@ StepData_ESDescr::StepData_ESDescr (const Standard_CString name) void StepData_ESDescr::SetNbFields (const Standard_Integer nb) { - Standard_Integer minb,i, oldnb = NbFields(); + Standard_Integer minb = 0,i = 0, oldnb = NbFields(); thenames.Clear(); if (nb == 0) { thedescr.Nullify(); return; } Handle(TColStd_HArray1OfTransient) li = new TColStd_HArray1OfTransient(1,nb); @@ -97,7 +97,7 @@ void StepData_ESDescr::SetNbFields (const Standard_Integer nb) Standard_Integer StepData_ESDescr::Rank (const Standard_CString name) const { - Standard_Integer rank; + Standard_Integer rank = 0; if (!thenames.Find(name, rank)) return 0; return rank; diff --git a/src/StepData/StepData_EnumTool.cxx b/src/StepData/StepData_EnumTool.cxx index 5fa8fd6e8a..e1966d0b56 100644 --- a/src/StepData/StepData_EnumTool.cxx +++ b/src/StepData/StepData_EnumTool.cxx @@ -37,7 +37,7 @@ StepData_EnumTool::StepData_EnumTool const Standard_CString e32,const Standard_CString e33, const Standard_CString e34,const Standard_CString e35, const Standard_CString e36,const Standard_CString e37, - const Standard_CString e38,const Standard_CString e39) + const Standard_CString e38,const Standard_CString e39) : theinit(thetexts.Length()), theopt(Standard_True) { AddDefinition (e0); AddDefinition (e1); AddDefinition (e2); AddDefinition (e3); AddDefinition (e4); AddDefinition (e5); @@ -53,7 +53,7 @@ StepData_EnumTool::StepData_EnumTool AddDefinition (e33); AddDefinition (e34); AddDefinition (e35); AddDefinition (e36); AddDefinition (e37); AddDefinition (e38); AddDefinition (e39); - theinit = thetexts.Length(); theopt = Standard_True; + } void StepData_EnumTool::AddDefinition (const Standard_CString term) diff --git a/src/StepData/StepData_Field.cxx b/src/StepData/StepData_Field.cxx index d717483e4e..02a9c8104e 100644 --- a/src/StepData/StepData_Field.cxx +++ b/src/StepData/StepData_Field.cxx @@ -99,7 +99,7 @@ static Standard_Integer TrueKind (const Standard_Integer kind) } // Les listes ... if ((thekind & KindArity) == KindList) { - Standard_Integer i, low, up; + Standard_Integer i = 0, low = 0, up = 0; DeclareAndCast(TColStd_HArray1OfInteger,hi,theany); if (!hi.IsNull()) { low = hi->Lower(); up = hi->Upper(); diff --git a/src/StepData/StepData_Field.hxx b/src/StepData/StepData_Field.hxx index b5f9c9ace6..75e9c7cbf0 100644 --- a/src/StepData/StepData_Field.hxx +++ b/src/StepData/StepData_Field.hxx @@ -197,9 +197,9 @@ private: - Standard_Integer thekind; - Standard_Integer theint; - Standard_Real thereal; + Standard_Integer thekind{}; + Standard_Integer theint{}; + Standard_Real thereal{}; Handle(Standard_Transient) theany; diff --git a/src/StepData/StepData_FieldList.cxx b/src/StepData/StepData_FieldList.cxx index 679c18c2ec..6cf1138ff2 100644 --- a/src/StepData/StepData_FieldList.cxx +++ b/src/StepData/StepData_FieldList.cxx @@ -41,11 +41,11 @@ StepData_Field& StepData_FieldList::CField (const Standard_Integer) void StepData_FieldList::FillShared (Interface_EntityIterator& iter) const { - Standard_Integer i, nb = NbFields(); + Standard_Integer i = 0, nb = NbFields(); for (i = 1; i <= nb; i ++) { const StepData_Field& fi = Field(i); if (fi.Kind() != 7) continue; // KindEntity - Standard_Integer i1,i2, nb1 = 1, nb2 = 1, ari = fi.Arity(); + Standard_Integer i1 = 0,i2 = 0, nb1 = 1, nb2 = 1, ari = fi.Arity(); if (ari == 1) nb1 = fi.Length(); if (ari == 2) { nb1 = fi.Length(1); nb2 = fi.Length(2); } for (i1 = 1; i1 <= nb1; i1 ++) diff --git a/src/StepData/StepData_FileProtocol.cxx b/src/StepData/StepData_FileProtocol.cxx index 6a264f7c88..24fb907052 100644 --- a/src/StepData/StepData_FileProtocol.cxx +++ b/src/StepData/StepData_FileProtocol.cxx @@ -57,7 +57,7 @@ Standard_Boolean StepData_FileProtocol::GlobalCheck(const Interface_Graph& G, Handle(Interface_Check)& ach) const { Standard_Boolean res = Standard_False; - Standard_Integer i,nb = NbResources(); + Standard_Integer i = 0,nb = NbResources(); for (i = 1; i <= nb; i ++) res |= Resource(i)->GlobalCheck (G,ach); return res; } diff --git a/src/StepData/StepData_PDescr.cxx b/src/StepData/StepData_PDescr.cxx index cd5cb1f67d..9a41fea049 100644 --- a/src/StepData/StepData_PDescr.cxx +++ b/src/StepData/StepData_PDescr.cxx @@ -98,7 +98,7 @@ StepData_PDescr::StepData_PDescr () { if (other.IsNull()) return; thekind = other->Kind(); - Standard_Integer i, maxenum = other->EnumMax (); + Standard_Integer i = 0, maxenum = other->EnumMax (); for (i = 0; i <= maxenum; i ++) AddEnumDef (other->EnumText(i)); // ne sont pas reprises : les SELECT thetype = other->Type(); diff --git a/src/StepData/StepData_Plex.cxx b/src/StepData/StepData_Plex.cxx index 0c391174b8..6f95fb8d80 100644 --- a/src/StepData/StepData_Plex.cxx +++ b/src/StepData/StepData_Plex.cxx @@ -40,7 +40,7 @@ static StepData_Field bid; Standard_Boolean StepData_Plex::Matches (const Standard_CString steptype) const { - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { if (Member(i)->Matches (steptype)) return Standard_True; } @@ -50,7 +50,7 @@ static StepData_Field bid; Handle(StepData_Simple) StepData_Plex::As (const Standard_CString steptype) const { Handle(StepData_Simple) ent; - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { ent = Member(i); if (ent->Matches(steptype)) return ent; @@ -61,7 +61,7 @@ static StepData_Field bid; Standard_Boolean StepData_Plex::HasField (const Standard_CString name) const { - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { if (Member(i)->HasField (name)) return Standard_True; } @@ -71,7 +71,7 @@ static StepData_Field bid; const StepData_Field& StepData_Plex::Field (const Standard_CString name) const { Handle(StepData_Simple) ent; - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { ent = Member(i); if (ent->HasField (name)) return ent->Field (name); @@ -83,7 +83,7 @@ static StepData_Field bid; StepData_Field& StepData_Plex::CField (const Standard_CString name) { Handle(StepData_Simple) ent; - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { ent = Member(i); if (ent->HasField (name)) return ent->CField (name); @@ -101,7 +101,7 @@ static StepData_Field bid; Handle(TColStd_HSequenceOfAsciiString) StepData_Plex::TypeList () const { Handle(TColStd_HSequenceOfAsciiString) tl = new TColStd_HSequenceOfAsciiString(); - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { TCollection_AsciiString nam (Member(i)->StepType()); tl->Append (nam); @@ -112,7 +112,7 @@ static StepData_Field bid; void StepData_Plex::Check(Handle(Interface_Check)& ach) const { - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { Handle(StepData_Simple) si = Member(i); si->Check(ach); @@ -122,7 +122,7 @@ void StepData_Plex::Check(Handle(Interface_Check)& ach) const void StepData_Plex::Shared (Interface_EntityIterator& list) const { - Standard_Integer i, nb = NbMembers(); + Standard_Integer i = 0, nb = NbMembers(); for (i = 1; i <= nb; i ++) { Handle(StepData_Simple) si = Member(i); si->Shared (list); diff --git a/src/StepData/StepData_Protocol.cxx b/src/StepData/StepData_Protocol.cxx index 330299ccd7..c1022032b5 100644 --- a/src/StepData/StepData_Protocol.cxx +++ b/src/StepData/StepData_Protocol.cxx @@ -161,7 +161,7 @@ Handle(StepData_EDescr) StepData_Protocol::Descr } if (!anylevel) return sd; - Standard_Integer i, nb = NbResources(); + Standard_Integer i = 0, nb = NbResources(); for (i = 1; i <= nb; i ++) { Handle(StepData_Protocol) sp = Handle(StepData_Protocol)::DownCast(Resource(i)); if (sp.IsNull()) continue; @@ -182,7 +182,7 @@ Handle(StepData_ESDescr) StepData_Protocol::ESDescr Handle(StepData_ECDescr) StepData_Protocol::ECDescr (const TColStd_SequenceOfAsciiString& names, const Standard_Boolean anylevel) const { - Standard_Integer i, nb = names.Length(); + Standard_Integer i = 0, nb = names.Length(); Handle(StepData_ECDescr) cd; Interface_DataMapIteratorOfDataMapOfTransientInteger iter(thedscnum); for (; iter.More(); iter.Next()) { @@ -227,7 +227,7 @@ Handle(StepData_PDescr) StepData_Protocol::PDescr } if (!anylevel) return sd; - Standard_Integer i, nb = NbResources(); + Standard_Integer i = 0, nb = NbResources(); for (i = 1; i <= nb; i ++) { Handle(StepData_Protocol) sp = Handle(StepData_Protocol)::DownCast(Resource(i)); if (sp.IsNull()) continue; @@ -256,7 +256,7 @@ Handle(StepData_EDescr) StepData_Protocol::BasicDescr } if (!anylevel) return sd; - Standard_Integer i, nb = NbResources(); + Standard_Integer i = 0, nb = NbResources(); for (i = 1; i <= nb; i ++) { Handle(StepData_Protocol) sp = Handle(StepData_Protocol)::DownCast(Resource(i)); if (sp.IsNull()) continue; diff --git a/src/StepData/StepData_SelectInt.cxx b/src/StepData/StepData_SelectInt.cxx index 6517ab9301..0a5a4fb73f 100644 --- a/src/StepData/StepData_SelectInt.cxx +++ b/src/StepData/StepData_SelectInt.cxx @@ -17,7 +17,7 @@ IMPLEMENT_STANDARD_RTTIEXT(StepData_SelectInt,StepData_SelectMember) -StepData_SelectInt::StepData_SelectInt () { thekind = 0; theval = 0; } +StepData_SelectInt::StepData_SelectInt () : thekind(0), theval(0) { } Standard_Integer StepData_SelectInt::Kind () const { return thekind; } void StepData_SelectInt::SetKind (const Standard_Integer kind) { thekind = kind; } diff --git a/src/StepData/StepData_SelectReal.cxx b/src/StepData/StepData_SelectReal.cxx index 65063744a8..8c5cdd71a4 100644 --- a/src/StepData/StepData_SelectReal.cxx +++ b/src/StepData/StepData_SelectReal.cxx @@ -20,7 +20,7 @@ IMPLEMENT_STANDARD_RTTIEXT(StepData_SelectReal,StepData_SelectMember) // Definitions : cf Field #define KindReal 5 -StepData_SelectReal::StepData_SelectReal () { theval = 0.0; } +StepData_SelectReal::StepData_SelectReal () : theval(0.0) { } Standard_Integer StepData_SelectReal::Kind () const { return KindReal; } diff --git a/src/StepData/StepData_Simple.cxx b/src/StepData/StepData_Simple.cxx index d66b94e489..392aa65f79 100644 --- a/src/StepData/StepData_Simple.cxx +++ b/src/StepData/StepData_Simple.cxx @@ -88,10 +88,10 @@ void StepData_Simple::Check(Handle(Interface_Check)& /*ach*/) const void StepData_Simple::Shared (Interface_EntityIterator& list) const { - Standard_Integer i, nb = thefields.NbFields(); + Standard_Integer i = 0, nb = thefields.NbFields(); for (i = 1; i <= nb; i ++) { const StepData_Field& fi = thefields.Field(i); - Standard_Integer j1,j2,l1,l2; l1 = l2 = 1; + Standard_Integer j1 = 0,j2 = 0,l1 = 0,l2 = 0; l1 = l2 = 1; if (fi.Arity() >= 1) l1 = fi.Length(1); if (fi.Arity() > 1) l2 = fi.Length(2); for (j1 = 1; j1 <= l1; j1 ++) { diff --git a/src/StepData/StepData_StepDumper.cxx b/src/StepData/StepData_StepDumper.cxx index a3533c8034..dcc7004d60 100644 --- a/src/StepData/StepData_StepDumper.cxx +++ b/src/StepData/StepData_StepDumper.cxx @@ -29,9 +29,9 @@ StepData_StepDumper::StepData_StepDumper (const Handle(StepData_StepModel)& amodel, const Handle(StepData_Protocol)& protocol, const Standard_Integer mode) - : theslib (protocol) , thewlib (protocol) , thewriter (amodel) + : themodel(amodel), theslib (protocol) , thewlib (protocol) , thewriter (amodel) { - themodel = amodel; + if (mode > 0) thewriter.LabelMode () = 2; } @@ -46,7 +46,7 @@ Standard_Boolean StepData_StepDumper::Dump (Standard_OStream& S, const Handle(Standard_Transient)& ent, const Standard_Integer level) { - Standard_Integer i, nb = themodel->NbEntities(); + Standard_Integer i = 0, nb = themodel->NbEntities(); TColStd_Array1OfInteger ids(0,nb); ids.Init(0); Standard_Integer num = themodel->Number(ent); Standard_Integer nlab = themodel->IdentLabel(ent); @@ -54,7 +54,7 @@ Standard_Boolean StepData_StepDumper::Dump if (level <= 0) { Handle(StepData_ReadWriteModule) module; - Standard_Integer CN; + Standard_Integer CN = 0; if (num > 0) S << "#" << num << " = "; else S << "#??? = "; if (thewlib.Select(ent,module,CN)) { @@ -79,7 +79,7 @@ Standard_Boolean StepData_StepDumper::Dump else if (level == 1) { // ... Idents ... Handle(Standard_Transient) anent; - Handle(Interface_GeneralModule) module; Standard_Integer CN; + Handle(Interface_GeneralModule) module; Standard_Integer CN = 0; if (theslib.Select(ent,module,CN)) { Interface_EntityIterator iter; module->FillSharedCase (CN,ent,iter); @@ -100,7 +100,7 @@ Standard_Boolean StepData_StepDumper::Dump // ... Envoi ... TColStd_Array1OfInteger tab(0,nb); tab.Init(0); tab.SetValue(num,1); - Handle(Interface_GeneralModule) module; Standard_Integer CN; + Handle(Interface_GeneralModule) module; Standard_Integer CN = 0; if (theslib.Select(ent,module,CN)) { Interface_EntityIterator iter; module->FillSharedCase (CN,ent,iter); diff --git a/src/StepData/StepData_StepModel.cxx b/src/StepData/StepData_StepModel.cxx index 5d86f07835..f0a6a6e7fd 100644 --- a/src/StepData/StepData_StepModel.cxx +++ b/src/StepData/StepData_StepModel.cxx @@ -111,9 +111,9 @@ void StepData_StepModel::VerifyCheck(Handle(Interface_Check)& ach) const Handle(StepData_StepModel) me (this); Handle(Interface_Protocol) aHP = StepData::HeaderProtocol(); Interface_ShareTool sh(me,aHP); - Handle(Interface_GeneralModule) module; Standard_Integer CN; + Handle(Interface_GeneralModule) module; Standard_Integer CN = 0; for (Interface_EntityIterator iter = Header(); iter.More(); iter.Next()) { - Handle(Standard_Transient) head = iter.Value(); + const Handle(Standard_Transient)& head = iter.Value(); if (!lib.Select(head,module,CN)) continue; module->CheckCase(CN,head,sh,ach); } diff --git a/src/StepData/StepData_StepReaderData.cxx b/src/StepData/StepData_StepReaderData.cxx index 3221e05d59..73d1b6f4c1 100644 --- a/src/StepData/StepData_StepReaderData.cxx +++ b/src/StepData/StepData_StepReaderData.cxx @@ -324,12 +324,12 @@ StepData_StepReaderData::StepData_StepReaderData (const Standard_Integer nbheader, const Standard_Integer nbtotal, const Standard_Integer nbpar, const Resource_FormatType theSourceCodePage) : Interface_FileReaderData(nbtotal, nbpar), theidents(1, nbtotal), - thetypes(1, nbtotal), mySourceCodePage(theSourceCodePage) //, themults (1,nbtotal) + thetypes(1, nbtotal), thenbents(0), thelastn(0), thenbhead(nbheader), thenbscop(0), thecheck(new Interface_Check), mySourceCodePage(theSourceCodePage) //, themults (1,nbtotal) { // char textnum[10]; - thenbscop = 0; thenbents = 0; thelastn = 0; thenbhead = nbheader; + //themults.Init(0); - thecheck = new Interface_Check; + if (initstr) return; //for (Standard_Integer i = 0; i < Maxlst; i ++) { // sprintf(textnum,"$%d",i+1); @@ -349,7 +349,7 @@ void StepData_StepReaderData::SetRecord(const Standard_Integer num, const Standard_CString type, const Standard_Integer /* nbpar */) { - Standard_Integer numlst; + Standard_Integer numlst = 0; /* if (strcmp(type,"/ * (SUB) * /") == 0) { // defini dans recfile.pc thetypes.SetValue (num,sublist); @@ -791,7 +791,7 @@ Standard_Integer StepData_StepReaderData::ReadSub(const Standard_Integer numsub, // Il faut passer au transient ... if (htr.IsNull()) { htr = new TColStd_HArray1OfTransient(1, nbp); val = htr; - Standard_Integer jp; + Standard_Integer jp = 0; if (!hin.IsNull()) { for (jp = 1; jp < ip; jp++) { Handle(StepData_SelectInt) sin = new StepData_SelectInt; @@ -914,7 +914,7 @@ Standard_Boolean StepData_StepReaderData::ReadField(const Standard_Integer num, const Interface_FileParameter& FP = Param(num, nump); Standard_CString str = FP.CValue(); Standard_Boolean OK = Standard_True; - Standard_Integer nent, kind; + Standard_Integer nent = 0, kind = 0; Handle(TCollection_HAsciiString) txt; Handle(Standard_Transient) sub; Interface_ParamType FT = FP.ParamType(); @@ -967,7 +967,7 @@ Standard_Boolean StepData_StepReaderData::ReadList(const Standard_Integer num, StepData_FieldList& list) const { // controler nbs egaux - Standard_Integer i, nb = list.NbFields(); + Standard_Integer i = 0, nb = list.NbFields(); if (!CheckNbParams(num, nb, ach, descr->TypeName())) return Standard_False; for (i = 1; i <= nb; i++) { Handle(StepData_PDescr) pde = descr->Field(i); @@ -1756,7 +1756,7 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap) TColStd_IndexedMapOfInteger imap(thenbents); TColStd_Array1OfInteger indm(0, nbdirec); // Index Map -> Record Number (seulement si map) - Standard_Integer num; // svv Jan11 2000 : porting on DEC + Standard_Integer num = 0; // svv Jan11 2000 : porting on DEC for (num = 1; num <= nbdirec; num++) { Standard_Integer ident = theidents(num); if (ident > 0) { // Ident normal -> Map ? @@ -1987,7 +1987,7 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap) if (id < 0) continue; // deja resolu en tete // Voila : on va chercher id dans ndi; algorithme de balayage - Standard_Integer pass, sens, nok, n0, irec; pass = sens = nok = 0; + Standard_Integer pass = 0, sens = 0, nok = 0, n0 = 0, irec = 0; pass = sens = nok = 0; if (!iamap) pass = 1; // si map non disponible while (pass < 3) { pass++; @@ -2056,7 +2056,7 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap) // Alimenter le Check ... Pour cela, determiner n0 Entite et Ident char failmess[100]; Standard_Integer nument = 0; - Standard_Integer n0ent; // svv Jan11 2000 : porting on DEC + Standard_Integer n0ent = 0; // svv Jan11 2000 : porting on DEC for (n0ent = 1; n0ent <= nr; n0ent++) { if (indi(n0ent) > 0) nument++; } diff --git a/src/StepData/StepData_StepReaderTool.cxx b/src/StepData/StepData_StepReaderTool.cxx index 9ece1b80b8..06303c31d5 100644 --- a/src/StepData/StepData_StepReaderTool.cxx +++ b/src/StepData/StepData_StepReaderTool.cxx @@ -215,7 +215,7 @@ Standard_Boolean StepData_StepReaderTool::AnalyseRecord { DeclareAndCast(StepData_StepReaderData,stepdat,Data()); Handle(Interface_ReaderModule) imodule; - Standard_Integer CN; + Standard_Integer CN = 0; if (therlib.Select(anent,imodule,CN)) { Handle(StepData_ReadWriteModule) module = diff --git a/src/StepData/StepData_StepWriter.cxx b/src/StepData/StepData_StepWriter.cxx index ee04642aa8..733f345b95 100644 --- a/src/StepData/StepData_StepWriter.cxx +++ b/src/StepData/StepData_StepWriter.cxx @@ -64,13 +64,13 @@ static TCollection_AsciiString textunknown (".U."); //======================================================================= StepData_StepWriter::StepData_StepWriter(const Handle(StepData_StepModel)& amodel) - : thecurr (StepLong) , thefloatw (12) + : themodel(amodel), thefile(new TColStd_HSequenceOfHAsciiString()), thecurr (StepLong) , thesect(Standard_False), thecomm(Standard_False), thefirst(Standard_True), themult(Standard_False), theindent(Standard_False), thefloatw (12), thelabmode(thetypmode = 0) { - themodel = amodel; thelabmode = thetypmode = 0; - thefile = new TColStd_HSequenceOfHAsciiString(); - thesect = Standard_False; thefirst = Standard_True; - themult = Standard_False; thecomm = Standard_False; - thelevel = theindval = 0; theindent = Standard_False; + + + + + thelevel = theindval = 0; // Format flottant : reporte dans le FloatWriter } @@ -172,10 +172,10 @@ void StepData_StepWriter::SendModel(const Handle(StepData_Protocol)& protocol, Interface_EntityIterator header = themodel->Header(); thenum = 0; for (header.Start(); header.More(); header.Next()) { - Handle(Standard_Transient) anent = header.Value(); + const Handle(Standard_Transient)& anent = header.Value(); // Write Entity via Lib (similaire a SendEntity) - Handle(StepData_ReadWriteModule) module; Standard_Integer CN; + Handle(StepData_ReadWriteModule) module; Standard_Integer CN = 0; if (lib.Select(anent,module,CN)) { if (module->IsComplex(CN)) StartComplex(); else { @@ -331,7 +331,7 @@ void StepData_StepWriter::SendEntity(const Standard_Integer num, // Write Entity via Lib thenum = num; - Handle(StepData_ReadWriteModule) module; Standard_Integer CN; + Handle(StepData_ReadWriteModule) module; Standard_Integer CN = 0; if (themodel->IsRedefinedContent(num)) { // Entite Erreur : Ecrire le Contenu + les Erreurs en Commentaires Handle(Interface_ReportEntity) rep = themodel->ReportEntity(num); @@ -586,7 +586,7 @@ void StepData_StepWriter::SendField(const StepData_Field& fild, if (arity == 0) { SendUndef(); return; } // PAS NORMAL if (arity == 1) { OpenSub(); - Standard_Integer i,low = fild.Lower(), up = low + fild.Length() - 1; + Standard_Integer i = 0,low = fild.Lower(), up = low + fild.Length() - 1; for (i = low; i <= up; i ++) { kind = fild.ItemKind(i); done = Standard_True; @@ -607,7 +607,7 @@ void StepData_StepWriter::SendField(const StepData_Field& fild, } if (arity == 2) { OpenSub(); - Standard_Integer j,low1 = fild.Lower(1), up1 = low1 + fild.Length(1) - 1; + Standard_Integer j = 0,low1 = fild.Lower(1), up1 = low1 + fild.Length(1) - 1; for (j = low1; j <= up1; j ++) { Standard_Integer i=0,low2 = fild.Lower(2), up2 = low2 + fild.Length(2) - 1; OpenSub(); @@ -677,11 +677,11 @@ void StepData_StepWriter::SendList(const StepData_FieldList& list, const Handle(StepData_ESDescr)& descr) { // start entity ? - Standard_Integer i, nb = list.NbFields(); + Standard_Integer i = 0, nb = list.NbFields(); for (i = 1; i <= nb; i ++) { Handle(StepData_PDescr) pde; if (!descr.IsNull()) pde = descr->Field(i); - const StepData_Field fild = list.Field(i); + const StepData_Field& fild = list.Field(i); SendField (fild,pde); } // end entity ? diff --git a/src/StepData/StepData_StepWriter.hxx b/src/StepData/StepData_StepWriter.hxx index 34c2fc2ea6..e3a32c83c5 100644 --- a/src/StepData/StepData_StepWriter.hxx +++ b/src/StepData/StepData_StepWriter.hxx @@ -298,10 +298,10 @@ private: Standard_Integer thelevel; Standard_Boolean theindent; Standard_Integer theindval; - Standard_Integer thetypmode; + Standard_Integer thetypmode{}; Interface_FloatWriter thefloatw; Interface_CheckIterator thechecks; - Standard_Integer thenum; + Standard_Integer thenum{}; Standard_Integer thelabmode; Handle(TColStd_HArray1OfInteger) thescopebeg; Handle(TColStd_HArray1OfInteger) thescopeend; diff --git a/src/StepData/StepData_UndefinedEntity.cxx b/src/StepData/StepData_UndefinedEntity.cxx index 381ebb81f3..50135b7e7f 100644 --- a/src/StepData/StepData_UndefinedEntity.cxx +++ b/src/StepData/StepData_UndefinedEntity.cxx @@ -26,12 +26,12 @@ IMPLEMENT_STANDARD_RTTIEXT(StepData_UndefinedEntity,Standard_Transient) -StepData_UndefinedEntity::StepData_UndefinedEntity () - { thecont = new Interface_UndefinedContent; thesub = Standard_False; } +StepData_UndefinedEntity::StepData_UndefinedEntity () : thecont(new Interface_UndefinedContent), thesub(Standard_False) + { } StepData_UndefinedEntity::StepData_UndefinedEntity - (const Standard_Boolean issub) - { thesub = issub; thecont = new Interface_UndefinedContent; } + (const Standard_Boolean issub) : thecont(new Interface_UndefinedContent), thesub(issub) + { } Handle(Interface_UndefinedContent) StepData_UndefinedEntity::UndefinedContent () const @@ -151,7 +151,7 @@ void StepData_UndefinedEntity::WriteParams (StepData_StepWriter& SW) const void StepData_UndefinedEntity::FillShared (Interface_EntityIterator& list) const { - Standard_Integer i, nb = thecont->NbParams(); + Standard_Integer i = 0, nb = thecont->NbParams(); for (i = 1; i <= nb; i ++) { Interface_ParamType ptype = thecont->ParamType(i); if (ptype == Interface_ParamSub) { diff --git a/src/StepDimTol/StepDimTol_DatumReference.hxx b/src/StepDimTol/StepDimTol_DatumReference.hxx index 7483f54fad..55e7094985 100644 --- a/src/StepDimTol/StepDimTol_DatumReference.hxx +++ b/src/StepDimTol/StepDimTol_DatumReference.hxx @@ -65,7 +65,7 @@ protected: private: - Standard_Integer myPrecedence; + Standard_Integer myPrecedence{}; Handle(StepDimTol_Datum) myReferencedDatum; diff --git a/src/StepElement/StepElement_CurveElementEndReleasePacket.hxx b/src/StepElement/StepElement_CurveElementEndReleasePacket.hxx index a48e319fcd..841168011c 100644 --- a/src/StepElement/StepElement_CurveElementEndReleasePacket.hxx +++ b/src/StepElement/StepElement_CurveElementEndReleasePacket.hxx @@ -65,7 +65,7 @@ private: StepElement_CurveElementFreedom theReleaseFreedom; - Standard_Real theReleaseStiffness; + Standard_Real theReleaseStiffness{}; }; diff --git a/src/StepElement/StepElement_CurveElementSectionDefinition.hxx b/src/StepElement/StepElement_CurveElementSectionDefinition.hxx index beb012e474..77ab047c19 100644 --- a/src/StepElement/StepElement_CurveElementSectionDefinition.hxx +++ b/src/StepElement/StepElement_CurveElementSectionDefinition.hxx @@ -66,7 +66,7 @@ private: Handle(TCollection_HAsciiString) theDescription; - Standard_Real theSectionAngle; + Standard_Real theSectionAngle{}; }; diff --git a/src/StepElement/StepElement_CurveElementSectionDerivedDefinitions.hxx b/src/StepElement/StepElement_CurveElementSectionDerivedDefinitions.hxx index ad35682e92..e6eed075ac 100644 --- a/src/StepElement/StepElement_CurveElementSectionDerivedDefinitions.hxx +++ b/src/StepElement/StepElement_CurveElementSectionDerivedDefinitions.hxx @@ -115,10 +115,10 @@ protected: private: - Standard_Real theCrossSectionalArea; + Standard_Real theCrossSectionalArea{}; Handle(StepElement_HArray1OfMeasureOrUnspecifiedValue) theShearArea; Handle(TColStd_HArray1OfReal) theSecondMomentOfArea; - Standard_Real theTorsionalConstant; + Standard_Real theTorsionalConstant{}; StepElement_MeasureOrUnspecifiedValue theWarpingConstant; Handle(StepElement_HArray1OfMeasureOrUnspecifiedValue) theLocationOfCentroid; Handle(StepElement_HArray1OfMeasureOrUnspecifiedValue) theLocationOfShearCentre; diff --git a/src/StepElement/StepElement_SurfaceSectionFieldVarying.hxx b/src/StepElement/StepElement_SurfaceSectionFieldVarying.hxx index caa5fcdc99..f7e24bc83b 100644 --- a/src/StepElement/StepElement_SurfaceSectionFieldVarying.hxx +++ b/src/StepElement/StepElement_SurfaceSectionFieldVarying.hxx @@ -65,7 +65,7 @@ private: Handle(StepElement_HArray1OfSurfaceSection) theDefinitions; - Standard_Boolean theAdditionalNodeValues; + Standard_Boolean theAdditionalNodeValues{}; }; diff --git a/src/StepElement/StepElement_UniformSurfaceSection.hxx b/src/StepElement/StepElement_UniformSurfaceSection.hxx index eef5f43892..51945bd31a 100644 --- a/src/StepElement/StepElement_UniformSurfaceSection.hxx +++ b/src/StepElement/StepElement_UniformSurfaceSection.hxx @@ -69,7 +69,7 @@ protected: private: - Standard_Real theThickness; + Standard_Real theThickness{}; StepElement_MeasureOrUnspecifiedValue theBendingThickness; StepElement_MeasureOrUnspecifiedValue theShearThickness; diff --git a/src/StepFEA/StepFEA_ConstantSurface3dElementCoordinateSystem.hxx b/src/StepFEA/StepFEA_ConstantSurface3dElementCoordinateSystem.hxx index d4430739f3..dfb0ea76cb 100644 --- a/src/StepFEA/StepFEA_ConstantSurface3dElementCoordinateSystem.hxx +++ b/src/StepFEA/StepFEA_ConstantSurface3dElementCoordinateSystem.hxx @@ -66,8 +66,8 @@ protected: private: - Standard_Integer theAxis; - Standard_Real theAngle; + Standard_Integer theAxis{}; + Standard_Real theAngle{}; }; diff --git a/src/StepFEA/StepFEA_FeaAreaDensity.hxx b/src/StepFEA/StepFEA_FeaAreaDensity.hxx index 21cc753bb6..5e2206d7bc 100644 --- a/src/StepFEA/StepFEA_FeaAreaDensity.hxx +++ b/src/StepFEA/StepFEA_FeaAreaDensity.hxx @@ -59,7 +59,7 @@ protected: private: - Standard_Real theFeaConstant; + Standard_Real theFeaConstant{}; }; diff --git a/src/StepFEA/StepFEA_FeaMassDensity.hxx b/src/StepFEA/StepFEA_FeaMassDensity.hxx index 1127a580c3..ce2db39a38 100644 --- a/src/StepFEA/StepFEA_FeaMassDensity.hxx +++ b/src/StepFEA/StepFEA_FeaMassDensity.hxx @@ -59,7 +59,7 @@ protected: private: - Standard_Real theFeaConstant; + Standard_Real theFeaConstant{}; }; diff --git a/src/StepFEA/StepFEA_FeaSecantCoefficientOfLinearThermalExpansion.hxx b/src/StepFEA/StepFEA_FeaSecantCoefficientOfLinearThermalExpansion.hxx index 0c13239ef2..4c741ad42a 100644 --- a/src/StepFEA/StepFEA_FeaSecantCoefficientOfLinearThermalExpansion.hxx +++ b/src/StepFEA/StepFEA_FeaSecantCoefficientOfLinearThermalExpansion.hxx @@ -66,7 +66,7 @@ private: StepFEA_SymmetricTensor23d theFeaConstants; - Standard_Real theReferenceTemperature; + Standard_Real theReferenceTemperature{}; }; diff --git a/src/StepFEA/StepFEA_ParametricSurface3dElementCoordinateSystem.hxx b/src/StepFEA/StepFEA_ParametricSurface3dElementCoordinateSystem.hxx index 0b284d0efa..0c5114158a 100644 --- a/src/StepFEA/StepFEA_ParametricSurface3dElementCoordinateSystem.hxx +++ b/src/StepFEA/StepFEA_ParametricSurface3dElementCoordinateSystem.hxx @@ -66,8 +66,8 @@ protected: private: - Standard_Integer theAxis; - Standard_Real theAngle; + Standard_Integer theAxis{}; + Standard_Real theAngle{}; }; diff --git a/src/StepFile/StepFile_Read.cxx b/src/StepFile/StepFile_Read.cxx index 26319a7c43..a6101e787c 100644 --- a/src/StepFile/StepFile_Read.cxx +++ b/src/StepFile/StepFile_Read.cxx @@ -110,17 +110,17 @@ static Standard_Integer StepFile_Read (const char* theName, sout << " ... STEP File Read ...\n"; - Standard_Integer nbhead, nbrec, nbpar; + Standard_Integer nbhead = 0, nbrec = 0, nbpar = 0; aFileDataModel.GetFileNbR (&nbhead,&nbrec,&nbpar); // renvoi par lex/yacc Handle(StepData_StepReaderData) undirec = new StepData_StepReaderData(nbhead,nbrec,nbpar, theStepModel->SourceCodePage()); // creation tableau de records for ( Standard_Integer nr = 1; nr <= nbrec; nr ++) { - int nbarg; char* ident; char* typrec = 0; + int nbarg = 0; char* ident = nullptr; char* typrec = 0; aFileDataModel.GetRecordDescription(&ident, &typrec, &nbarg); undirec->SetRecord (nr, ident, typrec, nbarg); if (nbarg>0) { - Interface_ParamType typa; char* val; + Interface_ParamType typa; char* val = nullptr; while(aFileDataModel.GetArgDescription (&typa, &val) == 1) { undirec->AddStepParam (nr, val, typa); } diff --git a/src/StepFile/StepFile_ReadData.cxx b/src/StepFile/StepFile_ReadData.cxx index 98054dc128..8fdfebb8a8 100644 --- a/src/StepFile/StepFile_ReadData.cxx +++ b/src/StepFile/StepFile_ReadData.cxx @@ -35,9 +35,9 @@ class StepFile_ReadData::CharactersPage { public: - CharactersPage(const Standard_Integer theMaxCar) :myNext(NULL), myUsed(0) + CharactersPage(const Standard_Integer theMaxCar) :myNext(NULL), myCharacters(new char[theMaxCar]), myUsed(0) { - myCharacters = new char[theMaxCar]; + } ~CharactersPage() @@ -83,9 +83,9 @@ public: public: - ArgumentsPage(Standard_Integer theMaxArg) :myNext(NULL), myUsed(0) + ArgumentsPage(Standard_Integer theMaxArg) :myNext(NULL), myArgs(new Argument[theMaxArg]), myUsed(0) { - myArgs = new Argument[theMaxArg]; + } ~ArgumentsPage() @@ -151,9 +151,9 @@ class StepFile_ReadData::RecordsPage public: - RecordsPage(const Standard_Integer theMaxRec) :myNext(NULL), myUsed(0) + RecordsPage(const Standard_Integer theMaxRec) :myNext(NULL), myRecords(new Record[theMaxRec]), myUsed(0) { - myRecords = new Record[theMaxRec]; + } ~RecordsPage() @@ -205,11 +205,11 @@ StepFile_ReadData::StepFile_ReadData() myNbRec(0), myNbHead(0), myNbPar(0), myYaRec(0), myNumSub(0), myErrorArg(Standard_False), myResText(NULL), myCurrType(TextValue::SubList), mySubArg(NULL), myTypeArg(Interface_ParamSub), myCurrArg(NULL), myFirstRec(NULL), - myCurRec(NULL), myLastRec(NULL), myCurScope(NULL), myFirstError(NULL), myCurError(NULL) + myCurRec(NULL), myLastRec(NULL), myCurScope(NULL), myFirstError(NULL), myCurError(NULL), myOneCharPage(new CharactersPage(myMaxChar)), myOneArgPage(new ArgumentsPage(myMaxArg)), myOneRecPage(new RecordsPage(myMaxRec)) { - myOneCharPage = new CharactersPage(myMaxChar); - myOneArgPage = new ArgumentsPage(myMaxArg); - myOneRecPage = new RecordsPage(myMaxRec); + + + }; //======================================================================= @@ -310,7 +310,7 @@ void StepFile_ReadData::RecordListStart() { if (myNumSub > 0) { - Record* aSubRec; + Record* aSubRec = nullptr; aSubRec = CreateNewRecord(); switch (myNumSub) { @@ -344,11 +344,11 @@ void StepFile_ReadData::RecordListStart() void StepFile_ReadData::CreateNewArg() { - Argument* aNewArg; + Argument* aNewArg = nullptr; myNbPar++; if (myOneArgPage->myUsed >= myMaxArg) { - ArgumentsPage* aNewArgPage; + ArgumentsPage* aNewArgPage = nullptr; aNewArgPage = new ArgumentsPage(myMaxArg); aNewArgPage->myNext = myOneArgPage; myOneArgPage = aNewArgPage; @@ -409,8 +409,8 @@ void StepFile_ReadData::CreateErrorArg() void StepFile_ReadData::AddNewScope() { - Scope* aNewScope; - Record* aRecord; + Scope* aNewScope = nullptr; + Record* aRecord = nullptr; aNewScope = new Scope; aNewScope->myRecord = myCurRec; aNewScope->myPrevious = myCurScope; @@ -429,8 +429,8 @@ void StepFile_ReadData::AddNewScope() void StepFile_ReadData::FinalOfScope() { - Scope* anOldScope; - Record* aRecord; + Scope* anOldScope = nullptr; + Record* aRecord = nullptr; if (myCurScope == NULL) return; aRecord = CreateNewRecord(); @@ -687,8 +687,8 @@ Standard_CString StepFile_ReadData::GetLastError() const char* StepFile_ReadData::RecordNewText(char* theText) { - char* aSavResText; - char* aNewText; + char* aSavResText = nullptr; + char* aNewText = nullptr; aSavResText = myResText; CreateNewText(theText, (int)strlen(theText)); aNewText = myResText; @@ -726,10 +726,10 @@ void StepFile_ReadData::AddNewRecord(Record* theNewRecord) StepFile_ReadData::Record* StepFile_ReadData::CreateNewRecord() { - Record* aNewRecord; + Record* aNewRecord = nullptr; if (myOneRecPage->myUsed >= myMaxRec) { - RecordsPage* aNewRecPage; + RecordsPage* aNewRecPage = nullptr; aNewRecPage = new RecordsPage(myMaxRec); aNewRecPage->myNext = myOneRecPage; myOneRecPage = aNewRecPage; diff --git a/src/StepFile/lex.step.cxx b/src/StepFile/lex.step.cxx index 24d51f0a0a..262c68a86e 100644 --- a/src/StepFile/lex.step.cxx +++ b/src/StepFile/lex.step.cxx @@ -797,9 +797,9 @@ static int yy_flex_strlen ( const char * ); */ YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; + yy_state_type yy_current_state = 0; + char *yy_cp = nullptr, *yy_bp = nullptr; + int yy_act = 0; if ( !(yy_init) ) { @@ -1146,7 +1146,7 @@ YY_FATAL_ERROR( "flex scanner jammed" ); */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ - yy_state_type yy_next_state; + yy_state_type yy_next_state = 0; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; @@ -1373,8 +1373,8 @@ int yyFlexLexer::yy_get_next_buffer() { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; + int number_to_move = 0, i = 0; + int ret_val = 0; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( @@ -1479,8 +1479,8 @@ int yyFlexLexer::yy_get_next_buffer() yy_state_type yyFlexLexer::yy_get_previous_state() { - yy_state_type yy_current_state; - char *yy_cp; + yy_state_type yy_current_state = 0; + char *yy_cp = nullptr; yy_current_state = (yy_start); @@ -1510,7 +1510,7 @@ int yyFlexLexer::yy_get_next_buffer() */ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) { - int yy_is_jam; + int yy_is_jam = 0; YY_CHAR yy_c = 50; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) @@ -1530,7 +1530,7 @@ int yyFlexLexer::yy_get_next_buffer() #ifndef YY_NO_UNPUT void yyFlexLexer::yyunput( int c, char* yy_bp) { - char *yy_cp; + char *yy_cp = nullptr; yy_cp = (yy_c_buf_p); @@ -1568,7 +1568,7 @@ int yyFlexLexer::yy_get_next_buffer() int yyFlexLexer::yyinput() { - int c; + int c = 0; *(yy_c_buf_p) = (yy_hold_char); @@ -1715,7 +1715,7 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) */ YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream& file, int size ) { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b = nullptr; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) @@ -1878,7 +1878,7 @@ void yyFlexLexer::yypop_buffer_state (void) */ void yyFlexLexer::yyensure_buffer_stack(void) { - yy_size_t num_to_alloc; + yy_size_t num_to_alloc = 0; if (!(yy_buffer_stack)) { @@ -1923,7 +1923,7 @@ void yyFlexLexer::yyensure_buffer_stack(void) { if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) { - yy_size_t new_size; + yy_size_t new_size = 0; (yy_start_stack_depth) += YY_START_STACK_INCR; new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); diff --git a/src/StepFile/step.tab.cxx b/src/StepFile/step.tab.cxx index 32a8fee759..00297407f2 100644 --- a/src/StepFile/step.tab.cxx +++ b/src/StepFile/step.tab.cxx @@ -174,7 +174,7 @@ namespace step { template parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v) : Base (t) - , value (YY_MOVE (v)) + , value (v) {} template @@ -206,7 +206,7 @@ namespace step { #if 201103L <= YY_CPLUSPLUS parser::by_kind::by_kind (by_kind&& that) - : kind_ (that.kind_) + noexcept : kind_ (that.kind_) { that.clear (); } @@ -285,7 +285,7 @@ namespace step { {} parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.value)) + noexcept : super_type (that.state, YY_MOVE (that.value)) { #if 201103L <= YY_CPLUSPLUS // that is emptied. @@ -434,7 +434,7 @@ namespace step { int parser::parse () { - int yyn; + int yyn = 0; /// Length of the RHS of the rule being reduced. int yylen = 0; @@ -446,7 +446,7 @@ namespace step { symbol_type yyla; /// The return value of parse (). - int yyresult; + int yyresult = 0; #if YY_EXCEPTIONS try @@ -686,7 +686,7 @@ namespace step { ++yynerrs_; context yyctx (*this, yyla); std::string msg = yysyntax_error_ (yyctx); - error (YY_MOVE (msg)); + error (msg); } diff --git a/src/StepFile/step.tab.hxx b/src/StepFile/step.tab.hxx index 914aac07b0..82a82c061e 100644 --- a/src/StepFile/step.tab.hxx +++ b/src/StepFile/step.tab.hxx @@ -405,7 +405,7 @@ namespace step { #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) noexcept; #endif /// Copy constructor. @@ -655,7 +655,7 @@ namespace step { /// Construct an empty symbol. stack_symbol_type (); /// Move or copy construction. - stack_symbol_type (YY_RVREF (stack_symbol_type) that); + stack_symbol_type (YY_RVREF (stack_symbol_type) that) noexcept; /// Steal the contents from \a sym to build this. stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); #if YY_CPLUSPLUS < 201103L diff --git a/src/StepGeom/StepGeom_Axis1Placement.hxx b/src/StepGeom/StepGeom_Axis1Placement.hxx index 2db12165a1..ce3e8e0700 100644 --- a/src/StepGeom/StepGeom_Axis1Placement.hxx +++ b/src/StepGeom/StepGeom_Axis1Placement.hxx @@ -64,7 +64,7 @@ private: Handle(StepGeom_Direction) axis; - Standard_Boolean hasAxis; + Standard_Boolean hasAxis{}; }; diff --git a/src/StepGeom/StepGeom_Axis2Placement2d.hxx b/src/StepGeom/StepGeom_Axis2Placement2d.hxx index b13f8d7b12..347572b63f 100644 --- a/src/StepGeom/StepGeom_Axis2Placement2d.hxx +++ b/src/StepGeom/StepGeom_Axis2Placement2d.hxx @@ -64,7 +64,7 @@ private: Handle(StepGeom_Direction) refDirection; - Standard_Boolean hasRefDirection; + Standard_Boolean hasRefDirection{}; }; diff --git a/src/StepGeom/StepGeom_Axis2Placement3d.hxx b/src/StepGeom/StepGeom_Axis2Placement3d.hxx index 82a199393f..ea4ee823af 100644 --- a/src/StepGeom/StepGeom_Axis2Placement3d.hxx +++ b/src/StepGeom/StepGeom_Axis2Placement3d.hxx @@ -73,8 +73,8 @@ private: Handle(StepGeom_Direction) axis; Handle(StepGeom_Direction) refDirection; - Standard_Boolean hasAxis; - Standard_Boolean hasRefDirection; + Standard_Boolean hasAxis{}; + Standard_Boolean hasRefDirection{}; }; diff --git a/src/StepGeom/StepGeom_BSplineCurve.hxx b/src/StepGeom/StepGeom_BSplineCurve.hxx index 8dfaf7c9d7..6c5de1b655 100644 --- a/src/StepGeom/StepGeom_BSplineCurve.hxx +++ b/src/StepGeom/StepGeom_BSplineCurve.hxx @@ -81,7 +81,7 @@ protected: private: - Standard_Integer degree; + Standard_Integer degree{}; Handle(StepGeom_HArray1OfCartesianPoint) controlPointsList; StepGeom_BSplineCurveForm curveForm; StepData_Logical closedCurve; diff --git a/src/StepGeom/StepGeom_BSplineSurface.hxx b/src/StepGeom/StepGeom_BSplineSurface.hxx index 59fe5fd4e7..86a5c5a772 100644 --- a/src/StepGeom/StepGeom_BSplineSurface.hxx +++ b/src/StepGeom/StepGeom_BSplineSurface.hxx @@ -91,8 +91,8 @@ protected: private: - Standard_Integer uDegree; - Standard_Integer vDegree; + Standard_Integer uDegree{}; + Standard_Integer vDegree{}; Handle(StepGeom_HArray2OfCartesianPoint) controlPointsList; StepGeom_BSplineSurfaceForm surfaceForm; StepData_Logical uClosed; diff --git a/src/StepGeom/StepGeom_CartesianPoint.hxx b/src/StepGeom/StepGeom_CartesianPoint.hxx index daab1642d6..94e51b8cc1 100644 --- a/src/StepGeom/StepGeom_CartesianPoint.hxx +++ b/src/StepGeom/StepGeom_CartesianPoint.hxx @@ -66,8 +66,8 @@ protected: private: - Standard_Integer nbcoord; - Standard_Real coords[3]; + Standard_Integer nbcoord{}; + Standard_Real coords[3]{}; }; diff --git a/src/StepGeom/StepGeom_CartesianTransformationOperator.hxx b/src/StepGeom/StepGeom_CartesianTransformationOperator.hxx index 054cc2fbd6..d2edfbcdc6 100644 --- a/src/StepGeom/StepGeom_CartesianTransformationOperator.hxx +++ b/src/StepGeom/StepGeom_CartesianTransformationOperator.hxx @@ -85,10 +85,10 @@ private: Handle(StepGeom_Direction) axis1; Handle(StepGeom_Direction) axis2; Handle(StepGeom_CartesianPoint) localOrigin; - Standard_Real scale; - Standard_Boolean hasAxis1; - Standard_Boolean hasAxis2; - Standard_Boolean hasScale; + Standard_Real scale{}; + Standard_Boolean hasAxis1{}; + Standard_Boolean hasAxis2{}; + Standard_Boolean hasScale{}; }; diff --git a/src/StepGeom/StepGeom_CartesianTransformationOperator3d.hxx b/src/StepGeom/StepGeom_CartesianTransformationOperator3d.hxx index 576b2b1c74..449cbcc85e 100644 --- a/src/StepGeom/StepGeom_CartesianTransformationOperator3d.hxx +++ b/src/StepGeom/StepGeom_CartesianTransformationOperator3d.hxx @@ -63,7 +63,7 @@ private: Handle(StepGeom_Direction) axis3; - Standard_Boolean hasAxis3; + Standard_Boolean hasAxis3{}; }; diff --git a/src/StepGeom/StepGeom_Circle.hxx b/src/StepGeom/StepGeom_Circle.hxx index e3dfc58286..e73ea112a0 100644 --- a/src/StepGeom/StepGeom_Circle.hxx +++ b/src/StepGeom/StepGeom_Circle.hxx @@ -57,7 +57,7 @@ protected: private: - Standard_Real radius; + Standard_Real radius{}; }; diff --git a/src/StepGeom/StepGeom_CompositeCurveSegment.hxx b/src/StepGeom/StepGeom_CompositeCurveSegment.hxx index 9db52e3f1f..4b8b3e8383 100644 --- a/src/StepGeom/StepGeom_CompositeCurveSegment.hxx +++ b/src/StepGeom/StepGeom_CompositeCurveSegment.hxx @@ -66,7 +66,7 @@ private: StepGeom_TransitionCode transition; - Standard_Boolean sameSense; + Standard_Boolean sameSense{}; Handle(StepGeom_Curve) parentCurve; diff --git a/src/StepGeom/StepGeom_ConicalSurface.hxx b/src/StepGeom/StepGeom_ConicalSurface.hxx index fa98f9846e..29f66c0b19 100644 --- a/src/StepGeom/StepGeom_ConicalSurface.hxx +++ b/src/StepGeom/StepGeom_ConicalSurface.hxx @@ -61,8 +61,8 @@ protected: private: - Standard_Real radius; - Standard_Real semiAngle; + Standard_Real radius{}; + Standard_Real semiAngle{}; }; diff --git a/src/StepGeom/StepGeom_CurveBoundedSurface.hxx b/src/StepGeom/StepGeom_CurveBoundedSurface.hxx index b62d74cdd6..51b6a07b5c 100644 --- a/src/StepGeom/StepGeom_CurveBoundedSurface.hxx +++ b/src/StepGeom/StepGeom_CurveBoundedSurface.hxx @@ -75,7 +75,7 @@ private: Handle(StepGeom_Surface) theBasisSurface; Handle(StepGeom_HArray1OfSurfaceBoundary) theBoundaries; - Standard_Boolean theImplicitOuter; + Standard_Boolean theImplicitOuter{}; }; diff --git a/src/StepGeom/StepGeom_CylindricalSurface.hxx b/src/StepGeom/StepGeom_CylindricalSurface.hxx index 36158a8f99..b213bf54e0 100644 --- a/src/StepGeom/StepGeom_CylindricalSurface.hxx +++ b/src/StepGeom/StepGeom_CylindricalSurface.hxx @@ -57,7 +57,7 @@ protected: private: - Standard_Real radius; + Standard_Real radius{}; }; diff --git a/src/StepGeom/StepGeom_DegenerateToroidalSurface.hxx b/src/StepGeom/StepGeom_DegenerateToroidalSurface.hxx index 2a5674ba12..46cb6e736e 100644 --- a/src/StepGeom/StepGeom_DegenerateToroidalSurface.hxx +++ b/src/StepGeom/StepGeom_DegenerateToroidalSurface.hxx @@ -57,7 +57,7 @@ protected: private: - Standard_Boolean selectOuter; + Standard_Boolean selectOuter{}; }; diff --git a/src/StepGeom/StepGeom_Ellipse.hxx b/src/StepGeom/StepGeom_Ellipse.hxx index 5d08511a6c..8cfb607ff9 100644 --- a/src/StepGeom/StepGeom_Ellipse.hxx +++ b/src/StepGeom/StepGeom_Ellipse.hxx @@ -61,8 +61,8 @@ protected: private: - Standard_Real semiAxis1; - Standard_Real semiAxis2; + Standard_Real semiAxis1{}; + Standard_Real semiAxis2{}; }; diff --git a/src/StepGeom/StepGeom_GeometricRepresentationContext.hxx b/src/StepGeom/StepGeom_GeometricRepresentationContext.hxx index 0683821dbe..29d89828eb 100644 --- a/src/StepGeom/StepGeom_GeometricRepresentationContext.hxx +++ b/src/StepGeom/StepGeom_GeometricRepresentationContext.hxx @@ -57,7 +57,7 @@ protected: private: - Standard_Integer coordinateSpaceDimension; + Standard_Integer coordinateSpaceDimension{}; }; diff --git a/src/StepGeom/StepGeom_Hyperbola.hxx b/src/StepGeom/StepGeom_Hyperbola.hxx index 10f3035112..9d719751d0 100644 --- a/src/StepGeom/StepGeom_Hyperbola.hxx +++ b/src/StepGeom/StepGeom_Hyperbola.hxx @@ -61,8 +61,8 @@ protected: private: - Standard_Real semiAxis; - Standard_Real semiImagAxis; + Standard_Real semiAxis{}; + Standard_Real semiImagAxis{}; }; diff --git a/src/StepGeom/StepGeom_OffsetCurve3d.hxx b/src/StepGeom/StepGeom_OffsetCurve3d.hxx index 5b541e3ecb..cc6a26d070 100644 --- a/src/StepGeom/StepGeom_OffsetCurve3d.hxx +++ b/src/StepGeom/StepGeom_OffsetCurve3d.hxx @@ -71,7 +71,7 @@ private: Handle(StepGeom_Curve) basisCurve; - Standard_Real distance; + Standard_Real distance{}; StepData_Logical selfIntersect; Handle(StepGeom_Direction) refDirection; diff --git a/src/StepGeom/StepGeom_OffsetSurface.hxx b/src/StepGeom/StepGeom_OffsetSurface.hxx index 4bf545f8bd..8e9e3cfc3e 100644 --- a/src/StepGeom/StepGeom_OffsetSurface.hxx +++ b/src/StepGeom/StepGeom_OffsetSurface.hxx @@ -67,7 +67,7 @@ private: Handle(StepGeom_Surface) basisSurface; - Standard_Real distance; + Standard_Real distance{}; StepData_Logical selfIntersect; diff --git a/src/StepGeom/StepGeom_OrientedSurface.hxx b/src/StepGeom/StepGeom_OrientedSurface.hxx index 0f746f501e..9facf97a6d 100644 --- a/src/StepGeom/StepGeom_OrientedSurface.hxx +++ b/src/StepGeom/StepGeom_OrientedSurface.hxx @@ -59,7 +59,7 @@ protected: private: - Standard_Boolean theOrientation; + Standard_Boolean theOrientation{}; }; diff --git a/src/StepGeom/StepGeom_Parabola.hxx b/src/StepGeom/StepGeom_Parabola.hxx index 1d7d7c7486..679cacb256 100644 --- a/src/StepGeom/StepGeom_Parabola.hxx +++ b/src/StepGeom/StepGeom_Parabola.hxx @@ -57,7 +57,7 @@ protected: private: - Standard_Real focalDist; + Standard_Real focalDist{}; }; diff --git a/src/StepGeom/StepGeom_PointOnCurve.hxx b/src/StepGeom/StepGeom_PointOnCurve.hxx index 719b22ef5d..fa5b4e87b8 100644 --- a/src/StepGeom/StepGeom_PointOnCurve.hxx +++ b/src/StepGeom/StepGeom_PointOnCurve.hxx @@ -62,7 +62,7 @@ private: Handle(StepGeom_Curve) basisCurve; - Standard_Real pointParameter; + Standard_Real pointParameter{}; }; diff --git a/src/StepGeom/StepGeom_PointOnSurface.hxx b/src/StepGeom/StepGeom_PointOnSurface.hxx index bf29823bdb..d4c432a664 100644 --- a/src/StepGeom/StepGeom_PointOnSurface.hxx +++ b/src/StepGeom/StepGeom_PointOnSurface.hxx @@ -67,8 +67,8 @@ private: Handle(StepGeom_Surface) basisSurface; - Standard_Real pointParameterU; - Standard_Real pointParameterV; + Standard_Real pointParameterU{}; + Standard_Real pointParameterV{}; }; diff --git a/src/StepGeom/StepGeom_RectangularTrimmedSurface.hxx b/src/StepGeom/StepGeom_RectangularTrimmedSurface.hxx index f3cfa0bf05..62936fa467 100644 --- a/src/StepGeom/StepGeom_RectangularTrimmedSurface.hxx +++ b/src/StepGeom/StepGeom_RectangularTrimmedSurface.hxx @@ -84,12 +84,12 @@ private: Handle(StepGeom_Surface) basisSurface; - Standard_Real u1; - Standard_Real u2; - Standard_Real v1; - Standard_Real v2; - Standard_Boolean usense; - Standard_Boolean vsense; + Standard_Real u1{}; + Standard_Real u2{}; + Standard_Real v1{}; + Standard_Real v2{}; + Standard_Boolean usense{}; + Standard_Boolean vsense{}; }; diff --git a/src/StepGeom/StepGeom_ReparametrisedCompositeCurveSegment.hxx b/src/StepGeom/StepGeom_ReparametrisedCompositeCurveSegment.hxx index ca3ab39588..30cd11607e 100644 --- a/src/StepGeom/StepGeom_ReparametrisedCompositeCurveSegment.hxx +++ b/src/StepGeom/StepGeom_ReparametrisedCompositeCurveSegment.hxx @@ -57,7 +57,7 @@ protected: private: - Standard_Real paramLength; + Standard_Real paramLength{}; }; diff --git a/src/StepGeom/StepGeom_SphericalSurface.hxx b/src/StepGeom/StepGeom_SphericalSurface.hxx index 6d23c63331..a0f4d0100c 100644 --- a/src/StepGeom/StepGeom_SphericalSurface.hxx +++ b/src/StepGeom/StepGeom_SphericalSurface.hxx @@ -57,7 +57,7 @@ protected: private: - Standard_Real radius; + Standard_Real radius{}; }; diff --git a/src/StepGeom/StepGeom_SuParameters.hxx b/src/StepGeom/StepGeom_SuParameters.hxx index 2874a986b0..38eb7f97c0 100644 --- a/src/StepGeom/StepGeom_SuParameters.hxx +++ b/src/StepGeom/StepGeom_SuParameters.hxx @@ -74,12 +74,12 @@ public : DEFINE_STANDARD_RTTIEXT(StepGeom_SuParameters, StepGeom_GeometricRepresentationItem) private: - Standard_Real myA; - Standard_Real myAlpha; - Standard_Real myB; - Standard_Real myBeta; - Standard_Real myC; - Standard_Real myGamma; + Standard_Real myA{}; + Standard_Real myAlpha{}; + Standard_Real myB{}; + Standard_Real myBeta{}; + Standard_Real myC{}; + Standard_Real myGamma{}; }; #endif // _StepGeom_SuParameters_HeaderFile_ diff --git a/src/StepGeom/StepGeom_SurfacePatch.hxx b/src/StepGeom/StepGeom_SurfacePatch.hxx index 2f3d98cdcf..0c42cafb45 100644 --- a/src/StepGeom/StepGeom_SurfacePatch.hxx +++ b/src/StepGeom/StepGeom_SurfacePatch.hxx @@ -76,8 +76,8 @@ private: Handle(StepGeom_BoundedSurface) parentSurface; StepGeom_TransitionCode uTransition; StepGeom_TransitionCode vTransition; - Standard_Boolean uSense; - Standard_Boolean vSense; + Standard_Boolean uSense{}; + Standard_Boolean vSense{}; }; diff --git a/src/StepGeom/StepGeom_ToroidalSurface.hxx b/src/StepGeom/StepGeom_ToroidalSurface.hxx index f2ade9a217..6d4c19f4ed 100644 --- a/src/StepGeom/StepGeom_ToroidalSurface.hxx +++ b/src/StepGeom/StepGeom_ToroidalSurface.hxx @@ -61,8 +61,8 @@ protected: private: - Standard_Real majorRadius; - Standard_Real minorRadius; + Standard_Real majorRadius{}; + Standard_Real minorRadius{}; }; diff --git a/src/StepGeom/StepGeom_TrimmedCurve.hxx b/src/StepGeom/StepGeom_TrimmedCurve.hxx index 45a186c18b..649fd34d65 100644 --- a/src/StepGeom/StepGeom_TrimmedCurve.hxx +++ b/src/StepGeom/StepGeom_TrimmedCurve.hxx @@ -88,7 +88,7 @@ private: Handle(StepGeom_Curve) basisCurve; Handle(StepGeom_HArray1OfTrimmingSelect) trim1; Handle(StepGeom_HArray1OfTrimmingSelect) trim2; - Standard_Boolean senseAgreement; + Standard_Boolean senseAgreement{}; StepGeom_TrimmingPreference masterRepresentation; diff --git a/src/StepGeom/StepGeom_Vector.hxx b/src/StepGeom/StepGeom_Vector.hxx index d407840e75..211eddcf68 100644 --- a/src/StepGeom/StepGeom_Vector.hxx +++ b/src/StepGeom/StepGeom_Vector.hxx @@ -62,7 +62,7 @@ private: Handle(StepGeom_Direction) orientation; - Standard_Real magnitude; + Standard_Real magnitude{}; }; diff --git a/src/StepKinematics/StepKinematics_ActuatedKinematicPair.cxx b/src/StepKinematics/StepKinematics_ActuatedKinematicPair.cxx index 123f8f3024..987c603e17 100644 --- a/src/StepKinematics/StepKinematics_ActuatedKinematicPair.cxx +++ b/src/StepKinematics/StepKinematics_ActuatedKinematicPair.cxx @@ -22,14 +22,14 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_ActuatedKinematicPair, StepKinematics_ //function : StepKinematics_ActuatedKinematicPair //purpose : //======================================================================= -StepKinematics_ActuatedKinematicPair::StepKinematics_ActuatedKinematicPair () +StepKinematics_ActuatedKinematicPair::StepKinematics_ActuatedKinematicPair () : defTX(Standard_False), defTY(Standard_False), defTZ(Standard_False), defRX(Standard_False), defRY(Standard_False), defRZ(Standard_False) { - defTX = Standard_False; - defTY = Standard_False; - defTZ = Standard_False; - defRX = Standard_False; - defRY = Standard_False; - defRZ = Standard_False; + + + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_CylindricalPairValue.hxx b/src/StepKinematics/StepKinematics_CylindricalPairValue.hxx index 9c1f07c8e2..9978a40120 100644 --- a/src/StepKinematics/StepKinematics_CylindricalPairValue.hxx +++ b/src/StepKinematics/StepKinematics_CylindricalPairValue.hxx @@ -52,8 +52,8 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_CylindricalPairValue, StepKinematics_PairValue) private: - Standard_Real myActualTranslation; - Standard_Real myActualRotation; + Standard_Real myActualTranslation{}; + Standard_Real myActualRotation{}; }; #endif // _StepKinematics_CylindricalPairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_CylindricalPairWithRange.cxx b/src/StepKinematics/StepKinematics_CylindricalPairWithRange.cxx index 81dbb23807..b5de1f4a67 100644 --- a/src/StepKinematics/StepKinematics_CylindricalPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_CylindricalPairWithRange.cxx @@ -22,12 +22,12 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_CylindricalPairWithRange, StepKinemati //function : StepKinematics_CylindricalPairWithRange //purpose : //======================================================================= -StepKinematics_CylindricalPairWithRange::StepKinematics_CylindricalPairWithRange () +StepKinematics_CylindricalPairWithRange::StepKinematics_CylindricalPairWithRange () : defLowerLimitActualTranslation(Standard_False), defUpperLimitActualTranslation(Standard_False), defLowerLimitActualRotation(Standard_False), defUpperLimitActualRotation(Standard_False) { - defLowerLimitActualTranslation = Standard_False; - defUpperLimitActualTranslation = Standard_False; - defLowerLimitActualRotation = Standard_False; - defUpperLimitActualRotation = Standard_False; + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_CylindricalPairWithRange.hxx b/src/StepKinematics/StepKinematics_CylindricalPairWithRange.hxx index b1d9369fe2..ace87a53ab 100644 --- a/src/StepKinematics/StepKinematics_CylindricalPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_CylindricalPairWithRange.hxx @@ -88,10 +88,10 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_CylindricalPairWithRange, StepKinematics_CylindricalPair) private: - Standard_Real myLowerLimitActualTranslation; //!< optional - Standard_Real myUpperLimitActualTranslation; //!< optional - Standard_Real myLowerLimitActualRotation; //!< optional - Standard_Real myUpperLimitActualRotation; //!< optional + Standard_Real myLowerLimitActualTranslation{}; //!< optional + Standard_Real myUpperLimitActualTranslation{}; //!< optional + Standard_Real myLowerLimitActualRotation{}; //!< optional + Standard_Real myUpperLimitActualRotation{}; //!< optional Standard_Boolean defLowerLimitActualTranslation; //!< flag "is LowerLimitActualTranslation defined" Standard_Boolean defUpperLimitActualTranslation; //!< flag "is UpperLimitActualTranslation defined" Standard_Boolean defLowerLimitActualRotation; //!< flag "is LowerLimitActualRotation defined" diff --git a/src/StepKinematics/StepKinematics_GearPair.hxx b/src/StepKinematics/StepKinematics_GearPair.hxx index ed70c15545..fb978deb6e 100644 --- a/src/StepKinematics/StepKinematics_GearPair.hxx +++ b/src/StepKinematics/StepKinematics_GearPair.hxx @@ -76,11 +76,11 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_GearPair, StepKinematics_LowOrderKinematicPairWithMotionCoupling) private: - Standard_Real myRadiusFirstLink; - Standard_Real myRadiusSecondLink; - Standard_Real myBevel; - Standard_Real myHelicalAngle; - Standard_Real myGearRatio; + Standard_Real myRadiusFirstLink{}; + Standard_Real myRadiusSecondLink{}; + Standard_Real myBevel{}; + Standard_Real myHelicalAngle{}; + Standard_Real myGearRatio{}; }; #endif // _StepKinematics_GearPair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_GearPairValue.hxx b/src/StepKinematics/StepKinematics_GearPairValue.hxx index 0e8b800d80..e5c2a949be 100644 --- a/src/StepKinematics/StepKinematics_GearPairValue.hxx +++ b/src/StepKinematics/StepKinematics_GearPairValue.hxx @@ -46,7 +46,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_GearPairValue, StepKinematics_PairValue) private: - Standard_Real myActualRotation1; + Standard_Real myActualRotation1{}; }; #endif // _StepKinematics_GearPairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_GearPairWithRange.cxx b/src/StepKinematics/StepKinematics_GearPairWithRange.cxx index 4e2448f80a..208a8d83d7 100644 --- a/src/StepKinematics/StepKinematics_GearPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_GearPairWithRange.cxx @@ -22,10 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_GearPairWithRange, StepKinematics_Gear //function : StepKinematics_GearPairWithRange //purpose : //======================================================================= -StepKinematics_GearPairWithRange::StepKinematics_GearPairWithRange () +StepKinematics_GearPairWithRange::StepKinematics_GearPairWithRange () : defLowerLimitActualRotation1(Standard_False), defUpperLimitActualRotation1(Standard_False) { - defLowerLimitActualRotation1 = Standard_False; - defUpperLimitActualRotation1 = Standard_False; + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_GearPairWithRange.hxx b/src/StepKinematics/StepKinematics_GearPairWithRange.hxx index c90048fd8c..1f7f806ce5 100644 --- a/src/StepKinematics/StepKinematics_GearPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_GearPairWithRange.hxx @@ -69,8 +69,8 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_GearPairWithRange, StepKinematics_GearPair) private: - Standard_Real myLowerLimitActualRotation1; //!< optional - Standard_Real myUpperLimitActualRotation1; //!< optional + Standard_Real myLowerLimitActualRotation1{}; //!< optional + Standard_Real myUpperLimitActualRotation1{}; //!< optional Standard_Boolean defLowerLimitActualRotation1; //!< flag "is LowerLimitActualRotation1 defined" Standard_Boolean defUpperLimitActualRotation1; //!< flag "is UpperLimitActualRotation1 defined" diff --git a/src/StepKinematics/StepKinematics_LinearFlexibleAndPinionPair.hxx b/src/StepKinematics/StepKinematics_LinearFlexibleAndPinionPair.hxx index 71d12f2a1f..87cfb8a0bb 100644 --- a/src/StepKinematics/StepKinematics_LinearFlexibleAndPinionPair.hxx +++ b/src/StepKinematics/StepKinematics_LinearFlexibleAndPinionPair.hxx @@ -52,7 +52,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_LinearFlexibleAndPinionPair, StepKinematics_LowOrderKinematicPairWithMotionCoupling) private: - Standard_Real myPinionRadius; + Standard_Real myPinionRadius{}; }; #endif // _StepKinematics_LinearFlexibleAndPinionPair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_LinearFlexibleAndPlanarCurvePair.hxx b/src/StepKinematics/StepKinematics_LinearFlexibleAndPlanarCurvePair.hxx index 10c0b7efdb..7fa05f10e6 100644 --- a/src/StepKinematics/StepKinematics_LinearFlexibleAndPlanarCurvePair.hxx +++ b/src/StepKinematics/StepKinematics_LinearFlexibleAndPlanarCurvePair.hxx @@ -60,7 +60,7 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_LinearFlexibleAndPlanarCurvePair, StepKin private: Handle(StepGeom_Curve) myPairCurve; - Standard_Boolean myOrientation; + Standard_Boolean myOrientation{}; }; #endif // _StepKinematics_LinearFlexibleAndPlanarCurvePair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_LowOrderKinematicPair.hxx b/src/StepKinematics/StepKinematics_LowOrderKinematicPair.hxx index f395c16453..49e02404cc 100644 --- a/src/StepKinematics/StepKinematics_LowOrderKinematicPair.hxx +++ b/src/StepKinematics/StepKinematics_LowOrderKinematicPair.hxx @@ -82,12 +82,12 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_LowOrderKinematicPair, StepKinematics_KinematicPair) private: - Standard_Boolean myTX; - Standard_Boolean myTY; - Standard_Boolean myTZ; - Standard_Boolean myRX; - Standard_Boolean myRY; - Standard_Boolean myRZ; + Standard_Boolean myTX{}; + Standard_Boolean myTY{}; + Standard_Boolean myTZ{}; + Standard_Boolean myRX{}; + Standard_Boolean myRY{}; + Standard_Boolean myRZ{}; }; #endif // _StepKinematics_LowOrderKinematicPair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_LowOrderKinematicPairValue.hxx b/src/StepKinematics/StepKinematics_LowOrderKinematicPairValue.hxx index b5f9c51041..db22ca7296 100644 --- a/src/StepKinematics/StepKinematics_LowOrderKinematicPairValue.hxx +++ b/src/StepKinematics/StepKinematics_LowOrderKinematicPairValue.hxx @@ -76,12 +76,12 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_LowOrderKinematicPairValue, StepKinematics_PairValue) private: - Standard_Real myActualTranslationX; - Standard_Real myActualTranslationY; - Standard_Real myActualTranslationZ; - Standard_Real myActualRotationX; - Standard_Real myActualRotationY; - Standard_Real myActualRotationZ; + Standard_Real myActualTranslationX{}; + Standard_Real myActualTranslationY{}; + Standard_Real myActualTranslationZ{}; + Standard_Real myActualRotationX{}; + Standard_Real myActualRotationY{}; + Standard_Real myActualRotationZ{}; }; #endif // _StepKinematics_LowOrderKinematicPairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_LowOrderKinematicPairWithRange.cxx b/src/StepKinematics/StepKinematics_LowOrderKinematicPairWithRange.cxx index 277303707b..fb85ca269f 100644 --- a/src/StepKinematics/StepKinematics_LowOrderKinematicPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_LowOrderKinematicPairWithRange.cxx @@ -22,20 +22,20 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_LowOrderKinematicPairWithRange, StepKi //function : StepKinematics_LowOrderKinematicPairWithRange //purpose : //======================================================================= -StepKinematics_LowOrderKinematicPairWithRange::StepKinematics_LowOrderKinematicPairWithRange () -{ - defLowerLimitActualRotationX = Standard_False; - defUpperLimitActualRotationX = Standard_False; - defLowerLimitActualRotationY = Standard_False; - defUpperLimitActualRotationY = Standard_False; - defLowerLimitActualRotationZ = Standard_False; - defUpperLimitActualRotationZ = Standard_False; - defLowerLimitActualTranslationX = Standard_False; - defUpperLimitActualTranslationX = Standard_False; - defLowerLimitActualTranslationY = Standard_False; - defUpperLimitActualTranslationY = Standard_False; - defLowerLimitActualTranslationZ = Standard_False; - defUpperLimitActualTranslationZ = Standard_False; +StepKinematics_LowOrderKinematicPairWithRange::StepKinematics_LowOrderKinematicPairWithRange () : defLowerLimitActualRotationX(Standard_False), defUpperLimitActualRotationX(Standard_False), defLowerLimitActualRotationY(Standard_False), defUpperLimitActualRotationY(Standard_False), defLowerLimitActualRotationZ(Standard_False), defUpperLimitActualRotationZ(Standard_False), defLowerLimitActualTranslationX(Standard_False), defUpperLimitActualTranslationX(Standard_False), defLowerLimitActualTranslationY(Standard_False), defUpperLimitActualTranslationY(Standard_False), defLowerLimitActualTranslationZ(Standard_False), defUpperLimitActualTranslationZ(Standard_False) +{ + + + + + + + + + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_LowOrderKinematicPairWithRange.hxx b/src/StepKinematics/StepKinematics_LowOrderKinematicPairWithRange.hxx index ca4bc55da6..1364f902f2 100644 --- a/src/StepKinematics/StepKinematics_LowOrderKinematicPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_LowOrderKinematicPairWithRange.hxx @@ -160,18 +160,18 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_LowOrderKinematicPairWithRange, StepKinematics_LowOrderKinematicPair) private: - Standard_Real myLowerLimitActualRotationX; //!< optional - Standard_Real myUpperLimitActualRotationX; //!< optional - Standard_Real myLowerLimitActualRotationY; //!< optional - Standard_Real myUpperLimitActualRotationY; //!< optional - Standard_Real myLowerLimitActualRotationZ; //!< optional - Standard_Real myUpperLimitActualRotationZ; //!< optional - Standard_Real myLowerLimitActualTranslationX; //!< optional - Standard_Real myUpperLimitActualTranslationX; //!< optional - Standard_Real myLowerLimitActualTranslationY; //!< optional - Standard_Real myUpperLimitActualTranslationY; //!< optional - Standard_Real myLowerLimitActualTranslationZ; //!< optional - Standard_Real myUpperLimitActualTranslationZ; //!< optional + Standard_Real myLowerLimitActualRotationX{}; //!< optional + Standard_Real myUpperLimitActualRotationX{}; //!< optional + Standard_Real myLowerLimitActualRotationY{}; //!< optional + Standard_Real myUpperLimitActualRotationY{}; //!< optional + Standard_Real myLowerLimitActualRotationZ{}; //!< optional + Standard_Real myUpperLimitActualRotationZ{}; //!< optional + Standard_Real myLowerLimitActualTranslationX{}; //!< optional + Standard_Real myUpperLimitActualTranslationX{}; //!< optional + Standard_Real myLowerLimitActualTranslationY{}; //!< optional + Standard_Real myUpperLimitActualTranslationY{}; //!< optional + Standard_Real myLowerLimitActualTranslationZ{}; //!< optional + Standard_Real myUpperLimitActualTranslationZ{}; //!< optional Standard_Boolean defLowerLimitActualRotationX; //!< flag "is LowerLimitActualRotationX defined" Standard_Boolean defUpperLimitActualRotationX; //!< flag "is UpperLimitActualRotationX defined" Standard_Boolean defLowerLimitActualRotationY; //!< flag "is LowerLimitActualRotationY defined" diff --git a/src/StepKinematics/StepKinematics_MechanismStateRepresentation.cxx b/src/StepKinematics/StepKinematics_MechanismStateRepresentation.cxx index 7dca9ea9f7..b5570da5f4 100644 --- a/src/StepKinematics/StepKinematics_MechanismStateRepresentation.cxx +++ b/src/StepKinematics/StepKinematics_MechanismStateRepresentation.cxx @@ -24,7 +24,7 @@ StepKinematics_MechanismStateRepresentation::StepKinematics_MechanismStateRepres void StepKinematics_MechanismStateRepresentation::Init(const Handle(TCollection_HAsciiString)& theName, const Handle(StepRepr_HArray1OfRepresentationItem)& theItems, const Handle(StepRepr_RepresentationContext)& theContextOfItems, - const Handle(StepKinematics_MechanismRepresentation) theMechanism) + const Handle(StepKinematics_MechanismRepresentation)& theMechanism) { StepRepr_Representation::Init(theName, theItems, theContextOfItems); myRepresentedMechanism = theMechanism; diff --git a/src/StepKinematics/StepKinematics_MechanismStateRepresentation.hxx b/src/StepKinematics/StepKinematics_MechanismStateRepresentation.hxx index 82ee1ca25c..7e26f9c189 100644 --- a/src/StepKinematics/StepKinematics_MechanismStateRepresentation.hxx +++ b/src/StepKinematics/StepKinematics_MechanismStateRepresentation.hxx @@ -34,7 +34,7 @@ public: //! Returns a MechanismStateRepresentation Standard_EXPORT StepKinematics_MechanismStateRepresentation(); - Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const Handle(StepRepr_HArray1OfRepresentationItem)& theItems, const Handle(StepRepr_RepresentationContext)& theContextOfItems, const Handle(StepKinematics_MechanismRepresentation) theMechanism); + Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const Handle(StepRepr_HArray1OfRepresentationItem)& theItems, const Handle(StepRepr_RepresentationContext)& theContextOfItems, const Handle(StepKinematics_MechanismRepresentation)& theMechanism); Standard_EXPORT void SetMechanism(const Handle(StepKinematics_MechanismRepresentation)& theMechanism); diff --git a/src/StepKinematics/StepKinematics_PlanarCurvePair.hxx b/src/StepKinematics/StepKinematics_PlanarCurvePair.hxx index 5ee0512fd5..b5a7afddd8 100644 --- a/src/StepKinematics/StepKinematics_PlanarCurvePair.hxx +++ b/src/StepKinematics/StepKinematics_PlanarCurvePair.hxx @@ -67,7 +67,7 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_PlanarCurvePair, StepKinematics_HighOrder private: Handle(StepGeom_Curve) myCurve1; Handle(StepGeom_Curve) myCurve2; - Standard_Boolean myOrientation; + Standard_Boolean myOrientation{}; }; #endif // _StepKinematics_PlanarCurvePair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_PlanarPairValue.hxx b/src/StepKinematics/StepKinematics_PlanarPairValue.hxx index a6a2560d0a..eb5509a3f8 100644 --- a/src/StepKinematics/StepKinematics_PlanarPairValue.hxx +++ b/src/StepKinematics/StepKinematics_PlanarPairValue.hxx @@ -58,9 +58,9 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_PlanarPairValue, StepKinematics_PairValue) private: - Standard_Real myActualRotation; - Standard_Real myActualTranslationX; - Standard_Real myActualTranslationY; + Standard_Real myActualRotation{}; + Standard_Real myActualTranslationX{}; + Standard_Real myActualTranslationY{}; }; #endif // _StepKinematics_PlanarPairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_PlanarPairWithRange.cxx b/src/StepKinematics/StepKinematics_PlanarPairWithRange.cxx index 3328a4a0ee..e0e578f141 100644 --- a/src/StepKinematics/StepKinematics_PlanarPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_PlanarPairWithRange.cxx @@ -22,14 +22,14 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_PlanarPairWithRange, StepKinematics_Pl //function : StepKinematics_PlanarPairWithRange //purpose : //======================================================================= -StepKinematics_PlanarPairWithRange::StepKinematics_PlanarPairWithRange () +StepKinematics_PlanarPairWithRange::StepKinematics_PlanarPairWithRange () : defLowerLimitActualRotation(Standard_False), defUpperLimitActualRotation(Standard_False), defLowerLimitActualTranslationX(Standard_False), defUpperLimitActualTranslationX(Standard_False), defLowerLimitActualTranslationY(Standard_False), defUpperLimitActualTranslationY(Standard_False) { - defLowerLimitActualRotation = Standard_False; - defUpperLimitActualRotation = Standard_False; - defLowerLimitActualTranslationX = Standard_False; - defUpperLimitActualTranslationX = Standard_False; - defLowerLimitActualTranslationY = Standard_False; - defUpperLimitActualTranslationY = Standard_False; + + + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_PlanarPairWithRange.hxx b/src/StepKinematics/StepKinematics_PlanarPairWithRange.hxx index 3ccff45350..a08c6efd6b 100644 --- a/src/StepKinematics/StepKinematics_PlanarPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_PlanarPairWithRange.hxx @@ -106,12 +106,12 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_PlanarPairWithRange, StepKinematics_PlanarPair) private: - Standard_Real myLowerLimitActualRotation; //!< optional - Standard_Real myUpperLimitActualRotation; //!< optional - Standard_Real myLowerLimitActualTranslationX; //!< optional - Standard_Real myUpperLimitActualTranslationX; //!< optional - Standard_Real myLowerLimitActualTranslationY; //!< optional - Standard_Real myUpperLimitActualTranslationY; //!< optional + Standard_Real myLowerLimitActualRotation{}; //!< optional + Standard_Real myUpperLimitActualRotation{}; //!< optional + Standard_Real myLowerLimitActualTranslationX{}; //!< optional + Standard_Real myUpperLimitActualTranslationX{}; //!< optional + Standard_Real myLowerLimitActualTranslationY{}; //!< optional + Standard_Real myUpperLimitActualTranslationY{}; //!< optional Standard_Boolean defLowerLimitActualRotation; //!< flag "is LowerLimitActualRotation defined" Standard_Boolean defUpperLimitActualRotation; //!< flag "is UpperLimitActualRotation defined" Standard_Boolean defLowerLimitActualTranslationX; //!< flag "is LowerLimitActualTranslationX defined" diff --git a/src/StepKinematics/StepKinematics_PointOnPlanarCurvePair.hxx b/src/StepKinematics/StepKinematics_PointOnPlanarCurvePair.hxx index 8fee9cdf32..0b4ca05758 100644 --- a/src/StepKinematics/StepKinematics_PointOnPlanarCurvePair.hxx +++ b/src/StepKinematics/StepKinematics_PointOnPlanarCurvePair.hxx @@ -60,7 +60,7 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_PointOnPlanarCurvePair, StepKinematics_Hi private: Handle(StepGeom_Curve) myPairCurve; - Standard_Boolean myOrientation; + Standard_Boolean myOrientation{}; }; #endif // _StepKinematics_PointOnPlanarCurvePair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_PointOnPlanarCurvePairWithRange.cxx b/src/StepKinematics/StepKinematics_PointOnPlanarCurvePairWithRange.cxx index e6027ad144..d8bff3989e 100644 --- a/src/StepKinematics/StepKinematics_PointOnPlanarCurvePairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_PointOnPlanarCurvePairWithRange.cxx @@ -22,14 +22,14 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_PointOnPlanarCurvePairWithRange, StepK //function : StepKinematics_PointOnPlanarCurvePairWithRange //purpose : //======================================================================= -StepKinematics_PointOnPlanarCurvePairWithRange::StepKinematics_PointOnPlanarCurvePairWithRange () +StepKinematics_PointOnPlanarCurvePairWithRange::StepKinematics_PointOnPlanarCurvePairWithRange () : defLowerLimitYaw(Standard_False), defUpperLimitYaw(Standard_False), defLowerLimitPitch(Standard_False), defUpperLimitPitch(Standard_False), defLowerLimitRoll(Standard_False), defUpperLimitRoll(Standard_False) { - defLowerLimitYaw = Standard_False; - defUpperLimitYaw = Standard_False; - defLowerLimitPitch = Standard_False; - defUpperLimitPitch = Standard_False; - defLowerLimitRoll = Standard_False; - defUpperLimitRoll = Standard_False; + + + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_PointOnPlanarCurvePairWithRange.hxx b/src/StepKinematics/StepKinematics_PointOnPlanarCurvePairWithRange.hxx index c49ef2fe3c..d88f8c776b 100644 --- a/src/StepKinematics/StepKinematics_PointOnPlanarCurvePairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_PointOnPlanarCurvePairWithRange.hxx @@ -111,12 +111,12 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_PointOnPlanarCurvePairWithRange, StepKine private: Handle(StepGeom_TrimmedCurve) myRangeOnPairCurve; - Standard_Real myLowerLimitYaw; //!< optional - Standard_Real myUpperLimitYaw; //!< optional - Standard_Real myLowerLimitPitch; //!< optional - Standard_Real myUpperLimitPitch; //!< optional - Standard_Real myLowerLimitRoll; //!< optional - Standard_Real myUpperLimitRoll; //!< optional + Standard_Real myLowerLimitYaw{}; //!< optional + Standard_Real myUpperLimitYaw{}; //!< optional + Standard_Real myLowerLimitPitch{}; //!< optional + Standard_Real myUpperLimitPitch{}; //!< optional + Standard_Real myLowerLimitRoll{}; //!< optional + Standard_Real myUpperLimitRoll{}; //!< optional Standard_Boolean defLowerLimitYaw; //!< flag "is LowerLimitYaw defined" Standard_Boolean defUpperLimitYaw; //!< flag "is UpperLimitYaw defined" Standard_Boolean defLowerLimitPitch; //!< flag "is LowerLimitPitch defined" diff --git a/src/StepKinematics/StepKinematics_PointOnSurfacePairWithRange.cxx b/src/StepKinematics/StepKinematics_PointOnSurfacePairWithRange.cxx index 74d76a7af2..868e0fcf98 100644 --- a/src/StepKinematics/StepKinematics_PointOnSurfacePairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_PointOnSurfacePairWithRange.cxx @@ -22,14 +22,14 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_PointOnSurfacePairWithRange, StepKinem //function : StepKinematics_PointOnSurfacePairWithRange //purpose : //======================================================================= -StepKinematics_PointOnSurfacePairWithRange::StepKinematics_PointOnSurfacePairWithRange () +StepKinematics_PointOnSurfacePairWithRange::StepKinematics_PointOnSurfacePairWithRange () : defLowerLimitYaw(Standard_False), defUpperLimitYaw(Standard_False), defLowerLimitPitch(Standard_False), defUpperLimitPitch(Standard_False), defLowerLimitRoll(Standard_False), defUpperLimitRoll(Standard_False) { - defLowerLimitYaw = Standard_False; - defUpperLimitYaw = Standard_False; - defLowerLimitPitch = Standard_False; - defUpperLimitPitch = Standard_False; - defLowerLimitRoll = Standard_False; - defUpperLimitRoll = Standard_False; + + + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_PointOnSurfacePairWithRange.hxx b/src/StepKinematics/StepKinematics_PointOnSurfacePairWithRange.hxx index bc10b25124..958e81c5b1 100644 --- a/src/StepKinematics/StepKinematics_PointOnSurfacePairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_PointOnSurfacePairWithRange.hxx @@ -110,12 +110,12 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_PointOnSurfacePairWithRange, StepKinemati private: Handle(StepGeom_RectangularTrimmedSurface) myRangeOnPairSurface; - Standard_Real myLowerLimitYaw; //!< optional - Standard_Real myUpperLimitYaw; //!< optional - Standard_Real myLowerLimitPitch; //!< optional - Standard_Real myUpperLimitPitch; //!< optional - Standard_Real myLowerLimitRoll; //!< optional - Standard_Real myUpperLimitRoll; //!< optional + Standard_Real myLowerLimitYaw{}; //!< optional + Standard_Real myUpperLimitYaw{}; //!< optional + Standard_Real myLowerLimitPitch{}; //!< optional + Standard_Real myUpperLimitPitch{}; //!< optional + Standard_Real myLowerLimitRoll{}; //!< optional + Standard_Real myUpperLimitRoll{}; //!< optional Standard_Boolean defLowerLimitYaw; //!< flag "is LowerLimitYaw defined" Standard_Boolean defUpperLimitYaw; //!< flag "is UpperLimitYaw defined" Standard_Boolean defLowerLimitPitch; //!< flag "is LowerLimitPitch defined" diff --git a/src/StepKinematics/StepKinematics_PrismaticPairValue.hxx b/src/StepKinematics/StepKinematics_PrismaticPairValue.hxx index dd11337e9a..315f0809ee 100644 --- a/src/StepKinematics/StepKinematics_PrismaticPairValue.hxx +++ b/src/StepKinematics/StepKinematics_PrismaticPairValue.hxx @@ -46,7 +46,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_PrismaticPairValue, StepKinematics_PairValue) private: - Standard_Real myActualTranslation; + Standard_Real myActualTranslation{}; }; #endif // _StepKinematics_PrismaticPairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_PrismaticPairWithRange.cxx b/src/StepKinematics/StepKinematics_PrismaticPairWithRange.cxx index 84f058ae48..dec7b44466 100644 --- a/src/StepKinematics/StepKinematics_PrismaticPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_PrismaticPairWithRange.cxx @@ -22,10 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_PrismaticPairWithRange, StepKinematics //function : StepKinematics_PrismaticPairWithRange //purpose : //======================================================================= -StepKinematics_PrismaticPairWithRange::StepKinematics_PrismaticPairWithRange () +StepKinematics_PrismaticPairWithRange::StepKinematics_PrismaticPairWithRange () : defLowerLimitActualTranslation(Standard_False), defUpperLimitActualTranslation(Standard_False) { - defLowerLimitActualTranslation = Standard_False; - defUpperLimitActualTranslation = Standard_False; + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_PrismaticPairWithRange.hxx b/src/StepKinematics/StepKinematics_PrismaticPairWithRange.hxx index 009df4743e..ca880df18c 100644 --- a/src/StepKinematics/StepKinematics_PrismaticPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_PrismaticPairWithRange.hxx @@ -70,8 +70,8 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_PrismaticPairWithRange, StepKinematics_PrismaticPair) private: - Standard_Real myLowerLimitActualTranslation; //!< optional - Standard_Real myUpperLimitActualTranslation; //!< optional + Standard_Real myLowerLimitActualTranslation{}; //!< optional + Standard_Real myUpperLimitActualTranslation{}; //!< optional Standard_Boolean defLowerLimitActualTranslation; //!< flag "is LowerLimitActualTranslation defined" Standard_Boolean defUpperLimitActualTranslation; //!< flag "is UpperLimitActualTranslation defined" diff --git a/src/StepKinematics/StepKinematics_RackAndPinionPair.hxx b/src/StepKinematics/StepKinematics_RackAndPinionPair.hxx index 02169f79e6..5ff8ecee2f 100644 --- a/src/StepKinematics/StepKinematics_RackAndPinionPair.hxx +++ b/src/StepKinematics/StepKinematics_RackAndPinionPair.hxx @@ -52,7 +52,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_RackAndPinionPair, StepKinematics_LowOrderKinematicPairWithMotionCoupling) private: - Standard_Real myPinionRadius; + Standard_Real myPinionRadius{}; }; #endif // _StepKinematics_RackAndPinionPair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_RackAndPinionPairValue.hxx b/src/StepKinematics/StepKinematics_RackAndPinionPairValue.hxx index cd927db9eb..551dac3ef9 100644 --- a/src/StepKinematics/StepKinematics_RackAndPinionPairValue.hxx +++ b/src/StepKinematics/StepKinematics_RackAndPinionPairValue.hxx @@ -46,7 +46,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_RackAndPinionPairValue, StepKinematics_PairValue) private: - Standard_Real myActualDisplacement; + Standard_Real myActualDisplacement{}; }; #endif // _StepKinematics_RackAndPinionPairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_RackAndPinionPairWithRange.cxx b/src/StepKinematics/StepKinematics_RackAndPinionPairWithRange.cxx index ddae649746..f2fc2a41c3 100644 --- a/src/StepKinematics/StepKinematics_RackAndPinionPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_RackAndPinionPairWithRange.cxx @@ -22,10 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_RackAndPinionPairWithRange, StepKinema //function : StepKinematics_RackAndPinionPairWithRange //purpose : //======================================================================= -StepKinematics_RackAndPinionPairWithRange::StepKinematics_RackAndPinionPairWithRange () +StepKinematics_RackAndPinionPairWithRange::StepKinematics_RackAndPinionPairWithRange () : defLowerLimitRackDisplacement(Standard_False), defUpperLimitRackDisplacement(Standard_False) { - defLowerLimitRackDisplacement = Standard_False; - defUpperLimitRackDisplacement = Standard_False; + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_RackAndPinionPairWithRange.hxx b/src/StepKinematics/StepKinematics_RackAndPinionPairWithRange.hxx index 1ce7e12392..68a44d7ecb 100644 --- a/src/StepKinematics/StepKinematics_RackAndPinionPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_RackAndPinionPairWithRange.hxx @@ -65,8 +65,8 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_RackAndPinionPairWithRange, StepKinematics_RackAndPinionPair) private: - Standard_Real myLowerLimitRackDisplacement; //!< optional - Standard_Real myUpperLimitRackDisplacement; //!< optional + Standard_Real myLowerLimitRackDisplacement{}; //!< optional + Standard_Real myUpperLimitRackDisplacement{}; //!< optional Standard_Boolean defLowerLimitRackDisplacement; //!< flag "is LowerLimitRackDisplacement defined" Standard_Boolean defUpperLimitRackDisplacement; //!< flag "is UpperLimitRackDisplacement defined" diff --git a/src/StepKinematics/StepKinematics_RevolutePairValue.hxx b/src/StepKinematics/StepKinematics_RevolutePairValue.hxx index 17374c4628..c85906f225 100644 --- a/src/StepKinematics/StepKinematics_RevolutePairValue.hxx +++ b/src/StepKinematics/StepKinematics_RevolutePairValue.hxx @@ -46,7 +46,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_RevolutePairValue, StepKinematics_PairValue) private: - Standard_Real myActualRotation; + Standard_Real myActualRotation{}; }; #endif // _StepKinematics_RevolutePairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_RevolutePairWithRange.cxx b/src/StepKinematics/StepKinematics_RevolutePairWithRange.cxx index db06b53bff..bd7497ec6d 100644 --- a/src/StepKinematics/StepKinematics_RevolutePairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_RevolutePairWithRange.cxx @@ -22,10 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_RevolutePairWithRange, StepKinematics_ //function : StepKinematics_RevolutePairWithRange //purpose : //======================================================================= -StepKinematics_RevolutePairWithRange::StepKinematics_RevolutePairWithRange () +StepKinematics_RevolutePairWithRange::StepKinematics_RevolutePairWithRange () : defLowerLimitActualRotation(Standard_False), defUpperLimitActualRotation(Standard_False) { - defLowerLimitActualRotation = Standard_False; - defUpperLimitActualRotation = Standard_False; + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_RevolutePairWithRange.hxx b/src/StepKinematics/StepKinematics_RevolutePairWithRange.hxx index 98851137bc..1161246ded 100644 --- a/src/StepKinematics/StepKinematics_RevolutePairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_RevolutePairWithRange.hxx @@ -70,8 +70,8 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_RevolutePairWithRange, StepKinematics_RevolutePair) private: - Standard_Real myLowerLimitActualRotation; //!< optional - Standard_Real myUpperLimitActualRotation; //!< optional + Standard_Real myLowerLimitActualRotation{}; //!< optional + Standard_Real myUpperLimitActualRotation{}; //!< optional Standard_Boolean defLowerLimitActualRotation; //!< flag "is LowerLimitActualRotation defined" Standard_Boolean defUpperLimitActualRotation; //!< flag "is UpperLimitActualRotation defined" diff --git a/src/StepKinematics/StepKinematics_RollingSurfacePairValue.hxx b/src/StepKinematics/StepKinematics_RollingSurfacePairValue.hxx index eb0b59ef91..c7c4016af5 100644 --- a/src/StepKinematics/StepKinematics_RollingSurfacePairValue.hxx +++ b/src/StepKinematics/StepKinematics_RollingSurfacePairValue.hxx @@ -54,7 +54,7 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_RollingSurfacePairValue, StepKinematics_P private: Handle(StepGeom_PointOnSurface) myActualPointOnSurface; - Standard_Real myActualRotation; + Standard_Real myActualRotation{}; }; #endif // _StepKinematics_RollingSurfacePairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_RotationAboutDirection.hxx b/src/StepKinematics/StepKinematics_RotationAboutDirection.hxx index 409ff71268..ec0783566e 100644 --- a/src/StepKinematics/StepKinematics_RotationAboutDirection.hxx +++ b/src/StepKinematics/StepKinematics_RotationAboutDirection.hxx @@ -51,7 +51,7 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_RotationAboutDirection, StepGeom_Geometri private: Handle(StepGeom_Direction) myDirectionOfAxis; - Standard_Real myRotationAngle; + Standard_Real myRotationAngle{}; }; #endif // _StepKinematics_RotationAboutDirection_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_ScrewPair.hxx b/src/StepKinematics/StepKinematics_ScrewPair.hxx index 618c553ee7..43d14bfcfa 100644 --- a/src/StepKinematics/StepKinematics_ScrewPair.hxx +++ b/src/StepKinematics/StepKinematics_ScrewPair.hxx @@ -52,7 +52,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_ScrewPair, StepKinematics_LowOrderKinematicPairWithMotionCoupling) private: - Standard_Real myPitch; + Standard_Real myPitch{}; }; #endif // _StepKinematics_ScrewPair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_ScrewPairValue.hxx b/src/StepKinematics/StepKinematics_ScrewPairValue.hxx index 7ca723db15..8ee329607d 100644 --- a/src/StepKinematics/StepKinematics_ScrewPairValue.hxx +++ b/src/StepKinematics/StepKinematics_ScrewPairValue.hxx @@ -46,7 +46,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_ScrewPairValue, StepKinematics_PairValue) private: - Standard_Real myActualRotation; + Standard_Real myActualRotation{}; }; #endif // _StepKinematics_ScrewPairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_ScrewPairWithRange.cxx b/src/StepKinematics/StepKinematics_ScrewPairWithRange.cxx index 200d4b9fe2..43bf8f7442 100644 --- a/src/StepKinematics/StepKinematics_ScrewPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_ScrewPairWithRange.cxx @@ -22,10 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_ScrewPairWithRange, StepKinematics_Scr //function : StepKinematics_ScrewPairWithRange //purpose : //======================================================================= -StepKinematics_ScrewPairWithRange::StepKinematics_ScrewPairWithRange () +StepKinematics_ScrewPairWithRange::StepKinematics_ScrewPairWithRange () : defLowerLimitActualRotation(Standard_False), defUpperLimitActualRotation(Standard_False) { - defLowerLimitActualRotation = Standard_False; - defUpperLimitActualRotation = Standard_False; + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_ScrewPairWithRange.hxx b/src/StepKinematics/StepKinematics_ScrewPairWithRange.hxx index 0dafd7c0f2..ca25e0775e 100644 --- a/src/StepKinematics/StepKinematics_ScrewPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_ScrewPairWithRange.hxx @@ -65,8 +65,8 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_ScrewPairWithRange, StepKinematics_ScrewPair) private: - Standard_Real myLowerLimitActualRotation; //!< optional - Standard_Real myUpperLimitActualRotation; //!< optional + Standard_Real myLowerLimitActualRotation{}; //!< optional + Standard_Real myUpperLimitActualRotation{}; //!< optional Standard_Boolean defLowerLimitActualRotation; //!< flag "is LowerLimitActualRotation defined" Standard_Boolean defUpperLimitActualRotation; //!< flag "is UpperLimitActualRotation defined" diff --git a/src/StepKinematics/StepKinematics_SlidingSurfacePairValue.hxx b/src/StepKinematics/StepKinematics_SlidingSurfacePairValue.hxx index c1cef284f2..21d237e8d4 100644 --- a/src/StepKinematics/StepKinematics_SlidingSurfacePairValue.hxx +++ b/src/StepKinematics/StepKinematics_SlidingSurfacePairValue.hxx @@ -61,7 +61,7 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_SlidingSurfacePairValue, StepKinematics_P private: Handle(StepGeom_PointOnSurface) myActualPointOnSurface1; Handle(StepGeom_PointOnSurface) myActualPointOnSurface2; - Standard_Real myActualRotation; + Standard_Real myActualRotation{}; }; #endif // _StepKinematics_SlidingSurfacePairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_SphericalPairWithPinAndRange.cxx b/src/StepKinematics/StepKinematics_SphericalPairWithPinAndRange.cxx index 0b876d5b27..59a4a3e300 100644 --- a/src/StepKinematics/StepKinematics_SphericalPairWithPinAndRange.cxx +++ b/src/StepKinematics/StepKinematics_SphericalPairWithPinAndRange.cxx @@ -22,12 +22,12 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_SphericalPairWithPinAndRange, StepKine //function : StepKinematics_SphericalPairWithPinAndRange //purpose : //======================================================================= -StepKinematics_SphericalPairWithPinAndRange::StepKinematics_SphericalPairWithPinAndRange () +StepKinematics_SphericalPairWithPinAndRange::StepKinematics_SphericalPairWithPinAndRange () : defLowerLimitYaw(Standard_False), defUpperLimitYaw(Standard_False), defLowerLimitRoll(Standard_False), defUpperLimitRoll(Standard_False) { - defLowerLimitYaw = Standard_False; - defUpperLimitYaw = Standard_False; - defLowerLimitRoll = Standard_False; - defUpperLimitRoll = Standard_False; + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_SphericalPairWithPinAndRange.hxx b/src/StepKinematics/StepKinematics_SphericalPairWithPinAndRange.hxx index c8e9aa89bc..a6cc446aae 100644 --- a/src/StepKinematics/StepKinematics_SphericalPairWithPinAndRange.hxx +++ b/src/StepKinematics/StepKinematics_SphericalPairWithPinAndRange.hxx @@ -88,10 +88,10 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_SphericalPairWithPinAndRange, StepKinematics_SphericalPairWithPin) private: - Standard_Real myLowerLimitYaw; //!< optional - Standard_Real myUpperLimitYaw; //!< optional - Standard_Real myLowerLimitRoll; //!< optional - Standard_Real myUpperLimitRoll; //!< optional + Standard_Real myLowerLimitYaw{}; //!< optional + Standard_Real myUpperLimitYaw{}; //!< optional + Standard_Real myLowerLimitRoll{}; //!< optional + Standard_Real myUpperLimitRoll{}; //!< optional Standard_Boolean defLowerLimitYaw; //!< flag "is LowerLimitYaw defined" Standard_Boolean defUpperLimitYaw; //!< flag "is UpperLimitYaw defined" Standard_Boolean defLowerLimitRoll; //!< flag "is LowerLimitRoll defined" diff --git a/src/StepKinematics/StepKinematics_SphericalPairWithRange.cxx b/src/StepKinematics/StepKinematics_SphericalPairWithRange.cxx index b43479ba1d..6604c9c4e6 100644 --- a/src/StepKinematics/StepKinematics_SphericalPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_SphericalPairWithRange.cxx @@ -22,14 +22,14 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_SphericalPairWithRange, StepKinematics //function : StepKinematics_SphericalPairWithRange //purpose : //======================================================================= -StepKinematics_SphericalPairWithRange::StepKinematics_SphericalPairWithRange () +StepKinematics_SphericalPairWithRange::StepKinematics_SphericalPairWithRange () : defLowerLimitYaw(Standard_False), defUpperLimitYaw(Standard_False), defLowerLimitPitch(Standard_False), defUpperLimitPitch(Standard_False), defLowerLimitRoll(Standard_False), defUpperLimitRoll(Standard_False) { - defLowerLimitYaw = Standard_False; - defUpperLimitYaw = Standard_False; - defLowerLimitPitch = Standard_False; - defUpperLimitPitch = Standard_False; - defLowerLimitRoll = Standard_False; - defUpperLimitRoll = Standard_False; + + + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_SphericalPairWithRange.hxx b/src/StepKinematics/StepKinematics_SphericalPairWithRange.hxx index 43cf7c6bd6..7fe09f2658 100644 --- a/src/StepKinematics/StepKinematics_SphericalPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_SphericalPairWithRange.hxx @@ -106,12 +106,12 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_SphericalPairWithRange, StepKinematics_SphericalPair) private: - Standard_Real myLowerLimitYaw; //!< optional - Standard_Real myUpperLimitYaw; //!< optional - Standard_Real myLowerLimitPitch; //!< optional - Standard_Real myUpperLimitPitch; //!< optional - Standard_Real myLowerLimitRoll; //!< optional - Standard_Real myUpperLimitRoll; //!< optional + Standard_Real myLowerLimitYaw{}; //!< optional + Standard_Real myUpperLimitYaw{}; //!< optional + Standard_Real myLowerLimitPitch{}; //!< optional + Standard_Real myUpperLimitPitch{}; //!< optional + Standard_Real myLowerLimitRoll{}; //!< optional + Standard_Real myUpperLimitRoll{}; //!< optional Standard_Boolean defLowerLimitYaw; //!< flag "is LowerLimitYaw defined" Standard_Boolean defUpperLimitYaw; //!< flag "is UpperLimitYaw defined" Standard_Boolean defLowerLimitPitch; //!< flag "is LowerLimitPitch defined" diff --git a/src/StepKinematics/StepKinematics_SurfacePair.hxx b/src/StepKinematics/StepKinematics_SurfacePair.hxx index d0164f3653..ccf71512c3 100644 --- a/src/StepKinematics/StepKinematics_SurfacePair.hxx +++ b/src/StepKinematics/StepKinematics_SurfacePair.hxx @@ -67,7 +67,7 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_SurfacePair, StepKinematics_HighOrderKine private: Handle(StepGeom_Surface) mySurface1; Handle(StepGeom_Surface) mySurface2; - Standard_Boolean myOrientation; + Standard_Boolean myOrientation{}; }; #endif // _StepKinematics_SurfacePair_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_SurfacePairWithRange.cxx b/src/StepKinematics/StepKinematics_SurfacePairWithRange.cxx index 7c36fd1b55..fe6f582be2 100644 --- a/src/StepKinematics/StepKinematics_SurfacePairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_SurfacePairWithRange.cxx @@ -22,10 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_SurfacePairWithRange, StepKinematics_S //function : StepKinematics_SurfacePairWithRange //purpose : //======================================================================= -StepKinematics_SurfacePairWithRange::StepKinematics_SurfacePairWithRange () +StepKinematics_SurfacePairWithRange::StepKinematics_SurfacePairWithRange () : defLowerLimitActualRotation(Standard_False), defUpperLimitActualRotation(Standard_False) { - defLowerLimitActualRotation = Standard_False; - defUpperLimitActualRotation = Standard_False; + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_SurfacePairWithRange.hxx b/src/StepKinematics/StepKinematics_SurfacePairWithRange.hxx index e948ad48f4..4cbaf14e5e 100644 --- a/src/StepKinematics/StepKinematics_SurfacePairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_SurfacePairWithRange.hxx @@ -83,8 +83,8 @@ DEFINE_STANDARD_RTTIEXT(StepKinematics_SurfacePairWithRange, StepKinematics_Surf private: Handle(StepGeom_RectangularTrimmedSurface) myRangeOnSurface1; Handle(StepGeom_RectangularTrimmedSurface) myRangeOnSurface2; - Standard_Real myLowerLimitActualRotation; //!< optional - Standard_Real myUpperLimitActualRotation; //!< optional + Standard_Real myLowerLimitActualRotation{}; //!< optional + Standard_Real myUpperLimitActualRotation{}; //!< optional Standard_Boolean defLowerLimitActualRotation; //!< flag "is LowerLimitActualRotation defined" Standard_Boolean defUpperLimitActualRotation; //!< flag "is UpperLimitActualRotation defined" diff --git a/src/StepKinematics/StepKinematics_UniversalPair.cxx b/src/StepKinematics/StepKinematics_UniversalPair.cxx index d9103609e9..6696df47a4 100644 --- a/src/StepKinematics/StepKinematics_UniversalPair.cxx +++ b/src/StepKinematics/StepKinematics_UniversalPair.cxx @@ -22,9 +22,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_UniversalPair, StepKinematics_LowOrder //function : StepKinematics_UniversalPair //purpose : //======================================================================= -StepKinematics_UniversalPair::StepKinematics_UniversalPair () +StepKinematics_UniversalPair::StepKinematics_UniversalPair () : defInputSkewAngle(Standard_False) { - defInputSkewAngle = Standard_False; + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_UniversalPair.hxx b/src/StepKinematics/StepKinematics_UniversalPair.hxx index becf5ae6ec..e5787de501 100644 --- a/src/StepKinematics/StepKinematics_UniversalPair.hxx +++ b/src/StepKinematics/StepKinematics_UniversalPair.hxx @@ -61,7 +61,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_UniversalPair, StepKinematics_LowOrderKinematicPair) private: - Standard_Real myInputSkewAngle; //!< optional + Standard_Real myInputSkewAngle{}; //!< optional Standard_Boolean defInputSkewAngle; //!< flag "is InputSkewAngle defined" }; diff --git a/src/StepKinematics/StepKinematics_UniversalPairValue.hxx b/src/StepKinematics/StepKinematics_UniversalPairValue.hxx index a26ece433e..81a40c375c 100644 --- a/src/StepKinematics/StepKinematics_UniversalPairValue.hxx +++ b/src/StepKinematics/StepKinematics_UniversalPairValue.hxx @@ -52,8 +52,8 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_UniversalPairValue, StepKinematics_PairValue) private: - Standard_Real myFirstRotationAngle; - Standard_Real mySecondRotationAngle; + Standard_Real myFirstRotationAngle{}; + Standard_Real mySecondRotationAngle{}; }; #endif // _StepKinematics_UniversalPairValue_HeaderFile_ diff --git a/src/StepKinematics/StepKinematics_UniversalPairWithRange.cxx b/src/StepKinematics/StepKinematics_UniversalPairWithRange.cxx index 9fd98da7a8..2173b1fe8f 100644 --- a/src/StepKinematics/StepKinematics_UniversalPairWithRange.cxx +++ b/src/StepKinematics/StepKinematics_UniversalPairWithRange.cxx @@ -22,12 +22,12 @@ IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_UniversalPairWithRange, StepKinematics //function : StepKinematics_UniversalPairWithRange //purpose : //======================================================================= -StepKinematics_UniversalPairWithRange::StepKinematics_UniversalPairWithRange () +StepKinematics_UniversalPairWithRange::StepKinematics_UniversalPairWithRange () : defLowerLimitFirstRotation(Standard_False), defUpperLimitFirstRotation(Standard_False), defLowerLimitSecondRotation(Standard_False), defUpperLimitSecondRotation(Standard_False) { - defLowerLimitFirstRotation = Standard_False; - defUpperLimitFirstRotation = Standard_False; - defLowerLimitSecondRotation = Standard_False; - defUpperLimitSecondRotation = Standard_False; + + + + } //======================================================================= diff --git a/src/StepKinematics/StepKinematics_UniversalPairWithRange.hxx b/src/StepKinematics/StepKinematics_UniversalPairWithRange.hxx index 7aedf8118a..2fd76a7b26 100644 --- a/src/StepKinematics/StepKinematics_UniversalPairWithRange.hxx +++ b/src/StepKinematics/StepKinematics_UniversalPairWithRange.hxx @@ -90,10 +90,10 @@ public : DEFINE_STANDARD_RTTIEXT(StepKinematics_UniversalPairWithRange, StepKinematics_UniversalPair) private: - Standard_Real myLowerLimitFirstRotation; //!< optional - Standard_Real myUpperLimitFirstRotation; //!< optional - Standard_Real myLowerLimitSecondRotation; //!< optional - Standard_Real myUpperLimitSecondRotation; //!< optional + Standard_Real myLowerLimitFirstRotation{}; //!< optional + Standard_Real myUpperLimitFirstRotation{}; //!< optional + Standard_Real myLowerLimitSecondRotation{}; //!< optional + Standard_Real myUpperLimitSecondRotation{}; //!< optional Standard_Boolean defLowerLimitFirstRotation; //!< flag "is LowerLimitFirstRotation defined" Standard_Boolean defUpperLimitFirstRotation; //!< flag "is UpperLimitFirstRotation defined" Standard_Boolean defLowerLimitSecondRotation; //!< flag "is LowerLimitSecondRotation defined" diff --git a/src/StepRepr/StepRepr_AssemblyComponentUsage.cxx b/src/StepRepr/StepRepr_AssemblyComponentUsage.cxx index 374815fadd..4a5ffb8982 100644 --- a/src/StepRepr/StepRepr_AssemblyComponentUsage.cxx +++ b/src/StepRepr/StepRepr_AssemblyComponentUsage.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_AssemblyComponentUsage,StepRepr_ProductDefin //function : StepRepr_AssemblyComponentUsage //purpose : //======================================================================= -StepRepr_AssemblyComponentUsage::StepRepr_AssemblyComponentUsage () +StepRepr_AssemblyComponentUsage::StepRepr_AssemblyComponentUsage () : defReferenceDesignator(Standard_False) { - defReferenceDesignator = Standard_False; + } //======================================================================= diff --git a/src/StepRepr/StepRepr_ConfigurationItem.cxx b/src/StepRepr/StepRepr_ConfigurationItem.cxx index 22599123ac..6d6cf99bf0 100644 --- a/src/StepRepr/StepRepr_ConfigurationItem.cxx +++ b/src/StepRepr/StepRepr_ConfigurationItem.cxx @@ -26,10 +26,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ConfigurationItem,Standard_Transient) //function : StepRepr_ConfigurationItem //purpose : //======================================================================= -StepRepr_ConfigurationItem::StepRepr_ConfigurationItem () +StepRepr_ConfigurationItem::StepRepr_ConfigurationItem () : defDescription(Standard_False), defPurpose(Standard_False) { - defDescription = Standard_False; - defPurpose = Standard_False; + + } //======================================================================= diff --git a/src/StepRepr/StepRepr_IntegerRepresentationItem.hxx b/src/StepRepr/StepRepr_IntegerRepresentationItem.hxx index 08a6ccedbe..543eae98c8 100644 --- a/src/StepRepr/StepRepr_IntegerRepresentationItem.hxx +++ b/src/StepRepr/StepRepr_IntegerRepresentationItem.hxx @@ -51,6 +51,6 @@ public: DEFINE_STANDARD_RTTIEXT(StepRepr_IntegerRepresentationItem,StepRepr_RepresentationItem) private: - Standard_Integer value; + Standard_Integer value{}; }; #endif // _StepRepr_IntegerRepresentationItem_HeaderFile diff --git a/src/StepRepr/StepRepr_MakeFromUsageOption.hxx b/src/StepRepr/StepRepr_MakeFromUsageOption.hxx index fae73e1b2f..1c016ac495 100644 --- a/src/StepRepr/StepRepr_MakeFromUsageOption.hxx +++ b/src/StepRepr/StepRepr_MakeFromUsageOption.hxx @@ -76,7 +76,7 @@ protected: private: - Standard_Integer theRanking; + Standard_Integer theRanking{}; Handle(TCollection_HAsciiString) theRankingRationale; Handle(StepBasic_MeasureWithUnit) theQuantity; diff --git a/src/StepRepr/StepRepr_MeasureRepresentationItem.cxx b/src/StepRepr/StepRepr_MeasureRepresentationItem.cxx index 88a45d878d..a3ea397efd 100644 --- a/src/StepRepr/StepRepr_MeasureRepresentationItem.cxx +++ b/src/StepRepr/StepRepr_MeasureRepresentationItem.cxx @@ -28,9 +28,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_MeasureRepresentationItem,StepRepr_Represent //function : StepRepr_MeasureRepresentationItem //purpose : //======================================================================= -StepRepr_MeasureRepresentationItem::StepRepr_MeasureRepresentationItem() +StepRepr_MeasureRepresentationItem::StepRepr_MeasureRepresentationItem() : myMeasure(new StepBasic_MeasureWithUnit) { - myMeasure = new StepBasic_MeasureWithUnit; + } //======================================================================= diff --git a/src/StepRepr/StepRepr_ProductConcept.cxx b/src/StepRepr/StepRepr_ProductConcept.cxx index 0848fb0e47..ad23a2ea54 100644 --- a/src/StepRepr/StepRepr_ProductConcept.cxx +++ b/src/StepRepr/StepRepr_ProductConcept.cxx @@ -26,9 +26,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ProductConcept,Standard_Transient) //function : StepRepr_ProductConcept //purpose : //======================================================================= -StepRepr_ProductConcept::StepRepr_ProductConcept () +StepRepr_ProductConcept::StepRepr_ProductConcept () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepRepr/StepRepr_PropertyDefinition.cxx b/src/StepRepr/StepRepr_PropertyDefinition.cxx index 0064af2275..56fd82cead 100644 --- a/src/StepRepr/StepRepr_PropertyDefinition.cxx +++ b/src/StepRepr/StepRepr_PropertyDefinition.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_PropertyDefinition,Standard_Transient) //function : StepRepr_PropertyDefinition //purpose : //======================================================================= -StepRepr_PropertyDefinition::StepRepr_PropertyDefinition () +StepRepr_PropertyDefinition::StepRepr_PropertyDefinition () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepRepr/StepRepr_ReprItemAndLengthMeasureWithUnit.cxx b/src/StepRepr/StepRepr_ReprItemAndLengthMeasureWithUnit.cxx index 821b856c99..e59e3839f6 100644 --- a/src/StepRepr/StepRepr_ReprItemAndLengthMeasureWithUnit.cxx +++ b/src/StepRepr/StepRepr_ReprItemAndLengthMeasureWithUnit.cxx @@ -22,9 +22,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ReprItemAndLengthMeasureWithUnit,StepRepr_Re //function : StepRepr_ReprItemAndLengthMeasureWithUnit //purpose : //======================================================================= -StepRepr_ReprItemAndLengthMeasureWithUnit::StepRepr_ReprItemAndLengthMeasureWithUnit() : StepRepr_ReprItemAndMeasureWithUnit() +StepRepr_ReprItemAndLengthMeasureWithUnit::StepRepr_ReprItemAndLengthMeasureWithUnit() : StepRepr_ReprItemAndMeasureWithUnit(), myLengthMeasureWithUnit(new StepBasic_LengthMeasureWithUnit()) { - myLengthMeasureWithUnit = new StepBasic_LengthMeasureWithUnit(); + } //======================================================================= diff --git a/src/StepRepr/StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI.cxx b/src/StepRepr/StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI.cxx index 2a61ce9b75..501a697935 100644 --- a/src/StepRepr/StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI.cxx +++ b/src/StepRepr/StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI.cxx @@ -22,9 +22,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI,StepR //function : StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI //purpose : //======================================================================= -StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI::StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI() : StepRepr_ReprItemAndMeasureWithUnitAndQRI() +StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI::StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI() : StepRepr_ReprItemAndMeasureWithUnitAndQRI(), myLengthMeasureWithUnit(new StepBasic_LengthMeasureWithUnit()) { - myLengthMeasureWithUnit = new StepBasic_LengthMeasureWithUnit(); + } //======================================================================= diff --git a/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnit.cxx b/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnit.cxx index b881f28d0a..fe901abe5c 100644 --- a/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnit.cxx +++ b/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnit.cxx @@ -26,10 +26,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ReprItemAndMeasureWithUnit,StepRepr_Represen //function : StepRepr_ReprItemAndMeasureWithUnit //purpose : //======================================================================= -StepRepr_ReprItemAndMeasureWithUnit::StepRepr_ReprItemAndMeasureWithUnit() +StepRepr_ReprItemAndMeasureWithUnit::StepRepr_ReprItemAndMeasureWithUnit() : myMeasureWithUnit(new StepBasic_MeasureWithUnit()), myMeasureRepresentationItem(new StepRepr_MeasureRepresentationItem()) { - myMeasureWithUnit = new StepBasic_MeasureWithUnit(); - myMeasureRepresentationItem = new StepRepr_MeasureRepresentationItem(); + + } diff --git a/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnitAndQRI.cxx b/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnitAndQRI.cxx index b03f5f3575..822380f95e 100644 --- a/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnitAndQRI.cxx +++ b/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnitAndQRI.cxx @@ -27,7 +27,7 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ReprItemAndMeasureWithUnitAndQRI,StepRepr_Re void StepRepr_ReprItemAndMeasureWithUnitAndQRI::Init (const Handle(StepBasic_MeasureWithUnit)& aMWU, const Handle(StepRepr_RepresentationItem)& aRI, - const Handle(StepShape_QualifiedRepresentationItem) aQRI) + const Handle(StepShape_QualifiedRepresentationItem)& aQRI) { StepRepr_ReprItemAndMeasureWithUnit::Init(aMWU, aRI); myQualifiedRepresentationItem = aQRI; @@ -37,9 +37,9 @@ void StepRepr_ReprItemAndMeasureWithUnitAndQRI::Init (const Handle(StepBasic_Mea //function : StepRepr_ReprItemAndMeasureWithUnitAndQRI //purpose : //======================================================================= -StepRepr_ReprItemAndMeasureWithUnitAndQRI::StepRepr_ReprItemAndMeasureWithUnitAndQRI() : StepRepr_ReprItemAndMeasureWithUnit() +StepRepr_ReprItemAndMeasureWithUnitAndQRI::StepRepr_ReprItemAndMeasureWithUnitAndQRI() : StepRepr_ReprItemAndMeasureWithUnit(), myQualifiedRepresentationItem(new StepShape_QualifiedRepresentationItem()) { - myQualifiedRepresentationItem = new StepShape_QualifiedRepresentationItem(); + } //======================================================================= diff --git a/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnitAndQRI.hxx b/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnitAndQRI.hxx index 961a8165dd..c8108ac603 100644 --- a/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnitAndQRI.hxx +++ b/src/StepRepr/StepRepr_ReprItemAndMeasureWithUnitAndQRI.hxx @@ -35,7 +35,7 @@ public: Standard_EXPORT StepRepr_ReprItemAndMeasureWithUnitAndQRI(); - Standard_EXPORT void Init (const Handle(StepBasic_MeasureWithUnit)& aMWU, const Handle(StepRepr_RepresentationItem)& aRI, const Handle(StepShape_QualifiedRepresentationItem) aQRI); + Standard_EXPORT void Init (const Handle(StepBasic_MeasureWithUnit)& aMWU, const Handle(StepRepr_RepresentationItem)& aRI, const Handle(StepShape_QualifiedRepresentationItem)& aQRI); Standard_EXPORT void SetQualifiedRepresentationItem (const Handle(StepShape_QualifiedRepresentationItem)& aQRI); diff --git a/src/StepRepr/StepRepr_ReprItemAndPlaneAngleMeasureWithUnit.cxx b/src/StepRepr/StepRepr_ReprItemAndPlaneAngleMeasureWithUnit.cxx index 7e9aa19115..d76c4d1d7f 100644 --- a/src/StepRepr/StepRepr_ReprItemAndPlaneAngleMeasureWithUnit.cxx +++ b/src/StepRepr/StepRepr_ReprItemAndPlaneAngleMeasureWithUnit.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ReprItemAndPlaneAngleMeasureWithUnit,StepRep //function : StepRepr_ReprItemAndPlaneAngleMeasureWithUnit //purpose : //======================================================================= -StepRepr_ReprItemAndPlaneAngleMeasureWithUnit::StepRepr_ReprItemAndPlaneAngleMeasureWithUnit() : StepRepr_ReprItemAndMeasureWithUnit() +StepRepr_ReprItemAndPlaneAngleMeasureWithUnit::StepRepr_ReprItemAndPlaneAngleMeasureWithUnit() : StepRepr_ReprItemAndMeasureWithUnit(), myPlaneAngleMeasureWithUnit(new StepBasic_PlaneAngleMeasureWithUnit()) { - myPlaneAngleMeasureWithUnit = new StepBasic_PlaneAngleMeasureWithUnit(); + } //======================================================================= diff --git a/src/StepRepr/StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI.cxx b/src/StepRepr/StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI.cxx index fd72a32493..b1498e327b 100644 --- a/src/StepRepr/StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI.cxx +++ b/src/StepRepr/StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI,S //function : StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI //purpose : //======================================================================= -StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI::StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI() : StepRepr_ReprItemAndMeasureWithUnitAndQRI() +StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI::StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI() : StepRepr_ReprItemAndMeasureWithUnitAndQRI(), myPlaneAngleMeasureWithUnit(new StepBasic_PlaneAngleMeasureWithUnit()) { - myPlaneAngleMeasureWithUnit = new StepBasic_PlaneAngleMeasureWithUnit(); + } //======================================================================= diff --git a/src/StepRepr/StepRepr_ShapeAspectRelationship.cxx b/src/StepRepr/StepRepr_ShapeAspectRelationship.cxx index 0d5ce23c34..c0317d67ba 100644 --- a/src/StepRepr/StepRepr_ShapeAspectRelationship.cxx +++ b/src/StepRepr/StepRepr_ShapeAspectRelationship.cxx @@ -25,9 +25,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepRepr_ShapeAspectRelationship,Standard_Transient) //function : StepRepr_ShapeAspectRelationship //purpose : //======================================================================= -StepRepr_ShapeAspectRelationship::StepRepr_ShapeAspectRelationship () +StepRepr_ShapeAspectRelationship::StepRepr_ShapeAspectRelationship () : defDescription(Standard_False) { - defDescription = Standard_False; + } //======================================================================= diff --git a/src/StepSelect/StepSelect_StepType.cxx b/src/StepSelect/StepSelect_StepType.cxx index 69b5397606..b326804c29 100644 --- a/src/StepSelect/StepSelect_StepType.cxx +++ b/src/StepSelect/StepSelect_StepType.cxx @@ -51,7 +51,7 @@ static TCollection_AsciiString lastvalue; { lastvalue.Clear(); Handle(StepData_ReadWriteModule) module; - Standard_Integer CN; + Standard_Integer CN = 0; Standard_Boolean ok = thelib.Select (ent,module,CN); if (!ok) { lastvalue.AssignCat ("..NOT FROM SCHEMA "); diff --git a/src/StepShape/StepShape_Block.hxx b/src/StepShape/StepShape_Block.hxx index 5110fb5b4f..1e34cd3fe6 100644 --- a/src/StepShape/StepShape_Block.hxx +++ b/src/StepShape/StepShape_Block.hxx @@ -70,9 +70,9 @@ private: Handle(StepGeom_Axis2Placement3d) position; - Standard_Real x; - Standard_Real y; - Standard_Real z; + Standard_Real x{}; + Standard_Real y{}; + Standard_Real z{}; }; diff --git a/src/StepShape/StepShape_BooleanOperand.hxx b/src/StepShape/StepShape_BooleanOperand.hxx index 689b8075fb..af90dc0a89 100644 --- a/src/StepShape/StepShape_BooleanOperand.hxx +++ b/src/StepShape/StepShape_BooleanOperand.hxx @@ -85,7 +85,7 @@ private: Handle(StepShape_HalfSpaceSolid) theHalfSpaceSolid; StepShape_CsgPrimitive theCsgPrimitive; Handle(StepShape_BooleanResult) theBooleanResult; - Standard_Integer theTypeOfContent; + Standard_Integer theTypeOfContent{}; }; diff --git a/src/StepShape/StepShape_BoxDomain.hxx b/src/StepShape/StepShape_BoxDomain.hxx index 08e6a1f195..839712b97c 100644 --- a/src/StepShape/StepShape_BoxDomain.hxx +++ b/src/StepShape/StepShape_BoxDomain.hxx @@ -69,9 +69,9 @@ private: Handle(StepGeom_CartesianPoint) corner; - Standard_Real xlength; - Standard_Real ylength; - Standard_Real zlength; + Standard_Real xlength{}; + Standard_Real ylength{}; + Standard_Real zlength{}; }; diff --git a/src/StepShape/StepShape_CsgSelect.hxx b/src/StepShape/StepShape_CsgSelect.hxx index ffd9e75860..d14d5b23f0 100644 --- a/src/StepShape/StepShape_CsgSelect.hxx +++ b/src/StepShape/StepShape_CsgSelect.hxx @@ -66,7 +66,7 @@ private: Handle(StepShape_BooleanResult) theBooleanResult; StepShape_CsgPrimitive theCsgPrimitive; - Standard_Integer theTypeOfContent; + Standard_Integer theTypeOfContent{}; }; diff --git a/src/StepShape/StepShape_EdgeCurve.hxx b/src/StepShape/StepShape_EdgeCurve.hxx index 0b7fb8b600..2cf401ad3d 100644 --- a/src/StepShape/StepShape_EdgeCurve.hxx +++ b/src/StepShape/StepShape_EdgeCurve.hxx @@ -63,7 +63,7 @@ private: Handle(StepGeom_Curve) edgeGeometry; - Standard_Boolean sameSense; + Standard_Boolean sameSense{}; }; diff --git a/src/StepShape/StepShape_ExtrudedAreaSolid.hxx b/src/StepShape/StepShape_ExtrudedAreaSolid.hxx index 2dbcfeebbc..2271015f98 100644 --- a/src/StepShape/StepShape_ExtrudedAreaSolid.hxx +++ b/src/StepShape/StepShape_ExtrudedAreaSolid.hxx @@ -63,7 +63,7 @@ private: Handle(StepGeom_Direction) extrudedDirection; - Standard_Real depth; + Standard_Real depth{}; }; diff --git a/src/StepShape/StepShape_ExtrudedFaceSolid.hxx b/src/StepShape/StepShape_ExtrudedFaceSolid.hxx index e47cce88bc..3da03811cf 100644 --- a/src/StepShape/StepShape_ExtrudedFaceSolid.hxx +++ b/src/StepShape/StepShape_ExtrudedFaceSolid.hxx @@ -63,7 +63,7 @@ private: Handle(StepGeom_Direction) extrudedDirection; - Standard_Real depth; + Standard_Real depth{}; }; diff --git a/src/StepShape/StepShape_FaceBound.hxx b/src/StepShape/StepShape_FaceBound.hxx index 2890d90775..78f4346bf9 100644 --- a/src/StepShape/StepShape_FaceBound.hxx +++ b/src/StepShape/StepShape_FaceBound.hxx @@ -63,7 +63,7 @@ private: Handle(StepShape_Loop) bound; - Standard_Boolean orientation; + Standard_Boolean orientation{}; }; diff --git a/src/StepShape/StepShape_FaceSurface.hxx b/src/StepShape/StepShape_FaceSurface.hxx index 7ef488b805..6e7cbe921c 100644 --- a/src/StepShape/StepShape_FaceSurface.hxx +++ b/src/StepShape/StepShape_FaceSurface.hxx @@ -63,7 +63,7 @@ private: Handle(StepGeom_Surface) faceGeometry; - Standard_Boolean sameSense; + Standard_Boolean sameSense{}; }; diff --git a/src/StepShape/StepShape_HalfSpaceSolid.hxx b/src/StepShape/StepShape_HalfSpaceSolid.hxx index b80bba4641..dce5d45c18 100644 --- a/src/StepShape/StepShape_HalfSpaceSolid.hxx +++ b/src/StepShape/StepShape_HalfSpaceSolid.hxx @@ -62,7 +62,7 @@ private: Handle(StepGeom_Surface) baseSurface; - Standard_Boolean agreementFlag; + Standard_Boolean agreementFlag{}; }; diff --git a/src/StepShape/StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem.cxx b/src/StepShape/StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem.cxx index 8d5c033d6b..40cfc9e74e 100644 --- a/src/StepShape/StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem.cxx +++ b/src/StepShape/StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem.cxx @@ -22,9 +22,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem,StepRepr_RepresentationItem) -StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem::StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem () +StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem::StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem () : myMeasure(new StepBasic_MeasureWithUnit) { - myMeasure = new StepBasic_MeasureWithUnit; + } void StepShape_MeasureRepresentationItemAndQualifiedRepresentationItem::Init diff --git a/src/StepShape/StepShape_OrientedClosedShell.hxx b/src/StepShape/StepShape_OrientedClosedShell.hxx index 90082e01d3..b503eb93ae 100644 --- a/src/StepShape/StepShape_OrientedClosedShell.hxx +++ b/src/StepShape/StepShape_OrientedClosedShell.hxx @@ -73,7 +73,7 @@ private: Handle(StepShape_ClosedShell) closedShellElement; - Standard_Boolean orientation; + Standard_Boolean orientation{}; }; diff --git a/src/StepShape/StepShape_OrientedEdge.hxx b/src/StepShape/StepShape_OrientedEdge.hxx index 3f80561a9b..b9f2a23754 100644 --- a/src/StepShape/StepShape_OrientedEdge.hxx +++ b/src/StepShape/StepShape_OrientedEdge.hxx @@ -71,7 +71,7 @@ private: Handle(StepShape_Edge) edgeElement; - Standard_Boolean orientation; + Standard_Boolean orientation{}; }; diff --git a/src/StepShape/StepShape_OrientedFace.hxx b/src/StepShape/StepShape_OrientedFace.hxx index 3458ac4b8e..cf3664ed48 100644 --- a/src/StepShape/StepShape_OrientedFace.hxx +++ b/src/StepShape/StepShape_OrientedFace.hxx @@ -73,7 +73,7 @@ private: Handle(StepShape_Face) faceElement; - Standard_Boolean orientation; + Standard_Boolean orientation{}; }; diff --git a/src/StepShape/StepShape_OrientedOpenShell.hxx b/src/StepShape/StepShape_OrientedOpenShell.hxx index c44889c932..aae38e1ee4 100644 --- a/src/StepShape/StepShape_OrientedOpenShell.hxx +++ b/src/StepShape/StepShape_OrientedOpenShell.hxx @@ -73,7 +73,7 @@ private: Handle(StepShape_OpenShell) openShellElement; - Standard_Boolean orientation; + Standard_Boolean orientation{}; }; diff --git a/src/StepShape/StepShape_OrientedPath.hxx b/src/StepShape/StepShape_OrientedPath.hxx index 29d268d042..8a6d0f2601 100644 --- a/src/StepShape/StepShape_OrientedPath.hxx +++ b/src/StepShape/StepShape_OrientedPath.hxx @@ -73,7 +73,7 @@ private: Handle(StepShape_EdgeLoop) pathElement; - Standard_Boolean orientation; + Standard_Boolean orientation{}; }; diff --git a/src/StepShape/StepShape_PrecisionQualifier.hxx b/src/StepShape/StepShape_PrecisionQualifier.hxx index 7214e968b5..5e37b6cea3 100644 --- a/src/StepShape/StepShape_PrecisionQualifier.hxx +++ b/src/StepShape/StepShape_PrecisionQualifier.hxx @@ -54,7 +54,7 @@ protected: private: - Standard_Integer thePrecisionValue; + Standard_Integer thePrecisionValue{}; }; diff --git a/src/StepShape/StepShape_RevolvedAreaSolid.hxx b/src/StepShape/StepShape_RevolvedAreaSolid.hxx index 2fce9ccf37..9d47659116 100644 --- a/src/StepShape/StepShape_RevolvedAreaSolid.hxx +++ b/src/StepShape/StepShape_RevolvedAreaSolid.hxx @@ -63,7 +63,7 @@ private: Handle(StepGeom_Axis1Placement) axis; - Standard_Real angle; + Standard_Real angle{}; }; diff --git a/src/StepShape/StepShape_RevolvedFaceSolid.hxx b/src/StepShape/StepShape_RevolvedFaceSolid.hxx index 5fd4409fdf..c12757bedf 100644 --- a/src/StepShape/StepShape_RevolvedFaceSolid.hxx +++ b/src/StepShape/StepShape_RevolvedFaceSolid.hxx @@ -65,7 +65,7 @@ private: Handle(StepGeom_Axis1Placement) axis; - Standard_Real angle; + Standard_Real angle{}; }; diff --git a/src/StepShape/StepShape_RightAngularWedge.hxx b/src/StepShape/StepShape_RightAngularWedge.hxx index 213ff0de19..ac30fcfa2e 100644 --- a/src/StepShape/StepShape_RightAngularWedge.hxx +++ b/src/StepShape/StepShape_RightAngularWedge.hxx @@ -74,10 +74,10 @@ private: Handle(StepGeom_Axis2Placement3d) position; - Standard_Real x; - Standard_Real y; - Standard_Real z; - Standard_Real ltx; + Standard_Real x{}; + Standard_Real y{}; + Standard_Real z{}; + Standard_Real ltx{}; }; diff --git a/src/StepShape/StepShape_RightCircularCone.hxx b/src/StepShape/StepShape_RightCircularCone.hxx index c967ca3d81..d881a1d020 100644 --- a/src/StepShape/StepShape_RightCircularCone.hxx +++ b/src/StepShape/StepShape_RightCircularCone.hxx @@ -70,9 +70,9 @@ private: Handle(StepGeom_Axis1Placement) position; - Standard_Real height; - Standard_Real radius; - Standard_Real semiAngle; + Standard_Real height{}; + Standard_Real radius{}; + Standard_Real semiAngle{}; }; diff --git a/src/StepShape/StepShape_RightCircularCylinder.hxx b/src/StepShape/StepShape_RightCircularCylinder.hxx index c6180d6c24..f043a5feec 100644 --- a/src/StepShape/StepShape_RightCircularCylinder.hxx +++ b/src/StepShape/StepShape_RightCircularCylinder.hxx @@ -66,8 +66,8 @@ private: Handle(StepGeom_Axis1Placement) position; - Standard_Real height; - Standard_Real radius; + Standard_Real height{}; + Standard_Real radius{}; }; diff --git a/src/StepShape/StepShape_Sphere.hxx b/src/StepShape/StepShape_Sphere.hxx index 445c29dec1..ec791690a3 100644 --- a/src/StepShape/StepShape_Sphere.hxx +++ b/src/StepShape/StepShape_Sphere.hxx @@ -61,7 +61,7 @@ protected: private: - Standard_Real radius; + Standard_Real radius{}; Handle(StepGeom_Point) centre; diff --git a/src/StepShape/StepShape_Torus.hxx b/src/StepShape/StepShape_Torus.hxx index 5014e1f257..e4bf03c5bd 100644 --- a/src/StepShape/StepShape_Torus.hxx +++ b/src/StepShape/StepShape_Torus.hxx @@ -66,8 +66,8 @@ private: Handle(StepGeom_Axis1Placement) position; - Standard_Real majorRadius; - Standard_Real minorRadius; + Standard_Real majorRadius{}; + Standard_Real minorRadius{}; }; diff --git a/src/StepToGeom/StepToGeom.cxx b/src/StepToGeom/StepToGeom.cxx index 1b365c150e..d1003f77e2 100644 --- a/src/StepToGeom/StepToGeom.cxx +++ b/src/StepToGeom/StepToGeom.cxx @@ -767,7 +767,7 @@ Handle(TBSplineCurve) MakeBSplineCurveCommon aSummaryMuultypisity += aUniqueKnotMultiplicities.Value(i); } - Standard_Boolean shouldBePeriodic; + Standard_Boolean shouldBePeriodic = 0; if (aSummaryMuultypisity == (NbPoles + aDegree + 1)) { shouldBePeriodic = Standard_False; @@ -834,7 +834,7 @@ Handle(Geom2d_BSplineCurve) StepToGeom::MakeBSplineCurve2d (const Handle(StepGeo Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface (const Handle(StepGeom_BSplineSurface)& SS) { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Handle(StepGeom_BSplineSurfaceWithKnots) BS; Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BSR; @@ -1899,7 +1899,7 @@ static Standard_Boolean ExtractParameter Standard_Real & aParam) { Handle(StepGeom_CartesianPoint) aPoint; - Standard_Integer i; + Standard_Integer i = 0; //:S4136 Standard_Real precBrep = BRepAPI::Precision(); for ( i = 1 ; i <= nbSel ; i++) { StepGeom_TrimmingSelect theSel = TS->Value(i); @@ -1995,7 +1995,7 @@ Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve (const Handle(StepGeom_Tr const Standard_Integer nbSel1 = SC->NbTrim1(); const Standard_Integer nbSel2 = SC->NbTrim2(); - Standard_Integer MasterRep; + Standard_Integer MasterRep = 0; switch (SC->MasterRepresentation()) { case StepGeom_tpCartesian: MasterRep = 1; break; @@ -2007,7 +2007,7 @@ Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve (const Handle(StepGeom_Tr //and parameters are specified as CARTESIAN_POINT Standard_Boolean isPoint = Standard_False; if(MasterRep == 0 || (MasterRep == 2 && nbSel1 >1 && nbSel2 > 1)) { - Standard_Integer ii; + Standard_Integer ii = 0; for(ii = 1; ii <= nbSel1; ii++) { if (!(theTrimSel1->Value(ii).CartesianPoint().IsNull())) diff --git a/src/StepToTopoDS/StepToTopoDS_Builder.cxx b/src/StepToTopoDS/StepToTopoDS_Builder.cxx index b502766c3b..86a861135a 100644 --- a/src/StepToTopoDS/StepToTopoDS_Builder.cxx +++ b/src/StepToTopoDS/StepToTopoDS_Builder.cxx @@ -87,6 +87,7 @@ #include #include +#include #include static void ResetPreci (const TopoDS_Shape& S, Standard_Real maxtol) { @@ -369,7 +370,7 @@ void StepToTopoDS_Builder::Init BRep_Builder B; B.MakeSolid(S); B.Add(S,Sh); - Standard_Integer Nb, i; + Standard_Integer Nb = 0, i = 0; Nb = aFBABWV->NbVoids(); Message_ProgressScope aPS (aPSRoot.Next(), NULL, Nb); for ( i=1; i<=Nb && aPS.More(); i++) { @@ -639,7 +640,7 @@ static TopoDS_Face TranslateBoundedSurf (const Handle(StepGeom_Surface) &surf, if (!RS.IsNull()) { - Standard_Real umin, umax, vmin, vmax; + Standard_Real umin = NAN, umax = NAN, vmin = NAN, vmax = NAN; theSurf->Bounds(umin, umax, vmin, vmax); myMkFace.Init(RS->BasisSurface(), umin, umax, vmin, vmax, TolDegen); @@ -664,7 +665,7 @@ void StepToTopoDS_Builder::Init BRep_Builder B; B.MakeCompound(S); TopoDS_Edge theEdge; - Standard_Integer i; + Standard_Integer i = 0; Standard_Real preci = Precision(); //gka Standard_Real maxtol = MaxTol(); Standard_Integer nbElem = GCS->NbElements(); @@ -673,7 +674,7 @@ void StepToTopoDS_Builder::Init { Message_ProgressRange aRange = aPS.Next(); StepShape_GeometricSetSelect aGSS = GCS->ElementsValue(i); - Handle(Standard_Transient) ent = aGSS.Value(); + const Handle(Standard_Transient)& ent = aGSS.Value(); TopoDS_Shape res = TransferBRep::ShapeResult ( TP, ent ); if ( ! res.IsNull() ) { // already translated diff --git a/src/StepToTopoDS/StepToTopoDS_NMTool.cxx b/src/StepToTopoDS/StepToTopoDS_NMTool.cxx index 8db5198325..3e6b110ba0 100644 --- a/src/StepToTopoDS/StepToTopoDS_NMTool.cxx +++ b/src/StepToTopoDS/StepToTopoDS_NMTool.cxx @@ -23,9 +23,9 @@ // Purpose : Default constructor // ============================================================================ -StepToTopoDS_NMTool::StepToTopoDS_NMTool() { - myIDEASCase = Standard_False; - myActiveFlag = Standard_False; +StepToTopoDS_NMTool::StepToTopoDS_NMTool() : myIDEASCase(Standard_False), myActiveFlag(Standard_False) { + + } // ============================================================================ @@ -34,9 +34,9 @@ StepToTopoDS_NMTool::StepToTopoDS_NMTool() { // ============================================================================ StepToTopoDS_NMTool::StepToTopoDS_NMTool(const StepToTopoDS_DataMapOfRI& MapOfRI, - const StepToTopoDS_DataMapOfRINames& MapOfRINames) { - myIDEASCase = Standard_False; - myActiveFlag = Standard_False; + const StepToTopoDS_DataMapOfRINames& MapOfRINames) : myIDEASCase(Standard_False), myActiveFlag(Standard_False) { + + Init(MapOfRI, MapOfRINames); } @@ -184,7 +184,7 @@ Standard_Boolean StepToTopoDS_NMTool::IsPureNMShell(const TopoDS_Shape& Shell) { Standard_Boolean result = Standard_True; TopExp_Explorer edgeExp(Shell, TopAbs_EDGE); for ( ; edgeExp.More(); edgeExp.Next() ) { - TopoDS_Shape currentEdge = edgeExp.Current(); + const TopoDS_Shape& currentEdge = edgeExp.Current(); if ( !this->isEdgeRegisteredAsNM(currentEdge) ) { result = Standard_False; break; @@ -223,10 +223,10 @@ Standard_Boolean StepToTopoDS_NMTool::isAdjacentShell(const TopoDS_Shape& ShellA TopExp_Explorer edgeExpA(ShellA, TopAbs_EDGE); for ( ; edgeExpA.More(); edgeExpA.Next() ) { - TopoDS_Shape currentEdgeA = edgeExpA.Current(); + const TopoDS_Shape& currentEdgeA = edgeExpA.Current(); TopExp_Explorer edgeExpB(ShellB, TopAbs_EDGE); for ( ; edgeExpB.More(); edgeExpB.Next() ) { - TopoDS_Shape currentEdgeB = edgeExpB.Current(); + const TopoDS_Shape& currentEdgeB = edgeExpB.Current(); if ( currentEdgeA.IsSame(currentEdgeB) ) return Standard_True; } diff --git a/src/StepToTopoDS/StepToTopoDS_Tool.hxx b/src/StepToTopoDS/StepToTopoDS_Tool.hxx index 57f45ab26c..b51dc7f46a 100644 --- a/src/StepToTopoDS/StepToTopoDS_Tool.hxx +++ b/src/StepToTopoDS/StepToTopoDS_Tool.hxx @@ -120,17 +120,17 @@ private: StepToTopoDS_DataMapOfTRI myDataMap; StepToTopoDS_PointVertexMap myVertexMap; StepToTopoDS_PointEdgeMap myEdgeMap; - Standard_Boolean myComputePC; + Standard_Boolean myComputePC{}; Handle(Transfer_TransientProcess) myTransProc; - Standard_Integer myNbC0Surf; - Standard_Integer myNbC1Surf; - Standard_Integer myNbC2Surf; - Standard_Integer myNbC0Cur2; - Standard_Integer myNbC1Cur2; - Standard_Integer myNbC2Cur2; - Standard_Integer myNbC0Cur3; - Standard_Integer myNbC1Cur3; - Standard_Integer myNbC2Cur3; + Standard_Integer myNbC0Surf{}; + Standard_Integer myNbC1Surf{}; + Standard_Integer myNbC2Surf{}; + Standard_Integer myNbC0Cur2{}; + Standard_Integer myNbC1Cur2{}; + Standard_Integer myNbC2Cur2{}; + Standard_Integer myNbC0Cur3{}; + Standard_Integer myNbC1Cur3{}; + Standard_Integer myNbC2Cur3{}; }; diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx index 74f25802f9..a88655ae81 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx @@ -78,7 +78,7 @@ private: TopoDS_Wire myWire; - Standard_Boolean myInfiniteSegment; + Standard_Boolean myInfiniteSegment{}; }; diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx index 3b0e2fca74..6f9f654d64 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx @@ -17,6 +17,8 @@ //:o0 abv 16.02.99: POLYLINE allowed as 3d curve of edge //gka,abv 05.04.99: S4136: improving tolerance management, eliminate BRepAPI::Precision() +#include + #include #include #include @@ -136,7 +138,7 @@ static void DecodeMakeEdgeError(const BRepLib_MakeEdge& ME, // ============================================================================ static Handle(Geom_Curve) MakeCurve - (const Handle(StepGeom_Curve)& C1, const Handle(Transfer_TransientProcess) TP) + (const Handle(StepGeom_Curve)& C1, const Handle(Transfer_TransientProcess)& TP) { Handle(Geom_Curve) C2 = Handle(Geom_Curve)::DownCast (TP->FindTransient(C1)); if (!C2.IsNull()) return C2; @@ -383,7 +385,7 @@ void StepToTopoDS_TranslateEdge::MakeFromCurve3D // -- Statistics -- -> No Warning message aTool.AddContinuity (C1); BRep_Builder B; - Standard_Real temp1,temp2, U1,U2; + Standard_Real temp1 = NAN,temp2 = NAN, U1 = NAN,U2 = NAN; gp_Pnt pproj; gp_Pnt pv1 = BRep_Tool::Pnt(V1); gp_Pnt pv2 = BRep_Tool::Pnt(V2); diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx index 156197a605..15efa9ce4e 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx @@ -22,6 +22,8 @@ // rln 02.06.99 removing #include // smh 31.01.01 BUC60810 : IsNull protection +#include + #include #include #include @@ -109,7 +111,7 @@ static void CheckPCurves (TopoDS_Wire& aWire, const TopoDS_Face& aFace, { if (isPlane) { RemovePCurves (aWire, aFace);return; } BRep_Builder B; - Standard_Real w1, w2, cf, cl; + Standard_Real w1 = NAN, w2 = NAN, cf = NAN, cl = NAN; Handle(Geom_Surface) mySurf = BRep_Tool::Surface(aFace); Handle(ShapeExtend_WireData) sbwd = new ShapeExtend_WireData (aWire); @@ -152,7 +154,7 @@ static void CheckPCurves (TopoDS_Wire& aWire, const TopoDS_Face& aFace, if (w1 > w2 && mySurf->IsUPeriodic()) { - Standard_Real u1, u2, v1, v2; + Standard_Real u1 = NAN, u2 = NAN, v1 = NAN, v2 = NAN; mySurf->Bounds(u1, u2, v1, v2); ElCLib::AdjustPeriodic(u1, u2, Min(Abs(w2-w1)/2, Precision::PConfusion()), @@ -225,7 +227,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac TopoDS_Edge E; TopoDS_Vertex V; - Standard_Boolean isSeam, isLikeSeam; + Standard_Boolean isSeam = 0, isLikeSeam = 0; Handle(StepShape_OrientedEdge) OrEdge1, OrEdge2; Handle(StepGeom_Curve) StepCurve, StepCurve1, StepCurve2; @@ -234,7 +236,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac Handle(Geom2d_Curve) C2d, C2d1, C2d2, WhichC2d1, WhichC2d2; TopoDS_Edge suspectE; //:f1, degEdge; - Standard_Integer j, NbEdge = EL->NbEdgeList(); + Standard_Integer j = 0, NbEdge = EL->NbEdgeList(); if (NbEdge == 0) { TP->AddWarning(EL, "Wire not done. EdgeLoop does not contain edges."); done = Standard_False; diff --git a/src/StepToTopoDS/StepToTopoDS_TranslatePolyLoop.cxx b/src/StepToTopoDS/StepToTopoDS_TranslatePolyLoop.cxx index 2db5e71008..684544c2cd 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslatePolyLoop.cxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslatePolyLoop.cxx @@ -16,6 +16,8 @@ //gka,abv 14.09.99: S4136: eliminate BRepAPI::Precision() +#include + #include #include #include @@ -72,7 +74,7 @@ void StepToTopoDS_TranslatePolyLoop::Init(const Handle(StepShape_PolyLoop)& PL, Handle(Transfer_TransientProcess) TP = aTool.TransientProcess(); //:S4136 Standard_Real preci = BRepAPI::Precision(); - Standard_Integer i; + Standard_Integer i = 0; Handle(StepGeom_CartesianPoint) P1,P2; Handle(Geom_CartesianPoint) GP1, GP2; TopoDS_Vertex V1, V2; @@ -82,7 +84,7 @@ void StepToTopoDS_TranslatePolyLoop::Init(const Handle(StepShape_PolyLoop)& PL, Handle(Geom2d_Line) L2d; gp_Vec V; gp_Vec2d V2d; - Standard_Real Magn; + Standard_Real Magn = NAN; Handle(Geom_Plane) SP = Handle(Geom_Plane)::DownCast(GeomSurf); if (SP.IsNull()) TP->AddFail(PL,"Surface not planar in a FacetedBRep !"); Handle(ShapeAnalysis_Surface) STSU = new ShapeAnalysis_Surface ( GeomSurf ); diff --git a/src/StepVisual/StepVisual_BoxCharacteristicSelect.hxx b/src/StepVisual/StepVisual_BoxCharacteristicSelect.hxx index 2a5e5910de..032d8cba0b 100644 --- a/src/StepVisual/StepVisual_BoxCharacteristicSelect.hxx +++ b/src/StepVisual/StepVisual_BoxCharacteristicSelect.hxx @@ -54,8 +54,8 @@ private: - Standard_Real theRealValue; - Standard_Integer theTypeOfContent; + Standard_Real theRealValue{}; + Standard_Integer theTypeOfContent{}; }; diff --git a/src/StepVisual/StepVisual_CameraModelD2.hxx b/src/StepVisual/StepVisual_CameraModelD2.hxx index 6d22dc02bc..396c56cc52 100644 --- a/src/StepVisual/StepVisual_CameraModelD2.hxx +++ b/src/StepVisual/StepVisual_CameraModelD2.hxx @@ -63,7 +63,7 @@ private: Handle(StepVisual_PlanarBox) viewWindow; - Standard_Boolean viewWindowClipping; + Standard_Boolean viewWindowClipping{}; }; diff --git a/src/StepVisual/StepVisual_ColourRgb.hxx b/src/StepVisual/StepVisual_ColourRgb.hxx index bdaea0c35a..c72d669e12 100644 --- a/src/StepVisual/StepVisual_ColourRgb.hxx +++ b/src/StepVisual/StepVisual_ColourRgb.hxx @@ -65,9 +65,9 @@ protected: private: - Standard_Real red; - Standard_Real green; - Standard_Real blue; + Standard_Real red{}; + Standard_Real green{}; + Standard_Real blue{}; }; diff --git a/src/StepVisual/StepVisual_CurveStyleFontPattern.hxx b/src/StepVisual/StepVisual_CurveStyleFontPattern.hxx index eeca58dc00..c435e65ec0 100644 --- a/src/StepVisual/StepVisual_CurveStyleFontPattern.hxx +++ b/src/StepVisual/StepVisual_CurveStyleFontPattern.hxx @@ -59,8 +59,8 @@ protected: private: - Standard_Real visibleSegmentLength; - Standard_Real invisibleSegmentLength; + Standard_Real visibleSegmentLength{}; + Standard_Real invisibleSegmentLength{}; }; diff --git a/src/StepVisual/StepVisual_PlanarExtent.hxx b/src/StepVisual/StepVisual_PlanarExtent.hxx index 62c7625e51..3d462905cf 100644 --- a/src/StepVisual/StepVisual_PlanarExtent.hxx +++ b/src/StepVisual/StepVisual_PlanarExtent.hxx @@ -61,8 +61,8 @@ protected: private: - Standard_Real sizeInX; - Standard_Real sizeInY; + Standard_Real sizeInX{}; + Standard_Real sizeInY{}; }; diff --git a/src/StepVisual/StepVisual_PreDefinedColour.cxx b/src/StepVisual/StepVisual_PreDefinedColour.cxx index 26577ec0b9..da0c1c75f6 100644 --- a/src/StepVisual/StepVisual_PreDefinedColour.cxx +++ b/src/StepVisual/StepVisual_PreDefinedColour.cxx @@ -18,9 +18,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_PreDefinedColour,StepVisual_Colour) -StepVisual_PreDefinedColour::StepVisual_PreDefinedColour () +StepVisual_PreDefinedColour::StepVisual_PreDefinedColour () : myItem(new StepVisual_PreDefinedItem) { - myItem = new StepVisual_PreDefinedItem; + } void StepVisual_PreDefinedColour::SetPreDefinedItem (const Handle(StepVisual_PreDefinedItem) &item) diff --git a/src/StepVisual/StepVisual_SurfaceStyleReflectanceAmbient.hxx b/src/StepVisual/StepVisual_SurfaceStyleReflectanceAmbient.hxx index baf55343c7..2c57e3776c 100644 --- a/src/StepVisual/StepVisual_SurfaceStyleReflectanceAmbient.hxx +++ b/src/StepVisual/StepVisual_SurfaceStyleReflectanceAmbient.hxx @@ -43,7 +43,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepVisual_SurfaceStyleReflectanceAmbient, Standard_Transient) private: - Standard_Real myAmbientReflectance; + Standard_Real myAmbientReflectance{}; }; #endif // _StepVisual_SurfaceStyleReflectanceAmbient_HeaderFile_ diff --git a/src/StepVisual/StepVisual_SurfaceStyleTransparent.hxx b/src/StepVisual/StepVisual_SurfaceStyleTransparent.hxx index 28b293a606..158e4caa63 100644 --- a/src/StepVisual/StepVisual_SurfaceStyleTransparent.hxx +++ b/src/StepVisual/StepVisual_SurfaceStyleTransparent.hxx @@ -43,7 +43,7 @@ public : DEFINE_STANDARD_RTTIEXT(StepVisual_SurfaceStyleTransparent, Standard_Transient) private: - Standard_Real myTransparency; + Standard_Real myTransparency{}; }; #endif // _StepVisual_SurfaceStyleTransparent_HeaderFile_ diff --git a/src/StepVisual/StepVisual_TessellatedEdge.cxx b/src/StepVisual/StepVisual_TessellatedEdge.cxx index 7096b10ba0..886edb4cc0 100644 --- a/src/StepVisual/StepVisual_TessellatedEdge.cxx +++ b/src/StepVisual/StepVisual_TessellatedEdge.cxx @@ -23,9 +23,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedEdge, StepVisual_TessellatedStr //purpose : //======================================================================= -StepVisual_TessellatedEdge::StepVisual_TessellatedEdge () +StepVisual_TessellatedEdge::StepVisual_TessellatedEdge () : myHasGeometricLink(Standard_False) { - myHasGeometricLink = Standard_False; + } //======================================================================= diff --git a/src/StepVisual/StepVisual_TessellatedFace.cxx b/src/StepVisual/StepVisual_TessellatedFace.cxx index 1432d69d95..83b5a23074 100644 --- a/src/StepVisual/StepVisual_TessellatedFace.cxx +++ b/src/StepVisual/StepVisual_TessellatedFace.cxx @@ -23,9 +23,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedFace, StepVisual_TessellatedStr //purpose : //======================================================================= -StepVisual_TessellatedFace::StepVisual_TessellatedFace () +StepVisual_TessellatedFace::StepVisual_TessellatedFace () : myHasGeometricLink(Standard_False) { - myHasGeometricLink = Standard_False; + } //======================================================================= diff --git a/src/StepVisual/StepVisual_TessellatedFace.hxx b/src/StepVisual/StepVisual_TessellatedFace.hxx index 9386ed3822..1ef3923e83 100644 --- a/src/StepVisual/StepVisual_TessellatedFace.hxx +++ b/src/StepVisual/StepVisual_TessellatedFace.hxx @@ -79,7 +79,7 @@ public : private: Handle(StepVisual_CoordinatesList) myCoordinates; - Standard_Integer myPnmax; + Standard_Integer myPnmax{}; Handle(TColStd_HArray2OfReal) myNormals; StepVisual_FaceOrSurface myGeometricLink; //!< optional Standard_Boolean myHasGeometricLink; //!< flag "is GeometricLink defined" diff --git a/src/StepVisual/StepVisual_TessellatedShell.cxx b/src/StepVisual/StepVisual_TessellatedShell.cxx index 879282aba4..4262a90de1 100644 --- a/src/StepVisual/StepVisual_TessellatedShell.cxx +++ b/src/StepVisual/StepVisual_TessellatedShell.cxx @@ -23,9 +23,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedShell, StepVisual_TessellatedIt //purpose : //======================================================================= -StepVisual_TessellatedShell::StepVisual_TessellatedShell () +StepVisual_TessellatedShell::StepVisual_TessellatedShell () : myHasTopologicalLink(Standard_False) { - myHasTopologicalLink = Standard_False; + } //======================================================================= diff --git a/src/StepVisual/StepVisual_TessellatedSolid.cxx b/src/StepVisual/StepVisual_TessellatedSolid.cxx index 169ecd240d..117ed89977 100644 --- a/src/StepVisual/StepVisual_TessellatedSolid.cxx +++ b/src/StepVisual/StepVisual_TessellatedSolid.cxx @@ -23,9 +23,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedSolid, StepVisual_TessellatedIt //purpose : //======================================================================= -StepVisual_TessellatedSolid::StepVisual_TessellatedSolid () +StepVisual_TessellatedSolid::StepVisual_TessellatedSolid () : myHasGeometricLink(Standard_False) { - myHasGeometricLink = Standard_False; + } //======================================================================= diff --git a/src/StepVisual/StepVisual_TessellatedSurfaceSet.hxx b/src/StepVisual/StepVisual_TessellatedSurfaceSet.hxx index 436aa4645b..5c77f7410b 100644 --- a/src/StepVisual/StepVisual_TessellatedSurfaceSet.hxx +++ b/src/StepVisual/StepVisual_TessellatedSurfaceSet.hxx @@ -67,7 +67,7 @@ public : private: Handle(StepVisual_CoordinatesList) myCoordinates; - Standard_Integer myPnmax; + Standard_Integer myPnmax{}; Handle(TColStd_HArray2OfReal) myNormals; }; diff --git a/src/StepVisual/StepVisual_TessellatedVertex.cxx b/src/StepVisual/StepVisual_TessellatedVertex.cxx index 59527941c3..3a8f4d897a 100644 --- a/src/StepVisual/StepVisual_TessellatedVertex.cxx +++ b/src/StepVisual/StepVisual_TessellatedVertex.cxx @@ -23,10 +23,10 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedVertex, StepVisual_TessellatedS //purpose : //======================================================================= -StepVisual_TessellatedVertex::StepVisual_TessellatedVertex () +StepVisual_TessellatedVertex::StepVisual_TessellatedVertex () : myPointIndex(0), myHasTopologicalLink(Standard_False) { - myPointIndex = 0; - myHasTopologicalLink = Standard_False; + + } //======================================================================= diff --git a/src/StepVisual/StepVisual_TessellatedWire.cxx b/src/StepVisual/StepVisual_TessellatedWire.cxx index bfb34eed41..4e568f8d6f 100644 --- a/src/StepVisual/StepVisual_TessellatedWire.cxx +++ b/src/StepVisual/StepVisual_TessellatedWire.cxx @@ -23,9 +23,9 @@ IMPLEMENT_STANDARD_RTTIEXT(StepVisual_TessellatedWire, StepVisual_TessellatedIte //purpose : //======================================================================= -StepVisual_TessellatedWire::StepVisual_TessellatedWire () +StepVisual_TessellatedWire::StepVisual_TessellatedWire () : myHasGeometricModelLink(Standard_False) { - myHasGeometricModelLink = Standard_False; + } //======================================================================= diff --git a/src/StepVisual/StepVisual_ViewVolume.hxx b/src/StepVisual/StepVisual_ViewVolume.hxx index 56d8de03d6..5f441a7315 100644 --- a/src/StepVisual/StepVisual_ViewVolume.hxx +++ b/src/StepVisual/StepVisual_ViewVolume.hxx @@ -92,12 +92,12 @@ private: StepVisual_CentralOrParallel projectionType; Handle(StepGeom_CartesianPoint) projectionPoint; - Standard_Real viewPlaneDistance; - Standard_Real frontPlaneDistance; - Standard_Boolean frontPlaneClipping; - Standard_Real backPlaneDistance; - Standard_Boolean backPlaneClipping; - Standard_Boolean viewVolumeSidesClipping; + Standard_Real viewPlaneDistance{}; + Standard_Real frontPlaneDistance{}; + Standard_Boolean frontPlaneClipping{}; + Standard_Real backPlaneDistance{}; + Standard_Boolean backPlaneClipping{}; + Standard_Boolean viewVolumeSidesClipping{}; Handle(StepVisual_PlanarBox) viewWindow; diff --git a/src/Storage/Storage_BaseDriver.cxx b/src/Storage/Storage_BaseDriver.cxx index 6e7edaaa6c..26a3b98f68 100644 --- a/src/Storage/Storage_BaseDriver.cxx +++ b/src/Storage/Storage_BaseDriver.cxx @@ -34,7 +34,7 @@ TCollection_AsciiString Storage_BaseDriver::ReadMagicNumber (Standard_IStream& t TCollection_AsciiString aReadMagicNumber; - char aChar; + char aChar = 0; Standard_Size aReadCharNb = 0; while (theIStream.good() && (aReadCharNb < aMagicNumberLen)) diff --git a/src/Storage/Storage_Data.cxx b/src/Storage/Storage_Data.cxx index 4ff095359e..6ffb320a99 100644 --- a/src/Storage/Storage_Data.cxx +++ b/src/Storage/Storage_Data.cxx @@ -26,12 +26,12 @@ IMPLEMENT_STANDARD_RTTIEXT(Storage_Data,Standard_Transient) -Storage_Data::Storage_Data() +Storage_Data::Storage_Data() : myRootData(new Storage_RootData), myTypeData(new Storage_TypeData), myInternal(new Storage_InternalData), myHeaderData(new Storage_HeaderData) { - myRootData = new Storage_RootData; - myTypeData = new Storage_TypeData; - myInternal = new Storage_InternalData; - myHeaderData = new Storage_HeaderData; + + + + } void Storage_Data::AddRoot(const Handle(Standard_Persistent)& anObject) const diff --git a/src/Storage/Storage_RootData.cxx b/src/Storage/Storage_RootData.cxx index b5093120a9..b563bade1b 100644 --- a/src/Storage/Storage_RootData.cxx +++ b/src/Storage/Storage_RootData.cxx @@ -48,7 +48,7 @@ Standard_Boolean Storage_RootData::Read (const Handle(Storage_BaseDriver)& theDr } TCollection_AsciiString aRootName, aTypeName; - Standard_Integer aRef; + Standard_Integer aRef = 0; Standard_Integer len = theDriver->RootSectionSize(); for (Standard_Integer i = 1; i <= len; i++) diff --git a/src/Storage/Storage_Schema.cxx b/src/Storage/Storage_Schema.cxx index bb617809b0..bc6809b0a4 100644 --- a/src/Storage/Storage_Schema.cxx +++ b/src/Storage/Storage_Schema.cxx @@ -97,15 +97,15 @@ Standard_Persistent* Storage_Bucket::Value Storage_BucketOfPersistent::Storage_BucketOfPersistent (const Standard_Integer theBucketSize, const Standard_Integer theBucketNumber) -: myNumberOfBucket(1),myNumberOfBucketAllocated(theBucketNumber),myBucketSize +: myBuckets((Storage_Bucket**)Standard::Allocate + (sizeof(Storage_Bucket*) * theBucketNumber)), myNumberOfBucket(1),myNumberOfBucketAllocated(theBucketNumber),myCurrentBucket(myBuckets[0]), myLength(0), myCurrentBucketNumber(0), myBucketSize (theBucketSize) { - myBuckets = (Storage_Bucket**)Standard::Allocate - (sizeof(Storage_Bucket*) * theBucketNumber); + myBuckets[0] = new Storage_Bucket(myBucketSize); - myCurrentBucket = myBuckets[0]; - myLength = 0; - myCurrentBucketNumber = 0; + + + } //======================================================================= @@ -116,7 +116,7 @@ Storage_BucketOfPersistent::Storage_BucketOfPersistent void Storage_BucketOfPersistent::Clear() { if (myBuckets) { - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i < myNumberOfBucket; i++) delete myBuckets[i]; myNumberOfBucket = 1; @@ -143,7 +143,7 @@ Storage_BucketOfPersistent::~Storage_BucketOfPersistent() Standard_Persistent* Storage_BucketOfPersistent::Value (const Standard_Integer theIndex) { - Standard_Integer theInd,theCurrentBucketNumber,tecurrentind = theIndex - 1; + Standard_Integer theInd = 0,theCurrentBucketNumber = 0,tecurrentind = theIndex - 1; theCurrentBucketNumber = tecurrentind / myBucketSize; theInd = tecurrentind - (myBucketSize * theCurrentBucketNumber); @@ -269,11 +269,11 @@ void Storage_BucketIterator::Next() // IMPLEMENTATION BucketOfPersistent //======================================================================= -Storage_Schema::Storage_Schema() +Storage_Schema::Storage_Schema() : myCallBackState(Standard_False) { Clear(); ResetDefaultCallBack(); - myCallBackState = Standard_False; + } //======================================================================= @@ -332,7 +332,7 @@ void Storage_Schema::Write (const Handle(Storage_BaseDriver)& theDriver, // add all the persistent to write... // - Standard_Integer posfrom,posto; + Standard_Integer posfrom = 0,posto = 0; Handle(Standard_Persistent) p; Handle(Storage_HSeqOfRoot) plist; TCollection_AsciiString errorContext("AddPersistent"); @@ -359,8 +359,8 @@ void Storage_Schema::Write (const Handle(Storage_BaseDriver)& theDriver, // ...and now we write // - Standard_Integer i, - len; + Standard_Integer i = 0, + len = 0; aData->HeaderData()->SetCreationDate(ICreationDate()); aData->HeaderData()->SetStorageVersion(Storage::Version()); @@ -662,7 +662,7 @@ Standard_Boolean Storage_Schema::AddPersistent Handle(Storage_InternalData) iData = Storage_Schema::ICurrentData()->InternalData(); if (sp->_typenum == 0) { - Standard_Integer aTypenum; + Standard_Integer aTypenum = 0; static TCollection_AsciiString aTypeName; aTypeName = tName; Handle(Storage_TypeData) tData = Storage_Schema::ICurrentData()->TypeData(); @@ -830,8 +830,8 @@ Handle(Storage_Data)& Storage_Schema::ICurrentData() TCollection_AsciiString Storage_Schema::ICreationDate() { char nowstr[SLENGTH]; - time_t nowbin; - struct tm *nowstruct; + time_t nowbin = 0; + struct tm *nowstruct = nullptr; if (time(&nowbin) == (time_t)-1) { #ifdef OCCT_DEBUG diff --git a/src/Storage/Storage_TypeData.cxx b/src/Storage/Storage_TypeData.cxx index ee0cb721b6..a6ad934d5f 100644 --- a/src/Storage/Storage_TypeData.cxx +++ b/src/Storage/Storage_TypeData.cxx @@ -44,7 +44,7 @@ Standard_Boolean Storage_TypeData::Read (const Handle(Storage_BaseDriver)& theDr return Standard_False; } - Standard_Integer aTypeNum; + Standard_Integer aTypeNum = 0; TCollection_AsciiString aTypeName; Standard_Integer len = theDriver->TypeSectionSize(); @@ -88,7 +88,7 @@ Standard_Boolean Storage_TypeData::IsType(const TCollection_AsciiString& aName) Handle(TColStd_HSequenceOfAsciiString) Storage_TypeData::Types() const { Handle(TColStd_HSequenceOfAsciiString) r = new TColStd_HSequenceOfAsciiString; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= myPt.Extent(); i++) { r->Append(myPt.FindKey(i)); diff --git a/src/Storage/Storage_TypedCallBack.cxx b/src/Storage/Storage_TypedCallBack.cxx index c3c0d9e198..d39e6d0b4b 100644 --- a/src/Storage/Storage_TypedCallBack.cxx +++ b/src/Storage/Storage_TypedCallBack.cxx @@ -23,10 +23,10 @@ Storage_TypedCallBack::Storage_TypedCallBack() : myIndex(0) { } -Storage_TypedCallBack::Storage_TypedCallBack(const TCollection_AsciiString& aTypeName,const Handle(Storage_CallBack)& aCallBack) : myIndex(0) +Storage_TypedCallBack::Storage_TypedCallBack(const TCollection_AsciiString& aTypeName,const Handle(Storage_CallBack)& aCallBack) : myType(aTypeName), myCallBack(aCallBack), myIndex(0) { - myType = aTypeName; - myCallBack = aCallBack; + + } void Storage_TypedCallBack::SetType(const TCollection_AsciiString& aType) diff --git a/src/TColStd/TColStd_PackedMapOfInteger.cxx b/src/TColStd/TColStd_PackedMapOfInteger.cxx index 07650da631..19d1efbe3d 100644 --- a/src/TColStd/TColStd_PackedMapOfInteger.cxx +++ b/src/TColStd/TColStd_PackedMapOfInteger.cxx @@ -552,9 +552,9 @@ void TColStd_PackedMapOfInteger::Intersection else if (myData1 == theMap2.myData1) Intersect (theMap1); else { - const TColStd_intMapNode* const* aData1; - const TColStd_intMapNode* const* aData2; - Standard_Integer nBuckets1, nBuckets2; + const TColStd_intMapNode* const* aData1 = nullptr; + const TColStd_intMapNode* const* aData2 = nullptr; + Standard_Integer nBuckets1 = 0, nBuckets2 = 0; if (theMap1.Extent() < theMap2.Extent()) { aData1 = theMap1.myData1; @@ -841,7 +841,7 @@ void TColStd_PackedMapOfInteger::Difference (const TColStd_PackedMapOfInteger& else if (myData1 == theMap2.myData1) Differ(theMap1); else { - Standard_Integer i; + Standard_Integer i = 0; const Standard_Integer nBuckets1 = theMap1.myNbBuckets; const Standard_Integer nBuckets2 = theMap2.myNbBuckets; Clear(); diff --git a/src/TCollection/TCollection_AsciiString.cxx b/src/TCollection/TCollection_AsciiString.cxx index 3234a888bd..6d8511e357 100644 --- a/src/TCollection/TCollection_AsciiString.cxx +++ b/src/TCollection/TCollection_AsciiString.cxx @@ -46,9 +46,9 @@ static inline void Free (Standard_PCharacter aAddr) // ---------------------------------------------------------------------------- // Create an empty AsciiString // ---------------------------------------------------------------------------- -TCollection_AsciiString::TCollection_AsciiString() +TCollection_AsciiString::TCollection_AsciiString() : mylength(0) { - mylength = 0; + mystring = Allocate(mylength+1); mystring[mylength] = '\0'; @@ -116,10 +116,10 @@ TCollection_AsciiString::TCollection_AsciiString(const Standard_Character aChar) // Create an AsciiString from a filler // ---------------------------------------------------------------------------- TCollection_AsciiString::TCollection_AsciiString(const Standard_Integer length, - const Standard_Character filler ) + const Standard_Character filler ) : mystring(Allocate(length+1)), mylength(length) { - mystring = Allocate(length+1); - mylength = length; + + for (int i = 0 ; i < length ; i++) mystring[i] = filler; mystring[length] = '\0'; } @@ -472,7 +472,7 @@ Standard_Integer TCollection_AsciiString::FirstLocationNotInSet { if (mylength == 0 || Set.mylength == 0) return 0; if (FromIndex > 0 && ToIndex <= mylength && FromIndex <= ToIndex ) { - Standard_Boolean find; + Standard_Boolean find = 0; for (int i = FromIndex-1 ; i < ToIndex; i++) { find = Standard_False; for(int j = 0; j < Set.mylength; j++) @@ -735,7 +735,7 @@ Standard_Boolean TCollection_AsciiString::EndsWith (const TCollection_AsciiStrin // ---------------------------------------------------------------------------- Standard_Integer TCollection_AsciiString::IntegerValue()const { - char *ptr; + char *ptr = nullptr; Standard_Integer value = (Standard_Integer)strtol(mystring,&ptr,10); if (ptr != mystring) return value; @@ -747,7 +747,7 @@ Standard_Integer TCollection_AsciiString::IntegerValue()const // ---------------------------------------------------------------------------- Standard_Boolean TCollection_AsciiString::IsIntegerValue()const { - char *ptr; + char *ptr = nullptr; strtol(mystring,&ptr,10); if (ptr != mystring) { @@ -764,7 +764,7 @@ Standard_Boolean TCollection_AsciiString::IsIntegerValue()const // ---------------------------------------------------------------------------- Standard_Boolean TCollection_AsciiString::IsRealValue (Standard_Boolean theToCheckFull)const { - char *ptr; + char *ptr = nullptr; Strtod(mystring,&ptr); if (theToCheckFull) { @@ -793,7 +793,7 @@ Standard_Boolean TCollection_AsciiString::IsAscii()const //------------------------------------------------------------------------ void TCollection_AsciiString::LeftAdjust () { - Standard_Integer i ; + Standard_Integer i = 0 ; for( i = 0 ; i < mylength ; i ++) if(!IsSpace(mystring[i])) break; if( i > 0 ) Remove(1,i); } @@ -890,7 +890,7 @@ void TCollection_AsciiString::Prepend(const TCollection_AsciiString& what) // ---------------------------------------------------------------------------- Standard_Real TCollection_AsciiString::RealValue()const { - char *ptr; + char *ptr = nullptr; Standard_Real value = Strtod(mystring,&ptr); if (ptr != mystring) return value; @@ -985,7 +985,7 @@ void TCollection_AsciiString::Remove (const Standard_Integer where, const Standard_Integer ahowmany) { if (where+ahowmany <= mylength+1) { - int i,j; + int i = 0,j = 0; for(i = where+ahowmany-1, j = where-1; i < mylength; i++, j++) mystring[j] = mystring[i]; mylength -= ahowmany; @@ -1003,7 +1003,7 @@ void TCollection_AsciiString::Remove (const Standard_Integer where, //------------------------------------------------------------------------ void TCollection_AsciiString::RightAdjust () { - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = mylength-1 ; i >= 0 ; i--) if(!IsSpace(mystring[i])) break; @@ -1017,8 +1017,8 @@ void TCollection_AsciiString::RightAdjust () void TCollection_AsciiString::RightJustify(const Standard_Integer Width, const Standard_Character Filler) { - Standard_Integer i ; - Standard_Integer k ; + Standard_Integer i = 0 ; + Standard_Integer k = 0 ; if (Width > mylength) { mystring = Reallocate (mystring, Width + 1); @@ -1041,7 +1041,7 @@ Standard_Integer TCollection_AsciiString::Search { Standard_Integer size = Standard_Integer( what ? strlen( what ) : 0 ); if (size) { - int k,j; + int k = 0,j = 0; int i = 0; while ( i < mylength-size+1 ) { k = i++; @@ -1063,7 +1063,7 @@ Standard_Integer TCollection_AsciiString::Search Standard_Integer size = what.mylength; Standard_CString swhat = what.mystring; if (size) { - int k,j; + int k = 0,j = 0; int i = 0; while ( i < mylength-size+1 ) { k = i++; @@ -1084,7 +1084,7 @@ Standard_Integer TCollection_AsciiString::SearchFromEnd { Standard_Integer size = Standard_Integer( what ? strlen( what ) : 0 ); if (size) { - int k,j; + int k = 0,j = 0; int i = mylength-1; while ( i >= size-1 ) { k = i--; @@ -1106,7 +1106,7 @@ Standard_Integer TCollection_AsciiString::SearchFromEnd int size = what.mylength; if (size) { Standard_CString swhat = what.mystring; - int k,j; + int k = 0,j = 0; int i = mylength-1; while ( i >= size-1 ) { k = i--; @@ -1256,9 +1256,9 @@ TCollection_AsciiString TCollection_AsciiString::Token throw Standard_NullObject("TCollection_AsciiString::Token : " "parameter 'separators'"); - Standard_Integer theOne ; + Standard_Integer theOne = 0 ; Standard_Integer StringIndex = 0 ; - Standard_Integer SeparatorIndex ; + Standard_Integer SeparatorIndex = 0 ; Standard_Integer BeginIndex=0 ; Standard_Integer EndIndex=0 ; @@ -1327,7 +1327,7 @@ void TCollection_AsciiString::UpperCase() //------------------------------------------------------------------------ Standard_Integer TCollection_AsciiString::UsefullLength () const { - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = mylength -1 ; i >= 0 ; i--) if (IsGraphic(mystring[i])) break; return i+1; diff --git a/src/TCollection/TCollection_ExtendedString.cxx b/src/TCollection/TCollection_ExtendedString.cxx index 2a83bab603..294bfd5b9d 100644 --- a/src/TCollection/TCollection_ExtendedString.cxx +++ b/src/TCollection/TCollection_ExtendedString.cxx @@ -184,10 +184,10 @@ TCollection_ExtendedString::TCollection_ExtendedString // Create a string from a ExtCharacter // ---------------------------------------------------------------------------- TCollection_ExtendedString::TCollection_ExtendedString - (const Standard_ExtCharacter aChar) + (const Standard_ExtCharacter aChar) : mylength(1), mystring(allocateExtChars (1)) { - mylength = 1; - mystring = allocateExtChars (1); + + mystring[0] = aChar; mystring[1] = 0; } @@ -197,10 +197,10 @@ TCollection_ExtendedString::TCollection_ExtendedString // ---------------------------------------------------------------------------- TCollection_ExtendedString::TCollection_ExtendedString (const Standard_Integer length, - const Standard_ExtCharacter filler ) + const Standard_ExtCharacter filler ) : mystring(allocateExtChars (length)), mylength(length) { - mystring = allocateExtChars (length); - mylength = length; + + for (int i = 0 ; i < length ; i++) mystring[i] = filler; mystring[mylength] = 0; } @@ -212,7 +212,7 @@ TCollection_ExtendedString::TCollection_ExtendedString (const Standard_Integer aValue) { union {int bid ; - char t [13];} CHN ; + char t [13];} CHN{} ; Sprintf(&CHN.t[0],"%d",aValue); mylength = (int)strlen(CHN.t); mystring = allocateExtChars (mylength); @@ -227,7 +227,7 @@ TCollection_ExtendedString::TCollection_ExtendedString (const Standard_Real aValue) { union {int bid ; - char t [50];} CHN ; + char t [50];} CHN{} ; Sprintf(&CHN.t[0],"%g",aValue); mylength = (int)strlen( CHN.t ); mystring = allocateExtChars (mylength); @@ -239,11 +239,11 @@ TCollection_ExtendedString::TCollection_ExtendedString // create an extendedstring from an extendedstring // ---------------------------------------------------------------------------- TCollection_ExtendedString::TCollection_ExtendedString - (const TCollection_ExtendedString& astring) + (const TCollection_ExtendedString& astring) : mylength(astring.mylength), mystring(allocateExtChars (astring.mylength)) { const Standard_Integer aSizeBytes = astring.mylength * sizeof(Standard_ExtCharacter); - mylength = astring.mylength; - mystring = allocateExtChars (astring.mylength); + + memcpy (mystring, astring.mystring, aSizeBytes); mystring[mylength] = 0; } @@ -253,9 +253,9 @@ TCollection_ExtendedString::TCollection_ExtendedString //--------------------------------------------------------------------------- TCollection_ExtendedString::TCollection_ExtendedString (const TCollection_AsciiString& theString, - const Standard_Boolean isMultiByte) + const Standard_Boolean isMultiByte) : mylength(nbSymbols (theString.ToCString())) { - mylength = nbSymbols (theString.ToCString()); + mystring = allocateExtChars (mylength); mystring[mylength] = 0; if (isMultiByte && ConvertToUnicode (theString.ToCString())) @@ -644,7 +644,7 @@ void TCollection_ExtendedString::Remove (const Standard_Integer where, const Standard_Integer ahowmany) { if (where+ahowmany <= mylength+1) { - int i,j; + int i = 0,j = 0; for (i = where+ahowmany-1, j = where-1; i < mylength; i++, j++) mystring[j] = mystring[i]; mylength -= ahowmany; @@ -665,7 +665,7 @@ Standard_Integer TCollection_ExtendedString::Search Standard_Integer size = what.mylength; Standard_ExtString swhat = what.mystring; if (size) { - int k,j; + int k = 0,j = 0; int i = 0; Standard_Boolean find = Standard_False; while ( i < mylength-size+1 && !find) { @@ -688,7 +688,7 @@ Standard_Integer TCollection_ExtendedString::SearchFromEnd Standard_Integer size = what.mylength; if (size) { Standard_ExtString swhat = what.mystring; - int k,j; + int k = 0,j = 0; int i = mylength-1; Standard_Boolean find = Standard_False; while ( i >= size-1 && !find) { @@ -771,11 +771,11 @@ TCollection_ExtendedString TCollection_ExtendedString::Token throw Standard_NullObject("TCollection_ExtendedString::Token : " "parameter 'separators'"); - int i,j,k,l; + int i = 0,j = 0,k = 0,l = 0; Standard_PExtCharacter buftmp = allocateExtChars (mylength); - Standard_ExtCharacter aSep; + Standard_ExtCharacter aSep = 0; - Standard_Boolean isSepFound = Standard_False, otherSepFound; + Standard_Boolean isSepFound = Standard_False, otherSepFound = 0; j = 0; diff --git a/src/TDF/TDF_Attribute.cxx b/src/TDF/TDF_Attribute.cxx index 201a44ee13..b7ae1727fe 100644 --- a/src/TDF/TDF_Attribute.cxx +++ b/src/TDF/TDF_Attribute.cxx @@ -388,7 +388,7 @@ Standard_OStream& TDF_Attribute::Dump(Standard_OStream& anOS) const if (IsBackuped()) anOS<<" Backuped"; if (IsForgotten()) anOS<<" Forgotten"; char toto[45]; - Standard_PCharacter pStr; + Standard_PCharacter pStr = nullptr; // pStr=toto; ID().ToCString(pStr); diff --git a/src/TDF/TDF_ClosureTool.cxx b/src/TDF/TDF_ClosureTool.cxx index f7aad675b3..005a802a44 100644 --- a/src/TDF/TDF_ClosureTool.cxx +++ b/src/TDF/TDF_ClosureTool.cxx @@ -117,7 +117,7 @@ void TDF_ClosureTool::LabelAttributes const TDF_ClosureMode& aMode) { Handle(TDF_DataSet) tmpDataSet; - Standard_Boolean BindLabel; + Standard_Boolean BindLabel = 0; TDF_MapIteratorOfAttributeMap attMItr; TDF_MapIteratorOfLabelMap labMItr; diff --git a/src/TDF/TDF_CopyLabel.cxx b/src/TDF/TDF_CopyLabel.cxx index e2c701774c..8846fe6b87 100644 --- a/src/TDF/TDF_CopyLabel.cxx +++ b/src/TDF/TDF_CopyLabel.cxx @@ -50,9 +50,9 @@ TDF_CopyLabel::TDF_CopyLabel() //======================================================================= TDF_CopyLabel::TDF_CopyLabel(const TDF_Label& aSource,const TDF_Label& aTarget ) - :myFilter(Standard_False), myIsDone(Standard_False) + :mySL(aSource), myTL(aTarget), myFilter(Standard_False), myIsDone(Standard_False) { - mySL = aSource; myTL = aTarget; + } //======================================================================= @@ -80,7 +80,7 @@ void TDF_CopyLabel::ExternalReferences(const TDF_Label& aRefLabel, const TDF_Lab // TDF_Tool::Entry(itr.Value()->Label(), entr1); //d // std::cout<<"\tSource Attribute dynamic type = "<DynamicType()<<" Label = "<Label(), entr1); // std::cout<<"\t\tReferences attribute dynamic type = "<DynamicType()<<" Label = "<SetRelocation(att, att); #ifdef OCCT_DEBUG PrintEntry(att->Label(), Standard_True); diff --git a/src/TDF/TDF_Data.cxx b/src/TDF/TDF_Data.cxx index 50e85d0fc2..afbd2dae75 100644 --- a/src/TDF/TDF_Data.cxx +++ b/src/TDF/TDF_Data.cxx @@ -243,7 +243,7 @@ Standard_Integer TDF_Data::CommitTransaction if (aPtrCurrentAtt->mySavedTransaction >= aPtrCurrentAtt->myTransaction) { - const Handle(TDF_Attribute) currentAtt = aPtrCurrentAtt; + const Handle(TDF_Attribute)& currentAtt = aPtrCurrentAtt; // Collision with a not forgotten version. if (backupAtt.IsNull()) { TDF_Data_DeltaCreation diff --git a/src/TDF/TDF_Delta.cxx b/src/TDF/TDF_Delta.cxx index 60d5b7c79b..711416eaa7 100644 --- a/src/TDF/TDF_Delta.cxx +++ b/src/TDF/TDF_Delta.cxx @@ -87,7 +87,7 @@ void TDF_Delta::BeforeOrAfterApply(const Standard_Boolean before) const Standard_Boolean noDeadLock = Standard_True; Standard_Integer nbAD = ADlist.Extent(); - Standard_Boolean next; + Standard_Boolean next = 0; while (noDeadLock && (nbAD != 0)) { itr.Initialize(ADlist); while (itr.More()) { diff --git a/src/TDF/TDF_Tool.cxx b/src/TDF/TDF_Tool.cxx index ca2228f9be..c617a3f763 100644 --- a/src/TDF/TDF_Tool.cxx +++ b/src/TDF/TDF_Tool.cxx @@ -172,7 +172,7 @@ static Standard_Boolean TDF_Tool_DescendantRef attMItr.More(); attMItr.Next()) { // CLE // const Handle(TDF_Attribute)& att = attMItr.Key(); - Handle(TDF_Attribute) att = attMItr.Key(); + const Handle(TDF_Attribute)& att = attMItr.Key(); if (!att.IsNull() && !att->Label().IsNull()) { // ENDCLE @@ -242,7 +242,7 @@ static void TDF_Tool_OutReferers(const TDF_Label& aRefLabel, attMItr.More(); attMItr.Next()) { // CLE // const Handle(TDF_Attribute)& att = attMItr.Key(); - Handle(TDF_Attribute) att = attMItr.Key(); + const Handle(TDF_Attribute)& att = attMItr.Key(); // ENDCLE if (aFilterForReferences.IsKept(att) && !att->Label().IsNull() && @@ -316,7 +316,7 @@ static void TDF_Tool_OutReferences(const TDF_Label& aRefLabel, itr.Value()->References(ds); const TDF_AttributeMap& attMap = ds->Attributes(); for (TDF_MapIteratorOfAttributeMap attMItr(attMap);attMItr.More();attMItr.Next()) { - Handle(TDF_Attribute) att = attMItr.Key(); + const Handle(TDF_Attribute)& att = attMItr.Key(); if (aFilterForReferences.IsKept(att) && !att->Label().IsNull() && !att->Label().IsDescendant(aRefLabel)) @@ -650,7 +650,7 @@ void TDF_Tool::ExtendedDeepDump anOS<Lower(); Standard_Integer anUpper = newArray->Upper(); Standard_Boolean aDimEqual = Standard_False; - Standard_Integer i; + Standard_Integer i = 0; if ( Lower() == aLower && Upper() == anUpper ) { aDimEqual = Standard_True; diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx index 54c623167b..6a89a9a61e 100644 --- a/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx +++ b/src/TDataStd/TDataStd_DeltaOnModificationOfByteArray.cxx @@ -55,7 +55,7 @@ TDataStd_DeltaOnModificationOfByteArray::TDataStd_DeltaOnModificationOfByteArray if(Arr1 != Arr2) { myUp1 = Arr1->Upper(); myUp2 = Arr2->Upper(); - Standard_Integer i, N=0, aCase=0; + Standard_Integer i = 0, N=0, aCase=0; if(myUp1 == myUp2) {aCase = 1; N = myUp1;} else if(myUp1 < myUp2) @@ -124,7 +124,7 @@ void TDataStd_DeltaOnModificationOfByteArray::Apply() else aCurAtt->Backup(); - Standard_Integer aCase; + Standard_Integer aCase = 0; if(myUp1 == myUp2) aCase = 1; else if(myUp1 < myUp2) @@ -135,7 +135,7 @@ void TDataStd_DeltaOnModificationOfByteArray::Apply() if (aCase == 1 && (myIndxes.IsNull() || myValues.IsNull())) return; - Standard_Integer i; + Standard_Integer i = 0; Handle(TColStd_HArray1OfByte) BArr = aCurAtt->InternalArray(); if(BArr.IsNull()) return; if(aCase == 1) diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx index 2d55759218..849440dd91 100644 --- a/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx +++ b/src/TDataStd/TDataStd_DeltaOnModificationOfExtStringArray.cxx @@ -54,7 +54,7 @@ TDataStd_DeltaOnModificationOfExtStringArray::TDataStd_DeltaOnModificationOfExtS if(Arr1 != Arr2) { myUp1 = Arr1->Upper(); myUp2 = Arr2->Upper(); - Standard_Integer i, N =0, aCase=0; + Standard_Integer i = 0, N =0, aCase=0; if(myUp1 == myUp2) {aCase = 1; N = myUp1;} else if(myUp1 < myUp2) @@ -123,7 +123,7 @@ void TDataStd_DeltaOnModificationOfExtStringArray::Apply() else aCurAtt->Backup(); - Standard_Integer aCase; + Standard_Integer aCase = 0; if(myUp1 == myUp2) aCase = 1; else if(myUp1 < myUp2) @@ -134,7 +134,7 @@ void TDataStd_DeltaOnModificationOfExtStringArray::Apply() if (aCase == 1 && (myIndxes.IsNull() || myValues.IsNull())) return; - Standard_Integer i; + Standard_Integer i = 0; Handle(TColStd_HArray1OfExtendedString) aStrArr = aCurAtt->Array(); if(aStrArr.IsNull()) return; diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx index 89f197109e..a9eeb30b12 100644 --- a/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx +++ b/src/TDataStd/TDataStd_DeltaOnModificationOfIntArray.cxx @@ -54,7 +54,7 @@ TDataStd_DeltaOnModificationOfIntArray::TDataStd_DeltaOnModificationOfIntArray(c if(Arr1 != Arr2) { myUp1 = Arr1->Upper(); myUp2 = Arr2->Upper(); - Standard_Integer i, N=0, aCase=0; + Standard_Integer i = 0, N=0, aCase=0; if(myUp1 == myUp2) {aCase = 1; N = myUp1;} else if(myUp1 < myUp2) @@ -122,7 +122,7 @@ void TDataStd_DeltaOnModificationOfIntArray::Apply() else aCurAtt->Backup(); - Standard_Integer aCase; + Standard_Integer aCase = 0; if(myUp1 == myUp2) aCase = 1; else if(myUp1 < myUp2) @@ -133,7 +133,7 @@ void TDataStd_DeltaOnModificationOfIntArray::Apply() if (aCase == 1 && (myIndxes.IsNull() || myValues.IsNull())) return; - Standard_Integer i; + Standard_Integer i = 0; Handle(TColStd_HArray1OfInteger) IntArr = aCurAtt->Array(); if(IntArr.IsNull()) return; if(aCase == 1) diff --git a/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx b/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx index d0b4b70f59..3805497ebb 100644 --- a/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx +++ b/src/TDataStd/TDataStd_DeltaOnModificationOfRealArray.cxx @@ -54,7 +54,7 @@ TDataStd_DeltaOnModificationOfRealArray:: if(Arr1 != Arr2) { myUp1 = Arr1->Upper(); myUp2 = Arr2->Upper(); - Standard_Integer i, N =0, aCase=0; + Standard_Integer i = 0, N =0, aCase=0; if(myUp1 == myUp2) {aCase = 1; N = myUp1;} else if(myUp1 < myUp2) @@ -121,7 +121,7 @@ void TDataStd_DeltaOnModificationOfRealArray::Apply() else aCurAtt->Backup(); - Standard_Integer aCase; + Standard_Integer aCase = 0; if(myUp1 == myUp2) aCase = 1; else if(myUp1 < myUp2) @@ -132,7 +132,7 @@ void TDataStd_DeltaOnModificationOfRealArray::Apply() if (aCase == 1 && (myIndxes.IsNull() || myValues.IsNull())) return; - Standard_Integer i; + Standard_Integer i = 0; Handle(TColStd_HArray1OfReal) aRealArr = aCurAtt->Array(); if(aRealArr.IsNull()) return; if(aCase == 1) diff --git a/src/TDataStd/TDataStd_ExtStringArray.cxx b/src/TDataStd/TDataStd_ExtStringArray.cxx index a9e565723f..2bcd6fba12 100644 --- a/src/TDataStd/TDataStd_ExtStringArray.cxx +++ b/src/TDataStd/TDataStd_ExtStringArray.cxx @@ -193,7 +193,7 @@ void TDataStd_ExtStringArray::ChangeArray(const Handle(TColStd_HArray1OfExtended Standard_Integer aLower = newArray->Lower(); Standard_Integer anUpper = newArray->Upper(); Standard_Boolean aDimEqual = Standard_False; - Standard_Integer i; + Standard_Integer i = 0; if (Lower() == aLower && Upper() == anUpper ) { aDimEqual = Standard_True; @@ -267,7 +267,7 @@ Handle(TDF_Attribute) TDataStd_ExtStringArray::NewEmpty () const void TDataStd_ExtStringArray::Restore(const Handle(TDF_Attribute)& With) { - Standard_Integer i, lower, upper; + Standard_Integer i = 0, lower = 0, upper = 0; Handle(TDataStd_ExtStringArray) anArray = Handle(TDataStd_ExtStringArray)::DownCast(With); if(!anArray->myValue.IsNull()) { lower = anArray->Lower(); @@ -309,7 +309,7 @@ Standard_OStream& TDataStd_ExtStringArray::Dump (Standard_OStream& anOS) const { anOS << "\nExtStringArray :"; if(!myValue.IsNull()) { - Standard_Integer i, lower, upper; + Standard_Integer i = 0, lower = 0, upper = 0; lower = myValue->Lower(); upper = myValue->Upper(); for(i = lower; i<=upper; i++) diff --git a/src/TDataStd/TDataStd_IntPackedMap.cxx b/src/TDataStd/TDataStd_IntPackedMap.cxx index ef1f71bd50..527cfa49da 100644 --- a/src/TDataStd/TDataStd_IntPackedMap.cxx +++ b/src/TDataStd/TDataStd_IntPackedMap.cxx @@ -62,9 +62,9 @@ Handle(TDataStd_IntPackedMap) TDataStd_IntPackedMap::Set (const TDF_Label& theLa //purpose : //======================================================================= TDataStd_IntPackedMap::TDataStd_IntPackedMap () - :myIsDelta(Standard_False) + :myMap(new TColStd_HPackedMapOfInteger ()), myIsDelta(Standard_False) { - myMap = new TColStd_HPackedMapOfInteger (); + } //======================================================================= //function : ChangeMap diff --git a/src/TDataStd/TDataStd_IntegerArray.cxx b/src/TDataStd/TDataStd_IntegerArray.cxx index d827b1e604..8cf68ab52a 100644 --- a/src/TDataStd/TDataStd_IntegerArray.cxx +++ b/src/TDataStd/TDataStd_IntegerArray.cxx @@ -190,7 +190,7 @@ void TDataStd_IntegerArray::ChangeArray(const Handle(TColStd_HArray1OfInteger)& Standard_Integer aLower = newArray->Lower(); Standard_Integer anUpper = newArray->Upper(); Standard_Boolean aDimEqual = Standard_False; - Standard_Integer i; + Standard_Integer i = 0; if(Lower() == aLower && Upper() == anUpper ) { aDimEqual = Standard_True; @@ -264,7 +264,7 @@ Handle(TDF_Attribute) TDataStd_IntegerArray::NewEmpty () const void TDataStd_IntegerArray::Restore(const Handle(TDF_Attribute)& With) { - Standard_Integer i, lower, upper; + Standard_Integer i = 0, lower = 0, upper = 0; Handle(TDataStd_IntegerArray) anArray = Handle(TDataStd_IntegerArray)::DownCast(With); if(!anArray->myValue.IsNull()) { lower = anArray->Lower(); @@ -307,7 +307,7 @@ Standard_OStream& TDataStd_IntegerArray::Dump (Standard_OStream& anOS) const { anOS << "\nIntegerArray:: " << this <<" :"; if(!myValue.IsNull()) { - Standard_Integer i, lower, upper; + Standard_Integer i = 0, lower = 0, upper = 0; lower = myValue->Lower(); upper = myValue->Upper(); for(i = lower; i<=upper; i++) diff --git a/src/TDataStd/TDataStd_RealArray.cxx b/src/TDataStd/TDataStd_RealArray.cxx index 90bf7b32f9..828ac44e3d 100644 --- a/src/TDataStd/TDataStd_RealArray.cxx +++ b/src/TDataStd/TDataStd_RealArray.cxx @@ -190,7 +190,7 @@ void TDataStd_RealArray::ChangeArray(const Handle(TColStd_HArray1OfReal)& newArr Standard_Integer aLower = newArray->Lower(); Standard_Integer anUpper = newArray->Upper(); Standard_Boolean aDimEqual = Standard_False; - Standard_Integer i; + Standard_Integer i = 0; if (!myValue.IsNull()) { if (Lower() == aLower && Upper() == anUpper ) { @@ -265,7 +265,7 @@ Handle(TDF_Attribute) TDataStd_RealArray::NewEmpty () const void TDataStd_RealArray::Restore(const Handle(TDF_Attribute)& With) { - Standard_Integer i, lower, upper; + Standard_Integer i = 0, lower = 0, upper = 0; Handle(TDataStd_RealArray) anArray = Handle(TDataStd_RealArray)::DownCast(With); if(!anArray->myValue.IsNull()) { lower = anArray->Lower(); @@ -307,7 +307,7 @@ Standard_OStream& TDataStd_RealArray::Dump (Standard_OStream& anOS) const { anOS << "\nRealArray::" << this <<" :"; if(!myValue.IsNull()) { - Standard_Integer i, lower, upper; + Standard_Integer i = 0, lower = 0, upper = 0; lower = myValue->Lower(); upper = myValue->Upper(); for(i = lower; i<=upper; i++) diff --git a/src/TDataStd/TDataStd_ReferenceArray.cxx b/src/TDataStd/TDataStd_ReferenceArray.cxx index 2d94dd66c7..138a20bda2 100644 --- a/src/TDataStd/TDataStd_ReferenceArray.cxx +++ b/src/TDataStd/TDataStd_ReferenceArray.cxx @@ -179,7 +179,7 @@ void TDataStd_ReferenceArray::SetInternalArray (const Handle(TDataStd_HLabelArra Standard_Integer aLower = values->Lower(); Standard_Integer anUpper = values->Upper(); Standard_Boolean aDimEqual = Standard_False; - Standard_Integer i; + Standard_Integer i = 0; #ifdef OCC2932 if (Lower() == aLower && Upper() == anUpper ) { diff --git a/src/TDataXtd/TDataXtd_Constraint.cxx b/src/TDataXtd/TDataXtd_Constraint.cxx index 9c066f792b..b1120d3cca 100644 --- a/src/TDataXtd/TDataXtd_Constraint.cxx +++ b/src/TDataXtd/TDataXtd_Constraint.cxx @@ -443,7 +443,7 @@ void TDataXtd_Constraint::References(const Handle(TDF_DataSet)& DS) const { //bidouille en attendant traitement des contraintes d assemblage en dehors de la part // l attribut placement devrait oriente vers les contraintes de placement en dehors - Standard_Integer Lim; + Standard_Integer Lim = 0; if (myType >= TDataXtd_MATE && myType<=TDataXtd_FACES_ANGLE) Lim =1; else Lim =3; diff --git a/src/TDataXtd/TDataXtd_Geometry.cxx b/src/TDataXtd/TDataXtd_Geometry.cxx index d9b258a5b0..2858e4596d 100644 --- a/src/TDataXtd/TDataXtd_Geometry.cxx +++ b/src/TDataXtd/TDataXtd_Geometry.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -157,7 +159,7 @@ Standard_Boolean TDataXtd_Geometry::Line(const Handle(TNaming_NamedShape)& NS,gp if (shape.IsNull()) return Standard_False; if (shape.ShapeType() == TopAbs_EDGE) { const TopoDS_Edge& edge = TopoDS::Edge(shape); - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; // TopLoc_Location loc; Handle(Geom_Curve) curve = BRep_Tool::Curve (edge,first,last); if (!curve.IsNull()) { @@ -198,7 +200,7 @@ Standard_Boolean TDataXtd_Geometry::Circle(const Handle(TNaming_NamedShape)& NS, if (shape.IsNull()) return Standard_False; if (shape.ShapeType() == TopAbs_EDGE) { const TopoDS_Edge& edge = TopoDS::Edge(shape); - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; // TopLoc_Location loc; Handle(Geom_Curve) curve = BRep_Tool::Curve (edge,first,last); if (!curve.IsNull()) { @@ -241,7 +243,7 @@ Standard_Boolean TDataXtd_Geometry::Ellipse(const Handle(TNaming_NamedShape)& NS if (shape.IsNull()) return Standard_False; if (shape.ShapeType() == TopAbs_EDGE) { const TopoDS_Edge& edge = TopoDS::Edge(shape); - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; Handle(Geom_Curve) curve = BRep_Tool::Curve (edge,first,last); if (!curve.IsNull()) { if (curve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve))) @@ -372,7 +374,7 @@ TDataXtd_GeometryEnum TDataXtd_Geometry::Type (const Handle(TNaming_NamedShape) case TopAbs_EDGE : { const TopoDS_Edge& edge = TopoDS::Edge(shape); - Standard_Real first,last; + Standard_Real first = NAN,last = NAN; // TopLoc_Location loc; Handle(Geom_Curve) curve = BRep_Tool::Curve (edge,first,last); if (!curve.IsNull()) { diff --git a/src/TDocStd/TDocStd_Application.cxx b/src/TDocStd/TDocStd_Application.cxx index 7157746eb8..751ea1f826 100644 --- a/src/TDocStd/TDocStd_Application.cxx +++ b/src/TDocStd/TDocStd_Application.cxx @@ -119,7 +119,7 @@ void TDocStd_Application::ReadingFormats(TColStd_SequenceOfAsciiString &theForma NCollection_IndexedDataMap::Iterator anIter(myReaders); for (; anIter.More(); anIter.Next()) { - Handle(PCDM_RetrievalDriver) aDriver = anIter.Value(); + const Handle(PCDM_RetrievalDriver)& aDriver = anIter.Value(); if (aDriver.IsNull() == Standard_False) { theFormats.Append(anIter.Key()); } @@ -138,7 +138,7 @@ void TDocStd_Application::WritingFormats(TColStd_SequenceOfAsciiString &theForma NCollection_IndexedDataMap::Iterator anIter(myWriters); for (; anIter.More(); anIter.Next()) { - Handle(PCDM_StorageDriver) aDriver = anIter.Value(); + const Handle(PCDM_StorageDriver)& aDriver = anIter.Value(); if (aDriver.IsNull() == Standard_False) { theFormats.Append(anIter.Key()); } diff --git a/src/TDocStd/TDocStd_ApplicationDelta.cxx b/src/TDocStd/TDocStd_ApplicationDelta.cxx index 96e5dbef9f..0175c717fd 100644 --- a/src/TDocStd/TDocStd_ApplicationDelta.cxx +++ b/src/TDocStd/TDocStd_ApplicationDelta.cxx @@ -37,7 +37,7 @@ void TDocStd_ApplicationDelta::Dump(Standard_OStream& anOS) const { myName.Print(anOS); anOS<<" - " << myDocuments.Length() << " documents "; anOS<<" ( "; - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= myDocuments.Length(); i++) { Handle(TDocStd_Document) aDocAddr= myDocuments.Value(i); anOS << "\"" << aDocAddr.get(); diff --git a/src/TDocStd/TDocStd_Document.cxx b/src/TDocStd/TDocStd_Document.cxx index 94c732866c..fb21fa7a8d 100644 --- a/src/TDocStd/TDocStd_Document.cxx +++ b/src/TDocStd/TDocStd_Document.cxx @@ -668,7 +668,7 @@ void TDocStd_Document::UpdateReferences(const TCollection_AsciiString& aDocEntry { TDF_AttributeList aRefList; - TDocStd_XLink* xRefPtr; + TDocStd_XLink* xRefPtr = nullptr; for (TDocStd_XLinkIterator xItr (this); xItr.More(); xItr.Next()) { xRefPtr = xItr.Value(); if (xRefPtr->DocumentEntry() == aDocEntry) { diff --git a/src/TDocStd/TDocStd_Document.hxx b/src/TDocStd/TDocStd_Document.hxx index 4e0c752b31..097161b6fc 100644 --- a/src/TDocStd/TDocStd_Document.hxx +++ b/src/TDocStd/TDocStd_Document.hxx @@ -293,7 +293,7 @@ private: Standard_Integer mySaveTime; Standard_Boolean myIsNestedTransactionMode; TDF_DeltaList myUndoFILO; - Standard_Boolean myOnlyTransactionModification; + Standard_Boolean myOnlyTransactionModification{}; Standard_Boolean mySaveEmptyLabels; TDocStd_FormatVersion myStorageFormatVersion; diff --git a/src/TDocStd/TDocStd_MultiTransactionManager.cxx b/src/TDocStd/TDocStd_MultiTransactionManager.cxx index f59f862ffd..50927784e3 100644 --- a/src/TDocStd/TDocStd_MultiTransactionManager.cxx +++ b/src/TDocStd/TDocStd_MultiTransactionManager.cxx @@ -26,12 +26,12 @@ IMPLEMENT_STANDARD_RTTIEXT(TDocStd_MultiTransactionManager,Standard_Transient) //function : TDocStd_MultiTransactionManager //purpose : Constructor //======================================================================= -TDocStd_MultiTransactionManager::TDocStd_MultiTransactionManager () +TDocStd_MultiTransactionManager::TDocStd_MultiTransactionManager () : myUndoLimit(0), myOpenTransaction(Standard_False), myIsNestedTransactionMode(Standard_False), myOnlyTransactionModification(Standard_False) { - myUndoLimit = 0; - myOpenTransaction = Standard_False; - myIsNestedTransactionMode = Standard_False; - myOnlyTransactionModification = Standard_False; + + + + } //======================================================================= @@ -51,7 +51,7 @@ void TDocStd_MultiTransactionManager::SetUndoLimit(const Standard_Integer theLim --n; } - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) myDocuments.Value(i)->SetUndoLimit(myUndoLimit); @@ -66,7 +66,7 @@ void TDocStd_MultiTransactionManager::Undo() { if (myUndos.IsEmpty()) return; const TDocStd_SequenceOfDocument& docs = myUndos.First()->GetDocuments(); - Standard_Integer i; + Standard_Integer i = 0; for (i = docs.Length(); i > 0; i--) { Handle(TDocStd_Document) doc = docs.Value(i); if (doc.IsNull() || doc->GetAvailableUndos() == 0) continue; @@ -85,7 +85,7 @@ void TDocStd_MultiTransactionManager::Undo() void TDocStd_MultiTransactionManager::Redo() { if (myRedos.IsEmpty()) return; const TDocStd_SequenceOfDocument& docs = myRedos.First()->GetDocuments(); - Standard_Integer i; + Standard_Integer i = 0; for (i = docs.Length(); i > 0; i--) { Handle(TDocStd_Document) doc = docs.Value(i); if (doc.IsNull() || doc->GetAvailableRedos() == 0) continue; @@ -112,7 +112,7 @@ void TDocStd_MultiTransactionManager::OpenCommand() { "while a previous one is not committed or aborted"); } myOpenTransaction = Standard_True; - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) { while(myDocuments.Value(i)->HasOpenCommand()) myDocuments.Value(i)->AbortCommand(); @@ -127,7 +127,7 @@ void TDocStd_MultiTransactionManager::OpenCommand() { void TDocStd_MultiTransactionManager::AbortCommand() { myOpenTransaction = Standard_False; - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) { while(myDocuments.Value(i)->HasOpenCommand()) myDocuments.Value(i)->AbortCommand(); @@ -143,7 +143,7 @@ Standard_Boolean TDocStd_MultiTransactionManager::CommitCommand() { Handle(TDocStd_ApplicationDelta) aDelta = new TDocStd_ApplicationDelta; Standard_Boolean isCommited = Standard_False; - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) { isCommited = Standard_False; while(myDocuments.Value(i)->HasOpenCommand()) @@ -187,7 +187,7 @@ Standard_Boolean TDocStd_MultiTransactionManager::CommitCommand void TDocStd_MultiTransactionManager::DumpTransaction(Standard_OStream& anOS) const { - Standard_Integer i; + Standard_Integer i = 0; if(myDocuments.Length() == 0) anOS << "Manager is empty" << std::endl; else { @@ -237,7 +237,7 @@ void TDocStd_MultiTransactionManager::RemoveLastUndo() { if(myUndos.Length() == 0) return; const TDocStd_SequenceOfDocument& docs = myUndos.Last()->GetDocuments(); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= docs.Length(); i++) { docs.Value(i)->RemoveFirstUndo(); } @@ -252,7 +252,7 @@ void TDocStd_MultiTransactionManager::RemoveLastUndo() void TDocStd_MultiTransactionManager::AddDocument (const Handle(TDocStd_Document)& theDoc) { - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) if(myDocuments.Value(i) == theDoc) return; // the document is already added to the list @@ -285,7 +285,7 @@ void TDocStd_MultiTransactionManager::AddDocument void TDocStd_MultiTransactionManager::RemoveDocument (const Handle(TDocStd_Document)& theDoc) { - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) { if(myDocuments.Value(i) == theDoc) myDocuments.Remove(i); @@ -323,7 +323,7 @@ void TDocStd_MultiTransactionManager::SetNestedTransactionMode (const Standard_Boolean isAllowed) { myIsNestedTransactionMode = isAllowed; - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) { if(myDocuments.Value(i)->IsNestedTransactionMode() != myIsNestedTransactionMode) myDocuments.Value(i)->SetNestedTransactionMode(myIsNestedTransactionMode); @@ -340,7 +340,7 @@ void TDocStd_MultiTransactionManager::SetModificationMode { myOnlyTransactionModification = theTransactionOnly; - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) { myDocuments.Value(i)->SetModificationMode(myOnlyTransactionModification); } @@ -356,7 +356,7 @@ void TDocStd_MultiTransactionManager::ClearUndos() AbortCommand(); myUndos.Clear(); - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) { myDocuments.Value(i)->ClearUndos(); } @@ -372,7 +372,7 @@ void TDocStd_MultiTransactionManager::ClearRedos() AbortCommand(); myRedos.Clear(); - Standard_Integer i; + Standard_Integer i = 0; for(i = myDocuments.Length(); i > 0; i--) { myDocuments.Value(i)->ClearRedos(); } diff --git a/src/TDocStd/TDocStd_Owner.hxx b/src/TDocStd/TDocStd_Owner.hxx index 5e3b62346e..f4c9e75bda 100644 --- a/src/TDocStd/TDocStd_Owner.hxx +++ b/src/TDocStd/TDocStd_Owner.hxx @@ -87,7 +87,7 @@ protected: private: //! It keeps pointer to the document to avoid handles cyclic dependency - TDocStd_Document* myDocument; + TDocStd_Document* myDocument{}; }; diff --git a/src/TDocStd/TDocStd_PathParser.cxx b/src/TDocStd/TDocStd_PathParser.cxx index 5f9fd775c2..adabc5862f 100644 --- a/src/TDocStd/TDocStd_PathParser.cxx +++ b/src/TDocStd/TDocStd_PathParser.cxx @@ -18,9 +18,9 @@ #include -TDocStd_PathParser::TDocStd_PathParser(const TCollection_ExtendedString& path) +TDocStd_PathParser::TDocStd_PathParser(const TCollection_ExtendedString& path) : myPath(path) { - myPath = path; + Parse(); } diff --git a/src/TDocStd/TDocStd_XLinkTool.cxx b/src/TDocStd/TDocStd_XLinkTool.cxx index cb51806e60..2c72e27b13 100644 --- a/src/TDocStd/TDocStd_XLinkTool.cxx +++ b/src/TDocStd/TDocStd_XLinkTool.cxx @@ -34,9 +34,9 @@ //function : TDocStd_XLinkTool //purpose : //======================================================================= -TDocStd_XLinkTool::TDocStd_XLinkTool () { - isDone = Standard_False; - myRT = new TDF_RelocationTable(); +TDocStd_XLinkTool::TDocStd_XLinkTool () : isDone(Standard_False), myRT(new TDF_RelocationTable()) { + + } //======================================================================= diff --git a/src/TNaming/TNaming.cxx b/src/TNaming/TNaming.cxx index 9051d0d615..4759f55da6 100644 --- a/src/TNaming/TNaming.cxx +++ b/src/TNaming/TNaming.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -108,7 +110,7 @@ static void SubstituteShape(const TopoDS_Shape& oldShape, if (!amap.IsBound(oldShape)) { return; } - TNaming_RefShape* pos; + TNaming_RefShape* pos = nullptr; pos = amap.ChangeFind(oldShape); pos->Shape(newShape); amap.UnBind(oldShape); @@ -170,7 +172,7 @@ Standard_Boolean TNaming::SubstituteSShape(const TDF_Label& Lab, const TopoDS_Sh TNaming_DataMapOfShapePtrRefShape& amap = US->Map(); if (!amap.IsBound(To)) return Standard_False; - TNaming_RefShape* pos; + TNaming_RefShape* pos = nullptr; pos = amap.ChangeFind(To); if(!amap.UnBind(To)) return Standard_False; //update shape @@ -207,7 +209,7 @@ static Standard_Boolean Rebuild (const TopoDS_Shape& S, TopoDS_Shape NewS = S.Oriented(TopAbs_FORWARD); NewS.EmptyCopy(); if (NewS.ShapeType() == TopAbs_EDGE) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; BRep_Tool::Range(TopoDS::Edge(S),f,l); B.Range(TopoDS::Edge(NewS),f,l); } @@ -547,7 +549,7 @@ static TopoDS_Shape ShapeCopy(const TopoDS_Shape& S, TopoDS_Shape NewS = S.Oriented(TopAbs_FORWARD); NewS.EmptyCopy(); if (NewS.ShapeType() == TopAbs_EDGE) { - Standard_Real f,l; + Standard_Real f = NAN,l = NAN; BRep_Tool::Range(TopoDS::Edge(S),f,l); B.Range(TopoDS::Edge(NewS),f,l); } diff --git a/src/TNaming/TNaming_DeltaOnRemoval.cxx b/src/TNaming/TNaming_DeltaOnRemoval.cxx index f5a10d9833..7451ad15f6 100644 --- a/src/TNaming/TNaming_DeltaOnRemoval.cxx +++ b/src/TNaming/TNaming_DeltaOnRemoval.cxx @@ -28,9 +28,9 @@ IMPLEMENT_STANDARD_RTTIEXT(TNaming_DeltaOnRemoval,TDF_DeltaOnRemoval) //purpose : //======================================================================= TNaming_DeltaOnRemoval::TNaming_DeltaOnRemoval(const Handle(TNaming_NamedShape)& NS) -:TDF_DeltaOnRemoval(NS) +:TDF_DeltaOnRemoval(NS), myDelta(new TNaming_DeltaOnModification(NS)) { - myDelta = new TNaming_DeltaOnModification(NS); + } //======================================================================= diff --git a/src/TNaming/TNaming_Localizer.hxx b/src/TNaming/TNaming_Localizer.hxx index e322d2fa7b..82d4a7f36e 100644 --- a/src/TNaming/TNaming_Localizer.hxx +++ b/src/TNaming/TNaming_Localizer.hxx @@ -81,7 +81,7 @@ private: - Standard_Integer myCurTrans; + Standard_Integer myCurTrans{}; Handle(TNaming_UsedShapes) myUS; TopTools_ListOfShape myShapeWithSubShapes; TNaming_ListOfMapOfShape mySubShapes; diff --git a/src/TNaming/TNaming_Name.cxx b/src/TNaming/TNaming_Name.cxx index 7238eda6a2..9a7af74726 100644 --- a/src/TNaming/TNaming_Name.cxx +++ b/src/TNaming/TNaming_Name.cxx @@ -376,7 +376,7 @@ static TopoDS_Shape MakeShape (const TopTools_IndexedMapOfShape& MS) //purpose : Tries to make shape with given type from the given shape //======================================================================= -static TopoDS_Shape ShapeWithType(const TopoDS_Shape theShape, +static TopoDS_Shape ShapeWithType(const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType ) { if (theShape.IsNull() || theType == TopAbs_SHAPE) return theShape; Standard_Integer aType = theShape.ShapeType(); @@ -397,7 +397,7 @@ static TopoDS_Shape ShapeWithType(const TopoDS_Shape theShape, TopTools_ListIteratorOfListOfShape aListIter(aShapes); if (aType < theType) { - Standard_Integer aCount; + Standard_Integer aCount = 0; for(aCount=0;aListIter.More();aListIter.Next()) { TopExp_Explorer anExp(aListIter.Value(),theType); if (anExp.More()) { @@ -1351,7 +1351,7 @@ static Standard_Boolean FilterByNeighbourgs (const TDF_Label& L, //---------------------------------------- // First argument: collection has to be filtered. //---------------------------------------- - Handle(TNaming_NamedShape) Cand = Args.First(); //collection of candidates + const Handle(TNaming_NamedShape)& Cand = Args.First(); //collection of candidates #ifdef OCCT_DEBUG_FNB Standard_Integer i = 1; diff --git a/src/TNaming/TNaming_NamedShape.cxx b/src/TNaming/TNaming_NamedShape.cxx index 5c298e5356..9352d9e2da 100644 --- a/src/TNaming/TNaming_NamedShape.cxx +++ b/src/TNaming/TNaming_NamedShape.cxx @@ -157,11 +157,11 @@ void TNaming_Node::DumpJson (Standard_OStream& theOStream, Standard_Integer theD //purpose : //======================================================================= -TNaming_NamedShape::TNaming_NamedShape() +TNaming_NamedShape::TNaming_NamedShape() : myNode(0L), myVersion(0), myEvolution(TNaming_PRIMITIVE) { - myNode = 0L; - myVersion = 0; - myEvolution = TNaming_PRIMITIVE; + + + } //======================================================================= @@ -295,7 +295,7 @@ void TNaming_NamedShape::Clear() } p = myNode; - TNaming_Node* q; + TNaming_Node* q = nullptr; while (p != 0L) { q = p; p = p->nextSameAttribute; @@ -363,7 +363,7 @@ Standard_Boolean TNaming_NamedShape::AfterUndo } p = myNode; - TNaming_Node* q; + TNaming_Node* q = nullptr; while (p != 0L) { q = p; p = p->nextSameAttribute; @@ -418,7 +418,7 @@ void TNaming_NamedShape::Restore(const Handle(TDF_Attribute)& anAttribute) { Clear(); - TNaming_NamedShape* PAtt = (TNaming_NamedShape*)anAttribute.operator->(); + TNaming_NamedShape* PAtt = dynamic_cast(anAttribute.operator->()); myNode = PAtt->myNode; myEvolution = PAtt->myEvolution; myVersion = PAtt->myVersion; @@ -678,7 +678,7 @@ void TNaming_Builder::Generated(const TopoDS_Shape& newShape) } TNaming_RefShape* pos = 0L; - TNaming_RefShape* pns; + TNaming_RefShape* pns = nullptr; if (myShapes->myMap.IsBound(newShape)) { #ifdef OCCT_DEBUG_BUILDER @@ -716,8 +716,8 @@ void TNaming_Builder::Delete(const TopoDS_Shape& oldShape) throw Standard_ConstructionError("TNaming_Builder : not same evolution"); } - TNaming_RefShape* pns; - TNaming_RefShape* pos; + TNaming_RefShape* pns = nullptr; + TNaming_RefShape* pos = nullptr; if (myShapes->myMap.IsBound(oldShape)) pos = myShapes->myMap.ChangeFind(oldShape); @@ -759,7 +759,7 @@ void TNaming_Builder::Generated(const TopoDS_Shape& oldShape, #endif return; } - TNaming_RefShape* pos; + TNaming_RefShape* pos = nullptr; if (!myShapes->myMap.IsBound(oldShape)) { pos = new TNaming_RefShape(oldShape); myShapes->myMap.Bind(oldShape,pos); @@ -767,7 +767,7 @@ void TNaming_Builder::Generated(const TopoDS_Shape& oldShape, else pos = myShapes->myMap.ChangeFind(oldShape); - TNaming_RefShape* pns; + TNaming_RefShape* pns = nullptr; if (!myShapes->myMap.IsBound(newShape)) { pns = new TNaming_RefShape(newShape); myShapes->myMap.Bind(newShape,pns); @@ -802,7 +802,7 @@ void TNaming_Builder::Modify(const TopoDS_Shape& oldShape, #endif return; } - TNaming_RefShape* pos; + TNaming_RefShape* pos = nullptr; if (!myShapes->myMap.IsBound(oldShape)) { pos = new TNaming_RefShape(oldShape); myShapes->myMap.Bind(oldShape,pos); @@ -810,7 +810,7 @@ void TNaming_Builder::Modify(const TopoDS_Shape& oldShape, else pos = myShapes->myMap.ChangeFind(oldShape); - TNaming_RefShape* pns; + TNaming_RefShape* pns = nullptr; if (!myShapes->myMap.IsBound(newShape)) { pns = new TNaming_RefShape(newShape); myShapes->myMap.Bind(newShape,pns); @@ -838,7 +838,7 @@ void TNaming_Builder::Select (const TopoDS_Shape& S, throw Standard_ConstructionError("TNaming_Builder : not same evolution"); } - TNaming_RefShape* pos; + TNaming_RefShape* pos = nullptr; if (!myShapes->myMap.IsBound(InS)) { pos = new TNaming_RefShape(InS); myShapes->myMap.Bind(InS,pos); @@ -846,7 +846,7 @@ void TNaming_Builder::Select (const TopoDS_Shape& S, else pos = myShapes->myMap.ChangeFind(InS); - TNaming_RefShape* pns; + TNaming_RefShape* pns = nullptr; if (!myShapes->myMap.IsBound(S)) { pns = new TNaming_RefShape(S); myShapes->myMap.Bind(S,pns); @@ -870,9 +870,9 @@ void TNaming_Builder::Select (const TopoDS_Shape& S, //======================================================================= TNaming_Iterator::TNaming_Iterator(const Handle(TNaming_NamedShape)& Att) -:myTrans(-1) +:myNode(Att->myNode), myTrans(-1) { - myNode = Att->myNode; + } //======================================================================= @@ -1005,7 +1005,7 @@ static void SelectSameShape (TNaming_Node*& myNode, TNaming_Node* pdn = myNode; while (pdn != 0L) { - Standard_Boolean Valid; + Standard_Boolean Valid = 0; if (Trans < 0) Valid = pdn->myAtt->IsValid(); else Valid = pdn->IsValidInTrans(Trans); @@ -1074,11 +1074,11 @@ TNaming_NewShapeIterator::TNaming_NewShapeIterator //======================================================================= TNaming_NewShapeIterator::TNaming_NewShapeIterator (const TNaming_Iterator& anIterator) -:myTrans(anIterator.myTrans) +:myNode(anIterator.myNode), myTrans(anIterator.myTrans) { Standard_NoSuchObject_Raise_if(anIterator.myNode == 0L, "TNaming_NewShapeIterator::TNaming_NewShapeIterator"); - myNode = anIterator.myNode; + TNaming_RefShape* RS = myNode->myNew; if (RS == 0L) myNode = 0L; // No descendant @@ -1135,11 +1135,11 @@ TNaming_NewShapeIterator::TNaming_NewShapeIterator //======================================================================= TNaming_NewShapeIterator::TNaming_NewShapeIterator(const TNaming_NewShapeIterator& anIterator) -:myTrans(anIterator.myTrans) +:myNode(anIterator.myNode), myTrans(anIterator.myTrans) { Standard_NoSuchObject_Raise_if(anIterator.myNode == 0L, "TNaming_NewShapeIterator::TNaming_NewShapeIterator"); - myNode = anIterator.myNode; + TNaming_RefShape* RS = myNode->myNew; if (RS == 0L) myNode = 0L; // No descendant @@ -1302,11 +1302,11 @@ TNaming_OldShapeIterator::TNaming_OldShapeIterator //======================================================================= TNaming_OldShapeIterator::TNaming_OldShapeIterator (const TNaming_Iterator& anIterator) -:myTrans(anIterator.myTrans) +:myNode(anIterator.myNode), myTrans(anIterator.myTrans) { Standard_NoSuchObject_Raise_if(anIterator.myNode == 0L, "TNaming_OldShapeIterator::TNaming_OldShapeIterator"); - myNode = anIterator.myNode; + TNaming_RefShape* RS = myNode->myNew; if (RS == 0L) myNode = 0L; // No descendant @@ -1324,11 +1324,11 @@ TNaming_OldShapeIterator::TNaming_OldShapeIterator (const TNaming_Iterator& anIt //======================================================================= TNaming_OldShapeIterator::TNaming_OldShapeIterator(const TNaming_OldShapeIterator& anIterator) -:myTrans(anIterator.myTrans) +:myNode(anIterator.myNode), myTrans(anIterator.myTrans) { Standard_NoSuchObject_Raise_if(anIterator.myNode == 0L, "TNaming_OldShapeIterator::TNaming_OldShapeIterator"); - myNode = anIterator.myNode; + TNaming_RefShape* RS = myNode->myOld; if (RS == 0L) myNode = 0L; // No descendant @@ -1443,7 +1443,7 @@ TNaming_SameShapeIterator::TNaming_SameShapeIterator void TNaming_SameShapeIterator::Next() { - TNaming_RefShape* prs; + TNaming_RefShape* prs = nullptr; if (myIsNew) prs = myNode->myNew; else prs = myNode->myOld; myNode = myNode->NextSameShape(prs); @@ -1638,7 +1638,7 @@ Standard_Integer TNaming_Tool::ValidUntil (const TopoDS_Shape& S, Standard_NoSuchObject_Raise_if(!TNaming_Tool::HasLabel(US,S),"TNaming_Tool::ValidUntil"); TNaming_RefShape* RS = US->Map().ChangeFind(S); - Standard_Integer Cur; + Standard_Integer Cur = 0; Standard_Integer Until = 0; TNaming_Node* Node = RS->FirstUse(); diff --git a/src/TNaming/TNaming_Scope.cxx b/src/TNaming/TNaming_Scope.cxx index 95b0bd217a..c60c70b95b 100644 --- a/src/TNaming/TNaming_Scope.cxx +++ b/src/TNaming/TNaming_Scope.cxx @@ -34,10 +34,10 @@ TNaming_Scope::TNaming_Scope () : myWithValid(Standard_False) //purpose : //======================================================================= -TNaming_Scope::TNaming_Scope (TDF_LabelMap& map) +TNaming_Scope::TNaming_Scope (TDF_LabelMap& map) : myWithValid(Standard_True), myValid(map) { - myWithValid = Standard_True; - myValid = map; + + } //======================================================================= diff --git a/src/TNaming/TNaming_Selector.cxx b/src/TNaming/TNaming_Selector.cxx index bba7a914da..1f2ac26464 100644 --- a/src/TNaming/TNaming_Selector.cxx +++ b/src/TNaming/TNaming_Selector.cxx @@ -295,9 +295,9 @@ Standard_Boolean TNaming_Selector::IsIdentified (const TDF_Label& L, //purpose : //======================================================================= -TNaming_Selector::TNaming_Selector (const TDF_Label& L) +TNaming_Selector::TNaming_Selector (const TDF_Label& L) : myLabel(L) { - myLabel = L; + } //======================================================================= diff --git a/src/TNaming/TNaming_Tool.cxx b/src/TNaming/TNaming_Tool.cxx index 4763f9753e..6a52d66760 100644 --- a/src/TNaming/TNaming_Tool.cxx +++ b/src/TNaming/TNaming_Tool.cxx @@ -411,7 +411,7 @@ void TNaming_Tool::FirstOlds (const Handle(TNaming_UsedShapes)& US, TopTools_IndexedMapOfShape& MS, TDF_LabelList& Labels) { - Standard_Integer TransDef; + Standard_Integer TransDef = 0; Standard_Boolean YaModif = 0; for (; it.More(); it.Next()) { @@ -445,7 +445,7 @@ TopoDS_Shape TNaming_Tool::InitialShape(const TopoDS_Shape& S, if (!TNaming_Tool::HasLabel(US,S)) return Res; - Standard_Integer Transdef; + Standard_Integer Transdef = 0; Label(US,S,Transdef); TopTools_IndexedMapOfShape MS; TNaming_OldShapeIterator it(S,Transdef,US); diff --git a/src/TNaming/TNaming_TranslateTool.cxx b/src/TNaming/TNaming_TranslateTool.cxx index b4a2b4d96b..8d6a260ede 100644 --- a/src/TNaming/TNaming_TranslateTool.cxx +++ b/src/TNaming/TNaming_TranslateTool.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -251,7 +253,7 @@ void TNaming_TranslateTool::UpdateEdge lcr.Clear(); Handle(BRep_GCurve) GC; - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; while (itcr.More()) { const Handle(BRep_CurveRepresentation)& CR = itcr.Value(); diff --git a/src/TPrsStd/TPrsStd_ConstraintTools.cxx b/src/TPrsStd/TPrsStd_ConstraintTools.cxx index 9445d0da43..1d0a1fc363 100644 --- a/src/TPrsStd/TPrsStd_ConstraintTools.cxx +++ b/src/TPrsStd/TPrsStd_ConstraintTools.cxx @@ -82,6 +82,7 @@ #include #include +#include #include static Standard_Boolean CheckShapesPair(const TopoDS_Shape& , const TopoDS_Shape& ); //ota @@ -176,7 +177,7 @@ void TPrsStd_ConstraintTools::ComputeTextAndValue(const Handle(TDataXtd_Constrai TCollection_ExtendedString& txt, const Standard_Boolean anIsAngle ) { - Standard_Real outvalue; + Standard_Real outvalue = NAN; const Handle(TDataStd_Real)& VAL = aConst->GetValue(); val = VAL->Get(); if(anIsAngle){ @@ -217,7 +218,7 @@ void TPrsStd_ConstraintTools::UpdateOnlyValue(const Handle(TDataXtd_Constraint)& { if (anAIS.IsNull()) return; if (!aConst->IsDimension()) return; - Standard_Real val; + Standard_Real val = NAN; TCollection_ExtendedString txt; TPrsStd_ConstraintTools:: ComputeTextAndValue(aConst,val,txt,aConst->GetType() == TDataXtd_ANGLE); Handle(PrsDim_Relation) rel = Handle(PrsDim_Relation)::DownCast(anAIS); @@ -293,7 +294,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint) } // Get custom value - Standard_Real aValue; + Standard_Real aValue = NAN; TCollection_ExtendedString aText; ComputeTextAndValue (theConst, aValue, aText,Standard_False); @@ -803,7 +804,7 @@ void TPrsStd_ConstraintTools::ComputeAngleForOneFace (const Handle(TDataXtd_Cons return; } - Standard_Real val1; + Standard_Real val1 = NAN; TCollection_ExtendedString txt; TPrsStd_ConstraintTools::ComputeTextAndValue (aConst,val1,txt,Standard_True); @@ -1020,7 +1021,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a return; } } - Standard_Real val1; + Standard_Real val1 = NAN; TCollection_ExtendedString txt; ComputeTextAndValue (aConst,val1,txt,Standard_True); @@ -1190,7 +1191,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)& if (IsFace(shape1)) shape1 = GetFace(shape1); - Standard_Real val1; + Standard_Real val1 = NAN; TCollection_ExtendedString txt; ComputeTextAndValue(aConst,val1,txt,Standard_False); @@ -1267,7 +1268,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint if (IsFace(shape1)) shape1 = GetFace(shape1); - Standard_Real val1; + Standard_Real val1 = NAN; TCollection_ExtendedString txt; ComputeTextAndValue(aConst,val1,txt,Standard_False); @@ -1346,7 +1347,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint if (IsFace(shape1)) shape1 = GetFace(shape1); - Standard_Real val1; + Standard_Real val1 = NAN; TCollection_ExtendedString txt; ComputeTextAndValue(aConst,val1,txt,Standard_False); @@ -1591,7 +1592,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain // get the circle plane Handle(Geom_Plane) aPlane2 = new Geom_Plane (anAx32); - Standard_Real A, B, C ,D1, D2; + Standard_Real A = NAN, B = NAN, C = NAN ,D1 = NAN, D2 = NAN; aPlane1->Coefficients(A, B, C, D1);//Get normalized coefficients aPlane2->Coefficients(A, B, C, D2);//Get normalized coefficients const gp_Dir& aDir1 = anAx31.Direction(); @@ -1654,7 +1655,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)& NullifyAIS(anAIS); return; } - Standard_Real val1; + Standard_Real val1 = NAN; TCollection_ExtendedString txt; ComputeTextAndValue(aConst,val1,txt,Standard_False); @@ -1801,7 +1802,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)& } - Standard_Real val1; + Standard_Real val1 = NAN; TCollection_ExtendedString txt; Handle(PrsDim_LengthDimension) ais; //Handle(Prs3d_Drawer) aDrawer; @@ -2157,7 +2158,7 @@ void TPrsStd_ConstraintTools::ComputeRound(const Handle(TDataXtd_Constraint)& aC return; } - Standard_Real val1; + Standard_Real val1 = NAN; TCollection_ExtendedString txt; ComputeTextAndValue(aConst,val1,txt,Standard_False); diff --git a/src/TPrsStd/TPrsStd_NamedShapeDriver.cxx b/src/TPrsStd/TPrsStd_NamedShapeDriver.cxx index f1e5eac3bd..779cf56825 100644 --- a/src/TPrsStd/TPrsStd_NamedShapeDriver.cxx +++ b/src/TPrsStd/TPrsStd_NamedShapeDriver.cxx @@ -66,8 +66,7 @@ Standard_Boolean TPrsStd_NamedShapeDriver::Update (const TDF_Label& aLabel, if(S.IsNull()){ return Standard_False; } - TopLoc_Location L = S.Location(); - + Handle(AIS_Shape) AISShape; if (AIS.IsNull()) AISShape = new AIS_Shape(S); else { diff --git a/src/TopExp/TopExp_Explorer.cxx b/src/TopExp/TopExp_Explorer.cxx index d87dd372ed..f4bbc18b9b 100644 --- a/src/TopExp/TopExp_Explorer.cxx +++ b/src/TopExp/TopExp_Explorer.cxx @@ -36,14 +36,14 @@ static const Standard_Integer theStackSize = 20; //purpose : //======================================================================= TopExp_Explorer::TopExp_Explorer() -: myStack (0L), +: myStack((TopoDS_Iterator*)Standard::Allocate(theStackSize*sizeof(TopoDS_Iterator))), myTop (-1), mySizeOfStack (theStackSize), toFind (TopAbs_SHAPE), toAvoid (TopAbs_SHAPE), hasMore (Standard_False) { - myStack = (TopoDS_Iterator*)Standard::Allocate(theStackSize*sizeof(TopoDS_Iterator)); + } //======================================================================= @@ -53,15 +53,13 @@ TopExp_Explorer::TopExp_Explorer() TopExp_Explorer::TopExp_Explorer (const TopoDS_Shape& theS, const TopAbs_ShapeEnum theToFind, const TopAbs_ShapeEnum theToAvoid) -: myStack (0L), +: myStack((TopoDS_Iterator*)Standard::Allocate(theStackSize*sizeof(TopoDS_Iterator))), myTop (-1), mySizeOfStack (theStackSize), toFind (theToFind), toAvoid (theToAvoid), hasMore (Standard_False) { - myStack = (TopoDS_Iterator*)Standard::Allocate(theStackSize*sizeof(TopoDS_Iterator)); - Init (theS, theToFind, theToAvoid); } @@ -137,7 +135,7 @@ const TopoDS_Shape& TopExp_Explorer::Current()const //======================================================================= void TopExp_Explorer::Next() { - Standard_Integer NewSize; + Standard_Integer NewSize = 0; TopoDS_Shape ShapTop; TopAbs_ShapeEnum ty; Standard_NoMoreObject_Raise_if(!hasMore,"TopExp_Explorer::Next"); @@ -161,7 +159,7 @@ void TopExp_Explorer::Next() if(++myTop >= mySizeOfStack) { NewSize = mySizeOfStack + theStackSize; TopExp_Stack newStack = (TopoDS_Iterator*)Standard::Allocate(NewSize*sizeof(TopoDS_Iterator)); - Standard_Integer i; + Standard_Integer i = 0; for ( i =0; i < myTop; i++) { new (&newStack[i]) TopoDS_Iterator(myStack[i]); myStack[i].~TopoDS_Iterator(); @@ -187,7 +185,7 @@ void TopExp_Explorer::Next() if(++myTop >= mySizeOfStack) { NewSize = mySizeOfStack + theStackSize; TopExp_Stack newStack = (TopoDS_Iterator*)Standard::Allocate(NewSize*sizeof(TopoDS_Iterator)); - Standard_Integer i; + Standard_Integer i = 0; for (i =0; i < myTop; i++) { new (&newStack[i]) TopoDS_Iterator(myStack[i]); myStack[i].~TopoDS_Iterator(); diff --git a/src/TopLoc/TopLoc_Datum3D.cxx b/src/TopLoc/TopLoc_Datum3D.cxx index 4c1e1fc0ef..18852add0d 100644 --- a/src/TopLoc/TopLoc_Datum3D.cxx +++ b/src/TopLoc/TopLoc_Datum3D.cxx @@ -59,7 +59,7 @@ void TopLoc_Datum3D::DumpJson (Standard_OStream& theOStream, Standard_Integer th void TopLoc_Datum3D::ShallowDump(Standard_OStream& S) const { S << " TopLoc_Datum3D " << (void*)this << std::endl; - Standard_Integer i; + Standard_Integer i = 0; gp_Trsf T = myTrsf; for (i = 1; i<=3; i++) { S<<" ( "<> buffer; if (strcmp(buffer,"Locations")) { @@ -254,7 +254,7 @@ void TopTools_LocationSet::Read(Standard_IStream& IS, const Message_ProgressRan return; } - Standard_Integer i, nbLoc; + Standard_Integer i = 0, nbLoc = 0; IS >> nbLoc; TopLoc_Location L; @@ -263,7 +263,7 @@ void TopTools_LocationSet::Read(Standard_IStream& IS, const Message_ProgressRan //OCC19559 Message_ProgressScope PS(theProgress, "Locations", nbLoc); for (i = 1; i <= nbLoc&& PS.More(); i++, PS.Next()) { - Standard_Integer typLoc; + Standard_Integer typLoc = 0; IS >> typLoc; if (typLoc == 1) { diff --git a/src/TopTools/TopTools_ShapeSet.cxx b/src/TopTools/TopTools_ShapeSet.cxx index ba63755e9e..fc50d535cc 100644 --- a/src/TopTools/TopTools_ShapeSet.cxx +++ b/src/TopTools/TopTools_ShapeSet.cxx @@ -385,7 +385,7 @@ void TopTools_ShapeSet::Dump(Standard_OStream& OS)const // dump the shapes //----------------------------------------- - Standard_Integer i, nbShapes = myShapes.Extent(); + Standard_Integer i = 0, nbShapes = myShapes.Extent(); OS << "\nDump of " << nbShapes << " TShapes"; OS << "\n\n-----------------\n\n"; @@ -494,7 +494,7 @@ void TopTools_ShapeSet::Write(Standard_OStream& OS, const Message_ProgressRange // write the shapes //----------------------------------------- - Standard_Integer i, nbShapes = myShapes.Extent(); + Standard_Integer i = 0, nbShapes = myShapes.Extent(); OS << "\nTShapes " << nbShapes << "\n"; @@ -675,7 +675,7 @@ void TopTools_ShapeSet::Read(Standard_IStream& IS, const Message_ProgressRange& return; } - Standard_Integer i, nbShapes; + Standard_Integer i = 0, nbShapes = 0; IS >> nbShapes; //OCC19559 @@ -810,7 +810,7 @@ void TopTools_ShapeSet::Read(TopoDS_Shape& S, break; } - Standard_Integer l; + Standard_Integer l = 0; IS >> l; S.Location(myLocations.Location(l), Standard_False); } diff --git a/src/TopTrans/TopTrans_CurveTransition.cxx b/src/TopTrans/TopTrans_CurveTransition.cxx index 4ead87760c..924e5b5748 100644 --- a/src/TopTrans/TopTrans_CurveTransition.cxx +++ b/src/TopTrans/TopTrans_CurveTransition.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -304,7 +306,7 @@ Standard_Boolean TopTrans_CurveTransition::IsBefore // The reference is curv // The first is the interference which have the nearest curvature // in the direction - Standard_Real deltaC1, deltaC2; + Standard_Real deltaC1 = NAN, deltaC2 = NAN; if (C1==0. || myCurv==0.) { deltaC1=C1-myCurv; } diff --git a/src/TopTrans/TopTrans_SurfaceTransition.cxx b/src/TopTrans/TopTrans_SurfaceTransition.cxx index 530e6ffd5e..07d88782a6 100644 --- a/src/TopTrans/TopTrans_SurfaceTransition.cxx +++ b/src/TopTrans/TopTrans_SurfaceTransition.cxx @@ -16,6 +16,8 @@ // Modified: eap Mar 25 2002 (occ102,occ227), touch case +#include + #include #include #include @@ -303,11 +305,11 @@ void TopTrans_SurfaceTransition::Compare Standard_Real prod = (dironF^Norm).Dot(myTgt); if (prod < 0.) Curv = -Curv; - Standard_Real Ang; + Standard_Real Ang = NAN; // ----- Ang = ::FUN_Ang(myNorm,beafter,myTgt,Norm,O); - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; // ----- // i = 0,1,2 : cos = 0,>0,<0 // j = 0,1,2 : sin = 0,>0,<0 @@ -369,7 +371,7 @@ void TopTrans_SurfaceTransition::Compare // i = 0,1,2 : cos = 0,>0,<0 // j = 0,1,2 : sin = 0,>0,<0 - Standard_Integer i,j; ::FUN_getSTA(Ang,tola,i,j); + Standard_Integer i = 0,j = 0; ::FUN_getSTA(Ang,tola,i,j); Standard_Integer kmax = M_INTERNAL(O) ? 2 : 1; for (Standard_Integer k=1; k <=kmax; k++) { diff --git a/src/TopoDS/TopoDS_AlertWithShape.cxx b/src/TopoDS/TopoDS_AlertWithShape.cxx index 38a7638eb7..2c86ce973f 100644 --- a/src/TopoDS/TopoDS_AlertWithShape.cxx +++ b/src/TopoDS/TopoDS_AlertWithShape.cxx @@ -24,9 +24,9 @@ IMPLEMENT_STANDARD_RTTIEXT(TopoDS_AlertWithShape,Message_Alert) //purpose : //======================================================================= -TopoDS_AlertWithShape::TopoDS_AlertWithShape (const TopoDS_Shape& theShape) +TopoDS_AlertWithShape::TopoDS_AlertWithShape (const TopoDS_Shape& theShape) : myShape(theShape) { - myShape = theShape; + } //======================================================================= diff --git a/src/TopoDSToStep/TopoDSToStep_FacetedTool.cxx b/src/TopoDSToStep/TopoDSToStep_FacetedTool.cxx index 6500b231df..31f2db4ac8 100644 --- a/src/TopoDSToStep/TopoDSToStep_FacetedTool.cxx +++ b/src/TopoDSToStep/TopoDSToStep_FacetedTool.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -49,7 +51,7 @@ TopoDSToStep_FacetedError TopoDSToStep_FacetedTool::CheckTopoDSShape else if (Su->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) { Handle(Geom_BSplineSurface) aBsplS = Handle(Geom_BSplineSurface)::DownCast(Su); - Standard_Integer uDeg, vDeg, nUPol, nVPol; + Standard_Integer uDeg = 0, vDeg = 0, nUPol = 0, nVPol = 0; uDeg = aBsplS->UDegree(); if (uDeg == 1) { vDeg = aBsplS->VDegree(); @@ -73,7 +75,7 @@ TopoDSToStep_FacetedError TopoDSToStep_FacetedTool::CheckTopoDSShape else if (Su->IsKind(STANDARD_TYPE(Geom_BezierSurface))) { Handle(Geom_BezierSurface) aBzS = Handle(Geom_BezierSurface)::DownCast(Su); - Standard_Integer uDeg, vDeg, nUPol, nVPol; + Standard_Integer uDeg = 0, vDeg = 0, nUPol = 0, nVPol = 0; uDeg = aBzS->UDegree(); if (uDeg == 1) { vDeg = aBzS->VDegree(); @@ -106,7 +108,7 @@ TopoDSToStep_FacetedError TopoDSToStep_FacetedTool::CheckTopoDSShape const TopoDS_Edge anEdge = TopoDS::Edge(EdgeExp.Current()); EdgeExp.Next(); - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(anEdge, aFace, cf, cl); diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx index edf9f1b5f7..6e36413f32 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -109,8 +111,8 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge, } #define Nbpt 21 - Standard_Integer i; - Standard_Real U, U1, U2; + Standard_Integer i = 0; + Standard_Real U = NAN, U1 = NAN, U2 = NAN; gp_Pnt P; Standard_Boolean isSeam = BRep_Tool::IsClosed(aEdge, aTool.CurrentFace()); diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx index 00c4c5475d..dc62a38e8d 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx @@ -21,6 +21,8 @@ //szv#4 S4163 // abv 30.11.99: fix %30 pdn changed to produce SurfaceOfRevolution instead of DegenerateToroidalSurface +#include + #include #include #include @@ -141,7 +143,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace, return; } - Standard_Integer i; + Standard_Integer i = 0; //BRepAdaptor_Surface SA = BRepAdaptor_Surface(ForwardFace); @@ -237,7 +239,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace, gp_Dir dir = Ax3.Direction(); gp_Dir X = Ax3.XDirection(); // create basis curve - Standard_Real UF, VF, UL, VL; + Standard_Real UF = NAN, VF = NAN, UL = NAN, VL = NAN; ShapeAlgo::AlgoContainer()->GetFaceUVBounds(aFace, UF, UL, VF, VL); gp_Ax2 Ax2(pos.XYZ() + X.XYZ() * TS->MajorRadius(), X ^ dir, X); Handle(Geom_Curve) BasisCurve = new Geom_Circle(Ax2, TS->MinorRadius()); @@ -351,7 +353,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace, for (;Ex.More(); Ex.Next()) { TopoDS_Edge E = TopoDS::Edge(Ex.Current()); - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, ForwardFace, cf, cl); //CA = BRepAdaptor_Curve(E, ForwardFace); diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepWire.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepWire.cxx index 252fc3a0e4..b39754d5b5 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepWire.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepWire.cxx @@ -16,6 +16,8 @@ //szv#4 S4163 +#include + #include #include #include @@ -195,7 +197,7 @@ void TopoDSToStep_MakeStepWire::Init (const TopoDS_Wire& aWire, Standard_Integer nb = anExtWire2->NbEdges(); if (nb % 2 == 0) { - Standard_Integer ie; + Standard_Integer ie = 0; // check if two adjacent edges are the same for (ie = 1; ie < nb; ie++) { @@ -240,7 +242,7 @@ void TopoDSToStep_MakeStepWire::Init (const TopoDS_Wire& aWire, // --------------------------------- // --- Is the edge Degenerated ? --- // --------------------------------- - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; Handle(Geom2d_Curve) theC2d = BRep_Tool::CurveOnSurface (anEdge, aTool.CurrentFace(), cf, cl); if (BRep_Tool::Degenerated (anEdge)) { diff --git a/src/TopoDSToStep/TopoDSToStep_Root.cxx b/src/TopoDSToStep/TopoDSToStep_Root.cxx index d44213a510..d9af58cfa5 100644 --- a/src/TopoDSToStep/TopoDSToStep_Root.cxx +++ b/src/TopoDSToStep/TopoDSToStep_Root.cxx @@ -17,8 +17,8 @@ #include -TopoDSToStep_Root::TopoDSToStep_Root () -{ done = Standard_False; toler = 0.0001; } +TopoDSToStep_Root::TopoDSToStep_Root () : done(Standard_False), toler(0.0001) +{ } Standard_Real& TopoDSToStep_Root::Tolerance () { return toler; } diff --git a/src/TopoDSToStep/TopoDSToStep_Tool.cxx b/src/TopoDSToStep/TopoDSToStep_Tool.cxx index 864b6bc9bf..5e1fcd44e0 100644 --- a/src/TopoDSToStep/TopoDSToStep_Tool.cxx +++ b/src/TopoDSToStep/TopoDSToStep_Tool.cxx @@ -25,9 +25,9 @@ //purpose : //======================================================================= TopoDSToStep_Tool::TopoDSToStep_Tool() - : myFacetedContext(Standard_False), myLowestTol(0.),myReversedSurface (Standard_False) + : myFacetedContext(Standard_False), myLowestTol(0.),myReversedSurface (Standard_False), myPCurveMode(Interface_Static::IVal("write.surfacecurve.mode")) { - myPCurveMode = Interface_Static::IVal("write.surfacecurve.mode"); + } //======================================================================= diff --git a/src/TopoDSToStep/TopoDSToStep_Tool.hxx b/src/TopoDSToStep/TopoDSToStep_Tool.hxx index 11d0e85c2d..552080d728 100644 --- a/src/TopoDSToStep/TopoDSToStep_Tool.hxx +++ b/src/TopoDSToStep/TopoDSToStep_Tool.hxx @@ -101,7 +101,7 @@ private: MoniTool_DataMapOfShapeTransient myDataMap; - Standard_Boolean myFacetedContext; + Standard_Boolean myFacetedContext{}; Standard_Real myLowestTol; TopoDS_Shell myCurrentShell; TopoDS_Face myCurrentFace; @@ -109,7 +109,7 @@ private: TopoDS_Edge myCurrentEdge; TopoDS_Vertex myCurrentVertex; Standard_Boolean myReversedSurface; - Standard_Integer myPCurveMode; + Standard_Integer myPCurveMode{}; }; diff --git a/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx b/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx index 673e55459a..5f965499ee 100644 --- a/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx +++ b/src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx @@ -17,6 +17,8 @@ // - fixed trimming of circles and ellipses (radians used instead of degrees) //szv#4 S4163 +#include + #include #include #include @@ -109,8 +111,8 @@ const Handle(TColStd_HSequenceOfTransient)& TopoDSToStep_WireframeBuilder::Value #define Nbpt 23 static Handle(StepGeom_TrimmedCurve) MakeTrimmedCurve (const Handle(StepGeom_Curve) &C, - const Handle(StepGeom_CartesianPoint) P1, - const Handle(StepGeom_CartesianPoint) P2, + const Handle(StepGeom_CartesianPoint)& P1, + const Handle(StepGeom_CartesianPoint)& P2, Standard_Real trim1, Standard_Real trim2, Standard_Boolean sense) @@ -195,7 +197,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder:: } } - Standard_Real aFirst, aLast; + Standard_Real aFirst = NAN, aLast = NAN; Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aFirst, aLast); if (!aC.IsNull()) @@ -209,7 +211,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder:: { return Standard_False; } - Handle(StepGeom_Curve) aPMSC = aGTSMC.Value(); + const Handle(StepGeom_Curve)& aPMSC = aGTSMC.Value(); // trim the curve Standard_Real aTrim1 = aCA.FirstParameter(); @@ -257,7 +259,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder:: Standard_Boolean aIPlan = Standard_False; if (!theFace.IsNull()) { - Standard_Real aCF, aCL; + Standard_Real aCF = NAN, aCL = NAN; Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(anEdge, theFace, aCF, aCL); Handle(Geom_Surface) aS = BRep_Tool::Surface(theFace); if (aS->IsKind(STANDARD_TYPE(Geom_Plane)) && aC2d->IsKind(STANDARD_TYPE(Geom2d_Line))) diff --git a/src/Transfer/Transfer_ActorOfFinderProcess.cxx b/src/Transfer/Transfer_ActorOfFinderProcess.cxx index a5019409bd..f765c973f8 100644 --- a/src/Transfer/Transfer_ActorOfFinderProcess.cxx +++ b/src/Transfer/Transfer_ActorOfFinderProcess.cxx @@ -23,7 +23,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Transfer_ActorOfFinderProcess,Transfer_ActorOfProcessForFinder) -Transfer_ActorOfFinderProcess::Transfer_ActorOfFinderProcess () { themodetrans = 0; } +Transfer_ActorOfFinderProcess::Transfer_ActorOfFinderProcess () : themodetrans(0) { } Standard_Integer& Transfer_ActorOfFinderProcess::ModeTrans () { return themodetrans; } diff --git a/src/Transfer/Transfer_Binder.cxx b/src/Transfer/Transfer_Binder.cxx index 1ae815cd4a..a4ece87377 100644 --- a/src/Transfer/Transfer_Binder.cxx +++ b/src/Transfer/Transfer_Binder.cxx @@ -26,11 +26,11 @@ IMPLEMENT_STANDARD_RTTIEXT(Transfer_Binder,Standard_Transient) //function : Transfer_Binder //purpose : //======================================================================= -Transfer_Binder::Transfer_Binder () +Transfer_Binder::Transfer_Binder () : thestatus(Transfer_StatusVoid), theexecst(Transfer_StatusInitial), thecheck(new Interface_Check) { - thestatus = Transfer_StatusVoid; - theexecst = Transfer_StatusInitial; - thecheck = new Interface_Check; + + + } //======================================================================= diff --git a/src/Transfer/Transfer_DispatchControl.cxx b/src/Transfer/Transfer_DispatchControl.cxx index e0fd85ce4e..e98b4e171e 100644 --- a/src/Transfer/Transfer_DispatchControl.cxx +++ b/src/Transfer/Transfer_DispatchControl.cxx @@ -22,8 +22,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Transfer_DispatchControl,Interface_CopyControl) Transfer_DispatchControl::Transfer_DispatchControl (const Handle(Interface_InterfaceModel)& model, - const Handle(Transfer_TransientProcess)& TP) - { themodel = model; theTP = TP; } + const Handle(Transfer_TransientProcess)& TP) : themodel(model), theTP(TP) + { } const Handle(Transfer_TransientProcess)& diff --git a/src/Transfer/Transfer_Finder.cxx b/src/Transfer/Transfer_Finder.cxx index b23b49de1b..1fba56d936 100644 --- a/src/Transfer/Transfer_Finder.cxx +++ b/src/Transfer/Transfer_Finder.cxx @@ -179,9 +179,9 @@ NCollection_DataMap& Transf NCollection_DataMap::Iterator iter(list); for (; iter.More(); iter.Next()) { - TCollection_AsciiString name = iter.Key(); + const TCollection_AsciiString& name = iter.Key(); if (!name.StartsWith(fromname)) continue; - Handle(Standard_Transient) atr = iter.Value(); + const Handle(Standard_Transient)& atr = iter.Value(); Handle(Standard_Transient) newatr = atr; // Copy ? according type diff --git a/src/Transfer/Transfer_FinderProcess.cxx b/src/Transfer/Transfer_FinderProcess.cxx index f8b74f08f1..ce35471512 100644 --- a/src/Transfer/Transfer_FinderProcess.cxx +++ b/src/Transfer/Transfer_FinderProcess.cxx @@ -33,7 +33,7 @@ Transfer_FinderProcess::Transfer_FinderProcess (const Standard_Integer nb) Standard_Integer Transfer_FinderProcess::NextMappedWithAttribute (const Standard_CString name, const Standard_Integer num0) const { - Standard_Integer num, nb = NbMapped(); + Standard_Integer num = 0, nb = NbMapped(); for (num = num0+1; num <= nb; num ++) { Handle(Transfer_Finder) fnd = Mapped (num); if (fnd.IsNull()) continue; @@ -64,7 +64,7 @@ void Transfer_FinderProcess::PrintStats (const Standard_Integer mode, Standard_ S<< "******** Basic Statistics ********"< 1) { TColStd_IndexedMapOfTransient map (themodel.IsNull() ? 1000 : themodel->NbEntities()); @@ -144,7 +144,7 @@ Transfer_ResultFromModel::Transfer_ResultFromModel () Handle(TColStd_HSequenceOfTransient) Transfer_ResultFromModel::TransferredList (const Standard_Integer level) const { - Standard_Integer i,nb; + Standard_Integer i = 0,nb = 0; Handle(TColStd_HSequenceOfTransient) list = new TColStd_HSequenceOfTransient(); Handle(TColStd_HSequenceOfTransient) res = Results(level); nb = res->Length(); @@ -159,7 +159,7 @@ Transfer_ResultFromModel::Transfer_ResultFromModel () Handle(TColStd_HSequenceOfTransient) Transfer_ResultFromModel::CheckedList (const Interface_CheckStatus check, const Standard_Boolean result) const { - Standard_Integer i,nb; + Standard_Integer i = 0,nb = 0; Handle(TColStd_HSequenceOfTransient) list = new TColStd_HSequenceOfTransient(); Handle(TColStd_HSequenceOfTransient) res = Results(2); nb = res->Length(); @@ -177,7 +177,7 @@ Transfer_ResultFromModel::Transfer_ResultFromModel () (const Standard_Boolean erronly, const Standard_Integer level) const { Interface_CheckIterator chl; - Standard_Integer i,nb; + Standard_Integer i = 0,nb = 0; Handle(TColStd_HSequenceOfTransient) list = new TColStd_HSequenceOfTransient(); Handle(TColStd_HSequenceOfTransient) res = Results(level); nb = res->Length(); diff --git a/src/Transfer/Transfer_ResultFromTransient.cxx b/src/Transfer/Transfer_ResultFromTransient.cxx index 453c19471e..49924f7cd4 100644 --- a/src/Transfer/Transfer_ResultFromTransient.cxx +++ b/src/Transfer/Transfer_ResultFromTransient.cxx @@ -61,7 +61,7 @@ Handle(Transfer_ResultFromTransient) Transfer_ResultFromTransient::ResultFromKe { Handle(Transfer_ResultFromTransient) res; if (key == thestart) return this; - Standard_Integer i, nb = NbSubResults(); + Standard_Integer i = 0, nb = NbSubResults(); for (i = 1; i <= nb; i ++) { res = SubResult(i)->ResultFromKey(key); if (!res.IsNull()) return res; @@ -73,7 +73,7 @@ Handle(Transfer_ResultFromTransient) Transfer_ResultFromTransient::ResultFromKe (TColStd_IndexedMapOfTransient& map) const { if (thesubs.IsNull()) return; - Standard_Integer i, nb = thesubs->Length(); + Standard_Integer i = 0, nb = thesubs->Length(); for (i = 1; i <= nb; i ++) map.Add (thesubs->Value(i)); for (i = 1; i <= nb; i ++) SubResult(i)->FillMap(map); } diff --git a/src/Transfer/Transfer_TransferInput.cxx b/src/Transfer/Transfer_TransferInput.cxx index 05232fed00..6024faef97 100644 --- a/src/Transfer/Transfer_TransferInput.cxx +++ b/src/Transfer/Transfer_TransferInput.cxx @@ -37,7 +37,7 @@ Transfer_TransferInput::Transfer_TransferInput () { } { Interface_EntityIterator iter; for (list.Start(); list.More(); list.Next()) { - Handle(Transfer_Binder) binder = list.Value(); + const Handle(Transfer_Binder)& binder = list.Value(); if (binder.IsNull()) continue; if (binder->IsKind(STANDARD_TYPE(Transfer_VoidBinder))) continue; diff --git a/src/Transfer/Transfer_TransferIterator.cxx b/src/Transfer/Transfer_TransferIterator.cxx index 7d81b210d0..e6ef809100 100644 --- a/src/Transfer/Transfer_TransferIterator.cxx +++ b/src/Transfer/Transfer_TransferIterator.cxx @@ -21,12 +21,12 @@ static Handle(Standard_Transient) nultrans; // pour retour const&(Null) - Transfer_TransferIterator::Transfer_TransferIterator () + Transfer_TransferIterator::Transfer_TransferIterator () : theitems(new Transfer_HSequenceOfBinder()), theselect(new TColStd_HSequenceOfInteger()), themaxi(0), thecurr(1) { - theitems = new Transfer_HSequenceOfBinder(); - theselect = new TColStd_HSequenceOfInteger(); - themaxi = 0; - thecurr = 1; + + + + } void Transfer_TransferIterator::AddItem @@ -57,7 +57,7 @@ static Handle(Standard_Transient) nultrans; // pour retour const&(Null) for (Standard_Integer i = theitems->Length(); i > 0; i --) { Handle(Transfer_Binder) atr = theitems->Value(i); Handle(Standard_Type) btype = ResultType(); - Standard_Boolean matchtype; + Standard_Boolean matchtype = 0; if (!atr->HasResult()) matchtype = Standard_False; else if (atr->IsMultiple()) matchtype = Standard_False; else if (casetype == 0) matchtype = (atype == btype); // Type fixe @@ -93,7 +93,7 @@ static Handle(Standard_Transient) nultrans; // pour retour const&(Null) Standard_Integer Transfer_TransferIterator::Number () const { - Standard_Integer numb,i; numb = 0; + Standard_Integer numb = 0,i = 0; numb = 0; for (i = 1; i <= themaxi; i ++) { if (theselect->Value(i) != 0) numb ++; } diff --git a/src/Transfer/Transfer_TransferOutput.cxx b/src/Transfer/Transfer_TransferOutput.cxx index 1bd7d194c1..a1fedbe671 100644 --- a/src/Transfer/Transfer_TransferOutput.cxx +++ b/src/Transfer/Transfer_TransferOutput.cxx @@ -27,20 +27,20 @@ #include Transfer_TransferOutput::Transfer_TransferOutput (const Handle(Transfer_ActorOfTransientProcess)& actor, - const Handle(Interface_InterfaceModel)& amodel) + const Handle(Interface_InterfaceModel)& amodel) : theproc(new Transfer_TransientProcess (amodel->NbEntities())), themodel(amodel) { - theproc = new Transfer_TransientProcess (amodel->NbEntities()); + theproc->SetActor(actor); - themodel = amodel; + // thescope = Standard_False; // theundef = Transfer_UndefIgnore; } Transfer_TransferOutput::Transfer_TransferOutput (const Handle(Transfer_TransientProcess)& proc, - const Handle(Interface_InterfaceModel)& amodel) + const Handle(Interface_InterfaceModel)& amodel) : theproc(proc), themodel(amodel) { - theproc = proc; - themodel = amodel; + + // thescope = Standard_False; //szv#4:S4163:12Mar99 initialization needed // theundef = Transfer_UndefIgnore; } @@ -93,7 +93,7 @@ void Transfer_TransferOutput::TransferRoots (const Handle(Interface_Protocol)& p Interface_EntityIterator list = tool.RootEntities(); Message_ProgressScope aPS(theProgress, NULL, list.NbEntities()); for (list.Start(); list.More() && aPS.More(); list.Next()) { - Handle(Standard_Transient) ent = list.Value(); + const Handle(Standard_Transient)& ent = list.Value(); // Standard_Integer scope = 0; // if (thescope) scope = theproc->NewScope (ent); if (theproc->Transfer (ent, aPS.Next())) theproc->SetRoot(ent); @@ -110,7 +110,7 @@ void Transfer_TransferOutput::TransferRoots (const Interface_Graph& G, Interface_EntityIterator list = tool.RootEntities(); Message_ProgressScope aPS(theProgress, NULL, list.NbEntities()); for (list.Start(); list.More() && aPS.More(); list.Next()) { - Handle(Standard_Transient) ent = list.Value(); + const Handle(Standard_Transient)& ent = list.Value(); // Standard_Integer scope = 0; // if (thescope) scope = theproc->NewScope (ent); if (theproc->Transfer (ent, aPS.Next())) theproc->SetRoot(ent); diff --git a/src/Transfer/Transfer_TransientListBinder.cxx b/src/Transfer/Transfer_TransientListBinder.cxx index 4f4c8d6770..e3a794fb23 100644 --- a/src/Transfer/Transfer_TransientListBinder.cxx +++ b/src/Transfer/Transfer_TransientListBinder.cxx @@ -24,8 +24,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Transfer_TransientListBinder,Transfer_Binder) //function : Constructor //purpose : //======================================================================= -Transfer_TransientListBinder::Transfer_TransientListBinder () -{ theres = new TColStd_HSequenceOfTransient(); } +Transfer_TransientListBinder::Transfer_TransientListBinder () : theres(new TColStd_HSequenceOfTransient()) +{ } //======================================================================= //function : Constructor @@ -33,8 +33,8 @@ Transfer_TransientListBinder::Transfer_TransientListBinder () //======================================================================= Transfer_TransientListBinder::Transfer_TransientListBinder - (const Handle(TColStd_HSequenceOfTransient)& list) -{ theres = list; } + (const Handle(TColStd_HSequenceOfTransient)& list) : theres(list) +{ } //======================================================================= //function : IsMultiple diff --git a/src/Transfer/Transfer_TransientProcess.cxx b/src/Transfer/Transfer_TransientProcess.cxx index 1950dd4d74..4a0da51c92 100644 --- a/src/Transfer/Transfer_TransientProcess.cxx +++ b/src/Transfer/Transfer_TransientProcess.cxx @@ -29,9 +29,9 @@ IMPLEMENT_STANDARD_RTTIEXT(Transfer_TransientProcess,Transfer_ProcessForTransien //purpose : //======================================================================= Transfer_TransientProcess::Transfer_TransientProcess - (const Standard_Integer nb) : Transfer_ProcessForTransient (nb) + (const Standard_Integer nb) : Transfer_ProcessForTransient (nb), thetrroots(new TColStd_HSequenceOfTransient) { - thetrroots = new TColStd_HSequenceOfTransient; + } @@ -243,7 +243,7 @@ void Transfer_TransientProcess::PrintStats(const Standard_Integer /*mode*/, S<<"**** Nb Entities : "<NbEntities()<IsKind(STANDARD_TYPE(TransferBRep_ShapeListBinder))) { DeclareAndCast(TransferBRep_ShapeListBinder,slbind,binder); - Standard_Integer i,nb = slbind->NbShapes(); + Standard_Integer i = 0,nb = slbind->NbShapes(); for (i = 1; i <= nb; i ++) shapes->Append (slbind->Shape(i)); } else if (binder->IsKind(STANDARD_TYPE(Transfer_SimpleBinderOfTransient))) { @@ -109,7 +109,7 @@ static void ShapeAppend (roots ? TP->RootResult() : TP->CompleteResult()); for (list.Start(); list.More(); list.Next()) { - Handle(Transfer_Binder) binder = list.Value(); + const Handle(Transfer_Binder)& binder = list.Value(); ShapeAppend (binder,shapes); } return shapes; @@ -123,7 +123,7 @@ static void ShapeAppend if (TP.IsNull() && list.IsNull()) return shapes; shapes = new TopTools_HSequenceOfShape(); - Standard_Integer ie, ne = list->Length(); + Standard_Integer ie = 0, ne = list->Length(); for (ie = 1; ie <= ne; ie ++) { Handle(Transfer_Binder) binder = TP->Find(list->Value(ie)); ShapeAppend (binder,shapes); @@ -225,7 +225,7 @@ static void FillInfo (const Handle(Transfer_Binder)& Binder, InfoSeq = new TransferBRep_HSequenceOfTransferResultInfo; if (TP.IsNull() || EntityTypes.IsNull()) return; Standard_Integer SeqLen = EntityTypes->Length(); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <= SeqLen; i++) { InfoSeq->Append (new TransferBRep_TransferResultInfo); } @@ -263,7 +263,7 @@ static void FillInfo (const Handle(Transfer_Binder)& Binder, InfoSeq = new TransferBRep_HSequenceOfTransferResultInfo; if (FP.IsNull() || ShapeTypes.IsNull()) return; Standard_Integer SeqLen = ShapeTypes->Length(); - Standard_Integer i; // svv Jan11 2000 : porting on DEC + Standard_Integer i = 0; // svv Jan11 2000 : porting on DEC for (i = 1; i <= SeqLen; i++) { InfoSeq->Append (new TransferBRep_TransferResultInfo); } @@ -320,7 +320,7 @@ Interface_CheckIterator TransferBRep::BRepCheck nchl.SetModel(model); for (chl.Start(); chl.More(); chl.Next()) { Standard_Integer num = 0; - Handle(Interface_Check) ach = chl.Value(); + const Handle(Interface_Check)& ach = chl.Value(); if (ach->NbFails() + ach->NbWarnings() == 0) continue; DeclareAndCast(Transfer_Finder,starting,ach->Entity()); Handle(Standard_Transient) ent; @@ -339,7 +339,7 @@ Interface_CheckIterator TransferBRep::BRepCheck { Handle(TColStd_HSequenceOfTransient) ls = new TColStd_HSequenceOfTransient(); for (chl.Start(); chl.More(); chl.Next()) { - const Handle(Interface_Check) ach = chl.Value(); + const Handle(Interface_Check)& ach = chl.Value(); if (ach->NbFails() + ach->NbWarnings() == 0) continue; Handle(Standard_Transient) ent = ach->Entity(); if (ent.IsNull()) continue; @@ -358,7 +358,7 @@ Interface_CheckIterator TransferBRep::BRepCheck { Handle(TopTools_HSequenceOfShape) ls = new TopTools_HSequenceOfShape(); for (chl.Start(); chl.More(); chl.Next()) { - const Handle(Interface_Check) ach = chl.Value(); + const Handle(Interface_Check)& ach = chl.Value(); if (ach->NbFails() + ach->NbWarnings() == 0) continue; Handle(Standard_Transient) ent = ach->Entity(); if (ent.IsNull()) continue; @@ -385,13 +385,13 @@ Interface_CheckIterator TransferBRep::BRepCheck Interface_CheckIterator nchl; for (chl.Start(); chl.More(); chl.Next()) { - const Handle(Interface_Check) ach = chl.Value(); + const Handle(Interface_Check)& ach = chl.Value(); if (ach->NbFails() + ach->NbWarnings() == 0) continue; Handle(Standard_Transient) ent = ach->Entity(); if (ent.IsNull()) continue; if (S.IsNull()) { if (ent == obj) { - Handle(Interface_Check) bch(ach); bch->SetEntity(ent); + const Handle(Interface_Check)& bch(ach); bch->SetEntity(ent); nchl.Add (bch,0); } } else { @@ -403,7 +403,7 @@ Interface_CheckIterator TransferBRep::BRepCheck if (!sbs.IsNull()) sh = sbs->Result(); if (!smp.IsNull()) sh = smp->Value(); if (sh == S) { - Handle(Interface_Check) bch(ach); bch->SetEntity(ent); + const Handle(Interface_Check)& bch(ach); bch->SetEntity(ent); nchl.Add (bch,0); } } @@ -421,7 +421,7 @@ void TransferBRep::PrintResultInfo(const Handle(Message_Printer)& Printer, const Handle(TransferBRep_TransferResultInfo)& ResultInfo, const Standard_Boolean printEmpty) { - Standard_Integer R, RW, RF, RWF, NR, NRW, NRF, NRWF; + Standard_Integer R = 0, RW = 0, RF = 0, RWF = 0, NR = 0, NRW = 0, NRF = 0, NRWF = 0; R = ResultInfo->Result(); RW = ResultInfo->ResultWarning(); RF = ResultInfo->ResultFail(); diff --git a/src/TransferBRep/TransferBRep_Reader.cxx b/src/TransferBRep/TransferBRep_Reader.cxx index 81d56534a5..6f1b876896 100644 --- a/src/TransferBRep/TransferBRep_Reader.cxx +++ b/src/TransferBRep/TransferBRep_Reader.cxx @@ -29,8 +29,8 @@ #include TransferBRep_Reader::TransferBRep_Reader () - : theDone (Standard_False) , theFilest (0) , theNewpr (Standard_False) - { theShapes = new TopTools_HSequenceOfShape(); theTransi = new TColStd_HSequenceOfTransient(); } + : theDone (Standard_False) , theFilest (0) , theNewpr (Standard_False), theShapes(new TopTools_HSequenceOfShape()), theTransi(new TColStd_HSequenceOfTransient()) + { } void TransferBRep_Reader::SetProtocol (const Handle(Interface_Protocol)& protocol) @@ -119,7 +119,7 @@ TransferBRep_Reader::TransferBRep_Reader () void TransferBRep_Reader::EndTransfer () { theShapes->Append ( TransferBRep::Shapes (theProc,Standard_True) ); - Standard_Integer i,nb = theProc->NbRoots(); + Standard_Integer i = 0,nb = theProc->NbRoots(); for (i = 1; i <= nb; i ++) { Handle(Standard_Transient) ent = theProc->Root(i); Handle(Standard_Transient) res = theProc->FindTransient(ent); @@ -168,7 +168,7 @@ TransferBRep_Reader::TransferBRep_Reader () if (!BeginTransfer()) return; if (list.IsNull()) return; Transfer_TransferOutput TP (theProc,theModel); - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); Message_Messenger::StreamBuffer sout = theProc->Messenger()->SendInfo(); if (theProc->TraceLevel() > 1) diff --git a/src/TransferBRep/TransferBRep_ShapeListBinder.cxx b/src/TransferBRep/TransferBRep_ShapeListBinder.cxx index 060c1e66cd..7a98ea7c05 100644 --- a/src/TransferBRep/TransferBRep_ShapeListBinder.cxx +++ b/src/TransferBRep/TransferBRep_ShapeListBinder.cxx @@ -28,12 +28,12 @@ IMPLEMENT_STANDARD_RTTIEXT(TransferBRep_ShapeListBinder,Transfer_Binder) -TransferBRep_ShapeListBinder::TransferBRep_ShapeListBinder () - { theres = new TopTools_HSequenceOfShape(); } +TransferBRep_ShapeListBinder::TransferBRep_ShapeListBinder () : theres(new TopTools_HSequenceOfShape()) + { } TransferBRep_ShapeListBinder::TransferBRep_ShapeListBinder - (const Handle(TopTools_HSequenceOfShape)& list) - { theres = list; } + (const Handle(TopTools_HSequenceOfShape)& list) : theres(list) + { } Standard_Boolean TransferBRep_ShapeListBinder::IsMultiple () const { return (NbShapes() > 1); } diff --git a/src/TransferBRep/TransferBRep_TransferResultInfo.hxx b/src/TransferBRep/TransferBRep_TransferResultInfo.hxx index 79a58d4466..4063548fee 100644 --- a/src/TransferBRep/TransferBRep_TransferResultInfo.hxx +++ b/src/TransferBRep/TransferBRep_TransferResultInfo.hxx @@ -78,14 +78,14 @@ protected: private: - Standard_Integer myR; - Standard_Integer myRW; - Standard_Integer myRF; - Standard_Integer myRWF; - Standard_Integer myNR; - Standard_Integer myNRW; - Standard_Integer myNRF; - Standard_Integer myNRWF; + Standard_Integer myR{}; + Standard_Integer myRW{}; + Standard_Integer myRF{}; + Standard_Integer myRWF{}; + Standard_Integer myNR{}; + Standard_Integer myNRW{}; + Standard_Integer myNRF{}; + Standard_Integer myNRWF{}; }; diff --git a/src/Units/Units.cxx b/src/Units/Units.cxx index 202f63c892..594acaefb7 100644 --- a/src/Units/Units.cxx +++ b/src/Units/Units.cxx @@ -95,7 +95,7 @@ Handle(Units_UnitsDictionary) Units::DictionaryOfUnits(const Standard_Boolean am Handle(Units_Quantity) Units::Quantity(const Standard_CString aquantity) { - Standard_Integer index; + Standard_Integer index = 0; Handle(Units_Quantity) quantity; Handle(Units_Quantity) nullquantity; Handle(Units_QuantitiesSequence) quantitiessequence; @@ -122,7 +122,7 @@ Handle(Units_Quantity) Units::Quantity(const Standard_CString aquantity) static TCollection_AsciiString symbol_string,quantity_string; Standard_CString Units::FirstQuantity(const Standard_CString aunit) { - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; Handle(Units_Quantity) thequantity; Handle(Units_QuantitiesSequence) quantitiessequence; Handle(Units_UnitsSequence) unitssequence; diff --git a/src/Units/Units_Dimensions.cxx b/src/Units/Units_Dimensions.cxx index 11e9849165..c536c44576 100644 --- a/src/Units/Units_Dimensions.cxx +++ b/src/Units/Units_Dimensions.cxx @@ -35,17 +35,17 @@ Units_Dimensions::Units_Dimensions(const Standard_Real amass const Standard_Real anamountofsubstance , const Standard_Real aluminousintensity , const Standard_Real aplaneangle , - const Standard_Real asolidangle ) + const Standard_Real asolidangle ) : themass(amass), thelength(alength), thetime(atime), theelectriccurrent(anelectriccurrent), thethermodynamictemperature(athermodynamictemperature), theamountofsubstance(anamountofsubstance), theluminousintensity(aluminousintensity), theplaneangle(aplaneangle), thesolidangle(asolidangle) { - themass = amass ; - thelength = alength ; - thetime = atime ; - theelectriccurrent = anelectriccurrent ; - thethermodynamictemperature = athermodynamictemperature ; - theamountofsubstance = anamountofsubstance ; - theluminousintensity = aluminousintensity ; - theplaneangle = aplaneangle ; - thesolidangle = asolidangle ; + + + + + + + + + } //======================================================================= @@ -181,7 +181,7 @@ Standard_Boolean Units_Dimensions::IsNotEqual void Units_Dimensions::Dump(const Standard_Integer ashift) const { - int i; + int i = 0; for(i=0; iSequence(); theactiveunitssequence = new TColStd_HSequenceOfInteger(); @@ -116,7 +116,7 @@ void Units_Explorer::Init(const Handle(Units_UnitsDictionary)& aunitsdictionary) void Units_Explorer::Init(const Handle(Units_UnitsSystem)& aunitssystem, const Standard_CString aquantity) { - Standard_Integer index; + Standard_Integer index = 0; thecurrentquantity = 0; thequantitiessequence = aunitssystem->QuantitiesSequence(); theactiveunitssequence = aunitssystem->ActiveUnitsSequence(); @@ -145,7 +145,7 @@ void Units_Explorer::Init(const Handle(Units_UnitsDictionary)& aunitsdictionary, const Standard_CString aquantity) { Handle(Units_Quantity) quantity; - Standard_Integer index; + Standard_Integer index = 0; thecurrentquantity = 0; thequantitiessequence = aunitsdictionary->Sequence(); theactiveunitssequence = new TColStd_HSequenceOfInteger(); diff --git a/src/Units/Units_Explorer.hxx b/src/Units/Units_Explorer.hxx index c54996c3bb..cf11464d54 100644 --- a/src/Units/Units_Explorer.hxx +++ b/src/Units/Units_Explorer.hxx @@ -120,9 +120,9 @@ private: - Standard_Integer thecurrentquantity; + Standard_Integer thecurrentquantity{}; Handle(Units_QuantitiesSequence) thequantitiessequence; - Standard_Integer thecurrentunit; + Standard_Integer thecurrentunit{}; Handle(Units_UnitsSequence) theunitssequence; Handle(TColStd_HSequenceOfInteger) theactiveunitssequence; diff --git a/src/Units/Units_Lexicon.cxx b/src/Units/Units_Lexicon.cxx index 71c03cedfa..0b98898718 100644 --- a/src/Units/Units_Lexicon.cxx +++ b/src/Units/Units_Lexicon.cxx @@ -140,7 +140,7 @@ void Units_Lexicon::AddToken(const Standard_CString aword, Handle(Units_Token) token; Handle(Units_Token) referencetoken; Standard_Boolean found = Standard_False; - Standard_Integer index; + Standard_Integer index = 0; for(index=1;index<=thesequenceoftokens->Length();index++) { referencetoken = thesequenceoftokens->Value(index); diff --git a/src/Units/Units_Measurement.cxx b/src/Units/Units_Measurement.cxx index 3e52746ddc..dd789e6640 100644 --- a/src/Units/Units_Measurement.cxx +++ b/src/Units/Units_Measurement.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -25,10 +27,10 @@ //function : Units_Measurement //purpose : //======================================================================= -Units_Measurement::Units_Measurement() +Units_Measurement::Units_Measurement() : themeasurement(0.), myHasToken(Standard_False) { - themeasurement = 0.; - myHasToken = Standard_False; + + } @@ -38,11 +40,11 @@ Units_Measurement::Units_Measurement() //======================================================================= Units_Measurement::Units_Measurement(const Standard_Real avalue, - const Handle(Units_Token)& atoken) + const Handle(Units_Token)& atoken) : themeasurement(avalue), thetoken(atoken), myHasToken(Standard_True) { - themeasurement = avalue; - thetoken = atoken; - myHasToken = Standard_True; + + + } @@ -52,9 +54,9 @@ Units_Measurement::Units_Measurement(const Standard_Real avalue, //======================================================================= Units_Measurement::Units_Measurement(const Standard_Real avalue, - const Standard_CString aunit) + const Standard_CString aunit) : themeasurement(avalue) { - themeasurement=avalue; + Units_UnitSentence unit(aunit); if(!unit.IsDone()) { #ifdef OCCT_DEBUG @@ -155,7 +157,7 @@ Handle(Units_Token) Units_Measurement::Token() const Units_Measurement Units_Measurement::Add (const Units_Measurement& ameasurement) const { - Standard_Real value; + Standard_Real value = NAN; Units_Measurement measurement; if(thetoken->Dimensions()->IsNotEqual((ameasurement.Token())->Dimensions())) return measurement; @@ -175,7 +177,7 @@ Units_Measurement Units_Measurement::Add Units_Measurement Units_Measurement::Subtract (const Units_Measurement& ameasurement) const { - Standard_Real value; + Standard_Real value = NAN; Units_Measurement measurement; if(thetoken->Dimensions()->IsNotEqual((ameasurement.Token())->Dimensions())) return measurement; diff --git a/src/Units/Units_Quantity.cxx b/src/Units/Units_Quantity.cxx index 8250f2ba2c..715a6cb311 100644 --- a/src/Units/Units_Quantity.cxx +++ b/src/Units/Units_Quantity.cxx @@ -38,7 +38,7 @@ Standard_Boolean Units_Quantity::IsEqual(const Standard_CString astring) const void Units_Quantity::Dump(const Standard_Integer ashift, const Standard_Integer alevel) const { - Standard_Integer index; + Standard_Integer index = 0; std::cout< + #include #include #include @@ -51,14 +53,14 @@ static Handle(Units_Token) CreateTokenForNumber(const Standard_CString str) //======================================================================= Units_Sentence::Units_Sentence(const Handle(Units_Lexicon)& alexicon, - const Standard_CString astring) + const Standard_CString astring) : thesequenceoftokens(new Units_TokensSequence()) { - Standard_Integer index; - Standard_Size i,limchain; + Standard_Integer index = 0; + Standard_Size i = 0,limchain = 0; Handle(Units_Token) token; Handle(Units_Token) referencetoken; - thesequenceoftokens = new Units_TokensSequence(); + Handle(Units_TokensSequence) lstlexicon=alexicon->Sequence(); if(lstlexicon.IsNull()) throw Units_NoSuchType("BAD LEXICON descriptor"); @@ -131,8 +133,8 @@ Units_Sentence::Units_Sentence(const Handle(Units_Lexicon)& alexicon, void Units_Sentence::SetConstants() { - Standard_Integer index; - Standard_Real value; + Standard_Integer index = 0; + Standard_Real value = NAN; Handle(Units_Token) token; TCollection_AsciiString string; @@ -163,7 +165,7 @@ static Handle(Units_Token) CalculateLocal(const Handle(Units_TokensSequence)& aS //} //std::cout<Length()==1) { return aSeq->Value(1); diff --git a/src/Units/Units_ShiftedToken.cxx b/src/Units/Units_ShiftedToken.cxx index 0a2e150c9e..31be3c51d9 100644 --- a/src/Units/Units_ShiftedToken.cxx +++ b/src/Units/Units_ShiftedToken.cxx @@ -31,9 +31,9 @@ Units_ShiftedToken::Units_ShiftedToken(const Standard_CString aword, const Standard_Real avalue, const Standard_Real amove, const Handle(Units_Dimensions)& adimensions) - : Units_Token(aword,amean,avalue,adimensions) + : Units_Token(aword,amean,avalue,adimensions), themove(amove) { - themove = amove; + } //======================================================================= diff --git a/src/Units/Units_ShiftedUnit.cxx b/src/Units/Units_ShiftedUnit.cxx index b6192e7805..1b95d5d5f5 100644 --- a/src/Units/Units_ShiftedUnit.cxx +++ b/src/Units/Units_ShiftedUnit.cxx @@ -33,9 +33,9 @@ Units_ShiftedUnit::Units_ShiftedUnit(const Standard_CString aname, const Standard_Real avalue, const Standard_Real amove, const Handle(Units_Quantity)& aquantity) - : Units_Unit(aname,asymbol,avalue,aquantity) + : Units_Unit(aname,asymbol,avalue,aquantity), themove(amove) { - themove = amove; + } //======================================================================= @@ -100,7 +100,7 @@ Handle(Units_Token) Units_ShiftedUnit::Token() const void Units_ShiftedUnit::Dump(const Standard_Integer , const Standard_Integer ) const { - Standard_Integer index; + Standard_Integer index = 0; TCollection_AsciiString string; // int i; diff --git a/src/Units/Units_Token.cxx b/src/Units/Units_Token.cxx index 2f3aa04cbe..52556b7227 100644 --- a/src/Units/Units_Token.cxx +++ b/src/Units/Units_Token.cxx @@ -34,12 +34,12 @@ IMPLEMENT_STANDARD_RTTIEXT(Units_Token,Standard_Transient) //function : Units_Token //purpose : //======================================================================= -Units_Token::Units_Token() +Units_Token::Units_Token() : theword(" "), themean(" "), thevalue(0.), thedimensions(new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.)) { - theword=" "; - themean=" "; - thevalue=0.; - thedimensions=new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.); + + + + } //======================================================================= @@ -47,12 +47,12 @@ Units_Token::Units_Token() //purpose : //======================================================================= -Units_Token::Units_Token(const Standard_CString aword) +Units_Token::Units_Token(const Standard_CString aword) : theword(aword), themean(" "), thevalue(0.), thedimensions(new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.)) { - theword=aword; - themean=" "; - thevalue=0.; - thedimensions=new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.); + + + + } //======================================================================= @@ -61,12 +61,12 @@ Units_Token::Units_Token(const Standard_CString aword) //======================================================================= Units_Token::Units_Token(const Standard_CString aword, - const Standard_CString amean) + const Standard_CString amean) : theword(aword), themean(amean), thevalue(0.), thedimensions(new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.)) { - theword=aword; - themean=amean; - thevalue=0.; - thedimensions=new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.); + + + + } //======================================================================= @@ -76,12 +76,12 @@ Units_Token::Units_Token(const Standard_CString aword, Units_Token::Units_Token(const Standard_CString aword, const Standard_CString amean, - const Standard_Real avalue) + const Standard_Real avalue) : theword(aword), themean(amean), thevalue(avalue), thedimensions(new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.)) { - theword=aword; - themean=amean; - thevalue=avalue; - thedimensions=new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.); + + + + } //======================================================================= @@ -92,11 +92,11 @@ Units_Token::Units_Token(const Standard_CString aword, Units_Token::Units_Token(const Standard_CString aword, const Standard_CString amean, const Standard_Real avalue, - const Handle(Units_Dimensions)& adimensions) + const Handle(Units_Dimensions)& adimensions) : theword(aword), themean(amean), thevalue(avalue) { - theword=aword; - themean=amean; - thevalue=avalue; + + + if(adimensions.IsNull()) thedimensions = new Units_Dimensions(0.,0.,0.,0.,0.,0.,0.,0.,0.); else @@ -159,11 +159,11 @@ void Units_Token::Dimensions(const Handle(Units_Dimensions)& adimensions) //purpose : //======================================================================= -Units_Token::Units_Token(const Handle(Units_Token)& atoken) +Units_Token::Units_Token(const Handle(Units_Token)& atoken) : thevalue(atoken->Value()) { theword = atoken->Word(); themean = atoken->Mean(); - thevalue = atoken->Value(); + thedimensions = atoken->Dimensions(); } @@ -358,7 +358,7 @@ Standard_Boolean Units_Token::IsEqual (const Handle(Units_Token)& atoken) const void Units_Token::Dump(const Standard_Integer ashift, const Standard_Integer alevel) const { - int i; + int i = 0; TCollection_AsciiString word = Word(); TCollection_AsciiString mean = Mean(); diff --git a/src/Units/Units_Unit.cxx b/src/Units/Units_Unit.cxx index b36352edfd..9bf93e4f19 100644 --- a/src/Units/Units_Unit.cxx +++ b/src/Units/Units_Unit.cxx @@ -30,13 +30,13 @@ IMPLEMENT_STANDARD_RTTIEXT(Units_Unit,Standard_Transient) Units_Unit::Units_Unit(const Standard_CString aname, const Standard_CString asymbol, const Standard_Real avalue, - const Handle(Units_Quantity)& aquantity) + const Handle(Units_Quantity)& aquantity) : thename(new TCollection_HAsciiString(aname)), thevalue(avalue), thequantity(aquantity), thesymbolssequence(new TColStd_HSequenceOfHAsciiString()) { - thename = new TCollection_HAsciiString(aname); - thevalue = avalue; - thequantity = aquantity; + + + Handle(TCollection_HAsciiString) symbol = new TCollection_HAsciiString(asymbol); - thesymbolssequence = new TColStd_HSequenceOfHAsciiString(); + thesymbolssequence->Prepend(symbol); } @@ -46,12 +46,12 @@ Units_Unit::Units_Unit(const Standard_CString aname, //======================================================================= Units_Unit::Units_Unit(const Standard_CString aname, - const Standard_CString asymbol) + const Standard_CString asymbol) : thename(new TCollection_HAsciiString(aname)), thevalue(0.), thesymbolssequence(new TColStd_HSequenceOfHAsciiString()) { - thename = new TCollection_HAsciiString(aname); - thevalue = 0.; + + Handle(TCollection_HAsciiString) symbol = new TCollection_HAsciiString(asymbol); - thesymbolssequence = new TColStd_HSequenceOfHAsciiString(); + thesymbolssequence->Prepend(symbol); } @@ -60,11 +60,11 @@ Units_Unit::Units_Unit(const Standard_CString aname, //purpose : //======================================================================= -Units_Unit::Units_Unit(const Standard_CString aname) +Units_Unit::Units_Unit(const Standard_CString aname) : thename(new TCollection_HAsciiString(aname)), thevalue(0.), thesymbolssequence(new TColStd_HSequenceOfHAsciiString()) { - thename = new TCollection_HAsciiString(aname); - thevalue = 0.; - thesymbolssequence = new TColStd_HSequenceOfHAsciiString(); + + + } //======================================================================= @@ -96,7 +96,7 @@ Handle(Units_Token) Units_Unit::Token() const Standard_Boolean Units_Unit::IsEqual(const Standard_CString astring) const { - Standard_Integer index; + Standard_Integer index = 0; TCollection_AsciiString symbol; for(index=1;index<=thesymbolssequence->Length();index++) @@ -116,7 +116,7 @@ Standard_Boolean Units_Unit::IsEqual(const Standard_CString astring) const void Units_Unit::Dump(const Standard_Integer /*ashift*/, const Standard_Integer) const { - Standard_Integer index; + Standard_Integer index = 0; TCollection_AsciiString string; // int i; diff --git a/src/Units/Units_UnitSentence.cxx b/src/Units/Units_UnitSentence.cxx index f8465da8e9..5f563c0474 100644 --- a/src/Units/Units_UnitSentence.cxx +++ b/src/Units/Units_UnitSentence.cxx @@ -65,7 +65,7 @@ void Units_UnitSentence::Analyse() if(Sequence()->Length()==0) return; - Standard_Integer index; + Standard_Integer index = 0; TCollection_AsciiString s; Handle(Units_Token) token; Handle(Units_Token) previoustoken; @@ -177,7 +177,7 @@ void Units_UnitSentence::Analyse() void Units_UnitSentence::SetUnits (const Handle(Units_QuantitiesSequence)& aquantitiessequence) { - Standard_Integer index,jindex,kindex; + Standard_Integer index = 0,jindex = 0,kindex = 0; Standard_Boolean istheend=0; Handle(Units_Quantity) quantity; Handle(Units_TokensSequence) sequenceoftokens; @@ -186,10 +186,8 @@ void Units_UnitSentence::SetUnits Handle(Units_Unit) unit; TCollection_AsciiString symbol; - Handle(Units_QuantitiesSequence) quantitiessequence = aquantitiessequence; - - for(index=1; index<=quantitiessequence->Length(); index++) { - quantity = quantitiessequence->Value(index); + for(index=1; index<=aquantitiessequence->Length(); index++) { + quantity = aquantitiessequence->Value(index); unitssequence=quantity->Sequence(); for(jindex=1; jindex<=unitssequence->Length(); jindex++) { unit = unitssequence->Value(jindex); diff --git a/src/Units/Units_UnitsDictionary.cxx b/src/Units/Units_UnitsDictionary.cxx index 05268f9a1e..09162ed15d 100644 --- a/src/Units/Units_UnitsDictionary.cxx +++ b/src/Units/Units_UnitsDictionary.cxx @@ -100,8 +100,8 @@ namespace void Units_UnitsDictionary::Creates() { - Standard_Boolean ismove; - Standard_Integer i, j, k, charnumber, unitscomputed; + Standard_Boolean ismove = 0; + Standard_Integer i = 0, j = 0, k = 0, charnumber = 0, unitscomputed = 0; Standard_Real matrix[50][50], coeff=0, move=0; Handle(Units_Token) token; Handle(Units_UnitsSequence) theunitssequence; @@ -329,7 +329,7 @@ void Units_UnitsDictionary::Creates() TCollection_AsciiString Units_UnitsDictionary::ActiveUnit(const Standard_CString aquantity) const { - Standard_Integer index1; + Standard_Integer index1 = 0; Handle(Units_Unit) unit; Handle(Units_UnitsSequence) unitssequence; Handle(Units_Quantity) quantity; diff --git a/src/Units/Units_UnitsSystem.cxx b/src/Units/Units_UnitsSystem.cxx index 48bd1541d3..9a34909983 100644 --- a/src/Units/Units_UnitsSystem.cxx +++ b/src/Units/Units_UnitsSystem.cxx @@ -16,6 +16,8 @@ // Convertir correctement les unites translatees +#include + #include #include #include @@ -39,10 +41,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Units_UnitsSystem,Standard_Transient) //function : Units_UnitsSystem //purpose : //======================================================================= -Units_UnitsSystem::Units_UnitsSystem() +Units_UnitsSystem::Units_UnitsSystem() : thequantitiessequence(new Units_QuantitiesSequence()), theactiveunitssequence(new TColStd_HSequenceOfInteger) { - thequantitiessequence = new Units_QuantitiesSequence(); - theactiveunitssequence = new TColStd_HSequenceOfInteger; + + } @@ -52,12 +54,12 @@ Units_UnitsSystem::Units_UnitsSystem() //======================================================================= Units_UnitsSystem::Units_UnitsSystem(const Standard_CString aName, - const Standard_Boolean Verbose) + const Standard_Boolean Verbose) : thequantitiessequence(new Units_QuantitiesSequence()), theactiveunitssequence(new TColStd_HSequenceOfInteger) { Handle(Resource_Manager) themanager = new Resource_Manager(aName,Verbose); - thequantitiessequence = new Units_QuantitiesSequence(); - theactiveunitssequence = new TColStd_HSequenceOfInteger; + + } @@ -90,7 +92,7 @@ Handle(TColStd_HSequenceOfInteger) Units_UnitsSystem::ActiveUnitsSequence() cons void Units_UnitsSystem::Specify(const Standard_CString aquantity,const Standard_CString aunit) { - Standard_Integer index; + Standard_Integer index = 0; Handle(Units_Unit) unit; Handle(Units_UnitsSequence) unitssequence; Handle(Units_Quantity) quantity; @@ -152,7 +154,7 @@ void Units_UnitsSystem::Specify(const Standard_CString aquantity,const Standard_ void Units_UnitsSystem::Remove(const Standard_CString aquantity, const Standard_CString aunit) { - Standard_Integer index1,index2; + Standard_Integer index1 = 0,index2 = 0; Handle(Units_Unit) unit; Handle(Units_UnitsSequence) unitssequence; Handle(Units_Quantity) quantity; @@ -200,7 +202,7 @@ void Units_UnitsSystem::Remove(const Standard_CString aquantity, void Units_UnitsSystem::Activate(const Standard_CString aquantity, const Standard_CString aunit) { - Standard_Integer index1,index2; + Standard_Integer index1 = 0,index2 = 0; Handle(Units_Unit) unit; Handle(Units_UnitsSequence) unitssequence; Handle(Units_Quantity) quantity; @@ -231,7 +233,7 @@ void Units_UnitsSystem::Activate(const Standard_CString aquantity, void Units_UnitsSystem::Activates() { - Standard_Integer index; + Standard_Integer index = 0; Handle(Units_UnitsSequence) unitssequence; Handle(Units_Quantity) quantity; @@ -252,7 +254,7 @@ void Units_UnitsSystem::Activates() TCollection_AsciiString Units_UnitsSystem::ActiveUnit(const Standard_CString aquantity) const { - Standard_Integer index1,index2; + Standard_Integer index1 = 0,index2 = 0; Handle(Units_Unit) unit; Handle(Units_UnitsSequence) unitssequence; Handle(Units_Quantity) quantity; @@ -304,13 +306,13 @@ Standard_Real Units_UnitsSystem::ConvertValueToUserSystem Standard_Real Units_UnitsSystem::ConvertSIValueToUserSystem (const Standard_CString aquantity,const Standard_Real avalue) const { - Standard_Integer index,activeunit; + Standard_Integer index = 0,activeunit = 0; Handle(Units_UnitsSequence) unitssequence; Handle(Units_Quantity) quantity; Handle(Units_QuantitiesSequence) quantitiessequence; Handle(Units_Unit) unit; Handle(Units_ShiftedUnit) sunit; - Standard_Real uvalue,umove; + Standard_Real uvalue = NAN,umove = NAN; for(index=1;index<=thequantitiessequence->Length();index++) { quantity = thequantitiessequence->Value(index); @@ -353,13 +355,13 @@ Standard_Real Units_UnitsSystem::ConvertSIValueToUserSystem Standard_Real Units_UnitsSystem::ConvertUserSystemValueToSI (const Standard_CString aquantity,const Standard_Real avalue) const { - Standard_Integer index,activeunit; + Standard_Integer index = 0,activeunit = 0; Handle(Units_UnitsSequence) unitssequence; Handle(Units_Quantity) quantity; Handle(Units_QuantitiesSequence) quantitiessequence; Handle(Units_Unit) unit; Handle(Units_ShiftedUnit) sunit; - Standard_Real uvalue,umove; + Standard_Real uvalue = NAN,umove = NAN; for(index=1;index<=thequantitiessequence->Length();index++) { quantity = thequantitiessequence->Value(index); diff --git a/src/UnitsAPI/UnitsAPI.cxx b/src/UnitsAPI/UnitsAPI.cxx index 0de5961313..150c9854c2 100644 --- a/src/UnitsAPI/UnitsAPI.cxx +++ b/src/UnitsAPI/UnitsAPI.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -337,7 +339,7 @@ Standard_Real UnitsAPI::AnyToLS(const Standard_Real aData, Standard_Real UnitsAPI::AnyToSI(const Standard_Real aData, const Standard_CString aUnit) { - Standard_Real aValue; + Standard_Real aValue = NAN; CheckLoading (UnitsAPI_DEFAULT); aValue = Units::ToSI(aData,aUnit); return aValue; @@ -353,7 +355,7 @@ Standard_Real UnitsAPI::AnyToSI(const Standard_Real aData, const Standard_CString aUnit, Handle(Units_Dimensions) &aDim) { - Standard_Real aValue; + Standard_Real aValue = NAN; CheckLoading (UnitsAPI_DEFAULT); aValue = Units::ToSI(aData,aUnit,aDim); return aValue; @@ -393,7 +395,7 @@ Standard_Real UnitsAPI::AnyFromLS(const Standard_Real aData, Standard_Real UnitsAPI::AnyFromSI(const Standard_Real aData, const Standard_CString aUnit) { - Standard_Real aValue; + Standard_Real aValue = NAN; CheckLoading (UnitsAPI_DEFAULT); aValue = Units::FromSI(aData,aUnit); return aValue; diff --git a/src/V3d/V3d.cxx b/src/V3d/V3d.cxx index 2bf1342634..b60487d732 100644 --- a/src/V3d/V3d.cxx +++ b/src/V3d/V3d.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -34,8 +36,8 @@ namespace void V3d::ArrowOfRadius(const Handle(Graphic3d_Group)& garrow,const Standard_Real X0,const Standard_Real Y0,const Standard_Real Z0,const Standard_Real Dx,const Standard_Real Dy,const Standard_Real Dz,const Standard_Real Alpha,const Standard_Real Lng) { - Standard_Real Xc, Yc, Zc, Xi, Yi, Zi, Xj, Yj, Zj; - Standard_Real Xn, Yn, Zn, X, Y, Z, X1 = 0., Y1 = 0., Z1 = 0., Norme; + Standard_Real Xc = NAN, Yc = NAN, Zc = NAN, Xi = NAN, Yi = NAN, Zi = NAN, Xj = NAN, Yj = NAN, Zj = NAN; + Standard_Real Xn = NAN, Yn = NAN, Zn = NAN, X = NAN, Y = NAN, Z = NAN, X1 = 0., Y1 = 0., Z1 = 0., Norme = NAN; const Standard_Integer NbPoints = 10; // Centre du cercle base de la fleche : @@ -62,7 +64,7 @@ void V3d::ArrowOfRadius(const Handle(Graphic3d_Group)& garrow,const Standard_Rea Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(3*NbPoints,NbPoints); - Standard_Integer i; + Standard_Integer i = 0; const Standard_Real Tg = Tan(Alpha); for (i = 1; i <= NbPoints; i++) { @@ -90,7 +92,7 @@ void V3d::CircleInPlane(const Handle(Graphic3d_Group)& gcircle,const Standard_Re Standard_Real Norme = Sqrt ( DX*DX + DY*DY + DZ*DZ ); if ( Norme >= 0.0001 ) { - Standard_Real VX,VY,VZ,X,Y,Z,Xn,Yn,Zn,Xi,Yi,Zi,Xj,Yj,Zj; + Standard_Real VX = NAN,VY = NAN,VZ = NAN,X = NAN,Y = NAN,Z = NAN,Xn = NAN,Yn = NAN,Zn = NAN,Xi = NAN,Yi = NAN,Zi = NAN,Xj = NAN,Yj = NAN,Zj = NAN; VX= DX/Norme; VY = DY/Norme; VZ = DZ/Norme; diff --git a/src/V3d/V3d_CircularGrid.cxx b/src/V3d/V3d_CircularGrid.cxx index ca4a7c911d..6e2de9f291 100644 --- a/src/V3d/V3d_CircularGrid.cxx +++ b/src/V3d/V3d_CircularGrid.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -42,7 +44,7 @@ public: : Graphic3d_Structure (theManager), myGrid (theGrid) {} //! Override method initiating recomputing in V3d_CircularGrid. - virtual void Compute() Standard_OVERRIDE + void Compute() Standard_OVERRIDE { GraphicClear (Standard_False); myGrid->myGroup = NewGroup(); @@ -120,10 +122,10 @@ void V3d_CircularGrid::UpdateDisplay () { gp_Ax3 ThePlane = myViewer->PrivilegedPlane(); - Standard_Real xl, yl, zl; - Standard_Real xdx, xdy, xdz; - Standard_Real ydx, ydy, ydz; - Standard_Real dx, dy, dz; + Standard_Real xl = NAN, yl = NAN, zl = NAN; + Standard_Real xdx = NAN, xdy = NAN, xdz = NAN; + Standard_Real ydx = NAN, ydy = NAN, ydz = NAN; + Standard_Real dx = NAN, dy = NAN, dz = NAN; ThePlane.Location ().Coord (xl, yl, zl); ThePlane.XDirection ().Coord (xdx, xdy, xdz); ThePlane.YDirection ().Coord (ydx, ydy, ydz); @@ -135,10 +137,10 @@ void V3d_CircularGrid::UpdateDisplay () MakeTransform = (RotationAngle() != myCurAngle || XOrigin() != myCurXo || YOrigin() != myCurYo); if (!MakeTransform) { - Standard_Real curxl, curyl, curzl; - Standard_Real curxdx, curxdy, curxdz; - Standard_Real curydx, curydy, curydz; - Standard_Real curdx, curdy, curdz; + Standard_Real curxl = NAN, curyl = NAN, curzl = NAN; + Standard_Real curxdx = NAN, curxdy = NAN, curxdz = NAN; + Standard_Real curydx = NAN, curydy = NAN, curydz = NAN; + Standard_Real curdx = NAN, curdy = NAN, curdz = NAN; myCurViewPlane.Location ().Coord (curxl, curyl, curzl); myCurViewPlane.XDirection ().Coord (curxdx, curxdy, curxdz); myCurViewPlane.YDirection ().Coord (curydx, curydy, curydz); @@ -246,7 +248,7 @@ void V3d_CircularGrid::DefineLines () if (aSeqTenth.Length()) { myGroup->SetGroupPrimitivesAspect (new Graphic3d_AspectLine3d (myTenthColor, Aspect_TOL_SOLID, 1.0)); - Standard_Integer n, np; + Standard_Integer n = 0, np = 0; const Standard_Integer nbl = aSeqTenth.Length() / nbpnts; Handle(Graphic3d_ArrayOfPolylines) aPrims2 = new Graphic3d_ArrayOfPolylines(aSeqTenth.Length(),nbl); for (np = 1, n=0; nSetPrimitivesAspect (new Graphic3d_AspectLine3d (myColor, Aspect_TOL_SOLID, 1.0)); - Standard_Integer n, np; + Standard_Integer n = 0, np = 0; const Standard_Integer nbl = aSeqLines.Length() / nbpnts; Handle(Graphic3d_ArrayOfPolylines) aPrims3 = new Graphic3d_ArrayOfPolylines(aSeqLines.Length(),nbl); for (np = 1, n=0; nSetScale (3.); const Standard_Integer nbpnts = Standard_Integer (2*aDivision); - Standard_Real r, alpha = M_PI / aDivision; + Standard_Real r = NAN, alpha = M_PI / aDivision; // diameters TColgp_SequenceOfPnt aSeqPnts; @@ -318,7 +320,7 @@ void V3d_CircularGrid::DefinePoints () myGroup->SetGroupPrimitivesAspect (MarkerAttrib); if (aSeqPnts.Length()) { - Standard_Real X,Y,Z; + Standard_Real X = NAN,Y = NAN,Z = NAN; const Standard_Integer nbv = aSeqPnts.Length(); Handle(Graphic3d_ArrayOfPoints) Cercle = new Graphic3d_ArrayOfPoints (nbv); for (Standard_Integer i=1; i<=nbv; i++) diff --git a/src/V3d/V3d_RectangularGrid.cxx b/src/V3d/V3d_RectangularGrid.cxx index 35b1d2b257..0435aa613b 100644 --- a/src/V3d/V3d_RectangularGrid.cxx +++ b/src/V3d/V3d_RectangularGrid.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -40,7 +42,7 @@ public: : Graphic3d_Structure (theManager), myGrid (theGrid) {} //! Override method initiating recomputing in V3d_RectangularGrid. - virtual void Compute() Standard_OVERRIDE + void Compute() Standard_OVERRIDE { GraphicClear (Standard_False); myGrid->myGroup = NewGroup(); @@ -121,10 +123,10 @@ void V3d_RectangularGrid::UpdateDisplay () gp_Ax3 ThePlane = myViewer->PrivilegedPlane (); Standard_Boolean MakeTransform = Standard_False; - Standard_Real xl, yl, zl; - Standard_Real xdx, xdy, xdz; - Standard_Real ydx, ydy, ydz; - Standard_Real dx, dy, dz; + Standard_Real xl = NAN, yl = NAN, zl = NAN; + Standard_Real xdx = NAN, xdy = NAN, xdz = NAN; + Standard_Real ydx = NAN, ydy = NAN, ydz = NAN; + Standard_Real dx = NAN, dy = NAN, dz = NAN; ThePlane.Location ().Coord (xl, yl, zl); ThePlane.XDirection ().Coord (xdx, xdy, xdz); ThePlane.YDirection ().Coord (ydx, ydy, ydz); @@ -135,10 +137,10 @@ void V3d_RectangularGrid::UpdateDisplay () if (RotationAngle() != myCurAngle || XOrigin() != myCurXo || YOrigin() != myCurYo) MakeTransform = Standard_True; if (! MakeTransform) { - Standard_Real curxl, curyl, curzl; - Standard_Real curxdx, curxdy, curxdz; - Standard_Real curydx, curydy, curydz; - Standard_Real curdx, curdy, curdz; + Standard_Real curxl = NAN, curyl = NAN, curzl = NAN; + Standard_Real curxdx = NAN, curxdy = NAN, curxdz = NAN; + Standard_Real curydx = NAN, curydy = NAN, curydz = NAN; + Standard_Real curdx = NAN, curdy = NAN, curdz = NAN; myCurViewPlane.Location ().Coord (curxl, curyl, curzl); myCurViewPlane.XDirection ().Coord (curxdx, curxdy, curxdz); myCurViewPlane.YDirection ().Coord (curydx, curydy, curydz); @@ -215,8 +217,8 @@ void V3d_RectangularGrid::DefineLines () myToComputePrs = Standard_False; myGroup->Clear(); - Standard_Integer nblines; - Standard_Real xl, yl, zl = myOffSet; + Standard_Integer nblines = 0; + Standard_Real xl = NAN, yl = NAN, zl = myOffSet; TColgp_SequenceOfPnt aSeqLines, aSeqTenth; @@ -298,7 +300,7 @@ void V3d_RectangularGrid::DefinePoints () myGroup->Clear(); // horizontals - Standard_Real xl, yl; + Standard_Real xl = NAN, yl = NAN; TColgp_SequenceOfPnt aSeqPnts; for (xl = 0.0; xl <= myXSize; xl += aXStep) { aSeqPnts.Append(gp_Pnt( xl, 0.0, -myOffSet)); @@ -312,8 +314,8 @@ void V3d_RectangularGrid::DefinePoints () } if (aSeqPnts.Length()) { - Standard_Integer i; - Standard_Real X,Y,Z; + Standard_Integer i = 0; + Standard_Real X = NAN,Y = NAN,Z = NAN; const Standard_Integer nbv = aSeqPnts.Length(); Handle(Graphic3d_ArrayOfPoints) Vertical = new Graphic3d_ArrayOfPoints (nbv); for (i=1; i<=nbv; i++) diff --git a/src/V3d/V3d_Trihedron.cxx b/src/V3d/V3d_Trihedron.cxx index 29c04ba8c3..0386a0f993 100644 --- a/src/V3d/V3d_Trihedron.cxx +++ b/src/V3d/V3d_Trihedron.cxx @@ -64,7 +64,7 @@ public: : Graphic3d_Structure (theManager), myTrihedron (theTrihedron) {} //! Override method to redirect to V3d_Trihedron. - virtual void Compute() Standard_OVERRIDE { myTrihedron->compute(); } + void Compute() Standard_OVERRIDE { myTrihedron->compute(); } private: V3d_Trihedron* myTrihedron; diff --git a/src/V3d/V3d_View.cxx b/src/V3d/V3d_View.cxx index 8497cfc596..e170f335b5 100644 --- a/src/V3d/V3d_View.cxx +++ b/src/V3d/V3d_View.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -63,7 +65,8 @@ namespace //purpose : //============================================================================= V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView theType) -: myIsInvalidatedImmediate (Standard_True), +: myDefaultCamera(new Graphic3d_Camera()), myImmediateUpdate(Standard_True), + myIsInvalidatedImmediate (Standard_True), MyViewer (theViewer.operator->()), SwitchSetFront (Standard_False), myZRotation (Standard_False), @@ -85,9 +88,9 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th ? Graphic3d_Camera::Projection_Orthographic : Graphic3d_Camera::Projection_Perspective); - myDefaultCamera = new Graphic3d_Camera(); + - myImmediateUpdate = Standard_False; + SetAutoZFitMode (Standard_True, 1.0); SetBackFacingModel (V3d_TOBM_AUTOMATIC); SetCamera (aCamera); @@ -104,7 +107,7 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th SetViewOrientationDefault(); theViewer->AddView (this); Init(); - myImmediateUpdate = Standard_True; + } //============================================================================= @@ -112,25 +115,25 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th //purpose : //============================================================================= V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const Handle(V3d_View)& theView) -: myIsInvalidatedImmediate (Standard_True), +: myDefaultCamera(new Graphic3d_Camera (theView->DefaultCamera())), myImmediateUpdate(Standard_True), myIsInvalidatedImmediate (Standard_True), MyViewer (theViewer.operator->()), - SwitchSetFront(Standard_False), + myDefaultViewAxis(theView->myDefaultViewAxis), myDefaultViewPoint(theView->myDefaultViewPoint), SwitchSetFront(Standard_False), myZRotation (Standard_False), MyTrsf (1, 4, 1, 4) { myView = theViewer->Driver()->CreateView (theViewer->StructureManager()); myView->CopySettings (theView->View()); - myDefaultViewPoint = theView->myDefaultViewPoint; - myDefaultViewAxis = theView->myDefaultViewAxis; + + - myDefaultCamera = new Graphic3d_Camera (theView->DefaultCamera()); + - myImmediateUpdate = Standard_False; + SetAutoZFitMode (theView->AutoZFitMode(), theView->AutoZFitScaleFactor()); theViewer->AddView (this); Init(); - myImmediateUpdate = Standard_True; + } //============================================================================= @@ -179,7 +182,7 @@ void V3d_View::SetMagnify (const Handle(Aspect_Window)& theWindow, { if (!myView->IsRemoved() && !myView->IsDefined()) { - Standard_Real aU1, aV1, aU2, aV2; + Standard_Real aU1 = NAN, aV1 = NAN, aU2 = NAN, aV2 = NAN; thePreviousView->Convert (theX1, theY1, aU1, aV1); thePreviousView->Convert (theX2, theY2, aU2, aV2); myView->SetWindow (Handle(Graphic3d_CView)(), theWindow, nullptr); @@ -756,7 +759,7 @@ void V3d_View::SetVisualization (const V3d_TypeOfVisualization theType) void V3d_View::SetFront() { gp_Ax3 a = MyViewer->PrivilegedPlane(); - Standard_Real xo, yo, zo, vx, vy, vz, xu, yu, zu; + Standard_Real xo = NAN, yo = NAN, zo = NAN, vx = NAN, vy = NAN, vz = NAN, xu = NAN, yu = NAN, zu = NAN; a.Direction().Coord(vx,vy,vz); a.YDirection().Coord(xu,yu,zu); @@ -1374,7 +1377,7 @@ void V3d_View::Reset (const Standard_Boolean theToUpdate) void V3d_View::SetCenter (const Standard_Integer theXp, const Standard_Integer theYp) { - Standard_Real aXv, aYv; + Standard_Real aXv = NAN, aYv = NAN; Convert (theXp, theYp, aXv, aYv); Translate (Camera(), aXv, aYv); @@ -1589,9 +1592,9 @@ void V3d_View::FitAll (const Bnd_Box& theBox, const Standard_Real theMargin, con void V3d_View::DepthFitAll(const Standard_Real Aspect, const Standard_Real Margin) { - Standard_Real Xmin,Ymin,Zmin,Xmax,Ymax,Zmax,U,V,W,U1,V1,W1 ; - Standard_Real Umin,Vmin,Wmin,Umax,Vmax,Wmax ; - Standard_Real Dx,Dy,Dz,Size; + Standard_Real Xmin = NAN,Ymin = NAN,Zmin = NAN,Xmax = NAN,Ymax = NAN,Zmax = NAN,U = NAN,V = NAN,W = NAN,U1 = NAN,V1 = NAN,W1 = NAN ; + Standard_Real Umin = NAN,Vmin = NAN,Wmin = NAN,Umax = NAN,Vmax = NAN,Wmax = NAN ; + Standard_Real Dx = NAN,Dy = NAN,Dz = NAN,Size = NAN; Standard_Integer Nstruct = myView->NumberOfDisplayedStructures() ; @@ -1669,7 +1672,7 @@ void V3d_View::WindowFit (const Standard_Integer theMinXp, if (!aCamera->IsOrthographic()) { // normalize view coordinates - Standard_Integer aWinWidth, aWinHeight; + Standard_Integer aWinWidth = 0, aWinHeight = 0; MyWindow->Size (aWinWidth, aWinHeight); // z coordinate of camera center @@ -1702,7 +1705,7 @@ void V3d_View::WindowFit (const Standard_Integer theMinXp, } else { - Standard_Real aX1, aY1, aX2, aY2; + Standard_Real aX1 = NAN, aY1 = NAN, aX2 = NAN, aY2 = NAN; Convert (theMinXp, theMinYp, aX1, aY1); Convert (theMaxXp, theMaxYp, aX2, aY2); FitAll (aX1, aY1, aX2, aY2); @@ -1768,12 +1771,12 @@ void V3d_View::ConvertToGrid(const Standard_Real theX, //======================================================================= Standard_Real V3d_View::Convert(const Standard_Integer Vp) const { - Standard_Integer aDxw, aDyw ; + Standard_Integer aDxw = 0, aDyw = 0 ; V3d_UnMapped_Raise_if (!myView->IsDefined(), "view has no window"); MyWindow->Size (aDxw, aDyw); - Standard_Real aValue; + Standard_Real aValue = NAN; gp_Pnt aViewDims = Camera()->ViewDimensions(); aValue = aViewDims.X() * (Standard_Real)Vp / (Standard_Real)aDxw; @@ -1790,7 +1793,7 @@ void V3d_View::Convert(const Standard_Integer Xp, Standard_Real& Xv, Standard_Real& Yv) const { - Standard_Integer aDxw, aDyw; + Standard_Integer aDxw = 0, aDyw = 0; V3d_UnMapped_Raise_if (!myView->IsDefined(), "view has no window"); @@ -1811,7 +1814,7 @@ Standard_Integer V3d_View::Convert(const Standard_Real Vv) const { V3d_UnMapped_Raise_if (!myView->IsDefined(), "view has no window"); - Standard_Integer aDxw, aDyw; + Standard_Integer aDxw = 0, aDyw = 0; MyWindow->Size (aDxw, aDyw); gp_Pnt aViewDims = Camera()->ViewDimensions(); @@ -1831,7 +1834,7 @@ void V3d_View::Convert(const Standard_Real Xv, { V3d_UnMapped_Raise_if (!myView->IsDefined(), "view has no window"); - Standard_Integer aDxw, aDyw; + Standard_Integer aDxw = 0, aDyw = 0; MyWindow->Size (aDxw, aDyw); gp_Pnt aPoint (Xv, Yv, 0.0); @@ -1914,7 +1917,7 @@ void V3d_View::Convert(const Standard_Real X, Standard_Integer& Yp) const { V3d_UnMapped_Raise_if (!myView->IsDefined(), "view has no window"); - Standard_Integer aHeight, aWidth; + Standard_Integer aHeight = 0, aWidth = 0; MyWindow->Size (aWidth, aHeight); gp_Pnt aPoint = Camera()->Project (gp_Pnt (X, Y, Z)); @@ -1933,7 +1936,7 @@ void V3d_View::Project (const Standard_Real theX, Standard_Real& theXp, Standard_Real& theYp) const { - Standard_Real aZp; + Standard_Real aZp = NAN; Project (theX, theY, theZ, theXp, theYp, aZp); } @@ -2058,8 +2061,8 @@ Standard_Integer V3d_View::MinMax(Standard_Real& Umin, Standard_Real& Umax, Standard_Real& Vmax) const { - Standard_Real Wmin,Wmax,U,V,W ; - Standard_Real Xmin,Ymin,Zmin,Xmax,Ymax,Zmax ; + Standard_Real Wmin = NAN,Wmax = NAN,U = NAN,V = NAN,W = NAN ; + Standard_Real Xmin = NAN,Ymin = NAN,Zmin = NAN,Xmax = NAN,Ymax = NAN,Zmax = NAN ; // CAL 6/11/98 Standard_Integer Nstruct = myView->NumberOfDisplayedStructures() ; @@ -2139,7 +2142,7 @@ gp_Pnt V3d_View::GravityPoint() const } } - Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + Standard_Real Xmin = NAN, Ymin = NAN, Zmin = NAN, Xmax = NAN, Ymax = NAN, Zmax = NAN; Standard_Integer aNbPoints = 0; gp_XYZ aResult (0.0, 0.0, 0.0); for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (aSetOfStructures); @@ -2251,7 +2254,7 @@ void V3d_View::ProjReferenceAxe(const Standard_Integer Xpix, Standard_Real& VY, Standard_Real& VZ) const { - Standard_Real Xo,Yo,Zo; + Standard_Real Xo = NAN,Yo = NAN,Zo = NAN; Convert (Xpix, Ypix, XP, YP, ZP); if ( Type() == V3d_PERSPECTIVE ) @@ -2472,7 +2475,7 @@ gp_XYZ V3d_View::TrsPoint (const Graphic3d_Vertex& thePnt, const TColStd_Array2O return gp_XYZ (thePnt.X(), thePnt.Y(), thePnt.Z()); } - Standard_Real X, Y, Z; + Standard_Real X = NAN, Y = NAN, Z = NAN; thePnt.Coord (X,Y,Z); const Standard_Real XX = (theMat(lr,lc+3) + X*theMat(lr,lc) + Y*theMat(lr,lc+1) + Z*theMat(lr,lc+2)) / theMat(lr+3,lc+3); const Standard_Real YY = (theMat(lr+1,lc+3) + X*theMat(lr+1,lc) + Y*theMat(lr+1,lc+1) + Z*theMat(lr+1,lc+2))/theMat(lr+3,lc+3); @@ -2622,7 +2625,7 @@ void V3d_View::AxialScale (const Standard_Integer Dx, const V3d_TypeOfAxe Axis) { if( Dx != 0. || Dy != 0. ) { - Standard_Real Sx, Sy, Sz; + Standard_Real Sx = NAN, Sy = NAN, Sz = NAN; AxialScale( Sx, Sy, Sz ); Standard_Real dscale = Sqrt(Dx*Dx + Dy*Dy) / 100. + 1; dscale = (Dx > 0) ? dscale : 1./dscale; @@ -2672,7 +2675,7 @@ void V3d_View::StartRotation(const Standard_Integer X, const Standard_Real zRotationThreshold) { sx = X; sy = Y; - Standard_Real x,y; + Standard_Real x = NAN,y = NAN; Size(x,y); rx = Standard_Real(Convert(x)); ry = Standard_Real(Convert(y)); @@ -2783,7 +2786,7 @@ void V3d_View::Init() Standard_Boolean V3d_View::Dump (const Standard_CString theFile, const Graphic3d_BufferType& theBufferType) { - Standard_Integer aWinWidth, aWinHeight; + Standard_Integer aWinWidth = 0, aWinHeight = 0; MyWindow->Size (aWinWidth, aWinHeight); Image_AlienPixMap anImage; @@ -3372,7 +3375,7 @@ void V3d_View::Move (const Standard_Real theDx, } } - Standard_Real XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ; + Standard_Real XX = NAN, XY = NAN, XZ = NAN, YX = NAN, YY = NAN, YZ = NAN, ZX = NAN, ZY = NAN, ZZ = NAN; myXscreenAxis.Coord (XX,XY,XZ); myYscreenAxis.Coord (YX,YY,YZ); myZscreenAxis.Coord (ZX,ZY,ZZ); @@ -3532,10 +3535,10 @@ void V3d_View::SetGrid (const gp_Ax3& aPlane, const Handle(Aspect_Grid)& aGrid) MyPlane = aPlane; MyGrid = aGrid; - Standard_Real xl, yl, zl; - Standard_Real xdx, xdy, xdz; - Standard_Real ydx, ydy, ydz; - Standard_Real dx, dy, dz; + Standard_Real xl = NAN, yl = NAN, zl = NAN; + Standard_Real xdx = NAN, xdy = NAN, xdz = NAN; + Standard_Real ydx = NAN, ydy = NAN, ydz = NAN; + Standard_Real dx = NAN, dy = NAN, dz = NAN; aPlane.Location ().Coord (xl, yl, zl); aPlane.XDirection ().Coord (xdx, xdy, xdz); aPlane.YDirection ().Coord (ydx, ydy, ydz); @@ -3580,10 +3583,10 @@ void V3d_View::SetGrid (const gp_Ax3& aPlane, const Handle(Aspect_Grid)& aGrid) Trsf2 (2, 3) = 0.0, Trsf2 (3, 3) = 1.0; - Standard_Real valuetrsf; - Standard_Real valueoldtrsf; - Standard_Real valuenewtrsf; - Standard_Integer i, j, k; + Standard_Real valuetrsf = NAN; + Standard_Real valueoldtrsf = NAN; + Standard_Real valuenewtrsf = NAN; + Standard_Integer i = 0, j = 0, k = 0; // Calculation of the product of matrices for (i=1; i<=4; i++) for (j=1; j<=4; j++) { diff --git a/src/V3d/V3d_View.hxx b/src/V3d/V3d_View.hxx index 22847902e9..f9e2b751fa 100644 --- a/src/V3d/V3d_View.hxx +++ b/src/V3d/V3d_View.hxx @@ -1035,8 +1035,8 @@ private: protected: - Standard_Real myOldMouseX; - Standard_Real myOldMouseY; + Standard_Real myOldMouseX{}; + Standard_Real myOldMouseY{}; gp_Dir myCamStartOpUp; gp_Dir myCamStartOpDir; gp_Pnt myCamStartOpEye; @@ -1051,23 +1051,23 @@ private: V3d_Viewer* MyViewer; NCollection_Sequence mySubviews; - V3d_View* myParentView; + V3d_View* myParentView{}; V3d_ListOfLight myActiveLights; gp_Dir myDefaultViewAxis; gp_Pnt myDefaultViewPoint; Handle(Aspect_Window) MyWindow; V3d_ListOfLight::Iterator myActiveLightsIterator; - Standard_Integer sx; - Standard_Integer sy; - Standard_Real rx; - Standard_Real ry; + Standard_Integer sx{}; + Standard_Integer sy{}; + Standard_Real rx{}; + Standard_Real ry{}; gp_Pnt myRotateGravity; - Standard_Boolean myComputedMode; + Standard_Boolean myComputedMode{}; Standard_Boolean SwitchSetFront; Standard_Boolean myZRotation; - Standard_Integer MyZoomAtPointX; - Standard_Integer MyZoomAtPointY; + Standard_Integer MyZoomAtPointX{}; + Standard_Integer MyZoomAtPointY{}; Handle(V3d_Trihedron) myTrihedron; Handle(Aspect_Grid) MyGrid; gp_Ax3 MyPlane; @@ -1079,8 +1079,8 @@ private: gp_Vec myZscreenAxis; gp_Dir myViewAxis; Graphic3d_Vertex myGravityReferencePoint; - Standard_Boolean myAutoZFitIsOn; - Standard_Real myAutoZFitScaleFactor; + Standard_Boolean myAutoZFitIsOn{}; + Standard_Real myAutoZFitScaleFactor{}; }; diff --git a/src/Vrml/Vrml_AsciiText.cxx b/src/Vrml/Vrml_AsciiText.cxx index 0facc261c2..75d450ed8a 100644 --- a/src/Vrml/Vrml_AsciiText.cxx +++ b/src/Vrml/Vrml_AsciiText.cxx @@ -17,25 +17,25 @@ IMPLEMENT_STANDARD_RTTIEXT(Vrml_AsciiText,Standard_Transient) -Vrml_AsciiText::Vrml_AsciiText() +Vrml_AsciiText::Vrml_AsciiText() : mySpacing(1), myJustification(Vrml_LEFT), myWidth(0) { TCollection_AsciiString tmpS(""); myString = new TColStd_HArray1OfAsciiString(1,1,tmpS); - mySpacing = 1; - myJustification = Vrml_LEFT; - myWidth = 0; + + + } Vrml_AsciiText::Vrml_AsciiText(const Handle(TColStd_HArray1OfAsciiString)& aString, const Standard_Real aSpacing, const Vrml_AsciiTextJustification aJustification, - const Standard_Real aWidth) + const Standard_Real aWidth) : myString(aString), mySpacing(aSpacing), myJustification(aJustification), myWidth(aWidth) { - myString = aString; - mySpacing = aSpacing; - myJustification = aJustification; - myWidth = aWidth; + + + + } void Vrml_AsciiText::SetString(const Handle(TColStd_HArray1OfAsciiString)& aString) @@ -80,7 +80,7 @@ Standard_Real Vrml_AsciiText::Width() const Standard_OStream& Vrml_AsciiText::Print(Standard_OStream& anOStream) const { - Standard_Integer i; + Standard_Integer i = 0; anOStream << "AsciiText {\n"; diff --git a/src/Vrml/Vrml_Cone.cxx b/src/Vrml/Vrml_Cone.cxx index c769d84912..7adcbd9112 100644 --- a/src/Vrml/Vrml_Cone.cxx +++ b/src/Vrml/Vrml_Cone.cxx @@ -16,11 +16,11 @@ Vrml_Cone::Vrml_Cone(const Vrml_ConeParts aParts, const Standard_Real aBottomRadius, - const Standard_Real aHeight) + const Standard_Real aHeight) : myParts(aParts), myBottomRadius(aBottomRadius), myHeight(aHeight) { - myParts = aParts; - myBottomRadius = aBottomRadius; - myHeight = aHeight; + + + } void Vrml_Cone::SetParts(const Vrml_ConeParts aParts) diff --git a/src/Vrml/Vrml_ConfigurationNode.cxx b/src/Vrml/Vrml_ConfigurationNode.cxx index 6cb9de24b2..103a005aef 100644 --- a/src/Vrml/Vrml_ConfigurationNode.cxx +++ b/src/Vrml/Vrml_ConfigurationNode.cxx @@ -40,9 +40,9 @@ Vrml_ConfigurationNode::Vrml_ConfigurationNode() : // purpose : //======================================================================= Vrml_ConfigurationNode::Vrml_ConfigurationNode(const Handle(Vrml_ConfigurationNode)& theNode) - :DE_ConfigurationNode(theNode) + :DE_ConfigurationNode(theNode), InternalParameters(theNode->InternalParameters) { - InternalParameters = theNode->InternalParameters; + } //======================================================================= diff --git a/src/Vrml/Vrml_Coordinate3.cxx b/src/Vrml/Vrml_Coordinate3.cxx index 81b7661ee8..4fb0665f85 100644 --- a/src/Vrml/Vrml_Coordinate3.cxx +++ b/src/Vrml/Vrml_Coordinate3.cxx @@ -17,16 +17,16 @@ IMPLEMENT_STANDARD_RTTIEXT(Vrml_Coordinate3,Standard_Transient) -Vrml_Coordinate3::Vrml_Coordinate3(const Handle(TColgp_HArray1OfVec)& aPoint) +Vrml_Coordinate3::Vrml_Coordinate3(const Handle(TColgp_HArray1OfVec)& aPoint) : myPoint(aPoint) { - myPoint = aPoint; + } - Vrml_Coordinate3::Vrml_Coordinate3() + Vrml_Coordinate3::Vrml_Coordinate3() : myPoint(new TColgp_HArray1OfVec(1,1)) { gp_Vec Tmp_Vec; - myPoint = new TColgp_HArray1OfVec(1,1); + Tmp_Vec.SetX(0); Tmp_Vec.SetY(0); Tmp_Vec.SetZ(0); myPoint->SetValue (1,Tmp_Vec); } @@ -43,7 +43,7 @@ Handle(TColgp_HArray1OfVec) Vrml_Coordinate3::Point() const Standard_OStream& Vrml_Coordinate3::Print(Standard_OStream& anOStream) const { - Standard_Integer i; + Standard_Integer i = 0; anOStream << "Coordinate3 {\n"; diff --git a/src/Vrml/Vrml_Cube.cxx b/src/Vrml/Vrml_Cube.cxx index 79988707e9..6e32fbed5d 100644 --- a/src/Vrml/Vrml_Cube.cxx +++ b/src/Vrml/Vrml_Cube.cxx @@ -16,11 +16,11 @@ Vrml_Cube::Vrml_Cube(const Standard_Real aWidth, const Standard_Real aHeight, - const Standard_Real aDepth) + const Standard_Real aDepth) : myWidth(aWidth), myHeight(aHeight), myDepth(aDepth) { - myWidth = aWidth; - myHeight = aHeight; - myDepth = aDepth; + + + } void Vrml_Cube::SetWidth(const Standard_Real aWidth) diff --git a/src/Vrml/Vrml_Cylinder.cxx b/src/Vrml/Vrml_Cylinder.cxx index 77abdc4e48..f608cbeee5 100644 --- a/src/Vrml/Vrml_Cylinder.cxx +++ b/src/Vrml/Vrml_Cylinder.cxx @@ -16,11 +16,11 @@ Vrml_Cylinder::Vrml_Cylinder(const Vrml_CylinderParts aParts, const Standard_Real aRadius, - const Standard_Real aHeight) + const Standard_Real aHeight) : myParts(aParts), myRadius(aRadius), myHeight(aHeight) { - myParts = aParts; - myRadius = aRadius; - myHeight = aHeight; + + + } void Vrml_Cylinder::SetParts(const Vrml_CylinderParts aParts) diff --git a/src/Vrml/Vrml_DirectionalLight.cxx b/src/Vrml/Vrml_DirectionalLight.cxx index decdb5e8bc..ac200a2ba6 100644 --- a/src/Vrml/Vrml_DirectionalLight.cxx +++ b/src/Vrml/Vrml_DirectionalLight.cxx @@ -26,9 +26,9 @@ Vrml_DirectionalLight::Vrml_DirectionalLight(): Vrml_DirectionalLight::Vrml_DirectionalLight(const Standard_Boolean aOnOff, const Standard_Real aIntensity, const Quantity_Color& aColor, - const gp_Vec& aDirection) + const gp_Vec& aDirection) : myOnOff(aOnOff) { - myOnOff = aOnOff; + if (aIntensity < 0. || aIntensity > 1.) { throw Standard_Failure("Error : Light intensity must be in the range 0.0 to 1.0, inclusive."); diff --git a/src/Vrml/Vrml_FontStyle.cxx b/src/Vrml/Vrml_FontStyle.cxx index 48667c4380..bf9698dbfe 100644 --- a/src/Vrml/Vrml_FontStyle.cxx +++ b/src/Vrml/Vrml_FontStyle.cxx @@ -16,11 +16,11 @@ Vrml_FontStyle::Vrml_FontStyle(const Standard_Real aSize, const Vrml_FontStyleFamily aFamily, - const Vrml_FontStyleStyle aStyle) + const Vrml_FontStyleStyle aStyle) : mySize(aSize), myFamily(aFamily), myStyle(aStyle) { - mySize = aSize; - myFamily = aFamily; - myStyle = aStyle; + + + } void Vrml_FontStyle::SetSize(const Standard_Real aSize) diff --git a/src/Vrml/Vrml_Group.cxx b/src/Vrml/Vrml_Group.cxx index f8425cc2db..fb5890c0fc 100644 --- a/src/Vrml/Vrml_Group.cxx +++ b/src/Vrml/Vrml_Group.cxx @@ -14,9 +14,9 @@ #include -Vrml_Group::Vrml_Group() +Vrml_Group::Vrml_Group() : myFlagPrint(0) { - myFlagPrint = 0; + } Standard_OStream& Vrml_Group::Print(Standard_OStream& anOStream) diff --git a/src/Vrml/Vrml_IndexedFaceSet.cxx b/src/Vrml/Vrml_IndexedFaceSet.cxx index a096fa2a70..d2273370b1 100644 --- a/src/Vrml/Vrml_IndexedFaceSet.cxx +++ b/src/Vrml/Vrml_IndexedFaceSet.cxx @@ -20,12 +20,12 @@ IMPLEMENT_STANDARD_RTTIEXT(Vrml_IndexedFaceSet,Standard_Transient) Vrml_IndexedFaceSet::Vrml_IndexedFaceSet(const Handle(TColStd_HArray1OfInteger)& aCoordIndex, const Handle(TColStd_HArray1OfInteger)& aMaterialIndex, const Handle(TColStd_HArray1OfInteger)& aNormalIndex, - const Handle(TColStd_HArray1OfInteger)& aTextureCoordIndex) + const Handle(TColStd_HArray1OfInteger)& aTextureCoordIndex) : myCoordIndex(aCoordIndex), myMaterialIndex(aMaterialIndex), myNormalIndex(aNormalIndex), myTextureCoordIndex(aTextureCoordIndex) { - myCoordIndex = aCoordIndex; - myMaterialIndex = aMaterialIndex; - myNormalIndex = aNormalIndex; - myTextureCoordIndex = aTextureCoordIndex; + + + + } Vrml_IndexedFaceSet::Vrml_IndexedFaceSet() @@ -79,7 +79,7 @@ Handle(TColStd_HArray1OfInteger) Vrml_IndexedFaceSet::TextureCoordIndex() const Standard_OStream& Vrml_IndexedFaceSet::Print(Standard_OStream& anOStream) const { - Standard_Integer i; + Standard_Integer i = 0; anOStream << "IndexedFaceSet {\n"; if ( myCoordIndex->Length() != 1 || myCoordIndex->Value(myCoordIndex->Lower())!=0 ) diff --git a/src/Vrml/Vrml_IndexedLineSet.cxx b/src/Vrml/Vrml_IndexedLineSet.cxx index 4a0dbb1927..91d94cb7b6 100644 --- a/src/Vrml/Vrml_IndexedLineSet.cxx +++ b/src/Vrml/Vrml_IndexedLineSet.cxx @@ -20,12 +20,12 @@ IMPLEMENT_STANDARD_RTTIEXT(Vrml_IndexedLineSet,Standard_Transient) Vrml_IndexedLineSet::Vrml_IndexedLineSet(const Handle(TColStd_HArray1OfInteger)& aCoordIndex, const Handle(TColStd_HArray1OfInteger)& aMaterialIndex, const Handle(TColStd_HArray1OfInteger)& aNormalIndex, - const Handle(TColStd_HArray1OfInteger)& aTextureCoordIndex) + const Handle(TColStd_HArray1OfInteger)& aTextureCoordIndex) : myCoordIndex(aCoordIndex), myMaterialIndex(aMaterialIndex), myNormalIndex(aNormalIndex), myTextureCoordIndex(aTextureCoordIndex) { - myCoordIndex = aCoordIndex; - myMaterialIndex = aMaterialIndex; - myNormalIndex = aNormalIndex; - myTextureCoordIndex = aTextureCoordIndex; + + + + } Vrml_IndexedLineSet::Vrml_IndexedLineSet() @@ -78,7 +78,7 @@ Handle(TColStd_HArray1OfInteger) Vrml_IndexedLineSet::TextureCoordIndex() const Standard_OStream& Vrml_IndexedLineSet::Print(Standard_OStream& anOStream) const { - Standard_Integer i; + Standard_Integer i = 0; anOStream << "IndexedLineSet {" << '\n'; diff --git a/src/Vrml/Vrml_Info.cxx b/src/Vrml/Vrml_Info.cxx index 34f3ea2b1f..b1b6d6f88a 100644 --- a/src/Vrml/Vrml_Info.cxx +++ b/src/Vrml/Vrml_Info.cxx @@ -14,9 +14,9 @@ #include -Vrml_Info::Vrml_Info(const TCollection_AsciiString& aString) +Vrml_Info::Vrml_Info(const TCollection_AsciiString& aString) : myString(aString) { - myString = aString; + } void Vrml_Info::SetString(const TCollection_AsciiString& aString) diff --git a/src/Vrml/Vrml_LOD.cxx b/src/Vrml/Vrml_LOD.cxx index 5ce1b311e0..fe760bc982 100644 --- a/src/Vrml/Vrml_LOD.cxx +++ b/src/Vrml/Vrml_LOD.cxx @@ -18,20 +18,20 @@ IMPLEMENT_STANDARD_RTTIEXT(Vrml_LOD,Standard_Transient) -Vrml_LOD::Vrml_LOD() +Vrml_LOD::Vrml_LOD() : myRange(new TColStd_HArray1OfReal(1,1)), myRangeFlag(Standard_False) { - myRange = new TColStd_HArray1OfReal(1,1); + gp_Vec tmpVec(0,0,0); myCenter = tmpVec; - myRangeFlag = Standard_False; + } Vrml_LOD::Vrml_LOD(const Handle(TColStd_HArray1OfReal)& aRange, - const gp_Vec& aCenter) + const gp_Vec& aCenter) : myRange(aRange), myCenter(aCenter), myRangeFlag(Standard_True) { - myRange = aRange; - myCenter = aCenter; - myRangeFlag = Standard_True; + + + } void Vrml_LOD::SetRange(const Handle(TColStd_HArray1OfReal)& aRange) @@ -57,7 +57,7 @@ Vrml_LOD::Vrml_LOD(const Handle(TColStd_HArray1OfReal)& aRange, Standard_OStream& Vrml_LOD::Print(Standard_OStream& anOStream) const { - Standard_Integer i; + Standard_Integer i = 0; anOStream << "LOD {\n"; if ( myRangeFlag == Standard_True ) diff --git a/src/Vrml/Vrml_Material.cxx b/src/Vrml/Vrml_Material.cxx index 3ca8b27e0d..f2fdf59ff8 100644 --- a/src/Vrml/Vrml_Material.cxx +++ b/src/Vrml/Vrml_Material.cxx @@ -22,14 +22,14 @@ Vrml_Material::Vrml_Material(const Handle(Quantity_HArray1OfColor)& aAmbientColo const Handle(Quantity_HArray1OfColor)& aSpecularColor, const Handle(Quantity_HArray1OfColor)& aEmissiveColor, const Handle(TColStd_HArray1OfReal)& aShininess, - const Handle(TColStd_HArray1OfReal)& aTransparency) + const Handle(TColStd_HArray1OfReal)& aTransparency) : myAmbientColor(aAmbientColor), myDiffuseColor(aDiffuseColor), mySpecularColor(aSpecularColor), myEmissiveColor(aEmissiveColor) { - myAmbientColor = aAmbientColor; - myDiffuseColor = aDiffuseColor; - mySpecularColor = aSpecularColor; - myEmissiveColor = aEmissiveColor; + + + + - Standard_Integer i; + Standard_Integer i = 0; for ( i = aShininess->Lower(); i <= aShininess->Upper(); i++ ) { if (aShininess->Value(i) < 0. || aShininess->Value(i) > 1.) @@ -102,7 +102,7 @@ Handle(Quantity_HArray1OfColor) Vrml_Material::EmissiveColor() const void Vrml_Material::SetShininess(const Handle(TColStd_HArray1OfReal)& aShininess) { - Standard_Integer i; + Standard_Integer i = 0; for ( i = aShininess->Lower(); i <= aShininess->Upper(); i++ ) { if (aShininess->Value(i) < 0. || aShininess->Value(i) > 1.) @@ -120,7 +120,7 @@ Handle(TColStd_HArray1OfReal) Vrml_Material::Shininess() const void Vrml_Material::SetTransparency(const Handle(TColStd_HArray1OfReal)& aTransparency) { - Standard_Integer i; + Standard_Integer i = 0; for ( i = aTransparency->Lower(); i <= aTransparency->Upper(); i++ ) { if (aTransparency->Value(i) < 0. || aTransparency->Value(i) > 1.) @@ -139,7 +139,7 @@ Handle(TColStd_HArray1OfReal) Vrml_Material::Transparency() const Standard_OStream& Vrml_Material::Print(Standard_OStream& anOStream) const { NCollection_Vec3 aColor_sRGB; - Standard_Integer i; + Standard_Integer i = 0; anOStream << "Material {\n"; if ( myAmbientColor->Length() != 1 || diff --git a/src/Vrml/Vrml_MaterialBinding.cxx b/src/Vrml/Vrml_MaterialBinding.cxx index 8a3f471fb5..7804855d85 100644 --- a/src/Vrml/Vrml_MaterialBinding.cxx +++ b/src/Vrml/Vrml_MaterialBinding.cxx @@ -14,14 +14,14 @@ #include -Vrml_MaterialBinding::Vrml_MaterialBinding(const Vrml_MaterialBindingAndNormalBinding aValue) +Vrml_MaterialBinding::Vrml_MaterialBinding(const Vrml_MaterialBindingAndNormalBinding aValue) : myValue(aValue) { - myValue = aValue; + } - Vrml_MaterialBinding::Vrml_MaterialBinding() + Vrml_MaterialBinding::Vrml_MaterialBinding() : myValue(Vrml_DEFAULT) { - myValue = Vrml_DEFAULT; + } void Vrml_MaterialBinding::SetValue(const Vrml_MaterialBindingAndNormalBinding aValue) diff --git a/src/Vrml/Vrml_MatrixTransform.cxx b/src/Vrml/Vrml_MatrixTransform.cxx index 4fcc63aba7..4f57848629 100644 --- a/src/Vrml/Vrml_MatrixTransform.cxx +++ b/src/Vrml/Vrml_MatrixTransform.cxx @@ -33,9 +33,9 @@ Vrml_MatrixTransform::Vrml_MatrixTransform() myMatrix = T; } - Vrml_MatrixTransform::Vrml_MatrixTransform(const gp_Trsf& aMatrix) + Vrml_MatrixTransform::Vrml_MatrixTransform(const gp_Trsf& aMatrix) : myMatrix(aMatrix) { - myMatrix = aMatrix; + } void Vrml_MatrixTransform::SetMatrix(const gp_Trsf& aMatrix) @@ -50,7 +50,7 @@ Vrml_MatrixTransform::Vrml_MatrixTransform() Standard_OStream& Vrml_MatrixTransform::Print(Standard_OStream& anOStream) const { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; anOStream << "MatrixTransform {\n"; if ( Abs(myMatrix.Value(1,1) - 1) > 0.0000001 || Abs(myMatrix.Value(2,1) - 0) > 0.0000001 || Abs(myMatrix.Value(3,1) - 0) > 0.0000001 || diff --git a/src/Vrml/Vrml_Normal.cxx b/src/Vrml/Vrml_Normal.cxx index 0f52a54fca..30d559899c 100644 --- a/src/Vrml/Vrml_Normal.cxx +++ b/src/Vrml/Vrml_Normal.cxx @@ -17,15 +17,15 @@ IMPLEMENT_STANDARD_RTTIEXT(Vrml_Normal,Standard_Transient) -Vrml_Normal::Vrml_Normal(const Handle(TColgp_HArray1OfVec)& aVector) +Vrml_Normal::Vrml_Normal(const Handle(TColgp_HArray1OfVec)& aVector) : myVector(aVector) { - myVector = aVector; + } - Vrml_Normal::Vrml_Normal() + Vrml_Normal::Vrml_Normal() : myVector(new TColgp_HArray1OfVec (1,1)) { gp_Vec Tmp_Vec; - myVector = new TColgp_HArray1OfVec (1,1); + Tmp_Vec.SetX(0); Tmp_Vec.SetY(0); Tmp_Vec.SetZ(1); myVector->SetValue(1,Tmp_Vec); @@ -43,7 +43,7 @@ Handle(TColgp_HArray1OfVec) Vrml_Normal::Vector() const Standard_OStream& Vrml_Normal::Print(Standard_OStream& anOStream) const { - Standard_Integer i; + Standard_Integer i = 0; anOStream << "Normal {\n"; i = myVector->Lower(); diff --git a/src/Vrml/Vrml_NormalBinding.cxx b/src/Vrml/Vrml_NormalBinding.cxx index 2f3620f6a2..68394c4c79 100644 --- a/src/Vrml/Vrml_NormalBinding.cxx +++ b/src/Vrml/Vrml_NormalBinding.cxx @@ -14,14 +14,14 @@ #include -Vrml_NormalBinding::Vrml_NormalBinding(const Vrml_MaterialBindingAndNormalBinding aValue) +Vrml_NormalBinding::Vrml_NormalBinding(const Vrml_MaterialBindingAndNormalBinding aValue) : myValue(aValue) { - myValue = aValue; + } - Vrml_NormalBinding::Vrml_NormalBinding() + Vrml_NormalBinding::Vrml_NormalBinding() : myValue(Vrml_DEFAULT) { - myValue = Vrml_DEFAULT; + } void Vrml_NormalBinding::SetValue(const Vrml_MaterialBindingAndNormalBinding aValue) diff --git a/src/Vrml/Vrml_OrthographicCamera.cxx b/src/Vrml/Vrml_OrthographicCamera.cxx index ae2352c997..a91ddcfe30 100644 --- a/src/Vrml/Vrml_OrthographicCamera.cxx +++ b/src/Vrml/Vrml_OrthographicCamera.cxx @@ -30,12 +30,12 @@ Vrml_OrthographicCamera::Vrml_OrthographicCamera(): Vrml_OrthographicCamera::Vrml_OrthographicCamera( const gp_Vec& aPosition, const Vrml_SFRotation& aOrientation, const Standard_Real aFocalDistance, - const Standard_Real aHeight) + const Standard_Real aHeight) : myPosition(aPosition), myOrientation(aOrientation), myFocalDistance(aFocalDistance), myHeight(aHeight) { - myPosition = aPosition; - myOrientation = aOrientation; - myFocalDistance = aFocalDistance; - myHeight = aHeight; + + + + } void Vrml_OrthographicCamera::SetPosition(const gp_Vec& aPosition) diff --git a/src/Vrml/Vrml_PerspectiveCamera.cxx b/src/Vrml/Vrml_PerspectiveCamera.cxx index b8b82d1453..2c8ff3b08d 100644 --- a/src/Vrml/Vrml_PerspectiveCamera.cxx +++ b/src/Vrml/Vrml_PerspectiveCamera.cxx @@ -30,12 +30,12 @@ Vrml_PerspectiveCamera::Vrml_PerspectiveCamera(): Vrml_PerspectiveCamera::Vrml_PerspectiveCamera( const gp_Vec& aPosition, const Vrml_SFRotation& aOrientation, const Standard_Real aFocalDistance, - const Standard_Real aHeightAngle) + const Standard_Real aHeightAngle) : myPosition(aPosition), myOrientation(aOrientation), myFocalDistance(aFocalDistance), myHeightAngle(aHeightAngle) { - myPosition = aPosition; - myOrientation = aOrientation; - myFocalDistance = aFocalDistance; - myHeightAngle = aHeightAngle; + + + + } void Vrml_PerspectiveCamera::SetPosition(const gp_Vec& aPosition) diff --git a/src/Vrml/Vrml_PointSet.cxx b/src/Vrml/Vrml_PointSet.cxx index cc8cab9022..7af78a9788 100644 --- a/src/Vrml/Vrml_PointSet.cxx +++ b/src/Vrml/Vrml_PointSet.cxx @@ -15,10 +15,10 @@ #include Vrml_PointSet::Vrml_PointSet(const Standard_Integer aStartIndex, - const Standard_Integer aNumPoints) + const Standard_Integer aNumPoints) : myStartIndex(aStartIndex), myNumPoints(aNumPoints) { - myStartIndex = aStartIndex; - myNumPoints = aNumPoints; + + } void Vrml_PointSet::SetStartIndex(const Standard_Integer aStartIndex) diff --git a/src/Vrml/Vrml_Rotation.cxx b/src/Vrml/Vrml_Rotation.cxx index c6d205d677..4a3b8cc647 100644 --- a/src/Vrml/Vrml_Rotation.cxx +++ b/src/Vrml/Vrml_Rotation.cxx @@ -21,9 +21,9 @@ Vrml_Rotation::Vrml_Rotation() myRotation = tmpR; } -Vrml_Rotation::Vrml_Rotation(const Vrml_SFRotation& aRotation) +Vrml_Rotation::Vrml_Rotation(const Vrml_SFRotation& aRotation) : myRotation(aRotation) { - myRotation = aRotation; + } void Vrml_Rotation::SetRotation(const Vrml_SFRotation& aRotation) diff --git a/src/Vrml/Vrml_SFImage.cxx b/src/Vrml/Vrml_SFImage.cxx index 30e0432ae4..813d6a24fa 100644 --- a/src/Vrml/Vrml_SFImage.cxx +++ b/src/Vrml/Vrml_SFImage.cxx @@ -17,10 +17,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Vrml_SFImage,Standard_Transient) -Vrml_SFImage::Vrml_SFImage() +Vrml_SFImage::Vrml_SFImage() : myArray(new TColStd_HArray1OfInteger(1,1)), myArrayFlag(Standard_False) { - myArray = new TColStd_HArray1OfInteger(1,1); - myArrayFlag = Standard_False; + + } Vrml_SFImage::Vrml_SFImage(const Standard_Integer aWidth, const Standard_Integer aHeight, diff --git a/src/Vrml/Vrml_SFImage.hxx b/src/Vrml/Vrml_SFImage.hxx index 604e2a9ae4..9ad7605d4b 100644 --- a/src/Vrml/Vrml_SFImage.hxx +++ b/src/Vrml/Vrml_SFImage.hxx @@ -71,8 +71,8 @@ protected: private: - Standard_Integer myWidth; - Standard_Integer myHeight; + Standard_Integer myWidth{}; + Standard_Integer myHeight{}; Vrml_SFImageNumber myNumber; Handle(TColStd_HArray1OfInteger) myArray; Standard_Boolean myArrayFlag; diff --git a/src/Vrml/Vrml_SFRotation.cxx b/src/Vrml/Vrml_SFRotation.cxx index 9d68e02fe0..610b691891 100644 --- a/src/Vrml/Vrml_SFRotation.cxx +++ b/src/Vrml/Vrml_SFRotation.cxx @@ -21,12 +21,12 @@ Vrml_SFRotation::Vrml_SFRotation() Vrml_SFRotation::Vrml_SFRotation( const Standard_Real aRotationX, const Standard_Real aRotationY, const Standard_Real aRotationZ, - const Standard_Real anAngle ) + const Standard_Real anAngle ) : myRotationX(aRotationX), myRotationY(aRotationY), myRotationZ(aRotationZ), myAngle(anAngle) { - myRotationX = aRotationX; - myRotationY = aRotationY; - myRotationZ = aRotationZ; - myAngle = anAngle; + + + + } void Vrml_SFRotation::SetRotationX(const Standard_Real aRotationX) diff --git a/src/Vrml/Vrml_SFRotation.hxx b/src/Vrml/Vrml_SFRotation.hxx index 5a2c309f42..7bf4214cf7 100644 --- a/src/Vrml/Vrml_SFRotation.hxx +++ b/src/Vrml/Vrml_SFRotation.hxx @@ -67,10 +67,10 @@ private: - Standard_Real myRotationX; - Standard_Real myRotationY; - Standard_Real myRotationZ; - Standard_Real myAngle; + Standard_Real myRotationX{}; + Standard_Real myRotationY{}; + Standard_Real myRotationZ{}; + Standard_Real myAngle{}; }; diff --git a/src/Vrml/Vrml_Scale.cxx b/src/Vrml/Vrml_Scale.cxx index bc1a495085..ba0940b028 100644 --- a/src/Vrml/Vrml_Scale.cxx +++ b/src/Vrml/Vrml_Scale.cxx @@ -20,9 +20,9 @@ Vrml_Scale::Vrml_Scale() myScaleFactor = tmpV; } -Vrml_Scale::Vrml_Scale(const gp_Vec& aScaleFactor) +Vrml_Scale::Vrml_Scale(const gp_Vec& aScaleFactor) : myScaleFactor(aScaleFactor) { - myScaleFactor = aScaleFactor; + } void Vrml_Scale::SetScaleFactor(const gp_Vec& aScaleFactor) diff --git a/src/Vrml/Vrml_Separator.cxx b/src/Vrml/Vrml_Separator.cxx index 026d21159c..e92d068466 100644 --- a/src/Vrml/Vrml_Separator.cxx +++ b/src/Vrml/Vrml_Separator.cxx @@ -14,16 +14,16 @@ #include -Vrml_Separator::Vrml_Separator(const Vrml_SeparatorRenderCulling aRenderCulling) +Vrml_Separator::Vrml_Separator(const Vrml_SeparatorRenderCulling aRenderCulling) : myRenderCulling(aRenderCulling), myFlagPrint(0) { - myRenderCulling = aRenderCulling; - myFlagPrint = 0; + + } - Vrml_Separator::Vrml_Separator() + Vrml_Separator::Vrml_Separator() : myRenderCulling(Vrml_AUTO), myFlagPrint(0) { - myRenderCulling = Vrml_AUTO; - myFlagPrint = 0; + + } void Vrml_Separator::SetRenderCulling(const Vrml_SeparatorRenderCulling aRenderCulling) diff --git a/src/Vrml/Vrml_ShapeHints.cxx b/src/Vrml/Vrml_ShapeHints.cxx index 66db06d71e..3868564797 100644 --- a/src/Vrml/Vrml_ShapeHints.cxx +++ b/src/Vrml/Vrml_ShapeHints.cxx @@ -17,12 +17,12 @@ Vrml_ShapeHints::Vrml_ShapeHints(const Vrml_VertexOrdering aVertexOrdering, const Vrml_ShapeType aShapeType, const Vrml_FaceType aFaceType, - const Standard_Real aAngle) + const Standard_Real aAngle) : myVertexOrdering(aVertexOrdering), myShapeType(aShapeType), myFaceType(aFaceType), myAngle(aAngle) { - myVertexOrdering = aVertexOrdering; - myShapeType = aShapeType; - myFaceType = aFaceType; - myAngle = aAngle; + + + + } void Vrml_ShapeHints::SetVertexOrdering(const Vrml_VertexOrdering aVertexOrdering) diff --git a/src/Vrml/Vrml_Sphere.cxx b/src/Vrml/Vrml_Sphere.cxx index d73f4bc7b4..37077ed328 100644 --- a/src/Vrml/Vrml_Sphere.cxx +++ b/src/Vrml/Vrml_Sphere.cxx @@ -14,9 +14,9 @@ #include -Vrml_Sphere::Vrml_Sphere(const Standard_Real aRadius) +Vrml_Sphere::Vrml_Sphere(const Standard_Real aRadius) : myRadius(aRadius) { - myRadius = aRadius; + } void Vrml_Sphere::SetRadius(const Standard_Real aRadius) diff --git a/src/Vrml/Vrml_SpotLight.cxx b/src/Vrml/Vrml_SpotLight.cxx index 31b9b24240..c69ceefa6d 100644 --- a/src/Vrml/Vrml_SpotLight.cxx +++ b/src/Vrml/Vrml_SpotLight.cxx @@ -32,9 +32,9 @@ Vrml_SpotLight::Vrml_SpotLight(): const gp_Vec& aLocation, const gp_Vec& aDirection, const Standard_Real aDropOffRate, - const Standard_Real aCutOffAngle) + const Standard_Real aCutOffAngle) : myOnOff(aOnOff) { - myOnOff = aOnOff; + if (aIntensity < 0. || aIntensity > 1.) { throw Standard_Failure("Error : Light intensity must be in the range 0.0 to 1.0, inclusive."); diff --git a/src/Vrml/Vrml_Switch.cxx b/src/Vrml/Vrml_Switch.cxx index 11efaea6eb..40feca5b72 100644 --- a/src/Vrml/Vrml_Switch.cxx +++ b/src/Vrml/Vrml_Switch.cxx @@ -14,9 +14,9 @@ #include -Vrml_Switch::Vrml_Switch(const Standard_Integer aWhichChild) +Vrml_Switch::Vrml_Switch(const Standard_Integer aWhichChild) : myWhichChild(aWhichChild) { - myWhichChild = aWhichChild; + } void Vrml_Switch::SetWhichChild(const Standard_Integer aWhichChild) diff --git a/src/Vrml/Vrml_Texture2.cxx b/src/Vrml/Vrml_Texture2.cxx index 6f12d260e0..cb746e73cb 100644 --- a/src/Vrml/Vrml_Texture2.cxx +++ b/src/Vrml/Vrml_Texture2.cxx @@ -17,29 +17,29 @@ #include #include -Vrml_Texture2::Vrml_Texture2() +Vrml_Texture2::Vrml_Texture2() : myFilename(""), myImage(new Vrml_SFImage), myWrapS(Vrml_REPEAT), myWrapT(Vrml_REPEAT) { - myFilename = ""; + - myImage = new Vrml_SFImage; + myImage->SetWidth(0); myImage->SetHeight(0); myImage->SetNumber(Vrml_NULL); - myWrapS = Vrml_REPEAT; - myWrapT = Vrml_REPEAT; + + } Vrml_Texture2::Vrml_Texture2(const TCollection_AsciiString& aFilename, const Handle(Vrml_SFImage)& aImage, const Vrml_Texture2Wrap aWrapS, - const Vrml_Texture2Wrap aWrapT) + const Vrml_Texture2Wrap aWrapT) : myFilename(aFilename), myImage(aImage), myWrapS(aWrapS), myWrapT(aWrapT) { - myFilename = aFilename; - myImage = aImage; - myWrapS = aWrapS; - myWrapT = aWrapT; + + + + } void Vrml_Texture2::SetFilename(const TCollection_AsciiString& aFilename) @@ -84,7 +84,7 @@ Vrml_Texture2::Vrml_Texture2(const TCollection_AsciiString& aFilename, Standard_OStream& Vrml_Texture2::Print(Standard_OStream& anOStream) const { - Standard_Integer i; + Standard_Integer i = 0; anOStream << "Texture2 {\n"; if ( !(myFilename.IsEqual("") ) ) diff --git a/src/Vrml/Vrml_Texture2Transform.cxx b/src/Vrml/Vrml_Texture2Transform.cxx index 95f72f4fe8..8537debe96 100644 --- a/src/Vrml/Vrml_Texture2Transform.cxx +++ b/src/Vrml/Vrml_Texture2Transform.cxx @@ -14,13 +14,13 @@ #include -Vrml_Texture2Transform::Vrml_Texture2Transform() +Vrml_Texture2Transform::Vrml_Texture2Transform() : myRotation(0) { gp_Vec2d tmpVec(0,0); myTranslation = tmpVec; myCenter = tmpVec; - myRotation = 0; + tmpVec.SetCoord(1,1); myScaleFactor = tmpVec; @@ -29,12 +29,12 @@ Vrml_Texture2Transform::Vrml_Texture2Transform() Vrml_Texture2Transform::Vrml_Texture2Transform(const gp_Vec2d& aTranslation, const Standard_Real aRotation, const gp_Vec2d& aScaleFactor, - const gp_Vec2d& aCenter) + const gp_Vec2d& aCenter) : myTranslation(aTranslation), myRotation(aRotation), myScaleFactor(aScaleFactor), myCenter(aCenter) { - myTranslation = aTranslation; - myRotation = aRotation; - myScaleFactor = aScaleFactor; - myCenter = aCenter; + + + + } void Vrml_Texture2Transform::SetTranslation(const gp_Vec2d& aTranslation) diff --git a/src/Vrml/Vrml_TextureCoordinate2.cxx b/src/Vrml/Vrml_TextureCoordinate2.cxx index 58d5c8eec3..0bfdb7ac5f 100644 --- a/src/Vrml/Vrml_TextureCoordinate2.cxx +++ b/src/Vrml/Vrml_TextureCoordinate2.cxx @@ -23,9 +23,9 @@ Vrml_TextureCoordinate2::Vrml_TextureCoordinate2() myPoint = new TColgp_HArray1OfVec2d(1,1,tmpVec); } -Vrml_TextureCoordinate2::Vrml_TextureCoordinate2(const Handle(TColgp_HArray1OfVec2d)& aPoint) +Vrml_TextureCoordinate2::Vrml_TextureCoordinate2(const Handle(TColgp_HArray1OfVec2d)& aPoint) : myPoint(aPoint) { - myPoint = aPoint; + } void Vrml_TextureCoordinate2::SetPoint(const Handle(TColgp_HArray1OfVec2d)& aPoint) @@ -40,7 +40,7 @@ Vrml_TextureCoordinate2::Vrml_TextureCoordinate2(const Handle(TColgp_HArray1OfVe Standard_OStream& Vrml_TextureCoordinate2::Print(Standard_OStream& anOStream) const { - Standard_Integer i; + Standard_Integer i = 0; anOStream << "TextureCoordinate2 {\n"; if ( myPoint->Length() != 1 || Abs(myPoint->Value(myPoint->Lower()).X() - 0) > 0.0001 || diff --git a/src/Vrml/Vrml_Transform.cxx b/src/Vrml/Vrml_Transform.cxx index 17228cbbc4..5ad28742af 100644 --- a/src/Vrml/Vrml_Transform.cxx +++ b/src/Vrml/Vrml_Transform.cxx @@ -43,13 +43,13 @@ Vrml_Transform::Vrml_Transform(const gp_Vec& aTranslation, const Vrml_SFRotation& aRotation, const gp_Vec& aScaleFactor, const Vrml_SFRotation& aScaleOrientation, - const gp_Vec& aCenter) + const gp_Vec& aCenter) : myTranslation(aTranslation), myRotation(aRotation), myScaleFactor(aScaleFactor), myScaleOrientation(aScaleOrientation), myCenter(aCenter) { - myTranslation = aTranslation; - myRotation = aRotation; - myScaleFactor = aScaleFactor; - myScaleOrientation = aScaleOrientation; - myCenter = aCenter; + + + + + } void Vrml_Transform::SetTranslation(const gp_Vec& aTranslation) diff --git a/src/Vrml/Vrml_TransformSeparator.cxx b/src/Vrml/Vrml_TransformSeparator.cxx index 794b8bf0ae..47d359378c 100644 --- a/src/Vrml/Vrml_TransformSeparator.cxx +++ b/src/Vrml/Vrml_TransformSeparator.cxx @@ -14,9 +14,9 @@ #include -Vrml_TransformSeparator::Vrml_TransformSeparator() +Vrml_TransformSeparator::Vrml_TransformSeparator() : myFlagPrint(0) { - myFlagPrint = 0; + } Standard_OStream& Vrml_TransformSeparator::Print(Standard_OStream& anOStream) diff --git a/src/Vrml/Vrml_Translation.cxx b/src/Vrml/Vrml_Translation.cxx index cd827353b0..49934aa193 100644 --- a/src/Vrml/Vrml_Translation.cxx +++ b/src/Vrml/Vrml_Translation.cxx @@ -20,9 +20,9 @@ Vrml_Translation::Vrml_Translation() myTranslation = tmpV; } -Vrml_Translation::Vrml_Translation(const gp_Vec& aTranslation) +Vrml_Translation::Vrml_Translation(const gp_Vec& aTranslation) : myTranslation(aTranslation) { - myTranslation = aTranslation; + } void Vrml_Translation::SetTranslation(const gp_Vec& aTranslation) diff --git a/src/Vrml/Vrml_WWWAnchor.cxx b/src/Vrml/Vrml_WWWAnchor.cxx index cb02879477..b760bfbb03 100644 --- a/src/Vrml/Vrml_WWWAnchor.cxx +++ b/src/Vrml/Vrml_WWWAnchor.cxx @@ -16,11 +16,11 @@ Vrml_WWWAnchor::Vrml_WWWAnchor(const TCollection_AsciiString& aName, const TCollection_AsciiString& aDescription, - const Vrml_WWWAnchorMap aMap) + const Vrml_WWWAnchorMap aMap) : myName(aName), myDescription(aDescription), myMap(aMap) { - myName = aName; - myDescription = aDescription; - myMap = aMap; + + + } void Vrml_WWWAnchor::SetName(const TCollection_AsciiString& aName) diff --git a/src/Vrml/Vrml_WWWInline.cxx b/src/Vrml/Vrml_WWWInline.cxx index 294223dc45..662f3ed8e6 100644 --- a/src/Vrml/Vrml_WWWInline.cxx +++ b/src/Vrml/Vrml_WWWInline.cxx @@ -15,9 +15,9 @@ #include #include -Vrml_WWWInline::Vrml_WWWInline() +Vrml_WWWInline::Vrml_WWWInline() : myName("") { - myName = ""; + gp_Vec tmpVec(0,0,0); myBboxSize = tmpVec; myBboxCenter = tmpVec; @@ -25,11 +25,11 @@ Vrml_WWWInline::Vrml_WWWInline() Vrml_WWWInline::Vrml_WWWInline(const TCollection_AsciiString& aName, const gp_Vec& aBboxSize, - const gp_Vec& aBboxCenter) + const gp_Vec& aBboxCenter) : myName(aName), myBboxSize(aBboxSize), myBboxCenter(aBboxCenter) { - myName = aName; - myBboxSize = aBboxSize; - myBboxCenter = aBboxCenter; + + + } void Vrml_WWWInline::SetName(const TCollection_AsciiString& aName) diff --git a/src/VrmlAPI/VrmlAPI_Writer.cxx b/src/VrmlAPI/VrmlAPI_Writer.cxx index 70cc2ef969..32888d6943 100644 --- a/src/VrmlAPI/VrmlAPI_Writer.cxx +++ b/src/VrmlAPI/VrmlAPI_Writer.cxx @@ -40,10 +40,10 @@ #include #include -VrmlAPI_Writer::VrmlAPI_Writer() +VrmlAPI_Writer::VrmlAPI_Writer() : myDrawer(new VrmlConverter_Drawer), myDeflection(-1), DX(1), DY(-1), DZ(1), XUp(0), YUp(0), ZUp(1), Focus(6) { - myDrawer = new VrmlConverter_Drawer; - myDeflection = -1; + + Handle(Quantity_HArray1OfColor) Col1 = new Quantity_HArray1OfColor (1, 1, Quantity_NOC_BLACK); Handle(TColStd_HArray1OfReal) kik1 = new TColStd_HArray1OfReal(1,1,0.0); Handle(TColStd_HArray1OfReal) kik2 = new TColStd_HArray1OfReal(1,1,0.1); @@ -55,13 +55,13 @@ VrmlAPI_Writer::VrmlAPI_Writer() myWireMaterial = new Vrml_Material(Col1,Col1, Col1, Col1, kik1, kik2); myFreeBoundsMaterial = new Vrml_Material(Col1,Col1, Col1, Col1, kik1, kik2); myUnfreeBoundsMaterial = new Vrml_Material(Col1,Col1, Col1, Col1, kik1, kik2); - DX = 1; - DY = -1; - DZ = 1; - XUp = 0; - YUp = 0; - ZUp = 1; - Focus = 6; + + + + + + + ResetToDefaults(); } diff --git a/src/VrmlAPI/VrmlAPI_Writer.hxx b/src/VrmlAPI/VrmlAPI_Writer.hxx index 5fb66fcbc7..8fcaa8df69 100644 --- a/src/VrmlAPI/VrmlAPI_Writer.hxx +++ b/src/VrmlAPI/VrmlAPI_Writer.hxx @@ -130,8 +130,8 @@ private: Standard_Real myDeflection; Handle(VrmlConverter_Projector) myPerespectiveCamera; Handle(VrmlConverter_Projector) myOrthographicCamera; - Standard_Real myTransparency; - Standard_Real myShininess; + Standard_Real myTransparency{}; + Standard_Real myShininess{}; Handle(Vrml_Material) myFrontMaterial; Handle(Vrml_Material) myPointsMaterial; Handle(Vrml_Material) myUisoMaterial; diff --git a/src/VrmlConverter/VrmlConverter_Curve.cxx b/src/VrmlConverter/VrmlConverter_Curve.cxx index 5c1f63c978..65b317c31a 100644 --- a/src/VrmlConverter/VrmlConverter_Curve.cxx +++ b/src/VrmlConverter/VrmlConverter_Curve.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -81,7 +83,7 @@ static void DrawCurve (const Adaptor3d_Curve& aCurve, const Handle(VrmlConverter_Drawer)& aDrawer, // for passsing of LineAspect Standard_OStream& anOStream) { - Standard_Integer nbintervals = 1, i; + Standard_Integer nbintervals = 1, i = 0; Handle(TColgp_HArray1OfVec) HAV1; Handle(TColStd_HArray1OfInteger) HAI1; @@ -117,7 +119,7 @@ static void DrawCurve (const Adaptor3d_Curve& aCurve, default: { - Standard_Real U; + Standard_Real U = NAN; Standard_Integer N = Max(2, NbP*nbintervals); // std::cout << "nbintervals " << nbintervals << std::endl; @@ -208,7 +210,7 @@ void VrmlConverter_Curve::Add(const Adaptor3d_Curve& aCurve, Standard_Integer NbPoints = aDrawer->Discretisation(); - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; Standard_Real aLimit = aDrawer->MaximalParameterValue(); FindLimits(aCurve, aLimit, V1, V2); diff --git a/src/VrmlConverter/VrmlConverter_DeflectionCurve.cxx b/src/VrmlConverter/VrmlConverter_DeflectionCurve.cxx index 6664391d78..ecf48e2c79 100644 --- a/src/VrmlConverter/VrmlConverter_DeflectionCurve.cxx +++ b/src/VrmlConverter/VrmlConverter_DeflectionCurve.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -120,7 +122,7 @@ static void DrawCurve (Adaptor3d_Curve& aCurve, const Handle(VrmlConverter_Drawer)& aDrawer, // for passsing of LineAspect Standard_OStream& anOStream) { - Standard_Integer i; + Standard_Integer i = 0; Standard_Boolean key = Standard_False; Handle(TColgp_HArray1OfVec) HAV1; Handle(TColStd_HArray1OfInteger) HAI1; @@ -164,7 +166,7 @@ static void DrawCurve (Adaptor3d_Curve& aCurve, HAI1 = new TColStd_HArray1OfInteger(1,N+2); DU = (U2-U1) / N; - Standard_Real U; + Standard_Real U = NAN; gp_Pnt p; for (Standard_Integer Index = 1; Index <= N+1; Index++) { @@ -243,13 +245,13 @@ static Standard_Real GetDeflection(const Adaptor3d_Curve& aCurve, const Standard_Real U2, const Handle(VrmlConverter_Drawer)& aDrawer) { - Standard_Real theRequestedDeflection; + Standard_Real theRequestedDeflection = NAN; if(aDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE) // TOD_RELATIVE, TOD_ABSOLUTE { Bnd_Box box; BndLib_Add3dCurve::Add(aCurve, U1, U2, Precision::Confusion(), box); - Standard_Real Xmin, Xmax, Ymin, Ymax, Zmin, Zmax, diagonal; + Standard_Real Xmin = NAN, Xmax = NAN, Ymin = NAN, Ymax = NAN, Zmin = NAN, Zmax = NAN, diagonal = NAN; box.Get( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax ); if (!(box.IsOpenXmin() || box.IsOpenXmax() || box.IsOpenYmin() || box.IsOpenYmax() || @@ -282,7 +284,7 @@ void VrmlConverter_DeflectionCurve::Add(Standard_OStream& anOS const Handle(VrmlConverter_Drawer)& aDrawer) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; Standard_Real aLimit = aDrawer->MaximalParameterValue(); FindLimits(aCurve, aLimit, V1, V2); @@ -325,7 +327,7 @@ void VrmlConverter_DeflectionCurve::Add(Standard_OStream& anOStream, const Standard_Real aDeflection, const Standard_Real aLimit) { - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; FindLimits(aCurve, aLimit, V1, V2); Handle(VrmlConverter_Drawer) aDrawer = new VrmlConverter_Drawer; @@ -347,7 +349,7 @@ void VrmlConverter_DeflectionCurve::Add(Standard_OStream& anOS const Handle(VrmlConverter_Drawer)& aDrawer) { Standard_Real aLimit = aDrawer->MaximalParameterValue(); - Standard_Real V1, V2; + Standard_Real V1 = NAN, V2 = NAN; FindLimits(aCurve, aLimit, V1, V2); DrawCurve(aCurve, @@ -388,7 +390,7 @@ void VrmlConverter_DeflectionCurve::Add(Standard_OStream& anOStream, Handle(TColgp_HArray1OfVec) aHAV1 = new TColgp_HArray1OfVec(1, aNbNodes); Handle(TColStd_HArray1OfInteger) aHAI1 = new TColStd_HArray1OfInteger(1, aNbNodes + 1); - Standard_Integer i; + Standard_Integer i = 0; gp_Pnt aPoint; gp_Vec aVec; for (i = 1; i<=aNbNodes; i++) diff --git a/src/VrmlConverter/VrmlConverter_HLRShape.cxx b/src/VrmlConverter/VrmlConverter_HLRShape.cxx index e83290bec9..add3d1d3e9 100644 --- a/src/VrmlConverter/VrmlConverter_HLRShape.cxx +++ b/src/VrmlConverter/VrmlConverter_HLRShape.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -38,17 +40,17 @@ void VrmlConverter_HLRShape::Add(Standard_OStream& anOS StdPrs_HLRToolShape Tool(aShape,aProjector->Projector()); Standard_Integer NbEdge = Tool.NbEdges(); - Standard_Integer i; - Standard_Real U1,U2; + Standard_Integer i = 0; + Standard_Real U1 = NAN,U2 = NAN; BRepAdaptor_Curve TheCurve; - Standard_Real theRequestedDeflection; + Standard_Real theRequestedDeflection = NAN; if(aDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE) // TOD_RELATIVE, TOD_ABSOLUTE { Bnd_Box box; BRepBndLib::AddClose(aShape, box); - Standard_Real Xmin, Xmax, Ymin, Ymax, Zmin, Zmax, diagonal; + Standard_Real Xmin = NAN, Xmax = NAN, Ymin = NAN, Ymax = NAN, Zmin = NAN, Zmax = NAN, diagonal = NAN; box.Get( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax ); if (!(box.IsOpenXmin() || box.IsOpenXmax() || box.IsOpenYmin() || box.IsOpenYmax() || diff --git a/src/VrmlConverter/VrmlConverter_IsoAspect.cxx b/src/VrmlConverter/VrmlConverter_IsoAspect.cxx index a75d34300f..16b7afd233 100644 --- a/src/VrmlConverter/VrmlConverter_IsoAspect.cxx +++ b/src/VrmlConverter/VrmlConverter_IsoAspect.cxx @@ -17,17 +17,17 @@ IMPLEMENT_STANDARD_RTTIEXT(VrmlConverter_IsoAspect,VrmlConverter_LineAspect) -VrmlConverter_IsoAspect::VrmlConverter_IsoAspect():VrmlConverter_LineAspect () +VrmlConverter_IsoAspect::VrmlConverter_IsoAspect():VrmlConverter_LineAspect (), myNumber(10) { - myNumber = 10; + } VrmlConverter_IsoAspect::VrmlConverter_IsoAspect (const Handle(Vrml_Material)& aMaterial, const Standard_Boolean OnOff, const Standard_Integer aNumber) - :VrmlConverter_LineAspect (aMaterial, OnOff) + :VrmlConverter_LineAspect (aMaterial, OnOff), myNumber(aNumber) { - myNumber = aNumber; + } void VrmlConverter_IsoAspect::SetNumber (const Standard_Integer aNumber) diff --git a/src/VrmlConverter/VrmlConverter_LineAspect.cxx b/src/VrmlConverter/VrmlConverter_LineAspect.cxx index 07fb3b3dc4..64ecb2e95a 100644 --- a/src/VrmlConverter/VrmlConverter_LineAspect.cxx +++ b/src/VrmlConverter/VrmlConverter_LineAspect.cxx @@ -17,16 +17,16 @@ IMPLEMENT_STANDARD_RTTIEXT(VrmlConverter_LineAspect,Standard_Transient) -VrmlConverter_LineAspect::VrmlConverter_LineAspect() +VrmlConverter_LineAspect::VrmlConverter_LineAspect() : myHasMaterial(Standard_False) { - myHasMaterial = Standard_False; + } VrmlConverter_LineAspect::VrmlConverter_LineAspect (const Handle(Vrml_Material)& aMaterial, - const Standard_Boolean OnOff) + const Standard_Boolean OnOff) : myMaterial(aMaterial), myHasMaterial(OnOff) { - myMaterial = aMaterial; - myHasMaterial = OnOff; + + } diff --git a/src/VrmlConverter/VrmlConverter_PointAspect.cxx b/src/VrmlConverter/VrmlConverter_PointAspect.cxx index bf85bdddb3..5a09d72f9b 100644 --- a/src/VrmlConverter/VrmlConverter_PointAspect.cxx +++ b/src/VrmlConverter/VrmlConverter_PointAspect.cxx @@ -17,16 +17,16 @@ IMPLEMENT_STANDARD_RTTIEXT(VrmlConverter_PointAspect,Standard_Transient) -VrmlConverter_PointAspect::VrmlConverter_PointAspect() +VrmlConverter_PointAspect::VrmlConverter_PointAspect() : myHasMaterial(Standard_False) { - myHasMaterial = Standard_False; + } VrmlConverter_PointAspect::VrmlConverter_PointAspect (const Handle(Vrml_Material)& aMaterial, - const Standard_Boolean OnOff) + const Standard_Boolean OnOff) : myMaterial(aMaterial), myHasMaterial(OnOff) { - myMaterial = aMaterial; - myHasMaterial = OnOff; + + } diff --git a/src/VrmlConverter/VrmlConverter_Projector.cxx b/src/VrmlConverter/VrmlConverter_Projector.cxx index 0db9159c57..4dbc246668 100644 --- a/src/VrmlConverter/VrmlConverter_Projector.cxx +++ b/src/VrmlConverter/VrmlConverter_Projector.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -38,17 +40,17 @@ VrmlConverter_Projector::VrmlConverter_Projector (const TopTools_Array1OfShape& const Standard_Real YUp, const Standard_Real ZUp, const VrmlConverter_TypeOfCamera Camera, - const VrmlConverter_TypeOfLight Light) + const VrmlConverter_TypeOfLight Light) : myTypeOfCamera(Camera), myTypeOfLight(Light) { - myTypeOfCamera = Camera; - myTypeOfLight = Light; + + - Standard_Integer i; + Standard_Integer i = 0; Bnd_Box box; - Standard_Real Xmin, Xmax, Ymin, Ymax, Zmin, Zmax, diagonal; - Standard_Real Xtarget, Ytarget, Ztarget, Angle, MaxAngle, Height, MaxHeight; + Standard_Real Xmin = NAN, Xmax = NAN, Ymin = NAN, Ymax = NAN, Zmin = NAN, Zmax = NAN, diagonal = NAN; + Standard_Real Xtarget = NAN, Ytarget = NAN, Ztarget = NAN, Angle = NAN, MaxAngle = NAN, Height = NAN, MaxHeight = NAN; for ( i=Shapes.Lower(); i <= Shapes.Upper(); i++) { diff --git a/src/VrmlConverter/VrmlConverter_ShadedShape.cxx b/src/VrmlConverter/VrmlConverter_ShadedShape.cxx index 414a2fb6e3..b3a2194f5b 100644 --- a/src/VrmlConverter/VrmlConverter_ShadedShape.cxx +++ b/src/VrmlConverter/VrmlConverter_ShadedShape.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -49,7 +51,7 @@ void VrmlConverter_ShadedShape::Add( Standard_OStream& anOStream, { Handle(Poly_Triangulation) T; TopLoc_Location theLocation; - Standard_Integer i, j, k, decal, nnv, EI; + Standard_Integer i = 0, j = 0, k = 0, decal = 0, nnv = 0, EI = 0; Standard_Integer t[3], n[3]; gp_Pnt p; @@ -60,7 +62,7 @@ void VrmlConverter_ShadedShape::Add( Standard_OStream& anOStream, Standard_Integer nbTriangles = 0, nbVertices = 0; - Standard_Integer nt, nnn, n1, n2, n3; + Standard_Integer nt = 0, nnn = 0, n1 = 0, n2 = 0, n3 = 0; // iterating on each face of the shape: for (ex.Init(aShape, TopAbs_FACE); ex.More(); ex.Next()) { @@ -357,7 +359,7 @@ void VrmlConverter_ShadedShape::ComputeNormal(const TopoDS_Face& aFace, const Handle(Poly_Triangulation)& T = pc.Triangulation(); BRepAdaptor_Surface S; Standard_Boolean hasUV = T->HasUVNodes(); - Standard_Integer i; + Standard_Integer i = 0; TopLoc_Location l; Handle(Geom_Surface) GS = BRep_Tool::Surface(aFace, l); @@ -366,7 +368,7 @@ void VrmlConverter_ShadedShape::ComputeNormal(const TopoDS_Face& aFace, gp_Vec D1U,D1V; gp_Vec D2U,D2V,D2UV; gp_Pnt P; - Standard_Real U, V; + Standard_Real U = NAN, V = NAN; CSLib_DerivativeStatus aStatus; CSLib_NormalStatus NStat; S.Initialize(aFace); diff --git a/src/VrmlConverter/VrmlConverter_ShadingAspect.cxx b/src/VrmlConverter/VrmlConverter_ShadingAspect.cxx index 56023e7a9a..2cd990847a 100644 --- a/src/VrmlConverter/VrmlConverter_ShadingAspect.cxx +++ b/src/VrmlConverter/VrmlConverter_ShadingAspect.cxx @@ -18,14 +18,14 @@ IMPLEMENT_STANDARD_RTTIEXT(VrmlConverter_ShadingAspect,Standard_Transient) -VrmlConverter_ShadingAspect::VrmlConverter_ShadingAspect() +VrmlConverter_ShadingAspect::VrmlConverter_ShadingAspect() : myHasNormals(Standard_False), myHasMaterial(Standard_False) { Handle(Vrml_Material) m = new Vrml_Material; Vrml_ShapeHints sh; myFrontMaterial = m; myShapeHints = sh; - myHasNormals = Standard_False; - myHasMaterial = Standard_False; + + } void VrmlConverter_ShadingAspect::SetFrontMaterial(const Handle(Vrml_Material)& aMaterial) { diff --git a/src/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx b/src/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx index bfba8b13be..56507b4e68 100644 --- a/src/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx +++ b/src/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -37,13 +39,13 @@ static Standard_Real GetDeflection(const Handle(BRepAdaptor_Surface)& aFace, const Handle (VrmlConverter_Drawer)& aDrawer) { - Standard_Real theRequestedDeflection; + Standard_Real theRequestedDeflection = NAN; if(aDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE) // TOD_RELATIVE, TOD_ABSOLUTE { Bnd_Box box; BndLib_AddSurface::Add(aFace->Surface(), Precision::Confusion(), box); - Standard_Real Xmin, Xmax, Ymin, Ymax, Zmin, Zmax, diagonal; + Standard_Real Xmin = NAN, Xmax = NAN, Ymin = NAN, Ymax = NAN, Zmin = NAN, Zmax = NAN, diagonal = NAN; box.Get( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax ); if (!(box.IsOpenXmin() || box.IsOpenXmax() || box.IsOpenYmin() || box.IsOpenYmax() || @@ -84,7 +86,7 @@ void VrmlConverter_WFDeflectionRestrictedFace::Add { StdPrs_ToolRFace ToolRst (aFace); - Standard_Real UF, UL, VF, VL; + Standard_Real UF = NAN, UL = NAN, VF = NAN, VL = NAN; UF = aFace->FirstUParameter(); UL = aFace->LastUParameter(); VF = aFace->FirstVParameter(); @@ -93,8 +95,8 @@ void VrmlConverter_WFDeflectionRestrictedFace::Add Standard_Real aLimit = aDrawer->MaximalParameterValue(); // compute bounds of the restriction - Standard_Real UMin,UMax,VMin,VMax; - Standard_Integer i; + Standard_Real UMin = NAN,UMax = NAN,VMin = NAN,VMax = NAN; + Standard_Integer i = 0; UMin = UF; UMax = UL; @@ -138,7 +140,7 @@ void VrmlConverter_WFDeflectionRestrictedFace::Add // trim the isos gp_Pnt2d P1,P2; - Standard_Real U1, U2; + Standard_Real U1 = NAN, U2 = NAN; gp_Pnt dummypnt; for (ToolRst.Init(); ToolRst.More(); ToolRst.Next()) { TopAbs_Orientation Orient = ToolRst.Orientation(); diff --git a/src/VrmlConverter/VrmlConverter_WFDeflectionShape.cxx b/src/VrmlConverter/VrmlConverter_WFDeflectionShape.cxx index 7b46cc9de2..049cf98ea9 100644 --- a/src/VrmlConverter/VrmlConverter_WFDeflectionShape.cxx +++ b/src/VrmlConverter/VrmlConverter_WFDeflectionShape.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -42,13 +44,13 @@ void VrmlConverter_WFDeflectionShape::Add( Standard_OStream& a StdPrs_ShapeTool Tool(aShape); - Standard_Real theRequestedDeflection; + Standard_Real theRequestedDeflection = NAN; if(aDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE) // TOD_RELATIVE, TOD_ABSOLUTE { Bnd_Box box; BRepBndLib::AddClose(aShape, box); - Standard_Real Xmin, Xmax, Ymin, Ymax, Zmin, Zmax, diagonal; + Standard_Real Xmin = NAN, Xmax = NAN, Ymin = NAN, Ymax = NAN, Zmin = NAN, Zmax = NAN, diagonal = NAN; box.Get( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax ); if (!(box.IsOpenXmin() || box.IsOpenXmax() || box.IsOpenYmin() || box.IsOpenYmax() || diff --git a/src/VrmlConverter/VrmlConverter_WFRestrictedFace.cxx b/src/VrmlConverter/VrmlConverter_WFRestrictedFace.cxx index fd23d50898..d279f64a33 100644 --- a/src/VrmlConverter/VrmlConverter_WFRestrictedFace.cxx +++ b/src/VrmlConverter/VrmlConverter_WFRestrictedFace.cxx @@ -12,6 +12,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -44,8 +46,8 @@ void VrmlConverter_WFRestrictedFace::Add StdPrs_ToolRFace ToolRst (aFace); // compute bounds of the restriction - Standard_Real UMin,UMax,VMin,VMax; - Standard_Integer i; + Standard_Real UMin = NAN,UMax = NAN,VMin = NAN,VMax = NAN; + Standard_Integer i = 0; gp_Pnt2d P1,P2; Bnd_Box2d B; @@ -91,7 +93,7 @@ void VrmlConverter_WFRestrictedFace::Add } // trim the isos - Standard_Real U1, U2, U, DU; + Standard_Real U1 = NAN, U2 = NAN, U = NAN, DU = NAN; for (ToolRst.Init(); ToolRst.More(); ToolRst.Next()) { TopAbs_Orientation Orient = ToolRst.Orientation(); diff --git a/src/VrmlConverter/VrmlConverter_WFShape.cxx b/src/VrmlConverter/VrmlConverter_WFShape.cxx index 2ee9766e0a..400c47759b 100644 --- a/src/VrmlConverter/VrmlConverter_WFShape.cxx +++ b/src/VrmlConverter/VrmlConverter_WFShape.cxx @@ -45,7 +45,7 @@ void VrmlConverter_WFShape::Add(Standard_OStream& anOStream, aDrawer->VIsoAspect()->Number() != 0 ) { BRepAdaptor_Surface S; - Standard_Boolean isoU, isoV; + Standard_Boolean isoU = 0, isoV = 0; for(Tool.InitFace();Tool.MoreFace();Tool.NextFace()){ isoU = (aDrawer->UIsoAspect()->Number() != 0); isoV = (aDrawer->VIsoAspect()->Number() != 0); diff --git a/src/VrmlData/VrmlData_Group.cxx b/src/VrmlData/VrmlData_Group.cxx index 3af1d8c706..8b15668042 100644 --- a/src/VrmlData/VrmlData_Group.cxx +++ b/src/VrmlData/VrmlData_Group.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -422,7 +424,7 @@ VrmlData_ErrorStatus VrmlData_Group::openFile (Standard_IStream& theStream, const TCollection_AsciiString& theFilename) { - std::ifstream& aStream = static_cast (theStream); + std::ifstream& aStream = dynamic_cast (theStream); VrmlData_ErrorStatus aStatus (VrmlData_EmptyData); NCollection_List::Iterator aDirIter = Scene().VrmlDirIterator(); @@ -511,7 +513,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write (const char * thePrefix) const // Output the Rotation gp_XYZ anAxis; - Standard_Real anAngle; + Standard_Real anAngle = NAN; if (myTrsf.GetRotation (anAxis, anAngle)) { // output the Rotation Sprintf (buf, "rotation %.12g %.12g %.12g %.9g", diff --git a/src/VrmlData/VrmlData_IndexedFaceSet.cxx b/src/VrmlData/VrmlData_IndexedFaceSet.cxx index 3b0c346e9a..aec4bde3c7 100644 --- a/src/VrmlData/VrmlData_IndexedFaceSet.cxx +++ b/src/VrmlData/VrmlData_IndexedFaceSet.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -49,7 +51,7 @@ IMPLEMENT_STANDARD_RTTIEXT(VrmlData_IndexedFaceSet,VrmlData_Faceted) VrmlData_ErrorStatus VrmlData_Faceted::readData (VrmlData_InBuffer& theBuffer) { VrmlData_ErrorStatus aStatus (VrmlData_EmptyData); - Standard_Boolean aBool; + Standard_Boolean aBool = 0; if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "ccw")) { if (OK(aStatus, ReadBoolean (theBuffer, aBool))) myIsCCW = aBool; @@ -60,7 +62,7 @@ VrmlData_ErrorStatus VrmlData_Faceted::readData (VrmlData_InBuffer& theBuffer) if (OK(aStatus, ReadBoolean (theBuffer, aBool))) myIsSolid = aBool; } else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "creaseAngle")) { - Standard_Real anAngle; + Standard_Real anAngle = NAN; if (OK(aStatus, Scene().ReadReal (theBuffer, anAngle, Standard_False, Standard_False))) { if (anAngle < -Precision::Confusion()*0.001) @@ -246,9 +248,9 @@ const Handle(TopoDS_TShape)& VrmlData_IndexedFaceSet::TShape () { if(mapPolyId.Contains(i)) // check to avoid previously skipped faces { - const Standard_Integer * anArrNodes; + const Standard_Integer * anArrNodes = nullptr; Polygon(i, anArrNodes); - const Standard_Integer * arrIndice; + const Standard_Integer * arrIndice = nullptr; int nbn = IndiceNormals(i, arrIndice); for (Standard_Integer j = 0; j < nbn; j++) { diff --git a/src/VrmlData/VrmlData_IndexedLineSet.cxx b/src/VrmlData/VrmlData_IndexedLineSet.cxx index 7f15d7a66d..6c8c880eb0 100644 --- a/src/VrmlData/VrmlData_IndexedLineSet.cxx +++ b/src/VrmlData/VrmlData_IndexedLineSet.cxx @@ -58,7 +58,7 @@ const Handle(TopoDS_TShape)& VrmlData_IndexedLineSet::TShape () if (myNbPolygons == 0) myTShape.Nullify(); else if (myIsModified) { - Standard_Integer i; + Standard_Integer i = 0; BRep_Builder aBuilder; const gp_XYZ * arrNodes = myCoords->Values(); @@ -66,7 +66,7 @@ const Handle(TopoDS_TShape)& VrmlData_IndexedLineSet::TShape () TopoDS_Wire aWire; aBuilder.MakeWire(aWire); for (i = 0; i < (int)myNbPolygons; i++) { - const Standard_Integer * arrIndice; + const Standard_Integer * arrIndice = nullptr; const Standard_Integer nNodes = Polygon(i, arrIndice); TColgp_Array1OfPnt arrPoint (1, nNodes); TColStd_Array1OfReal arrParam (1, nNodes); diff --git a/src/VrmlData/VrmlData_Node.cxx b/src/VrmlData/VrmlData_Node.cxx index d4a85824aa..ab26f89d35 100644 --- a/src/VrmlData/VrmlData_Node.cxx +++ b/src/VrmlData/VrmlData_Node.cxx @@ -200,8 +200,8 @@ VrmlData_ErrorStatus VrmlData_Node::ReadInteger (VrmlData_InBuffer& theBuffer, { VrmlData_ErrorStatus aStatus; if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) { - char * endptr; - long aResult; + char * endptr = nullptr; + long aResult = 0; aResult = strtol (theBuffer.LinePtr, &endptr, 10); if (endptr == theBuffer.LinePtr) aStatus = VrmlData_NumericInputError; @@ -443,7 +443,7 @@ VrmlData_ErrorStatus VrmlData_UnknownNode::Read (VrmlData_InBuffer& theBuffer) while (aLevelCounter >= 0 && OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) { - int aChar; + int aChar = 0; while ((aChar = theBuffer.LinePtr[0]) != '\0') { theBuffer.LinePtr++; if (aChar == '{') { diff --git a/src/VrmlData/VrmlData_Node.hxx b/src/VrmlData/VrmlData_Node.hxx index fed5337283..535cb6e173 100644 --- a/src/VrmlData/VrmlData_Node.hxx +++ b/src/VrmlData/VrmlData_Node.hxx @@ -182,7 +182,7 @@ class VrmlData_Node : public Standard_Transient // ---------- PRIVATE FIELDS ---------- const VrmlData_Scene * myScene; - const char * myName; ///< name of the node + const char * myName{}; ///< name of the node #ifdef OCCT_DEBUG Standard_Integer myLineCount; #endif diff --git a/src/VrmlData/VrmlData_Scene.cxx b/src/VrmlData/VrmlData_Scene.cxx index 1c851aab42..2a500708e0 100644 --- a/src/VrmlData/VrmlData_Scene.cxx +++ b/src/VrmlData/VrmlData_Scene.cxx @@ -66,13 +66,13 @@ VrmlData_Scene::VrmlData_Scene myStatus (VrmlData_StatusOK), myAllocator (theAlloc.IsNull() ? new NCollection_IncAllocator : theAlloc.operator->()), - myLineError (0), + myWorldInfo(new VrmlData_WorldInfo (* this)), myLineError (0), myOutput (0L), myIndent (2), myCurrentIndent (0), myAutoNameCounter (0) { - myWorldInfo = new VrmlData_WorldInfo (* this); + Standard_CString anInfo = "Generated by Open CASCADE Technology " OCC_VERSION_STRING; myWorldInfo->AddInfo (anInfo); myLstNodes.Append (myWorldInfo); @@ -565,7 +565,7 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode // the counter. The loop terminates when the counter becomes negative. while (aLevelCounter >= 0 && (aStatus = ReadLine(theBuffer)) == VrmlData_StatusOK) { - int aChar; + int aChar = 0; while ((aChar = theBuffer.LinePtr[0]) != '\0') { theBuffer.LinePtr++; if (aChar == '[') { @@ -714,7 +714,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadReal Standard_Real aResult(0.); VrmlData_ErrorStatus aStatus; if (VrmlData_Node::OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) { - char * endptr; + char * endptr = nullptr; aResult = Strtod (theBuffer.LinePtr, &endptr); if (endptr == theBuffer.LinePtr) aStatus = VrmlData_NumericInputError; @@ -744,7 +744,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXYZ for (Standard_Integer i = 0; i < 3; i++) { if (!VrmlData_Node::OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) break; - char * endptr; + char * endptr = nullptr; aVal[i] = Strtod (theBuffer.LinePtr, &endptr); if (endptr == theBuffer.LinePtr) { aStatus = VrmlData_NumericInputError; @@ -786,7 +786,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXY for (Standard_Integer i = 0; i < 2; i++) { if (!VrmlData_Node::OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) break; - char * endptr; + char * endptr = nullptr; aVal[i] = Strtod (theBuffer.LinePtr, &endptr); if (endptr == theBuffer.LinePtr) { aStatus = VrmlData_NumericInputError; @@ -829,7 +829,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex NCollection_Vector vecIndice; NCollection_Vector vecInt; Standard_Boolean isMore (Standard_True); - long anIntValue; + long anIntValue = 0; // Loop reading integers from the stream while (isMore && VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) @@ -1186,7 +1186,7 @@ void dumpNode (Standard_OStream& theStream, else if (theNode->IsKind(STANDARD_TYPE(VrmlData_IndexedFaceSet))) { const Handle(VrmlData_IndexedFaceSet) aNode = Handle(VrmlData_IndexedFaceSet)::DownCast(theNode); - const Standard_Integer ** ppDummy; + const Standard_Integer ** ppDummy = nullptr; const Standard_Size nCoord = aNode->Coordinates()->Length(); const Standard_Size nPoly = aNode->Polygons (ppDummy); char buf[80]; @@ -1197,7 +1197,7 @@ void dumpNode (Standard_OStream& theStream, } else if (theNode->IsKind(STANDARD_TYPE(VrmlData_IndexedLineSet))) { const Handle(VrmlData_IndexedLineSet) aNode = Handle(VrmlData_IndexedLineSet)::DownCast(theNode); - const Standard_Integer ** ppDummy; + const Standard_Integer ** ppDummy = nullptr; const Standard_Size nCoord = aNode->Coordinates()->Length(); const Standard_Size nPoly = aNode->Polygons (ppDummy); diff --git a/src/VrmlData/VrmlData_ShapeConvert.cxx b/src/VrmlData/VrmlData_ShapeConvert.cxx index 6411c778de..e61bb79fbd 100644 --- a/src/VrmlData/VrmlData_ShapeConvert.cxx +++ b/src/VrmlData/VrmlData_ShapeConvert.cxx @@ -246,7 +246,7 @@ void VrmlData_ShapeConvert::Convert (const Standard_Boolean theExtractFaces, Standard_Boolean Extract[2] = {theExtractFaces, theExtractEdges}; TopAbs_ShapeEnum ShapeType[2] = {TopAbs_FACE, TopAbs_EDGE}; - Standard_Integer i; + Standard_Integer i = 0; const Handle(NCollection_IncAllocator) anAlloc = new NCollection_IncAllocator; @@ -321,7 +321,7 @@ Handle(VrmlData_Geometry) VrmlData_ShapeConvert::triToIndexedFaceSet const TopoDS_Face& theFace, const Handle(VrmlData_Coordinate)& theCoord) { - Standard_Integer i; + Standard_Integer i = 0; const Standard_Integer nNodes (theTri->NbNodes()); const Standard_Integer nTriangles (theTri->NbTriangles()); @@ -480,7 +480,7 @@ Handle(VrmlData_Geometry) VrmlData_ShapeConvert::triToIndexedFaceSet Handle(VrmlData_Geometry) VrmlData_ShapeConvert::polToIndexedLineSet (const Handle(Poly_Polygon3D)& thePol) { - Standard_Integer i; + Standard_Integer i = 0; const Standard_Integer nNodes (thePol->NbNodes()); const TColgp_Array1OfPnt& arrPolyNodes = thePol->Nodes(); const Handle(NCollection_IncAllocator)& anAlloc = myScene.Allocator(); diff --git a/src/VrmlData/VrmlData_WorldInfo.hxx b/src/VrmlData/VrmlData_WorldInfo.hxx index fb50dceef7..2e2885d9de 100644 --- a/src/VrmlData/VrmlData_WorldInfo.hxx +++ b/src/VrmlData/VrmlData_WorldInfo.hxx @@ -91,7 +91,7 @@ class VrmlData_WorldInfo : public VrmlData_Node private: // ---------- PRIVATE FIELDS ---------- - const char * myTitle; + const char * myTitle{}; NCollection_List myInfo; public: diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx index 357f693e66..4c84c108eb 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx @@ -21,13 +21,13 @@ IMPLEMENT_STANDARD_RTTIEXT(XCAFDimTolObjects_DatumObject,Standard_Transient) //purpose : //======================================================================= -XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject() +XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject() : myIsDTarget(Standard_False), myIsValidDT(Standard_False), myHasPlane(Standard_False), myHasPnt(Standard_False), myHasPntText(Standard_False) { - myIsDTarget = Standard_False; - myIsValidDT = Standard_False; - myHasPlane = Standard_False; - myHasPnt = Standard_False; - myHasPntText = Standard_False; + + + + + } //======================================================================= @@ -35,30 +35,30 @@ XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject() //purpose : //======================================================================= -XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDimTolObjects_DatumObject)& theObj) +XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDimTolObjects_DatumObject)& theObj) : myName(theObj->myName), myModifiers(theObj->myModifiers), myModifierWithValue(theObj->myModifierWithValue), myValueOfModifier(theObj->myValueOfModifier), myDatumTarget(theObj->myDatumTarget), myPosition(theObj->myPosition), myIsDTarget(theObj->myIsDTarget), myIsValidDT(theObj->myIsValidDT), myDTargetType(theObj->myDTargetType), myLength(theObj->myLength), myWidth(theObj->myWidth), myDatumTargetNumber(theObj->myDatumTargetNumber), myAxis(theObj->myAxis), myPlane(theObj->myPlane), myPnt(theObj->myPnt), myPntText(theObj->myPntText), myHasPlane(theObj->myHasPlane), myHasPnt(theObj->myHasPnt), myHasPntText(theObj->myHasPntText), myPresentation(theObj->myPresentation), mySemanticName(theObj->mySemanticName), myPresentationName(theObj->myPresentationName) { - myName = theObj->myName; - myModifiers = theObj->myModifiers; - myModifierWithValue = theObj->myModifierWithValue; - myValueOfModifier = theObj->myValueOfModifier; - myDatumTarget = theObj->myDatumTarget; - myPosition = theObj->myPosition; - myIsDTarget = theObj->myIsDTarget; - myIsValidDT = theObj->myIsValidDT; - myDTargetType = theObj->myDTargetType; - myLength = theObj->myLength; - myWidth = theObj->myWidth; - myDatumTargetNumber = theObj->myDatumTargetNumber; - myAxis = theObj->myAxis; - myPlane = theObj->myPlane; - myPnt= theObj->myPnt; - myPntText= theObj->myPntText; - myHasPlane = theObj->myHasPlane; - myHasPnt = theObj->myHasPnt; - myHasPntText = theObj->myHasPntText; - myPresentation = theObj->myPresentation; - mySemanticName = theObj->mySemanticName; - myPresentationName = theObj->myPresentationName; + + + + + + + + + + + + + + + + + + + + + + } //======================================================================= diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx index db29b20fa1..1a72c6d079 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx @@ -209,15 +209,15 @@ private: Handle(TCollection_HAsciiString) myName; XCAFDimTolObjects_DatumModifiersSequence myModifiers; XCAFDimTolObjects_DatumModifWithValue myModifierWithValue; - Standard_Real myValueOfModifier; + Standard_Real myValueOfModifier{}; TopoDS_Shape myDatumTarget; - Standard_Integer myPosition; + Standard_Integer myPosition{}; Standard_Boolean myIsDTarget; Standard_Boolean myIsValidDT; XCAFDimTolObjects_DatumTargetType myDTargetType; - Standard_Real myLength; - Standard_Real myWidth; - Standard_Integer myDatumTargetNumber; + Standard_Real myLength{}; + Standard_Real myWidth{}; + Standard_Integer myDatumTargetNumber{}; gp_Ax2 myAxis; gp_Ax2 myPlane; gp_Pnt myPnt; diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx index 6724e94141..5fd657f6ab 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx @@ -22,12 +22,12 @@ IMPLEMENT_STANDARD_RTTIEXT(XCAFDimTolObjects_DimensionObject,Standard_Transient) //purpose : //======================================================================= -XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject() +XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject() : myHasPlane(Standard_False), myHasPntText(Standard_False), myHasPoint1(Standard_False), myHasPoint2(Standard_False) { - myHasPlane = Standard_False; - myHasPntText = Standard_False; - myHasPoint1 = Standard_False; - myHasPoint2 = Standard_False; + + + + } //======================================================================= @@ -35,31 +35,31 @@ XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject() //purpose : //======================================================================= -XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject(const Handle(XCAFDimTolObjects_DimensionObject)& theObj) -{ - myType = theObj->myType; - myVal = theObj->myVal; - myQualifier = theObj->myQualifier; - myAngularQualifier = theObj->myAngularQualifier; - myIsHole = theObj->myIsHole; - myFormVariance = theObj->myFormVariance; - myGrade = theObj->myGrade; - myL = theObj->myL; - myR = theObj->myR; - myModifiers = theObj->myModifiers; - myPath = theObj->myPath; - myDir = theObj->myDir; - myHasPoint1 = theObj->myHasPoint1; - myPnt1 = theObj->myPnt1; - myHasPoint2 = theObj->myHasPoint2; - myPnt2 = theObj->myPnt2; - myPntText= theObj->myPntText; - myHasPlane = theObj->myHasPlane; - myPlane = theObj->myPlane; - myHasPntText = theObj->myHasPntText; - mySemanticName = theObj->mySemanticName; - myPresentation = theObj->myPresentation; - myPresentationName = theObj->myPresentationName; +XCAFDimTolObjects_DimensionObject::XCAFDimTolObjects_DimensionObject(const Handle(XCAFDimTolObjects_DimensionObject)& theObj) : myType(theObj->myType), myVal(theObj->myVal), myQualifier(theObj->myQualifier), myAngularQualifier(theObj->myAngularQualifier), myIsHole(theObj->myIsHole), myFormVariance(theObj->myFormVariance), myGrade(theObj->myGrade), myL(theObj->myL), myR(theObj->myR), myModifiers(theObj->myModifiers), myPath(theObj->myPath), myDir(theObj->myDir), myHasPoint1(theObj->myHasPoint1), myPnt1(theObj->myPnt1), myHasPoint2(theObj->myHasPoint2), myPnt2(theObj->myPnt2), myPntText(theObj->myPntText), myHasPlane(theObj->myHasPlane), myPlane(theObj->myPlane), myHasPntText(theObj->myHasPntText), mySemanticName(theObj->mySemanticName), myPresentation(theObj->myPresentation), myPresentationName(theObj->myPresentationName) +{ + + + + + + + + + + + + + + + + + + + + + + + for (int i = 0; i < theObj->myDescriptions.Length(); i++) { myDescriptions.Append(theObj->myDescriptions(i)); diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx index c34f6b6165..d421fe627b 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx @@ -311,11 +311,11 @@ private: Handle(TColStd_HArray1OfReal) myVal; XCAFDimTolObjects_DimensionQualifier myQualifier; XCAFDimTolObjects_AngularQualifier myAngularQualifier; - Standard_Boolean myIsHole; + Standard_Boolean myIsHole{}; XCAFDimTolObjects_DimensionFormVariance myFormVariance; XCAFDimTolObjects_DimensionGrade myGrade; - Standard_Integer myL; - Standard_Integer myR; + Standard_Integer myL{}; + Standard_Integer myR{}; XCAFDimTolObjects_DimensionModifiersSequence myModifiers; TopoDS_Edge myPath; gp_Dir myDir; diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx index c405b343d7..743193a500 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx @@ -20,13 +20,13 @@ IMPLEMENT_STANDARD_RTTIEXT(XCAFDimTolObjects_GeomToleranceObject,Standard_Transi //purpose : //======================================================================= -XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject() +XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject() : myHasAxis(Standard_False), myHasPlane(Standard_False), myHasPnt(Standard_False), myHasPntText(Standard_False), myAffectedPlaneType(XCAFDimTolObjects_ToleranceZoneAffectedPlane_None) { - myHasAxis = Standard_False; - myHasPlane = Standard_False; - myHasPnt = Standard_False; - myHasPntText = Standard_False; - myAffectedPlaneType = XCAFDimTolObjects_ToleranceZoneAffectedPlane_None; + + + + + } //======================================================================= @@ -34,29 +34,29 @@ XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject() //purpose : //======================================================================= -XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject(const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObj) +XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject(const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObj) : myType(theObj->myType), myTypeOfValue(theObj->myTypeOfValue), myValue(theObj->myValue), myMatReqModif(theObj->myMatReqModif), myZoneModif(theObj->myZoneModif), myValueOfZoneModif(theObj->myValueOfZoneModif), myModifiers(theObj->myModifiers), myMaxValueModif(theObj->myMaxValueModif), myAxis(theObj->myAxis), myHasAxis(theObj->myHasAxis), myPlane(theObj->myPlane), myPnt(theObj->myPnt), myPntText(theObj->myPntText), myHasPlane(theObj->myHasPlane), myHasPnt(theObj->myHasPnt), myHasPntText(theObj->myHasPntText), mySemanticName(theObj->mySemanticName), myAffectedPlaneType(theObj->myAffectedPlaneType), myAffectedPlane(theObj->myAffectedPlane), myPresentation(theObj->myPresentation), myPresentationName(theObj->myPresentationName) { - myType = theObj->myType; - myTypeOfValue = theObj->myTypeOfValue; - myValue = theObj->myValue; - myMatReqModif = theObj->myMatReqModif; - myZoneModif = theObj->myZoneModif; - myValueOfZoneModif = theObj->myValueOfZoneModif; - myModifiers = theObj->myModifiers; - myMaxValueModif = theObj->myMaxValueModif; - myAxis = theObj->myAxis; - myHasAxis = theObj->myHasAxis; - myPlane = theObj->myPlane; - myPnt= theObj->myPnt; - myPntText= theObj->myPntText; - myHasPlane = theObj->myHasPlane; - myHasPnt = theObj->myHasPnt; - myHasPntText = theObj->myHasPntText; - mySemanticName = theObj->mySemanticName; - myAffectedPlaneType = theObj->myAffectedPlaneType; - myAffectedPlane = theObj->myAffectedPlane; - myPresentation = theObj->myPresentation; - myPresentationName = theObj->myPresentationName; + + + + + + + + + + + + + + + + + + + + + } //======================================================================= diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx index 0743736c61..f827c52d2c 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx @@ -220,12 +220,12 @@ private: XCAFDimTolObjects_GeomToleranceType myType; XCAFDimTolObjects_GeomToleranceTypeValue myTypeOfValue; - Standard_Real myValue; + Standard_Real myValue{}; XCAFDimTolObjects_GeomToleranceMatReqModif myMatReqModif; XCAFDimTolObjects_GeomToleranceZoneModif myZoneModif; - Standard_Real myValueOfZoneModif; + Standard_Real myValueOfZoneModif{}; XCAFDimTolObjects_GeomToleranceModifiersSequence myModifiers; - Standard_Real myMaxValueModif; + Standard_Real myMaxValueModif{}; gp_Ax2 myAxis; Standard_Boolean myHasAxis; gp_Ax2 myPlane; diff --git a/src/XCAFDoc/XCAFDoc.cxx b/src/XCAFDoc/XCAFDoc.cxx index 9faf73353c..e4f7bdfcec 100644 --- a/src/XCAFDoc/XCAFDoc.cxx +++ b/src/XCAFDoc/XCAFDoc.cxx @@ -517,7 +517,7 @@ TCollection_AsciiString XCAFDoc::AttributeInfo (const Handle(TDF_Attribute)& the } } else if ( theAtt->IsKind(STANDARD_TYPE(XCAFDoc_GraphNode)) ) { - Standard_CString type; + Standard_CString type = nullptr; if ( theAtt->ID() == XCAFDoc::LayerRefGUID() ) { type = "Layer Instance Link"; } diff --git a/src/XCAFDoc/XCAFDoc_AssemblyGraph.cxx b/src/XCAFDoc/XCAFDoc_AssemblyGraph.cxx index b344faec96..bba38fe03f 100644 --- a/src/XCAFDoc/XCAFDoc_AssemblyGraph.cxx +++ b/src/XCAFDoc/XCAFDoc_AssemblyGraph.cxx @@ -260,11 +260,11 @@ Standard_Integer XCAFDoc_AssemblyGraph::addNode(const TDF_Label& theLabel, // ======================================================================= XCAFDoc_AssemblyGraph::Iterator::Iterator(const Handle(XCAFDoc_AssemblyGraph)& theGraph, - const Standard_Integer theNode) + const Standard_Integer theNode) : myGraph(theGraph), myCurrentIndex(theNode) { Standard_NullObject_Raise_if(theGraph.IsNull(), "Null assembly graph!"); Standard_NullObject_Raise_if(theNode < 1, "Node ID must be positive one-based integer!"); - myGraph = theGraph; - myCurrentIndex = theNode; + + } diff --git a/src/XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx b/src/XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx index e0a23ed09f..0983319233 100644 --- a/src/XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx +++ b/src/XCAFDoc/XCAFDoc_ClippingPlaneTool.cxx @@ -100,7 +100,7 @@ Standard_Boolean XCAFDoc_ClippingPlaneTool::GetClippingPlane(const TDF_Label& th //purpose : //======================================================================= -TDF_Label XCAFDoc_ClippingPlaneTool::AddClippingPlane(const gp_Pln& thePlane, const TCollection_ExtendedString theName) const +TDF_Label XCAFDoc_ClippingPlaneTool::AddClippingPlane(const gp_Pln& thePlane, const TCollection_ExtendedString& theName) const { TDF_Label aLabel; TDF_LabelSequence aClippingPlanes; @@ -108,7 +108,7 @@ TDF_Label XCAFDoc_ClippingPlaneTool::AddClippingPlane(const gp_Pln& thePlane, co for (Standard_Integer i = 1; i <= aClippingPlanes.Length(); i++) { gp_Pln aPlane; TCollection_ExtendedString aName; - Standard_Boolean aCapping; + Standard_Boolean aCapping = 0; GetClippingPlane(aClippingPlanes.Value(i), aPlane, aName, aCapping); if (!aName.IsEqual(theName)) continue; @@ -149,7 +149,7 @@ TDF_Label XCAFDoc_ClippingPlaneTool::AddClippingPlane(const gp_Pln& thePlane, co //purpose : //======================================================================= -TDF_Label XCAFDoc_ClippingPlaneTool::AddClippingPlane(const gp_Pln& thePlane, const TCollection_ExtendedString theName, const Standard_Boolean theCapping) const +TDF_Label XCAFDoc_ClippingPlaneTool::AddClippingPlane(const gp_Pln& thePlane, const TCollection_ExtendedString& theName, const Standard_Boolean theCapping) const { TDF_Label aLabel = AddClippingPlane(thePlane, theName); Standard_Integer aCappingVal = (theCapping) ? 1 : 0; @@ -206,7 +206,7 @@ void XCAFDoc_ClippingPlaneTool::GetClippingPlanes(TDF_LabelSequence& theLabels) //======================================================================= void XCAFDoc_ClippingPlaneTool::UpdateClippingPlane(const TDF_Label& theLabel, - const gp_Pln& thePlane, const TCollection_ExtendedString theName) const + const gp_Pln& thePlane, const TCollection_ExtendedString& theName) const { if (theLabel.Father() != Label()) return; diff --git a/src/XCAFDoc/XCAFDoc_ClippingPlaneTool.hxx b/src/XCAFDoc/XCAFDoc_ClippingPlaneTool.hxx index 980fec6346..f4f37ac850 100644 --- a/src/XCAFDoc/XCAFDoc_ClippingPlaneTool.hxx +++ b/src/XCAFDoc/XCAFDoc_ClippingPlaneTool.hxx @@ -60,7 +60,7 @@ public: //! Adds a clipping plane definition to a ClippingPlane table and returns //! its label (returns existing label if the same clipping plane //! is already defined) - Standard_EXPORT TDF_Label AddClippingPlane(const gp_Pln& thePlane, const TCollection_ExtendedString theName, const Standard_Boolean theCapping) const; + Standard_EXPORT TDF_Label AddClippingPlane(const gp_Pln& thePlane, const TCollection_ExtendedString& theName, const Standard_Boolean theCapping) const; //! Adds a clipping plane definition to a ClippingPlane table and returns //! its label (returns existing label if the same clipping plane @@ -70,7 +70,7 @@ public: //! Adds a clipping plane definition to a ClippingPlane table and returns //! its label (returns existing label if the same clipping plane //! is already defined) - Standard_EXPORT TDF_Label AddClippingPlane(const gp_Pln& thePlane, const TCollection_ExtendedString theName) const; + Standard_EXPORT TDF_Label AddClippingPlane(const gp_Pln& thePlane, const TCollection_ExtendedString& theName) const; //! Adds a clipping plane definition to a ClippingPlane table and returns //! its label (returns existing label if the same clipping plane @@ -87,7 +87,7 @@ public: //! Sets new value of plane and name to the given clipping plane label //! or do nothing, if the given label is not a clipping plane label - Standard_EXPORT void UpdateClippingPlane(const TDF_Label& theLabelL, const gp_Pln& thePlane, const TCollection_ExtendedString theName) const; + Standard_EXPORT void UpdateClippingPlane(const TDF_Label& theLabelL, const gp_Pln& thePlane, const TCollection_ExtendedString& theName) const; //! Set new value of capping for given clipping plane label Standard_EXPORT void SetCapping(const TDF_Label& theClippingPlaneL, const Standard_Boolean theCapping); diff --git a/src/XCAFDoc/XCAFDoc_Datum.cxx b/src/XCAFDoc/XCAFDoc_Datum.cxx index 83c9d7fd16..9f0a4293af 100644 --- a/src/XCAFDoc/XCAFDoc_Datum.cxx +++ b/src/XCAFDoc/XCAFDoc_Datum.cxx @@ -11,6 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -201,7 +203,7 @@ void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theOb } XCAFDimTolObjects_DatumModifWithValue aM; - Standard_Real aV; + Standard_Real aV = NAN; theObject->GetModifierWithValue(aM, aV); if(aM != XCAFDimTolObjects_DatumModifWithValue_None) { diff --git a/src/XCAFDoc/XCAFDoc_DimTol.hxx b/src/XCAFDoc/XCAFDoc_DimTol.hxx index b907284586..de7d7e07ff 100644 --- a/src/XCAFDoc/XCAFDoc_DimTol.hxx +++ b/src/XCAFDoc/XCAFDoc_DimTol.hxx @@ -78,7 +78,7 @@ protected: private: - Standard_Integer myKind; + Standard_Integer myKind{}; Handle(TColStd_HArray1OfReal) myVal; Handle(TCollection_HAsciiString) myName; Handle(TCollection_HAsciiString) myDescription; diff --git a/src/XCAFDoc/XCAFDoc_Dimension.cxx b/src/XCAFDoc/XCAFDoc_Dimension.cxx index 1ba7bdd4a2..906c0b5e21 100644 --- a/src/XCAFDoc/XCAFDoc_Dimension.cxx +++ b/src/XCAFDoc/XCAFDoc_Dimension.cxx @@ -124,7 +124,7 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec Handle(TDataStd_Integer) anAngularQualifier = TDataStd_Integer::Set(Label().FindChild(ChildLab_AngularQualifier), theObject->GetAngularQualifier()); - Standard_Boolean aH; + Standard_Boolean aH = 0; XCAFDimTolObjects_DimensionFormVariance aF; XCAFDimTolObjects_DimensionGrade aG; theObject->GetClassOfTolerance(aH,aF,aG); @@ -140,7 +140,7 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec aClass->ChangeArray(anArrI); } - Standard_Integer aL, aR; + Standard_Integer aL = 0, aR = 0; theObject->GetNbOfDecimalPlaces(aL, aR); if (aL > 0 || aR > 0) { diff --git a/src/XCAFDoc/XCAFDoc_GraphNode.cxx b/src/XCAFDoc/XCAFDoc_GraphNode.cxx index efa73c447d..e681257fbb 100644 --- a/src/XCAFDoc/XCAFDoc_GraphNode.cxx +++ b/src/XCAFDoc/XCAFDoc_GraphNode.cxx @@ -274,7 +274,7 @@ Standard_Integer XCAFDoc_GraphNode::FatherIndex(const Handle(XCAFDoc_GraphNode)& Standard_Integer XCAFDoc_GraphNode::ChildIndex(const Handle(XCAFDoc_GraphNode)& Ch) const { - Standard_Integer Chindex; + Standard_Integer Chindex = 0; if (NbChildren() != 0) { for (Chindex = 1; Chindex <= NbChildren(); Chindex++) @@ -418,7 +418,7 @@ Handle(TDF_Attribute) XCAFDoc_GraphNode::NewEmpty() const void XCAFDoc_GraphNode::References(const Handle(TDF_DataSet)& aDataSet) const { - Standard_Integer i; + Standard_Integer i = 0; Handle(XCAFDoc_GraphNode) fct; for ( i = 1; i <= NbChildren(); i++ ) { fct = myChildren(i); diff --git a/src/XCAFDoc/XCAFDoc_Material.hxx b/src/XCAFDoc/XCAFDoc_Material.hxx index d17fd092a4..6f4c260ae7 100644 --- a/src/XCAFDoc/XCAFDoc_Material.hxx +++ b/src/XCAFDoc/XCAFDoc_Material.hxx @@ -81,7 +81,7 @@ private: Handle(TCollection_HAsciiString) myName; Handle(TCollection_HAsciiString) myDescription; - Standard_Real myDensity; + Standard_Real myDensity{}; Handle(TCollection_HAsciiString) myDensName; Handle(TCollection_HAsciiString) myDensValType; diff --git a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx index 67b7691d57..e9888882ee 100644 --- a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx +++ b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx @@ -90,9 +90,9 @@ Handle(XCAFDoc_ShapeTool) XCAFDoc_ShapeTool::Set(const TDF_Label& L) //purpose : //======================================================================= -XCAFDoc_ShapeTool::XCAFDoc_ShapeTool() +XCAFDoc_ShapeTool::XCAFDoc_ShapeTool() : hasSimpleShapes(Standard_False) { - hasSimpleShapes = Standard_False; + } @@ -598,7 +598,7 @@ static Standard_Boolean prepareAssembly (const TopoDS_Shape& theShape, for (; Iterator.More(); Iterator.Next()) aSubShapeSeq.Append(Iterator.Value()); for (Standard_Integer i = 1; i <= aSubShapeSeq.Length(); i++) { - TopoDS_Shape Scomp = aSubShapeSeq.Value(i); + const TopoDS_Shape& Scomp = aSubShapeSeq.Value(i); TopoDS_Shape aNewScomp; B.Remove(theOUTShape, Scomp); prepareAssembly( Scomp, aNewScomp ); @@ -1199,7 +1199,7 @@ Standard_Boolean XCAFDoc_ShapeTool::AddSubShape(const TDF_Label &shapeL, TDF_LabelSequence aShapeLSeq; for (TopoDS_Iterator it(GetShape(shapeL)); it.More() && !isDefined; it.Next()) { - TopoDS_Shape aShape = it.Value(); + const TopoDS_Shape& aShape = it.Value(); if (sub.IsSame(aShape.Located(TopLoc_Location()))) { isDefined = Standard_True; @@ -1363,7 +1363,7 @@ Standard_OStream& XCAFDoc_ShapeTool::Dump(Standard_OStream& theDumpLog, const St GetShapes( SeqLabels); if (SeqLabels.Length()>0) theDumpLog<String()); TDataStd_Name::Set(tmplbl,extstr); } @@ -1483,7 +1483,7 @@ TDF_Label XCAFDoc_ShapeTool::SetExternRefs(const TColStd_SequenceOfHAsciiString& TDataStd_UAttribute::Set(ShapeLabel,XCAFDoc::ExternRefGUID()); for(Standard_Integer i=1; i<=SHAS.Length(); i++) { TDF_Label tmplbl = ShapeLabel.FindChild(i,Standard_True); - Handle(TCollection_HAsciiString) str = SHAS(i); + const Handle(TCollection_HAsciiString)& str = SHAS(i); TCollection_ExtendedString extstr(str->String()); TDataStd_Name::Set(tmplbl,extstr); } @@ -1557,7 +1557,7 @@ Standard_Boolean XCAFDoc_ShapeTool::SetSHUO (const TDF_LabelSequence& labels, if (labels.Length() < 2) return Standard_False; // check is all labels contains components of any assemblyies - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= labels.Length(); i++) if ( !IsComponent(labels.Value(i)) ) return Standard_False; @@ -1828,7 +1828,7 @@ static Standard_Boolean getUsersShapesOfSHUO (TopLoc_IndexedMapOfLocation& aPrev // get previous set location aNewPrevLocMap.Add( loc ); aNewPrevLocMap.Add( compLoc ); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= aPrevLocMap.Extent(); i++) aNewPrevLocMap.Add( aPrevLocMap.FindKey(i) ); TDF_Label L = theUserL.Father(); @@ -2056,7 +2056,7 @@ void XCAFDoc_ShapeTool::makeSubShape (const TDF_Label& theMainShapeL, TDF_Label aSubLabel; // Identical location and empty location are not the same for ShapeTool, so try to process both // in case of aSubLoc is not identical, the second Add try will not affect algorithm. - Standard_Boolean isNewSubL; + Standard_Boolean isNewSubL = 0; isNewSubL = AddSubShape(thePart, aChildShape.Located(aSubLoc, Standard_False), aSubLabel); if (aSubLabel.IsNull()) { @@ -2253,7 +2253,7 @@ void XCAFDoc_ShapeTool::DumpJson (Standard_OStream& theOStream, Standard_Integer for (XCAFDoc_DataMapOfShapeLabel::Iterator aShapeLabelIt (myShapeLabels); aShapeLabelIt.More(); aShapeLabelIt.Next()) { - const TopoDS_Shape aShape = aShapeLabelIt.Key(); + const TopoDS_Shape& aShape = aShapeLabelIt.Key(); OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, &aShape) TCollection_AsciiString aShapeLabel; @@ -2263,7 +2263,7 @@ void XCAFDoc_ShapeTool::DumpJson (Standard_OStream& theOStream, Standard_Integer for (XCAFDoc_DataMapOfShapeLabel::Iterator aSubShapeIt (mySubShapes); aSubShapeIt.More(); aSubShapeIt.Next()) { - const TopoDS_Shape aSubShape = aSubShapeIt.Key(); + const TopoDS_Shape& aSubShape = aSubShapeIt.Key(); OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, &aSubShape) TCollection_AsciiString aSubShapeLabel; @@ -2273,7 +2273,7 @@ void XCAFDoc_ShapeTool::DumpJson (Standard_OStream& theOStream, Standard_Integer for (XCAFDoc_DataMapOfShapeLabel::Iterator aSimpleShapeIt (mySimpleShapes); aSimpleShapeIt.More(); aSimpleShapeIt.Next()) { - const TopoDS_Shape aSimpleShape = aSimpleShapeIt.Key(); + const TopoDS_Shape& aSimpleShape = aSimpleShapeIt.Key(); OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, &aSimpleShape) TCollection_AsciiString aSimpleShapeLabel; diff --git a/src/XCAFPrs/XCAFPrs_AISObject.cxx b/src/XCAFPrs/XCAFPrs_AISObject.cxx index e890665988..9ec3fa25a4 100644 --- a/src/XCAFPrs/XCAFPrs_AISObject.cxx +++ b/src/XCAFPrs/XCAFPrs_AISObject.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -42,13 +44,13 @@ IMPLEMENT_STANDARD_RTTIEXT(XCAFPrs_AISObject,AIS_ColoredShape) XCAFPrs_AISObject::XCAFPrs_AISObject (const TDF_Label& theLabel) : AIS_ColoredShape(TopoDS_Shape()), - myToSyncStyles (Standard_True) + myLabel(theLabel), myToSyncStyles (Standard_True) { // define plastic material by default for proper color reproduction setMaterial (myDrawer, Graphic3d_NameOfMaterial_Plastified, Standard_False, Standard_False); hasOwnMaterial = Standard_True; - myLabel = theLabel; + } //======================================================================= @@ -72,7 +74,7 @@ static void DisplayText (const TDF_Label& aLabel, BRepBndLib::Add (aShape, aBox); if ( ! aBox.IsVoid() ) { - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin = NAN, aYmin = NAN, aZmin = NAN, aXmax = NAN, aYmax = NAN, aZmax = NAN; aBox.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); gp_Pnt aPnt (0.5 * (aXmin + aXmax), 0.5 * (aYmin + aYmax), 0.5 * (aZmin + aZmax)); Prs3d_Text::Draw (aPrs->CurrentGroup(), anAspect, aName->Get(), aPnt); diff --git a/src/XCAFView/XCAFView_Object.cxx b/src/XCAFView/XCAFView_Object.cxx index bc1e06f1de..f52d19a3b6 100644 --- a/src/XCAFView/XCAFView_Object.cxx +++ b/src/XCAFView/XCAFView_Object.cxx @@ -21,34 +21,34 @@ IMPLEMENT_STANDARD_RTTIEXT(XCAFView_Object,Standard_Transient) //function : XCAFView_Object //purpose : //======================================================================= -XCAFView_Object::XCAFView_Object() +XCAFView_Object::XCAFView_Object() : myClippingExpression(new TCollection_HAsciiString()), myFrontPlaneClipping(Standard_False), myBackPlaneClipping(Standard_False), myViewVolumeSidesClipping(Standard_False), myGDTPoints(NULL) { - myClippingExpression = new TCollection_HAsciiString(); - myFrontPlaneClipping = Standard_False; - myBackPlaneClipping = Standard_False; - myViewVolumeSidesClipping = Standard_False; - myGDTPoints = NULL; + + + + + } //======================================================================= //function : XCAFView_Object //purpose : //======================================================================= -XCAFView_Object::XCAFView_Object(const Handle(XCAFView_Object)& theObj) +XCAFView_Object::XCAFView_Object(const Handle(XCAFView_Object)& theObj) : myType(theObj->myType), myProjectionPoint(theObj->myProjectionPoint), myViewDirection(theObj->myViewDirection), myUpDirection(theObj->myUpDirection), myZoomFactor(theObj->myZoomFactor), myWindowHorizontalSize(theObj->myWindowHorizontalSize), myWindowVerticalSize(theObj->myWindowVerticalSize), myClippingExpression(theObj->myClippingExpression), myFrontPlaneClipping(theObj->myFrontPlaneClipping), myFrontPlaneDistance(theObj->myFrontPlaneDistance), myBackPlaneClipping(theObj->myBackPlaneClipping), myBackPlaneDistance(theObj->myBackPlaneDistance), myViewVolumeSidesClipping(theObj->myViewVolumeSidesClipping), myGDTPoints(NULL) { - myType = theObj->myType; - myProjectionPoint = theObj->myProjectionPoint; - myViewDirection = theObj->myViewDirection; - myUpDirection = theObj->myUpDirection; - myZoomFactor = theObj->myZoomFactor; - myWindowHorizontalSize = theObj->myWindowHorizontalSize; - myWindowVerticalSize = theObj->myWindowVerticalSize; - myClippingExpression = theObj->myClippingExpression; - myFrontPlaneClipping = theObj->myFrontPlaneClipping; - myFrontPlaneDistance = theObj->myFrontPlaneDistance; - myBackPlaneClipping = theObj->myBackPlaneClipping; - myBackPlaneDistance = theObj->myBackPlaneDistance; - myViewVolumeSidesClipping = theObj->myViewVolumeSidesClipping; - myGDTPoints = NULL; + + + + + + + + + + + + + + } diff --git a/src/XCAFView/XCAFView_Object.hxx b/src/XCAFView/XCAFView_Object.hxx index b80b032acf..18bdead369 100644 --- a/src/XCAFView/XCAFView_Object.hxx +++ b/src/XCAFView/XCAFView_Object.hxx @@ -226,14 +226,14 @@ private: gp_Pnt myProjectionPoint; gp_Dir myViewDirection; gp_Dir myUpDirection; - Standard_Real myZoomFactor; - Standard_Real myWindowHorizontalSize; - Standard_Real myWindowVerticalSize; + Standard_Real myZoomFactor{}; + Standard_Real myWindowHorizontalSize{}; + Standard_Real myWindowVerticalSize{}; Handle(TCollection_HAsciiString) myClippingExpression; Standard_Boolean myFrontPlaneClipping; - Standard_Real myFrontPlaneDistance; + Standard_Real myFrontPlaneDistance{}; Standard_Boolean myBackPlaneClipping; - Standard_Real myBackPlaneDistance; + Standard_Real myBackPlaneDistance{}; Standard_Boolean myViewVolumeSidesClipping; Handle(TColgp_HArray1OfPnt) myGDTPoints; // Point for each GDT to describe position of GDT frame in View. }; diff --git a/src/XSAlgo/XSAlgo_AlgoContainer.cxx b/src/XSAlgo/XSAlgo_AlgoContainer.cxx index 5b9cd8b79c..28f5abdb1b 100644 --- a/src/XSAlgo/XSAlgo_AlgoContainer.cxx +++ b/src/XSAlgo/XSAlgo_AlgoContainer.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -65,9 +67,9 @@ IMPLEMENT_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient) //function : XSAlgo_AlgoContainer //purpose : //======================================================================= -XSAlgo_AlgoContainer::XSAlgo_AlgoContainer() +XSAlgo_AlgoContainer::XSAlgo_AlgoContainer() : myTC(new XSAlgo_ToolContainer) { - myTC = new XSAlgo_ToolContainer; + } //======================================================================= @@ -284,13 +286,13 @@ TopoDS_Shape XSAlgo_AlgoContainer::PerformFixShape(const TopoDS_Shape& S, // Purpose : for CheckPCurve // ============================================================================ -static TopoDS_Edge MakeEdgeOnCurve(const TopoDS_Edge edge) +static TopoDS_Edge MakeEdgeOnCurve(const TopoDS_Edge& edge) { TopoDS_Edge result; //BRep_Builder B; // B not used - see below (skl) Handle(Geom_Curve) C3d; ShapeAnalysis_Edge sae; - Standard_Real cf, cl; + Standard_Real cf = NAN, cl = NAN; if (!sae.Curve3d (edge, C3d, cf, cl, Standard_False )) return result; gp_Pnt PV1 = C3d->Value(cf); @@ -314,7 +316,7 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E, const Standard_Real preci, const Standard_Boolean isSeam) const { - Standard_Real w1, w2; + Standard_Real w1 = NAN, w2 = NAN; Handle(Geom2d_Curve) thePC; ShapeAnalysis_Edge sae; if ( ! sae.PCurve (E, face, thePC, w1, w2, Standard_False ) ) { @@ -323,7 +325,7 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E, // Check for pcurve longer than surface Handle(Geom_Surface) surf = BRep_Tool::Surface(face); - Standard_Real UF,UL,VF,VL; + Standard_Real UF = NAN,UL = NAN,VF = NAN,VL = NAN; surf->Bounds (UF,UL,VF,VL); gp_Pnt2d PUV1, PUV2; PUV1 = thePC->Value(w1); @@ -345,7 +347,7 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E, // ex. : UVV en DEGRES sur une surface en RADIANS, recalee = 57 tours ! Handle(Geom_Curve) C3d; - Standard_Real cf1, cl1; + Standard_Real cf1 = NAN, cl1 = NAN; sae.Curve3d (E, C3d, cf1, cl1, Standard_False ); gp_Pnt P1 = surf->Value(PUV1.X(), PUV1.Y()); @@ -376,7 +378,7 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E, BRep_Builder B; Handle(Geom2d_Curve) seamPC; if ( isSeam ) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; TopoDS_Shape REdge = E.Reversed() ; if ( ! sae.PCurve ( TopoDS::Edge ( REdge ), face, seamPC, f, l, Standard_False ) || @@ -422,7 +424,7 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E, // get corrected pcurve from the temporary edge, and put to original sae.PCurve ( edge, face, thePC, w1, w2, Standard_False ); if ( isSeam ) { - Standard_Real f, l; + Standard_Real f = NAN, l = NAN; TopoDS_Shape REdge = edge.Reversed(); sae.PCurve ( TopoDS::Edge ( REdge ), face, seamPC, f, l, Standard_False ); if ( E.Orientation() == TopAbs_REVERSED ) //:abv 14.11.01: coneEl.sat loop diff --git a/src/XSControl/XSControl_ConnectedShapes.cxx b/src/XSControl/XSControl_ConnectedShapes.cxx index 1abd723766..bdf1bf6661 100644 --- a/src/XSControl/XSControl_ConnectedShapes.cxx +++ b/src/XSControl/XSControl_ConnectedShapes.cxx @@ -64,7 +64,7 @@ XSControl_ConnectedShapes::XSControl_ConnectedShapes () const TopAbs_ShapeEnum type) { Handle(TColStd_HSequenceOfTransient) li = new TColStd_HSequenceOfTransient(); - Standard_Integer i, nb = TP->NbMapped(); + Standard_Integer i = 0, nb = TP->NbMapped(); // TopTools_MapOfShape adj (nb); TopTools_MapOfShape vtx(20); @@ -78,7 +78,7 @@ XSControl_ConnectedShapes::XSControl_ConnectedShapes () if (sh.IsNull()) continue; if (sh.ShapeType() != type) continue; for (TopExp_Explorer vsh(sh,TopAbs_VERTEX); vsh.More(); vsh.Next()) { - TopoDS_Shape avtx = vsh.Current(); + const TopoDS_Shape& avtx = vsh.Current(); if (vtx.Contains(avtx)) { li->Append (TP->Mapped(i)); break; // break de ce for interieur, entite suivante diff --git a/src/XSControl/XSControl_Controller.cxx b/src/XSControl/XSControl_Controller.cxx index 08ddcf2b22..3b08e576ac 100644 --- a/src/XSControl/XSControl_Controller.cxx +++ b/src/XSControl/XSControl_Controller.cxx @@ -457,7 +457,7 @@ void XSControl_Controller::Customise (Handle(XSControl_WorkSession)& WS) } // Applied Modifiers - Standard_Integer i, nb = myAdaptorApplied.Length(); + Standard_Integer i = 0, nb = myAdaptorApplied.Length(); for (i = 1; i <= nb; i ++) { const Handle(Standard_Transient) &anitem = myAdaptorApplied.Value(i); Handle(TCollection_HAsciiString) name = WS->Name(anitem); diff --git a/src/XSControl/XSControl_FuncShape.cxx b/src/XSControl/XSControl_FuncShape.cxx index d161a2c064..faf6d00d1e 100644 --- a/src/XSControl/XSControl_FuncShape.cxx +++ b/src/XSControl/XSControl_FuncShape.cxx @@ -90,7 +90,7 @@ static IFSelect_ReturnStatus XSControl_tpdraw TopoDS_Shape sh; char nomvar[40]; // Standard_Boolean moderoot = (pilot->Word(0).Value(3) == 'r'); - Standard_Integer n1, n2, i, max=0, index=0; + Standard_Integer n1 = 0, n2 = 0, i = 0, max=0, index=0; Handle(Interface_InterfaceModel) model = TP->Model(); if (model.IsNull()) { if (mode == 0) { @@ -391,7 +391,7 @@ static IFSelect_ReturnStatus XSControl_fromshape TopoDS_Shape S0 = Shape; TopLoc_Location L; S0.Location ( L ); - Standard_Integer i, nb = TP->NbMapped(); + Standard_Integer i = 0, nb = TP->NbMapped(); if ( ! silent ) sout<<"searching in map among "<Mapped(i); @@ -423,7 +423,7 @@ static IFSelect_ReturnStatus XSControl_fromshape sout<EntityFromShapeResult(subsh,submodrec); if (subent.IsNull()) { @@ -530,7 +530,7 @@ static IFSelect_ReturnStatus XSControl_trconnexentities Handle(TColStd_HSequenceOfTransient) list = XSControl_ConnectedShapes::AdjacentEntities (Shape,TP,TopAbs_FACE); - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); sout<Model(); sout<<"("; @@ -758,7 +758,7 @@ Standard_Integer XSControl_FuncShape::MoreShapes list->Append (li); return li->Length(); } - Standard_Integer i, paro = 0, parf = 0, moins = 0, n1 = 0, n2 = 0; + Standard_Integer i = 0, paro = 0, parf = 0, moins = 0, n1 = 0, n2 = 0; for (i = 0; name[i] != '\0'; i ++) { if (name[i] == '(') paro = i; if (name[i] == '-') moins = i; @@ -819,7 +819,7 @@ Standard_Boolean XSControl_FuncShape::FileAndVar resvar.AssignCat (var); else if (resfile.Length() == 0) resvar.AssignCat (def); else { - Standard_Integer nomdeb, nomfin; + Standard_Integer nomdeb = 0, nomfin = 0; nomdeb = resfile.SearchFromEnd ("/"); if (nomdeb <= 0) nomdeb = resfile.SearchFromEnd("\\"); // pour NT if (nomdeb < 0) nomdeb = 0; diff --git a/src/XSControl/XSControl_Functions.cxx b/src/XSControl/XSControl_Functions.cxx index efe8bb8e3f..4836cbb1fd 100644 --- a/src/XSControl/XSControl_Functions.cxx +++ b/src/XSControl/XSControl_Functions.cxx @@ -304,7 +304,7 @@ static IFSelect_ReturnStatus XSControl_trstat(const Handle(IFSelect_SessionPilot if (!TR->IsRecorded(ent)) { sout<<" Entity "<FinalResult(ent); Handle(TColStd_HSequenceOfTransient) list = TR->CheckedList(ent); - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); if (nb > 0) sout<<" Entities implied by Check/Result :"<Print(list->Value(i), sout); } sout<TransferWriter(); Handle(XSControl_Controller) control = XSControl::Session(pilot)->NormAdaptor(); - Standard_Integer modemin,modemax; + Standard_Integer modemin = 0,modemax = 0; Message_Messenger::StreamBuffer sout = Message::SendInfo(); if (control->ModeWriteBounds (modemin,modemax)) { sout<<"Write Mode : allowed values "<Append (RootForTransfer(i)); return list; } @@ -192,7 +192,7 @@ Standard_Integer XSControl_Reader::NbRootsForTransfer () if (therootsta) return theroots.Length(); therootsta = Standard_True; Interface_ShareFlags sf (thesession->Graph()); - Standard_Integer i, nbr = sf.NbRoots(); + Standard_Integer i = 0, nbr = sf.NbRoots(); for (i = 1; i <= nbr; i ++) { // on filtre les racines qu on sait transferer Handle(Standard_Transient) start = sf.Root(i); @@ -276,7 +276,7 @@ Standard_Integer XSControl_Reader::TransferList { if (list.IsNull()) return 0; Standard_Integer nbt = 0; - Standard_Integer i, nb = list->Length(); + Standard_Integer i = 0, nb = list->Length(); const Handle(XSControl_TransferReader) &TR = thesession->TransferReader(); TR->BeginTransfer(); ClearShapes(); @@ -303,7 +303,7 @@ Standard_Integer XSControl_Reader::TransferRoots (const Message_ProgressRange& { NbRootsForTransfer(); Standard_Integer nbt = 0; - Standard_Integer i, nb = theroots.Length(); + Standard_Integer i = 0, nb = theroots.Length(); const Handle(XSControl_TransferReader) &TR = thesession->TransferReader(); TR->BeginTransfer(); @@ -374,7 +374,7 @@ TopoDS_Shape XSControl_Reader::Shape (const Standard_Integer num) const TopoDS_Shape XSControl_Reader::OneShape () const { TopoDS_Shape sh; - Standard_Integer i,nb = theshapes.Length(); + Standard_Integer i = 0,nb = theshapes.Length(); if (nb == 0) return sh; if (nb == 1) return theshapes.Value(1); TopoDS_Compound C; @@ -468,9 +468,8 @@ void XSControl_Reader::GetStatsTransfer (const Handle(TColStd_HSequenceOfTransie nbMapped = nbWithFail = nbWithResult = 0; for (itrp.Start(); itrp.More(); itrp.Next()) { - Handle(Transfer_Binder) binder = itrp.Value(); - Handle(Standard_Transient) ent = itrp.Starting(); - nbMapped++; + const Handle(Transfer_Binder)& binder = itrp.Value(); + nbMapped++; if (binder.IsNull()) nbWithFail++; else if(!binder->HasResult()) nbWithFail++; diff --git a/src/XSControl/XSControl_Reader.hxx b/src/XSControl/XSControl_Reader.hxx index 99211cd72b..ead55369f8 100644 --- a/src/XSControl/XSControl_Reader.hxx +++ b/src/XSControl/XSControl_Reader.hxx @@ -270,7 +270,7 @@ protected: Standard_EXPORT TopTools_SequenceOfShape& Shapes(); - Standard_Boolean therootsta; + Standard_Boolean therootsta{}; TColStd_SequenceOfTransient theroots; diff --git a/src/XSControl/XSControl_SelectForTransfer.cxx b/src/XSControl/XSControl_SelectForTransfer.cxx index c1cfcba78d..4cc0dea77b 100644 --- a/src/XSControl/XSControl_SelectForTransfer.cxx +++ b/src/XSControl/XSControl_SelectForTransfer.cxx @@ -25,8 +25,8 @@ IMPLEMENT_STANDARD_RTTIEXT(XSControl_SelectForTransfer,IFSelect_SelectExtract) XSControl_SelectForTransfer::XSControl_SelectForTransfer () { } XSControl_SelectForTransfer::XSControl_SelectForTransfer - (const Handle(XSControl_TransferReader)& TR) - { theTR = TR; } + (const Handle(XSControl_TransferReader)& TR) : theTR(TR) + { } void XSControl_SelectForTransfer::SetReader diff --git a/src/XSControl/XSControl_TransferReader.cxx b/src/XSControl/XSControl_TransferReader.cxx index d1f73102bb..40ec8431b2 100644 --- a/src/XSControl/XSControl_TransferReader.cxx +++ b/src/XSControl/XSControl_TransferReader.cxx @@ -240,7 +240,7 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::RecordedList () c { Handle(TColStd_HSequenceOfTransient) li = new TColStd_HSequenceOfTransient(); if (myModel.IsNull()) return li; - Standard_Integer i, nb = myModel->NbEntities(); + Standard_Integer i = 0, nb = myModel->NbEntities(); for (i = 1; i <= nb; i ++) { if(myResults.IsBound(i)) if(!myResults.Find(i).IsNull()) li->Append (myModel->Value(i)); @@ -450,7 +450,7 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromResult Handle(Transfer_Binder) abinder; DeclareAndCast(Transfer_Binder,binder,res); - Standard_Integer i,j,nb; + Standard_Integer i = 0,j = 0,nb = 0; if (mode == 0 || mode == 1) { // on regarde dans le TransientProcess (Roots ou tous Mappeds) @@ -481,7 +481,7 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromResult Handle(Transfer_ResultFromModel) rec = ResultFromNumber (i); if (rec.IsNull()) return nulh; Handle(TColStd_HSequenceOfTransient) list = rec->Results (mode-2); - Standard_Integer ir,nr = list->Length(); + Standard_Integer ir = 0,nr = list->Length(); for (ir = 1; ir <= nr; ir ++) { DeclareAndCast(Transfer_ResultFromTransient,rft,list->Value(ir)); if (rft.IsNull()) continue; @@ -509,7 +509,7 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromShapeResult { Handle(Standard_Transient) nulh, samesh, partner; if (res.IsNull()) return nulh; - Standard_Integer i,j,nb; + Standard_Integer i = 0,j = 0,nb = 0; XSControl_Utils xu; if (mode == 0 || mode == 1 || mode == -1) { @@ -544,7 +544,7 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromShapeResult if (rec.IsNull()) continue; Handle(TColStd_HSequenceOfTransient) list = rec->Results (mode-2); - Standard_Integer ir,nr = list->Length(); + Standard_Integer ir = 0,nr = list->Length(); for (ir = 1; ir <= nr; ir ++) { DeclareAndCast(Transfer_ResultFromTransient,rft,list->Value(ir)); if (rft.IsNull()) continue; @@ -573,7 +573,7 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::EntitiesFromShape TopTools_MapOfShape shapes; // On convertit res en une map, pour test de presence rapide - Standard_Integer i, j, nb = res->Length(); + Standard_Integer i = 0, j = 0, nb = res->Length(); if (nb == 0) return lt; for (i = 1; i <= nb; i ++) shapes.Add (res->Value(i)); @@ -605,7 +605,7 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::EntitiesFromShape if (rec.IsNull()) continue; Handle(TColStd_HSequenceOfTransient) list = rec->Results (mode-2); - Standard_Integer ir,nr = list->Length(); + Standard_Integer ir = 0,nr = list->Length(); for (ir = 1; ir <= nr; ir ++) { DeclareAndCast(Transfer_ResultFromTransient,rft,list->Value(i)); if (rft.IsNull()) continue; @@ -635,7 +635,7 @@ Interface_CheckIterator XSControl_TransferReader::CheckList if (myModel.IsNull() || ent.IsNull()) return chl; // Check-List COMPLETE ... tout le Modele if (ent == myModel) { - Standard_Integer i,nb = myModel->NbEntities(); + Standard_Integer i = 0,nb = myModel->NbEntities(); for (i = 1; i <= nb; i ++) { Handle(Transfer_ResultFromModel) rec = ResultFromNumber (i); if (!rec.IsNull()) { @@ -647,7 +647,7 @@ Interface_CheckIterator XSControl_TransferReader::CheckList // Check-List sur une LISTE ... else if (ent->IsKind(STANDARD_TYPE(TColStd_HSequenceOfTransient))) { DeclareAndCast(TColStd_HSequenceOfTransient,list,ent); - Standard_Integer i,nb = list->Length(); + Standard_Integer i = 0,nb = list->Length(); for (i = 1; i <= nb; i ++) { Handle(Transfer_ResultFromModel) rec = FinalResult (list->Value(i)); if (!rec.IsNull()) { @@ -705,14 +705,14 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::CheckedList if (ent.IsNull()) return res; if (ent == myModel) { - Standard_Integer i,nb = myModel->NbEntities(); + Standard_Integer i = 0,nb = myModel->NbEntities(); for (i = 1; i <= nb; i ++) { Handle(Transfer_ResultFromModel) rec = ResultFromNumber (i); if (!rec.IsNull()) res->Append (rec->CheckedList(withcheck,level)); } } else if (ent->IsKind(STANDARD_TYPE(TColStd_HSequenceOfTransient))) { DeclareAndCast(TColStd_HSequenceOfTransient,list,ent); - Standard_Integer i,nb = list->Length(); + Standard_Integer i = 0,nb = list->Length(); for (i = 1; i <= nb; i ++) { Handle(Transfer_ResultFromModel) rec = FinalResult (list->Value(i)); if (!rec.IsNull()) res->Append (rec->CheckedList(withcheck,level)); @@ -808,7 +808,7 @@ Standard_Integer XSControl_TransferReader::TransferOne // seule difference entre TransferRoots et TransferOne Standard_Integer res = 0; - Handle(Standard_Transient) obj = ent; + const Handle(Standard_Transient)& obj = ent; TP.Transfer (obj, theProgress); if (theProgress.UserBreak()) return res; @@ -846,7 +846,7 @@ Standard_Integer XSControl_TransferReader::TransferList if (myGraph.IsNull()) myTP->SetModel(myModel); else myTP->SetGraph(myGraph); - Standard_Integer i,nb = list->Length(); + Standard_Integer i = 0,nb = list->Length(); // Pour le log-file if (level > 0) { @@ -925,7 +925,7 @@ Standard_Integer XSControl_TransferReader::TransferRoots(const Interface_Graph& return -1; // Les entites transferees sont notees "asmain" - Standard_Integer i,n = myTP->NbMapped(); + Standard_Integer i = 0,n = myTP->NbMapped(); for (i = 1; i <= n; i ++) { Handle(Standard_Transient) ent = myTP->Mapped(i); Handle(Transfer_Binder) bnd = myTP->MapItem(i); @@ -980,7 +980,7 @@ void XSControl_TransferReader::PrintStats (Standard_OStream& sout, sout << "****** Final Results ******"<Length(); + Standard_Integer i = 0, nb = list->Length(); Handle(IFSelect_SignatureList) counter; if (mode > 2) counter = new IFSelect_SignatureList (mode == 6); IFSelect_PrintCount pcm = IFSelect_CountByItem; @@ -1032,7 +1032,7 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::LastTransferList { Handle(TColStd_HSequenceOfTransient) li = new TColStd_HSequenceOfTransient(); if (myTP.IsNull()) return li; - Standard_Integer i,j,nb = + Standard_Integer i = 0,j = 0,nb = (roots ? myTP->NbRoots() : myTP->NbMapped()); for (j = 1; j <= nb; j ++) { i = (roots ? myModel->Number (myTP->Root(j)) : j); @@ -1061,7 +1061,7 @@ const Handle(TopTools_HSequenceOfShape) & XSControl_TransferReader::ShapeResultL if (myModel.IsNull()) return myShapeResult; Handle(TColStd_HSequenceOfTransient) li = RecordedList(); myShapeResult = new TopTools_HSequenceOfShape(); - Standard_Integer i, nb = myModel->NbEntities(); + Standard_Integer i = 0, nb = myModel->NbEntities(); TopoDS_Shape sh; for (i = 1; i <= nb; i ++) { sh = ShapeResult (myModel->Value(i)); @@ -1175,7 +1175,7 @@ void XSControl_TransferReader::PrintStatsOnList(const Handle(Transfer_TransientP Handle(Interface_InterfaceModel) model = TP->Model(); if (what >= 1 && what <= 3) { - Standard_Integer stat; + Standard_Integer stat = 0; Standard_Integer nbv = 0, nbw = 0, nbf = 0, nbr = 0, nbrw = 0, nbrf = 0, nbnr = 0, nbi = 0; Transfer_IteratorOfProcessForTransient itrp(Standard_True); if (what == 1) itrp = TP->RootResult(Standard_True); @@ -1197,8 +1197,8 @@ void XSControl_TransferReader::PrintStatsOnList(const Handle(Transfer_TransientP for (itrp.Start(); itrp.More(); itrp.Next()) { nbi ++; - Handle(Transfer_Binder) binder = itrp.Value(); - Handle(Standard_Transient) ent = itrp.Starting(); + const Handle(Transfer_Binder)& binder = itrp.Value(); + const Handle(Standard_Transient)& ent = itrp.Starting(); if (binder.IsNull()) { nbnr ++; if (notrec) counter->Add(ent,"(not recorded)"); @@ -1231,7 +1231,7 @@ void XSControl_TransferReader::PrintStatsOnList(const Handle(Transfer_TransientP if (mode == 1) continue; const Handle(Interface_Check)& ch = binder->Check(); - Standard_Integer newi,newnbw = ch->NbWarnings(), newnbf = ch->NbFails(); + Standard_Integer newi = 0,newnbw = ch->NbWarnings(), newnbf = ch->NbFails(); if (newnbw > 0) { sout<<" - Warnings : "<NbMapped(); + Standard_Integer i = 0, nb = myTransferWriter->NbMapped(); for (i = 1; i <= nb; i ++) { DeclareAndCast(Transfer_SimpleBinderOfTransient,tb,myTransferWriter->MapItem(i)); if (tb.IsNull()) continue; @@ -206,7 +206,7 @@ Interface_CheckIterator XSControl_TransferWriter::ResultCheckList { Interface_CheckIterator chl; if (myTransferWriter.IsNull()) return chl; - Standard_Integer i, nb = myTransferWriter->NbMapped(); + Standard_Integer i = 0, nb = myTransferWriter->NbMapped(); for (i = 1; i <= nb; i ++) { DeclareAndCast(Transfer_SimpleBinderOfTransient,tb,myTransferWriter->MapItem(i)); if (tb.IsNull()) continue; diff --git a/src/XSControl/XSControl_Utils.cxx b/src/XSControl/XSControl_Utils.cxx index 2df8058d79..ed8dd2dc38 100644 --- a/src/XSControl/XSControl_Utils.cxx +++ b/src/XSControl/XSControl_Utils.cxx @@ -60,7 +60,7 @@ static const Standard_ExtString voidext = { 0 }; void XSControl_Utils::TraceLines (const Handle(Standard_Transient)& lines) const { Message_Messenger::StreamBuffer sout = Message::SendInfo(); - Standard_Integer i,nb; + Standard_Integer i = 0,nb = 0; DeclareAndCast(TColStd_HSequenceOfHAsciiString,linha,lines); if (!linha.IsNull()) { nb = linha->Length(); @@ -229,7 +229,7 @@ static const Standard_ExtString voidext = { 0 }; Standard_CString XSControl_Utils::ExtendedToAscii (const Standard_ExtString str) const { bufext.Clear(); bufext.AssignCat (str); bufasc.Clear(); - Standard_Integer i, nb = bufext.Length(); + Standard_Integer i = 0, nb = bufext.Length(); for (i = 1; i <= nb; i ++) { int unext = bufext.Value(i); unext = unext & 127; @@ -340,7 +340,7 @@ static const Standard_ExtString voidext = { 0 }; BRep_Builder B; TopoDS_Compound C; B.MakeCompound(C); - Standard_Integer i,n = seqval->Length(); + Standard_Integer i = 0,n = seqval->Length(); for (i = 1; i <= n ; i ++) B.Add(C,seqval->Value(i)); return C; } @@ -353,7 +353,7 @@ static const Standard_ExtString voidext = { 0 }; if (!compound || res != TopAbs_COMPOUND) return res; res = TopAbs_SHAPE; for (TopoDS_Iterator iter(shape); iter.More(); iter.Next()) { - TopoDS_Shape sh = iter.Value(); + const TopoDS_Shape& sh = iter.Value(); if (sh.IsNull()) continue; TopAbs_ShapeEnum typ = sh.ShapeType(); if (typ == TopAbs_COMPOUND) typ = ShapeType (sh,compound); @@ -522,7 +522,7 @@ static const Standard_ExtString voidext = { 0 }; Handle(Standard_Transient) XSControl_Utils::SeqToArr (const Handle(Standard_Transient)& seqval, const Standard_Integer first) const { - Standard_Integer i,lng; + Standard_Integer i = 0,lng = 0; Handle(Standard_Transient) val; if (seqval.IsNull()) return val; DeclareAndCast(TColStd_HSequenceOfHAsciiString,seqs,seqval); @@ -548,7 +548,7 @@ static const Standard_ExtString voidext = { 0 }; Handle(Standard_Transient) XSControl_Utils::ArrToSeq (const Handle(Standard_Transient)& arrval) const { - Standard_Integer i,first,last; + Standard_Integer i = 0,first = 0,last = 0; Handle(Standard_Transient) val; if (arrval.IsNull()) return val; DeclareAndCast(Interface_HArray1OfHAsciiString,arrs,arrval); diff --git a/src/XSControl/XSControl_WorkSession.cxx b/src/XSControl/XSControl_WorkSession.cxx index 07ff5ce3eb..f27664bda4 100644 --- a/src/XSControl/XSControl_WorkSession.cxx +++ b/src/XSControl/XSControl_WorkSession.cxx @@ -250,7 +250,7 @@ Standard_Boolean XSControl_WorkSession::PrintTransferStatus(const Standard_Inte // *** CHECK (commun READ+WRITE) *** if (!binder.IsNull()) { const Handle(Interface_Check) ch = binder->Check(); - Standard_Integer i,nbw = ch->NbWarnings(), nbf = ch->NbFails(); + Standard_Integer i = 0,nbw = ch->NbWarnings(), nbf = ch->NbFails(); if (nbw > 0) { S<<" - Warnings : "<CWarning(i)<SetGraph (HGraph()); } Handle(TColStd_HSequenceOfTransient) lis = myTransferReader->RecordedList(); - Standard_Integer i, nb = lis->Length(); + Standard_Integer i = 0, nb = lis->Length(); for (i = 1; i <= nb; i ++) TP->SetRoot(lis->Value(i)); } if (mode == 3) { Handle(Transfer_TransientProcess) TP = myTransferReader->TransientProcess(); if (TP.IsNull()) return; - Standard_Integer i, nb = TP->NbRoots(); + Standard_Integer i = 0, nb = TP->NbRoots(); for (i = 1; i <= nb; i ++) myTransferReader->RecordResult(TP->Root(i)); } if (mode == 4 || mode == 5) myTransferReader->BeginTransfer(); diff --git a/src/Xw/Xw_Window.cxx b/src/Xw/Xw_Window.cxx index 548767a4fe..dfc457c66a 100644 --- a/src/Xw/Xw_Window.cxx +++ b/src/Xw/Xw_Window.cxx @@ -334,7 +334,7 @@ void Xw_Window::Position (Standard_Integer& theX1, Standard_Integer& theY1, XWindowAttributes anAttributes; memset (&anAttributes, 0, sizeof(anAttributes)); XGetWindowAttributes (myDisplay->GetDisplay(), (Window )myXWindow, &anAttributes); - Window aChild; + Window aChild = 0; XTranslateCoordinates (myDisplay->GetDisplay(), anAttributes.root, (Window )myXWindow, 0, 0, &anAttributes.x, &anAttributes.y, &aChild); diff --git a/src/gce/gce_MakeCirc.cxx b/src/gce/gce_MakeCirc.cxx index 18ecf6b2b1..142e25f55e 100644 --- a/src/gce/gce_MakeCirc.cxx +++ b/src/gce/gce_MakeCirc.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,11 +49,11 @@ //========================================================================= gce_MakeCirc::gce_MakeCirc(const gp_Pnt& P1 , const gp_Pnt& P2 , - const gp_Pnt& P3) { + const gp_Pnt& P3) : gce_Root() { //========================================================================= // Traitement. + //========================================================================= - Standard_Real dist1, dist2, dist3, aResolution; + Standard_Real dist1 = NAN, dist2 = NAN, dist3 = NAN, aResolution = NAN; // aResolution = gp::Resolution(); // @@ -70,7 +72,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& P1 , return; } // - Standard_Real x1,y1,z1,x2,y2,z2,x3,y3,z3; + Standard_Real x1 = NAN,y1 = NAN,z1 = NAN,x2 = NAN,y2 = NAN,z2 = NAN,x3 = NAN,y3 = NAN,z3 = NAN; // P1.Coord(x1,y1,z1); P2.Coord(x2,y2,z2); @@ -106,7 +108,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& P1 , TheError = gce_IntersectionError; } else { - Standard_Integer nbext; + Standard_Integer nbext = 0; // // if (distmin.IsParallel()) { @@ -156,7 +158,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& P1 , //purpose : //======================================================================= gce_MakeCirc::gce_MakeCirc(const gp_Ax2& A2 , - const Standard_Real Radius ) { + const Standard_Real Radius ) : gce_Root() { if (Radius < 0.) { TheError = gce_NegativeRadius; } @@ -171,7 +173,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Ax2& A2 , //========================================================================= gce_MakeCirc::gce_MakeCirc(const gp_Pnt& Center , const gp_Pln& Plane , - const Standard_Real Radius ) { + const Standard_Real Radius ) : gce_Root() { gce_MakeCirc C = gce_MakeCirc(Center,Plane.Position().Direction(),Radius); TheCirc = C.Value(); TheError = C.Status(); @@ -183,7 +185,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& Center , //======================================================================= gce_MakeCirc::gce_MakeCirc(const gp_Pnt& Center , const gp_Dir& Norm , - const Standard_Real Radius ) { + const Standard_Real Radius ) : gce_Root() { if (Radius < 0.) { TheError = gce_NegativeRadius; } @@ -226,7 +228,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& Center , //======================================================================= gce_MakeCirc::gce_MakeCirc(const gp_Pnt& Center , const gp_Pnt& Ptaxis , - const Standard_Real Radius ) { + const Standard_Real Radius ) : gce_Root() { if (Radius < 0.) { TheError = gce_NegativeRadius; } @@ -273,7 +275,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& Center , //purpose : Creation d un gp_Circ par son axe et son rayon . //======================================================================= gce_MakeCirc::gce_MakeCirc(const gp_Ax1& Axis , - const Standard_Real Radius ) + const Standard_Real Radius ) : gce_Root() { if (Radius < 0.) { TheError = gce_NegativeRadius; @@ -318,7 +320,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Ax1& Axis , // donnee. //======================================================================= gce_MakeCirc::gce_MakeCirc(const gp_Circ& Circ , - const Standard_Real Dist ) + const Standard_Real Dist ) : gce_Root() { Standard_Real Rad = Circ.Radius()+Dist; if (Rad < 0.) { @@ -335,7 +337,7 @@ gce_MakeCirc::gce_MakeCirc(const gp_Circ& Circ , // est egal a la distance de a l axe de . //======================================================================= gce_MakeCirc::gce_MakeCirc(const gp_Circ& Circ , - const gp_Pnt& P ) + const gp_Pnt& P ) : gce_Root() { Standard_Real Rad = gp_Lin(Circ.Axis()).Distance(P); TheCirc = gp_Circ(Circ.Position(),Rad); diff --git a/src/gce/gce_MakeCirc2d.cxx b/src/gce/gce_MakeCirc2d.cxx index be1ac73768..143b14f8cc 100644 --- a/src/gce/gce_MakeCirc2d.cxx +++ b/src/gce/gce_MakeCirc2d.cxx @@ -15,6 +15,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ //========================================================================= gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& P1 , const gp_Pnt2d& P2 , - const gp_Pnt2d& P3 ) + const gp_Pnt2d& P3 ) : gce_Root() { gp_Dir2d dirx(1.0,0.0); @@ -67,7 +69,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& P1 , else { gp_Lin2d L1; gp_Lin2d L2; - Standard_Real x1,y1,x2,y2,x3,y3; + Standard_Real x1 = NAN,y1 = NAN,x2 = NAN,y2 = NAN,x3 = NAN,y3 = NAN; P1.Coord(x1,y1); P2.Coord(x2,y2); P3.Coord(x3,y3); @@ -95,7 +97,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& P1 , dist1 = P1.Distance(pInt); dist2 = P2.Distance(pInt); dist3 = P3.Distance(pInt); - Standard_Real xc,yc; + Standard_Real xc = NAN,yc = NAN; pInt.Coord(xc,yc); gp_Dir2d d1(x1-xc,y1-yc); gp_Dir2d d2(xc-x3,yc-y3); @@ -121,7 +123,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& P1 , gce_MakeCirc2d::gce_MakeCirc2d(const gp_Ax2d& XAxis , const Standard_Real Radius , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : gce_Root() { if (Radius >= 0.) { TheCirc2d = gp_Circ2d(XAxis,Radius,Sense); @@ -137,7 +139,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Ax2d& XAxis , //========================================================================== gce_MakeCirc2d::gce_MakeCirc2d(const gp_Ax22d& Axis , - const Standard_Real Radius ) + const Standard_Real Radius ) : gce_Root() { if (Radius >= 0.) { TheCirc2d = gp_Circ2d(Axis,Radius); @@ -155,7 +157,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Ax22d& Axis , gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& Center , const Standard_Real Radius , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : gce_Root() { if (Radius >= 0.) { TheCirc2d = gp_Circ2d(gp_Ax2d(Center,gp_Dir2d(1.0,0.0)),Radius,Sense); @@ -173,7 +175,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& Center , gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& Center , const gp_Pnt2d& Point , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : gce_Root() { TheCirc2d = gp_Circ2d(gp_Ax2d(Center,gp_Dir2d(1.0,0.0)), Point.Distance(Center),Sense); @@ -186,7 +188,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& Center , //========================================================================== gce_MakeCirc2d::gce_MakeCirc2d(const gp_Circ2d& Circ , - const gp_Pnt2d& Point ) + const gp_Pnt2d& Point ) : gce_Root() { TheCirc2d = gp_Circ2d(Circ.Axis(),Point.Distance(Circ.Location())); TheError = gce_Done; @@ -198,7 +200,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Circ2d& Circ , //========================================================================== gce_MakeCirc2d::gce_MakeCirc2d(const gp_Circ2d& Circ , - const Standard_Real Dist1 ) + const Standard_Real Dist1 ) : gce_Root() { TheCirc2d = gp_Circ2d(Circ.Axis(),Abs(Circ.Radius()+Dist1)); TheError = gce_Done; diff --git a/src/gce/gce_MakeCone.cxx b/src/gce/gce_MakeCone.cxx index 27c5792c77..8a38f53c9d 100644 --- a/src/gce/gce_MakeCone.cxx +++ b/src/gce/gce_MakeCone.cxx @@ -30,7 +30,7 @@ //========================================================================= gce_MakeCone::gce_MakeCone(const gp_Ax2& A2 , const Standard_Real Ang , - const Standard_Real Radius) + const Standard_Real Radius) : gce_Root() { if (Radius < 0.0) { TheError = gce_NegativeRadius; } else { @@ -54,7 +54,7 @@ gce_MakeCone::gce_MakeCone(const gp_Ax2& A2 , gce_MakeCone::gce_MakeCone(const gp_Pnt& P1 , const gp_Pnt& P2 , const gp_Pnt& P3 , - const gp_Pnt& P4 ) + const gp_Pnt& P4 ) : gce_Root() { if (P1.Distance(P2)= gp::Resolution()) { TheLin = gp_Lin(P1,gp_Dir(P2.XYZ()-P1.XYZ())); @@ -65,7 +65,7 @@ gce_MakeLin::gce_MakeLin(const gp_Pnt& P1 , //========================================================================= gce_MakeLin::gce_MakeLin(const gp_Lin& Lin , - const gp_Pnt& P ) + const gp_Pnt& P ) : gce_Root() { TheLin = gp_Lin(P,Lin.Direction()); TheError = gce_Done; diff --git a/src/gce/gce_MakeLin2d.cxx b/src/gce/gce_MakeLin2d.cxx index 363941314b..038d148774 100644 --- a/src/gce/gce_MakeLin2d.cxx +++ b/src/gce/gce_MakeLin2d.cxx @@ -26,7 +26,7 @@ //========================================================================= // Creation d une ligne 2d de gp a partir d un Ax2d de gp. + //========================================================================= -gce_MakeLin2d::gce_MakeLin2d(const gp_Ax2d& A) +gce_MakeLin2d::gce_MakeLin2d(const gp_Ax2d& A) : gce_Root() { TheLin2d = gp_Lin2d(A); TheError = gce_Done; @@ -38,7 +38,7 @@ gce_MakeLin2d::gce_MakeLin2d(const gp_Ax2d& A) //========================================================================= gce_MakeLin2d::gce_MakeLin2d(const gp_Pnt2d& P, - const gp_Dir2d& V) + const gp_Dir2d& V) : gce_Root() { TheLin2d = gp_Lin2d(P,V); TheError = gce_Done; @@ -51,7 +51,7 @@ gce_MakeLin2d::gce_MakeLin2d(const gp_Pnt2d& P, gce_MakeLin2d::gce_MakeLin2d(const Standard_Real A, const Standard_Real B, - const Standard_Real C) + const Standard_Real C) : gce_Root() { if (A*A + B*B <= gp::Resolution()) { TheError = gce_NullAxis; @@ -68,7 +68,7 @@ gce_MakeLin2d::gce_MakeLin2d(const Standard_Real A, //========================================================================= gce_MakeLin2d::gce_MakeLin2d(const gp_Pnt2d& P1, - const gp_Pnt2d& P2) + const gp_Pnt2d& P2) : gce_Root() { if (P1.Distance(P2) >= gp::Resolution()) { TheLin2d = gp_Lin2d(P1,gp_Dir2d(P2.XY()-P1.XY())); @@ -85,7 +85,7 @@ gce_MakeLin2d::gce_MakeLin2d(const gp_Pnt2d& P1, //========================================================================= gce_MakeLin2d::gce_MakeLin2d(const gp_Lin2d& Line, - const gp_Pnt2d& Point) + const gp_Pnt2d& Point) : gce_Root() { TheLin2d = gp_Lin2d(Point,Line.Direction()); TheError = gce_Done; @@ -97,7 +97,7 @@ gce_MakeLin2d::gce_MakeLin2d(const gp_Lin2d& Line, //========================================================================= gce_MakeLin2d::gce_MakeLin2d(const gp_Lin2d& Line, - const Standard_Real Dist) + const Standard_Real Dist) : gce_Root() { gp_Pnt2d Point(Line.Location().XY()+ Dist*gp_XY(-Line.Direction().Y(),Line.Direction().X())); diff --git a/src/gce/gce_MakeParab.cxx b/src/gce/gce_MakeParab.cxx index 411aec2d3b..b599ad7bfd 100644 --- a/src/gce/gce_MakeParab.cxx +++ b/src/gce/gce_MakeParab.cxx @@ -23,7 +23,7 @@ #include gce_MakeParab::gce_MakeParab(const gp_Ax2& A2 , - const Standard_Real Focal ) + const Standard_Real Focal ) : gce_Root() { if (Focal < 0.0) { TheError = gce_NullFocusLength; } else { @@ -33,7 +33,7 @@ gce_MakeParab::gce_MakeParab(const gp_Ax2& A2 , } gce_MakeParab::gce_MakeParab(const gp_Ax1& D , - const gp_Pnt& F ) + const gp_Pnt& F ) : gce_Root() { TheParab = gp_Parab(D,F); TheError = gce_Done; diff --git a/src/gce/gce_MakeParab2d.cxx b/src/gce/gce_MakeParab2d.cxx index 680ff4156a..34affa1117 100644 --- a/src/gce/gce_MakeParab2d.cxx +++ b/src/gce/gce_MakeParab2d.cxx @@ -24,7 +24,7 @@ #include gce_MakeParab2d::gce_MakeParab2d(const gp_Ax22d& A , - const Standard_Real Focal ) + const Standard_Real Focal ) : gce_Root() { if (Focal < 0.0) { TheError = gce_NullFocusLength; } else { @@ -35,7 +35,7 @@ gce_MakeParab2d::gce_MakeParab2d(const gp_Ax22d& A , gce_MakeParab2d::gce_MakeParab2d(const gp_Ax2d& MirrorAxis , const Standard_Real Focal , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : gce_Root() { if (Focal < 0.0) { TheError = gce_NullFocusLength; } else { @@ -46,7 +46,7 @@ gce_MakeParab2d::gce_MakeParab2d(const gp_Ax2d& MirrorAxis , gce_MakeParab2d::gce_MakeParab2d(const gp_Ax2d& D , const gp_Pnt2d& F , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : gce_Root() { TheParab2d = gp_Parab2d(D,F,Sense); TheError = gce_Done; @@ -61,7 +61,7 @@ gce_MakeParab2d::gce_MakeParab2d(const gp_Ax2d& D , gce_MakeParab2d::gce_MakeParab2d(const gp_Pnt2d& S , const gp_Pnt2d& Center , - const Standard_Boolean Sense ) + const Standard_Boolean Sense ) : gce_Root() { if (S.Distance(Center) >= gp::Resolution()) { gp_Dir2d XAxis(gp_XY(S.XY()-Center.XY())); diff --git a/src/gce/gce_MakePln.cxx b/src/gce/gce_MakePln.cxx index 41b724ab85..a3736315c6 100644 --- a/src/gce/gce_MakePln.cxx +++ b/src/gce/gce_MakePln.cxx @@ -25,21 +25,21 @@ #include #include -gce_MakePln::gce_MakePln(const gp_Ax2& A2) +gce_MakePln::gce_MakePln(const gp_Ax2& A2) : gce_Root() { ThePln = gp_Pln(gp_Ax3(A2)); TheError = gce_Done; } gce_MakePln::gce_MakePln(const gp_Pnt& P, - const gp_Dir& V) + const gp_Dir& V) : gce_Root() { ThePln = gp_Pln(P,V); TheError = gce_Done; } gce_MakePln::gce_MakePln(const gp_Pnt& P1, - const gp_Pnt& P2) + const gp_Pnt& P2) : gce_Root() { if (P1.Distance(P2) <= gp::Resolution()) { TheError = gce_ConfusedPoints; } else { @@ -52,7 +52,7 @@ gce_MakePln::gce_MakePln(const gp_Pnt& P1, gce_MakePln::gce_MakePln(const Standard_Real A, const Standard_Real B, const Standard_Real C, - const Standard_Real D) + const Standard_Real D) : gce_Root() { if (A*A + B*B + C*C <= gp::Resolution()) { TheError = gce_BadEquation; @@ -69,7 +69,7 @@ gce_MakePln::gce_MakePln(const Standard_Real A, gce_MakePln::gce_MakePln(const gp_Pnt& P1 , const gp_Pnt& P2 , - const gp_Pnt& P3 ) + const gp_Pnt& P3 ) : gce_Root() { gp_XYZ V1(P2.XYZ()-P1.XYZ()); gp_XYZ V2(P3.XYZ()-P1.XYZ()); @@ -88,7 +88,7 @@ gce_MakePln::gce_MakePln(const gp_Pnt& P1 , //========================================================================= gce_MakePln::gce_MakePln(const gp_Pln& Pl , - const Standard_Real Dist ) + const Standard_Real Dist ) : gce_Root() { gp_Pnt Center(Pl.Location().XYZ()+Dist*gp_XYZ(Pl.Axis().Direction().XYZ())); ThePln=gp_Pln(gp_Ax3(Center,Pl.Axis().Direction(),Pl.XAxis().Direction())); @@ -101,7 +101,7 @@ gce_MakePln::gce_MakePln(const gp_Pln& Pl , //========================================================================= gce_MakePln::gce_MakePln(const gp_Pln& Pl , - const gp_Pnt& Point ) + const gp_Pnt& Point ) : gce_Root() { ThePln = gp_Pln(gp_Ax3(Point,Pl.Axis().Direction(),Pl.XAxis().Direction())); TheError = gce_Done; @@ -111,7 +111,7 @@ gce_MakePln::gce_MakePln(const gp_Pln& Pl , // Creation d un gp_pln a partir d un Ax1 (Point + Normale). + //========================================================================= -gce_MakePln::gce_MakePln(const gp_Ax1& Axis ) +gce_MakePln::gce_MakePln(const gp_Ax1& Axis ) : gce_Root() { ThePln = gp_Pln(Axis.Location(),Axis.Direction()); TheError = gce_Done; diff --git a/src/gp/gp_Dir.cxx b/src/gp/gp_Dir.cxx index f5997d04ef..b53111306d 100644 --- a/src/gp/gp_Dir.cxx +++ b/src/gp/gp_Dir.cxx @@ -14,6 +14,8 @@ // JCV 07/12/90 Modifs suite a l'introduction des classes XYZ et Mat dans gp +#include + #include #include @@ -46,7 +48,7 @@ Standard_Real gp_Dir::Angle (const gp_Dir& Other) const Standard_Real gp_Dir::AngleWithRef (const gp_Dir& Other, const gp_Dir& Vref) const { - Standard_Real Ang; + Standard_Real Ang = NAN; gp_XYZ XYZ = coord.Crossed (Other.coord); Standard_Real Cosinus = coord.Dot(Other.coord); Standard_Real Sinus = XYZ.Modulus (); diff --git a/src/gp/gp_Quaternion.cxx b/src/gp/gp_Quaternion.cxx index 3b53940ac3..4601c2cc57 100644 --- a/src/gp/gp_Quaternion.cxx +++ b/src/gp/gp_Quaternion.cxx @@ -17,6 +17,8 @@ // http://www.gamedev.ru/code/articles/?id=4215&page=3 // and maths found in Wikipedia and elsewhere +#include + #include #include @@ -167,7 +169,7 @@ void gp_Quaternion::SetMatrix (const gp_Mat& theMat) gp_Mat gp_Quaternion::GetMatrix () const { - Standard_Real wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2; + Standard_Real wx = NAN, wy = NAN, wz = NAN, xx = NAN, yy = NAN, yz = NAN, xy = NAN, xz = NAN, zz = NAN, x2 = NAN, y2 = NAN, z2 = NAN; Standard_Real s = 2.0 / SquareNorm(); x2 = x * s; y2 = y * s; z2 = z * s; xx = x * x2; xy = x * y2; xz = x * z2; diff --git a/src/gp/gp_Trsf.cxx b/src/gp/gp_Trsf.cxx index 3e1ff120db..23bfda7665 100644 --- a/src/gp/gp_Trsf.cxx +++ b/src/gp/gp_Trsf.cxx @@ -19,6 +19,8 @@ #define No_Standard_OutOfRange +#include + #include #include @@ -940,7 +942,7 @@ Standard_Boolean gp_Trsf::InitFromJson (const Standard_SStream& theSStream, Sta } } - Standard_Real ashape; + Standard_Real ashape = NAN; OCCT_INIT_FIELD_VALUE_INTEGER (aStreamStr, aPos, ashape); shape = (gp_TrsfForm)((Standard_Integer)ashape); diff --git a/src/gp/gp_XY.cxx b/src/gp/gp_XY.cxx index 6b9d06520c..ddc512ab1a 100644 --- a/src/gp/gp_XY.cxx +++ b/src/gp/gp_XY.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -19,7 +21,7 @@ Standard_Boolean gp_XY::IsEqual (const gp_XY& Other, const Standard_Real Tolerance) const { - Standard_Real val; + Standard_Real val = NAN; val = x - Other.x; if (val < 0) val = - val; if (val > Tolerance) return Standard_False; diff --git a/src/gp/gp_XYZ.cxx b/src/gp/gp_XYZ.cxx index bd0a6a196e..e1845cd84d 100644 --- a/src/gp/gp_XYZ.cxx +++ b/src/gp/gp_XYZ.cxx @@ -12,6 +12,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -21,7 +23,7 @@ Standard_Boolean gp_XYZ::IsEqual (const gp_XYZ& Other, const Standard_Real Tolerance) const { - Standard_Real val; + Standard_Real val = NAN; val = x - Other.x; if (val < 0) val = - val; if (val > Tolerance) return Standard_False; diff --git a/src/math/math.cxx b/src/math/math.cxx index 2fff3ae4ee..81f3c1377f 100644 --- a/src/math/math.cxx +++ b/src/math/math.cxx @@ -1964,7 +1964,7 @@ static const Standard_Real Weight[] = { void math::GaussPoints(const Standard_Integer Index, math_Vector& GPoint) { Standard_Integer Som = 0; - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = 1; i < Index; i++) { Som += (i+1) >> 1; } @@ -1979,7 +1979,7 @@ void math::GaussPoints(const Standard_Integer Index, math_Vector& GPoint) { void math::GaussWeights(const Standard_Integer Index, math_Vector& GWeight) { Standard_Integer Som = 0; - Standard_Integer i ; + Standard_Integer i = 0 ; for ( i = 1; i < Index; i++) { Som += (i+1) >> 1; @@ -2011,7 +2011,7 @@ Standard_Boolean math::OrderedGaussPointsAndWeights(const Standard_Integer Index if (Index <= 61) { // Get points from the array. - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer aStartInd = 1; // Compute the index of starting point in the array. diff --git a/src/math/math_BFGS.cxx b/src/math/math_BFGS.cxx index 6073c8b801..bcd4f6dc6c 100644 --- a/src/math/math_BFGS.cxx +++ b/src/math/math_BFGS.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include #include @@ -70,8 +72,8 @@ public: Grad = *G; } - virtual Standard_Boolean Value(const Standard_Real x, - Standard_Real& fval) + Standard_Boolean Value(const Standard_Real x, + Standard_Real& fval) override { *P = *Dir; P->Multiply(x); @@ -80,9 +82,9 @@ public: return F->Value(*P, fval); } - virtual Standard_Boolean Values(const Standard_Real x, + Standard_Boolean Values(const Standard_Real x, Standard_Real& fval, - Standard_Real& D) + Standard_Real& D) override { *P = *Dir; P->Multiply(x); @@ -96,13 +98,13 @@ public: return Standard_False; } - virtual Standard_Boolean Derivative(const Standard_Real x, - Standard_Real& D) + Standard_Boolean Derivative(const Standard_Real x, + Standard_Real& D) override { *P = *Dir; P->Multiply(x); P->Add(*P0); - Standard_Real fval; + Standard_Real fval = NAN; D = 0.; if (F->Values(*P, fval, *G)) { @@ -214,7 +216,7 @@ static Standard_Boolean MinimizeDirection(math_Vector& P, const math_Vector& theLeft, const math_Vector& theRight) { - Standard_Real lambda; + Standard_Real lambda = NAN; if (!ComputeInitScale(F0, Dir, Gr, lambda)) return Standard_False; @@ -251,7 +253,7 @@ static Standard_Boolean MinimizeDirection(math_Vector& P, } F.Initialize(P, Dir); - Standard_Real F1; + Standard_Real F1 = NAN; if (!F.Value(lambda, F1)) return Standard_False; @@ -264,7 +266,7 @@ static Standard_Boolean MinimizeDirection(math_Vector& P, if (Bracket.IsDone()) { // find minimum inside the bracket - Standard_Real ax, xx, bx, Fax, Fxx, Fbx; + Standard_Real ax = NAN, xx = NAN, bx = NAN, Fax = NAN, Fxx = NAN, Fbx = NAN; Bracket.Values(ax, xx, bx); Bracket.FunctionValues(Fax, Fxx, Fbx); @@ -285,12 +287,12 @@ static Standard_Boolean MinimizeDirection(math_Vector& P, { // Bracket definition is failure. If the bounds are defined then // set current point to intersection with bounds - Standard_Real aFMin, aFMax; + Standard_Real aFMin = NAN, aFMax = NAN; if (!F.Value(aMinLambda, aFMin)) return Standard_False; if (!F.Value(aMaxLambda, aFMax)) return Standard_False; - Standard_Real aBestLambda; + Standard_Real aBestLambda = NAN; if (aFMin < aFMax) { aBestLambda = aMinLambda; @@ -317,8 +319,8 @@ void math_BFGS::Perform(math_MultipleVarFunctionWithGradient& F, { const Standard_Integer n = TheLocation.Length(); Standard_Boolean Good = Standard_True; - Standard_Integer j, i; - Standard_Real fae, fad, fac; + Standard_Integer j = 0, i = 0; + Standard_Real fae = NAN, fad = NAN, fac = NAN; math_Vector xi(1, n), dg(1, n), hdg(1, n); math_Matrix hessin(1, n, 1, n); diff --git a/src/math/math_BissecNewton.cxx b/src/math/math_BissecNewton.cxx index 88eecc5a2e..4a5f721eab 100644 --- a/src/math/math_BissecNewton.cxx +++ b/src/math/math_BissecNewton.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -49,10 +51,10 @@ void math_BissecNewton::Perform(math_FunctionWithDerivative& F, const Standard_Real Bound2, const Standard_Integer NbIterations) { - Standard_Boolean GOOD; - Standard_Integer j; - Standard_Real dxold, fh, fl; - Standard_Real swap, temp, xh, xl; + Standard_Boolean GOOD = 0; + Standard_Integer j = 0; + Standard_Real dxold = NAN, fh = NAN, fl = NAN; + Standard_Real swap = NAN, temp = NAN, xh = NAN, xl = NAN; GOOD = F.Values(Bound1, fl, df); if(!GOOD) { diff --git a/src/math/math_BracketMinimum.cxx b/src/math/math_BracketMinimum.cxx index 39e0c8a623..a9b8fdd977 100644 --- a/src/math/math_BracketMinimum.cxx +++ b/src/math/math_BracketMinimum.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -47,7 +49,7 @@ Standard_Boolean math_BracketMinimum::LimitAndMayBeSwap if ((theA - theB) * (theB - theC) < 0) { // swap B and C - Standard_Real dum; + Standard_Real dum = NAN; SHFT(dum, theB, theC, dum); SHFT(dum, theFB, theFC, dum); } @@ -57,8 +59,8 @@ Standard_Boolean math_BracketMinimum::LimitAndMayBeSwap void math_BracketMinimum::Perform(math_Function& F) { - Standard_Boolean OK; - Standard_Real ulim, u, r, q, fu, dum; + Standard_Boolean OK = 0; + Standard_Real ulim = NAN, u = NAN, r = NAN, q = NAN, fu = NAN, dum = NAN; Done = Standard_False; Standard_Real Lambda = GOLD; diff --git a/src/math/math_BracketedRoot.cxx b/src/math/math_BracketedRoot.cxx index 29e9a6be0a..ddaf30dd8a 100644 --- a/src/math/math_BracketedRoot.cxx +++ b/src/math/math_BracketedRoot.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -25,13 +27,13 @@ math_BracketedRoot::math_BracketedRoot (math_Function& F, const Standard_Real Bound2, const Standard_Real Tolerance, const Standard_Integer NbIterations, - const Standard_Real ZEPS ) { + const Standard_Real ZEPS ) : TheRoot(Bound2) { - Standard_Real Fa,Fc,a,c=0,d=0,e=0; - Standard_Real min1,min2,p,q,r,s,tol1,xm; + Standard_Real Fa = NAN,Fc = NAN,a = NAN,c=0,d=0,e=0; + Standard_Real min1 = NAN,min2 = NAN,p = NAN,q = NAN,r = NAN,s = NAN,tol1 = NAN,xm = NAN; a = Bound1; - TheRoot = Bound2; + F.Value(a,Fa); F.Value(TheRoot,TheError); if (Fa*TheError > 0.) { Done = Standard_False;} diff --git a/src/math/math_BrentMinimum.cxx b/src/math/math_BrentMinimum.cxx index df60527838..720627c2b4 100644 --- a/src/math/math_BrentMinimum.cxx +++ b/src/math/math_BrentMinimum.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -94,9 +96,9 @@ void math_BrentMinimum::Perform(math_Function& F, const Standard_Real bx, const Standard_Real cx) { - Standard_Boolean OK; - Standard_Real etemp, fu, p, q, r; - Standard_Real tol1, tol2, u, v, w, xm; + Standard_Boolean OK = 0; + Standard_Real etemp = NAN, fu = NAN, p = NAN, q = NAN, r = NAN; + Standard_Real tol1 = NAN, tol2 = NAN, u = NAN, v = NAN, w = NAN, xm = NAN; Standard_Real e = 0.0; Standard_Real d = RealLast(); diff --git a/src/math/math_ComputeGaussPointsAndWeights.cxx b/src/math/math_ComputeGaussPointsAndWeights.cxx index 46a4e0b936..d675e21d0d 100644 --- a/src/math/math_ComputeGaussPointsAndWeights.cxx +++ b/src/math/math_ComputeGaussPointsAndWeights.cxx @@ -20,15 +20,15 @@ #include #include -math_ComputeGaussPointsAndWeights::math_ComputeGaussPointsAndWeights(const Standard_Integer Number) +math_ComputeGaussPointsAndWeights::math_ComputeGaussPointsAndWeights(const Standard_Integer Number) : myIsDone(Standard_False) { - myIsDone = Standard_False; + try { myPoints = new TColStd_HArray1OfReal(1, Number); myWeights = new TColStd_HArray1OfReal(1, Number); - Standard_Integer i; + Standard_Integer i = 0; TColStd_Array1OfReal aDiag(1, Number); TColStd_Array1OfReal aSubDiag(1, Number); diff --git a/src/math/math_ComputeKronrodPointsAndWeights.cxx b/src/math/math_ComputeKronrodPointsAndWeights.cxx index 339dc85f94..6aee8a616e 100644 --- a/src/math/math_ComputeKronrodPointsAndWeights.cxx +++ b/src/math/math_ComputeKronrodPointsAndWeights.cxx @@ -14,18 +14,20 @@ // commercial license or contractual agreement. +#include + #include #include #include #include #include -math_ComputeKronrodPointsAndWeights::math_ComputeKronrodPointsAndWeights(const Standard_Integer Number) +math_ComputeKronrodPointsAndWeights::math_ComputeKronrodPointsAndWeights(const Standard_Integer Number) : myIsDone(Standard_False) { - myIsDone = Standard_False; + try { - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; Standard_Integer a2NP1 = 2*Number + 1; myPoints = new TColStd_HArray1OfReal(1, a2NP1); @@ -76,11 +78,11 @@ math_ComputeKronrodPointsAndWeights::math_ComputeKronrodPointsAndWeights(const S aa[i] = aDiag(i); bb[i] = aSubDiag(i); } - Standard_Real *ptrtmp; - Standard_Real u; - Standard_Integer m; - Standard_Integer k; - Standard_Integer l; + Standard_Real *ptrtmp = nullptr; + Standard_Real u = NAN; + Standard_Integer m = 0; + Standard_Integer k = 0; + Standard_Integer l = 0; Standard_Real *a = aa+1; Standard_Real *b = bb+1; diff --git a/src/math/math_Crout.cxx b/src/math/math_Crout.cxx index 3123a9eb38..71cf913a4b 100644 --- a/src/math/math_Crout.cxx +++ b/src/math/math_Crout.cxx @@ -21,6 +21,8 @@ //#endif +#include + #include #include #include @@ -29,12 +31,12 @@ #include math_Crout::math_Crout(const math_Matrix& A, const Standard_Real MinPivot): - InvA(1, A.RowNumber(), 1, A.ColNumber()) + InvA(1, A.RowNumber(), 1, A.ColNumber()), Det(1) { - Standard_Integer i,j,k; + Standard_Integer i = 0,j = 0,k = 0; Standard_Integer Nctl = A.RowNumber(); Standard_Integer lowr = A.LowerRow(), lowc = A.LowerCol(); - Standard_Real scale; + Standard_Real scale = NAN; math_Matrix L(1, Nctl, 1, Nctl); math_Vector Diag(1, Nctl); @@ -43,7 +45,7 @@ math_Crout::math_Crout(const math_Matrix& A, const Standard_Real MinPivot): math_NotSquare_Raise_if(Nctl != A.ColNumber(), " "); - Det = 1; + for (i =1; i <= Nctl; i++) { for (j = 1; j <= i -1; j++) { scale = 0.0; @@ -110,7 +112,7 @@ void math_Crout::Solve(const math_Vector& B, math_Vector& X) const Standard_Integer n = InvA.RowNumber(); Standard_Integer lowb = B.Lower(), lowx = X.Lower(); - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for (i = 1; i <= n; i++) { X(i+lowx-1) = InvA(i, 1)*B(1+lowb-1); diff --git a/src/math/math_DirectPolynomialRoots.cxx b/src/math/math_DirectPolynomialRoots.cxx index d67db7e825..c02f5731dd 100644 --- a/src/math/math_DirectPolynomialRoots.cxx +++ b/src/math/math_DirectPolynomialRoots.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include @@ -54,10 +56,10 @@ const Standard_Real ZERO = 1.0e-30; static Standard_Real Improve(const Standard_Integer N, Standard_Real *Poly, const Standard_Real IniSol) { - Standard_Real Val = 0., Der, Delta; + Standard_Real Val = 0., Der = NAN, Delta = NAN; Standard_Real Sol = IniSol; Standard_Real IniVal = Value(N, Poly, IniSol); - Standard_Integer Index; + Standard_Integer Index = 0; // std::cout << "Improve\n"; for(Index = 1; Index < 10; Index++) { @@ -128,33 +130,33 @@ const Standard_Real ZERO = 1.0e-30; const Standard_Real B, const Standard_Real C, const Standard_Real D, - const Standard_Real E) { - InfiniteStatus = Standard_False; - Done = Standard_True; + const Standard_Real E) : InfiniteStatus(Standard_False), Done(Standard_True) { + + Solve(A, B, C, D, E); } math_DirectPolynomialRoots::math_DirectPolynomialRoots(const Standard_Real A, const Standard_Real B, const Standard_Real C, - const Standard_Real D) { - Done = Standard_True; - InfiniteStatus = Standard_False; + const Standard_Real D) : Done(Standard_True), InfiniteStatus(Standard_False) { + + Solve(A, B, C, D); } math_DirectPolynomialRoots::math_DirectPolynomialRoots(const Standard_Real A, const Standard_Real B, - const Standard_Real C) { - Done = Standard_True; - InfiniteStatus = Standard_False; + const Standard_Real C) : Done(Standard_True), InfiniteStatus(Standard_False) { + + Solve(A, B, C); } math_DirectPolynomialRoots::math_DirectPolynomialRoots(const Standard_Real A, - const Standard_Real B) { - Done = Standard_True; - InfiniteStatus = Standard_False; + const Standard_Real B) : Done(Standard_True), InfiniteStatus(Standard_False) { + + Solve(A, B); } @@ -204,11 +206,11 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real a, } /////////////////////////////////// - Standard_Real A, B, C, D, R3, S3, T3, Q3, Y0, P0, Q0, P, Q, P1, Q1; - Standard_Real Discr, Sdiscr; - Standard_Integer Index; - Standard_Integer Exp; - Standard_Real PowRadix1,PowRadix2; + Standard_Real A = NAN, B = NAN, C = NAN, D = NAN, R3 = NAN, S3 = NAN, T3 = NAN, Q3 = NAN, Y0 = NAN, P0 = NAN, Q0 = NAN, P = NAN, Q = NAN, P1 = NAN, Q1 = NAN; + Standard_Real Discr = NAN, Sdiscr = NAN; + Standard_Integer Index = 0; + Standard_Integer Exp = 0; + Standard_Real PowRadix1 = NAN,PowRadix2 = NAN; A = b / a; B = c / a; @@ -309,10 +311,10 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real a, return; } - Standard_Real Beta, Gamma, Del, P1, P2, P, Ep, Q1, Q2, Q3, Q, Eq, A1, A2, Discr; - Standard_Real Sigma, Psi, D1, D2, Sb, Omega, Sp3, Y1, Dbg, Sdbg, Den1, Den2; - Standard_Real U, H, Sq; - Standard_Integer Exp; + Standard_Real Beta = NAN, Gamma = NAN, Del = NAN, P1 = NAN, P2 = NAN, P = NAN, Ep = NAN, Q1 = NAN, Q2 = NAN, Q3 = NAN, Q = NAN, Eq = NAN, A1 = NAN, A2 = NAN, Discr = NAN; + Standard_Real Sigma = NAN, Psi = NAN, D1 = NAN, D2 = NAN, Sb = NAN, Omega = NAN, Sp3 = NAN, Y1 = NAN, Dbg = NAN, Sdbg = NAN, Den1 = NAN, Den2 = NAN; + Standard_Real U = NAN, H = NAN, Sq = NAN; + Standard_Integer Exp = 0; Beta = B / A; Gamma = C / A; diff --git a/src/math/math_DirectPolynomialRoots.hxx b/src/math/math_DirectPolynomialRoots.hxx index 7a2160087a..f5dda5a634 100644 --- a/src/math/math_DirectPolynomialRoots.hxx +++ b/src/math/math_DirectPolynomialRoots.hxx @@ -98,8 +98,8 @@ private: Standard_Boolean Done; Standard_Boolean InfiniteStatus; - Standard_Integer NbSol; - Standard_Real TheRoots[4]; + Standard_Integer NbSol{}; + Standard_Real TheRoots[4]{}; }; diff --git a/src/math/math_DoubleTab.hxx b/src/math/math_DoubleTab.hxx index 1ab5e36820..5250e43d9c 100644 --- a/src/math/math_DoubleTab.hxx +++ b/src/math/math_DoubleTab.hxx @@ -74,7 +74,7 @@ private: Standard_Address Addr; - Standard_Real Buf[16]; + Standard_Real Buf[16]{}; Standard_Boolean isAllocated; Standard_Integer LowR; Standard_Integer UppR; diff --git a/src/math/math_EigenValuesSearcher.cxx b/src/math/math_EigenValuesSearcher.cxx index 5f965af747..bd511522ed 100644 --- a/src/math/math_EigenValuesSearcher.cxx +++ b/src/math/math_EigenValuesSearcher.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include @@ -28,9 +30,9 @@ static inline Standard_Real pythag(const Standard_Real x, } math_EigenValuesSearcher::math_EigenValuesSearcher(const TColStd_Array1OfReal& Diagonal, - const TColStd_Array1OfReal& Subdiagonal) + const TColStd_Array1OfReal& Subdiagonal) : myIsDone(Standard_False) { - myIsDone = Standard_False; + Standard_Integer n = Diagonal.Length(); if (Subdiagonal.Length() != n) @@ -47,7 +49,7 @@ math_EigenValuesSearcher::math_EigenValuesSearcher(const TColStd_Array1OfReal& D Standard_Real* d = new Standard_Real [n+1]; Standard_Real* e = new Standard_Real [n+1]; Standard_Real** z = new Standard_Real* [n+1]; - Standard_Integer i, j; + Standard_Integer i = 0, j = 0; for (i = 1; i <= n; i++) z[i] = new Standard_Real [n+1]; @@ -59,20 +61,20 @@ math_EigenValuesSearcher::math_EigenValuesSearcher(const TColStd_Array1OfReal& D for (j = 1; j <= n; j++) z[i][j] = (i == j)? 1. : 0.; - Standard_Boolean result; - Standard_Integer m; - Standard_Integer l; - Standard_Integer iter; + Standard_Boolean result = 0; + Standard_Integer m = 0; + Standard_Integer l = 0; + Standard_Integer iter = 0; //Standard_Integer i; - Standard_Integer k; - Standard_Real s; - Standard_Real r; - Standard_Real p; - Standard_Real g; - Standard_Real f; - Standard_Real dd; - Standard_Real c; - Standard_Real b; + Standard_Integer k = 0; + Standard_Real s = NAN; + Standard_Real r = NAN; + Standard_Real p = NAN; + Standard_Real g = NAN; + Standard_Real f = NAN; + Standard_Real dd = NAN; + Standard_Real c = NAN; + Standard_Real b = NAN; result = Standard_True; @@ -191,7 +193,7 @@ math_Vector math_EigenValuesSearcher::EigenVector(const Standard_Integer Index) { math_Vector theVector(1, myN); - Standard_Integer i; + Standard_Integer i = 0; for (i = 1; i <= myN; i++) theVector(i) = myEigenVectors->Value(i, Index); diff --git a/src/math/math_FRPR.cxx b/src/math/math_FRPR.cxx index 3adad84643..830b705dac 100644 --- a/src/math/math_FRPR.cxx +++ b/src/math/math_FRPR.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include #include @@ -45,18 +47,18 @@ public : void Initialize(const math_Vector& p0, const math_Vector& dir); - virtual Standard_Boolean Value(const Standard_Real x, Standard_Real& fval); + Standard_Boolean Value(const Standard_Real x, Standard_Real& fval) override; }; DirFunctionTer::DirFunctionTer(math_Vector& V1, math_Vector& V2, math_Vector& V3, - math_MultipleVarFunction& f) { + math_MultipleVarFunction& f) : P0(&V1), Dir(&V2), P(&V3), F(&f) { + + + + - P0 = &V1; - Dir = &V2; - P = &V3; - F = &f; } void DirFunctionTer::Initialize(const math_Vector& p0, @@ -80,7 +82,7 @@ static Standard_Boolean MinimizeDirection(math_Vector& P, Standard_Real& Result, DirFunctionTer& F) { - Standard_Real ax, xx, bx; + Standard_Real ax = NAN, xx = NAN, bx = NAN; F.Initialize(P, Dir); math_BracketMinimum Bracket(F, 0.0, 1.0); @@ -138,10 +140,10 @@ math_FRPR::~math_FRPR() void math_FRPR::Perform(math_MultipleVarFunctionWithGradient& F, const math_Vector& StartingPoint) { - Standard_Boolean Good; + Standard_Boolean Good = 0; Standard_Integer n = TheLocation.Length(); - Standard_Integer j, its; - Standard_Real gg, gam, dgg; + Standard_Integer j = 0, its = 0; + Standard_Real gg = NAN, gam = NAN, dgg = NAN; math_Vector g(1, n), h(1, n); diff --git a/src/math/math_FunctionAllRoots.cxx b/src/math/math_FunctionAllRoots.cxx index b5c680b7f1..59a4047be1 100644 --- a/src/math/math_FunctionAllRoots.cxx +++ b/src/math/math_FunctionAllRoots.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include #include @@ -29,18 +31,18 @@ math_FunctionAllRoots::math_FunctionAllRoots ( math_FunctionWithDerivative& F, const math_FunctionSample& S, const Standard_Real EpsX, const Standard_Real EpsF, - const Standard_Real EpsNul) { + const Standard_Real EpsNul) : done(Standard_False) { - done=Standard_False; + - Standard_Boolean Nul, PNul, InterNul, Nuld, Nulf; + Standard_Boolean Nul = 0, PNul = 0, InterNul = 0, Nuld = 0, Nulf = 0; Standard_Real DebNul = 0., FinNul = 0.; Standard_Integer Indd = 0, Indf = 0; - Standard_Real cst,val,valsav=0,valbid; - Standard_Boolean fini; - Standard_Integer Nbp,i; + Standard_Real cst = NAN,val = NAN,valsav=0,valbid = NAN; + Standard_Boolean fini = 0; + Standard_Integer Nbp = 0,i = 0; Nbp=S.NbPoints(); F.Value(S.GetParameter(1),val); @@ -162,7 +164,7 @@ math_FunctionAllRoots::math_FunctionAllRoots ( } else { Standard_Integer NbpMin = 3; - Standard_Integer Nbrpt; + Standard_Integer Nbrpt = 0; if (!Nuld) { // Recherche des solutions entre S.GetParameter(1) // et le debut du 1er intervalle nul diff --git a/src/math/math_FunctionRoot.cxx b/src/math/math_FunctionRoot.cxx index 397f06de78..8b1c96be86 100644 --- a/src/math/math_FunctionRoot.cxx +++ b/src/math/math_FunctionRoot.cxx @@ -33,17 +33,17 @@ class math_MyFunctionSetWithDerivatives : public math_FunctionSetWithDerivatives math_MyFunctionSetWithDerivatives (math_FunctionWithDerivative& F ); - Standard_Integer NbVariables () const; - Standard_Integer NbEquations () const; - Standard_Boolean Value (const math_Vector& X, math_Vector& F) ; - Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) ; - Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) ; + Standard_Integer NbVariables () const override; + Standard_Integer NbEquations () const override; + Standard_Boolean Value (const math_Vector& X, math_Vector& F) override ; + Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) override ; + Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) override ; }; math_MyFunctionSetWithDerivatives::math_MyFunctionSetWithDerivatives - (math_FunctionWithDerivative& F ) { - Ff = &F ; + (math_FunctionWithDerivative& F ) : Ff(&F) { + } diff --git a/src/math/math_FunctionRoot.hxx b/src/math/math_FunctionRoot.hxx index 331e591195..16f8a5785a 100644 --- a/src/math/math_FunctionRoot.hxx +++ b/src/math/math_FunctionRoot.hxx @@ -97,7 +97,7 @@ private: Standard_Boolean Done; Standard_Real TheRoot; - Standard_Real TheError; + Standard_Real TheError{}; Standard_Real TheDerivative; Standard_Integer NbIter; diff --git a/src/math/math_FunctionRoots.cxx b/src/math/math_FunctionRoots.cxx index 0f9b9ee8aa..baed50f0ef 100644 --- a/src/math/math_FunctionRoots.cxx +++ b/src/math/math_FunctionRoots.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include #include @@ -44,7 +46,7 @@ public: : myF (&theF) {} - virtual Standard_Boolean Value(const Standard_Real theX, Standard_Real& theFval) + Standard_Boolean Value(const Standard_Real theX, Standard_Real& theFval) override { return myF->Derivative(theX, theFval); } @@ -59,7 +61,7 @@ static void AppendRoot(TColStd_SequenceOfReal& Sol, const Standard_Real dX) { Standard_Integer n=Sol.Length(); - Standard_Real t; + Standard_Real t = NAN; #ifdef OCCT_DEBUG if (myDebug) { std::cout << " Ajout de la solution numero : " << n+1 << std::endl; @@ -120,7 +122,7 @@ static void Solve(math_FunctionWithDerivative& F, Standard_Integer iter=0; Standard_Real tols2 = 0.5*tol; - Standard_Real a,b,c,d=0,e=0,fa,fb,fc,p,q,r,s,tol1,xm,min1,min2; + Standard_Real a = NAN,b = NAN,c = NAN,d=0,e=0,fa = NAN,fb = NAN,fc = NAN,p = NAN,q = NAN,r = NAN,s = NAN,tol1 = NAN,xm = NAN,min1 = NAN,min2 = NAN; a=x1;b=c=x2;fa=y1; fb=fc=y2; for(iter=1;iter<=ITMAX;iter++) { if((fb>0.0 && fc>0.0) || (fb<0.0 && fc<0.0)) { @@ -133,9 +135,9 @@ static void Solve(math_FunctionWithDerivative& F, xm=0.5*(c-b); if(Abs(xm) XN) X2 = XN; @@ -328,14 +330,14 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, // Standard_Real Val,Deriv; X=X0+i*dx; if (X>XN) X=XN; - Standard_Real u0,u1; + Standard_Real u0 = NAN,u1 = NAN; u0=dx*0.5; u1=X+u0; u0+=X; if(u0XN) u0=XN; if(u1XN) u1=XN; - Standard_Real y0,y1; + Standard_Real y0 = NAN,y1 = NAN; F.Value(u0,y0); y0-=K; F.Value(u1,y1); y1-=K; if(y0*y1 < 0.0) { @@ -364,9 +366,9 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, //-- On reprend une discretisation plus fine au voisinage de ces extremums //-- //-- Recherche d un minima positif - Standard_Real xm,ym,dym,xm1,xp1; + Standard_Real xm = NAN,ym = NAN,dym = NAN,xm1 = NAN,xp1 = NAN; Standard_Real majdx = 5.0*dx; - Standard_Boolean Rediscr; + Standard_Boolean Rediscr = 0; // Standard_Real ptrvalbis[MAXBIS]; Standard_Integer im1=0; ip1=2; @@ -460,7 +462,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, //-- et |f(x0)| > |f(x1)| et |f(x3)| > |f(x2)| //-- //-- En entree : a=xm-dx b=xm c=xm+dx - Standard_Real x1, x2, f0, f3; + Standard_Real x1 = NAN, x2 = NAN, f0 = NAN, f3 = NAN; Standard_Real R = 0.61803399; Standard_Real C = 1.0 - R; Standard_Real tolCR = NEpsX*10.0; @@ -470,7 +472,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, if (Abs(x3 - xm) > Abs(x0 - xm)) { x1 = xm; x2 = xm + C*(x3 - xm); } else { x2 = xm; x1 = xm - C*(xm - x0); } - Standard_Real f1, f2; + Standard_Real f1 = NAN, f2 = NAN; F.Value(x1, f1); f1 -= K; F.Value(x2, f2); f2 -= K; //-- printf("\n *************** RECHERCHE MINIMUM **********\n"); diff --git a/src/math/math_FunctionSetRoot.cxx b/src/math/math_FunctionSetRoot.cxx index 51801a4313..96e3a4658d 100644 --- a/src/math/math_FunctionSetRoot.cxx +++ b/src/math/math_FunctionSetRoot.cxx @@ -25,6 +25,8 @@ //#endif //math_FunctionSetRoot.cxx +#include + #include #include #include @@ -91,7 +93,7 @@ public : // Standard_Boolean MyDirFunction::Value(const math_Vector& Sol, math_Vector& FF, // math_Matrix& DF, math_Vector& GH, // Standard_Real& F2, Standard_Real& Gnr1); - Standard_Boolean Value(const Standard_Real x, Standard_Real& fval) ; + Standard_Boolean Value(const Standard_Real x, Standard_Real& fval) override ; }; @@ -99,13 +101,13 @@ MyDirFunction::MyDirFunction(math_Vector& V1, math_Vector& V2, math_Vector& V3, math_Vector& V4, - math_FunctionSetWithDerivatives& f) { + math_FunctionSetWithDerivatives& f) : P0(&V1), Dir(&V2), P(&V3), FV(&V4), F(&f) { - P0 = &V1; - Dir = &V2; - P = &V3; - FV = &V4; - F = &f; + + + + + } void MyDirFunction::Initialize(const math_Vector& p0, @@ -119,7 +121,7 @@ void MyDirFunction::Initialize(const math_Vector& p0, Standard_Boolean MyDirFunction::Value(const Standard_Real x, Standard_Real& fval) { - Standard_Real p; + Standard_Real p = NAN; for(Standard_Integer i = P->Lower(); i <= P->Upper(); i++) { p = Dir->Value(i); P->Value(i) = p * x + P0->Value(i); @@ -199,9 +201,9 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P0, //------------------------------------------------------- { // (1) Evaluation d'un tolerance parametrique 1D - Standard_Real tol1d = 2.1 , invnorme, tsol; + Standard_Real tol1d = 2.1 , invnorme = NAN, tsol = NAN; Standard_Real Eps = 1.e-16; - Standard_Real ax, bx, cx; + Standard_Real ax = NAN, bx = NAN, cx = NAN; for (Standard_Integer ii =1; ii<=Tol.Length(); ii++) { invnorme = Abs(Delta(ii)); @@ -211,8 +213,8 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P0, tol1d /= 3; //JR/Hp : - math_Vector PP0 = P0 ; - math_Vector PP1 = P1 ; + const math_Vector& PP0 = P0 ; + const math_Vector& PP1 = P1 ; Delta = PP1 - PP0; // Delta = P1 - P0; invnorme = Delta.Norm(); @@ -261,7 +263,7 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P, // (0) Evaluation d'un tolerance parametrique 1D Standard_Boolean good = Standard_False; Standard_Real Eps = 1.e-20; - Standard_Real tol1d = 1.1, Result = PValue, absdir; + Standard_Real tol1d = 1.1, Result = PValue, absdir = NAN; for (Standard_Integer ii =1; ii<=Tol.Length(); ii++) { absdir = Abs(Dir(ii)); @@ -270,7 +272,7 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P, if (tol1d > 0.9) return Standard_False; // (1) On realise une premiere interpolation quadratique - Standard_Real ax, bx, cx, df1, df2, Delta, tsol, fsol, tsolbis; + Standard_Real ax = NAN, bx = NAN, cx = NAN, df1 = NAN, df2 = NAN, Delta = NAN, tsol = NAN, fsol = NAN, tsolbis = NAN; FSR_DEBUG(" essai d interpolation"); df1 = Gradient*Dir; @@ -426,7 +428,7 @@ static void SearchDirection(const math_Matrix& DF, Standard_Real ratio = Abs( Direction(Direction.Lower()) *InvLengthMax(Direction.Lower()) ); - Standard_Integer i; + Standard_Integer i = 0; for (i = Direction.Lower()+1; i<=Direction.Upper(); i++) { ratio = Max(ratio, Abs( Direction(i)*InvLengthMax(i)) ); } @@ -463,7 +465,7 @@ static void SearchDirection(const math_Matrix& DF, //===================================================================== { Standard_Integer Ninc = DF.ColNumber(), Neq = DF.RowNumber(); - Standard_Integer i, j, k, Cons = 0; + Standard_Integer i = 0, j = 0, k = 0, Cons = 0; // verification sur les bornes imposees: @@ -540,7 +542,7 @@ Standard_Boolean Bounds(const math_Vector& InfBound, //====================================================== { Standard_Boolean Out = Standard_False; - Standard_Integer i, Ninc = Sol.Length(); + Standard_Integer i = 0, Ninc = Sol.Length(); Standard_Real monratio = 1; theIsNewSol = Standard_True; @@ -710,13 +712,13 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, (theInfBound.Length() != Ninc) || (theSupBound.Length() != Ninc)) { throw Standard_DimensionError(); } - Standard_Integer i; + Standard_Integer i = 0; Standard_Boolean ChangeDirection = Standard_False, Sort = Standard_False, isNewSol = Standard_False; - Standard_Boolean Good, Verif; - Standard_Boolean Stop; + Standard_Boolean Good = 0, Verif = 0; + Standard_Boolean Stop = 0; const Standard_Real EpsSqrt = 1.e-16, Eps = 1.e-32, Eps2 = 1.e-64, Progres = 0.005; - Standard_Real F2, PreviousMinimum, Dy, OldF; - Standard_Real Ambda, Ambda2, Gnr1, Oldgr; + Standard_Real F2 = NAN, PreviousMinimum = NAN, Dy = NAN, OldF = NAN; + Standard_Real Ambda = NAN, Ambda2 = NAN, Gnr1 = NAN, Oldgr = NAN; math_Vector InvLengthMax(1, Ninc); // Pour bloquer les pas a 1/4 du domaine math_IntegerVector aConstraints(1, Ninc); // Pour savoir sur quels bord on se trouve for (i = 1; i <= Ninc ; i++) { @@ -726,7 +728,7 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, } MyDirFunction F_Dir(Temp1, Temp2, Temp3, Temp4, F); - Standard_Integer DescenteIter; + Standard_Integer DescenteIter = 0; Done = Standard_False; Sol = StartingPoint; @@ -863,7 +865,7 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, Stop = Standard_False; Good = Standard_False; DescenteIter = 0; - Standard_Boolean Sortbis; + Standard_Boolean Sortbis = 0; // ------------------------------------------------- // Traitement standard sans traitement des bords diff --git a/src/math/math_Gauss.cxx b/src/math/math_Gauss.cxx index 7760db66f8..dd3c3f5be8 100644 --- a/src/math/math_Gauss.cxx +++ b/src/math/math_Gauss.cxx @@ -22,14 +22,13 @@ math_Gauss::math_Gauss(const math_Matrix& A, const Standard_Real MinPivot, - const Message_ProgressRange& theProgress) - : LU (1, A.RowNumber(), 1, A.ColNumber()), - Index(1, A.RowNumber()), + const Message_ProgressRange& theProgress) : + LU(A), Index(1, A.RowNumber()), D (0.0), Done (Standard_False) { math_NotSquare_Raise_if(A.RowNumber() != A.ColNumber(), " "); - LU = A; + Standard_Integer Error = LU_Decompose(LU, Index, D, @@ -88,7 +87,7 @@ math_Gauss::math_Gauss(const math_Matrix& A, Standard_Integer LowerCol = Inv.LowerCol(); math_Vector Column(1, LU.UpperRow()); - Standard_Integer I, J; + Standard_Integer I = 0, J = 0; for(J = 1; J <= LU.UpperRow(); J++) { for(I = 1; I <= LU.UpperRow(); I++) { Column(I) = 0.0; diff --git a/src/math/math_GaussLeastSquare.hxx b/src/math/math_GaussLeastSquare.hxx index c130729036..ddf9c4b150 100644 --- a/src/math/math_GaussLeastSquare.hxx +++ b/src/math/math_GaussLeastSquare.hxx @@ -74,11 +74,11 @@ protected: - Standard_Boolean Singular; + Standard_Boolean Singular{}; math_Matrix LU; math_Matrix A2; math_IntegerVector Index; - Standard_Real D; + Standard_Real D{}; private: diff --git a/src/math/math_GaussMultipleIntegration.cxx b/src/math/math_GaussMultipleIntegration.cxx index e45ee83243..badb42a158 100644 --- a/src/math/math_GaussMultipleIntegration.cxx +++ b/src/math/math_GaussMultipleIntegration.cxx @@ -40,6 +40,8 @@ de Gauss. //#endif +#include + #include #include #include @@ -79,20 +81,20 @@ class IntegrationFunction { const Standard_Integer maxsav, const Standard_Integer NVar, const math_IntegerVector& Ord, const math_Vector& Lowsav,const math_Vector& Uppsav): - Ordsav(1, NVar), - xr(1, NVar), + Fsav(&F), Ordsav(1, NVar), + NVarsav(NVar), xr(1, NVar), xm(1, NVar), GaussPoint(1, NVar, 1, maxsav), - GaussWeight(1, NVar, 1, maxsav) + GaussWeight(1, NVar, 1, maxsav), Done(Standard_False) { -Standard_Integer i, k; +Standard_Integer i = 0, k = 0; math_IntegerVector inc(1, NVar); inc.Init(0); -Fsav = &F; -NVarsav = NVar; -Ordsav = Ord; -Done = Standard_False; + + + + //Recuperation des points et poids de Gauss dans le fichier GaussPoints for (i =1; i<= NVarsav; i++) { @@ -131,14 +133,14 @@ Standard_Boolean IntegrationFunction::recursive_iteration(Standard_Integer& n, // Termination criterium : // Calcul de la valeur de la fonction aux points de Gauss fixes: - int local; + int local = 0; if (n == (NVarsav+1)) { math_Vector dx(1, NVarsav); - Standard_Integer j ; + Standard_Integer j = 0 ; for ( j = 1; j <= NVarsav; j++) { dx(j) = xr(j)* GaussPoint(j, inc(j)); } - Standard_Real F1; + Standard_Real F1 = NAN; Standard_Boolean Ok = Fsav->Value(xm + dx, F1); if (!Ok) {return Standard_False;}; Standard_Real Interm = 1; @@ -164,11 +166,11 @@ math_GaussMultipleIntegration:: math_GaussMultipleIntegration(math_MultipleVarFunction& F, const math_Vector& Lower, const math_Vector& Upper, - const math_IntegerVector& Order) + const math_IntegerVector& Order) : Done(Standard_False) { Standard_Integer MaxOrder = math::GaussPointsMax(); - Standard_Integer i, max =0; + Standard_Integer i = 0, max =0; Standard_Integer NVar = F.NbVariables(); math_IntegerVector Ord(1, NVar); math_Vector Lowsav(1, NVar); @@ -176,7 +178,7 @@ math_GaussMultipleIntegration:: Lowsav = Lower; Uppsav = Upper; // Ord = Order; - Done = Standard_False; + for (i = 1; i <= NVar; i++) { if (Order(i) > MaxOrder) { Ord(i) = MaxOrder; diff --git a/src/math/math_GaussSetIntegration.cxx b/src/math/math_GaussSetIntegration.cxx index b51bfc8552..ed731e570e 100644 --- a/src/math/math_GaussSetIntegration.cxx +++ b/src/math/math_GaussSetIntegration.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include #include @@ -30,11 +32,11 @@ math_GaussSetIntegration::math_GaussSetIntegration(math_FunctionSet& F, const math_Vector& Lower, const math_Vector& Upper, const math_IntegerVector& Order) - : Val(1, F.NbEquations()) { + : Val(1, F.NbEquations()), Done(Standard_False) { Standard_Integer NbEqua = F.NbEquations() , NbVar = F.NbVariables(); - Standard_Integer i; - Standard_Boolean IsOk; + Standard_Integer i = 0; + Standard_Boolean IsOk = 0; math_Vector FVal1(1, NbEqua), FVal2(1, NbEqua), Tval(1, NbVar); @@ -44,12 +46,12 @@ math_GaussSetIntegration::math_GaussSetIntegration(math_FunctionSet& F, "GaussSetIntegration "); // Initialisations - Done = Standard_False; + Standard_Real Xdeb = Lower.Value( Lower.Lower() ); Standard_Real Xfin = Upper.Value( Upper.Lower() ); Standard_Integer Ordre = Order.Value(Order.Lower()); - Standard_Real Xm, Xr; + Standard_Real Xm = NAN, Xr = NAN; math_Vector GaussP(1, Ordre), GaussW(1, Ordre); // Recuperation des points de Gauss dans le fichier GaussPoints. diff --git a/src/math/math_GaussSingleIntegration.cxx b/src/math/math_GaussSingleIntegration.cxx index f79c140f7f..c491d33b32 100644 --- a/src/math/math_GaussSingleIntegration.cxx +++ b/src/math/math_GaussSingleIntegration.cxx @@ -44,6 +44,8 @@ Etapes du calcul: //#endif +#include + #include #include #include @@ -75,7 +77,7 @@ math_GaussSingleIntegration:: const Standard_Integer IterMax = 13; // Max number of iteration Standard_Integer NIter = 1; // current number of iteration Standard_Integer NbInterval = 1; // current number of subintervals - Standard_Real dU,OldLen,Len; + Standard_Real dU = NAN,OldLen = NAN,Len = NAN; Perform(F, Lower, Upper, theOrder); Len = Val; @@ -101,10 +103,10 @@ void math_GaussSingleIntegration::Perform(math_Function& F, const Standard_Real Upper, const Standard_Integer Order) { - Standard_Real xr, xm, dx; - Standard_Integer j; - Standard_Real F1, F2; - Standard_Boolean Ok1; + Standard_Real xr = NAN, xm = NAN, dx = NAN; + Standard_Integer j = 0; + Standard_Real F1 = NAN, F2 = NAN; + Standard_Boolean Ok1 = 0; math_Vector GaussP(1, Order); math_Vector GaussW(1, Order); Done = Standard_False; diff --git a/src/math/math_GaussSingleIntegration.hxx b/src/math/math_GaussSingleIntegration.hxx index 67a3bbe2cf..87cbec146a 100644 --- a/src/math/math_GaussSingleIntegration.hxx +++ b/src/math/math_GaussSingleIntegration.hxx @@ -74,8 +74,8 @@ private: Standard_EXPORT void Perform (math_Function& F, const Standard_Real Lower, const Standard_Real Upper, const Standard_Integer Order); - Standard_Real Val; - Standard_Boolean Done; + Standard_Real Val{}; + Standard_Boolean Done{}; }; diff --git a/src/math/math_GlobOptMin.cxx b/src/math/math_GlobOptMin.cxx index 8364240918..7eacd222d1 100644 --- a/src/math/math_GlobOptMin.cxx +++ b/src/math/math_GlobOptMin.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement +#include + #include #include @@ -55,13 +57,13 @@ math_GlobOptMin::math_GlobOptMin(math_MultipleVarFunction* theFunc, const Standard_Real theC, const Standard_Real theDiscretizationTol, const Standard_Real theSameTol) -: myN(theFunc->NbVariables()), +: myFunc(theFunc), myN(theFunc->NbVariables()), myA(1, myN), myB(1, myN), myGlobA(1, myN), myGlobB(1, myN), - myIsConstLocked(Standard_False), - myX(1, myN), + myC(theC), myInitC(theC), myIsFindSingleSolution(Standard_False), myFunctionalMinimalValue(-Precision::Infinite()), myIsConstLocked(Standard_False), + myZ(-1), mySolCount(0), myX(1, myN), myTmp(1, myN), myV(1, myN), myMaxV(1, myN), @@ -70,15 +72,15 @@ math_GlobOptMin::math_GlobOptMin(math_MultipleVarFunction* theFunc, myCont(2), myF(Precision::Infinite()) { - Standard_Integer i; + Standard_Integer i = 0; - myFunc = theFunc; - myC = theC; - myInitC = theC; - myIsFindSingleSolution = Standard_False; - myFunctionalMinimalValue = -Precision::Infinite(); - myZ = -1; - mySolCount = 0; + + + + + + + for(i = 1; i <= myN; i++) { @@ -117,7 +119,7 @@ void math_GlobOptMin::SetGlobalParams(math_MultipleVarFunction* theFunc, const Standard_Real theDiscretizationTol, const Standard_Real theSameTol) { - Standard_Integer i; + Standard_Integer i = 0; myFunc = theFunc; myC = theC; @@ -155,7 +157,7 @@ void math_GlobOptMin::SetGlobalParams(math_MultipleVarFunction* theFunc, void math_GlobOptMin::SetLocalParams(const math_Vector& theLocalA, const math_Vector& theLocalB) { - Standard_Integer i; + Standard_Integer i = 0; myZ = -1; for(i = 1; i <= myN; i++) @@ -271,7 +273,7 @@ Standard_Boolean math_GlobOptMin::computeLocalExtremum(const math_Vector& thePnt Standard_Real& theVal, math_Vector& theOutPnt) { - Standard_Integer i; + Standard_Integer i = 0; //Newton method if (myCont >= 2 && @@ -346,14 +348,14 @@ void math_GlobOptMin::computeInitialValues() const Standard_Real aMaxLC = 1000.; const Standard_Real aMinEps = 0.1; const Standard_Real aMaxEps = 100.; - Standard_Integer i; + Standard_Integer i = 0; math_Vector aCurrPnt(1, myN); math_Vector aBestPnt(1, myN); math_Vector aParamStep(1, myN); Standard_Real aCurrVal = RealLast(); // Lipchitz const approximation. - Standard_Real aLipConst = 0.0, aPrevValDiag, aPrevValProj; + Standard_Real aLipConst = 0.0, aPrevValDiag = NAN, aPrevValProj = NAN; Standard_Integer aPntNb = 13; myFunc->Value(myA, aPrevValDiag); aPrevValProj = aPrevValDiag; @@ -389,15 +391,15 @@ void math_GlobOptMin::computeInitialValues() //======================================================================= void math_GlobOptMin::computeGlobalExtremum(Standard_Integer j) { - Standard_Integer i; - Standard_Real d = RealLast(), aPrevVal; // Functional in original and moved points. + Standard_Integer i = 0; + Standard_Real d = RealLast(), aPrevVal = NAN; // Functional in original and moved points. Standard_Real val = RealLast(); // Local extrema computed in moved point. Standard_Real aStepBestValue = RealLast(); math_Vector aStepBestPoint(1, myN); Standard_Boolean isInside = Standard_False, isReached = Standard_False; - Standard_Real r1, r2, r; + Standard_Real r1 = NAN, r2 = NAN, r = NAN; for(myX(j) = myA(j) + myE1; !isReached; myX(j) += myV(j)) { @@ -479,7 +481,7 @@ void math_GlobOptMin::computeGlobalExtremum(Standard_Integer j) //======================================================================= Standard_Boolean math_GlobOptMin::isInside(const math_Vector& thePnt) { - Standard_Integer i; + Standard_Integer i = 0; for(i = 1; i <= myN; i++) { @@ -495,7 +497,7 @@ Standard_Boolean math_GlobOptMin::isInside(const math_Vector& thePnt) //======================================================================= Standard_Boolean math_GlobOptMin::isStored(const math_Vector& thePnt) { - Standard_Integer i,j; + Standard_Integer i = 0,j = 0; Standard_Boolean isSame = Standard_True; math_Vector aTol(1, myN); aTol = (myB - myA) * mySameTol; @@ -559,7 +561,7 @@ Standard_Boolean math_GlobOptMin::isStored(const math_Vector& thePnt) //======================================================================= void math_GlobOptMin::Points(const Standard_Integer theIndex, math_Vector& theSol) { - Standard_Integer j; + Standard_Integer j = 0; for(j = 1; j <= myN; j++) theSol(j) = myY((theIndex - 1) * myN + j); @@ -598,7 +600,7 @@ Standard_Boolean math_GlobOptMin::CheckFunctionalStopCriteria() //======================================================================= void math_GlobOptMin::ComputeInitSol() { - Standard_Real aVal; + Standard_Real aVal = NAN; math_Vector aPnt(1, myN); // Check functional value in midpoint. It is necessary since local optimization diff --git a/src/math/math_GlobOptMin.hxx b/src/math/math_GlobOptMin.hxx index b2941e7caa..2ae21fe676 100644 --- a/src/math/math_GlobOptMin.hxx +++ b/src/math/math_GlobOptMin.hxx @@ -261,19 +261,19 @@ private: // Algorithm data. Standard_Real myZ; - Standard_Real myE1; // Border coefficient. - Standard_Real myE2; // Minimum step size. - Standard_Real myE3; // Local extrema starting parameter. + Standard_Real myE1{}; // Border coefficient. + Standard_Real myE2{}; // Minimum step size. + Standard_Real myE3{}; // Local extrema starting parameter. math_Vector myX; // Current modified solution. math_Vector myTmp; // Current modified solution. math_Vector myV; // Steps array. math_Vector myMaxV; // Max Steps array. - Standard_Real myLastStep; // Last step. + Standard_Real myLastStep{}; // Last step. NCollection_Array1 myCellSize; Standard_Integer myMinCellFilterSol; - Standard_Boolean isFirstCellFilterInvoke; + Standard_Boolean isFirstCellFilterInvoke{}; NCollection_CellFilter myFilter; // Continuity of local borders. diff --git a/src/math/math_Householder.cxx b/src/math/math_Householder.cxx index 152bdeccc1..60aecc6e4e 100644 --- a/src/math/math_Householder.cxx +++ b/src/math/math_Householder.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include #include @@ -39,12 +41,12 @@ math_Householder::math_Householder(const math_Matrix& A, const math_Vector& B, const Standard_Real EPS): Sol(1, A.ColNumber(), 1, 1), Q(1, A.RowNumber(), - 1, A.ColNumber()) { + 1, A.ColNumber()), mylowerArow(A.LowerRow()), mylowerAcol(A.LowerCol()), myupperArow(A.UpperRow()), myupperAcol(A.UpperCol()) { - mylowerArow = A.LowerRow(); - mylowerAcol = A.LowerCol(); - myupperArow = A.UpperRow(); - myupperAcol = A.UpperCol(); + + + + math_Matrix B1(1, B.Length(), 1, 1); B1.SetCol(1, B); Perform(A, B1, EPS); @@ -57,12 +59,12 @@ math_Householder::math_Householder(const math_Matrix& A, const math_Matrix& B, Sol(1, A.ColNumber(), 1, B.ColNumber()), Q(1, A.RowNumber(), - A.LowerCol(), A.UpperCol()) { + A.LowerCol(), A.UpperCol()), mylowerArow(A.LowerRow()), mylowerAcol(A.LowerCol()), myupperArow(A.UpperRow()), myupperAcol(A.UpperCol()) { - mylowerArow = A.LowerRow(); - mylowerAcol = A.LowerCol(); - myupperArow = A.UpperRow(); - myupperAcol = A.UpperCol(); + + + + Perform(A, B, EPS); } @@ -76,11 +78,11 @@ math_Householder::math_Householder(const math_Matrix& A, const math_Matrix& B, Sol(1, upperAcol-lowerAcol+1, 1, B.ColNumber()), Q(1, upperArow-lowerArow+1, - 1, upperAcol-lowerAcol+1) { - mylowerArow = lowerArow; - myupperArow = upperArow; - mylowerAcol = lowerAcol; - myupperAcol = upperAcol; + 1, upperAcol-lowerAcol+1), mylowerArow(lowerArow), myupperArow(upperArow), mylowerAcol(lowerAcol), myupperAcol(upperAcol) { + + + + Perform(A, B, EPS); } @@ -89,10 +91,10 @@ math_Householder::math_Householder(const math_Matrix& A, const math_Matrix& B, void math_Householder::Perform(const math_Matrix& A, const math_Matrix& B, const Standard_Real EPS) { - Standard_Integer i, j, k, n, l, m; - Standard_Real scale, f, g, h = 0., alfaii; - Standard_Real qki; - Standard_Real cj; + Standard_Integer i = 0, j = 0, k = 0, n = 0, l = 0, m = 0; + Standard_Real scale = NAN, f = NAN, g = NAN, h = 0., alfaii = NAN; + Standard_Real qki = NAN; + Standard_Real cj = NAN; n = Q.ColNumber(); l = Q.RowNumber(); m = B.ColNumber(); diff --git a/src/math/math_Householder.hxx b/src/math/math_Householder.hxx index 8c5e4f6af5..e36666da67 100644 --- a/src/math/math_Householder.hxx +++ b/src/math/math_Householder.hxx @@ -108,7 +108,7 @@ private: math_Matrix Sol; math_Matrix Q; - Standard_Boolean Done; + Standard_Boolean Done{}; Standard_Integer mylowerArow; Standard_Integer myupperArow; Standard_Integer mylowerAcol; diff --git a/src/math/math_IntegerVector.cxx b/src/math/math_IntegerVector.cxx index 60541a3e95..3674db4b43 100644 --- a/src/math/math_IntegerVector.cxx +++ b/src/math/math_IntegerVector.cxx @@ -110,8 +110,8 @@ Standard_Integer math_IntegerVector::Min() const void math_IntegerVector::Invert() { - Standard_Integer J; - Standard_Integer Temp; + Standard_Integer J = 0; + Standard_Integer Temp = 0; for(Standard_Integer Index = Lower(); Index <= Lower() + Length() / 2 ; Index++) { diff --git a/src/math/math_Jacobi.cxx b/src/math/math_Jacobi.cxx index e076b4b1fa..d3b7c5ab7d 100644 --- a/src/math/math_Jacobi.cxx +++ b/src/math/math_Jacobi.cxx @@ -24,15 +24,13 @@ #include #include -math_Jacobi::math_Jacobi(const math_Matrix& A) : AA(1, A.RowNumber(), - 1, A.RowNumber()), - EigenValues(1, A.RowNumber()), +math_Jacobi::math_Jacobi(const math_Matrix& A) : AA(A), EigenValues(1, A.RowNumber()), EigenVectors(1, A.RowNumber(), 1, A.RowNumber()) { math_NotSquare_Raise_if(A.RowNumber() != A.ColNumber(), " "); - AA = A; + Standard_Integer Error = Jacobi(AA, EigenValues, EigenVectors, NbRotations); if(!Error) { Done = Standard_True; diff --git a/src/math/math_Jacobi.hxx b/src/math/math_Jacobi.hxx index 9133c2d99c..cd085ea0b2 100644 --- a/src/math/math_Jacobi.hxx +++ b/src/math/math_Jacobi.hxx @@ -84,7 +84,7 @@ private: Standard_Boolean Done; math_Matrix AA; - Standard_Integer NbRotations; + Standard_Integer NbRotations{}; math_Vector EigenValues; math_Matrix EigenVectors; diff --git a/src/math/math_Kronrod.cxx b/src/math/math_Kronrod.cxx index 3b11e029d4..07388f26b2 100644 --- a/src/math/math_Kronrod.cxx +++ b/src/math/math_Kronrod.cxx @@ -3951,7 +3951,7 @@ Standard_Boolean math::KronrodPointsAndWeights(const Standard_Integer Index, if (Index <= 123) { // Get points from the array. - Standard_Integer i; + Standard_Integer i = 0; Standard_Integer aStartInd = 0; // Compute the index of starting point in the array. diff --git a/src/math/math_KronrodSingleIntegration.cxx b/src/math/math_KronrodSingleIntegration.cxx index 880e7137f2..d4e0a4dc66 100644 --- a/src/math/math_KronrodSingleIntegration.cxx +++ b/src/math/math_KronrodSingleIntegration.cxx @@ -14,6 +14,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -195,9 +197,9 @@ void math_KronrodSingleIntegration::Perform anErrors.Append(myAbsolutError); aValues.Append(myValue); - Standard_Integer i, nint, nbints; + Standard_Integer i = 0, nint = 0, nbints = 0; - Standard_Real maxerr; + Standard_Real maxerr = NAN; Standard_Integer count = 0; while(myErrorReached > theTolerance && myNbIterReached < theMaxNbIter) { @@ -216,7 +218,7 @@ void math_KronrodSingleIntegration::Perform Standard_Real b = anIntervals(nint+1); Standard_Real c = 0.5*(a + b); - Standard_Real v1, v2, e1, e2; + Standard_Real v1 = NAN, v2 = NAN, e1 = NAN, e2 = NAN; myIsDone = GKRule(theFunction, a, c, aGaussP, aGaussW, aKronrodP, aKronrodW, v1, e1); @@ -273,16 +275,16 @@ Standard_Boolean math_KronrodSingleIntegration::GKRule( Standard_Real& theError) { - Standard_Boolean IsDone; + Standard_Boolean IsDone = 0; Standard_Integer aNKronrod = theKronrodP.Length(); - Standard_Real aGaussVal; + Standard_Real aGaussVal = NAN; Standard_Integer aNPnt2 = (aNKronrod + 1)/2; - Standard_Integer i; - Standard_Real aDx; - Standard_Real aVal1; - Standard_Real aVal2; + Standard_Integer i = 0; + Standard_Real aDx = NAN; + Standard_Real aVal1 = NAN; + Standard_Real aVal2 = NAN; math_Vector f1(1, aNPnt2-1); math_Vector f2(1, aNPnt2-1); diff --git a/src/math/math_KronrodSingleIntegration.hxx b/src/math/math_KronrodSingleIntegration.hxx index 072a406a86..8ff4591ca1 100644 --- a/src/math/math_KronrodSingleIntegration.hxx +++ b/src/math/math_KronrodSingleIntegration.hxx @@ -103,9 +103,9 @@ private: Standard_Boolean myIsDone; Standard_Real myValue; Standard_Real myErrorReached; - Standard_Real myAbsolutError; + Standard_Real myAbsolutError{}; Standard_Integer myNbPntsReached; - Standard_Integer myNbIterReached; + Standard_Integer myNbIterReached{}; }; diff --git a/src/math/math_Matrix.cxx b/src/math/math_Matrix.cxx index 5fa865e747..2ffb36a887 100644 --- a/src/math/math_Matrix.cxx +++ b/src/math/math_Matrix.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -134,7 +136,7 @@ void math_Matrix::Transpose() Standard_Integer Row = LowerRowIndex; Standard_Integer Col = LowerColIndex; SetLowerCol(LowerRowIndex); - Standard_Real Temp; + Standard_Real Temp = NAN; for(Standard_Integer I = LowerRowIndex; I <= UpperRowIndex; I++) { for(Standard_Integer J = I; J <= UpperColIndex; J++) { Temp = Array(I, J); @@ -392,7 +394,7 @@ math_Matrix math_Matrix::Multiplied (const math_Matrix& Right) const math_Matrix Result(LowerRowIndex, UpperRowIndex, Right.LowerColIndex, Right.UpperColIndex); - Standard_Real Som; + Standard_Real Som = NAN; for(Standard_Integer I = LowerRowIndex; I <= UpperRowIndex; I++) { for(Standard_Integer J2 = Right.LowerColIndex; J2 <= Right.UpperColIndex; J2++) { Som = 0.0; @@ -415,7 +417,7 @@ math_Matrix math_Matrix::TMultiply (const math_Matrix& Right) const math_Matrix Result(LowerColIndex, UpperColIndex, Right.LowerColIndex, Right.UpperColIndex); - Standard_Real Som; + Standard_Real Som = NAN; for(Standard_Integer I = LowerColIndex; I <= UpperColIndex; I++) { for(Standard_Integer J2 = Right.LowerColIndex; J2 <= Right.UpperColIndex; J2++) { Som = 0.0; @@ -508,7 +510,7 @@ void math_Matrix::Multiply(const math_Matrix& Left, || (ColNumber() != Right.ColNumber()), "math_Matrix::Multiply() - matrices have incompatible dimensions"); - Standard_Real Som; + Standard_Real Som = NAN; Standard_Integer I1 = Left.LowerRowIndex; for(Standard_Integer I = LowerRowIndex; I <= UpperRowIndex; I++) { Standard_Integer J2 = Right.LowerColIndex; @@ -536,7 +538,7 @@ void math_Matrix::TMultiply(const math_Matrix& TLeft, || (ColNumber() != Right.ColNumber()), "math_Matrix::TMultiply() - matrices have incompatible dimensions"); - Standard_Real Som; + Standard_Real Som = NAN; Standard_Integer I1 = TLeft.LowerColIndex; for(Standard_Integer I = LowerRowIndex; I <= UpperRowIndex; I++) { Standard_Integer J2 = Right.LowerColIndex; @@ -610,7 +612,7 @@ void math_Matrix::Multiply(const math_Matrix& Right) Standard_DimensionError_Raise_if (ColNumber() != Right.RowNumber(), "math_Matrix::Multiply() - input matrix has incompatible dimensions"); - Standard_Real Som; + Standard_Real Som = NAN; for(Standard_Integer I = LowerRowIndex; I <= UpperRowIndex; I++) { for(Standard_Integer J2 = Right.LowerColIndex; J2 <= Right.UpperColIndex; J2++) { Som = 0.0; diff --git a/src/math/math_NewtonFunctionRoot.cxx b/src/math/math_NewtonFunctionRoot.cxx index 233d0b822f..96d03c0bd3 100644 --- a/src/math/math_NewtonFunctionRoot.cxx +++ b/src/math/math_NewtonFunctionRoot.cxx @@ -13,6 +13,8 @@ // commercial license or contractual agreement. +#include + #include #include #include @@ -23,17 +25,17 @@ math_NewtonFunctionRoot::math_NewtonFunctionRoot (math_FunctionWithDerivative& F const Standard_Real EpsF , const Standard_Real A, const Standard_Real B, - const Standard_Integer NbIterations ){ - EpsilonX = EpsX; - EpsilonF = EpsF; - Binf = A; - Bsup = B; - Itermax = NbIterations; - Done = Standard_False; - X = RealLast(); - DFx = 0; - Fx = RealLast(); - It = 0; + const Standard_Integer NbIterations ) : EpsilonX(EpsX), EpsilonF(EpsF), Binf(A), Bsup(B), Itermax(NbIterations), Done(Standard_False), X(RealLast()), DFx(0), Fx(RealLast()), It(0){ + + + + + + + + + + Perform(F, Guess); } @@ -42,18 +44,18 @@ math_NewtonFunctionRoot::math_NewtonFunctionRoot (const Standard_Real A , const Standard_Real B, const Standard_Real EpsX , const Standard_Real EpsF , - const Standard_Integer NbIterations ){ - - Binf = A; - Bsup = B; - EpsilonX = EpsX; - EpsilonF = EpsF; - Itermax = NbIterations; - Done = Standard_False; - X = RealLast(); - DFx = 0; - Fx = RealLast(); - It = 0; + const Standard_Integer NbIterations ) : Binf(A), Bsup(B), EpsilonX(EpsX), EpsilonF(EpsF), Itermax(NbIterations), Done(Standard_False), X(RealLast()), DFx(0), Fx(RealLast()), It(0){ + + + + + + + + + + + } @@ -61,17 +63,17 @@ math_NewtonFunctionRoot::math_NewtonFunctionRoot (math_FunctionWithDerivative& F const Standard_Real Guess, const Standard_Real EpsX , const Standard_Real EpsF , - const Standard_Integer NbIterations ){ - EpsilonX = EpsX; - EpsilonF = EpsF; - Itermax = NbIterations; - Binf = RealFirst(); - Bsup = RealLast(); - Done = Standard_False; - X = RealLast(); - DFx = 0; - Fx = RealLast(); - It = 0; + const Standard_Integer NbIterations ) : EpsilonX(EpsX), EpsilonF(EpsF), Itermax(NbIterations), Binf(RealFirst()), Bsup(RealLast()), Done(Standard_False), X(RealLast()), DFx(0), Fx(RealLast()), It(0){ + + + + + + + + + + Perform(F, Guess); } @@ -79,9 +81,9 @@ math_NewtonFunctionRoot::math_NewtonFunctionRoot (math_FunctionWithDerivative& F void math_NewtonFunctionRoot::Perform(math_FunctionWithDerivative& F, const Standard_Real Guess) { - Standard_Real Dx; - Standard_Boolean Ok; - Standard_Real AA, BB; + Standard_Real Dx = NAN; + Standard_Boolean Ok = 0; + Standard_Real AA = NAN, BB = NAN; //-------------------------------------------------- //-- lbr le 12 Nov 97 diff --git a/src/math/math_NewtonFunctionSetRoot.cxx b/src/math/math_NewtonFunctionSetRoot.cxx index 8c695f8853..8db8b6b7c5 100644 --- a/src/math/math_NewtonFunctionSetRoot.cxx +++ b/src/math/math_NewtonFunctionSetRoot.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include #include @@ -117,9 +119,9 @@ void math_NewtonFunctionSetRoot::Perform( const math_Vector& SupBound) { - Standard_Real d; - Standard_Boolean OK; - Standard_Integer Error; + Standard_Real d = NAN; + Standard_Boolean OK = 0; + Standard_Integer Error = 0; Done = Standard_False; Sol = StartingPoint; diff --git a/src/math/math_NewtonMinimum.cxx b/src/math/math_NewtonMinimum.cxx index 89ae93f952..117faef876 100644 --- a/src/math/math_NewtonMinimum.cxx +++ b/src/math/math_NewtonMinimum.cxx @@ -21,6 +21,8 @@ //#endif +#include + #include #include #include @@ -95,8 +97,8 @@ void math_NewtonMinimum::Perform(math_MultipleVarFunctionWithHessian& F, math_Vector* auxiliaire = precedent; Standard_Boolean Ok = Standard_True; - Standard_Integer NbConv = 0, ii, Nreduction; - Standard_Real VPrecedent, VItere; + Standard_Integer NbConv = 0, ii = 0, Nreduction = 0; + Standard_Real VPrecedent = NAN, VItere = NAN; Done = Standard_True; TheStatus = math_OK; diff --git a/src/math/math_PSO.cxx b/src/math/math_PSO.cxx index b9e1323ec9..16408f0f89 100644 --- a/src/math/math_PSO.cxx +++ b/src/math/math_PSO.cxx @@ -13,6 +13,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include @@ -30,19 +32,12 @@ math_PSO::math_PSO(math_MultipleVarFunction* theFunc, const math_Vector& theSteps, const Standard_Integer theNbParticles, const Standard_Integer theNbIter) -: myLowBorder(1, theFunc->NbVariables()), - myUppBorder(1, theFunc->NbVariables()), - mySteps(1, theFunc->NbVariables()) -{ - myN = theFunc->NbVariables(); - myNbParticles = theNbParticles; - myNbIter = theNbIter; - myFunc = theFunc; - - myLowBorder = theLowBorder; - myUppBorder = theUppBorder; - mySteps = theSteps; -} +: myFunc(theFunc), + myLowBorder(theLowBorder), + myUppBorder(theUppBorder), mySteps(theSteps), + myN(theFunc->NbVariables()), myNbParticles(theNbParticles), + myNbIter(theNbIter) +{} //======================================================================= //function : math_PSO @@ -78,7 +73,7 @@ void math_PSO::Perform(const math_Vector& theSteps, // Generate initial particles distribution. Standard_Boolean isRegularGridFinished = Standard_False; - Standard_Real aCurrValue; + Standard_Real aCurrValue = NAN; math_Vector aCurrPoint(1, myN); PSO_Particle* aParticle = aPool.GetWorstParticle(); @@ -89,7 +84,7 @@ void math_PSO::Perform(const math_Vector& theSteps, if (aCurrValue < aParticle->Distance) { - Standard_Integer aDimIdx; + Standard_Integer aDimIdx = 0; for(aDimIdx = 0; aDimIdx < myN; ++aDimIdx) { aParticle->Position[aDimIdx] = aCurrPoint(aDimIdx + 1); diff --git a/src/math/math_PSOParticlesPool.cxx b/src/math/math_PSOParticlesPool.cxx index 8fd5dc28cb..fa436f6f98 100644 --- a/src/math/math_PSOParticlesPool.cxx +++ b/src/math/math_PSOParticlesPool.cxx @@ -27,13 +27,13 @@ math_PSOParticlesPool::math_PSOParticlesPool(const Standard_Integer theParticles myMemory(0, theParticlesCount * (theDimensionCount // Position + theDimensionCount // Velocity + theDimensionCount) // BestPosition - - 1) + - 1), myParticlesCount(theParticlesCount), myDimensionCount(theDimensionCount) { - myParticlesCount = theParticlesCount; - myDimensionCount = theDimensionCount; + + myMemory.Init(0.); // Pointers adjusting. - Standard_Integer aParIdx, aShiftIdx; + Standard_Integer aParIdx = 0, aShiftIdx = 0; for(aParIdx = 1; aParIdx <= myParticlesCount; ++aParIdx) { aShiftIdx = (theDimensionCount * 3) * (aParIdx - 1); diff --git a/src/math/math_Powell.cxx b/src/math/math_Powell.cxx index 14b3dbd83a..fe23d915dc 100644 --- a/src/math/math_Powell.cxx +++ b/src/math/math_Powell.cxx @@ -19,6 +19,8 @@ //#endif +#include + #include #include #include @@ -47,17 +49,17 @@ class DirFunctionBis : public math_Function { void Initialize(const math_Vector& p0, const math_Vector& dir); - virtual Standard_Boolean Value(const Standard_Real x, Standard_Real& fval); + Standard_Boolean Value(const Standard_Real x, Standard_Real& fval) override; }; DirFunctionBis::DirFunctionBis(math_Vector& V1, math_Vector& V2, math_Vector& V3, - math_MultipleVarFunction& f) { - P0 = &V1; - Dir = &V2; - P = &V3; - F = &f; + math_MultipleVarFunction& f) : P0(&V1), Dir(&V2), P(&V3), F(&f) { + + + + } @@ -83,9 +85,9 @@ static Standard_Boolean MinimizeDirection(math_Vector& P, Standard_Real& Result, DirFunctionBis& F) { - Standard_Real ax; - Standard_Real xx; - Standard_Real bx; + Standard_Real ax = NAN; + Standard_Real xx = NAN; + Standard_Real bx = NAN; F.Initialize(P, Dir); @@ -146,8 +148,8 @@ void math_Powell::Perform(math_MultipleVarFunction& F, const math_Matrix& StartingDirections) { Done = Standard_False; - Standard_Integer i, ibig, j; - Standard_Real t, fptt, del; + Standard_Integer i = 0, ibig = 0, j = 0; + Standard_Real t = NAN, fptt = NAN, del = NAN; Standard_Integer n = TheLocation.Length(); math_Vector pt(1,n); math_Vector ptt(1,n); diff --git a/src/math/math_Recipes.cxx b/src/math/math_Recipes.cxx index d8da2fd77f..88edb7f0ec 100644 --- a/src/math/math_Recipes.cxx +++ b/src/math/math_Recipes.cxx @@ -18,6 +18,8 @@ #define No_Standard_DimensionError //#endif +#include + #include #include @@ -55,8 +57,8 @@ static inline Standard_Real PYTHAG (const Standard_Real a, const Standard_Real b static void EigenSort(math_Vector& d, math_Matrix& v) { // descending order - Standard_Integer k, i, j; - Standard_Real p; + Standard_Integer k = 0, i = 0, j = 0; + Standard_Real p = NAN; Standard_Integer n = d.Length(); for(i = 1; i < n; i++) { @@ -78,8 +80,8 @@ static void EigenSort(math_Vector& d, math_Matrix& v) { // descending order Standard_Integer Jacobi(math_Matrix& a, math_Vector& d, math_Matrix& v, Standard_Integer& nrot) { Standard_Integer n = a.RowNumber(); - Standard_Integer j, iq, ip, i; - Standard_Real tresh, theta, tau, t, sm, s, h, g, c; + Standard_Integer j = 0, iq = 0, ip = 0, i = 0; + Standard_Real tresh = NAN, theta = NAN, tau = NAN, t = NAN, sm = NAN, s = NAN, h = NAN, g = NAN, c = NAN; math_Vector b(1, n); math_Vector z(1, n); @@ -166,8 +168,8 @@ Standard_Integer LU_Decompose(math_Matrix& a, Standard_Real TINY, const Message_ProgressRange& theProgress) { - Standard_Integer i, imax=0, j, k; - Standard_Real big, dum, sum, temp; + Standard_Integer i = 0, imax=0, j = 0, k = 0; + Standard_Real big = NAN, dum = NAN, sum = NAN, temp = NAN; Standard_Integer n = a.RowNumber(); d = 1.0; @@ -247,8 +249,8 @@ void LU_Solve(const math_Matrix& a, const math_IntegerVector& indx, math_Vector& b) { - Standard_Integer i, ii = 0, ip, j; - Standard_Real sum; + Standard_Integer i = 0, ii = 0, ip = 0, j = 0; + Standard_Real sum = NAN; Standard_Integer n=a.RowNumber(); Standard_Integer nblow=b.Lower()-1; @@ -276,8 +278,8 @@ Standard_Integer LU_Invert(math_Matrix& a) { math_Matrix inv(1, n, 1, n); math_Vector col(1, n); math_IntegerVector indx(1, n); - Standard_Real d; - Standard_Integer i, j; + Standard_Real d = NAN; + Standard_Integer i = 0, j = 0; Standard_Integer Error = LU_Decompose(a, indx, d); if(!Error) { @@ -313,8 +315,8 @@ Standard_Integer SVD_Decompose(math_Matrix& a, math_Matrix& v, math_Vector& rv1) { - Standard_Integer flag, i, its, j, jj, k, l=0, nm=0; - Standard_Real ar, aw, aik, aki, c, f, h, s, x, y, z; + Standard_Integer flag = 0, i = 0, its = 0, j = 0, jj = 0, k = 0, l=0, nm=0; + Standard_Real ar = NAN, aw = NAN, aik = NAN, aki = NAN, c = NAN, f = NAN, h = NAN, s = NAN, x = NAN, y = NAN, z = NAN; Standard_Real anorm = 0.0, g = 0.0, scale = 0.0; Standard_Integer m = a.RowNumber(); Standard_Integer n = a.ColNumber(); @@ -537,8 +539,8 @@ void SVD_Solve(const math_Matrix& u, const math_Vector& b, math_Vector& x) { - Standard_Integer jj, j, i; - Standard_Real s; + Standard_Integer jj = 0, j = 0, i = 0; + Standard_Real s = NAN; Standard_Integer m = u.RowNumber(); Standard_Integer n = u.ColNumber(); @@ -565,11 +567,11 @@ Standard_Integer DACTCL_Decompose(math_Vector& a, const math_IntegerVector& indx, const Standard_Real MinPivot) { - Standard_Integer i, j, Neq = indx.Length(); - Standard_Integer jr, jd, jh, is, ie, k, ir, id, ih, mh; - Standard_Integer idot, idot1, idot2; - Standard_Real aa, d, dot; - Standard_Boolean diag; + Standard_Integer i = 0, j = 0, Neq = indx.Length(); + Standard_Integer jr = 0, jd = 0, jh = 0, is = 0, ie = 0, k = 0, ir = 0, id = 0, ih = 0, mh = 0; + Standard_Integer idot = 0, idot1 = 0, idot2 = 0; + Standard_Real aa = NAN, d = NAN, dot = NAN; + Standard_Boolean diag = 0; jr = 0; for (j = 1; j <= Neq; j++) { @@ -633,10 +635,10 @@ Standard_Integer DACTCL_Solve(const math_Vector& a, const math_IntegerVector& indx, const Standard_Real MinPivot) { - Standard_Integer i, j, Neq = indx.Length(); - Standard_Integer jr, jd, jh, is, k, id; - Standard_Integer jh1, idot, idot1, idot2; - Standard_Real aa, d, dot; + Standard_Integer i = 0, j = 0, Neq = indx.Length(); + Standard_Integer jr = 0, jd = 0, jh = 0, is = 0, k = 0, id = 0; + Standard_Integer jh1 = 0, idot = 0, idot1 = 0, idot2 = 0; + Standard_Real aa = NAN, d = NAN, dot = NAN; jr = 0; for (j = 1; j <= Neq; j++) { diff --git a/src/math/math_SVD.cxx b/src/math/math_SVD.cxx index 88c8d7d899..140d845ae5 100644 --- a/src/math/math_SVD.cxx +++ b/src/math/math_SVD.cxx @@ -29,10 +29,10 @@ math_SVD::math_SVD (const math_Matrix& A) : U (1, Max(A.RowNumber(),A.ColNumber()), 1, A.ColNumber()) , V (1, A.ColNumber(), 1, A.ColNumber()), - Diag (1, A.ColNumber()) + Diag (1, A.ColNumber()), RowA(A.RowNumber()) { U.Init(0.0); - RowA = A.RowNumber() ; + U.Set(1, A.RowNumber(), 1, A.ColNumber(), A) ; Standard_Integer Error = SVD_Decompose(U, Diag, V) ; Done = (!Error) ? Standard_True : Standard_False ; @@ -60,7 +60,7 @@ void math_SVD::Solve (const math_Vector& B, void math_SVD::PseudoInverse (math_Matrix& Result, const Standard_Real Eps) { - Standard_Integer i, j ; + Standard_Integer i = 0, j = 0 ; StdFail_NotDone_Raise_if(!Done, " "); diff --git a/src/math/math_TrigonometricFunctionRoots.cxx b/src/math/math_TrigonometricFunctionRoots.cxx index 692fa3153c..f6ab9aaa93 100644 --- a/src/math/math_TrigonometricFunctionRoots.cxx +++ b/src/math/math_TrigonometricFunctionRoots.cxx @@ -24,6 +24,8 @@ #define No_Standard_DimensionError //#endif +#include + #include #include #include @@ -87,12 +89,12 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, const Standard_Real InfBound, const Standard_Real SupBound) { - Standard_Integer i, j=0, k, l, NZer=0, Nit = 10; - Standard_Real Depi, Delta, Mod, AA, BB, CC, MyBorneInf; - Standard_Real Teta, X; - Standard_Real Eps, Tol1 = 1.e-15; + Standard_Integer i = 0, j=0, k = 0, l = 0, NZer=0, Nit = 10; + Standard_Real Depi = NAN, Delta = NAN, Mod = NAN, AA = NAN, BB = NAN, CC = NAN, MyBorneInf = NAN; + Standard_Real Teta = NAN, X = NAN; + Standard_Real Eps = NAN, Tol1 = 1.e-15; TColStd_Array1OfReal ko(1,5), Zer(1,4); - Standard_Boolean Flag4; + Standard_Boolean Flag4 = 0; InfiniteStatus = Standard_False; Done = Standard_True; @@ -333,7 +335,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, ko(3) = 2.0*E-2.0*A; ko(4) = 4.0*B+2.0*D; ko(5) = A+C+E; - Standard_Boolean bko; + Standard_Boolean bko = 0; Standard_Integer nbko=0; do { bko=Standard_False; @@ -352,7 +354,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, InfiniteStatus = Standard_True; return; } - Standard_Boolean triok; + Standard_Boolean triok = 0; do { triok=Standard_True; for(i=1;i + #include #include #include @@ -74,10 +76,10 @@ void math_Uzawa::Perform(const math_Matrix& Cont, const math_Vector& Secont, const Standard_Real EpsLix, const Standard_Real EpsLic, const Standard_Integer NbIterations) { - Standard_Integer i,j, k; - Standard_Real scale; - Standard_Real Normat, Normli, Xian, Xmax=0, Xmuian; - Standard_Real Rho, Err, Err1, ErrMax=0, Coef = 1./Sqrt(2.); + Standard_Integer i = 0,j = 0, k = 0; + Standard_Real scale = NAN; + Standard_Real Normat = NAN, Normli = NAN, Xian = NAN, Xmax=0, Xmuian = NAN; + Standard_Real Rho = NAN, Err = NAN, Err1 = NAN, ErrMax=0, Coef = 1./Sqrt(2.); Standard_Integer Nlig = Cont.RowNumber(); Standard_Integer Ncol = Cont.ColNumber(); diff --git a/src/math/math_Uzawa.hxx b/src/math/math_Uzawa.hxx index da914e1e94..bee185521c 100644 --- a/src/math/math_Uzawa.hxx +++ b/src/math/math_Uzawa.hxx @@ -123,8 +123,8 @@ private: math_Vector Errinit; math_Vector Vardua; math_Matrix CTCinv; - Standard_Integer NbIter; - Standard_Boolean Done; + Standard_Integer NbIter{}; + Standard_Boolean Done{}; };