From: SONOLET Aymeric Date: Wed, 3 Jan 2024 12:42:30 +0000 (+0100) Subject: refactor: use clang-tidy again X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bf7e9ac9404a3b6bb1fb03a71a1feda0c833cdef;p=modules%2Fshaper.git refactor: use clang-tidy again Use readability separate declarations and strict unused variables --- diff --git a/.clang-tidy b/.clang-tidy index 118e72abf..02f4920f6 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,6 +1,6 @@ --- Checks: | - -*,clang-diagnostic-*,clang-analyzer-*,modernize-use-override,modernize-use-nullptr,modernize-use-using,modernize-use-default-member-init,modernize-loop-convert,modernize-use-auto,modernize-redundant-void-arg,modernize-type-traits,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,misc-include-cleaner,misc-const-correctness,misc-unused-parameters + -*,clang-diagnostic-*,clang-analyzer-*,modernize-use-override,modernize-use-nullptr,modernize-use-using,modernize-use-default-member-init,modernize-loop-convert,modernize-use-auto,modernize-redundant-void-arg,modernize-type-traits,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,readability-isolate-declaration,misc-include-cleaner,misc-const-correctness,misc-unused-parameters WarningsAsErrors: '' HeaderFilterRegex: .*SHAPER.* AnalyzeTemporaryDtors: false @@ -23,8 +23,12 @@ CheckOptions: value: '10' - key: google-readability-namespace-comments.SpacesBeforeComments value: '2' + - key: misc-const-corectness.WarnPointersAsValues + value: '1' + - key: misc-const-corectness.TransformPointersAsValues + value: '1' - key: misc-unused-parameters.StrictMode - value: '0' + value: '1' - key: modernize-loop-convert.MaxCopySize value: '16' - key: modernize-loop-convert.MinConfidence diff --git a/src/BuildPlugin/BuildPlugin_Edge.cpp b/src/BuildPlugin/BuildPlugin_Edge.cpp index e294266df..a1b4df351 100644 --- a/src/BuildPlugin/BuildPlugin_Edge.cpp +++ b/src/BuildPlugin/BuildPlugin_Edge.cpp @@ -175,7 +175,9 @@ void BuildPlugin_Edge::edgeByPoints() { } std::string aError; - GeomShapePtr aFirstShape, aSecondShape; + GeomShapePtr aFirstShape; + + GeomShapePtr aSecondShape; if (!getShape(aFirstPointAttr, aFirstShape, aError) || !getShape(aSecondPointAttr, aSecondShape, aError)) { setError(aError); diff --git a/src/BuildPlugin/BuildPlugin_Filling.cpp b/src/BuildPlugin/BuildPlugin_Filling.cpp index 69e42797c..b177ae1ed 100644 --- a/src/BuildPlugin/BuildPlugin_Filling.cpp +++ b/src/BuildPlugin/BuildPlugin_Filling.cpp @@ -248,7 +248,9 @@ static void edgePoints(const GeomEdgePtr &theEdge, bool isReverseClosedCurve(const GeomEdgePtr &theEdge1, const GeomEdgePtr &theEdge2) { - std::list anEdge1Points, anEdge2Points; + std::list anEdge1Points; + + std::list anEdge2Points; edgePoints(theEdge1, anEdge1Points); edgePoints(theEdge2, anEdge2Points); @@ -287,7 +289,9 @@ bool isReverseOpenedCurve(const GeomEdgePtr &theEdge1, void shiftStartPoint(GeomWirePtr &theWire, const GeomEdgePtr &theRefEdge, const double theTolerance) { if (!theWire->isClosed()) { - GeomVertexPtr aV1, aV2; + GeomVertexPtr aV1; + + GeomVertexPtr aV2; GeomAlgoAPI_ShapeTools::findBounds(theWire, aV1, aV2); if (aV1->point()->distance(aV2->point()) > theTolerance) return; @@ -295,7 +299,9 @@ void shiftStartPoint(GeomWirePtr &theWire, const GeomEdgePtr &theRefEdge, // find closest vertex on the wire to the start point on the edge GeomPointPtr aFirstRefPnt = theRefEdge->firstPoint(); - ListOfShape aBegin, aEnd; + ListOfShape aBegin; + + ListOfShape aEnd; double aMinDist = 1.e100; for (GeomAPI_WireExplorer anExp(theWire); anExp.more(); anExp.next()) { double aDist = anExp.currentVertex()->point()->distance(aFirstRefPnt); diff --git a/src/BuildPlugin/BuildPlugin_Interpolation.cpp b/src/BuildPlugin/BuildPlugin_Interpolation.cpp index b3ed0320f..e92b5b001 100644 --- a/src/BuildPlugin/BuildPlugin_Interpolation.cpp +++ b/src/BuildPlugin/BuildPlugin_Interpolation.cpp @@ -186,7 +186,9 @@ void BuildPlugin_Interpolation::execute() { isClosed ? false : (!string(USE_TANGENTS_ID())->value().empty()); // Get tangent for start and end points - GeomDirPtr aDirStart, aDirEnd; + GeomDirPtr aDirStart; + + GeomDirPtr aDirEnd; if (isToUseTangents) { aDirStart = selectionToDir(selection(TANGENT_START_ID())); aDirEnd = selectionToDir(selection(TANGENT_END_ID())); diff --git a/src/BuildPlugin/BuildPlugin_Shell.cpp b/src/BuildPlugin/BuildPlugin_Shell.cpp index 47b10053d..366903ec1 100644 --- a/src/BuildPlugin/BuildPlugin_Shell.cpp +++ b/src/BuildPlugin/BuildPlugin_Shell.cpp @@ -43,7 +43,9 @@ void BuildPlugin_Shell::execute() { AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID()); // Collect base shapes. - ListOfShape aShapes, aContexts; + ListOfShape aShapes; + + ListOfShape aContexts; getOriginalShapesAndContexts(BASE_OBJECTS_ID(), aShapes, aContexts); // Collect sketch faces. diff --git a/src/BuildPlugin/BuildPlugin_Wire.cpp b/src/BuildPlugin/BuildPlugin_Wire.cpp index b16606ff5..c1dafc8df 100644 --- a/src/BuildPlugin/BuildPlugin_Wire.cpp +++ b/src/BuildPlugin/BuildPlugin_Wire.cpp @@ -388,7 +388,9 @@ bool buildSketchWires(FeaturePtr theSketchFeature, GeomShapePtr theSketchShape, MapVertexWire aMapVW; for (auto &aSketchEdge : aSketchEdges) { GeomEdgePtr anEdge = aSketchEdge->edge(); - GeomVertexPtr aStartV, aEndV; + GeomVertexPtr aStartV; + + GeomVertexPtr aEndV; anEdge->vertices(aStartV, aEndV); auto aFoundStart = aMapVW.find(aStartV); auto aFoundEnd = aMapVW.find(aEndV); diff --git a/src/CollectionPlugin/CollectionPlugin_Group.cpp b/src/CollectionPlugin/CollectionPlugin_Group.cpp index eaf5b479f..de867a0cd 100644 --- a/src/CollectionPlugin/CollectionPlugin_Group.cpp +++ b/src/CollectionPlugin/CollectionPlugin_Group.cpp @@ -81,7 +81,9 @@ bool CollectionPlugin_Group::customAction(const std::string &theActionId) { if (theActionId == "split") { DocumentPtr aDoc = document(); // collect all existing names of features to give unique names - std::set aFeatNames, aResNames; + std::set aFeatNames; + + std::set aResNames; std::list allFeat = aDoc->allFeatures(); auto allFeatIter = allFeat.begin(); for (; allFeatIter != allFeat.end(); allFeatIter++) { diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index 3fa444a4e..9080d7b75 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -120,7 +120,9 @@ std::string Config_XMLReader::findConfigFile(const std::string theFileName, if (aSolution > 2) { // there may be several paths separated by ";" symbol // LCOV_EXCL_START std::string anEnvPart = anEnv; - size_t aPosStart = 0, aPosEnd; + size_t aPosStart = 0; + + size_t aPosEnd; for (int aSubNum = 0; aSubNum < aSolution - 3; aSubNum++) { aPosStart++; aPosStart = anEnvPart.find(';', aPosStart); diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp index d68fa5aa3..fca7ed75f 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp @@ -228,7 +228,9 @@ void ConstructionPlugin_Axis::createAxisByLine() { } else if (aLineShape->isCompound()) { // create an edge which covers all edges from compounds (they are on the // same line) - GeomPointPtr aFirst, aLast; + GeomPointPtr aFirst; + + GeomPointPtr aLast; GeomXYZPtr aLineVec; for (GeomAPI_ShapeIterator anIt(aLineShape); anIt.more(); anIt.next()) { GeomEdgePtr aSub = anIt.current()->edge(); diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp index 724803570..20d2291cb 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp @@ -202,8 +202,13 @@ ConstructionPlugin_Plane::createByGeneralEquation() { (anAttrC.get() != nullptr) && (anAttrD.get() != nullptr) && anAttrA->isInitialized() && anAttrB->isInitialized() && anAttrC->isInitialized() && anAttrD->isInitialized()) { - double aA = anAttrA->value(), aB = anAttrB->value(), aC = anAttrC->value(), - aD = anAttrD->value(); + double aA = anAttrA->value(); + + double aB = anAttrB->value(); + + double aC = anAttrC->value(); + + double aD = anAttrD->value(); std::shared_ptr aPlane = std::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); double aSize = Config_PropManager::real(SKETCH_TAB_NAME, "planes_size"); @@ -289,7 +294,9 @@ ConstructionPlugin_Plane::createByLineAndPoint() { aRes = GeomAlgoAPI_FaceBuilder::squareFace( aNewPln, aSize > aDistance ? aSize : aDistance); } else { - std::shared_ptr aV1, aV2; + std::shared_ptr aV1; + + std::shared_ptr aV2; GeomAlgoAPI_ShapeTools::findBounds(anEdge, aV1, aV2); aRes = faceByThreeVertices(aV1, aV2, aVertex); } @@ -526,13 +533,27 @@ std::shared_ptr makeRectangularFace(const std::shared_ptr theFace, const std::shared_ptr thePln) { // Create rectangular face close to the selected - double aXmin, aYmin, Zmin, aXmax, aYmax, Zmax; + double aXmin; + + double aYmin; + + double Zmin; + + double aXmax; + + double aYmax; + + double Zmax; theFace->computeSize(aXmin, aYmin, Zmin, aXmax, aYmax, Zmax); // use all 8 points of the bounding box to find the 2D bounds bool isFirst = true; - double aMinX2d = DBL_MAX, aMaxX2d = -DBL_MAX; - double aMinY2d = DBL_MAX, aMaxY2d = -DBL_MAX; + double aMinX2d = DBL_MAX; + + double aMaxX2d = -DBL_MAX; + double aMinY2d = DBL_MAX; + + double aMaxY2d = -DBL_MAX; for (int aXIsMin = 0; aXIsMin < 2; aXIsMin++) { for (int aYIsMin = 0; aYIsMin < 2; aYIsMin++) { for (int aZIsMin = 0; aZIsMin < 2; aZIsMin++) { diff --git a/src/ExchangeAPI/ExchangeAPI_Import.cpp b/src/ExchangeAPI/ExchangeAPI_Import.cpp index b659f2dc9..98af94c1d 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Import.cpp @@ -281,7 +281,9 @@ void ExchangeAPI_Import_Image::dump(ModelHighAPI_Dumper &theDumper) const { std::string aNewImageDir = theDumper.getDumpDir(); if (aResult.get() && aResult->hasTexture()) { // get image data - int aWidth, aHeight; + int aWidth; + + int aHeight; std::string aFormat; std::list aByteList; AttributeImagePtr anImageAttr = diff --git a/src/ExchangePlugin/ExchangePlugin_ExportPart.cpp b/src/ExchangePlugin/ExchangePlugin_ExportPart.cpp index aceeeba22..781c8f1db 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportPart.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportPart.cpp @@ -99,7 +99,11 @@ void ExchangePlugin_ExportPart::execute() { if (aFeaturesToExport.back()->getKind() == ExchangePlugin_ExportPart::ID()) aFeaturesToExport.pop_back(); - std::list anExternalLinks, anExportedParts, aReferredParts; + std::list anExternalLinks; + + std::list anExportedParts; + + std::list aReferredParts; if (!verifyExport(aFeaturesToExport, anExternalLinks, anExportedParts, aReferredParts)) { if (!anExternalLinks.empty()) { diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index f3d469f45..6248cea20 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -200,7 +200,9 @@ void ExchangePlugin_ImportFeature::importFile(const std::string &theFileName) { data()->setName(Locale::Convert::toWString(anObjectName)); ResultBodyPtr aResult = document()->createBody(data()); - bool anColorGroupSelected = false, anMaterialsGroupSelected = false; + bool anColorGroupSelected = false; + + bool anMaterialsGroupSelected = false; if (anExtension == "BREP" || anExtension == "BRP") { aGeomShape = BREPImport(theFileName, anExtension, anError); } else if (anExtension == "STEP" || anExtension == "STP") { diff --git a/src/FeaturesAPI/FeaturesAPI_Translation.cpp b/src/FeaturesAPI/FeaturesAPI_Translation.cpp index df55d89d1..932db666a 100644 --- a/src/FeaturesAPI/FeaturesAPI_Translation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Translation.cpp @@ -187,7 +187,9 @@ TranslationPtr addTranslation( startPoint.variantType() != ModelHighAPI_Selection::VT_Empty && endPoint.variantType() != ModelHighAPI_Selection::VT_Empty; - ModelHighAPI_Selection firstSel, secondSel; + ModelHighAPI_Selection firstSel; + + ModelHighAPI_Selection secondSel; ModelHighAPI_Double values[VEC_SIZE]; if (byAxis) { firstSel = axis; diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp index 6fa2beb88..477fbe15f 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp @@ -69,7 +69,9 @@ void FeaturesPlugin_BooleanCommon::initAttributes() { //================================================================================================== void FeaturesPlugin_BooleanCommon::execute() { ListOfShape aPlanes; - GeomAPI_ShapeHierarchy anObjects, aTools; + GeomAPI_ShapeHierarchy anObjects; + + GeomAPI_ShapeHierarchy aTools; bool isSimpleMode = false; diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp index c2333a741..fa074e7b8 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp @@ -65,7 +65,9 @@ void FeaturesPlugin_BooleanCut::initAttributes() { //================================================================================================== void FeaturesPlugin_BooleanCut::execute() { - GeomAPI_ShapeHierarchy anObjects, aTools; + GeomAPI_ShapeHierarchy anObjects; + + GeomAPI_ShapeHierarchy aTools; ListOfShape aPlanes; // Getting objects and tools diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp index 695893e90..b9e2ec5ad 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp @@ -56,7 +56,9 @@ void FeaturesPlugin_BooleanFill::initAttributes() { //================================================================================================= void FeaturesPlugin_BooleanFill::execute() { std::string anError; - GeomAPI_ShapeHierarchy anObjects, aTools; + GeomAPI_ShapeHierarchy anObjects; + + GeomAPI_ShapeHierarchy aTools; ListOfShape aPlanes; // Getting objects. diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp index 8aebe92de..54e2f6f25 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp @@ -143,7 +143,9 @@ void FeaturesPlugin_BooleanFuse::initAttributes() { //================================================================================================== void FeaturesPlugin_BooleanFuse::execute() { std::string anError; - GeomAPI_ShapeHierarchy anObjectsHierarchy, aToolsHierarchy; + GeomAPI_ShapeHierarchy anObjectsHierarchy; + + GeomAPI_ShapeHierarchy aToolsHierarchy; ListOfShape aPlanes; bool isSimpleCreation = false; @@ -163,7 +165,11 @@ void FeaturesPlugin_BooleanFuse::execute() { !processAttribute(TOOL_LIST_ID(), aToolsHierarchy, aPlanes)) return; - ListOfShape anObjects, aTools, anEdgesAndFaces; + ListOfShape anObjects; + + ListOfShape aTools; + + ListOfShape anEdgesAndFaces; // all objects except edges and faces anObjectsHierarchy.objectsByType(anEdgesAndFaces, anObjects, GeomAPI_Shape::FACE, GeomAPI_Shape::EDGE); @@ -215,7 +221,9 @@ void FeaturesPlugin_BooleanFuse::execute() { // mark all subs of this parent as precessed to avoid handling twice aParent = anObjectsHierarchy.parent(anObject); - ListOfShape aUsed, aNotUsed; + ListOfShape aUsed; + + ListOfShape aNotUsed; anObjectsHierarchy.splitCompound(aParent, aUsed, aNotUsed); aShapesToAdd.insert(aShapesToAdd.end(), aNotUsed.begin(), aNotUsed.end()); } else diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp index 894e51d7c..8076f8b0f 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp @@ -62,7 +62,9 @@ void FeaturesPlugin_BooleanSmash::initAttributes() { //================================================================================================== void FeaturesPlugin_BooleanSmash::execute() { std::string anError; - GeomAPI_ShapeHierarchy anObjectsHistory, aToolsHistory; + GeomAPI_ShapeHierarchy anObjectsHistory; + + GeomAPI_ShapeHierarchy aToolsHistory; ListOfShape aPlanes; // Getting objects and tools. @@ -98,7 +100,9 @@ void FeaturesPlugin_BooleanSmash::execute() { if (aParent) { anOriginalShapes.push_back(aParent); - ListOfShape aUsed, aNotUsed; + ListOfShape aUsed; + + ListOfShape aNotUsed; anObjectsHistory.splitCompound(aParent, aUsed, aNotUsed); aShapesToAdd.insert(aShapesToAdd.end(), aNotUsed.begin(), aNotUsed.end()); diff --git a/src/FeaturesPlugin/FeaturesPlugin_BoundingBox.cpp b/src/FeaturesPlugin/FeaturesPlugin_BoundingBox.cpp index a3ecb2f7a..431ed6c86 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BoundingBox.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BoundingBox.cpp @@ -117,7 +117,17 @@ bool FeaturesPlugin_BoundingBox::updateValues() { } if (aShape && !aShape->isEqual(myShape)) { - double aXmin, aXmax, aYmin, aYmax, aZmin, aZmax; + double aXmin; + + double aXmax; + + double aYmin; + + double aYmax; + + double aZmin; + + double aZmax; std::string anError; if (!GetBoundingBox(aShape, aXmin, aXmax, aYmin, aYmax, aZmin, aZmax, anError)) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_Chamfer.cpp b/src/FeaturesPlugin/FeaturesPlugin_Chamfer.cpp index d6e9530c5..b7f9abf5a 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Chamfer.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Chamfer.cpp @@ -107,7 +107,13 @@ FeaturesPlugin_Chamfer::performOperation(const GeomShapePtr &theSolid, bool isDistDist = aCreationMethod->value() == CREATION_METHOD_DISTANCE_DISTANCE(); - double aD1 = 0.0, aD2 = 0.0, aD = 0.0, anAngle = 0.0; + double aD1 = 0.0; + + double aD2 = 0.0; + + double aD = 0.0; + + double anAngle = 0.0; if (isDistDist) { aD1 = real(FeaturesPlugin_Chamfer::D1_ID())->value(); aD2 = real(FeaturesPlugin_Chamfer::D2_ID())->value(); diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index a1190a336..c9e47aa74 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -234,7 +234,11 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean( const ListOfShape &theTools, ListOfShape &theObjects, ListOfMakeShape &theMakeShapes) { // Getting objects. - ListOfShape anObjects, anEdgesAndFaces, aCompSolids; + ListOfShape anObjects; + + ListOfShape anEdgesAndFaces; + + ListOfShape aCompSolids; std::map aCompSolidsObjects; bool aCompoundsOnly = true; // if there are only compounds, do not use filler // restoring compsolids diff --git a/src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp b/src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp index 678e1afb3..c01ed7bd3 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp @@ -71,7 +71,9 @@ void FeaturesPlugin_Defeaturing::execute() { std::string anError; std::vector aResultBaseAlgoList; - ListOfShape anOriginalShapesList, aResultShapesList; + ListOfShape anOriginalShapesList; + + ListOfShape aResultShapesList; for (auto &anIt : aBodiesAndFacesToRemove) { GeomShapePtr aParent = anIt.first; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index 9d6c13de0..18a6f1195 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -68,7 +68,9 @@ void FeaturesPlugin_Extrusion::initAttributes() { //================================================================================================= void FeaturesPlugin_Extrusion::execute() { - ListOfShape aBaseShapesList, aBoundaryShapes; + ListOfShape aBaseShapesList; + + ListOfShape aBoundaryShapes; ListOfMakeShape aMakeShapesList; // Make extrusions. diff --git a/src/FeaturesPlugin/FeaturesPlugin_Fillet.cpp b/src/FeaturesPlugin/FeaturesPlugin_Fillet.cpp index d9605cbad..e1bd32ca8 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Fillet.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Fillet.cpp @@ -75,7 +75,9 @@ FeaturesPlugin_Fillet::performOperation(const GeomShapePtr &theSolid, bool isFixedRadius = aCreationMethod->value() == CREATION_METHOD_SINGLE_RADIUS(); - double aRadius1 = 0.0, aRadius2 = 0.0; + double aRadius1 = 0.0; + + double aRadius2 = 0.0; if (isFixedRadius) aRadius1 = real(RADIUS_ID())->value(); else { diff --git a/src/FeaturesPlugin/FeaturesPlugin_GlueFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_GlueFaces.cpp index 5bef25f8b..17ccc8ce0 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_GlueFaces.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_GlueFaces.cpp @@ -137,7 +137,9 @@ bool FeaturesPlugin_GlueFaces::isGlued(const ListOfShape &theInputs, // Consider the list of input shapes the same as the result, if // * the total number of faces did NOT change. - int nbInputFaces = 0, nbInputEdges = 0; + int nbInputFaces = 0; + + int nbInputEdges = 0; for (auto aShape : theInputs) { if (aShape.get()) { nbInputFaces += aShape->subShapes(GeomAPI_Shape::FACE, true).size(); @@ -145,7 +147,9 @@ bool FeaturesPlugin_GlueFaces::isGlued(const ListOfShape &theInputs, } } - int nbResultFaces = 0, nbResultEdges = 0; + int nbResultFaces = 0; + + int nbResultEdges = 0; nbResultFaces = theResult->subShapes(GeomAPI_Shape::FACE, true).size(); nbResultEdges = theResult->subShapes(GeomAPI_Shape::EDGE, true).size(); return (0 < nbResultFaces && diff --git a/src/FeaturesPlugin/FeaturesPlugin_InspectBoundingBox.cpp b/src/FeaturesPlugin/FeaturesPlugin_InspectBoundingBox.cpp index d9abcf170..fbf0564cf 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_InspectBoundingBox.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_InspectBoundingBox.cpp @@ -136,7 +136,17 @@ bool FeaturesPlugin_InspectBoundingBox::updateValues() { } if (aShape && !aShape->isEqual(myShape)) { - double aXmin, aXmax, aYmin, aYmax, aZmin, aZmax; + double aXmin; + + double aXmax; + + double aYmin; + + double aYmax; + + double aZmin; + + double aZmax; std::string anError; if (!GetBoundingBox(aShape, aXmin, aXmax, aYmin, aYmax, aZmin, aZmax, anError)) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_Loft.cpp b/src/FeaturesPlugin/FeaturesPlugin_Loft.cpp index 4b26d3a13..29895d7b3 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Loft.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Loft.cpp @@ -50,7 +50,9 @@ void FeaturesPlugin_Loft::execute() { if (aFirstSelection->isInitialized() && aSecondelection->isInitialized()) { - GeomShapePtr aFirstShape, aSecondShape; + GeomShapePtr aFirstShape; + + GeomShapePtr aSecondShape; if (aFirstSelection && aSecondelection) { aFirstShape = aFirstSelection->value(); diff --git a/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp b/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp index 5a4c7bc84..621119937 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp @@ -97,9 +97,15 @@ void FeaturesPlugin_MultiTranslation::execute() { anObjectsSelList, isKeepSubShapes, anObjects, aParts, aTextureSource)) return; - std::shared_ptr aFirstDir, aSecondDir; - double aFirstStep, aSecondStep; - int aFirstNbCopies, aSecondNbCopies; + std::shared_ptr aFirstDir; + + std::shared_ptr aSecondDir; + double aFirstStep; + + double aSecondStep; + int aFirstNbCopies; + + int aSecondNbCopies; if (!paramsAlongDirection(0, aFirstDir, aFirstStep, aFirstNbCopies)) return; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp index 8d9dff517..a1b822d65 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp @@ -98,7 +98,9 @@ void FeaturesPlugin_Partition::execute() { resizePlanes(anObjects.objects(), aPlanes, aMakeShapeList); // cut unused solids of composolids from the objects of partition - ListOfShape aTargetObjects, anUnusedSubs; + ListOfShape aTargetObjects; + + ListOfShape anUnusedSubs; std::string aError; if (!cutSubs(anObjects, aTargetObjects, anUnusedSubs, aFuzzy, aMakeShapeList, aError)) { @@ -264,7 +266,9 @@ bool FeaturesPlugin_Partition::cutSubs( // compose a set of tools for the CUT operation: // find the list of unused subs of the first argument or use itself - ListOfShape aToolsForUsed, aToolsForUnused; + ListOfShape aToolsForUsed; + + ListOfShape aToolsForUnused; GeomShapePtr aFirstArgument = theHierarchy.parent(*anIt, false); if (aFirstArgument && aFirstArgument->shapeType() == GeomAPI_Shape::COMPSOLID) { @@ -279,7 +283,9 @@ bool FeaturesPlugin_Partition::cutSubs( // cut subs bool isOk = true; for (++anIt; anIt != theHierarchy.end() && isOk; ++anIt) { - ListOfShape aUsed, aNotUsed; + ListOfShape aUsed; + + ListOfShape aNotUsed; GeomShapePtr aParent = theHierarchy.parent(*anIt, false); if (aParent && aParent->shapeType() == GeomAPI_Shape::COMPSOLID) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp index c4ed63002..41383ac0b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp @@ -68,7 +68,9 @@ void FeaturesPlugin_Pipe::execute() { std::string aCreationMethod = string(CREATION_METHOD())->value(); // Getting base objects. - ListOfShape aBaseShapesList, aBaseFacesList; + ListOfShape aBaseShapesList; + + ListOfShape aBaseFacesList; std::map aSketchWiresMap; AttributeSelectionListPtr aBaseObjectsSelectionList = selectionList(BASE_OBJECTS_ID()); @@ -290,9 +292,13 @@ void FeaturesPlugin_Pipe::storeResult( } case GeomAPI_Shape::EDGE: case GeomAPI_Shape::WIRE: { - std::shared_ptr aV1, aV2; + std::shared_ptr aV1; + + std::shared_ptr aV2; GeomAlgoAPI_ShapeTools::findBounds(theBaseShape, aV1, aV2); - ListOfShape aV1History, aV2History; + ListOfShape aV1History; + + ListOfShape aV2History; thePipeAlgo->generated(aV1, aV1History); thePipeAlgo->generated(aV2, aV2History); if (!aV1History.empty()) { @@ -361,9 +367,13 @@ void FeaturesPlugin_Pipe::storeResult( } case GeomAPI_Shape::EDGE: case GeomAPI_Shape::WIRE: { - std::shared_ptr aV1, aV2; + std::shared_ptr aV1; + + std::shared_ptr aV2; GeomAlgoAPI_ShapeTools::findBounds(aBaseShape, aV1, aV2); - ListOfShape aV1History, aV2History; + ListOfShape aV1History; + + ListOfShape aV2History; thePipeAlgo->generated(aV1, aV1History); thePipeAlgo->generated(aV2, aV2History); if (!aV1History.empty()) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Sewing.cpp b/src/FeaturesPlugin/FeaturesPlugin_Sewing.cpp index d413049da..e674a38e4 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Sewing.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Sewing.cpp @@ -105,7 +105,9 @@ bool FeaturesPlugin_Sewing::isSewn(const ListOfShape &theInputs, // Consider the list of input shapes the same as the result, if // * both arguments have the same number of shells // * the total number of faces in these shells did NOT change. - int nbInputShells = 0, nbInputFaces = 0; + int nbInputShells = 0; + + int nbInputFaces = 0; for (auto aShape : theInputs) { if (aShape.get()) { if (aShape->isShell()) @@ -114,7 +116,9 @@ bool FeaturesPlugin_Sewing::isSewn(const ListOfShape &theInputs, } } - int nbResultShells = 0, nbResultFaces = 0; + int nbResultShells = 0; + + int nbResultFaces = 0; if (theResult->isCompound()) { ListOfShape shells = theResult->subShapes(GeomAPI_Shape::SHELL, true); nbResultShells = shells.size(); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index 39781e87d..b4f9a8671 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -835,7 +835,9 @@ bool FeaturesPlugin_ValidatorExtrusionBoundaryFace::isValid( aDir = anEdge->line()->direction(); // from/to shapes - GeomShapePtr aFromShape, aToShape; + GeomShapePtr aFromShape; + + GeomShapePtr aToShape; aSelection = aFeature->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID()); if (aSelection.get()) { aToShape = aSelection->value(); @@ -1511,7 +1513,9 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid( int anObjectsToolsNb[2] = {0, 0}; - auto anIt = theArguments.begin(), aLast = theArguments.end(); + auto anIt = theArguments.begin(); + + auto aLast = theArguments.end(); bool isAllInSameCompSolid = true; ResultBodyPtr aCompSolid; @@ -1878,7 +1882,9 @@ bool FeaturesPlugin_ValidatorBooleanFuseArguments::isValid( std::shared_ptr aFeature = std::dynamic_pointer_cast(theFeature); - int anObjectsNb = 0, aToolsNb = 0; + int anObjectsNb = 0; + + int aToolsNb = 0; auto anIt = theArguments.begin(); @@ -2027,7 +2033,9 @@ bool FeaturesPlugin_ValidatorBooleanCommonArguments::isValid( std::shared_ptr aFeature = std::dynamic_pointer_cast(theFeature); - int anObjectsNb = 0, aToolsNb = 0; + int anObjectsNb = 0; + + int aToolsNb = 0; auto anIt = theArguments.begin(); diff --git a/src/GeomAPI/GeomAPI_AISObject.cpp b/src/GeomAPI/GeomAPI_AISObject.cpp index c8da86d68..0641f46b5 100644 --- a/src/GeomAPI/GeomAPI_AISObject.cpp +++ b/src/GeomAPI/GeomAPI_AISObject.cpp @@ -313,7 +313,17 @@ void GeomAPI_AISObject::createFixed(std::shared_ptr theShape, if (!aFixPrs.IsNull()) { Bnd_Box aBox; BRepBndLib::Add(aShape, aBox); - double aXmin, aXmax, aYmin, aYmax, aZmin, aZmax; + double aXmin; + + double aXmax; + + double aYmin; + + double aYmax; + + double aZmin; + + double aZmax; aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); gp_Pnt aXYZ1(aXmin, aXmax, aYmin); gp_Pnt aXYZ2(aXmax, aYmax, aZmax); @@ -405,7 +415,9 @@ bool GeomAPI_AISObject::setDeflection(const double theDeflection) { if (!anAIS.IsNull()) { Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast(anAIS); if (!anAISShape.IsNull()) { - Standard_Real aCoefficient, aPreviousCoefficient; + Standard_Real aCoefficient; + + Standard_Real aPreviousCoefficient; anAISShape->OwnDeviationCoefficient(aCoefficient, aPreviousCoefficient); if (fabs(aCoefficient - theDeflection) > Precision::Confusion()) { isModified = true; diff --git a/src/GeomAPI/GeomAPI_Angle.cpp b/src/GeomAPI/GeomAPI_Angle.cpp index 7e298ea0a..45bd825ba 100644 --- a/src/GeomAPI/GeomAPI_Angle.cpp +++ b/src/GeomAPI/GeomAPI_Angle.cpp @@ -47,9 +47,13 @@ GeomAPI_Angle::GeomAPI_Angle(const std::shared_ptr &theEdge1, const auto &anEdge1 = theEdge1->impl(); const auto &anEdge2 = theEdge2->impl(); - double aF1, aL1; + double aF1; + + double aL1; Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(anEdge1, aF1, aL1); - double aF2, aL2; + double aF2; + + double aL2; Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(anEdge2, aF2, aL2); auto *anAngle = new AngleDirections; diff --git a/src/GeomAPI/GeomAPI_Angle2d.cpp b/src/GeomAPI/GeomAPI_Angle2d.cpp index 1bfd378f3..714601944 100644 --- a/src/GeomAPI/GeomAPI_Angle2d.cpp +++ b/src/GeomAPI/GeomAPI_Angle2d.cpp @@ -62,7 +62,9 @@ static ThreePoints2d *newAngle(const std::shared_ptr &theStart1, bool isParallel = !aCenter; if (isParallel) aCenter = theStart1; - std::shared_ptr aPoint1, aPoint2; + std::shared_ptr aPoint1; + + std::shared_ptr aPoint2; if (isParallel) aPoint1 = aPoint2 = theEnd1; else { diff --git a/src/GeomAPI/GeomAPI_Circ.cpp b/src/GeomAPI/GeomAPI_Circ.cpp index 56258c67f..069947f9a 100644 --- a/src/GeomAPI/GeomAPI_Circ.cpp +++ b/src/GeomAPI/GeomAPI_Circ.cpp @@ -86,7 +86,9 @@ GeomAPI_Circ::project(const std::shared_ptr &thePoint) const { GeomAPI_ProjectPointOnCurve aProj(aPoint, aCircle); Standard_Integer aNbPoint = aProj.NbPoints(); if (aNbPoint > 0) { - double aMinDistance = Precision::Infinite(), aDistance; + double aMinDistance = Precision::Infinite(); + + double aDistance; for (Standard_Integer j = 1; j <= aNbPoint; j++) { gp_Pnt aNewPoint = aProj.Point(j); aDistance = aNewPoint.Distance(aPoint); diff --git a/src/GeomAPI/GeomAPI_Edge.cpp b/src/GeomAPI/GeomAPI_Edge.cpp index c2257e116..e64569cc8 100644 --- a/src/GeomAPI/GeomAPI_Edge.cpp +++ b/src/GeomAPI/GeomAPI_Edge.cpp @@ -74,7 +74,9 @@ void GeomAPI_Edge::vertices( std::shared_ptr &theStartVertex, std::shared_ptr &theEndVertex) const { const auto &anEdge = impl(); - TopoDS_Vertex aStart, aEnd; + TopoDS_Vertex aStart; + + TopoDS_Vertex aEnd; TopExp::Vertices(anEdge, aStart, aEnd); theStartVertex.reset(new GeomAPI_Vertex); theStartVertex->setImpl(new TopoDS_Vertex(aStart)); @@ -83,7 +85,9 @@ void GeomAPI_Edge::vertices( } static Handle(Geom_Curve) baseCurve(const TopoDS_Edge &theEdge) { - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast); while (aCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) { Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(aCurve); @@ -113,7 +117,9 @@ bool GeomAPI_Edge::isSameGeometry( bool GeomAPI_Edge::isLine() const { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (aCurve.IsNull()) // degenerative edge @@ -143,7 +149,9 @@ static Handle(Geom_Circle) circ(const Handle(Geom_Curve) theCurve) { bool GeomAPI_Edge::isCircle() const { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (!circ(aCurve).IsNull()) { @@ -157,7 +165,9 @@ bool GeomAPI_Edge::isCircle() const { bool GeomAPI_Edge::isArc() const { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (!circ(aCurve).IsNull()) { @@ -171,7 +181,9 @@ bool GeomAPI_Edge::isArc() const { bool GeomAPI_Edge::isEllipse() const { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (aCurve.IsNull()) // degenerative edge @@ -183,7 +195,9 @@ bool GeomAPI_Edge::isEllipse() const { bool GeomAPI_Edge::isBSpline() const { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (aCurve.IsNull()) // degenerative edge @@ -195,7 +209,9 @@ bool GeomAPI_Edge::isBSpline() const { std::shared_ptr GeomAPI_Edge::firstPoint() { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); gp_Pnt aPoint; @@ -206,7 +222,9 @@ std::shared_ptr GeomAPI_Edge::firstPoint() { std::shared_ptr GeomAPI_Edge::lastPoint() { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); gp_Pnt aPoint; @@ -217,7 +235,9 @@ std::shared_ptr GeomAPI_Edge::lastPoint() { std::shared_ptr GeomAPI_Edge::circle() const { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); Handle(Geom_Circle) aCirc = circ(aCurve); @@ -236,7 +256,9 @@ std::shared_ptr GeomAPI_Edge::circle() const { std::shared_ptr GeomAPI_Edge::ellipse() const { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (!aCurve.IsNull()) { @@ -255,7 +277,9 @@ std::shared_ptr GeomAPI_Edge::ellipse() const { std::shared_ptr GeomAPI_Edge::line() const { const auto &aShape = const_cast(this)->impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (aCurve) { @@ -285,10 +309,14 @@ bool GeomAPI_Edge::isEqual(const std::shared_ptr theEdge) const { if (aMyShape.ShapeType() != aInShape.ShapeType()) return false; - double aMyStart, aMyEnd; + double aMyStart; + + double aMyEnd; Handle(Geom_Curve) aMyCurve = BRep_Tool::Curve(TopoDS::Edge(aMyShape), aMyStart, aMyEnd); - double aInStart, aInEnd; + double aInStart; + + double aInEnd; Handle(Geom_Curve) aInCurve = BRep_Tool::Curve(TopoDS::Edge(aInShape), aInStart, aInEnd); @@ -317,7 +345,9 @@ bool GeomAPI_Edge::isEqual(const std::shared_ptr theEdge) const { void GeomAPI_Edge::setRange(const double &theFirst, const double &theLast) { TopoDS_Edge anEdge = impl(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); double aTolerance = BRep_Tool::Tolerance(anEdge); if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) { @@ -335,14 +365,22 @@ void GeomAPI_Edge::getRange(double &theFirst, double &theLast) const { // LCOV_EXCL_START bool GeomAPI_Edge::isInPlane(std::shared_ptr thePlane) const { - double aFirst, aLast; + double aFirst; + + double aLast; const auto &aShape = const_cast(this)->impl(); Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (aCurve.IsNull()) return false; - double A, B, C, D; + double A; + + double B; + + double C; + + double D; thePlane->coefficients(A, B, C, D); gp_Pln aPlane(A, B, C, D); @@ -379,12 +417,20 @@ bool GeomAPI_Edge::isInPlane(std::shared_ptr thePlane) const { void GeomAPI_Edge::intersectWithPlane( const std::shared_ptr thePlane, std::list> &theResult) const { - double aFirst, aLast; + double aFirst; + + double aLast; const auto &aShape = const_cast(this)->impl(); Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (!aCurve.IsNull()) { - double A, B, C, D; + double A; + + double B; + + double C; + + double D; thePlane->coefficients(A, B, C, D); gp_Pln aPln(A, B, C, D); Handle(Geom_Plane) aPlane = new Geom_Plane(aPln); @@ -416,7 +462,9 @@ void GeomAPI_Edge::intersectWithPlane( if (anExtrema.NbExtrema() > 0 && !anExtrema.Extrema().IsParallel() && anExtrema.LowerDistance() < aTolerance) { // distance is lower than tolerance => tangent case - gp_Pnt aPntC, aPntS; + gp_Pnt aPntC; + + gp_Pnt aPntS; anExtrema.NearestPoints(aPntC, aPntS); std::shared_ptr aPntPtr( new GeomAPI_Pnt(aPntS.X(), aPntS.Y(), aPntS.Z())); @@ -437,7 +485,9 @@ bool GeomAPI_Edge::isClosed() const { const auto &aShape = const_cast(this)->impl(); if (aShape.IsNull()) return false; - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge &)aShape, aFirst, aLast); if (aCurve.IsNull() || !aCurve->IsPeriodic()) @@ -457,28 +507,36 @@ bool GeomAPI_Edge::isDegenerated() const { void GeomAPI_Edge::setFirstPointTolerance(const double theTolerance) { TopoDS_Edge anEdge = impl(); - TopoDS_Vertex aVFirst, aVLast; + TopoDS_Vertex aVFirst; + + TopoDS_Vertex aVLast; TopExp::Vertices(anEdge, aVFirst, aVLast); BRep_Builder().UpdateVertex(aVFirst, theTolerance); } void GeomAPI_Edge::setLastPointTolerance(const double theTolerance) { TopoDS_Edge anEdge = impl(); - TopoDS_Vertex aVFirst, aVLast; + TopoDS_Vertex aVFirst; + + TopoDS_Vertex aVLast; TopExp::Vertices(anEdge, aVFirst, aVLast); BRep_Builder().UpdateVertex(aVLast, theTolerance); } double GeomAPI_Edge::firstPointTolerance() const { TopoDS_Edge anEdge = impl(); - TopoDS_Vertex aVFirst, aVLast; + TopoDS_Vertex aVFirst; + + TopoDS_Vertex aVLast; TopExp::Vertices(anEdge, aVFirst, aVLast); return BRep_Tool::Tolerance(aVFirst); } double GeomAPI_Edge::lastPointTolerance() const { TopoDS_Edge anEdge = impl(); - TopoDS_Vertex aVFirst, aVLast; + TopoDS_Vertex aVFirst; + + TopoDS_Vertex aVLast; TopExp::Vertices(anEdge, aVFirst, aVLast); return BRep_Tool::Tolerance(aVLast); } @@ -489,7 +547,9 @@ GeomPointPtr GeomAPI_Edge::middlePoint() const { const auto &anEdge = impl(); if (anEdge.IsNull()) return aMiddlePoint; - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); if (aCurve.IsNull()) return aMiddlePoint; diff --git a/src/GeomAPI/GeomAPI_Ellipse2d.cpp b/src/GeomAPI/GeomAPI_Ellipse2d.cpp index 29c8a89e9..c1634b2d5 100644 --- a/src/GeomAPI/GeomAPI_Ellipse2d.cpp +++ b/src/GeomAPI/GeomAPI_Ellipse2d.cpp @@ -151,7 +151,9 @@ static double extrema(IntAna2d_AnaIntersection *theIntersectionAlgo, thePoint1 = GeomPnt2dPtr(new GeomAPI_Pnt2d(anInterPnt.X(), anInterPnt.Y())); thePoint2 = GeomPnt2dPtr(new GeomAPI_Pnt2d(anInterPnt.X(), anInterPnt.Y())); } else if (theExtremaAlgo->IsDone() && theExtremaAlgo->NbExt() > 0) { - Extrema_POnCurv2d aP1, aP2; + Extrema_POnCurv2d aP1; + + Extrema_POnCurv2d aP2; for (int i = 1; i <= theExtremaAlgo->NbExt(); ++i) { double aSqDist = theExtremaAlgo->SquareDistance(i); if (aSqDist < aDistance) { diff --git a/src/GeomAPI/GeomAPI_Face.cpp b/src/GeomAPI/GeomAPI_Face.cpp index 2d183a321..3a4c803ae 100644 --- a/src/GeomAPI/GeomAPI_Face.cpp +++ b/src/GeomAPI/GeomAPI_Face.cpp @@ -101,9 +101,21 @@ bool GeomAPI_Face::isEqual(std::shared_ptr theFace) const { return false; // Get parameters of surfaces - double aMyUMin, aMyUMax, aMyVMin, aMyVMax; + double aMyUMin; + + double aMyUMax; + + double aMyVMin; + + double aMyVMax; aMySurf->Bounds(aMyUMin, aMyUMax, aMyVMin, aMyVMax); - double aInUMin, aInUMax, aInVMin, aInVMax; + double aInUMin; + + double aInUMax; + + double aInVMin; + + double aInVMax; aInSurf->Bounds(aInUMin, aInUMax, aInVMin, aInVMax); // Check that parameters are the same @@ -262,7 +274,13 @@ std::shared_ptr GeomAPI_Face::getPlane() const { } if (isPlanar) { - double aA, aB, aC, aD; + double aA; + + double aB; + + double aC; + + double aD; aPln.Coefficients(aA, aB, aC, aD); if (aFace.Orientation() == TopAbs_REVERSED) { aA = -aA; @@ -304,7 +322,13 @@ std::shared_ptr GeomAPI_Face::getCylinder() const { const gp_Dir &aDir = aCyl.Position().Direction(); double aRadius = aCyl.Radius(); - double aUMin, aUMax, aVMin, aVMax; + double aUMin; + + double aUMax; + + double aVMin; + + double aVMax; BRepTools::UVBounds(aFace, aUMin, aUMax, aVMin, aVMax); double aHeight = aVMax - aVMin; @@ -327,7 +351,13 @@ std::shared_ptr GeomAPI_Face::getCone() const { gp_Pnt aLoc = aCon.Location(); gp_Dir aDir = aCon.Position().Direction(); - double aUMin, aUMax, aVMin, aVMax; + double aUMin; + + double aUMax; + + double aVMin; + + double aVMax; BRepTools::UVBounds(aFace, aUMin, aUMax, aVMin, aVMax); double aSemiAngle = Abs(aCon.SemiAngle()); @@ -371,7 +401,13 @@ GeomPointPtr GeomAPI_Face::middlePoint() const { if (aFace.IsNull()) return anInnerPoint; - double aUMin, aUMax, aVMin, aVMax; + double aUMin; + + double aUMax; + + double aVMin; + + double aVMax; optimalBounds(aFace, aUMin, aUMax, aVMin, aVMax); Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace); @@ -387,15 +423,31 @@ GeomPointPtr GeomAPI_Face::middlePoint() const { void optimalBounds(const TopoDS_Face &theFace, const TopoDS_Edge &theEdge, Bnd_Box2d &theBndBox) { - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; const Handle(Geom2d_Curve) aC2D = BRep_Tool::CurveOnSurface(theEdge, theFace, aFirst, aLast); if (aC2D.IsNull()) return; - Standard_Real aXmin = 0.0, aYmin = 0.0, aXmax = 0.0, aYmax = 0.0; - Standard_Real aUmin, aUmax, aVmin, aVmax; - Bnd_Box2d aBoxC, aBoxS; + Standard_Real aXmin = 0.0; + + Standard_Real aYmin = 0.0; + + Standard_Real aXmax = 0.0; + + Standard_Real aYmax = 0.0; + Standard_Real aUmin; + + Standard_Real aUmax; + + Standard_Real aVmin; + + Standard_Real aVmax; + Bnd_Box2d aBoxC; + + Bnd_Box2d aBoxS; BndLib_Add2dCurve::AddOptimal(aC2D, aFirst, aLast, 0., aBoxC); if (aBoxC.IsVoid()) return; @@ -425,7 +477,9 @@ void optimalBounds(const TopoDS_Face &theFace, const TopoDS_Edge &theEdge, (aXmin < aUmin || aXmax > aUmax)) { Standard_Real aTol2 = 100 * Precision::SquareConfusion(); isUPeriodic = Standard_True; - gp_Pnt P1, P2; + gp_Pnt P1; + + gp_Pnt P2; // 1. Verify that the surface is U-closed if (!aS->IsUClosed()) { Standard_Real aVStep = aVmax - aVmin; @@ -496,7 +550,9 @@ void optimalBounds(const TopoDS_Face &theFace, const TopoDS_Edge &theEdge, (aYmin < aVmin || aYmax > aVmax)) { Standard_Real aTol2 = 100 * Precision::SquareConfusion(); isVPeriodic = Standard_True; - gp_Pnt P1, P2; + gp_Pnt P1; + + gp_Pnt P2; // 1. Verify that the surface is V-closed if (!aS->IsVClosed()) { Standard_Real aUStep = aUmax - aUmin; diff --git a/src/GeomAPI/GeomAPI_Pnt.cpp b/src/GeomAPI/GeomAPI_Pnt.cpp index ef7cb5de4..4e07aa33e 100644 --- a/src/GeomAPI/GeomAPI_Pnt.cpp +++ b/src/GeomAPI/GeomAPI_Pnt.cpp @@ -103,7 +103,13 @@ void GeomAPI_Pnt::translate(const std::shared_ptr &theDir, std::shared_ptr GeomAPI_Pnt::to2D(const std::shared_ptr &thePln) const { - double aA, aB, aC, aD; + double aA; + + double aB; + + double aC; + + double aD; thePln->coefficients(aA, aB, aC, aD); gp_Pln aPln(aA, aB, aC, aD); diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index a6b9e6e96..2139b2372 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -318,7 +318,9 @@ bool GeomAPI_Shape::isPlanar() const { if (theShape.ShapeType() != TopAbs_EDGE) return false; - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(theShape), aFirst, aLast); Handle(Standard_Type) aType = aCurve->DynamicType(); @@ -689,7 +691,17 @@ GeomPointPtr GeomAPI_Shape::middlePoint() const { break; default: { // get middle point as center of the bounding box - double aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ; + double aMinX; + + double aMinY; + + double aMinZ; + + double aMaxX; + + double aMaxY; + + double aMaxZ; computeSize(aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ); aMiddlePoint = GeomPointPtr(new GeomAPI_Pnt( (aMinX + aMaxX) * 0.5, (aMinY + aMaxY) * 0.5, (aMinZ + aMaxZ) * 0.5)); diff --git a/src/GeomAPI/GeomAPI_ShapeHierarchy.cpp b/src/GeomAPI/GeomAPI_ShapeHierarchy.cpp index 8368260b1..c927ab4ae 100644 --- a/src/GeomAPI/GeomAPI_ShapeHierarchy.cpp +++ b/src/GeomAPI/GeomAPI_ShapeHierarchy.cpp @@ -156,7 +156,9 @@ void GeomAPI_ShapeHierarchy::topLevelObjects( SetOfShape aProcessed = myProcessedObjects; aThis->myProcessedObjects.clear(); - iterator anIt = aThis->begin(), aEnd = aThis->end(); + iterator anIt = aThis->begin(); + + iterator aEnd = aThis->end(); for (; anIt != aEnd; ++anIt) { GeomShapePtr aShape = *anIt; GeomShapePtr aRoot = aThis->root(aShape); diff --git a/src/GeomAPI/GeomAPI_Shell.cpp b/src/GeomAPI/GeomAPI_Shell.cpp index e4a07f425..259d032e9 100644 --- a/src/GeomAPI/GeomAPI_Shell.cpp +++ b/src/GeomAPI/GeomAPI_Shell.cpp @@ -176,8 +176,12 @@ std::shared_ptr GeomAPI_Shell::getCone() const { GeomPointPtr anApex; GeomDirPtr anAxis; - double aSemiAngle = 0.0, aTanSemiAngle = 0.0; - double aHeight1 = 0.0, aHeight2 = 0.0; + double aSemiAngle = 0.0; + + double aTanSemiAngle = 0.0; + double aHeight1 = 0.0; + + double aHeight2 = 0.0; for (TopExp_Explorer anExp(impl(), TopAbs_FACE); anExp.More(); anExp.Next()) { diff --git a/src/GeomAPI/GeomAPI_Wire.cpp b/src/GeomAPI/GeomAPI_Wire.cpp index 5a05607aa..fb67ce8a4 100644 --- a/src/GeomAPI/GeomAPI_Wire.cpp +++ b/src/GeomAPI/GeomAPI_Wire.cpp @@ -61,7 +61,9 @@ bool GeomAPI_Wire::isPolygon(std::list &thePoints) const { for (BRepTools_WireExplorer anExp(aWire); anExp.More() && isPolygon; anExp.Next()) { const TopoDS_Edge &anEdge = anExp.Current(); - double aT1, aT2; + double aT1; + + double aT2; Handle(Geom_Curve) aC3D = BRep_Tool::Curve(anEdge, aT1, aT2); if (!aC3D.IsNull() && aC3D->IsKind(aLineType)) { gp_Pnt aCorner = BRep_Tool::Pnt(anExp.CurrentVertex()); @@ -89,7 +91,9 @@ bool GeomAPI_Wire::isRectangle(std::list &thePoints) const { for (BRepTools_WireExplorer anExp(aWire); anExp.More(); anExp.Next()) { const TopoDS_Edge &anEdge = anExp.Current(); - double aT1, aT2; + double aT1; + + double aT2; Handle(Geom_Curve) aC3D = BRep_Tool::Curve(anEdge, aT1, aT2); if (aC3D.IsNull()) continue; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp index ade7cd350..052941827 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp @@ -33,7 +33,9 @@ GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean( const GeomShapePtr theObject, const GeomShapePtr theTool, const GeomAlgoAPI_Tools::BOPType theOperationType, const double theFuzzy /*= -1*/) { - ListOfShape aListWithObject, aListWithTool; + ListOfShape aListWithObject; + + ListOfShape aListWithTool; aListWithObject.push_back(theObject); aListWithTool.push_back(theTool); build(aListWithObject, aListWithTool, theOperationType, theFuzzy); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_BoundingBox.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_BoundingBox.cpp index a64572184..73324e02f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_BoundingBox.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_BoundingBox.cpp @@ -102,7 +102,13 @@ Standard_Boolean ModifyShape(const TopoDS_Shape &theShape, } // non solid case or any periodic surface (Mantis 22454). - double U1, U2, V1, V2; + double U1; + + double U2; + + double V1; + + double V2; // changes for 0020677: EDF 1219 GEOM: MinDistance gives 0 instead // of 20.88 // S->Bounds(U1,U2,V1,V2); changed by @@ -169,7 +175,13 @@ double GetMinDistanceSingular(const TopoDS_Shape &aSh1, BRepExtrema_DistShapeShape dst(tmpSh1, tmpSh2); if (dst.IsDone()) { double MinDist = 1.e9; - gp_Pnt PMin1, PMin2, P1, P2; + gp_Pnt PMin1; + + gp_Pnt PMin2; + + gp_Pnt P1; + + gp_Pnt P2; for (int i = 1; i <= dst.NbSolution(); i++) { P1 = dst.PointOnShape1(i); P2 = dst.PointOnShape2(i); @@ -227,8 +239,9 @@ Standard_Real GetMinDistance(const TopoDS_Shape &theShape1, // Make GetMinDistance() return zero if a sole VERTEX is inside any of SOLIDs // which of shapes consists of only one vertex? - TopExp_Explorer exp1(theShape1, TopAbs_VERTEX), - exp2(theShape2, TopAbs_VERTEX); + TopExp_Explorer exp1(theShape1, TopAbs_VERTEX); + + TopExp_Explorer exp2(theShape2, TopAbs_VERTEX); TopoDS_Shape V1 = exp1.More() ? exp1.Current() : TopoDS_Shape(); TopoDS_Shape V2 = exp2.More() ? exp2.Current() : TopoDS_Shape(); exp1.Next(); @@ -257,7 +270,9 @@ Standard_Real GetMinDistance(const TopoDS_Shape &theShape1, BRepExtrema_DistShapeShape dst(theShape1, theShape2); if (dst.IsDone()) { - gp_Pnt P1, P2; + gp_Pnt P1; + + gp_Pnt P2; for (int i = 1; i <= dst.NbSolution(); i++) { P1 = dst.PointOnShape1(i); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp index 252deca2b..313d9869e 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp @@ -70,7 +70,9 @@ public: const TopoDS_Edge &anEdge = TopoDS::Edge((*anEdgeIt)->impl()); - double aFirst, aLast; + double aFirst; + + double aLast; TopLoc_Location aLoc; Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(anEdge, myPlane, aLoc, aFirst, aLast); @@ -91,7 +93,9 @@ public: const TopoDS_Edge &anEdge = TopoDS::Edge(theLine->impl()); - double aFirst, aLast; + double aFirst; + + double aLast; TopLoc_Location aLoc; Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(anEdge, myPlane, aLoc, aFirst, aLast); @@ -196,7 +200,9 @@ private: int anAppropriateSolution = 1; double aMinDist = Precision::Infinite(); - double aParSol, aPonTgCurve; + double aParSol; + + double aPonTgCurve; gp_Pnt2d aTgPnt; for (int i = 1; i <= aNbSol && aNbSol > 1 && aCurve; ++i) { theBuilder->Tangency1(i, aParSol, aPonTgCurve, aTgPnt); @@ -333,7 +339,9 @@ private: int anAppropriateSolution = 1; double aMinDist = Precision::Infinite(); - double aParSol, aPonTgCurve; + double aParSol; + + double aPonTgCurve; gp_Pnt2d aTgPnt; for (int i = 1; i <= aNbSol && aNbSol > 1; ++i) { bool isApplicable = false; @@ -420,7 +428,9 @@ private: int anAppropriateSolution = 1; double aMinDist = Precision::Infinite(); - double aParSol, aPonTgCurve; + double aParSol; + + double aPonTgCurve; gp_Pnt2d aTgPnt; for (int i = 1; i <= aNbSol && aNbSol > 1; ++i) { bool isApplicable = false; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp index fe2a58728..ce953f160 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp @@ -32,9 +32,12 @@ std::shared_ptr GeomAlgoAPI_CompoundBuilder::compound( aBuilder.MakeCompound(aComp); std::list>::const_iterator anIt = theShapes - .begin(), - aLast = - theShapes.end(); + + .begin(); + + std::list>::const_iterator aLast = + + theShapes.end(); for (; anIt != aLast; anIt++) { aBuilder.Add(aComp, (*anIt)->impl()); } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp index b147c87fc..44a32a9ab 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp @@ -109,9 +109,13 @@ std::shared_ptr GeomAlgoAPI_EdgeBuilder::cylinderAxis( // box of the face (vertices projected to the axis) plus 10% Bnd_Box aFaceBnd; BRepBndLib::Add(aFace, aFaceBnd); - gp_Pnt aBoxMin(aFaceBnd.CornerMin()), aBoxMax(aFaceBnd.CornerMax()); + gp_Pnt aBoxMin(aFaceBnd.CornerMin()); + + gp_Pnt aBoxMax(aFaceBnd.CornerMax()); bool isFirst = true; - double aParamMin = 0, aParamMax = 0; + double aParamMin = 0; + + double aParamMax = 0; for (int aX = 0; aX < 2; aX++) { for (int aY = 0; aY < 2; aY++) { for (int aZ = 0; aZ < 2; aZ++) { @@ -259,7 +263,9 @@ std::shared_ptr GeomAlgoAPI_EdgeBuilder::ellipticArc( GeomPointPtr aStartPnt = anEllipse.project(theStart); GeomPointPtr aEndPnt = anEllipse.project(theEnd); - double aStartParam, aEndParam; + double aStartParam; + + double aEndParam; anEllipse.parameter(aStartPnt, Precision::Confusion(), aStartParam); anEllipse.parameter(aEndPnt, Precision::Confusion(), aEndParam); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp index 0623a1de5..694187113 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp @@ -81,7 +81,13 @@ std::shared_ptr GeomAlgoAPI_FaceBuilder::planarFace( std::shared_ptr GeomAlgoAPI_FaceBuilder::planarFace( const std::shared_ptr thePlane, const double theX, const double theY, const double theWidth, const double theHeight) { - double aA, aB, aC, aD; + double aA; + + double aB; + + double aC; + + double aD; thePlane->coefficients(aA, aB, aC, aD); gp_Pln aPlane(aA, aB, aC, aD); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp index 141986952..7c01a3583 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp @@ -41,7 +41,9 @@ static void edgesToCurves(const std::list &theEdges, if (BRep_Tool::Degenerated(anEdge)) continue; - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); aCurve = new Geom_TrimmedCurve(aCurve, aFirst, aLast); @@ -106,7 +108,17 @@ void GeomAlgoAPI_Filling::buildByEdges() { } // build calculated surface - Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots; + Standard_Integer UDegree; + + Standard_Integer VDegree; + + Standard_Integer NbUPoles; + + Standard_Integer NbVPoles; + + Standard_Integer NbUKnots; + + Standard_Integer NbVKnots; anAppSurf.SurfShape(UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots); Handle(Geom_BSplineSurface) GBS = new Geom_BSplineSurface( anAppSurf.SurfPoles(), anAppSurf.SurfWeights(), anAppSurf.SurfUKnots(), diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Loft.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Loft.cpp index 5acf0df37..1e029d204 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Loft.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Loft.cpp @@ -67,8 +67,12 @@ void GeomAlgoAPI_Loft::build(const GeomShapePtr theFirstShape, } if (aFirstShape.ShapeType() == TopAbs_EDGE) { - GeomShapePtr aFirstWire, aSecondWire; - ListOfShape aFirstEdge, aSecondEdge; + GeomShapePtr aFirstWire; + + GeomShapePtr aSecondWire; + ListOfShape aFirstEdge; + + ListOfShape aSecondEdge; // Convert first edge to wire aFirstEdge.push_back(theFirstShape); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_NExplode.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_NExplode.cpp index ac83bc31c..fb6d6e901 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_NExplode.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_NExplode.cpp @@ -121,7 +121,9 @@ bool NExplodeTools::CompareShapes::operator()(const GeomShapePtr &lhs, } else if (Abs(dLength) < tol && lhs->shapeType() <= GeomAPI_Shape::FACE) { // equal values possible on shapes such as two halves of a sphere and // a membrane inside the sphere - Bnd_Box box1, box2; + Bnd_Box box1; + + Bnd_Box box2; BRepBndLib::Add(lhs->impl(), box1); if (!box1.IsVoid()) { BRepBndLib::Add(rhs->impl(), box2); @@ -129,8 +131,21 @@ bool NExplodeTools::CompareShapes::operator()(const GeomShapePtr &lhs, if (dSquareExtent >= tol) { exchange = Standard_True; } else if (Abs(dSquareExtent) < tol) { - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, value1, - value2; + Standard_Real aXmin; + + Standard_Real aYmin; + + Standard_Real aZmin; + + Standard_Real aXmax; + + Standard_Real aYmax; + + Standard_Real aZmax; + + Standard_Real value1; + + Standard_Real value2; box1.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); value1 = (aXmin + aXmax) * 999.0 + (aYmin + aYmax) * 99.0 + (aZmin + aZmax) * 0.9; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_NonPlanarFace.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_NonPlanarFace.cpp index 08807a0f6..7a43c0a45 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_NonPlanarFace.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_NonPlanarFace.cpp @@ -114,7 +114,11 @@ void GeomAlgoAPI_NonPlanarFace::build(const ListOfShape &theEdges) { // check and fix pcurves, if necessary TopExp_Explorer aExpE; - Standard_Real aT, aTolE, aDMax; + Standard_Real aT; + + Standard_Real aTolE; + + Standard_Real aDMax; ShapeFix_ShapeTolerance sat; aExpE.Init(aNewFace, TopAbs_EDGE); for (; aExpE.More(); aExpE.Next()) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_NormalToFace.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_NormalToFace.cpp index 7c71b9883..4c9e5576d 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_NormalToFace.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_NormalToFace.cpp @@ -155,7 +155,13 @@ bool GeomAlgoAPI_NormalToFace::normal(GeomShapePtr theFace, // Point gp_Pnt p1(0, 0, 0); // Point parameters on surface - double u1, u2, v1, v2; + double u1; + + double u2; + + double v1; + + double v2; Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace); Handle(ShapeAnalysis_Surface) aSurfAna = new ShapeAnalysis_Surface(aSurf); gp_Ax3 aPos = GetPosition(aFace); @@ -176,7 +182,9 @@ bool GeomAlgoAPI_NormalToFace::normal(GeomShapePtr theFace, } // Normal direction - gp_Vec Vec1, Vec2; + gp_Vec Vec1; + + gp_Vec Vec2; BRepAdaptor_Surface SF(aFace); SF.D1(pUV.X(), pUV.Y(), p1, Vec1, Vec2); if (Vec1.Magnitude() < Precision::Confusion()) { @@ -217,7 +225,17 @@ bool GeomAlgoAPI_NormalToFace::normal(GeomShapePtr theFace, // (only if average radius of curvature is not appropriate) if (radius < Precision::Confusion()) { Bnd_Box B; - Standard_Real Xmin, Xmax, Ymin, Ymax, Zmin, Zmax; + Standard_Real Xmin; + + Standard_Real Xmax; + + Standard_Real Ymin; + + Standard_Real Ymax; + + Standard_Real Zmin; + + Standard_Real Zmax; BRepBndLib::Add(aFace, B); B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); radius = ((Xmax - Xmin) + (Ymax - Ymin) + (Zmax - Zmin)) / 3.0; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp index 3fc205307..3e6a736c2 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp @@ -94,7 +94,9 @@ void GeomAlgoAPI_Pipe::build(const GeomShapePtr theBaseShape, if (!getPath(aPathWire, thePathShape)) { return; } - GeomShapePtr anOldPath(new GeomAPI_Shape), aNewPath(new GeomAPI_Shape); + GeomShapePtr anOldPath(new GeomAPI_Shape); + + GeomShapePtr aNewPath(new GeomAPI_Shape); anOldPath->setImpl(new TopoDS_Shape(aPathWire)); aPathWire.Move(getPathToBaseTranslation(aBaseShape, aPathWire)); aNewPath->setImpl(new TopoDS_Shape(aPathWire)); @@ -178,7 +180,9 @@ void GeomAlgoAPI_Pipe::build(const GeomShapePtr theBaseShape, return; } - GeomShapePtr anOldPath(new GeomAPI_Shape), aNewPath(new GeomAPI_Shape); + GeomShapePtr anOldPath(new GeomAPI_Shape); + + GeomShapePtr aNewPath(new GeomAPI_Shape); anOldPath->setImpl(new TopoDS_Shape(aPathWire)); aPathWire.Move( getPathToBaseTranslation(theBaseShape->impl(), aPathWire)); @@ -192,7 +196,9 @@ void GeomAlgoAPI_Pipe::build(const GeomShapePtr theBaseShape, return; } TopoDS_Edge aBiNormalEdge = TopoDS::Edge(aBiNormalShape); - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom_Curve) aBiNormalCurve = BRep_Tool::Curve(aBiNormalEdge, aFirst, aLast); Handle(Geom_Line) aBiNormalLine = Handle(Geom_Line)::DownCast(aBiNormalCurve); @@ -256,7 +262,9 @@ void GeomAlgoAPI_Pipe::build(const ListOfShape &theBaseShapes, TopoDS_Shape aReallyBase = theBaseShapes.front()->impl(); gp_Trsf aTrsf = getPathToBaseTranslation(aReallyBase, aPathWire); - GeomShapePtr anOldPath(new GeomAPI_Shape), aNewPath(new GeomAPI_Shape); + GeomShapePtr anOldPath(new GeomAPI_Shape); + + GeomShapePtr aNewPath(new GeomAPI_Shape); anOldPath->setImpl(new TopoDS_Shape(aPathWire)); aPathWire.Move(aTrsf); aNewPath->setImpl(new TopoDS_Shape(aPathWire)); @@ -353,7 +361,9 @@ void GeomAlgoAPI_Pipe::build(const ListOfShape &theBaseShapes, TopoDS_Shape aResult = aPipeBuilder->Shape(); // Setting naming. - GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape); + GeomShapePtr aFromShape(new GeomAPI_Shape); + + GeomShapePtr aToShape(new GeomAPI_Shape); aFromShape->setImpl(new TopoDS_Shape(aPipeBuilder->FirstShape())); aToShape->setImpl(new TopoDS_Shape(aPipeBuilder->LastShape())); fixOrientation(aFromShape); @@ -448,7 +458,9 @@ gp_Trsf getPathToBaseTranslation(const TopoDS_Shape &theBase, if (!BRep_Tool::IsClosed(thePath)) { TopoDS_Wire aPathWire = TopoDS::Wire(thePath); if (!aPathWire.IsNull()) { - TopoDS_Vertex aV1, aV2; + TopoDS_Vertex aV1; + + TopoDS_Vertex aV2; TopExp::Vertices(aPathWire, aV1, aV2); gp_Pnt aStart = BRep_Tool::Pnt(aV1); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp index cfd698e23..17dccc378 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp @@ -94,7 +94,9 @@ std::shared_ptr GeomAlgoAPI_PointBuilder::vertexOnEdge( } const TopoDS_Edge &anEdge = TopoDS::Edge(theEdge->impl()); - Standard_Real aUFirst, aULast; + Standard_Real aUFirst; + + Standard_Real aULast; Handle(Geom_Curve) anEdgeCurve = BRep_Tool::Curve(anEdge, aUFirst, aULast); if (!anEdgeCurve.IsNull()) { @@ -133,7 +135,9 @@ std::shared_ptr GeomAlgoAPI_PointBuilder::vertexByProjection( gp_Pnt aPnt(aProjPnt->x(), aProjPnt->y(), aProjPnt->z()); TopoDS_Edge anEdge = TopoDS::Edge(theEdge->impl()); - double aFirstOnCurve, aLastOnCurve; + double aFirstOnCurve; + + double aLastOnCurve; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirstOnCurve, aLastOnCurve); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointCloudOnFace.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PointCloudOnFace.cpp index 6a001bd75..8666ae5d3 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointCloudOnFace.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointCloudOnFace.cpp @@ -107,7 +107,9 @@ void CorrectShell(const TopoDS_Shape &theShell, const TopoDS_Face &theFace) { TopExp_Explorer anExplo(aFace, TopAbs_EDGE); for (; anExplo.More(); anExplo.Next()) { const TopoDS_Edge &anEdge = TopoDS::Edge(anExplo.Current()); - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, aFace, aFirst, aLast); aBB.UpdateEdge(anEdge, aPCurve, anInputSurf, anInputLoc, 0.); @@ -123,7 +125,13 @@ gp_Pnt GetMidPnt2d(const TopoDS_Face &theFace, if (theIsNaturalRestrictions) { BRepAdaptor_Surface aBAsurf(theFace); - Standard_Real aUmin, aUmax, aVmin, aVmax; + Standard_Real aUmin; + + Standard_Real aUmax; + + Standard_Real aVmin; + + Standard_Real aVmax; aUmin = aBAsurf.FirstUParameter(); aUmax = aBAsurf.LastUParameter(); aVmin = aBAsurf.FirstVParameter(); @@ -216,7 +224,9 @@ void ModifyFacesForGlobalResult( Standard_Integer aSum = 0; while (aSum < aDiff) // global loop { - Standard_Integer aNbFacesDone = 0, aNbFacesInTape = 0; + Standard_Integer aNbFacesDone = 0; + + Standard_Integer aNbFacesInTape = 0; TopoDS_Face aStartFace; Standard_Integer aStartIndex = (theIsToAddFaces) ? aNbFaces - 1 : 0; @@ -540,7 +550,9 @@ bool GeomAlgoAPI_PointCloudOnFace::PointCloud(GeomShapePtr theFace, TopTools_IndexedDataMapOfShapeListOfShape aEFmap; TopExp::MapShapesAndAncestors(res, TopAbs_EDGE, TopAbs_FACE, aEFmap); - TopTools_MapOfShape aBiggestFaces, aSmallestFaces; + TopTools_MapOfShape aBiggestFaces; + + TopTools_MapOfShape aSmallestFaces; Standard_Boolean aUseTriangulation = Standard_True; Standard_Boolean aSkipShared = Standard_False; if (aNbFaces != theNumberOfPoints) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp index 97dd9e9aa..e0628dc4e 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp @@ -363,7 +363,9 @@ void GeomAlgoAPI_Prism::buildByPlanes( gp_Pln(aToPnt->impl(), aToDir->impl())); IntAna_Quadric aBndFromQuadric( gp_Pln(aFromPnt->impl(), aFromDir->impl())); - Standard_Real aMaxToDist = 0, aMaxFromDist = 0; + Standard_Real aMaxToDist = 0; + + Standard_Real aMaxFromDist = 0; for (const auto &aPoint : aPoints) { gp_Lin aLine(aPoint, anExtVec); IntAna_IntConicQuad aToIntAna(aLine, aBndToQuadric); @@ -613,7 +615,9 @@ void GeomAlgoAPI_Prism::buildByFaces( aBoundingToShape = buildPlanarFace(aBoundingToShape, aBndBox); // Perform partition. - ListOfShape anObjects, aTools; + ListOfShape anObjects; + + ListOfShape aTools; anObjects.push_back(aResult); aTools.push_back(aBoundingFromShape); aTools.push_back(aBoundingToShape); @@ -829,7 +833,9 @@ void storeGenerationHistory(GeomAlgoAPI_Prism *thePrismAlgo, BRepPrimAPI_MakePrism *thePrismBuilder) { for (TopExp_Explorer anExp(theBase, theType); anExp.More(); anExp.Next()) { const TopoDS_Shape &aShape = anExp.Current(); - GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape); + GeomShapePtr aFromShape(new GeomAPI_Shape); + + GeomShapePtr aToShape(new GeomAPI_Shape); aFromShape->setImpl(new TopoDS_Shape(thePrismBuilder->FirstShape(aShape))); aToShape->setImpl(new TopoDS_Shape(thePrismBuilder->LastShape(aShape))); thePrismAlgo->fixOrientation(aFromShape); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Projection.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Projection.cpp index c27eb47f5..da25e1e7b 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Projection.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Projection.cpp @@ -54,7 +54,9 @@ GeomCurvePtr GeomAlgoAPI_Projection::project(const GeomEdgePtr &theEdge) { const auto &aShape = theEdge->impl(); TopoDS_Edge anEdge = TopoDS::Edge(aShape); if (!anEdge.IsNull()) { - double aStart, aEnd; + double aStart; + + double aEnd; Handle(Geom_Curve) anEdgeCurve = BRep_Tool::Curve(anEdge, aStart, aEnd); if (!anEdgeCurve.IsNull() && !BRep_Tool::IsClosed(anEdge)) anEdgeCurve = new Geom_TrimmedCurve(anEdgeCurve, aStart, aEnd); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp index 12903b23e..dbeea4220 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp @@ -622,7 +622,9 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution *theRevolutionAlgo, BRepPrimAPI_MakeRevol *theRevolBuilder) { for (TopExp_Explorer anExp(theBase, theType); anExp.More(); anExp.Next()) { const TopoDS_Shape &aShape = anExp.Current(); - GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape); + GeomShapePtr aFromShape(new GeomAPI_Shape); + + GeomShapePtr aToShape(new GeomAPI_Shape); aFromShape->setImpl(new TopoDS_Shape(theRevolBuilder->FirstShape(aShape))); aToShape->setImpl(new TopoDS_Shape(theRevolBuilder->LastShape(aShape))); theRevolutionAlgo->fixOrientation(aFromShape); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp index 952086e00..62f4cbda0 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp @@ -279,15 +279,27 @@ void setShapeAttributes( Quantity_Color aCol; if (theColorTool->GetColor(theLabel, XCAFDoc_ColorGen, aCol)) { - double r = aCol.Red(), g = aCol.Green(), b = aCol.Blue(); + double r = aCol.Red(); + + double g = aCol.Green(); + + double b = aCol.Blue(); std::vector ColRGB = {int(r * 255), int(g * 255), int(b * 255)}; theResultBody->addShapeColor(aShapeName, ColRGB); } else if (theColorTool->GetColor(theLabel, XCAFDoc_ColorSurf, aCol)) { - double r = aCol.Red(), g = aCol.Green(), b = aCol.Blue(); + double r = aCol.Red(); + + double g = aCol.Green(); + + double b = aCol.Blue(); std::vector aColRGB = {int(r * 255), int(g * 255), int(b * 255)}; theResultBody->addShapeColor(aShapeName, aColRGB); } else if (theColorTool->GetColor(theLabel, XCAFDoc_ColorCurv, aCol)) { - double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue(); + double aR = aCol.Red(); + + double aG = aCol.Green(); + + double aB = aCol.Blue(); std::vector aColRGB = {int(aR * 255), int(aG * 255), int(aB * 255)}; theResultBody->addShapeColor(aShapeName, aColRGB); } @@ -298,7 +310,11 @@ void setShapeAttributes( if (theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorGen, aCol) || theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorSurf, aCol) || theColorTool->GetColor(aXp2.Current(), XCAFDoc_ColorCurv, aCol)) { - double aR = aCol.Red(), aG = aCol.Green(), aB = aCol.Blue(); + double aR = aCol.Red(); + + double aG = aCol.Green(); + + double aB = aCol.Blue(); TopoDS_Face aFace = TopoDS::Face(aXp2.Current()); std::vector aColRGB = {int(aR * 255), int(aG * 255), int(aB * 255)}; @@ -402,7 +418,9 @@ void storeMaterial( // as PRODUCT can be included in the main shape // several times, we look here for all iclusions. - Standard_Integer anISub, aNbSubs = theIndices.Extent(); + Standard_Integer anISub; + + Standard_Integer aNbSubs = theIndices.Extent(); for (anISub = 1; anISub <= aNbSubs; anISub++) { TopoDS_Shape aSub = theIndices.FindKey(anISub); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp index 4e5a1ad06..2cbecb6d6 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STLExport.cpp @@ -59,7 +59,17 @@ bool STLExport(const std::string &theFileName, // ASCII mode aWriter.ASCIIMode() = theIsASCII; if (theIsRelative) { - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin; + + Standard_Real aYmin; + + Standard_Real aZmin; + + Standard_Real aXmax; + + Standard_Real aYmax; + + Standard_Real aZmax; Bnd_Box aBndBox; BRepBndLib::Add(theShape->impl(), aBndBox); aBndBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeInfo.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeInfo.cpp index 4ef53b948..882a1283b 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeInfo.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeInfo.cpp @@ -123,7 +123,17 @@ void GeomAlgoAPI_ShapeInfo::processShape( case GeomAPI_Shape::COMPOUND: { setShapeType(myShape->shapeType() == GeomAPI_Shape::COMPSOLID ? "CompSolid" : "Compound"); - double aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + double aXmin; + + double aYmin; + + double aZmin; + + double aXmax; + + double aYmax; + + double aZmax; if (myShape->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax)) { theVals.addGroupName("Bounding box"); GeomPointPtr aMinPoint(new GeomAPI_Pnt(aXmin, aYmin, aZmin)); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp index 31e12bb2c..a0d19d097 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp @@ -368,7 +368,9 @@ static Standard_Real paramOnCurve(const BRepAdaptor_Curve &theCurve, Extrema_ExtPC aParamSearch(thePoint, theCurve, theCurve.FirstParameter(), theCurve.LastParameter()); if (aParamSearch.IsDone()) { - Standard_Integer anIndMin = 0, aNbExt = aParamSearch.NbExt(); + Standard_Integer anIndMin = 0; + + Standard_Integer aNbExt = aParamSearch.NbExt(); Standard_Real aSqDistMin = RealLast(); for (Standard_Integer i = 1; i <= aNbExt; ++i) { if (aParamSearch.SquareDistance(i) < aSqDistMin) { @@ -388,7 +390,9 @@ static void paramsOnSurf(const BRepAdaptor_Surface &theSurf, Extrema_ExtPS aParamSearch(thePoint, theSurf, Precision::PConfusion(), Precision::PConfusion()); if (aParamSearch.IsDone()) { - Standard_Integer anIndMin = 0, aNbExt = aParamSearch.NbExt(); + Standard_Integer anIndMin = 0; + + Standard_Integer aNbExt = aParamSearch.NbExt(); Standard_Real aSqDistMin = RealLast(); for (Standard_Integer i = 1; i <= aNbExt; ++i) { if (aParamSearch.SquareDistance(i) < aSqDistMin) { @@ -457,7 +461,9 @@ static Standard_Real extremaPF(const gp_Pnt &thePoint, if (!aTria.IsNull()) aTol = Max(aTol, aTria->Deflection()); - Standard_Real aU, aV; + Standard_Real aU; + + Standard_Real aV; paramsOnSurf(aSurf, thePointOnFace, 2 * aTol, aU, aV); Standard_Real aValue = -1.0; @@ -480,7 +486,9 @@ static Standard_Real extremaEF(const TopoDS_Edge &theEdge, Standard_Real aP = paramOnCurve(aCurve, thePonE, BRep_Tool::Tolerance(theEdge)); - Standard_Real aU, aV; + Standard_Real aU; + + Standard_Real aV; paramsOnSurf(aSurf, thePonF, BRep_Tool::Tolerance(theFace), aU, aV); Standard_Real aValue = -1.0; @@ -499,9 +507,13 @@ static Standard_Real extremaFF(const TopoDS_Face &theFace1, BRepAdaptor_Surface aSurf1(theFace1); BRepAdaptor_Surface aSurf2(theFace2); - Standard_Real aU1, aV1; + Standard_Real aU1; + + Standard_Real aV1; paramsOnSurf(aSurf1, thePoint1, BRep_Tool::Tolerance(theFace1), aU1, aV1); - Standard_Real aU2, aV2; + Standard_Real aU2; + + Standard_Real aV2; paramsOnSurf(aSurf2, thePoint2, BRep_Tool::Tolerance(theFace2), aU2, aV2); Standard_Real aValue = -1.0; @@ -868,7 +880,9 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::groupSharedTopology( } TopoDS_Shape anInShape = aResult->impl(); - NCollection_List anUngroupedShapes, aStillUngroupedShapes; + NCollection_List anUngroupedShapes; + + NCollection_List aStillUngroupedShapes; addSimpleShapeToList(anInShape, anUngroupedShapes); // Iterate over all shapes and find shapes with shared vertices. @@ -1071,14 +1085,22 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::fitPlaneToBox( const gp_Pln &aFacePln = isPlanar.Plan(); Handle(Geom_Plane) aFacePlane = new Geom_Plane(aFacePln); IntAna_Quadric aQuadric(aFacePln); - Standard_Real UMin, UMax, VMin, VMax; + Standard_Real UMin; + + Standard_Real UMax; + + Standard_Real VMin; + + Standard_Real VMax; UMin = UMax = VMin = VMax = 0; for (const auto &thePoint : thePoints) { const auto &aPnt = thePoint->impl(); gp_Lin aLin(aPnt, aFacePln.Axis().Direction()); IntAna_IntConicQuad anIntAna(aLin, aQuadric); const gp_Pnt &aPntOnFace = anIntAna.Point(1); - Standard_Real aPntU(0), aPntV(0); + Standard_Real aPntU(0); + + Standard_Real aPntV(0); GeomLib_Tool::Parameters(aFacePlane, aPntOnFace, Precision::Confusion(), aPntU, aPntV); if (aPntU < UMin) @@ -1113,11 +1135,14 @@ void GeomAlgoAPI_ShapeTools::findBounds( if (theShape) { const auto &aShape = theShape->impl(); - TopoDS_Vertex aV1, aV2; + TopoDS_Vertex aV1; + + TopoDS_Vertex aV2; ShapeAnalysis::FindBounds(aShape, aV1, aV2); - std::shared_ptr aGeomV1(new GeomAPI_Vertex()), - aGeomV2(new GeomAPI_Vertex()); + std::shared_ptr aGeomV1(new GeomAPI_Vertex()); + + std::shared_ptr aGeomV2(new GeomAPI_Vertex()); aGeomV1->setImpl(new TopoDS_Vertex(aV1)); aGeomV2->setImpl(new TopoDS_Vertex(aV2)); theV1 = aGeomV1; @@ -1215,7 +1240,9 @@ bool GeomAlgoAPI_ShapeTools::isSubShapeInsideShape( } // Check intersections. - TopoDS_Vertex aV1, aV2; + TopoDS_Vertex aV1; + + TopoDS_Vertex aV2; ShapeAnalysis::FindBounds(anEdge, aV1, aV2); gp_Pnt aPnt1 = BRep_Tool::Pnt(aV1); gp_Pnt aPnt2 = BRep_Tool::Pnt(aV2); @@ -1301,7 +1328,9 @@ static bool boundaryOfEdge(const std::shared_ptr theEdge, GeomPointPtr aLastPnt = theEdge->lastPoint(); double aLastPntTol = theEdge->lastPointTolerance(); - double aFirst, aLast; + double aFirst; + + double aLast; theEdge->getRange(aFirst, aLast); bool isFirst = aPoint->distance(aFirstPnt) <= aFirstPntTol; @@ -1318,7 +1347,9 @@ bool GeomAlgoAPI_ShapeTools::isTangent( const std::shared_ptr theEdge1, const std::shared_ptr theEdge2, const std::shared_ptr theTgPoint) { - double aParE1 = 0, aParE2 = 0; + double aParE1 = 0; + + double aParE2 = 0; if (!boundaryOfEdge(theEdge1, theTgPoint, aParE1) || !boundaryOfEdge(theEdge2, theTgPoint, aParE2)) return false; @@ -1353,7 +1384,9 @@ GeomAlgoAPI_ShapeTools::intersect(const std::shared_ptr theEdge, } TopoDS_Edge anEdge = TopoDS::Edge(theEdge->impl()); - double aFirstOnCurve, aLastOnCurve; + double aFirstOnCurve; + + double aLastOnCurve; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirstOnCurve, aLastOnCurve); @@ -1398,7 +1431,9 @@ void GeomAlgoAPI_ShapeTools::splitShape( // Rebuild closed edge to place vertex to one of split points. // This will prevent edge to be split on same vertex. if (BRep_Tool::IsClosed(aBaseEdge)) { - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aBaseEdge, aFirst, aLast); auto aPIt = thePointsInfo.begin(); @@ -1444,7 +1479,9 @@ void GeomAlgoAPI_ShapeTools::splitShape_p( // Rebuild closed edge to place vertex to one of split points. // This will prevent edge to be split on seam vertex. if (BRep_Tool::IsClosed(aBaseEdge)) { - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aBaseEdge, aFirst, aLast); auto aPIt = thePoints.begin(); @@ -1490,7 +1527,9 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::findShape( aPntIt++; std::shared_ptr aLastPoint = *aPntIt; - auto anIt = theShapes.begin(), aLast = theShapes.end(); + auto anIt = theShapes.begin(); + + auto aLast = theShapes.end(); for (; anIt != aLast; anIt++) { GeomShapePtr aShape = *anIt; std::shared_ptr anEdge(new GeomAPI_Edge(aShape)); @@ -1537,13 +1576,17 @@ static TopoDS_Wire fixParametricGaps(const TopoDS_Wire &theWire) { BRepTools_WireExplorer aWExp(theWire); for (; aWExp.More(); aWExp.Next()) { TopoDS_Edge anEdge = aWExp.Current(); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); if (aCurve == aPrevCurve && Abs(aFirst - aPrevLastParam) > Precision::Confusion()) { // if parametric gap occurs, create new edge based on the copied curve aCurve = Handle(Geom_Curve)::DownCast(aCurve->Copy()); - TopoDS_Vertex aV1, aV2; + TopoDS_Vertex aV1; + + TopoDS_Vertex aV2; TopExp::Vertices(anEdge, aV1, aV2); anEdge = TopoDS::Edge(anEdge.EmptyCopied()); aBuilder.UpdateEdge(anEdge, aCurve, BRep_Tool::Tolerance(anEdge)); @@ -1601,7 +1644,9 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::wireToEdge( // curvilinear abscissa. static const int THE_MAX_DEGREE = 14; static const int THE_MAX_INTERVALS = 32; - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aNewEdge, aFirst, aLast); #if OCC_VERSION_LARGE < 0x07070000 Handle(GeomAdaptor_HCurve) aHCurve = new GeomAdaptor_HCurve(aCurve); @@ -1697,11 +1742,15 @@ void GeomAlgoAPI_ShapeTools::computeThroughAll( } // Objects bounds - Standard_Real lowBnd, upperBnd; + Standard_Real lowBnd; + + Standard_Real upperBnd; getMinMaxPointsOnLine(aBndObjs, aDir, lowBnd, upperBnd); // Base bounds - Standard_Real lowBase, upperBase; + Standard_Real lowBase; + + Standard_Real upperBase; getMinMaxPointsOnLine(aBndBases, aDir, lowBase, upperBase); // ----------.-----.---------.--------------.-----------> theDir @@ -1758,11 +1807,15 @@ void GeomAlgoAPI_ShapeTools::computeThroughAll( } // Objects bounds - Standard_Real lowBnd, upperBnd; + Standard_Real lowBnd; + + Standard_Real upperBnd; getMinMaxPointsOnLine(aBndObjs, aDir, lowBnd, upperBnd); // Base bounds - Standard_Real lowBase, upperBase; + Standard_Real lowBase; + + Standard_Real upperBase; getMinMaxPointsOnLine(aBndBases, aDir, lowBase, upperBase); // ----------.-----.---------.--------------.-----------> theDir diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp index 5f7be4df4..3afda4960 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp @@ -79,7 +79,9 @@ static TopoDS_Vertex findStartVertex( if (anEdge.ShapeType() != TopAbs_EDGE) continue; - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) aCurve = Handle(Geom_TrimmedCurve)::DownCast(aCurve)->BasisCurve(); @@ -87,7 +89,9 @@ static TopoDS_Vertex findStartVertex( BRepTools_WireExplorer anExp(theWire, theFace); for (; anExp.More(); anExp.Next()) { const TopoDS_Edge &aShapeEdge = anExp.Current(); - double aF, aL; + double aF; + + double aL; Handle(Geom_Curve) aShapeCurve = BRep_Tool::Curve(aShapeEdge, aF, aL); if (aShapeCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) aShapeCurve = @@ -97,7 +101,9 @@ static TopoDS_Vertex findStartVertex( continue; // the edge is found, search vertex - TopoDS_Vertex aV1, aV2; + TopoDS_Vertex aV1; + + TopoDS_Vertex aV2; TopExp::Vertices(aShapeEdge, aV1, aV2); return fabs(aF - aFirst) <= fabs(aL - aFirst) ? aV1 : aV2; } @@ -120,7 +126,9 @@ bool isFirst( NCollection_List aNewList; TopExp_Explorer anEdgesExp(aShape, TopAbs_EDGE); for (; anEdgesExp.More(); anEdgesExp.Next()) { - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(anEdgesExp.Current()), aFirst, aLast); if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) @@ -191,7 +199,9 @@ sortAreas(TopTools_ListOfShape &theAreas, if (anEdge.ShapeType() != TopAbs_EDGE) continue; - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); if (aCurve->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve)) aCurve = Handle(Geom_TrimmedCurve)::DownCast(aCurve)->BasisCurve(); @@ -310,7 +320,9 @@ void GeomAlgoAPI_SketchBuilder::build( continue; if (!aStartFound) { const TopoDS_Edge &anEdge = anExp.Current(); - TopoDS_Vertex aV1, aV2; + TopoDS_Vertex aV1; + + TopoDS_Vertex aV2; TopExp::Vertices(anEdge, aV1, aV2, Standard_True); if (aV1.IsSame(aStartVertex) == Standard_True) aStartFound = true; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SolidClassifier.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SolidClassifier.cpp index 3cdec6a78..f5299eef2 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SolidClassifier.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SolidClassifier.cpp @@ -178,7 +178,9 @@ classifyByDistance(BRepClass3d_SolidClassifier &theClassifier, theTolerance); } else if (aDistance.SupportTypeShape2(sol) == BRepExtrema_IsInFace) { TopoDS_Face aFace = TopoDS::Face(aDistance.SupportOnShape2(sol)); - double aParU, aParV; + double aParU; + + double aParV; aDistance.ParOnFaceS2(sol, aParU, aParV); aResult |= classifyVicinityOnFace(theClassifier, aFace, aParU, aParV, diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp index 3cf14170a..a3e44d818 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp @@ -42,7 +42,13 @@ class CompareShapes { const TopoDS_Edge &aLHSEdge = TopoDS::Edge(theLHS->impl()); const TopoDS_Edge &aRHSEdge = TopoDS::Edge(theRHS->impl()); - double aLF, aLE, aRF, aRE; + double aLF; + + double aLE; + + double aRF; + + double aRE; Handle(Geom_Curve) aLHSCurve = BRep_Tool::Curve(aLHSEdge, aLF, aLE); Handle(Geom_Curve) aRHSCurve = BRep_Tool::Curve(aRHSEdge, aRF, aRE); @@ -71,7 +77,9 @@ class CompareShapes { Bnd_Box2d aLHSBox = boundingBoxUV(aLHSFace); Bnd_Box2d aRHSBox = boundingBoxUV(aRHSFace); - double aLHSBB[4], aRHSBB[4]; + double aLHSBB[4]; + + double aRHSBB[4]; aLHSBox.Get(aLHSBB[0], aLHSBB[1], aLHSBB[2], aLHSBB[3]); aRHSBox.Get(aRHSBB[0], aRHSBB[1], aRHSBB[2], aRHSBB[3]); for (int anIndex = 0; anIndex < 4; ++anIndex) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp index 03e3d0d32..d6430ad29 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp @@ -58,7 +58,9 @@ public: if (anEdge.IsNull()) return true; - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); bool isAdded = true; @@ -84,9 +86,13 @@ public: if (anEdge1.IsNull() || anEdge2.IsNull()) return false; - double aFirst1, aLast1; + double aFirst1; + + double aLast1; Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(anEdge1, aFirst1, aLast1); - double aFirst2, aLast2; + double aFirst2; + + double aLast2; Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(anEdge2, aFirst2, aLast2); return aCurve1 == aCurve2 && fabs(aFirst1 - aFirst2) < Precision::Confusion() && @@ -177,7 +183,9 @@ GeomAlgoAPI_WireBuilder::GeomAlgoAPI_WireBuilder(const ListOfShape &theShapes, if (isSplitWire) { bool isToReshape = false; BRepTools_ReShape aReshape; - TopoDS_Vertex aVF, aVL; + TopoDS_Vertex aVF; + + TopoDS_Vertex aVL; TopExp::Vertices(aNewCurrent, aVF, aVL); gp_Pnt aPF = BRep_Tool::Pnt(aVF); double aTolF = BRep_Tool::Tolerance(aVF); @@ -204,7 +212,9 @@ GeomAlgoAPI_WireBuilder::GeomAlgoAPI_WireBuilder(const ListOfShape &theShapes, for (TopTools_ListOfShape::Iterator aBaseIt(aListOfEdges); aBaseIt.More(); aBaseIt.Next()) { TopoDS_Edge aBaseCurrent = TopoDS::Edge(aBaseIt.Value()); - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom_Curve) aBaseCurve = BRep_Tool::Curve(aBaseCurrent, aFirst, aLast); diff --git a/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.cxx b/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.cxx index df6ba96b8..1df6e8eb2 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.cxx @@ -209,7 +209,9 @@ void GEOMAlgo_AlgoTools::FaceNormal(const TopoDS_Face &aF, const Standard_Real U, const Standard_Real V, gp_Vec &aN) { gp_Pnt aPnt; - gp_Vec aD1U, aD1V; + gp_Vec aD1U; + + gp_Vec aD1V; Handle(Geom_Surface) aSurface; aSurface = BRep_Tool::Surface(aF); @@ -228,13 +230,49 @@ void GEOMAlgo_AlgoTools::FaceNormal(const TopoDS_Face &aF, Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace( const TopoDS_Edge &aEold, const TopoDS_Edge &aEnew, const TopoDS_Face &aF, const Handle(IntTools_Context) & aCtx) { - Standard_Boolean bIsClosed, bUClosed, bHasOld; - Standard_Integer iRet, aNbPoints; - Standard_Real aTS, aTS1, aTS2, aT, aT1, aT2, aScPr, aTol; - Standard_Real aU, aV, aUS1, aVS1, aUS2, aVS2; + Standard_Boolean bIsClosed; + + Standard_Boolean bUClosed; + + Standard_Boolean bHasOld; + Standard_Integer iRet; + + Standard_Integer aNbPoints; + Standard_Real aTS; + + Standard_Real aTS1; + + Standard_Real aTS2; + + Standard_Real aT; + + Standard_Real aT1; + + Standard_Real aT2; + + Standard_Real aScPr; + + Standard_Real aTol; + Standard_Real aU; + + Standard_Real aV; + + Standard_Real aUS1; + + Standard_Real aVS1; + + Standard_Real aUS2; + + Standard_Real aVS2; gp_Pnt aP; - gp_Pnt2d aP2DS1, aP2DS2, aP2D; - gp_Vec2d aV2DS1, aV2DS2; + gp_Pnt2d aP2DS1; + + gp_Pnt2d aP2DS2; + + gp_Pnt2d aP2D; + gp_Vec2d aV2DS1; + + gp_Vec2d aV2DS2; Handle(Geom2d_Curve) aC2D, aC2DS1, aC2DS2; Handle(Geom_Surface) aS; TopoDS_Edge aES; @@ -317,7 +355,9 @@ Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace( // // 3. Build the second 2D curve Standard_Boolean bRevOrder; - gp_Vec2d aV2DT, aV2D; + gp_Vec2d aV2DT; + + gp_Vec2d aV2D; Handle(Geom2d_Curve) aC2Dnew; Handle(Geom2d_TrimmedCurve) aC2DTnew; BRep_Builder aBB; @@ -429,7 +469,15 @@ void GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(const TopoDS_Edge &aE, const TopoDS_Face &aF, const Standard_Real aUMin, const Standard_Real aUMax) { - Standard_Real aT1, aT2, aTx, aUx, aTol; + Standard_Real aT1; + + Standard_Real aT2; + + Standard_Real aTx; + + Standard_Real aUx; + + Standard_Real aTol; gp_Pnt2d aP2D; Handle(Geom_Surface) aS; Handle(Geom2d_Curve) aC2D; @@ -460,8 +508,18 @@ Standard_Boolean GEOMAlgo_AlgoTools::IsSplitToReverse( const TopoDS_Edge &aEF1, const TopoDS_Edge &aEF2, const Handle(IntTools_Context) & aContext) { Standard_Boolean aFlag; - Standard_Real aT1, aT2, aScPr, a, b; - gp_Vec aV1, aV2; + Standard_Real aT1; + + Standard_Real aT2; + + Standard_Real aScPr; + + Standard_Real a; + + Standard_Real b; + gp_Vec aV1; + + gp_Vec aV2; gp_Pnt aP; Handle(Geom_Curve) aC1 = BRep_Tool::Curve(aEF1, a, b); @@ -512,7 +570,9 @@ GEOMAlgo_AlgoTools::ProjectPointOnShape(const gp_Pnt &aP1, if (BRep_Tool::Degenerated(aE2)) { // jfa return Standard_True; } else { - Standard_Real f, l; + Standard_Real f; + + Standard_Real l; Handle(Geom_Curve) aC3D = BRep_Tool::Curve(aE2, f, l); if (aC3D.IsNull()) { return Standard_True; @@ -550,7 +610,11 @@ GEOMAlgo_AlgoTools::ProjectPointOnShape(const gp_Pnt &aP1, // purpose : //======================================================================= void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge &aE, gp_Pnt &aP3D) { - Standard_Real aTx, aT1, aT2; + Standard_Real aTx; + + Standard_Real aT1; + + Standard_Real aT2; // BRep_Tool::Curve(aE, aT1, aT2); aTx = IntTools_Tools::IntermediatePoint(aT1, aT2); @@ -562,7 +626,9 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge &aE, gp_Pnt &aP3D) { //======================================================================= void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge &aE, const Standard_Real aT, gp_Pnt &aP3D) { - Standard_Real aT1, aT2; + Standard_Real aT1; + + Standard_Real aT2; Handle(Geom_Curve) aC3D; // aC3D = BRep_Tool::Curve(aE, aT1, aT2); @@ -585,7 +651,17 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face &aF, // purpose : //======================================================================= void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face &aF, gp_Pnt &aP3D) { - Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax; + Standard_Real aU; + + Standard_Real aV; + + Standard_Real aUMin; + + Standard_Real aUMax; + + Standard_Real aVMin; + + Standard_Real aVMax; // BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax); // @@ -627,8 +703,12 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes( const Standard_Real aTol, TopTools_ListOfShape &aLESD, const Handle(IntTools_Context) & aCtx) { Standard_Boolean bIsDone; - Standard_Real aTol2, aD2; - gp_Pnt aP1, aP2; + Standard_Real aTol2; + + Standard_Real aD2; + gp_Pnt aP1; + + gp_Pnt aP2; TopTools_ListIteratorOfListOfShape aIt; // aTol2 = aTol * aTol; @@ -662,9 +742,17 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes( const TopTools_ListOfShape &aLE, const Standard_Real aTol, TopTools_IndexedDataMapOfShapeListOfShape &aMEE, const Handle(IntTools_Context) & aCtx) { - Standard_Integer aNbE, aNbEProcessed, aNbESD, iErr; + Standard_Integer aNbE; + + Standard_Integer aNbEProcessed; + + Standard_Integer aNbESD; + + Standard_Integer iErr; TopTools_ListOfShape aLESD; - TopTools_ListIteratorOfListOfShape aIt, aIt1; + TopTools_ListIteratorOfListOfShape aIt; + + TopTools_ListIteratorOfListOfShape aIt1; TopTools_IndexedMapOfShape aMProcessed; TopAbs_ShapeEnum aType; // @@ -728,8 +816,22 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes( Standard_Integer GEOMAlgo_AlgoTools::RefineSDShapes( GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape &aMPKLE, const Standard_Real aTol, const Handle(IntTools_Context) & aCtx) { - Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd; - TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd; + Standard_Integer i; + + Standard_Integer aNbE; + + Standard_Integer iErr; + + Standard_Integer j; + + Standard_Integer aNbEE; + + Standard_Integer aNbToAdd; + TopTools_IndexedDataMapOfShapeListOfShape aMEE; + + TopTools_IndexedDataMapOfShapeListOfShape aMSDE; + + TopTools_IndexedDataMapOfShapeListOfShape aMEToAdd; // iErr = 1; // @@ -789,10 +891,24 @@ GEOMAlgo_AlgoTools::BuildTriangulation(const TopoDS_Shape &theShape) { Bnd_Box B; BRepBndLib::Add(theShape, B); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + Standard_Real aXmin; + + Standard_Real aYmin; + + Standard_Real aZmin; + + Standard_Real aXmax; + + Standard_Real aYmax; + + Standard_Real aZmax; B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin; + Standard_Real dx = aXmax - aXmin; + + Standard_Real dy = aYmax - aYmin; + + Standard_Real dz = aZmax - aZmin; Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4; Standard_Real aHLRAngle = 0.349066; @@ -874,11 +990,45 @@ void GetCount(const TopoDS_Shape &aS, Standard_Integer &iCnt) { //======================================================================= Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face &aF, gp_Pnt &theP, gp_Pnt2d &theP2D) { - Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint; - Standard_Integer iErr, aIx, aNbDomains, i; - Standard_Real aUMin, aUMax, aVMin, aVMax; - Standard_Real aVx, aUx, aV1, aV2, aU1, aU2, aEpsT; - Standard_Real aTotArcIntr, aTolTangfIntr, aTolHatch2D, aTolHatch3D; + Standard_Boolean bIsDone; + + Standard_Boolean bHasFirstPoint; + + Standard_Boolean bHasSecondPoint; + Standard_Integer iErr; + + Standard_Integer aIx; + + Standard_Integer aNbDomains; + + Standard_Integer i; + Standard_Real aUMin; + + Standard_Real aUMax; + + Standard_Real aVMin; + + Standard_Real aVMax; + Standard_Real aVx; + + Standard_Real aUx; + + Standard_Real aV1; + + Standard_Real aV2; + + Standard_Real aU1; + + Standard_Real aU2; + + Standard_Real aEpsT; + Standard_Real aTotArcIntr; + + Standard_Real aTolTangfIntr; + + Standard_Real aTolHatch2D; + + Standard_Real aTolHatch3D; gp_Dir2d aD2D(0., 1.); gp_Pnt2d aP2D; gp_Pnt aPx; @@ -1015,7 +1165,9 @@ GEOMAlgo_AlgoTools::PointCloudInFace(const TopoDS_Face &theFace, TopTools_IndexedDataMapOfShapeListOfShape aEFmap; TopExp::MapShapesAndAncestors(res, TopAbs_EDGE, TopAbs_FACE, aEFmap); - TopTools_MapOfShape aBiggestFaces, aSmallestFaces; + TopTools_MapOfShape aBiggestFaces; + + TopTools_MapOfShape aSmallestFaces; Standard_Boolean aUseTriangulation = Standard_True; Standard_Boolean aSkipShared = Standard_False; if (aNbFaces != theNbPnts) { @@ -1168,7 +1320,9 @@ void CorrectShell(const TopoDS_Shape &theShell, const TopoDS_Face &theFace) { TopExp_Explorer anExplo(aFace, TopAbs_EDGE); for (; anExplo.More(); anExplo.Next()) { const TopoDS_Edge &anEdge = TopoDS::Edge(anExplo.Current()); - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, aFace, aFirst, aLast); aBB.UpdateEdge(anEdge, aPCurve, anInputSurf, anInputLoc, 0.); @@ -1184,7 +1338,13 @@ gp_Pnt GetMidPnt2d(const TopoDS_Face &theFace, if (theIsNaturalRestrictions) { BRepAdaptor_Surface aBAsurf(theFace); - Standard_Real aUmin, aUmax, aVmin, aVmax; + Standard_Real aUmin; + + Standard_Real aUmax; + + Standard_Real aVmin; + + Standard_Real aVmax; aUmin = aBAsurf.FirstUParameter(); aUmax = aBAsurf.LastUParameter(); aVmin = aBAsurf.FirstVParameter(); @@ -1271,7 +1431,9 @@ void ModifyFacesForGlobalResult( Standard_Integer aSum = 0; while (aSum < aDiff) // global loop { - Standard_Integer aNbFacesDone = 0, aNbFacesInTape = 0; + Standard_Integer aNbFacesDone = 0; + + Standard_Integer aNbFacesInTape = 0; TopoDS_Face aStartFace; Standard_Integer aStartIndex = (theIsToAddFaces) ? aNbFaces - 1 : 0; diff --git a/src/GeomAlgoImpl/GEOMAlgo_AlgoTools_1.cxx b/src/GeomAlgoImpl/GEOMAlgo_AlgoTools_1.cxx index e377f6d5b..00729661e 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_AlgoTools_1.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_AlgoTools_1.cxx @@ -87,8 +87,16 @@ void GEOMAlgo_AlgoTools::FindChains( void GEOMAlgo_AlgoTools::FindChains( const GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape &aMCV, GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape &aMapChains) { - Standard_Integer i, j, aNbCV, aNbV; - TopTools_IndexedMapOfShape aProcessed, aChain; + Standard_Integer i; + + Standard_Integer j; + + Standard_Integer aNbCV; + + Standard_Integer aNbV; + TopTools_IndexedMapOfShape aProcessed; + + TopTools_IndexedMapOfShape aChain; // aNbCV = aMCV.Extent(); for (i = 1; i <= aNbCV; ++i) { @@ -118,7 +126,9 @@ void ProcessBlock(const TopoDS_Shape &aF, const GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape &aMCV, TopTools_IndexedMapOfShape &aProcessed, TopTools_IndexedMapOfShape &aChain) { - Standard_Integer j, aNbV; + Standard_Integer j; + + Standard_Integer aNbV; // if (aProcessed.Contains(aF)) { return; diff --git a/src/GeomAlgoImpl/GEOMAlgo_BndSphere.cxx b/src/GeomAlgoImpl/GEOMAlgo_BndSphere.cxx index 045bef760..5f785ec15 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_BndSphere.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_BndSphere.cxx @@ -45,7 +45,9 @@ GEOMAlgo_BndSphere::~GEOMAlgo_BndSphere() = default; //======================================================================= Standard_Boolean GEOMAlgo_BndSphere::IsOut(const GEOMAlgo_BndSphere &theOther) const { - Standard_Real aD2, aT2; + Standard_Real aD2; + + Standard_Real aT2; // aD2 = myCenter.SquareDistance(theOther.myCenter); aT2 = myRadius + myGap + theOther.myRadius + theOther.myGap; diff --git a/src/GeomAlgoImpl/GEOMAlgo_BndSphere.lxx b/src/GeomAlgoImpl/GEOMAlgo_BndSphere.lxx index 980188ae4..ee3b826e2 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_BndSphere.lxx +++ b/src/GeomAlgoImpl/GEOMAlgo_BndSphere.lxx @@ -76,21 +76,27 @@ //======================================================================= inline void GEOMAlgo_BndSphere::Add(const GEOMAlgo_BndSphere& theOther) { - Standard_Real aTmax, aR, aT, aTOther; - gp_Pnt aPc; - // - aPc.SetXYZ(0.5*(myCenter.XYZ()+theOther.myCenter.XYZ())); - // - aR=aPc.Distance(myCenter); - // - aT=myRadius+myGap; - aTOther=theOther.myRadius+theOther.myGap; - aTmax=(aT>aTOther) ? aT: aTOther; - // - aR=aR+aTmax; - // - myCenter=aPc; - myRadius=aR; + Standard_Real aTmax; + + Standard_Real aR; + + Standard_Real aT; + + Standard_Real aTOther; + gp_Pnt aPc; + // + aPc.SetXYZ(0.5 * (myCenter.XYZ() + theOther.myCenter.XYZ())); + // + aR = aPc.Distance(myCenter); + // + aT = myRadius + myGap; + aTOther = theOther.myRadius + theOther.myGap; + aTmax = (aT > aTOther) ? aT : aTOther; + // + aR = aR + aTmax; + // + myCenter = aPc; + myRadius = aR; } //======================================================================= //function : SquareExtent diff --git a/src/GeomAlgoImpl/GEOMAlgo_GlueDetector.cxx b/src/GeomAlgoImpl/GEOMAlgo_GlueDetector.cxx index f42fb5dcc..24c8bfb75 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_GlueDetector.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_GlueDetector.cxx @@ -138,7 +138,13 @@ void GEOMAlgo_GlueDetector::Perform() { // purpose : //======================================================================= void GEOMAlgo_GlueDetector::DetectVertices() { - Standard_Integer j, i, aNbV, aNbVSD; + Standard_Integer j; + + Standard_Integer i; + + Standard_Integer aNbV; + + Standard_Integer aNbVSD; Standard_Real aTolV; gp_Pnt aPV; TColStd_ListIteratorOfListOfInteger aIt; @@ -192,9 +198,19 @@ void GEOMAlgo_GlueDetector::DetectVertices() { continue; } // - Standard_Integer aNbIP, aIP, aNbIP1, aIP1; + Standard_Integer aNbIP; + + Standard_Integer aIP; + + Standard_Integer aNbIP1; + + Standard_Integer aIP1; TopTools_ListOfShape aLVSD; - TColStd_MapOfInteger aMIP, aMIP1, aMIPC; + TColStd_MapOfInteger aMIP; + + TColStd_MapOfInteger aMIP1; + + TColStd_MapOfInteger aMIPC; TColStd_MapIteratorOfMapOfInteger aIt1; // aMIP.Add(i); @@ -304,7 +320,13 @@ void GEOMAlgo_GlueDetector::DetectEdges() { DetectShapes(TopAbs_EDGE); } //======================================================================= void GEOMAlgo_GlueDetector::DetectShapes(const TopAbs_ShapeEnum aType) { Standard_Boolean bDegenerated; - Standard_Integer i, aNbF, aNbSDF, iErr; + Standard_Integer i; + + Standard_Integer aNbF; + + Standard_Integer aNbSDF; + + Standard_Integer iErr; TopTools_IndexedMapOfShape aMF; TopTools_ListIteratorOfListOfShape aItLS; GEOMAlgo_PassKeyShape aPKF; @@ -391,7 +413,9 @@ void GEOMAlgo_GlueDetector::DetectShapes(const TopAbs_ShapeEnum aType) { //======================================================================= void GEOMAlgo_GlueDetector::FacePassKey(const TopoDS_Face &aF, GEOMAlgo_PassKeyShape &aPK) { - Standard_Integer i, aNbE; + Standard_Integer i; + + Standard_Integer aNbE; TopoDS_Shape aER; TopTools_ListOfShape aLE; TopTools_IndexedMapOfShape aME; @@ -455,7 +479,9 @@ void GEOMAlgo_GlueDetector::CheckDetected() { TopTools_ListOfShape aLV; TopTools_MapOfShape aMFence; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm; - TopTools_IndexedDataMapOfShapeListOfShape aMVE, aMEV; + TopTools_IndexedDataMapOfShapeListOfShape aMVE; + + TopTools_IndexedDataMapOfShapeListOfShape aMEV; // // 1. aMVE, aMEV TopExp::MapShapesAndAncestors(myArgument, TopAbs_VERTEX, TopAbs_EDGE, aMVE); @@ -493,9 +519,15 @@ void GEOMAlgo_GlueDetector::CheckDetected( const TopTools_ListOfShape &aLVSD, const TopTools_IndexedDataMapOfShapeListOfShape &aMVE, const TopTools_IndexedDataMapOfShapeListOfShape &aMEV) { - Standard_Integer aNbVSD, iRet; - TopExp_Explorer aExp, aExpA; - TopTools_MapOfShape aMFence, aMVSD; + Standard_Integer aNbVSD; + + Standard_Integer iRet; + TopExp_Explorer aExp; + + TopExp_Explorer aExpA; + TopTools_MapOfShape aMFence; + + TopTools_MapOfShape aMVSD; TopTools_ListOfShape aLV; TopTools_ListIteratorOfListOfShape aItLS; // @@ -533,9 +565,17 @@ CheckAncesstors(const TopoDS_Shape &aVSD, const TopTools_MapOfShape &aMVSD, const TopTools_IndexedDataMapOfShapeListOfShape &aMVE, const TopTools_IndexedDataMapOfShapeListOfShape &aMEV, TopTools_IndexedDataMapOfShapeListOfShape &aMEVZ) { - TopTools_ListOfShape *pLE, *pLV, *pLVZ; - Standard_Integer iRet, aNbVX; - TopTools_ListIteratorOfListOfShape aItLE, aItLV; + TopTools_ListOfShape *pLE; + + TopTools_ListOfShape *pLV; + + TopTools_ListOfShape *pLVZ; + Standard_Integer iRet; + + Standard_Integer aNbVX; + TopTools_ListIteratorOfListOfShape aItLE; + + TopTools_ListIteratorOfListOfShape aItLV; TopTools_MapOfShape aMFence; TopTools_ListOfShape aLVX; // diff --git a/src/GeomAlgoImpl/GEOMAlgo_Gluer2.cxx b/src/GeomAlgoImpl/GEOMAlgo_Gluer2.cxx index f51bc6246..dba4b582e 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_Gluer2.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_Gluer2.cxx @@ -229,8 +229,12 @@ void GEOMAlgo_Gluer2::Perform() { // purpose : //======================================================================= void GEOMAlgo_Gluer2::CheckData() { - Standard_Integer aNbSG, i; - TopAbs_ShapeEnum aType, aTypeX; + Standard_Integer aNbSG; + + Standard_Integer i; + TopAbs_ShapeEnum aType; + + TopAbs_ShapeEnum aTypeX; TopTools_ListIteratorOfListOfShape aItLS; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS; // @@ -342,8 +346,12 @@ void GEOMAlgo_Gluer2::FillVertices() { // purpose : //======================================================================= void GEOMAlgo_Gluer2::FillBRepShapes(const TopAbs_ShapeEnum theType) { - Standard_Boolean bHasImage, bIsToWork; - Standard_Integer i, aNbE; + Standard_Boolean bHasImage; + + Standard_Boolean bIsToWork; + Standard_Integer i; + + Standard_Integer aNbE; TopoDS_Iterator aItS; TopoDS_Shape aEnew; TopTools_IndexedMapOfShape aME; @@ -400,9 +408,15 @@ void GEOMAlgo_Gluer2::FillBRepShapes(const TopAbs_ShapeEnum theType) { // purpose : //======================================================================= void GEOMAlgo_Gluer2::FillContainers(const TopAbs_ShapeEnum aType) { - Standard_Boolean bHasImage, bToReverse; - Standard_Integer i, aNbW; - TopoDS_Shape aWnew, aEnew; + Standard_Boolean bHasImage; + + Standard_Boolean bToReverse; + Standard_Integer i; + + Standard_Integer aNbW; + TopoDS_Shape aWnew; + + TopoDS_Shape aEnew; TopoDS_Iterator aItS; BRep_Builder aBB; TopTools_IndexedMapOfShape aMW; @@ -484,7 +498,9 @@ void GEOMAlgo_Gluer2::FillCompounds() { void GEOMAlgo_Gluer2::FillCompound(const TopoDS_Shape &aC) { Standard_Boolean bHasImage; TopAbs_ShapeEnum aType; - TopoDS_Shape aCnew, aCXnew; + TopoDS_Shape aCnew; + + TopoDS_Shape aCXnew; TopoDS_Iterator aItC; BRep_Builder aBB; // @@ -560,7 +576,9 @@ Standard_Boolean GEOMAlgo_Gluer2::HasImage(const TopoDS_Shape &aC) { //======================================================================= void GEOMAlgo_Gluer2::BuildResult() { Standard_Boolean bHasImage; - TopoDS_Shape aCnew, aCXnew; + TopoDS_Shape aCnew; + + TopoDS_Shape aCXnew; TopoDS_Iterator aItC; BRep_Builder aBB; // @@ -597,7 +615,9 @@ void GEOMAlgo_Gluer2::BuildResult() { } // if (!myKeepNonSolids) { - Standard_Integer i, aNb; + Standard_Integer i; + + Standard_Integer aNb; TopoDS_Shape aCnew1; TopTools_IndexedMapOfShape aM; // diff --git a/src/GeomAlgoImpl/GEOMAlgo_Gluer2_1.cxx b/src/GeomAlgoImpl/GEOMAlgo_Gluer2_1.cxx index 9bac8c0a3..2cd536e9a 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_Gluer2_1.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_Gluer2_1.cxx @@ -66,7 +66,9 @@ void GEOMAlgo_Gluer2::MakeBRepShapes(const TopoDS_Shape &theS, // aType = theS.ShapeType(); if (aType == TopAbs_EDGE) { - TopoDS_Edge aEE, aEEnew; + TopoDS_Edge aEE; + + TopoDS_Edge aEEnew; // aEE = *((TopoDS_Edge *)&theS); MakeEdge(aEE, aEEnew); @@ -76,7 +78,9 @@ void GEOMAlgo_Gluer2::MakeBRepShapes(const TopoDS_Shape &theS, // theSnew = aEEnew; } else if (aType == TopAbs_FACE) { - TopoDS_Face aFF, aFFnew; + TopoDS_Face aFF; + + TopoDS_Face aFFnew; // aFF = *((TopoDS_Face *)&theS); MakeFace(aFF, aFFnew); @@ -93,15 +97,31 @@ void GEOMAlgo_Gluer2::MakeBRepShapes(const TopoDS_Shape &theS, // purpose : //======================================================================= void GEOMAlgo_Gluer2::MakeFace(const TopoDS_Face &theF, TopoDS_Face &theFnew) { - Standard_Boolean bIsToReverse, bIsUPeriodic; + Standard_Boolean bIsToReverse; + + Standard_Boolean bIsUPeriodic; Standard_Integer iRet; - Standard_Real aTol, aUMin, aUMax, aVMin, aVMax; + Standard_Real aTol; + + Standard_Real aUMin; + + Standard_Real aUMax; + + Standard_Real aVMin; + + Standard_Real aVMax; Handle(Geom_Surface) aS; TopLoc_Location aLoc; - TopoDS_Shape aW, aWr; + TopoDS_Shape aW; + + TopoDS_Shape aWr; TopoDS_Edge aEx; - TopoDS_Face aFF, aFnew; - TopoDS_Iterator aItW, aItE; + TopoDS_Face aFF; + + TopoDS_Face aFnew; + TopoDS_Iterator aItW; + + TopoDS_Iterator aItE; BRep_Builder aBB; TopTools_ListOfShape aLEr; TopTools_ListIteratorOfListOfShape aItLE; @@ -197,8 +217,16 @@ void GEOMAlgo_Gluer2::MakeEdge(const TopoDS_Edge &aE, TopoDS_Edge &aNewEdge) { myErrorStatus = 0; // Standard_Boolean bIsDE; - Standard_Real aT1, aT2; - TopoDS_Vertex aV1, aV2, aVR1, aVR2; + Standard_Real aT1; + + Standard_Real aT2; + TopoDS_Vertex aV1; + + TopoDS_Vertex aV2; + + TopoDS_Vertex aVR1; + + TopoDS_Vertex aVR2; TopoDS_Edge aEx; // bIsDE = BRep_Tool::Degenerated(aE); @@ -252,9 +280,15 @@ void GEOMAlgo_Gluer2::MakeEdge(const TopoDS_Edge &aE, TopoDS_Edge &aNewEdge) { void GEOMAlgo_Gluer2::MakeVertex(const TopTools_ListOfShape &aLV, TopoDS_Vertex &aNewVertex) { Standard_Integer aNbV; - Standard_Real aTolV, aD, aDmax; + Standard_Real aTolV; + + Standard_Real aD; + + Standard_Real aDmax; gp_XYZ aGC; - gp_Pnt aP3D, aPGC; + gp_Pnt aP3D; + + gp_Pnt aPGC; TopoDS_Vertex aVx; BRep_Builder aBB; TopTools_ListIteratorOfListOfShape aIt; diff --git a/src/GeomAlgoImpl/GEOMAlgo_Gluer2_2.cxx b/src/GeomAlgoImpl/GEOMAlgo_Gluer2_2.cxx index d0a7786cb..22b3aba79 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_Gluer2_2.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_Gluer2_2.cxx @@ -68,7 +68,11 @@ const TopTools_ListOfShape &GEOMAlgo_Gluer2::Generated(const TopoDS_Shape &) { //======================================================================= const TopTools_ListOfShape & GEOMAlgo_Gluer2::Modified(const TopoDS_Shape &theS) { - Standard_Boolean bIsDeleted, bHasImage, bToReverse; + Standard_Boolean bIsDeleted; + + Standard_Boolean bHasImage; + + Standard_Boolean bToReverse; TopAbs_ShapeEnum aType; TopoDS_Shape aSim; // @@ -114,7 +118,11 @@ GEOMAlgo_Gluer2::Modified(const TopoDS_Shape &theS) { // purpose : //======================================================================= Standard_Boolean GEOMAlgo_Gluer2::IsDeleted(const TopoDS_Shape &theS) { - Standard_Boolean bRet, bContains, bHasImage; + Standard_Boolean bRet; + + Standard_Boolean bContains; + + Standard_Boolean bHasImage; // bRet = Standard_False; // diff --git a/src/GeomAlgoImpl/GEOMAlgo_Gluer2_3.cxx b/src/GeomAlgoImpl/GEOMAlgo_Gluer2_3.cxx index 305125b59..caf3e9859 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_Gluer2_3.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_Gluer2_3.cxx @@ -121,8 +121,22 @@ void GEOMAlgo_Gluer2::Detect() { // purpose : //======================================================================= void GEOMAlgo_Gluer2::PerformShapesToWork() { - Standard_Integer aNbSG, i, j, k, aNbC, aNb, aNbSD; - TopTools_ListIteratorOfListOfShape aItLS1, aItLS2; + Standard_Integer aNbSG; + + Standard_Integer i; + + Standard_Integer j; + + Standard_Integer k; + + Standard_Integer aNbC; + + Standard_Integer aNb; + + Standard_Integer aNbSD; + TopTools_ListIteratorOfListOfShape aItLS1; + + TopTools_ListIteratorOfListOfShape aItLS2; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS; GEOMAlgo_CoupleOfShapes aCS; GEOMAlgo_ListOfCoupleOfShapes aLCS; @@ -210,10 +224,20 @@ void GEOMAlgo_Gluer2::TreatPair(const GEOMAlgo_CoupleOfShapes &aCS, return; } // - Standard_Integer i, aNbS1, aNbS2, aNbS; - TopAbs_ShapeEnum aType, aTypeS; + Standard_Integer i; + + Standard_Integer aNbS1; + + Standard_Integer aNbS2; + + Standard_Integer aNbS; + TopAbs_ShapeEnum aType; + + TopAbs_ShapeEnum aTypeS; TopTools_ListIteratorOfListOfShape aItLS; - TopTools_IndexedMapOfShape aMS1, aMS2; + TopTools_IndexedMapOfShape aMS1; + + TopTools_IndexedMapOfShape aMS2; TopTools_DataMapOfShapeListOfShape aDMSLS; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS; GEOMAlgo_CoupleOfShapes aCSS; diff --git a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.cxx b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.cxx index 2f83178ca..f89d928f4 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.cxx @@ -137,7 +137,11 @@ void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape &aS1, // purpose : //======================================================================= void GEOMAlgo_PassKeyShape::SetShapes(const TopTools_ListOfShape &aLS) { - Standard_Integer i, aId, aIdN; + Standard_Integer i; + + Standard_Integer aId; + + Standard_Integer aIdN; TopTools_ListIteratorOfListOfShape aIt; // Clear(); @@ -200,7 +204,11 @@ void GEOMAlgo_PassKeyShape::Dump(const Standard_Integer) const {} //======================================================================= Standard_Integer NormalizedId(const Standard_Integer aId, const Standard_Integer aDiv) { - Standard_Integer aMax, aTresh, aIdRet; + Standard_Integer aMax; + + Standard_Integer aTresh; + + Standard_Integer aIdRet; // aIdRet = aId; aMax = ::IntegerLast(); diff --git a/src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx b/src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx index 8d3992f98..07e27d6a8 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx @@ -116,7 +116,9 @@ void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType) { TopAbs_ShapeEnum aType; BRep_Builder aBB; NCollection_Map aM; - NCollection_List::Iterator aIt, aItIm; + NCollection_List::Iterator aIt; + + NCollection_List::Iterator aItIm; // aIt.Initialize(myArguments); for (; aIt.More(); aIt.Next()) { @@ -151,7 +153,9 @@ void GEOMAlgo_Splitter::PostTreat(const Message_ProgressRange &theRange) #endif { if (myLimit != TopAbs_SHAPE) { - Standard_Integer i, aNbS; + Standard_Integer i; + + Standard_Integer aNbS; BRep_Builder aBB; TopoDS_Compound aC; TopTools_IndexedMapOfShape aMx; @@ -165,10 +169,22 @@ void GEOMAlgo_Splitter::PostTreat(const Message_ProgressRange &theRange) aBB.Add(aC, aS); } if (myLimitMode) { - Standard_Integer iType, iLimit, iTypeX; - TopAbs_ShapeEnum aType, aTypeX; - NCollection_List aLSP, aLSX; - NCollection_List::Iterator aIt, aItX, aItIm; + Standard_Integer iType; + + Standard_Integer iLimit; + + Standard_Integer iTypeX; + TopAbs_ShapeEnum aType; + + TopAbs_ShapeEnum aTypeX; + NCollection_List aLSP; + + NCollection_List aLSX; + NCollection_List::Iterator aIt; + + NCollection_List::Iterator aItX; + + NCollection_List::Iterator aItIm; NCollection_Map aM; // iLimit = (Standard_Integer)myLimit; @@ -263,8 +279,12 @@ void TreatCompound(const TopoDS_Shape &aC1, NCollection_List &aLSX) { Standard_Integer aNbC1; TopAbs_ShapeEnum aType; - NCollection_List aLC, aLC1; - NCollection_List::Iterator aIt, aIt1; + NCollection_List aLC; + + NCollection_List aLC1; + NCollection_List::Iterator aIt; + + NCollection_List::Iterator aIt1; TopoDS_Iterator aItC; // aLC.Append(aC1); diff --git a/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx b/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx index 125998daa..28602c0e3 100644 --- a/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx +++ b/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx @@ -208,7 +208,9 @@ void GEOMImpl_Fillet1d::fillPoint(GEOMImpl_Fillet1dPoint *thePoint) { aValid = !isRadiusIntersected(myCurve2, aPoint, aCenter, Standard_True); Geom2dAPI_ProjectPointOnCurve aProj(aCenter, myCurve2); - Standard_Integer a, aNB = aProj.NbPoints(); + Standard_Integer a; + + Standard_Integer aNB = aProj.NbPoints(); for (a = aNB; a > 0; a--) { if (aPoint.Distance(aProj.Point(a)) < aTol) continue; @@ -380,14 +382,20 @@ Standard_Boolean GEOMImpl_Fillet1d::Perform(const Standard_Real theRadius) { void GEOMImpl_Fillet1d::performInterval(const Standard_Real theStart, const Standard_Real theEnd, const Standard_Integer theNBSteps) { - Standard_Real aParam, aStep, aDStep; + Standard_Real aParam; + + Standard_Real aStep; + + Standard_Real aDStep; aStep = (theEnd - theStart) / theNBSteps; aDStep = aStep / 1000.; Standard_Integer aCycle; for (aCycle = 2, myStartSide = Standard_False; aCycle; myStartSide = !myStartSide, aCycle--) { - GEOMImpl_Fillet1dPoint *aLeft = nullptr, *aRight = nullptr; + GEOMImpl_Fillet1dPoint *aLeft = nullptr; + + GEOMImpl_Fillet1dPoint *aRight = nullptr; for (aParam = theStart + aStep; aParam < theEnd || fabs(theEnd - aParam) < Precision::Confusion(); @@ -555,7 +563,9 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt &thePoint, TopoDS_Edge &theEdge2) { TopoDS_Edge aResult; gp_Pnt2d aTargetPoint2d; - Standard_Real aX, aY; + Standard_Real aX; + + Standard_Real aY; ElSLib::PlaneParameters(myPlane->Pln().Position(), thePoint, aX, aY); aTargetPoint2d.SetCoord(aX, aY); @@ -590,7 +600,9 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt &thePoint, myPlane->Pln().Position()); Handle(Geom_Circle) aCircle = new Geom_Circle( gp_Ax2(aCenter, myPlane->Pln().Axis().Direction()), myRadius); - gp_Pnt2d aPoint2d1, aPoint2d2; + gp_Pnt2d aPoint2d1; + + gp_Pnt2d aPoint2d2; myCurve1->D0(aNearest->GetParam(), aPoint2d1); myCurve2->D0(aNearest->GetParam2(), aPoint2d2); gp_Pnt aPoint1 = ElSLib::PlaneValue(aPoint2d1.X(), aPoint2d1.Y(), @@ -624,7 +636,9 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt &thePoint, aResult = aBuilder.Edge(); // divide edges - Standard_Real aStart, anEnd; + Standard_Real aStart; + + Standard_Real anEnd; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(myEdge1, aStart, anEnd); gp_Vec aDir; aCurve->D1(aNearest->GetParam(), aPoint1, aDir); @@ -698,7 +712,9 @@ Standard_Boolean GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoint *thePoint) { Standard_Integer a; Standard_Boolean aDiffsSet = (myD.Length() != 0); - Standard_Real aDX = thePoint->GetParam() - myParam, aDY = 0.0; + Standard_Real aDX = thePoint->GetParam() - myParam; + + Standard_Real aDY = 0.0; if (thePoint->myV.Length() == myV.Length()) { // absolutely the same points for (a = 1; a <= myV.Length(); a++) { aDY = thePoint->myV.Value(a) - myV.Value(a); @@ -734,9 +750,15 @@ GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoint *thePoint) { // purpose : //======================================================================= void GEOMImpl_Fillet1dPoint::FilterPoints(GEOMImpl_Fillet1dPoint *thePoint) { - Standard_Integer a, b; + Standard_Integer a; + + Standard_Integer b; TColStd_SequenceOfReal aDiffs; - Standard_Real aY, aY2, aDX = thePoint->GetParam() - myParam; + Standard_Real aY; + + Standard_Real aY2; + + Standard_Real aDX = thePoint->GetParam() - myParam; for (a = 1; a <= myV.Length(); a++) { // searching for near point from thePoint Standard_Integer aNear = 0; diff --git a/src/GeomValidators/GeomValidators_FeatureKind.cpp b/src/GeomValidators/GeomValidators_FeatureKind.cpp index 7e660dcaa..e4432aed7 100644 --- a/src/GeomValidators/GeomValidators_FeatureKind.cpp +++ b/src/GeomValidators/GeomValidators_FeatureKind.cpp @@ -40,7 +40,9 @@ bool GeomValidators_FeatureKind::isValid( bool isSketchEntities = true; std::set anEntityKinds; std::string anEntityKindsStr; - auto anIt = theArguments.begin(), aLast = theArguments.end(); + auto anIt = theArguments.begin(); + + auto aLast = theArguments.end(); for (; anIt != aLast; anIt++) { anEntityKinds.insert(*anIt); if (!anEntityKindsStr.empty()) diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp index 59a7473eb..ae5307330 100644 --- a/src/GeomValidators/GeomValidators_ShapeType.cpp +++ b/src/GeomValidators/GeomValidators_ShapeType.cpp @@ -80,7 +80,11 @@ getShapeTypeDescription(const GeomValidators_ShapeType::TypeOfShape &theType) { if (MyShapeTypes.size() != 0) { std::map::const_iterator - anIt = MyShapeTypes.begin(), + + anIt = MyShapeTypes.begin(); + + std::map::const_iterator + aLast = MyShapeTypes.end(); for (; anIt != aLast; anIt++) if (anIt->second == theType) { @@ -98,7 +102,9 @@ bool GeomValidators_ShapeType::isValid( Events_InfoMessage &theError) const { bool aValid = false; - auto anIt = theArguments.begin(), aLast = theArguments.end(); + auto anIt = theArguments.begin(); + + auto aLast = theArguments.end(); // returns true if the attribute satisfies at least one of given arguments for (; anIt != aLast; anIt++) { TypeOfShape aShapeType = shapeType(*anIt); diff --git a/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp b/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp index be8065d22..39936f50b 100644 --- a/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp +++ b/src/InitializationPlugin/InitializationPlugin_PyInterp.cpp @@ -210,7 +210,13 @@ InitializationPlugin_PyInterp::evaluate(const std::wstring &theExpression, std::string InitializationPlugin_PyInterp::errorMessage() { std::string aPyError; if (PyErr_Occurred()) { - PyObject *pstr, *ptype, *pvalue, *ptraceback; + PyObject *pstr; + + PyObject *ptype; + + PyObject *pvalue; + + PyObject *ptraceback; PyErr_Fetch(&ptype, &pvalue, &ptraceback); PyErr_NormalizeException(&ptype, &pvalue, &ptraceback); pstr = PyObject_Str(pvalue); diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 364895a1d..8029ab615 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -284,7 +284,9 @@ GeomShapePtr centerByEdge(GeomShapePtr theEdge, TopoDS_Shape aShape = theEdge->impl(); if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE) { TopoDS_Edge anEdge = TopoDS::Edge(aShape); - double aFirst, aLast; + double aFirst; + + double aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); if (!aCurve.IsNull()) { TopoDS_Vertex aVertex; diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index c0dfd319c..9d9ae4abd 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -818,7 +818,11 @@ void Model_Data::referencesToObjects( std::dynamic_pointer_cast(anAttr); std::list> aRefs = aRefAttr->list(); std::list>::const_iterator - anIt = aRefs.begin(), + + anIt = aRefs.begin(); + + std::list>::const_iterator + aLast = aRefs.end(); for (; anIt != aLast; anIt++) { aReferenced.push_back(anIt->first); diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 6762d31e1..7083da5cb 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -185,7 +185,9 @@ static void updateShapesFromRoot(const TDF_Label theThisAccess, } if (aNewIter.More()) continue; - GeomShapePtr anOldShape(new GeomAPI_Shape), aRootShape(new GeomAPI_Shape); + GeomShapePtr anOldShape(new GeomAPI_Shape); + + GeomShapePtr aRootShape(new GeomAPI_Shape); anOldShape->setImpl(new TopoDS_Shape(anOld)); anOldShape = GeomAPI_Tools::getTypedShape(anOldShape); @@ -216,7 +218,9 @@ static void updateShapesFromRoot(const TDF_Label theThisAccess, } } if (!aCurrentToRoot.IsEmpty()) { // update the whole named shape content - TopTools_ListOfShape anOld, aNew; + TopTools_ListOfShape anOld; + + TopTools_ListOfShape aNew; TNaming_Evolution anEvol = aNS->Evolution(); for (TNaming_Iterator aNSIter(aNS); aNSIter.More(); aNSIter.Next()) { anOld.Prepend(aCurrentToRoot.IsBound(aNSIter.OldShape()) @@ -225,7 +229,9 @@ static void updateShapesFromRoot(const TDF_Label theThisAccess, aNew.Prepend(aNSIter.NewShape()); } TNaming_Builder aBuilder(aNS->Label()); - TopTools_ListOfShape::Iterator anOldIter(anOld), aNewIter(aNew); + TopTools_ListOfShape::Iterator anOldIter(anOld); + + TopTools_ListOfShape::Iterator aNewIter(aNew); for (; anOldIter.More(); anOldIter.Next(), aNewIter.Next()) { if (anEvol == TNaming_GENERATED) { aBuilder.Generated(anOldIter.Value(), aNewIter.Value()); @@ -900,7 +906,9 @@ bool Model_Document::finishOperation() { // objects (to perform it in the python scripts correctly): sketch become // current after creation of sub-elements FeaturePtr aCurrent = currentFeature(false); - CompositeFeaturePtr aMain, aNext = ModelAPI_Tools::compositeOwner(aCurrent); + CompositeFeaturePtr aMain; + + CompositeFeaturePtr aNext = ModelAPI_Tools::compositeOwner(aCurrent); while (aNext.get()) { aMain = aNext; aNext = ModelAPI_Tools::compositeOwner(aMain); @@ -1054,7 +1062,9 @@ void Model_Document::abortOperation() { !myDoc->HasOpenCommand()) { // abort all what was done in nested compactNested(); // store undo-delta here as undo actually does in the method later - int a, aNumTransactions = myTransactions.rbegin()->myOCAFNum; + int a; + + int aNumTransactions = myTransactions.rbegin()->myOCAFNum; for (a = 0; a < aNumTransactions; a++) { modifiedLabels(myDoc, aDeltaLabels); myDoc->Undo(); diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 17bc4b702..13d899715 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -285,7 +285,9 @@ void Model_Objects::refsToFeature( std::dynamic_pointer_cast(aResult->data()); if (aData.get() != nullptr) { const std::set &aRefs = aData->refsToMe(); - auto aRefIt = aRefs.begin(), aRefLast = aRefs.end(); + auto aRefIt = aRefs.begin(); + + auto aRefLast = aRefs.end(); for (; aRefIt != aRefLast; aRefIt++) { FeaturePtr aFeature = std::dynamic_pointer_cast((*aRefIt)->owner()); @@ -299,7 +301,9 @@ void Model_Objects::refsToFeature( std::dynamic_pointer_cast(theFeature->data()); if (aData.get() && !aData->refsToMe().empty()) { const std::set &aRefs = aData->refsToMe(); - auto aRefIt = aRefs.begin(), aRefLast = aRefs.end(); + auto aRefIt = aRefs.begin(); + + auto aRefLast = aRefs.end(); for (; aRefIt != aRefLast; aRefIt++) { FeaturePtr aFeature = std::dynamic_pointer_cast((*aRefIt)->owner()); @@ -393,10 +397,13 @@ void Model_Objects::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis) { Handle(TDataStd_ReferenceArray) aRefs; if (!aFeaturesLab.FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) return; - TDF_Label anAfterLab, - aMovedLab = std::dynamic_pointer_cast(theMoved->data()) - ->label() - .Father(); + TDF_Label anAfterLab; + + TDF_Label aMovedLab = std::dynamic_pointer_cast(theMoved->data()) + + ->label() + + .Father(); if (theAfterThis.get()) anAfterLab = std::dynamic_pointer_cast(theAfterThis->data()) ->label() @@ -613,7 +620,9 @@ ObjectPtr Model_Objects::object(TDF_Label theLabel) { std::dynamic_pointer_cast(aCurrentResult); if (!anOwner) return ObjectPtr(); // only Body can have sub-results - int a, aNumSubs = anOwner->numberOfSubs(); + int a; + + int aNumSubs = anOwner->numberOfSubs(); for (a = 0; a < aNumSubs; a++) { ResultPtr aSub = anOwner->subResult(a); if (aSub.get()) { @@ -868,7 +877,9 @@ void Model_Objects::synchronizeFeatures(const TDF_LabelList &theUpdated, } // update all objects by checking are they on labels or not - std::set aNewFeatures, aKeptFeatures; + std::set aNewFeatures; + + std::set aKeptFeatures; TDF_ChildIDIterator aLabIter(featuresLabel(), TDataStd_Comment::GetID()); for (; aLabIter.More(); aLabIter.Next()) { TDF_Label aFeatureLabel = aLabIter.Value()->Label(); @@ -1666,7 +1677,9 @@ bool Model_Objects::moveToFolder( return false; // labels for the folder and last feature in the list - TDF_Label aFolderLabel, aLastFeatureLabel; + TDF_Label aFolderLabel; + + TDF_Label aLastFeatureLabel; std::shared_ptr aData = std::static_pointer_cast(theFolder->data()); if (aData && aData->isValid()) @@ -2174,7 +2187,9 @@ bool Model_Objects::isLater(FeaturePtr theLater, FeaturePtr theCurrent) const { aCurrentD->isValid()) { TDF_Label aLaterL = aLaterD->label().Father(); TDF_Label aCurrentL = aCurrentD->label().Father(); - int aLaterI = -1, aCurentI = -1; // not found yet state + int aLaterI = -1; + + int aCurentI = -1; // not found yet state Handle(TDataStd_ReferenceArray) aRefs; if (featuresLabel().FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) { diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index 8327220fd..08ee73379 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -346,7 +346,9 @@ void Model_ResultConstruction::storeShape( // searching for the best new candidate to old location MapFaceToEdgeIndices::Iterator aNewIter(aNewIndices); for (; aNewIter.More(); aNewIter.Next()) { - double aBestFound = 0, aBestNotFound = 1.e+100; + double aBestFound = 0; + + double aBestNotFound = 1.e+100; int aBestTag = 0; const TColStd_ListOfInteger &aNewInd = aNewIter.Value(); // old faces indices where they where located @@ -358,7 +360,9 @@ void Model_ResultConstruction::storeShape( continue; // already found a best candidate Handle(TDataStd_IntPackedMap) anOldIndices = Handle(TDataStd_IntPackedMap)::DownCast(anOldIter.Value()); - double aFound = 0, aNotFound = 0; + double aFound = 0; + + double aNotFound = 0; TColStd_ListOfInteger::Iterator aNewIndIter(aNewInd); for (; aNewIndIter.More(); aNewIndIter.Next()) { if (anOldIndices->Contains(aNewIndIter.Value())) { @@ -492,7 +496,9 @@ void storeFacesOnLabel( std::wstringstream aName; aName << "Face"; TopExp_Explorer aPutEdges(aFaceToPut, TopAbs_EDGE); - TNaming_Builder *anEdgesBuilder = nullptr, *aVerticesBuilder = nullptr; + TNaming_Builder *anEdgesBuilder = nullptr; + + TNaming_Builder *aVerticesBuilder = nullptr; for (TColStd_ListOfInteger::Iterator anIter(aNewInd); anIter.More(); anIter.Next()) { int anIndex = anIter.Value(); @@ -585,7 +591,9 @@ void indexingSketchEdges( if (aConstr->shape() && aConstr->shape()->isEdge()) { TopoDS_Edge anEdge = TopoDS::Edge(aConstr->shape()->impl()); - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); theCurvesIndices.Bind(aCurve, a); theEdgesIndices.Bind(a, anEdge); @@ -610,7 +618,9 @@ void faceToEdgeIndices( for (TopExp_Explorer anEdges(aTopoFace, TopAbs_EDGE); anEdges.More(); anEdges.Next()) { TopoDS_Edge anEdge = TopoDS::Edge(anEdges.Current()); - Standard_Real aFirst, aLast; + Standard_Real aFirst; + + Standard_Real aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast); if (theCurvesIndices.IsBound(aCurve)) { int anIndex = theCurvesIndices.Find(aCurve); diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 6b9c680e9..8fdf1b07c 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -346,7 +346,9 @@ void Model_Update::processEvent( std::dynamic_pointer_cast(theMessage); const std::set &anObjs = aMsg->objects(); auto anObjIter = anObjs.cbegin(); - std::list aFeatures, aResults; + std::list aFeatures; + + std::list aResults; for (; anObjIter != anObjs.cend(); anObjIter++) { if (std::dynamic_pointer_cast((*anObjIter)->document()) ->executeFeatures()) { @@ -656,15 +658,27 @@ bool Model_Update::processFeature(FeaturePtr theFeature) { std::shared_ptr anOrigin = std::dynamic_pointer_cast( theFeature->attribute("Origin")); - double anOX = anOrigin->x(), anOY = anOrigin->y(), anOZ = anOrigin->z(); + double anOX = anOrigin->x(); + + double anOY = anOrigin->y(); + + double anOZ = anOrigin->z(); std::shared_ptr aDir = std::dynamic_pointer_cast( theFeature->attribute("DirX")); - double aDX = aDir->x(), aDY = aDir->y(), aDZ = aDir->z(); + double aDX = aDir->x(); + + double aDY = aDir->y(); + + double aDZ = aDir->z(); std::shared_ptr aNorm = std::dynamic_pointer_cast( theFeature->attribute("Norm")); - double aNX = aNorm->x(), aNY = aNorm->y(), aNZ = aNorm->z(); + double aNX = aNorm->x(); + + double aNY = aNorm->y(); + + double aNZ = aNorm->z(); // update sketch plane updateArguments(theFeature); theFeature->attributeChanged( diff --git a/src/Model/Model_Validator.cpp b/src/Model/Model_Validator.cpp index 4795a71f6..b5f53f8a6 100644 --- a/src/Model/Model_Validator.cpp +++ b/src/Model/Model_Validator.cpp @@ -328,7 +328,9 @@ void Model_ValidatorsFactory::registerCase( std::map>(); aFindAttrID = aFindFeature->second.find(theAttribute); } - auto aCasesIt = theCases.begin(), aCasesLast = theCases.end(); + auto aCasesIt = theCases.begin(); + + auto aCasesLast = theCases.end(); std::map> aFindCases = aFindAttrID->second; for (; aCasesIt != aCasesLast; aCasesIt++) { std::pair aCasePair = *aCasesIt; @@ -347,8 +349,9 @@ bool Model_ValidatorsFactory::isCase(FeaturePtr theFeature, if (aFindFeature != myCases.end()) { auto aFindAttrID = aFindFeature->second.find(theAttribute); if (aFindAttrID != aFindFeature->second.end()) { - auto aCasesIt = aFindAttrID->second.begin(), - aCasesLast = aFindAttrID->second.end(); + auto aCasesIt = aFindAttrID->second.begin(); + + auto aCasesLast = aFindAttrID->second.end(); for (; aCasesIt != aCasesLast && anInCase; aCasesIt++) { // the the switch-attribute that contains the case value AttributeStringPtr aSwitch = theFeature->string(aCasesIt->first); diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index 76196f5c2..95e05ecd5 100644 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -627,7 +627,9 @@ bool removeFeaturesAndReferences(const std::set &theFeatures, bool removeFeatures(const std::set &theFeatures, const bool theFlushRedisplay) { bool isDone = false; - auto anIt = theFeatures.begin(), aLast = theFeatures.end(); + auto anIt = theFeatures.begin(); + + auto aLast = theFeatures.end(); for (; anIt != aLast; anIt++) { FeaturePtr aFeature = *anIt; if (aFeature.get()) { @@ -666,7 +668,9 @@ void addRefsToFeature( // references to it std::set aMainReferences = theReferencesMap.at(theFeature); - auto anIt = aMainReferences.begin(), aLast = aMainReferences.end(); + auto anIt = aMainReferences.begin(); + + auto aLast = aMainReferences.end(); for (; anIt != aLast; anIt++) { FeaturePtr aRefFeature = *anIt; if (theReferences.find(aRefFeature) == theReferences.end()) { @@ -688,7 +692,9 @@ void findReferences(const std::set &theFeatures, if (theRecLevel > RECURSE_TOP_LEVEL) return; theRecLevel++; - auto anIt = theFeatures.begin(), aLast = theFeatures.end(); + auto anIt = theFeatures.begin(); + + auto aLast = theFeatures.end(); for (; anIt != aLast; anIt++) { FeaturePtr aFeature = *anIt; if (aFeature.get() && theReferences.find(aFeature) == theReferences.end()) { @@ -701,7 +707,9 @@ void findReferences(const std::set &theFeatures, } else { // filter references to skip composition features of the current // feature std::set aFilteredFeatures; - auto aRefIt = aSelRefFeatures.begin(), aRefLast = aSelRefFeatures.end(); + auto aRefIt = aSelRefFeatures.begin(); + + auto aRefLast = aSelRefFeatures.end(); for (; aRefIt != aRefLast; aRefIt++) { FeaturePtr aCFeature = *aRefIt; CompositeFeaturePtr aComposite = @@ -754,7 +762,11 @@ void findAllReferences( // ext_2(bool_1) // sk_3() std::map>::const_iterator - aMainIt = aMainList.begin(), + + aMainIt = aMainList.begin(); + + std::map>::const_iterator + aMainLast = aMainList.end(); for (; aMainIt != aMainLast; aMainIt++) { FeaturePtr aMainListFeature = aMainIt->first; @@ -770,7 +782,9 @@ void findAllReferences( << getFeatureInfo(aMainListFeature) << ", references size = " << aSize << std::endl; #endif - auto anIt = aMainRefList.begin(), aLast = aMainRefList.end(); + auto anIt = aMainRefList.begin(); + + auto aLast = aMainRefList.end(); std::set aResultRefList; aResultRefList.insert(aMainRefList.begin(), aMainRefList.end()); for (; anIt != aLast; anIt++) { @@ -798,13 +812,17 @@ void findRefsToFeatures( const std::set &theFeatures, const std::map> &theReferences, std::set &theFeaturesRefsTo) { - auto anIt = theFeatures.begin(), aLast = theFeatures.end(); + auto anIt = theFeatures.begin(); + + auto aLast = theFeatures.end(); for (; anIt != aLast; anIt++) { FeaturePtr aFeature = *anIt; if (theReferences.find(aFeature) == theReferences.end()) continue; std::set aRefList = theReferences.at(aFeature); - auto aRefIt = aRefList.begin(), aRefLast = aRefList.end(); + auto aRefIt = aRefList.begin(); + + auto aRefLast = aRefList.end(); for (; aRefIt != aRefLast; aRefIt++) { FeaturePtr aRefFeature = *aRefIt; CompositeFeaturePtr aComposite = @@ -830,7 +848,11 @@ void getConcealedResults( aRefs; theFeature->data()->referencesToObjects(aRefs); std::list>>::const_iterator - anIt = aRefs.begin(), + + anIt = aRefs.begin(); + + std::list>>::const_iterator + aLast = aRefs.end(); std::set alreadyThere; // to avoid duplications for (; anIt != aLast; anIt++) { @@ -838,8 +860,9 @@ void getConcealedResults( anIt->first)) continue; // use only concealed attributes std::list anObjects = (*anIt).second; - std::list::const_iterator anOIt = anObjects.begin(), - anOLast = anObjects.end(); + std::list::const_iterator anOIt = anObjects.begin(); + + std::list::const_iterator anOLast = anObjects.end(); for (; anOIt != anOLast; anOIt++) { ResultPtr aResult = std::dynamic_pointer_cast(*anOIt); if (aResult && aResult->isConcealed()) { @@ -1569,7 +1592,9 @@ std::wstring validateMovement(const FeaturePtr &theAfter, : (*(theMoved.cbegin()))->document(); std::set aMoved(theMoved.begin(), theMoved.end()); // fast access to moved - std::set aPassed, + std::set aPassed; + + std::set aPassedMoved; // all features and all moved before the current one std::set aPassedAfter; // all passed features after theAfter bool anAfterIsPassed = diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp index f8c8ed37f..bb32ac9d5 100644 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp @@ -102,7 +102,9 @@ void ModelGeomAlgo_Point2D::getPointsOfReference( if (aRefFeature->getKind() == theReferenceFeatureKind) { std::list anAttributes = aRefFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId()); - auto anIter = anAttributes.begin(), aLast = anAttributes.end(); + auto anIter = anAttributes.begin(); + + auto aLast = anAttributes.end(); bool isSkippedAttribute = false; if (isSkipFeatureAttributes) { for (anIter = anAttributes.begin(); @@ -242,7 +244,9 @@ void ModelGeomAlgo_Point2D::getPointsIntersectedShape( aFeatureShape = (*anEdgeShapes.begin())->shape(); } - auto anIt = theFeatures.begin(), aLast = theFeatures.end(); + auto anIt = theFeatures.begin(); + + auto aLast = theFeatures.end(); for (; anIt != aLast; anIt++) { FeaturePtr aFeature = *anIt; if (aFeature.get() == theBaseFeature.get()) @@ -302,7 +306,9 @@ void ModelGeomAlgo_Point2D::getPointsInsideShape( #ifdef DEBUG_POINT_INSIDE_SHAPE std::cout << "ModelGeomAlgo_Point2D::getPointsInsideShape:" << std::endl; #endif - auto anIt = theAttributes.begin(), aLast = theAttributes.end(); + auto anIt = theAttributes.begin(); + + auto aLast = theAttributes.end(); for (; anIt != aLast; anIt++) { std::shared_ptr anAttribute = *anIt; std::shared_ptr aPnt2d = anAttribute->pnt(); @@ -344,7 +350,9 @@ void ModelGeomAlgo_Point2D::getPointsInsideShape_p( std::list> &thePoints, std::map, std::shared_ptr> &theAttributeToPoint) { - auto anIt = theAttributes.begin(), aLast = theAttributes.end(); + auto anIt = theAttributes.begin(); + + auto aLast = theAttributes.end(); for (; anIt != aLast; anIt++) { std::shared_ptr anAttribute = *anIt; std::shared_ptr aPnt2d = anAttribute->pnt(); diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp b/src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp index 5dc731e5b..5b903fd6c 100644 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp @@ -59,7 +59,17 @@ void shapesOfType(const FeaturePtr &theFeature, static bool isPointWithinBB(const GeomPointPtr &thePoint, const GeomShapePtr &theShape, const double theTolerance) { - double aXMin, aXMax, aYMin, aYMax, aZMin, aZMax; + double aXMin; + + double aXMax; + + double aYMin; + + double aYMax; + + double aZMin; + + double aZMax; return theShape->computeSize(aXMin, aYMin, aZMin, aXMax, aYMax, aZMax) && thePoint->x() >= aXMin - theTolerance && thePoint->x() <= aXMax + theTolerance && diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index a0933f459..67cc597f8 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -1004,7 +1004,11 @@ bool ModelHighAPI_Dumper::isDefaultColor(const ResultPtr &theResult) const { return true; } - std::string aSection, aName, aDefault; + std::string aSection; + + std::string aName; + + std::string aDefault; theResult->colorConfigInfo(aSection, aName, aDefault); // dump current color @@ -1375,7 +1379,9 @@ ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<<(const AttributePtr &theAttr) { FeaturePtr anOwner = ModelAPI_Feature::feature(theAttr->owner()); - std::string aWrapperPrefix, aWrapperSuffix; + std::string aWrapperPrefix; + + std::string aWrapperSuffix; // Check the attribute belongs to copied (in multi-translation or // multi-rotation) feature. In this case we need to cast explicitly feature to // appropriate type. diff --git a/src/ModelHighAPI/ModelHighAPI_Services.cpp b/src/ModelHighAPI/ModelHighAPI_Services.cpp index 5a03a740f..76ae271cb 100644 --- a/src/ModelHighAPI/ModelHighAPI_Services.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Services.cpp @@ -44,7 +44,9 @@ std::shared_ptr activeDocument() { //-------------------------------------------------------------------------------------- std::shared_ptr defaultPlane(const std::wstring &theName) { std::shared_ptr o(new GeomAPI_Pnt(0, 0, 0)); - std::shared_ptr n, x; + std::shared_ptr n; + + std::shared_ptr x; if (theName == L"XOY") { n.reset(new GeomAPI_Dir(0, 0, 1)); x.reset(new GeomAPI_Dir(1, 0, 0)); diff --git a/src/ModuleBase/ModuleBase_IModule.cpp b/src/ModuleBase/ModuleBase_IModule.cpp index 12440a48d..16c3bb051 100644 --- a/src/ModuleBase/ModuleBase_IModule.cpp +++ b/src/ModuleBase/ModuleBase_IModule.cpp @@ -88,7 +88,9 @@ void ModuleBase_IModule::launchModal(const QString &theCmdId) { if (!myWorkshop->canStartOperation(theCmdId, isCommitted)) return; - std::string aXmlCfg, aDescription; + std::string aXmlCfg; + + std::string aDescription; getXMLRepresentation(theCmdId.toStdString(), aXmlCfg, aDescription); SessionPtr aMgr = ModelAPI_Session::get(); @@ -178,8 +180,8 @@ QString ModuleBase_IModule::getFeatureError(const FeaturePtr &theFeature) { return QString::fromUtf8(aMsg.c_str()); } -void ModuleBase_IModule::grantedOperationIds(ModuleBase_Operation *theOperation, - QStringList &theIds) const {} +void ModuleBase_IModule::grantedOperationIds( + ModuleBase_Operation * /*theOperation*/, QStringList & /*theIds*/) const {} ModuleBase_Operation * ModuleBase_IModule::getNewOperation(const std::string &theFeatureId) { @@ -203,7 +205,9 @@ ModuleBase_IModule::createOperation(const std::string &theFeatureId) { } } - std::string aXmlCfg, aDescription; + std::string aXmlCfg; + + std::string aDescription; getXMLRepresentation(theFeatureId, aXmlCfg, aDescription); aFOperation->getDescription()->setDescription( QString::fromStdString(aDescription)); diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index 8f28be384..492f7e059 100644 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -118,7 +118,7 @@ public: /// Realizes some functionality by an operation start /// \param theOperation a started operation - virtual void operationStarted(ModuleBase_Operation *theOperation) {} + virtual void operationStarted(ModuleBase_Operation * /*theOperation*/) {} /// Realizes some functionality by an operation resume /// By default it emits operationResumed signal @@ -126,13 +126,13 @@ public: virtual void operationResumed(ModuleBase_Operation *theOperation); /// Realizes some functionality by an operation stop - virtual void operationStopped(ModuleBase_Operation *theOperation) {} + virtual void operationStopped(ModuleBase_Operation * /*theOperation*/) {} /// Realizes some functionality by an operation commit - virtual void operationCommitted(ModuleBase_Operation *theOperation) {} + virtual void operationCommitted(ModuleBase_Operation * /*theOperation*/) {} /// Realizes some functionality by an operation abort - virtual void operationAborted(ModuleBase_Operation *theOperation) {} + virtual void operationAborted(ModuleBase_Operation * /*theOperation*/) {} /// Realizes some functionality by an operation start virtual ModuleBase_Operation *currentOperation() const = 0; @@ -151,7 +151,7 @@ public: /// Add menu items for object browser into the given menu /// \param theMenu a popup menu to be shown in the object browser - virtual void addObjectBrowserMenu(QMenu *theMenu) const {}; + virtual void addObjectBrowserMenu(QMenu * /*theMenu*/) const {}; /// Creates custom widgets for property panel /// \param theType a type of widget @@ -174,7 +174,7 @@ public: /// Call back forlast tuning of property panel before operation performance /// It is called as on clearing of property panel as on filling with new /// widgets - virtual void propertyPanelDefined(ModuleBase_Operation *theOperation) {} + virtual void propertyPanelDefined(ModuleBase_Operation * /*theOperation*/) {} /// Have an opportunity to create widgets for the current operation /// instead of standard creation in workshop @@ -246,7 +246,7 @@ public: /// Returns a list of modes, where the AIS objects should be activated /// \param theModes a list of modes - virtual void activeSelectionModes(QIntList &theModes) {} + virtual void activeSelectionModes(QIntList & /*theModes*/) {} /// Appends specific selection modes for the module to the list of types /// \param theModesType combination of available selection filters @@ -289,16 +289,16 @@ public: /// \param theFlag a flag of level of customization, which means that only /// part of sub-elements \param theUpdateViewer the parameter whether the /// viewer should be update immediately - virtual void activateCustomPrs(const FeaturePtr &theFeature, - const ModuleBase_CustomizeFlag &theFlag, - const bool theUpdateViewer) {} + virtual void activateCustomPrs(const FeaturePtr & /*theFeature*/, + const ModuleBase_CustomizeFlag & /*theFlag*/, + const bool /*theUpdateViewer*/) {} /// Deactivate custom presentation for the object. Default realization is /// empty. \param theFlag a flag of level of customization, which means that /// only part of sub-elements \param theUpdateViewer the parameter whether the /// viewer should be update immediately - virtual void deactivateCustomPrs(const ModuleBase_CustomizeFlag &theFlag, - const bool theUpdateViewer) {} + virtual void deactivateCustomPrs(const ModuleBase_CustomizeFlag & /*theFlag*/, + const bool /*theUpdateViewer*/) {} /// Modifies the given presentation in the custom way. // virtual bool customisePresentation(std::shared_ptr @@ -331,7 +331,7 @@ public: /// Disable displaying of custom mode /// \param theMode a mode to disable - virtual void disableCustomMode(ModuleBase_CustomizeFlag theMode) {} + virtual void disableCustomMode(ModuleBase_CustomizeFlag /*theMode*/) {} /// Enables disabled custom mode virtual void enableCustomModes() {} @@ -339,7 +339,7 @@ public: /// This method is called on object browser creation for customization of /// module specific features \param theObjectBrowser a pinter on Object /// Browser widget - virtual void customizeObjectBrowser(QWidget *theObjectBrowser) {} + virtual void customizeObjectBrowser(QWidget * /*theObjectBrowser*/) {} /// Creates a new operation /// \param theCmdId the operation name @@ -354,8 +354,8 @@ public: /// Customize presentation according to objects attributes /// \param theObject an object for presentation /// \param thePrs a presentation object - virtual void customizePresentation(const ObjectPtr &theObject, - const AISObjectPtr &thePrs) const {} + virtual void customizePresentation(const ObjectPtr & /*theObject*/, + const AISObjectPtr & /*thePrs*/) const {} //! Returns data object by AIS virtual ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const = 0; @@ -368,12 +368,12 @@ public: /// Update state of pop-up menu items in object browser /// \param theStdActions - a map of standard actions virtual void - updateObjectBrowserMenu(const QMap &theStdActions) {} + updateObjectBrowserMenu(const QMap & /*theStdActions*/) {} /// Update state of pop-up menu items in viewer /// \param theStdActions - a map of standard actions - virtual void updateViewerMenu(const QMap &theStdActions) { - } + virtual void + updateViewerMenu(const QMap & /*theStdActions*/) {} /// Returns true if the action should be always enabled /// \param theActionId an action index: Accept or Accept All @@ -394,12 +394,12 @@ public: /// Connects or disconnects to the value changed signal of the property panel /// widgets \param theWidget a property contol widget \param isToConnect a /// boolean value whether connect or disconnect - virtual void connectToPropertyPanel(ModuleBase_ModelWidget *theWidget, - const bool isToConnect){}; + virtual void connectToPropertyPanel(ModuleBase_ModelWidget * /*theWidget*/, + const bool /*isToConnect*/){}; /// Validates the operation to change the "Apply" button state. /// \param thePreviousState the previous state of the widget - virtual void widgetStateChanged(int thePreviousState){}; + virtual void widgetStateChanged(int /*thePreviousState*/){}; /// Returns true if the event is processed. /// \param thePreviousAttributeID an index of the previous active attribute @@ -409,7 +409,8 @@ public: /// Performs some GUI actions before an operation transaction is stopped /// Default realization is empty - virtual void beforeOperationStopped(ModuleBase_Operation *theOperation){}; + virtual void + beforeOperationStopped(ModuleBase_Operation * /*theOperation*/){}; /// Finds a shape by attribute if it is possible /// \param theAttribute an attribute @@ -454,16 +455,18 @@ public slots: /// Slot called on object display /// \param theObject a data object /// \param theAIS a presentation object - virtual void onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) {} + virtual void onObjectDisplayed(ObjectPtr /*theObject*/, + AISObjectPtr /*theAIS*/) {} /// Slot called on before object erase /// \param theObject a data object /// \param theAIS a presentation object - virtual void onBeforeObjectErase(ObjectPtr theObject, AISObjectPtr theAIS) {} + virtual void onBeforeObjectErase(ObjectPtr /*theObject*/, + AISObjectPtr /*theAIS*/) {} /// Called on transformation in current viewer /// \param theTrsfType type of tranformation - virtual void onViewTransformed(int theTrsfType = 2) {} + virtual void onViewTransformed(int /*theTrsfType*/ = 2) {} protected slots: /// Called on selection changed event diff --git a/src/ModuleBase/ModuleBase_ISelection.cpp b/src/ModuleBase/ModuleBase_ISelection.cpp index 7f54cf291..bb5611a59 100644 --- a/src/ModuleBase/ModuleBase_ISelection.cpp +++ b/src/ModuleBase/ModuleBase_ISelection.cpp @@ -89,8 +89,9 @@ ModuleBase_ISelection::getShape(const ModuleBase_ViewerPrsPtr &thePrs) { QList ModuleBase_ISelection::getViewerPrs(const QObjectPtrList &theObjects) { QList aSelectedPrs; - QObjectPtrList::const_iterator anIt = theObjects.begin(), - aLast = theObjects.end(); + QObjectPtrList::const_iterator anIt = theObjects.begin(); + + QObjectPtrList::const_iterator aLast = theObjects.end(); for (; anIt != aLast; anIt++) { ObjectPtr anObject = *anIt; if (anObject.get() != nullptr) { @@ -105,8 +106,9 @@ ModuleBase_ISelection::getViewerPrs(const QObjectPtrList &theObjects) { void ModuleBase_ISelection::filterSelectionOnEqualPoints( QList &theSelected) { QList aCandidatesToRemove; - QList::const_iterator anIt = theSelected.begin(), - aLast = theSelected.end(); + QList::const_iterator anIt = theSelected.begin(); + + QList::const_iterator aLast = theSelected.end(); QList::const_iterator aSubIt; std::set> aVerticesMap; @@ -116,7 +118,9 @@ void ModuleBase_ISelection::filterSelectionOnEqualPoints( getPresentationVertex(aPrs); if (aGeomPrsVertex.get()) { const auto &aPrsVertex = aGeomPrsVertex->impl(); - auto aVIt = aVerticesMap.begin(), aVLast = aVerticesMap.end(); + auto aVIt = aVerticesMap.begin(); + + auto aVLast = aVerticesMap.end(); bool aFound = false; for (; aVIt != aVLast && !aFound; aVIt++) { std::shared_ptr aGeomVertex = *aVIt; @@ -138,9 +142,12 @@ void ModuleBase_ISelection::filterSelectionOnEqualPoints( } } QList::const_iterator aRemIt = aCandidatesToRemove - .begin(), - aRemLast = - aCandidatesToRemove.end(); + + .begin(); + + QList::const_iterator aRemLast = + + aCandidatesToRemove.end(); for (; aRemIt != aRemLast; aRemIt++) { theSelected.removeAll(*aRemIt); } diff --git a/src/ModuleBase/ModuleBase_IWidgetCreator.h b/src/ModuleBase/ModuleBase_IWidgetCreator.h index 22bf9e4c8..e49c265d1 100644 --- a/src/ModuleBase/ModuleBase_IWidgetCreator.h +++ b/src/ModuleBase/ModuleBase_IWidgetCreator.h @@ -61,11 +61,11 @@ public: /// Returns a container of possible page types, which this creator can process /// The default implementation is empty /// \param theTypes a list of type names - virtual void pageTypes(std::set &theTypes) {} + virtual void pageTypes(std::set & /*theTypes*/) {} /// Returns a container of possible widget types, which this creator can /// process \param theTypes a list of type names - virtual void widgetTypes(std::set &theTypes) {} + virtual void widgetTypes(std::set & /*theTypes*/) {} /// Create panel control by its type. /// The default implementation is empty diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index 69022d168..3159701e8 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -266,8 +266,9 @@ bool ModuleBase_ModelWidget::focusTo() { qDebug("ModuleBase_ModelWidget::focusTo"); #endif QList aControls = getControls(); - QList::const_iterator anIt = aControls.begin(), - aLast = aControls.end(); + QList::const_iterator anIt = aControls.begin(); + + QList::const_iterator aLast = aControls.end(); bool isFocusAccepted = false; for (; anIt != aLast && !isFocusAccepted; anIt++) { QWidget *aWidget = *anIt; diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index a71141f29..e69bc8141 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -175,8 +175,8 @@ public: /// Returns values which should be highlighted when the whidget is active /// \param theValues a list of presentations - virtual void - getHighlighted(QList> &theValues){}; + virtual void getHighlighted( + QList> & /*theValues*/){}; /// Checks if the selection presentation is valid in widget /// \param theValue a selected presentation in the view diff --git a/src/ModuleBase/ModuleBase_OperationFeature.cpp b/src/ModuleBase/ModuleBase_OperationFeature.cpp index c450df1bc..3d0564cf7 100644 --- a/src/ModuleBase/ModuleBase_OperationFeature.cpp +++ b/src/ModuleBase/ModuleBase_OperationFeature.cpp @@ -197,8 +197,9 @@ bool ModuleBase_OperationFeature::hasObject(ObjectPtr theObj) const { FeaturePtr anObjectFeature = ModelAPI_Feature::feature(theObj); std::list anAttributes = aFeature->data()->attributes(ModelAPI_AttributeRefList::typeId()); - std::list::const_iterator anIt = anAttributes.begin(), - aLast = anAttributes.end(); + std::list::const_iterator anIt = anAttributes.begin(); + + std::list::const_iterator aLast = anAttributes.end(); bool aFoundObject = false; for (; anIt != aLast && !aFoundObject; anIt++) { std::shared_ptr aCurSelList = diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp index 7d1a839fb..baca3d591 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp @@ -208,7 +208,9 @@ bool ModuleBase_ParamSpinBox::hasVariable(const QString &theText) const { void ModuleBase_ParamSpinBox::showCompletion(bool checkPrefix) { myCompletePos = lineEdit()->cursorPosition(); - int aStart, aEnd; + int aStart; + + int aEnd; QString aPrefix; aPrefix = getPrefix(aStart, aEnd); if (checkPrefix) { @@ -300,7 +302,9 @@ QString ModuleBase_ParamSpinBox::getPrefix(int &theStart, int &theEnd) const { void ModuleBase_ParamSpinBox::insertCompletion(const QString &theText) { QString aText = lineEdit()->text(); - int aStart, aEnd; + int aStart; + + int aEnd; QString aPrefix = getPrefix(aStart, aEnd); QString aResult; diff --git a/src/ModuleBase/ModuleBase_Preferences.cpp b/src/ModuleBase/ModuleBase_Preferences.cpp index e1adad09b..52844650c 100644 --- a/src/ModuleBase/ModuleBase_Preferences.cpp +++ b/src/ModuleBase/ModuleBase_Preferences.cpp @@ -549,7 +549,9 @@ void ModuleBase_PreferencesDlg::showEvent(QShowEvent *theEvent) { void ModuleBase_PreferencesMgr::changedResources(const ResourceMap &theMap) { myModified.clear(); ResourceMap::ConstIterator it; - QString sec, param; + QString sec; + + QString param; for (it = theMap.begin(); it != theMap.end(); ++it) { ModuleBase_Pref aPref; it.key()->resource(aPref.first, aPref.second); diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 983080c3b..9ccc093e6 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -319,12 +319,16 @@ void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d) & // draw curve direction (issue 0021087) anEdgeE.Orientation(TopAbs_FORWARD); - TopoDS_Vertex aV1, aV2; + TopoDS_Vertex aV1; + + TopoDS_Vertex aV2; TopExp::Vertices(anEdgeE, aV1, aV2); gp_Pnt aP1 = BRep_Tool::Pnt(aV1); gp_Pnt aP2 = BRep_Tool::Pnt(aV2); - double fp, lp; + double fp; + + double lp; gp_Vec aDirVec; Handle(Geom_Curve) C = BRep_Tool::Curve(anEdgeE, fp, lp); diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index ed13fdf63..b59b32c19 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -605,7 +605,9 @@ std::string findGreedAttribute(ModuleBase_IWorkshop *theWorkshop, const FeaturePtr &theFeature) { std::string anAttributeId; - std::string aXmlCfg, aDescription; + std::string aXmlCfg; + + std::string aDescription; theWorkshop->module()->getXMLRepresentation(theFeature->getKind(), aXmlCfg, aDescription); @@ -947,7 +949,9 @@ bool hasModuleDocumentFeature(const std::set &theFeatures) { bool aFoundModuleDocumentObject = false; DocumentPtr aModuleDoc = ModelAPI_Session::get()->moduleDocument(); - auto anIt = theFeatures.begin(), aLast = theFeatures.end(); + auto anIt = theFeatures.begin(); + + auto aLast = theFeatures.end(); for (; anIt != aLast && !aFoundModuleDocumentObject; anIt++) { FeaturePtr aFeature = *anIt; ResultPtr aResult = ModuleBase_Tools::firstResult(aFeature); @@ -979,7 +983,9 @@ bool askToDelete( std::set aFeaturesRefsToParameter; std::set aParameterFeatures; QStringList aPartFeatureNames; - auto anIt = theFeatures.begin(), aLast = theFeatures.end(); + auto anIt = theFeatures.begin(); + + auto aLast = theFeatures.end(); // separate features to references to parameter features and references to // others for (; anIt != aLast; anIt++) { @@ -992,7 +998,9 @@ bool askToDelete( std::set aRefFeatures; std::set aRefList = theReferences.at(aFeature); - auto aRefIt = aRefList.begin(), aRefLast = aRefList.end(); + auto aRefIt = aRefList.begin(); + + auto aRefLast = aRefList.end(); for (; aRefIt != aRefLast; aRefIt++) { FeaturePtr aRefFeature = *aRefIt; if (theFeatures.find(aRefFeature) == @@ -1046,7 +1054,9 @@ bool askToDelete( aMessageBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes); aMessageBox.setDefaultButton(QMessageBox::No); - QString aText, aDetailedText; + QString aText; + + QString aDetailedText; if (!thePrefixInfo.empty()) aText = thePrefixInfo.c_str(); QString aSep = ", "; @@ -1131,8 +1141,9 @@ bool warningAboutConflict(QWidget *theParent, //************************************************************** void convertToFeatures(const QObjectPtrList &theObjects, std::set &theFeatures) { - QObjectPtrList::const_iterator anIt = theObjects.begin(), - aLast = theObjects.end(); + QObjectPtrList::const_iterator anIt = theObjects.begin(); + + QObjectPtrList::const_iterator aLast = theObjects.end(); for (; anIt != aLast; anIt++) { ObjectPtr anObject = *anIt; FeaturePtr aFeature = std::dynamic_pointer_cast(anObject); @@ -1149,8 +1160,9 @@ void convertToFeatures(const QObjectPtrList &theObjects, //************************************************************** void convertToFolders(const QObjectPtrList &theObjects, std::set &theFolders) { - QObjectPtrList::const_iterator anIt = theObjects.begin(), - aLast = theObjects.end(); + QObjectPtrList::const_iterator anIt = theObjects.begin(); + + QObjectPtrList::const_iterator aLast = theObjects.end(); for (; anIt != aLast; anIt++) { ObjectPtr anObject = *anIt; FolderPtr aFeature = std::dynamic_pointer_cast(anObject); @@ -1359,7 +1371,9 @@ std::wstring generateName(const AttributePtr &theAttribute, if (theAttribute.get() != nullptr) { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); if (aFeature.get()) { - std::string aXmlCfg, aDescription; + std::string aXmlCfg; + + std::string aDescription; theWorkshop->module()->getXMLRepresentation(aFeature->getKind(), aXmlCfg, aDescription); diff --git a/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp b/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp index f1cbbaa26..48b766c04 100644 --- a/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp +++ b/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp @@ -100,7 +100,11 @@ bool ModuleBase_WidgetConcealedObjects::restoreValueCustom() { std::set aParents; ModelAPI_Tools::getConcealedResults(myBaseFeature, aResults); std::list>::const_iterator - anIt = aResults.begin(), + + anIt = aResults.begin(); + + std::list>::const_iterator + aLast = aResults.end(); for (; anIt != aLast; anIt++) { ResultPtr aResult = *anIt; diff --git a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp index ee5c6f8fc..2eaa046cd 100644 --- a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp @@ -47,7 +47,9 @@ ModuleBase_WidgetCreatorFactory::~ModuleBase_WidgetCreatorFactory() = default; void ModuleBase_WidgetCreatorFactory::registerCreator( const WidgetCreatorPtr &theCreator) { - std::set::const_iterator anIt, aLast; + std::set::const_iterator anIt; + + std::set::const_iterator aLast; /// fill map of panels std::set aPanelTypes; theCreator->panelTypes(aPanelTypes); diff --git a/src/ModuleBase/ModuleBase_WidgetLabelValue.h b/src/ModuleBase/ModuleBase_WidgetLabelValue.h index 739fb9d7a..8abd54bc2 100644 --- a/src/ModuleBase/ModuleBase_WidgetLabelValue.h +++ b/src/ModuleBase/ModuleBase_WidgetLabelValue.h @@ -53,7 +53,7 @@ protected: bool storeValueCustom() override; //! Switch On/Off highlighting of the widget - void setHighlighted(bool isHighlighted) override {} + void setHighlighted(bool /*isHighlighted*/) override {} protected: ModuleBase_LabelValue *myLabel; ///< A label control diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 8db7ade36..6e8cd5529 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -381,8 +381,9 @@ bool ModuleBase_WidgetMultiSelector::setSelection( QList anInvalidValues; QList anAttributeValues; - QList::const_iterator anIt = theValues.begin(), - aLast = theValues.end(); + QList::const_iterator anIt = theValues.begin(); + + QList::const_iterator aLast = theValues.end(); for (; anIt != aLast; anIt++) { ModuleBase_ViewerPrsPtr aValue = *anIt; // do not validate and append to attribute selection presentation if it @@ -1013,8 +1014,9 @@ bool ModuleBase_WidgetMultiSelector::removeUnusedAttributeObjects( aRefListAttr->remove(anIndicesToBeRemoved); } else if (aType == ModelAPI_AttributeRefAttrList::typeId()) { std::set anAttributes; - QList::const_iterator anIt = theValues.begin(), - aLast = theValues.end(); + QList::const_iterator anIt = theValues.begin(); + + QList::const_iterator aLast = theValues.end(); ObjectPtr anObject; GeomShapePtr aShape; for (; anIt != aLast; anIt++) { @@ -1053,8 +1055,9 @@ ModuleBase_WidgetMultiSelector::convertSelection( // convert prs list to objects map std::map> aGeomSelection; std::set aShapes; - QList::const_iterator anIt = theValues.begin(), - aLast = theValues.end(); + QList::const_iterator anIt = theValues.begin(); + + QList::const_iterator aLast = theValues.end(); ObjectPtr anObject; GeomShapePtr aShape; GeomShapePtr anEmptyShape(new GeomAPI_Shape()); @@ -1095,7 +1098,9 @@ bool ModuleBase_WidgetMultiSelector::findInSelection( } if (theGeomSelection.find(theObject) != theGeomSelection.end()) { // found const std::set &aShapes = theGeomSelection.at(theObject); - auto anIt = aShapes.begin(), aLast = aShapes.end(); + auto anIt = aShapes.begin(); + + auto aLast = aShapes.end(); for (; anIt != aLast && !aFound; anIt++) { GeomShapePtr aCShape = *anIt; if (aCShape.get()) { @@ -1259,7 +1264,9 @@ void ModuleBase_WidgetMultiSelector::setReadOnly(bool isReadOnly) { ModuleBase_WidgetSelectionFilter::SelectorFeature = feature(); ModuleBase_WidgetSelectionFilter::AttributeId = attributeID(); - std::string aXmlCfg, aDescription; + std::string aXmlCfg; + + std::string aDescription; myWorkshop->module()->getXMLRepresentation(myUseFilters, aXmlCfg, aDescription); diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index cebd48bf9..914a75f5e 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -174,8 +174,9 @@ bool ModuleBase_WidgetSelector::acceptSubShape( } } - QIntList::const_iterator anIt = aShapeTypes.begin(), - aLast = aShapeTypes.end(); + QIntList::const_iterator anIt = aShapeTypes.begin(); + + QIntList::const_iterator aLast = aShapeTypes.end(); for (; anIt != aLast && !aValid; anIt++) { auto aCurrentShapeType = (TopAbs_ShapeEnum)*anIt; if (aShapeType == aCurrentShapeType) diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.cpp b/src/ModuleBase/ModuleBase_WidgetValidated.cpp index 4a92715e0..958219399 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidated.cpp @@ -273,8 +273,11 @@ bool ModuleBase_WidgetValidated::isValidSelectionForAttribute( bool aValid = false; // stores the current values of the widget attribute - bool isFlushesActived, isAttributeSetInitializedBlocked, - isAttributeSendUpdatedBlocked; + bool isFlushesActived; + + bool isAttributeSetInitializedBlocked; + + bool isAttributeSendUpdatedBlocked; blockAttribute(theAttribute, true, isFlushesActived, isAttributeSetInitializedBlocked, @@ -511,8 +514,9 @@ void ModuleBase_WidgetValidated::filterCompSolids( QList aValidatedValues; // Collect compsolids. - QList::const_iterator anIt = theValues.begin(), - aLast = theValues.end(); + QList::const_iterator anIt = theValues.begin(); + + QList::const_iterator aLast = theValues.end(); for (; anIt != aLast; anIt++) { const ModuleBase_ViewerPrsPtr &aViewerPrs = *anIt; ObjectPtr anObject = aViewerPrs->object(); diff --git a/src/PartSet/PartSet_FieldStepPrs.cpp b/src/PartSet/PartSet_FieldStepPrs.cpp index f0bed4d7a..2401d2e21 100644 --- a/src/PartSet/PartSet_FieldStepPrs.cpp +++ b/src/PartSet/PartSet_FieldStepPrs.cpp @@ -122,7 +122,9 @@ QList PartSet_FieldStepPrs::range(double &theMin, } } QList aShapeData; - double aRangeMin = aFieldStepData.first(), aRangeMax = aFieldStepData.last(); + double aRangeMin = aFieldStepData.first(); + + double aRangeMax = aFieldStepData.last(); if (aCols == 1) { for (int aRow = 0; aRow < aRows - aStart; aRow++) { double aValue = aFieldStepData.at(aRow); @@ -165,7 +167,9 @@ void PartSet_FieldStepPrs::Compute(const Handle(PrsMgr_PresentationManager3d) & switch (aType) { case ModelAPI_AttributeTables::DOUBLE: case ModelAPI_AttributeTables::INTEGER: { - double aMin, aMax; + double aMin; + + double aMax; QList aShapeData = range(aMin, aMax); AttributeSelectionListPtr aSelList = @@ -296,7 +300,9 @@ bool PartSet_FieldStepPrs::computeMassCenter(const TopoDS_Shape &theShape, int aNbPoints = 0; if (theShape.ShapeType() == TopAbs_EDGE) { - double f, l; + double f; + + double l; Handle(Geom_Curve) curve = BRep_Tool::Curve(TopoDS::Edge(theShape), f, l); if (!curve.IsNull()) { theCenter = curve->Value(0.5 * (f + l)); @@ -311,7 +317,11 @@ bool PartSet_FieldStepPrs::computeMassCenter(const TopoDS_Shape &theShape, if (!triangulation.IsNull() && triangulation->HasUVNodes()) { gp_XY C(0, 0); double A = 0; - int n1, n2, n3; + int n1; + + int n2; + + int n3; for (int iT = 1; iT <= triangulation->NbTriangles(); ++iT) { triangulation->Triangle(iT).Get(n1, n2, n3); const gp_Pnt2d &uv1 = triangulation->UVNode(n1); diff --git a/src/PartSet/PartSet_IconFactory.cpp b/src/PartSet/PartSet_IconFactory.cpp index dbd172584..613d95b28 100644 --- a/src/PartSet/PartSet_IconFactory.cpp +++ b/src/PartSet/PartSet_IconFactory.cpp @@ -90,7 +90,9 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj) { if (aGroup == ModelAPI_Folder::group()) { static QString anIconString(":pictures/features_folder.png"); - int aFirst = -1, aLast = -1; + int aFirst = -1; + + int aLast = -1; PartSet_Tools::getFirstAndLastIndexInFolder(theObj, aFirst, aLast); if ((aFirst != -1) && (aLast != -1)) { int aNbItems = aLast - aFirst + 1; diff --git a/src/PartSet/PartSet_MenuMgr.cpp b/src/PartSet/PartSet_MenuMgr.cpp index 5105bf7de..34c9a2be6 100644 --- a/src/PartSet/PartSet_MenuMgr.cpp +++ b/src/PartSet/PartSet_MenuMgr.cpp @@ -393,8 +393,9 @@ void PartSet_MenuMgr::setAuxiliary(const bool isChecked) { static const Events_ID anVisualEvent = Events_Loop::eventByName(EVENT_VISUAL_ATTRIBUTES); if (anObjects.size() > 0) { - QObjectPtrList::const_iterator anIt = anObjects.begin(), - aLast = anObjects.end(); + QObjectPtrList::const_iterator anIt = anObjects.begin(); + + QObjectPtrList::const_iterator aLast = anObjects.end(); for (; anIt != aLast; anIt++) { FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt); if (aFeature.get() != nullptr) { @@ -452,8 +453,9 @@ bool PartSet_MenuMgr::canSetAuxiliary(bool &theValue) const { bool isNotAuxiliaryFound = false; if (anObjects.size() > 0) { - QObjectPtrList::const_iterator anIt = anObjects.begin(), - aLast = anObjects.end(); + QObjectPtrList::const_iterator anIt = anObjects.begin(); + + QObjectPtrList::const_iterator aLast = anObjects.end(); for (; anIt != aLast && !isNotAuxiliaryFound; anIt++) { FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt); if ((aFeature.get() != nullptr) && diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index bfa6ae8ca..e4629faa0 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -492,8 +492,9 @@ void PartSet_Module::operationStarted(ModuleBase_Operation *theOperation) { for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { anObjects.append(*aIt); } - QObjectPtrList::const_iterator anIt = anObjects.begin(), - aLast = anObjects.end(); + QObjectPtrList::const_iterator anIt = anObjects.begin(); + + QObjectPtrList::const_iterator aLast = anObjects.end(); for (; anIt != aLast; anIt++) aWorkshop->deactivateActiveObject(*anIt, false); if (anObjects.size() > 0) { @@ -573,7 +574,11 @@ void PartSet_Module::operationStopped(ModuleBase_Operation *theOperation) { } QMap::const_iterator - anIt = myHasConstraintShown.begin(), + + anIt = myHasConstraintShown.begin(); + + QMap::const_iterator + aLast = myHasConstraintShown.end(); for (; anIt != aLast; anIt++) { mySketchMgr->updateBySketchParameters(anIt.key(), anIt.value()); @@ -661,8 +666,9 @@ bool PartSet_Module::canActivateSelection(const ObjectPtr &theObject) const { bool aCanActivate = ModuleBase_IModule::canActivateSelection(theObject); ModuleBase_Operation *anOperation = myWorkshop->currentOperation(); - bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation), - isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation); + bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation); + + bool isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation); if (isSketchOp || isNestedOp) { // in active sketch operation it is possible to activate operation object in // selection in the edit operation, e.g. points of the line can be moved @@ -1024,8 +1030,9 @@ bool PartSet_Module::deleteObjects() { // SessionPtr aMgr = ModelAPI_Session::get(); // 1. check whether the delete should be processed in the module ModuleBase_Operation *anOperation = myWorkshop->currentOperation(); - bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation), - isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation); + bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation); + + bool isNestedOp = sketchMgr()->isNestedSketchOperation(anOperation); if (isSketchOp || isNestedOp) { isProcessed = true; // 2. find selected presentations @@ -1044,8 +1051,9 @@ bool PartSet_Module::deleteObjects() { // avoid delete of the objects, which are not belong to the current sketch // in order to do not delete results of other sketches QObjectPtrList aSketchObjects; - QObjectPtrList::const_iterator anIt = aSelectedObj.begin(), - aLast = aSelectedObj.end(); + QObjectPtrList::const_iterator anIt = aSelectedObj.begin(); + + QObjectPtrList::const_iterator aLast = aSelectedObj.end(); for (; anIt != aLast; anIt++) { ObjectPtr anObject = *anIt; if (mySketchMgr->isObjectOfSketch(anObject)) { @@ -1168,8 +1176,8 @@ void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, } //****************************************************** -void PartSet_Module::onBeforeObjectErase(ObjectPtr theObject, - AISObjectPtr theAIS) { +void PartSet_Module::onBeforeObjectErase(ObjectPtr /*theObject*/, + AISObjectPtr /*theAIS*/) { // this is obsolete // it should be recomputed in order to disappear in the viewer if the // corresponded object is erased @@ -1497,7 +1505,9 @@ void PartSet_Module::setTexture(const AISObjectPtr &thePrs, if (!anImageAttr.get() || !anImageAttr->hasTexture()) return; - int aWidth, aHeight; + int aWidth; + + int aHeight; std::string aFormat; std::list aByteList; anImageAttr->texture(aWidth, aHeight, aByteList, aFormat); diff --git a/src/PartSet/PartSet_MouseProcessor.h b/src/PartSet/PartSet_MouseProcessor.h index 0e178e118..6d0b93ab7 100644 --- a/src/PartSet/PartSet_MouseProcessor.h +++ b/src/PartSet/PartSet_MouseProcessor.h @@ -42,28 +42,31 @@ public: /// Processing the mouse move event in the viewer /// \param theWindow a view window /// \param theEvent a mouse event - PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow *theWindow, - QMouseEvent *theEvent) {} + PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow * /*theWindow*/, + QMouseEvent * /*theEvent*/) {} /// Processing the mouse press event in the viewer /// \param theWindow a view window /// \param theEvent a mouse event - PARTSET_EXPORT virtual void mousePressed(ModuleBase_IViewWindow *theWindow, - QMouseEvent *theEvent) {} + PARTSET_EXPORT virtual void + mousePressed(ModuleBase_IViewWindow * /*theWindow*/, + QMouseEvent * /*theEvent*/) {} /// Processing the mouse release event in the viewer /// \param theWindow a view window /// \param theEvent a mouse event - PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow *theWindow, - QMouseEvent *theEvent) {} + PARTSET_EXPORT virtual void + mouseReleased(ModuleBase_IViewWindow * /*theWindow*/, + QMouseEvent * /*theEvent*/) {} /// Processing the mouse double click event in the viewer /// \param theWindow a view window /// \param theEvent a mouse event PARTSET_EXPORT virtual void - mouseDoubleClick(ModuleBase_IViewWindow *theWindow, QMouseEvent *theEvent) {} + mouseDoubleClick(ModuleBase_IViewWindow * /*theWindow*/, + QMouseEvent * /*theEvent*/) {} /// Fill preselection used in mouseReleased - virtual void - setPreSelection(const std::shared_ptr &thePreSelected, - ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent) {} + virtual void setPreSelection( + const std::shared_ptr & /*thePreSelected*/, + ModuleBase_IViewWindow * /*theWnd*/, QMouseEvent * /*theEvent*/) {} }; #endif diff --git a/src/PartSet/PartSet_OperationPrs.cpp b/src/PartSet/PartSet_OperationPrs.cpp index 7b28ce972..8fb376933 100644 --- a/src/PartSet/PartSet_OperationPrs.cpp +++ b/src/PartSet/PartSet_OperationPrs.cpp @@ -172,8 +172,8 @@ void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d) & } void PartSet_OperationPrs::ComputeSelection(const Handle(SelectMgr_Selection) & - aSelection, - const Standard_Integer aMode) { + /*aSelection*/, + const Standard_Integer /*aMode*/) { // the presentation is not used in the selection } @@ -275,8 +275,9 @@ void PartSet_OperationPrs::getFeatureShapes( QList aShapes; std::list anAttributes = theFeature->data()->attributes(""); - std::list::const_iterator anIt = anAttributes.begin(), - aLast = anAttributes.end(); + std::list::const_iterator anIt = anAttributes.begin(); + + std::list::const_iterator aLast = anAttributes.end(); for (; anIt != aLast; anIt++) { AttributePtr anAttribute = *anIt; if (!isSelectionAttribute(anAttribute)) @@ -369,8 +370,9 @@ void PartSet_OperationPrs::getResultShapes( std::list aResults; ModelAPI_Tools::allResults(theFeature, aResults); - std::list::const_iterator aRIt = aResults.begin(), - aRLast = aResults.end(); + std::list::const_iterator aRIt = aResults.begin(); + + std::list::const_iterator aRLast = aResults.end(); for (; aRIt != aRLast; aRIt++) { ResultPtr aResult = *aRIt; if (!aResult->isDisabled()) { @@ -430,8 +432,9 @@ void PartSet_OperationPrs::getHighlightedShapes( anActiveWidget->getHighlighted(aValues); QList aShapes; - QList::const_iterator anIIt = aValues.begin(), - aILast = aValues.end(); + QList::const_iterator anIIt = aValues.begin(); + + QList::const_iterator aILast = aValues.end(); for (; anIIt != aILast; anIIt++) { ModuleBase_ViewerPrsPtr aPrs = *anIIt; ObjectPtr anObject = aPrs->object(); @@ -469,13 +472,18 @@ void PartSet_OperationPrs::fillShapeList( // create presentations on the base of the shapes QMap>::const_iterator - anIt = theFeatureShapes.begin(), + + anIt = theFeatureShapes.begin(); + + QMap>::const_iterator + aLast = theFeatureShapes.end(); for (; anIt != aLast; anIt++) { ObjectPtr anObject = anIt.key(); QList aShapes = anIt.value(); - QList::const_iterator aShIt = aShapes.begin(), - aShLast = aShapes.end(); + QList::const_iterator aShIt = aShapes.begin(); + + QList::const_iterator aShLast = aShapes.end(); for (; aShIt != aShLast; aShIt++) { GeomShapePtr aGeomShape = *aShIt; // the shape should not be checked here on empty value because it should diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index 8b63be4a4..253c6adee 100644 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -302,8 +302,9 @@ bool PartSet_OverconstraintListener::appendConflictingObjects( // set error state for new objects and append them in the internal map of // objects - auto anIt = theConflictingObjects.begin(), - aLast = theConflictingObjects.end(); + auto anIt = theConflictingObjects.begin(); + + auto aLast = theConflictingObjects.end(); int aCountOfSimilarConstraints = 0; for (; anIt != aLast; anIt++) { @@ -338,7 +339,9 @@ bool PartSet_OverconstraintListener::repairConflictingObjects( const std::set &theConflictingObjects) { std::set aModifiedObjects; // erase error state of absent current objects in the parameter list - std::set::const_iterator anIt, aLast; + std::set::const_iterator anIt; + + std::set::const_iterator aLast; for (anIt = theConflictingObjects.begin(), aLast = theConflictingObjects.end(); anIt != aLast; anIt++) { @@ -364,7 +367,9 @@ void PartSet_OverconstraintListener::redisplayObjects( static Events_ID EVENT_REDISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); static const ModelAPI_EventCreator *aECreator = ModelAPI_EventCreator::get(); - auto anIt = theObjects.begin(), aLast = theObjects.end(); + auto anIt = theObjects.begin(); + + auto aLast = theObjects.end(); for (; anIt != aLast; anIt++) { ObjectPtr aObj = *anIt; aECreator->sendUpdated(aObj, EVENT_DISP); diff --git a/src/PartSet/PartSet_PreviewPlanes.cpp b/src/PartSet/PartSet_PreviewPlanes.cpp index f2b7898fd..be50c617c 100644 --- a/src/PartSet/PartSet_PreviewPlanes.cpp +++ b/src/PartSet/PartSet_PreviewPlanes.cpp @@ -118,7 +118,11 @@ void PartSet_PreviewPlanes::showPreviewPlanes( std::shared_ptr aXZDir(new GeomAPI_Dir(0, -1, 0)); std::shared_ptr aXYDir(new GeomAPI_Dir(0, 0, 1)); - std::vector aYZRGB(3, 0), aXZRGB(3, 0), aXYRGB(3, 0); + std::vector aYZRGB(3, 0); + + std::vector aXZRGB(3, 0); + + std::vector aXYRGB(3, 0); #ifdef SET_PLANES_COLOR_IN_PREFERENCES aYZRGB = Config_PropManager::color("Visualization", "yz_plane_color"); aXZRGB = Config_PropManager::color("Visualization", "xz_plane_color"); diff --git a/src/PartSet/PartSet_PreviewSketchPlane.cpp b/src/PartSet/PartSet_PreviewSketchPlane.cpp index 3c0624f51..757b93e22 100644 --- a/src/PartSet/PartSet_PreviewSketchPlane.cpp +++ b/src/PartSet/PartSet_PreviewSketchPlane.cpp @@ -124,7 +124,13 @@ void PartSet_PreviewSketchPlane::createSketchPlane( std::shared_ptr aFace(new GeomAPI_Face(myShape)); std::shared_ptr aPlane = aFace->getPlane(); if (aPlane.get()) { - double anA, aB, aC, aD; + double anA; + + double aB; + + double aC; + + double aD; aPlane->coefficients(anA, aB, aC, aD); std::shared_ptr aNormDir(new GeomAPI_Dir(anA, aB, aC)); std::shared_ptr aCoords = aNormDir->xyz(); @@ -202,7 +208,17 @@ bool PartSet_PreviewSketchPlane::getDefaultSizeOfView( if (aBox.IsVoid()) return false; - double aXmin, aXmax, anYmin, anYmax, aZmin, aZmax; + double aXmin; + + double aXmax; + + double anYmin; + + double anYmax; + + double aZmin; + + double aZmax; aBox.Get(aXmin, anYmin, aZmin, aXmax, anYmax, aZmax); theSizeOfView = maximumSize(aXmin, anYmin, aZmin, aXmax, anYmax, aZmax); diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index ff45e0724..13c0d53fb 100644 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -336,8 +336,9 @@ void PartSet_ResultSketchPrs::fillShapes( BRep_Builder aBuilder; // TopoDS_Compound aComp; aBuilder.MakeCompound(theAuxiliaryCompound); - std::list::const_iterator anIt = anAuxiliaryResults.begin(), - aLast = anAuxiliaryResults.end(); + std::list::const_iterator anIt = anAuxiliaryResults.begin(); + + std::list::const_iterator aLast = anAuxiliaryResults.end(); for (; anIt != aLast; anIt++) { ResultPtr aResult = *anIt; if (aResult.get()) { diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 9cfd6ee5f..908037732 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -722,8 +722,9 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow *theWnd, static Events_ID aMoveEvent = Events_Loop::eventByName(EVENT_OBJECT_MOVED); // static Events_ID aUpdateEvent = // Events_Loop::eventByName(EVENT_OBJECT_UPDATED); - FeatureToSelectionMap::const_iterator anIt = myCurrentSelection.begin(), - aLast = myCurrentSelection.end(); + FeatureToSelectionMap::const_iterator anIt = myCurrentSelection.begin(); + + FeatureToSelectionMap::const_iterator aLast = myCurrentSelection.end(); // 4. the features and attributes modification(move) bool isModified = false; for (; anIt != aLast; anIt++) { @@ -733,9 +734,12 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow *theWnd, // Process selection by attribute: the priority to the attribute if (!anAttributes.empty()) { std::map::const_iterator anAttIt = - anAttributes.begin(), - anAttLast = - anAttributes.end(); + + anAttributes.begin(); + + std::map::const_iterator anAttLast = + + anAttributes.end(); for (; anAttIt != anAttLast; anAttIt++) { AttributePtr anAttr = anAttIt->first; if (anAttr.get() == nullptr) @@ -887,7 +891,9 @@ void PartSet_SketcherMgr::get2dPoint(ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent, Point &thePoint) { Handle(V3d_View) aView = theWnd->v3dView(); gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), aView); - double aX, anY; + double aX; + + double anY; PartSet_Tools::convertTo2D(aPoint, myCurrentSketch, aView, aX, anY); thePoint.setValue(aX, anY); } @@ -1154,7 +1160,9 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation * /*theOperation*/) { std::map> aReferences; ModelAPI_Tools::findAllReferences(anInvalidFeatures, aReferences, false); - auto anIt = anInvalidFeatures.begin(), aLast = anInvalidFeatures.end(); + auto anIt = anInvalidFeatures.begin(); + + auto aLast = anInvalidFeatures.end(); // separate features to references to parameter features and references to // others QStringList anInvalidFeatureNames; @@ -1481,8 +1489,9 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr &theObject) const { if (theObject == aFeature) isObjectFound = true; else { - std::list::const_iterator anIt = aResults.begin(), - aLast = aResults.end(); + std::list::const_iterator anIt = aResults.begin(); + + std::list::const_iterator aLast = aResults.end(); for (; anIt != aLast && !isObjectFound; anIt++) { isObjectFound = *anIt == theObject; } @@ -1710,8 +1719,9 @@ bool PartSet_SketcherMgr::setDistanceValueByPreselection( std::list aRefAttrs = aFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId()); - std::list::const_iterator anIt = aRefAttrs.begin(), - aLast = aRefAttrs.end(); + std::list::const_iterator anIt = aRefAttrs.begin(); + + std::list::const_iterator aLast = aRefAttrs.end(); for (; anIt != aLast && anAllRefAttrInitialized; anIt++) { anAllRefAttrInitialized = (*anIt)->isInitialized(); } @@ -1736,7 +1746,9 @@ bool PartSet_SketcherMgr::setDistanceValueByPreselection( auto *anEditor = dynamic_cast(aWgt); if (anEditor) { - int aX = 0, anY = 0; + int aX = 0; + + int anY = 0; XGUI_Workshop *aWorkshop = XGUI_Tools::workshop(theWorkshop); XGUI_Displayer *aDisplayer = aWorkshop->displayer(); @@ -1756,7 +1768,9 @@ bool PartSet_SketcherMgr::setDistanceValueByPreselection( ModuleBase_IViewer *aViewer = aWorkshop->viewer(); Handle(V3d_View) aView = aViewer->activeView(); - int aCX, aCY; + int aCX; + + int aCY; aView->Convert(aPosition.X(), aPosition.Y(), aPosition.Z(), aCX, aCY); @@ -2014,8 +2028,9 @@ void PartSet_SketcherMgr::storeSelection( // the features moving theCurrentSelection.clear(); - QList::const_iterator anIt = aStoredPrs.begin(), - aLast = aStoredPrs.end(); + QList::const_iterator anIt = aStoredPrs.begin(); + + QList::const_iterator aLast = aStoredPrs.end(); CompositeFeaturePtr aSketch = activeSketch(); for (; anIt != aLast; anIt++) { @@ -2075,8 +2090,9 @@ void PartSet_SketcherMgr::restoreSelection( // %1").arg(theCurrentSelection.size()).toStdString().c_str()); ModuleBase_IWorkshop *aWorkshop = myModule->workshop(); auto *aConnector = dynamic_cast(aWorkshop); - FeatureToSelectionMap::const_iterator aSIt = theCurrentSelection.begin(), - aSLast = theCurrentSelection.end(); + FeatureToSelectionMap::const_iterator aSIt = theCurrentSelection.begin(); + + FeatureToSelectionMap::const_iterator aSLast = theCurrentSelection.end(); SelectMgr_IndexedMapOfOwner anOwnersToSelect; anOwnersToSelect.Clear(); for (; aSIt != aSLast; aSIt++) { @@ -2434,7 +2450,17 @@ void PartSet_Fitter::fitAll(Handle(V3d_View) theView) { Bnd_Box aBndBox; int aNumberOfSubs = aSketch->numberOfSubs(); - double aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + double aXmin; + + double aYmin; + + double aZmin; + + double aXmax; + + double aYmax; + + double aZmax; for (int i = 0; i < aNumberOfSubs; i++) { FeaturePtr aFeature = aSketch->subFeature(i); if (aDisplayer->isVisible(aFeature)) { diff --git a/src/PartSet/PartSet_SketcherReentrantMgr.cpp b/src/PartSet/PartSet_SketcherReentrantMgr.cpp index 972c2735c..ef05d7106 100644 --- a/src/PartSet/PartSet_SketcherReentrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReentrantMgr.cpp @@ -156,7 +156,9 @@ bool PartSet_SketcherReentrantMgr::processMouseMoved( myWorkshop->currentOperation()->propertyPanel(); FeaturePtr aCurrentFeature = aFOperation->feature(); - bool isLineFeature = false, isReentrantArcFeature = false; + bool isLineFeature = false; + + bool isReentrantArcFeature = false; std::string anAttributeOnStart; if (aCurrentFeature->getKind() == SketchPlugin_Line::ID()) { anAttributeOnStart = SketchPlugin_Line::START_ID(); @@ -436,8 +438,9 @@ void PartSet_SketcherReentrantMgr::onVertexSelected() { ModuleBase_IPropertyPanel *aPanel = anOperation->propertyPanel(); ModuleBase_ModelWidget *anActiveWidget = aPanel->activeWidget(); const QList &aWidgets = aPanel->modelWidgets(); - QList::const_iterator anIt = aWidgets.begin(), - aLast = aWidgets.end(); + QList::const_iterator anIt = aWidgets.begin(); + + QList::const_iterator aLast = aWidgets.end(); bool aFoundWidget = false; bool aFoundObligatory = false; for (; anIt != aLast && !aFoundObligatory; anIt++) { diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index e5e873adb..a6e6ac351 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -113,17 +113,29 @@ gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, if (theView.IsNull()) return gp_Pnt(); - Standard_Real XAt, YAt, ZAt; + Standard_Real XAt; + + Standard_Real YAt; + + Standard_Real ZAt; theView->At(XAt, YAt, ZAt); gp_Pnt AtPoint(XAt, YAt, ZAt); - double aX, aY, aZ; + double aX; + + double aY; + + double aZ; theView->Proj(aX, aY, aZ); gp_Dir EyeDir(aX, aY, aZ); EyeDir.Reverse(); gp_Pln PlaneOfTheView = gp_Pln(AtPoint, EyeDir); - Standard_Real X, Y, Z; + Standard_Real X; + + Standard_Real Y; + + Standard_Real Z; theView->Convert(thePoint.x(), thePoint.y(), X, Y, Z); gp_Pnt ConvertedPoint(X, Y, Z); @@ -158,7 +170,17 @@ void PartSet_Tools::convertTo2D(const gp_Pnt &thePoint, FeaturePtr theSketch, gp_Vec aVec(anOriginPnt, thePoint); if (!theView.IsNull()) { - Standard_Real XEye, YEye, ZEye, XAt, YAt, ZAt; + Standard_Real XEye; + + Standard_Real YEye; + + Standard_Real ZEye; + + Standard_Real XAt; + + Standard_Real YAt; + + Standard_Real ZAt; theView->Eye(XEye, YEye, ZEye); theView->At(XAt, YAt, ZAt); @@ -452,7 +474,9 @@ PartSet_Tools::findShapeBy2DPoint(const AttributePtr &theAttribute, ModelAPI_Feature::feature(theAttribute->owner()); // 2.1 get visualized results of the feature const std::list &aResList = anAttributeFeature->results(); - auto anIt = aResList.begin(), aLast = aResList.end(); + auto anIt = aResList.begin(); + + auto aLast = aResList.end(); for (; anIt != aLast; anIt++) { AISObjectPtr aAISObj = aDisplayer->getAISObject(*anIt); if (aAISObj.get() != nullptr) { @@ -512,7 +536,9 @@ PartSet_Tools::getPnt2d(QMouseEvent *theEvent, const FeaturePtr &theSketch) { gp_Pnt aPnt = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView()); - double aX, anY; + double aX; + + double anY; Handle(V3d_View) aView = theWindow->v3dView(); PartSet_Tools::convertTo2D(aPnt, theSketch, aView, aX, anY); @@ -529,7 +555,9 @@ PartSet_Tools::getPnt2d(const Handle(V3d_View) & theView, if (!aVertex.IsNull()) { // the case when the point is taken from the existing vertex gp_Pnt aPoint = BRep_Tool::Pnt(aVertex); - double aX, aY; + double aX; + + double aY; PartSet_Tools::convertTo2D(aPoint, theSketch, theView, aX, aY); aPoint2D.reset(new GeomAPI_Pnt2d(aX, aY)); } @@ -753,8 +781,9 @@ std::pair PartSet_Tools::findAttributeBy2dPoint( anAttiributes.insert(anAttiributes.end(), anArrays.begin(), anArrays.end()); - std::list::const_iterator anIt = anAttiributes.begin(), - aLast = anAttiributes.end(); + std::list::const_iterator anIt = anAttiributes.begin(); + + std::list::const_iterator aLast = anAttiributes.end(); double aMinDistance = 1.e-6; // searching for point with minimal distance and < 1.e-6 for (; anIt != aLast && !anAttribute; anIt++) { @@ -908,7 +937,11 @@ void PartSet_Tools::getDefaultColor(ObjectPtr theObject, std::vector &theColor) { theColor.clear(); // get default color from the preferences manager for the given result - std::string aSection, aName, aDefault; + std::string aSection; + + std::string aName; + + std::string aDefault; theObject->colorConfigInfo(aSection, aName, aDefault); if (!aSection.empty() && !aName.empty()) { theColor = Config_PropManager::color(aSection, aName); diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index 5b7790b4d..435726044 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -1066,7 +1066,9 @@ QTreeNodesList PartSet_PartRootNode::objectsDeleted(const DocumentPtr &theDoc, ////////////////////////////////////////////////////////////////////////////////// void PartSet_ObjectFolderNode::update() { - int aFirst = -1, aLast = -1; + int aFirst = -1; + + int aLast = -1; PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast); if ((aFirst == -1) || (aLast == -1)) { deleteChildren(); @@ -1124,7 +1126,9 @@ void PartSet_ObjectFolderNode::update() { QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList & /*theObjects*/) { QTreeNodesList aResult; - int aFirst = -1, aLast = -1; + int aFirst = -1; + + int aLast = -1; PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast); if ((aFirst == -1) || (aLast == -1)) { return aResult; @@ -1159,7 +1163,9 @@ QTreeNodesList PartSet_ObjectFolderNode::objectsDeleted(const DocumentPtr & /*theDoc*/, const QString & /*theGroup*/) { QTreeNodesList aResult; - int aFirst = -1, aLast = -1; + int aFirst = -1; + + int aLast = -1; PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast); if ((aFirst == -1) || (aLast == -1)) { return aResult; diff --git a/src/PartSet/PartSet_Validators.cpp b/src/PartSet/PartSet_Validators.cpp index 29446b97d..cffe73fa3 100644 --- a/src/PartSet/PartSet_Validators.cpp +++ b/src/PartSet/PartSet_Validators.cpp @@ -91,7 +91,9 @@ int shapesNbEdges(const ModuleBase_ISelection *theSelection, if (aShape->shapeType() == GeomAPI_Shape::EDGE) { const auto &aTDShape = aShape->impl(); TopoDS_Edge aEdge = TopoDS::Edge(aTDShape); - Standard_Real aStart, aEnd; + Standard_Real aStart; + + Standard_Real aEnd; Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge, aStart, aEnd); GeomAdaptor_Curve aAdaptor(aCurve); theEdges[(int)aAdaptor.GetType()] += 1; @@ -762,8 +764,9 @@ bool PartSet_CoincidentAttr::isValid(const AttributePtr &theAttribute, } // if there is no coincidence then it is not valid if (aCoinList.size() > 0) { - QList::const_iterator anIt = aCoinsideLines.begin(), - aLast = aCoinsideLines.end(); + QList::const_iterator anIt = aCoinsideLines.begin(); + + QList::const_iterator aLast = aCoinsideLines.end(); bool aValid = false; for (; anIt != aLast && !aValid; anIt++) { aValid = *anIt == aOtherFea; diff --git a/src/PartSet/PartSet_WidgetBSplinePoints.cpp b/src/PartSet/PartSet_WidgetBSplinePoints.cpp index 3fa0d7668..7aa68c64e 100644 --- a/src/PartSet/PartSet_WidgetBSplinePoints.cpp +++ b/src/PartSet/PartSet_WidgetBSplinePoints.cpp @@ -203,8 +203,11 @@ bool PartSet_WidgetBSplinePoints::isValidSelectionForAttribute_( bool aValid = false; // stores the current values of the widget attribute - bool isFlushesActived, isAttributeSetInitializedBlocked, - isAttributeSendUpdatedBlocked; + bool isFlushesActived; + + bool isAttributeSetInitializedBlocked; + + bool isAttributeSendUpdatedBlocked; AttributeRefAttrListPtr aRefAttrList = attributeRefAttrList(); ModuleBase_WidgetValidated::blockFeatureAttribute( @@ -555,7 +558,9 @@ void PartSet_WidgetBSplinePoints::mouseMoved(ModuleBase_IViewWindow *theWindow, gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView()); - double aX = 0, aY = 0; + double aX = 0; + + double aY = 0; PartSet_Tools::convertTo2D(aPoint, mySketch, theWindow->v3dView(), aX, aY); if (myState != ModifiedInViewer) storeCurentValue(); diff --git a/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp b/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp index f811b9190..c64bd4fc7 100644 --- a/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp +++ b/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp @@ -269,8 +269,8 @@ bool PartSet_WidgetFeaturePointSelector::setSelectionCustom( //******************************************************************** void PartSet_WidgetFeaturePointSelector::setPreSelection( - const ModuleBase_ViewerPrsPtr &thePreSelected, - ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent) { + const ModuleBase_ViewerPrsPtr & /*thePreSelected*/, + ModuleBase_IViewWindow * /*theWnd*/, QMouseEvent * /*theEvent*/) { // the method is empty because firstly by starging of the feature there is no // selection of sub-segments in the viewer, secondly preselection of restart // operation is processed by special reentrant message sent by the feature diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index eae8338fa..d276664a3 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -195,8 +195,11 @@ bool PartSet_WidgetPoint2D::isValidSelectionForAttribute_( bool aValid = false; // stores the current values of the widget attribute - bool isFlushesActived, isAttributeSetInitializedBlocked, - isAttributeSendUpdatedBlocked; + bool isFlushesActived; + + bool isAttributeSetInitializedBlocked; + + bool isAttributeSendUpdatedBlocked; AttributeRefAttrPtr aRefAttr = attributeRefAttr(); ModuleBase_WidgetValidated::blockFeatureAttribute( @@ -433,7 +436,7 @@ void PartSet_WidgetPoint2D::activateCustom() { } } -void PartSet_WidgetPoint2D::setHighlighted(bool isHighlighted) {} +void PartSet_WidgetPoint2D::setHighlighted(bool /*isHighlighted*/) {} void PartSet_WidgetPoint2D::deactivate() { // the value of the control should be stored to model if it was not @@ -555,7 +558,9 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow *theWindow, aFirstValue = myPreSelected; } - double aX = 0, aY = 0; + double aX = 0; + + double aY = 0; bool aHasPoint = false; if (aFirstValue.get()) { GeomShapePtr aShape = aFirstValue->shape(); @@ -648,7 +653,9 @@ void PartSet_WidgetPoint2D::processSelection( } } else { if (!isFeatureContainsPoint(myFeature, theX, theY)) { - double aX = 0, aY = 0; + double aX = 0; + + double aY = 0; bool anOrphanPoint = isOrphanPoint(aSelectedFeature, mySketch, aX, aY); // do not set a coincidence constraint in the attribute if the feature // contains a point with the same coordinates. It is important for line @@ -746,7 +753,9 @@ void PartSet_WidgetPoint2D::mouseMoved(ModuleBase_IViewWindow *theWindow, gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView()); - double aX = 0, aY = 0; + double aX = 0; + + double aY = 0; PartSet_Tools::convertTo2D(aPoint, mySketch, theWindow->v3dView(), aX, aY); if (myState != ModifiedInViewer) storeCurentValue(); @@ -857,8 +866,9 @@ bool PartSet_WidgetPoint2D::isOrphanPoint( PartSet_Tools::findCoincidences( aCoincidence, aCoinsideLines, aCoins, SketchPlugin_ConstraintCoincidence::ENTITY_B(), anIsAttributes); - QList::const_iterator anIt = aCoinsideLines.begin(), - aLast = aCoinsideLines.end(); + QList::const_iterator anIt = aCoinsideLines.begin(); + + QList::const_iterator aLast = aCoinsideLines.end(); for (; anIt != aLast && anOrphanPoint; anIt++) { anOrphanPoint = (*anIt)->getKind() != SketchPlugin_Line::ID(); } @@ -948,8 +958,9 @@ PartSet_WidgetPoint2D::findFirstEqualPointInArgumentFeatures( std::list anAttributes = theFeature->data()->attributes(ModelAPI_AttributeRefList::typeId()); - std::list::const_iterator anIt = anAttributes.begin(), - aLast = anAttributes.end(); + std::list::const_iterator anIt = anAttributes.begin(); + + std::list::const_iterator aLast = anAttributes.end(); for (; anIt != aLast && !aFeaturePoint.get(); anIt++) { std::shared_ptr aCurSelList = std::dynamic_pointer_cast(*anIt); @@ -974,7 +985,11 @@ std::shared_ptr PartSet_WidgetPoint2D::findFirstEqualPoint( std::list> anAttiributes = theFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list>::const_iterator - anIt = anAttiributes.begin(), + + anIt = anAttiributes.begin(); + + std::list>::const_iterator + aLast = anAttiributes.end(); ModelAPI_ValidatorsFactory *aValidators = ModelAPI_Session::get()->validators(); @@ -1005,8 +1020,9 @@ PartSet_WidgetPoint2D::findFirstEqualPointInSketch( aData->attribute(SketchPlugin_Sketch::FEATURES_ID())); std::list aFeatures = aRefList->list(); - std::list::const_iterator anIt = aFeatures.begin(), - aLast = aFeatures.end(); + std::list::const_iterator anIt = aFeatures.begin(); + + std::list::const_iterator aLast = aFeatures.end(); std::list> anAttiributes; std::shared_ptr aFPoint; diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 2ce623077..6fc73263c 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -353,8 +353,9 @@ bool PartSet_WidgetSketchCreator::setSelection( bool aDone = false; if (!startSketchOperation(theValues)) { myIsCustomAttribute = true; - QList::const_iterator anIt = theValues.begin(), - aLast = theValues.end(); + QList::const_iterator anIt = theValues.begin(); + + QList::const_iterator aLast = theValues.end(); bool aProcessed = false; for (; anIt != aLast; anIt++) { ModuleBase_ViewerPrsPtr aValue = *anIt; @@ -385,8 +386,8 @@ bool PartSet_WidgetSketchCreator::processSelection() { } //******************************************************************** -void PartSet_WidgetSketchCreator::updateOnSelectionChanged(const bool theDone) { -} +void PartSet_WidgetSketchCreator::updateOnSelectionChanged( + const bool /*theDone*/) {} bool PartSet_WidgetSketchCreator::startSketchOperation( const QList &theValues) { diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index bd7e9cd6f..67bd43cd9 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -198,7 +198,11 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel( aStates[PartSet_Tools::Expressions] = tr("Show existing expressions"); QMap::const_iterator - anIt = aStates.begin(), + + anIt = aStates.begin(); + + QMap::const_iterator + aLast = aStates.end(); for (; anIt != aLast; anIt++) { auto *aShowConstraints = new QCheckBox(anIt.value(), this); @@ -290,7 +294,11 @@ void PartSet_WidgetSketchLabel::onShowConstraint(bool theOn) { auto *aSenderCheckBox = qobject_cast(sender()); QMap::const_iterator - anIt = myShowConstraints.begin(), + + anIt = myShowConstraints.begin(); + + QMap::const_iterator + aLast = myShowConstraints.end(); PartSet_Tools::ConstraintVisibleState aState = PartSet_Tools::Geometrical; @@ -316,8 +324,9 @@ void PartSet_WidgetSketchLabel::blockAttribute( // to the method attributes or stored in the widget std::list anAttributes = myFeature->data()->attributes(""); - std::list::const_iterator anIt = anAttributes.begin(), - aLast = anAttributes.end(); + std::list::const_iterator anIt = anAttributes.begin(); + + std::list::const_iterator aLast = anAttributes.end(); QStringList aValues; for (; anIt != aLast; anIt++) { AttributePtr anAttribute = *anIt; @@ -713,7 +722,13 @@ std::shared_ptr PartSet_WidgetSketchLabel::setSketchPlane( std::shared_ptr thePlane) { // set plane parameters to feature std::shared_ptr aData = feature()->data(); - double anA, aB, aC, aD; + double anA; + + double aB; + + double aC; + + double aD; thePlane->coefficients(anA, aB, aC, aD); // calculate attributes of the sketch diff --git a/src/PartSetPlugin/PartSetPlugin_Part.h b/src/PartSetPlugin/PartSetPlugin_Part.h index 436f2b9b5..6cfc9d756 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.h +++ b/src/PartSetPlugin/PartSetPlugin_Part.h @@ -82,7 +82,8 @@ public: /// This method to inform that sub-feature is removed and must be removed from /// the internal data structures of the owner (the remove from the document /// will be done outside just after) - void removeFeature(std::shared_ptr theFeature) override {} + void + removeFeature(std::shared_ptr /*theFeature*/) override {} /// Use plugin manager for features creation PartSetPlugin_Part(); diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index bdc7e0723..c98df289c 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -1155,7 +1155,9 @@ void SHAPERGUI::updateToolbars(const QMap &theNewToolbars) { QtxActionToolMgr *aMgr = toolMgr(); QStringList aToolbars = theNewToolbars.keys(); - QIntList aCommands, aOldCmd; + QIntList aCommands; + + QIntList aOldCmd; int aToolbarId; QAction *aAction; int aActionId; diff --git a/src/SHAPERGUI/SHAPERGUI_DataModel.cpp b/src/SHAPERGUI/SHAPERGUI_DataModel.cpp index 4c5b0867d..c594fc854 100644 --- a/src/SHAPERGUI/SHAPERGUI_DataModel.cpp +++ b/src/SHAPERGUI/SHAPERGUI_DataModel.cpp @@ -67,7 +67,9 @@ bool SHAPERGUI_DataModel::open(const QString &thePath, CAM_Study *theStudy, QDir aDir(aTmpDir); QStringList aFiles = aDir.entryList(QDir::Files); - QStringList::const_iterator anIt = aFiles.begin(), aLast = aFiles.end(); + QStringList::const_iterator anIt = aFiles.begin(); + + QStringList::const_iterator aLast = aFiles.end(); for (; anIt != aLast; anIt++) { QString aFileName = *anIt; diff --git a/src/Selector/Selector_Algo.cpp b/src/Selector/Selector_Algo.cpp index b7dfb4c75..a66d24fba 100644 --- a/src/Selector/Selector_Algo.cpp +++ b/src/Selector/Selector_Algo.cpp @@ -352,15 +352,21 @@ bool Selector_Algo::sameGeometry(const TopoDS_Shape theShape1, if (!theShape1.IsNull() && !theShape2.IsNull() && theShape1.ShapeType() == theShape2.ShapeType()) { if (theShape1.ShapeType() == TopAbs_FACE) { // check surfaces - TopLoc_Location aLoc1, aLoc2; + TopLoc_Location aLoc1; + + TopLoc_Location aLoc2; TopoDS_Face aFace1 = TopoDS::Face(theShape1); Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(aFace1, aLoc1); TopoDS_Face aFace2 = TopoDS::Face(theShape2); Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(aFace2, aLoc2); return aSurf1 == aSurf2 && aLoc1.IsEqual(aLoc2); } else if (theShape1.ShapeType() == TopAbs_EDGE) { // check curves - TopLoc_Location aLoc1, aLoc2; - Standard_Real aFirst, aLast; + TopLoc_Location aLoc1; + + TopLoc_Location aLoc2; + Standard_Real aFirst; + + Standard_Real aLast; TopoDS_Edge anEdge1 = TopoDS::Edge(theShape1); Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(anEdge1, aLoc1, aFirst, aLast); diff --git a/src/Selector/Selector_FilterByNeighbors.cpp b/src/Selector/Selector_FilterByNeighbors.cpp index 09e6fb94d..93aa03139 100644 --- a/src/Selector/Selector_FilterByNeighbors.cpp +++ b/src/Selector/Selector_FilterByNeighbors.cpp @@ -380,7 +380,9 @@ TDF_Label Selector_FilterByNeighbors::restoreByName( if (aLinePos != std::wstring::npos) { std::wstring aContextName = aLastLevel.substr(aLinePos + 1); if (!aContextName.empty()) { - TDF_Label aThisContext, aValue; + TDF_Label aThisContext; + + TDF_Label aValue; if (theNameGenerator->restoreContext(aContextName, aThisContext, aValue)) { if (!aThisContext.IsNull()) diff --git a/src/Selector/Selector_Modify.cpp b/src/Selector/Selector_Modify.cpp index 35a611587..1d65ecb0f 100644 --- a/src/Selector/Selector_Modify.cpp +++ b/src/Selector/Selector_Modify.cpp @@ -286,7 +286,9 @@ Selector_Modify::restoreByName(std::wstring theName, myRecomputeWeakIndex = aFoundOldWeak == 0; continue; } - TDF_Label aSubContext, aValue; + TDF_Label aSubContext; + + TDF_Label aValue; if (!theNameGenerator->restoreContext(aSubStr, aSubContext, aValue)) return TDF_Label(); // can not restore if (aSubContext.IsNull() || diff --git a/src/SketchAPI/SketchAPI_BSpline.cpp b/src/SketchAPI/SketchAPI_BSpline.cpp index 7e23ffdf8..0e992a2a1 100644 --- a/src/SketchAPI/SketchAPI_BSpline.cpp +++ b/src/SketchAPI/SketchAPI_BSpline.cpp @@ -367,7 +367,9 @@ static void collectAuxiliaryFeatures(FeaturePtr theBSpline, AttributePtr anAttrB = aRefAttrB->attr(); AttributeIntegerPtr aPoleIndex; - FeaturePtr aPoint, aLine; + FeaturePtr aPoint; + + FeaturePtr aLine; if (anAttrA && anAttrA->attributeType() == GeomDataAPI_Point2DArray::typeId()) { aPoleIndex = anOwner->integer( @@ -403,7 +405,11 @@ void SketchAPI_BSpline::dump(ModelHighAPI_Dumper &theDumper) const { << ")" << std::endl; } else { // check if some B-spline parameters are default and should not be dumped - bool isDefaultDegree, isDefaultWeights, isDefaultKnotsMults; + bool isDefaultDegree; + + bool isDefaultWeights; + + bool isDefaultKnotsMults; checkDefaultParameters(isDefaultDegree, isDefaultWeights, isDefaultKnotsMults); @@ -424,7 +430,9 @@ void SketchAPI_BSpline::dump(ModelHighAPI_Dumper &theDumper) const { SketchAPI_SketchEntity::dump(theDumper); // dump control polygon - std::map anAuxPoles, anAuxSegments; + std::map anAuxPoles; + + std::map anAuxSegments; collectAuxiliaryFeatures(aBase, anAuxPoles, anAuxSegments); if (!anAuxPoles.empty()) @@ -451,7 +459,9 @@ void SketchAPI_BSpline::dumpControlPolygon( theDumper << "["; bool isFirst = true; // dump features and split them to auxiliary and regular - std::set aRegular, anAuxiliary; + std::set aRegular; + + std::set anAuxiliary; for (const auto &theAuxFeature : theAuxFeatures) { if (!isFirst) theDumper << ", "; @@ -501,7 +511,9 @@ bool SketchAPI_BSpline::insertPole(const int theIndex, weights()->setValue(anIndex, theWeight.value()); // update coordinates of points of control polygon - std::map aPoints, aLines; + std::map aPoints; + + std::map aLines; collectAuxiliaryFeatures(feature(), aPoints, aLines); auto aFound = aPoints.find(anIndex); if (aFound != aPoints.end()) diff --git a/src/SketchAPI/SketchAPI_ConstraintAngle.cpp b/src/SketchAPI/SketchAPI_ConstraintAngle.cpp index 99eb090d5..011c59cbc 100644 --- a/src/SketchAPI/SketchAPI_ConstraintAngle.cpp +++ b/src/SketchAPI/SketchAPI_ConstraintAngle.cpp @@ -97,7 +97,11 @@ static std::string angleTypeToString(FeaturePtr theFeature) { static const std::string THE_ANGLE_SUPPLEMENTARY("Supplementary"); static const std::string THE_ANGLE_BACKWARD("Backward"); - double anAngleDirect, anAngleComplmentary, anAngleBackward; + double anAngleDirect; + + double anAngleComplmentary; + + double anAngleBackward; calculatePossibleValuesOfAngle(theFeature, anAngleDirect, anAngleComplmentary, anAngleBackward); diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index 3af9d3b81..8e42e8e5e 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -289,7 +289,9 @@ void SketchPlugin_Arc::attributeChanged(const std::string &theID) { anAngle = 360; } else { GeomAPI_Circ2d aCircleForArc(aCenterAttr->pnt(), aStartAttr->pnt()); - double aStartParam, anEndParam; + double aStartParam; + + double anEndParam; aCircleForArc.parameter(aStartAttr->pnt(), paramTolerance, aStartParam); aCircleForArc.parameter(anEndAttr->pnt(), paramTolerance, anEndParam); anAngle = (anEndParam - aStartParam) / PI * 180.0; diff --git a/src/SketchPlugin/SketchPlugin_BSplineBase.cpp b/src/SketchPlugin/SketchPlugin_BSplineBase.cpp index 4c3eb5cd9..8a082768b 100644 --- a/src/SketchPlugin/SketchPlugin_BSplineBase.cpp +++ b/src/SketchPlugin/SketchPlugin_BSplineBase.cpp @@ -144,7 +144,9 @@ bool SketchPlugin_BSplineBase::addPole(const int theAfter) { // find internal coincidences applied to the poles with greater indices std::list aCoincidentPoleIndex; - std::map aControlPoles, aControlSegments; + std::map aControlPoles; + + std::map aControlSegments; bool hasAuxSegment = false; const std::set &aRefs = data()->refsToMe(); for (const auto &aRef : aRefs) { diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index d27c5961d..dfc692c33 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -141,7 +141,9 @@ double SketchPlugin_ConstraintDistance::calculateCurrentDistance() { SketcherPrs_Tools::getFeaturePoint( aData, SketchPlugin_Constraint::ENTITY_B(), aPlane); - GeomPnt2dPtr aGeomPntA, aGeomPntB; + GeomPnt2dPtr aGeomPntA; + + GeomPnt2dPtr aGeomPntB; GeomLine2dPtr aLine; if (aPointA.get() && aPointB.get()) { // both points aGeomPntA = aPointA->pnt(); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index b9ea091d3..c9a4df152 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -106,8 +106,12 @@ bool SketchPlugin_ConstraintLength::compute(const std::string &theAttributeId) { if (theAttributeId != SketchPlugin_Constraint::FLYOUT_VALUE_PNT()) return false; - std::shared_ptr aPoint1, aPoint2; - std::shared_ptr aStartPoint, anEndPoint; + std::shared_ptr aPoint1; + + std::shared_ptr aPoint2; + std::shared_ptr aStartPoint; + + std::shared_ptr anEndPoint; if (!getPoints(aPoint1, aPoint2, aStartPoint, anEndPoint)) return false; @@ -129,8 +133,12 @@ bool SketchPlugin_ConstraintLength::compute(const std::string &theAttributeId) { bool SketchPlugin_ConstraintLength::computeLenghtValue(double &theValue) { bool aResult = false; - std::shared_ptr aPoint1, aPoint2; - std::shared_ptr aStartPoint, anEndPoint; + std::shared_ptr aPoint1; + + std::shared_ptr aPoint2; + std::shared_ptr aStartPoint; + + std::shared_ptr anEndPoint; if (getPoints(aPoint1, aPoint2, aStartPoint, anEndPoint)) { theValue = aPoint1->distance(aPoint2); aResult = true; diff --git a/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp b/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp index 1933d5097..75be3ccd7 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp @@ -129,7 +129,9 @@ void SketchPlugin_ConstraintMirror::execute() { aMirrorIter = aMirroredList.begin(); int indFirstWrong = 0; // index of element starts difference in the lists std::set anInvalidInd; // list of indices of removed features - std::shared_ptr aFeatureIn, aFeatureOut; + std::shared_ptr aFeatureIn; + + std::shared_ptr aFeatureOut; for (; anInitIter != anInitialList.end(); anInitIter++, indFirstWrong++) { // Add features and store indices of objects to remove aFeatureIn = std::dynamic_pointer_cast(*anInitIter); diff --git a/src/SketchPlugin/SketchPlugin_EllipticArc.cpp b/src/SketchPlugin/SketchPlugin_EllipticArc.cpp index f7f7f87d8..9ec5da9f5 100644 --- a/src/SketchPlugin/SketchPlugin_EllipticArc.cpp +++ b/src/SketchPlugin/SketchPlugin_EllipticArc.cpp @@ -138,7 +138,11 @@ void SketchPlugin_EllipticArc::attributeChanged(const std::string &theID) { real(MAJOR_RADIUS_ID())->setValue(anEllipse->majorRadius()); real(MINOR_RADIUS_ID())->setValue(anEllipse->minorRadius()); - double aStartParam, aMidParam, aEndParam; + double aStartParam; + + double aMidParam; + + double aEndParam; anEllipse->parameter(anEdge->firstPoint(), tolerance, aStartParam); anEllipse->parameter(anEdge->middlePoint(), tolerance, aMidParam); anEllipse->parameter(anEdge->lastPoint(), tolerance, aEndParam); @@ -196,7 +200,9 @@ bool SketchPlugin_EllipticArc::fillCharacteristicPoints() { GeomPnt2dPtr aFocus2d = aFocusAttr->pnt(); GeomPnt2dPtr aStart2d = aStartPointAttr->pnt(); - double aMajorRadius = 0.0, aMinorRadius = 0.0; + double aMajorRadius = 0.0; + + double aMinorRadius = 0.0; calculateRadii(aCenter2d, aFocus2d, aStart2d, aMajorRadius, aMinorRadius); if (aMinorRadius < tolerance * aMajorRadius) return false; @@ -235,7 +241,9 @@ bool SketchPlugin_EllipticArc::fillCharacteristicPoints() { GeomPnt2dPtr anEnd = aEndPointAttr->pnt(); std::shared_ptr aProjection = anEllipseForArc->project(anEnd); - double aParamStart = 0.0, aParamEnd = 0.0; + double aParamStart = 0.0; + + double aParamEnd = 0.0; if (aProjection && anEnd->distance(aProjection) <= tolerance && anEllipseForArc->parameter(anEnd, paramTolerance, aParamEnd)) { // do not recalculate REVERSED flag if the arc is not consistent diff --git a/src/SketchPlugin/SketchPlugin_Fillet.cpp b/src/SketchPlugin/SketchPlugin_Fillet.cpp index 87a8d4c11..fb0c2dda6 100644 --- a/src/SketchPlugin/SketchPlugin_Fillet.cpp +++ b/src/SketchPlugin/SketchPlugin_Fillet.cpp @@ -219,7 +219,9 @@ bool SketchPlugin_Fillet::calculateFilletParameters() { return false; Events_InfoMessage anError; - FeaturePtr anEdge1, anEdge2; + FeaturePtr anEdge1; + + FeaturePtr anEdge2; if (!SketchPlugin_FilletVertexValidator::isValidVertex(aPointRefAttr, anError, anEdge1, anEdge2)) { setError(anError.messageString()); @@ -236,7 +238,9 @@ bool SketchPlugin_Fillet::calculateFilletParameters() { // First pair of points relate to first feature, second pair - to second. std::shared_ptr aStartEndPnt[aNbFeatures * 2]; for (int i = 0; i < aNbFeatures; i++) { - std::string aStartAttr, aEndAttr; + std::string aStartAttr; + + std::string aEndAttr; if (myBaseFeatures[i]->getKind() == SketchPlugin_Line::ID()) { aStartAttr = SketchPlugin_Line::START_ID(); aEndAttr = SketchPlugin_Line::END_ID(); diff --git a/src/SketchPlugin/SketchPlugin_MacroArc.cpp b/src/SketchPlugin/SketchPlugin_MacroArc.cpp index f6e6d1af0..864649a0b 100644 --- a/src/SketchPlugin/SketchPlugin_MacroArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroArc.cpp @@ -235,7 +235,9 @@ void SketchPlugin_MacroArc::attributeChanged(const std::string &theID) { anAngle = 360; } else { GeomAPI_Circ2d aCircleForArc(myCenter, myStart); - double aStartParam, anEndParam; + double aStartParam; + + double anEndParam; aCircleForArc.parameter(myStart, paramTolerance, aStartParam); aCircleForArc.parameter(myEnd, paramTolerance, anEndParam); anAngle = (anEndParam - aStartParam) / PI * 180.0; @@ -635,7 +637,9 @@ void SketchPlugin_MacroArc::recalculateReversedFlagByPassed( std::shared_ptr aPassed = theCurrentCircular.project(aPassedAttr->pnt()); - double aEndParam, aPassedParam; + double aEndParam; + + double aPassedParam; theCurrentCircular.parameter(myEnd, paramTolerance, aEndParam); theCurrentCircular.parameter(aPassed, paramTolerance, aPassedParam); diff --git a/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp b/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp index 7fe467949..3a67a3b65 100644 --- a/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp @@ -230,7 +230,9 @@ std::string SketchPlugin_MacroEllipticArc::processEvent( FeaturePtr SketchPlugin_MacroEllipticArc::createEllipticArcFeature() { GeomShapePtr anArc = getArcShape(); GeomEllipsePtr anEllipse; - GeomPointPtr aStartPoint, aEndPoint; + GeomPointPtr aStartPoint; + + GeomPointPtr aEndPoint; if (anArc->isEdge()) { GeomEdgePtr anArcEdge = anArc->edge(); aStartPoint = anArcEdge->firstPoint(); @@ -381,7 +383,9 @@ GeomShapePtr SketchPlugin_MacroEllipticArc::getArcShape() { aSketch->attribute(SketchPlugin_Sketch::NORM_ID())); GeomDirPtr aNormal(new GeomAPI_Dir(aNDir->x(), aNDir->y(), aNDir->z())); - GeomPointPtr aStart, anEnd; + GeomPointPtr aStart; + + GeomPointPtr anEnd; if (myStartPnt) aStart = aSketch->to3D(myStartPnt->x(), myStartPnt->y()); if (myEndPnt) diff --git a/src/SketchPlugin/SketchPlugin_Offset.cpp b/src/SketchPlugin/SketchPlugin_Offset.cpp index 2e2a78ed0..51e6e257b 100644 --- a/src/SketchPlugin/SketchPlugin_Offset.cpp +++ b/src/SketchPlugin/SketchPlugin_Offset.cpp @@ -216,7 +216,9 @@ void SketchPlugin_Offset::execute() { continue; // 5.a. End points (if any) - std::shared_ptr aStartPoint, anEndPoint; + std::shared_ptr aStartPoint; + + std::shared_ptr anEndPoint; SketchPlugin_SegmentationTools::getFeaturePoints(aFeature, aStartPoint, anEndPoint); @@ -341,7 +343,9 @@ bool SketchPlugin_Offset::findWireOneWay( // Empty set means all sketch edges. if (isInSet || theEdgesSet.empty()) { // Condition 4: consider only features with two end points - std::shared_ptr aP1, aP2; + std::shared_ptr aP1; + + std::shared_ptr aP2; SketchPlugin_SegmentationTools::getFeaturePoints(aCoincFeature, aP1, aP2); if (aP1 && aP2) { @@ -385,7 +389,9 @@ bool SketchPlugin_Offset::findWireOneWay( theProcessedEdgesSet.insert(aNextEdgeFeature); // 4. Which end of aNextEdgeFeature we need to proceed - std::shared_ptr aP1, aP2; + std::shared_ptr aP1; + + std::shared_ptr aP2; SketchPlugin_SegmentationTools::getFeaturePoints(aNextEdgeFeature, aP1, aP2); if (aP2->pnt()->isEqual(theEndPoint->pnt())) { // reversed @@ -467,7 +473,9 @@ void SketchPlugin_Offset::addToSketch(const ListOfMakeShape &theOffsetAlgos) { // update lists of base shapes and of offset shapes int aBaseListSize = aBaseRefList->size(); int anOffsetListSize = anOffsetRefList->size(); - int aBaseListIndex = 0, anOffsetListIndex = 0; + int aBaseListIndex = 0; + + int anOffsetListIndex = 0; std::list anOffsetBaseBackRefs; std::set aProcessedOffsets; for (auto &aSIt : aSelectedList) { @@ -583,7 +591,9 @@ void SketchPlugin_Offset::updateExistentOrCreateNew( std::shared_ptr aResEdge(new GeomAPI_Edge(theShape)); - std::shared_ptr aFP, aLP; + std::shared_ptr aFP; + + std::shared_ptr aLP; std::shared_ptr aFP3d = aResEdge->firstPoint(); std::shared_ptr aLP3d = aResEdge->lastPoint(); if (aFP3d && aLP3d) { @@ -829,7 +839,9 @@ bool SketchPlugin_Offset::findWires() { aProcessedEdgesSet.insert(aFeature); // End points (if any) - std::shared_ptr aStartPoint, anEndPoint; + std::shared_ptr aStartPoint; + + std::shared_ptr anEndPoint; SketchPlugin_SegmentationTools::getFeaturePoints(aFeature, aStartPoint, anEndPoint); @@ -937,7 +949,9 @@ void SketchPlugin_Offset::makeFillet( anIt->second.end()); GeomEdgePtr anEdge1(new GeomAPI_Edge(anEdges.front())); GeomEdgePtr anEdge2(new GeomAPI_Edge(anEdges.back())); - GeomVertexPtr V1, V2; + GeomVertexPtr V1; + + GeomVertexPtr V2; anEdge1->vertices(V1, V2); if (V1->isEqual(aFailedVertex)) V1 = V2; diff --git a/src/SketchPlugin/SketchPlugin_OverConstraintsResolver.cpp b/src/SketchPlugin/SketchPlugin_OverConstraintsResolver.cpp index a89b77ab0..8ef245dac 100644 --- a/src/SketchPlugin/SketchPlugin_OverConstraintsResolver.cpp +++ b/src/SketchPlugin/SketchPlugin_OverConstraintsResolver.cpp @@ -56,7 +56,9 @@ bool SketchPlugin_OverConstraintsResolver::perform() { } bool SketchPlugin_OverConstraintsResolver::checkHorizontalOrVerticalConflict() { - auto anIt = myConstraints.begin(), aLast = myConstraints.end(); + auto anIt = myConstraints.begin(); + + auto aLast = myConstraints.end(); bool isHVConstraint = false; FeaturePtr aFeature; for (; anIt != aLast; anIt++) { @@ -79,7 +81,9 @@ bool SketchPlugin_OverConstraintsResolver::checkHorizontalOrVerticalConflict() { bool SketchPlugin_OverConstraintsResolver::checkArcsAboutTangentialConflict() { bool isConflictsFound = false; - auto anIt = myConstraints.begin(), aLast = myConstraints.end(); + auto anIt = myConstraints.begin(); + + auto aLast = myConstraints.end(); for (; anIt != aLast; anIt++) { ObjectPtr anObject = *anIt; ConstraintPtr aConstain = diff --git a/src/SketchPlugin/SketchPlugin_Sketch.cpp b/src/SketchPlugin/SketchPlugin_Sketch.cpp index 605cf5cdb..dfc57d635 100644 --- a/src/SketchPlugin/SketchPlugin_Sketch.cpp +++ b/src/SketchPlugin/SketchPlugin_Sketch.cpp @@ -106,8 +106,9 @@ void SketchPlugin_Sketch::execute() { if (aFeatures.empty()) // actually, this must be avoided by the validators return; - std::list::const_iterator anIt = aFeatures.begin(), - aLast = aFeatures.end(); + std::list::const_iterator anIt = aFeatures.begin(); + + std::list::const_iterator aLast = aFeatures.end(); std::shared_ptr aFeature; std::list> aFeaturesPreview; for (; anIt != aLast; anIt++) { @@ -344,7 +345,13 @@ void SketchPlugin_Sketch::attributeChanged(const std::string &theID) { if (aFace.get()) { std::shared_ptr aPlane = aFace->getPlane(); if (aPlane.get()) { - double anA, aB, aC, aD; + double anA; + + double aB; + + double aC; + + double aD; aPlane->coefficients(anA, aB, aC, aD); // calculate attributes of the sketch @@ -631,7 +638,9 @@ GeomShapePtr axisOnNewPlane(ObjectPtr theAxis, GeomAx3Ptr theOldPlane, GeomLinePtr anAxisLine = anAxisEdge->line(); GeomDirPtr anAxisDir = anAxisLine->direction(); - double aFirstParam, aLastParam; + double aFirstParam; + + double aLastParam; anAxisEdge->getRange(aFirstParam, aLastParam); if (theOldPlane->dirX()->isParallel(anAxisDir)) diff --git a/src/SketchPlugin/SketchPlugin_Split.cpp b/src/SketchPlugin/SketchPlugin_Split.cpp index a7537113f..556d56141 100644 --- a/src/SketchPlugin/SketchPlugin_Split.cpp +++ b/src/SketchPlugin/SketchPlugin_Split.cpp @@ -140,7 +140,9 @@ void SketchPlugin_Split::execute() { // Find feature constraints FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObject); ResultPtr aBaseFeatureResult = aBaseFeature->lastResult(); - std::set aFeaturesToDelete, aFeaturesToUpdate; + std::set aFeaturesToDelete; + + std::set aFeaturesToUpdate; // std::map aTangentFeatures; std::map aCoincidenceToFeature; @@ -239,11 +241,15 @@ void SketchPlugin_Split::execute() { keepCurrentFeature(); std::string aFeatureKind = aBaseFeature->getKind(); - FeaturePtr aSplitFeature, anAfterFeature; + FeaturePtr aSplitFeature; + + FeaturePtr anAfterFeature; std::set aFurtherCoincidences; std::set aCreatedFeatures; std::set> aModifiedAttributes; - FeaturePtr aReplacingFeature, aNewFeature; + FeaturePtr aReplacingFeature; + + FeaturePtr aNewFeature; if (aFeatureKind == SketchPlugin_Line::ID()) aNewFeature = splitLine(aSplitFeature, aBaseFeature, anAfterFeature, @@ -634,7 +640,9 @@ void SketchPlugin_Split::updateCoincidenceConstraintsToFeature( // we should build coincidence constraints to end of the split feature std::set> aNewCoincidencesToSplitFeature; - AttributePoint2DPtr aStartPointAttr, anEndPointAttr; + AttributePoint2DPtr aStartPointAttr; + + AttributePoint2DPtr anEndPointAttr; SketchPlugin_SegmentationTools::getFeaturePoints( theSplitFeature, aStartPointAttr, anEndPointAttr); if (theFurtherCoincidences.find(aStartPointAttr) == @@ -644,8 +652,9 @@ void SketchPlugin_Split::updateCoincidenceConstraintsToFeature( theFurtherCoincidences.end()) aNewCoincidencesToSplitFeature.insert(anEndPointAttr); - auto aCIt = theCoincidenceToFeature.begin(), - aCLast = theCoincidenceToFeature.end(); + auto aCIt = theCoincidenceToFeature.begin(); + + auto aCLast = theCoincidenceToFeature.end(); #ifdef DEBUG_SPLIT std::cout << std::endl; std::cout << "Coincidences to feature(modified):" << std::endl; @@ -659,8 +668,9 @@ void SketchPlugin_Split::updateCoincidenceConstraintsToFeature( : SketchPlugin_Constraint::ENTITY_A(); AttributePoint2DPtr aCoincPoint = aCIt->second.second; - auto aFCIt = theFurtherCoincidences.begin(), - aFCLast = theFurtherCoincidences.end(); + auto aFCIt = theFurtherCoincidences.begin(); + + auto aFCLast = theFurtherCoincidences.end(); std::shared_ptr aCoincPnt = aCoincPoint->pnt(); AttributePoint2DPtr aFeaturePointAttribute; for (; aFCIt != aFCLast && !aFeaturePointAttribute.get(); aFCIt++) { @@ -676,8 +686,9 @@ void SketchPlugin_Split::updateCoincidenceConstraintsToFeature( aCoincFeature->refattr(aSecondAttribute)->attr()); theFeaturesToDelete.insert(aCIt->first); // create new coincidences to split feature points - auto aSFIt = aNewCoincidencesToSplitFeature.begin(), - aSFLast = aNewCoincidencesToSplitFeature.end(); + auto aSFIt = aNewCoincidencesToSplitFeature.begin(); + + auto aSFLast = aNewCoincidencesToSplitFeature.end(); for (; aSFIt != aSFLast; aSFIt++) { AttributePoint2DPtr aSFAttribute = *aSFIt; if (aCoincPnt->isEqual(aSFAttribute->pnt())) { @@ -715,7 +726,9 @@ void SketchPlugin_Split::updateCoincidenceConstraintsToFeature( void SketchPlugin_Split::updateRefFeatureConstraints( const ResultPtr &theFeatureBaseResult, const std::list &theRefsToFeature) { - auto anIt = theRefsToFeature.begin(), aLast = theRefsToFeature.end(); + auto anIt = theRefsToFeature.begin(); + + auto aLast = theRefsToFeature.end(); for (; anIt != aLast; anIt++) { AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(*anIt); @@ -743,7 +756,9 @@ FeaturePtr SketchPlugin_Split::splitLine( AttributePoint2DPtr aFirstPointAttrOfSplit = getPointAttribute(true); AttributePoint2DPtr aSecondPointAttrOfSplit = getPointAttribute(false); - AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase; + AttributePoint2DPtr aStartPointAttrOfBase; + + AttributePoint2DPtr anEndPointAttrOfBase; SketchPlugin_SegmentationTools::getFeaturePoints( aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase); @@ -889,7 +904,9 @@ FeaturePtr SketchPlugin_Split::splitArc( AttributePoint2DPtr aFirstPointAttrOfSplit = getPointAttribute(true); AttributePoint2DPtr aSecondPointAttrOfSplit = getPointAttribute(false); - AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase; + AttributePoint2DPtr aStartPointAttrOfBase; + + AttributePoint2DPtr anEndPointAttrOfBase; SketchPlugin_SegmentationTools::getFeaturePoints( aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase); if (!aStartPointAttrOfBase.get() && !anEndPointAttrOfBase.get()) { @@ -1040,7 +1057,9 @@ FeaturePtr SketchPlugin_Split::splitEllipticArc( AttributePoint2DPtr aFirstPointAttrOfSplit = getPointAttribute(true); AttributePoint2DPtr aSecondPointAttrOfSplit = getPointAttribute(false); - AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase; + AttributePoint2DPtr aStartPointAttrOfBase; + + AttributePoint2DPtr anEndPointAttrOfBase; SketchPlugin_SegmentationTools::getFeaturePoints( aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase); if (!aStartPointAttrOfBase.get() && !anEndPointAttrOfBase.get()) { @@ -1444,13 +1463,16 @@ SketchPlugin_Split::getPointAttribute(const bool isFirstAttribute) { std::shared_ptr aFirstPnt = anEdge->firstPoint(); std::shared_ptr aLastPnt = anEdge->lastPoint(); - std::shared_ptr aFirstPointAttr, aLastPointAttr; + std::shared_ptr aFirstPointAttr; + + std::shared_ptr aLastPointAttr; // find the points in feature attributes FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObject); std::list a2DPointAttributes = aBaseFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); - std::list::const_iterator anIt = a2DPointAttributes.begin(), - aLast = a2DPointAttributes.end(); + std::list::const_iterator anIt = a2DPointAttributes.begin(); + + std::list::const_iterator aLast = a2DPointAttributes.end(); for (; anIt != aLast; anIt++) { std::shared_ptr anAttributePoint = std::dynamic_pointer_cast(*anIt); @@ -1466,7 +1488,9 @@ SketchPlugin_Split::getPointAttribute(const bool isFirstAttribute) { // find the points in coincident features const GeomAlgoAPI_ShapeTools::PointToRefsMap &aRefAttributes = myCashedReferences.at(aBaseObject); - auto aRIt = aRefAttributes.begin(), aRLast = aRefAttributes.end(); + auto aRIt = aRefAttributes.begin(); + + auto aRLast = aRefAttributes.end(); for (; aRIt != aRLast; aRIt++) { const std::list &anAttributes = aRIt->second.first; GeomPointPtr aPoint = aRIt->first; diff --git a/src/SketchPlugin/SketchPlugin_Tools.cpp b/src/SketchPlugin/SketchPlugin_Tools.cpp index 3c05444ed..f4949bebb 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.cpp +++ b/src/SketchPlugin/SketchPlugin_Tools.cpp @@ -702,7 +702,9 @@ void SketchPlugin_SegmentationTools::getFeaturePoints( const FeaturePtr &theFeature, AttributePoint2DPtr &theStartPointAttr, AttributePoint2DPtr &theEndPointAttr) { std::string aFeatureKind = theFeature->getKind(); - std::string aStartAttributeName, anEndAttributeName; + std::string aStartAttributeName; + + std::string anEndAttributeName; if (aFeatureKind == SketchPlugin_Line::ID()) { aStartAttributeName = SketchPlugin_Line::START_ID(); anEndAttributeName = SketchPlugin_Line::END_ID(); @@ -734,8 +736,9 @@ void SketchPlugin_SegmentationTools::getRefAttributes( theFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::set aPointAttributesSet; - std::list::const_iterator aPIt = aPointAttributes.begin(), - aPLast = aPointAttributes.end(); + std::list::const_iterator aPIt = aPointAttributes.begin(); + + std::list::const_iterator aPLast = aPointAttributes.end(); for (; aPIt != aPLast; aPIt++) aPointAttributesSet.insert(*aPIt); @@ -803,7 +806,9 @@ GeomShapePtr SketchPlugin_SegmentationTools::getSubShape( std::shared_ptr aStartPoint; std::shared_ptr aSecondPoint; const std::set &aShapes = theCashedShapes[aBaseObject]; - auto anIt = aShapes.begin(), aLast = aShapes.end(); + auto anIt = aShapes.begin(); + + auto aLast = aShapes.end(); for (; anIt != aLast; anIt++) { GeomShapePtr aCurrentShape = *anIt; std::shared_ptr aProjectedPoint; @@ -912,8 +917,9 @@ void SketchPlugin_SegmentationTools::updateRefAttConstraints( std::cout << "updateRefAttConstraints" << std::endl; #endif - auto anIt = theModifiedAttributes.begin(), - aLast = theModifiedAttributes.end(); + auto anIt = theModifiedAttributes.begin(); + + auto aLast = theModifiedAttributes.end(); for (; anIt != aLast; anIt++) { AttributePtr anAttribute = anIt->first; AttributePtr aNewAttribute = anIt->second; @@ -924,8 +930,9 @@ void SketchPlugin_SegmentationTools::updateRefAttConstraints( continue; std::list aRefAttributes = theBaseRefAttributes.at(anAttribute); - std::list::const_iterator aRefIt = aRefAttributes.begin(), - aRLast = aRefAttributes.end(); + std::list::const_iterator aRefIt = aRefAttributes.begin(); + + std::list::const_iterator aRLast = aRefAttributes.end(); for (; aRefIt != aRLast; aRefIt++) { AttributeRefAttrPtr aRefAttr = @@ -943,7 +950,9 @@ void SketchPlugin_SegmentationTools::updateRefAttConstraints( void SketchPlugin_SegmentationTools::updateFeaturesAfterOperation( const std::set &theFeaturesToUpdate) { - auto anIt = theFeaturesToUpdate.begin(), aLast = theFeaturesToUpdate.end(); + auto anIt = theFeaturesToUpdate.begin(); + + auto aLast = theFeaturesToUpdate.end(); for (; anIt != aLast; anIt++) { FeaturePtr aRefFeature = std::dynamic_pointer_cast(*anIt); std::string aRefFeatureKind = aRefFeature->getKind(); diff --git a/src/SketchPlugin/SketchPlugin_Trim.cpp b/src/SketchPlugin/SketchPlugin_Trim.cpp index eaae8a48c..5c28611f2 100644 --- a/src/SketchPlugin/SketchPlugin_Trim.cpp +++ b/src/SketchPlugin/SketchPlugin_Trim.cpp @@ -120,7 +120,9 @@ void SketchPlugin_Trim::findShapePoints( const std::set &aShapes = myCashedShapes[aBaseObject]; if (!aShapes.empty()) { - auto anIt = aShapes.begin(), aLast = aShapes.end(); + auto anIt = aShapes.begin(); + + auto aLast = aShapes.end(); for (; anIt != aLast; anIt++) { GeomShapePtr aBaseShape = *anIt; std::shared_ptr aProjectedPoint; @@ -237,7 +239,9 @@ void SketchPlugin_Trim::execute() { bool anIsEqualPreviewAndSelected = aPreviewObject == aBaseObject; /// points of trim - std::shared_ptr aStartShapePoint, aLastShapePoint; + std::shared_ptr aStartShapePoint; + + std::shared_ptr aLastShapePoint; #ifdef DEBUG_TRIM std::cout << " Base Feature: " << aBaseFeature->data()->name() << std::endl; #endif @@ -254,7 +258,9 @@ void SketchPlugin_Trim::execute() { convertPoint(aLastShapePoint); /// find features that should be deleted (e.g. Middle Point) or updated (e.g. /// Length) - std::set aFeaturesToDelete, aFeaturesToUpdate; + std::set aFeaturesToDelete; + + std::set aFeaturesToUpdate; getConstraints(aFeaturesToDelete, aFeaturesToUpdate); // find references(attributes and features) to the base feature std::map> aBaseRefAttributes; @@ -312,7 +318,9 @@ void SketchPlugin_Trim::execute() { std::set aFurtherCoincidences; std::set> aModifiedAttributes; const std::string &aKind = aBaseFeature->getKind(); - FeaturePtr aReplacingFeature, aNewFeature; + FeaturePtr aReplacingFeature; + + FeaturePtr aNewFeature; if (aKind == SketchPlugin_Circle::ID() || aKind == SketchPlugin_Ellipse::ID()) { aReplacingFeature = trimClosed(aStartShapePoint2d, aLastShapePoint2d, @@ -597,8 +605,9 @@ bool SketchPlugin_Trim::setCoincidenceToAttribute( return false; std::shared_ptr aRefPnt2d = aRefPointAttr->pnt(); - auto anIt = theFurtherCoincidences.begin(), - aLast = theFurtherCoincidences.end(); + auto anIt = theFurtherCoincidences.begin(); + + auto aLast = theFurtherCoincidences.end(); bool aFoundPoint = false; for (; anIt != aLast && !aFoundPoint; anIt++) { AttributePoint2DPtr aPointAttribute = (*anIt); @@ -722,8 +731,9 @@ void SketchPlugin_Trim::removeReferencesToAttribute( std::list aRefAttributes = theBaseRefAttributes.at(theAttribute); - std::list::const_iterator aRefIt = aRefAttributes.begin(), - aRLast = aRefAttributes.end(); + std::list::const_iterator aRefIt = aRefAttributes.begin(); + + std::list::const_iterator aRLast = aRefAttributes.end(); std::set aFeaturesToDelete; for (; aRefIt != aRLast; aRefIt++) { @@ -766,7 +776,9 @@ FeaturePtr SketchPlugin_Trim::trimLine( FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObjectAttr->value()); /// points of trim - AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase; + AttributePoint2DPtr aStartPointAttrOfBase; + + AttributePoint2DPtr anEndPointAttrOfBase; SketchPlugin_SegmentationTools::getFeaturePoints( aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase); @@ -866,7 +878,9 @@ FeaturePtr SketchPlugin_Trim::trimArc( FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObjectAttr->value()); /// points of trim - AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase; + AttributePoint2DPtr aStartPointAttrOfBase; + + AttributePoint2DPtr anEndPointAttrOfBase; SketchPlugin_SegmentationTools::getFeaturePoints( aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase); @@ -965,7 +979,9 @@ FeaturePtr SketchPlugin_Trim::trimEllipticArc( FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObjectAttr->value()); // points of trim - AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase; + AttributePoint2DPtr aStartPointAttrOfBase; + + AttributePoint2DPtr anEndPointAttrOfBase; SketchPlugin_SegmentationTools::getFeaturePoints( aBaseFeature, aStartPointAttrOfBase, anEndPointAttrOfBase); diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 30747b15e..94e635235 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -709,7 +709,9 @@ bool SketchPlugin_FilletVertexValidator::isValid( const AttributePtr &theAttribute, const std::list & /*theArguments*/, Events_InfoMessage &theError) const { - FeaturePtr anEdge1, anEdge2; + FeaturePtr anEdge1; + + FeaturePtr anEdge2; return isValidVertex(theAttribute, theError, anEdge1, anEdge2); } diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_GeoExtensions.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_GeoExtensions.cpp index 3019123d2..f1c7c8513 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_GeoExtensions.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_GeoExtensions.cpp @@ -39,7 +39,9 @@ static void periodicNormalization(double &theParam, double thePeriodStart, } DeriVector2 BSplineImpl::Value(double u, double du, double *derivparam) { - DeriVector2 value, deriv; + DeriVector2 value; + + DeriVector2 deriv; d1(u, derivparam, value, deriv); return value.sum(GCS::DeriVector2(0., 0., deriv.x, deriv.y).mult(du)); } @@ -49,7 +51,9 @@ DeriVector2 BSplineImpl::CalculateNormal(Point &p, double *derivparam) { if (!parameter(p, u)) return DeriVector2(); - DeriVector2 value, deriv; + DeriVector2 value; + + DeriVector2 deriv; d1(u, derivparam, value, deriv); return deriv.rotate90ccw(); } diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 1ca2e9b5f..8560b49b0 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -290,7 +290,9 @@ static void createEllipseConstraints( if (!aPoint) continue; - GCS::InternalAlignmentType anAlignmentX, anAlignmentY; + GCS::InternalAlignmentType anAlignmentX; + + GCS::InternalAlignmentType anAlignmentY; if (anAttribute.first == SketchPlugin_Ellipse::SECOND_FOCUS_ID()) anAlignmentX = GCS::EllipseFocus2X; else if (anAttribute.first == SketchPlugin_Ellipse::MAJOR_AXIS_START_ID()) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp index 355c63f0f..0e060c8c5 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp @@ -753,7 +753,9 @@ ConstraintWrapperPtr createConstraintHVDistance( GCSPointPtr aPoint1 = thePoint1->point(); GCSPointPtr aPoint2 = thePoint2->point(); - double *aParam1, *aParam2; + double *aParam1; + + double *aParam2; if (theType == CONSTRAINT_HORIZONTAL_DISTANCE) { aParam1 = aPoint1->x; aParam2 = aPoint2->x; diff --git a/src/SketchSolver/SketchSolver_Constraint.h b/src/SketchSolver/SketchSolver_Constraint.h index de7e6b633..08749a8fe 100644 --- a/src/SketchSolver/SketchSolver_Constraint.h +++ b/src/SketchSolver/SketchSolver_Constraint.h @@ -55,8 +55,8 @@ public: void process(StoragePtr theStorage, bool theEvensBlocked); /// \brief Notify this object about the feature is changed somewhere - virtual void notify(const FeaturePtr &theFeature, - PlaneGCSSolver_Update *theUpdater) {} + virtual void notify(const FeaturePtr & /*theFeature*/, + PlaneGCSSolver_Update * /*theUpdater*/) {} /// \brief Update constraint virtual void update(); diff --git a/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp b/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp index da36ee7df..513f27ff1 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp @@ -134,7 +134,9 @@ static void findDiameterOnEllipse(FeaturePtr theConstruction, if (!anEllipseAttr) return; - std::pair aMajorAxis, aMinorAxis; + std::pair aMajorAxis; + + std::pair aMinorAxis; ellipseDiameters(theEllipse, aMajorAxis, aMinorAxis); if (anEllipseAttr->id() == aMajorAxis.first) { theStart = anEllipseAttr; @@ -155,9 +157,15 @@ static void processEllipticArcExtremities( SketchSolver_ConstraintType &theType, const ConstraintPtr &theConstraint, const StoragePtr &theStorage, std::vector &theAttributes, EntityWrapperPtr theExtremities[2]) { - AttributePoint2DPtr aPointA, aPointB; - FeaturePtr anOwnerA, anOwnerB; - FeaturePtr aParentA, aParentB; + AttributePoint2DPtr aPointA; + + AttributePoint2DPtr aPointB; + FeaturePtr anOwnerA; + + FeaturePtr anOwnerB; + FeaturePtr aParentA; + + FeaturePtr aParentB; getPointOwnerAndParent( theConstraint->refattr(SketchPlugin_Constraint::ENTITY_A()), aPointA, anOwnerA, aParentA); @@ -165,8 +173,14 @@ static void processEllipticArcExtremities( theConstraint->refattr(SketchPlugin_Constraint::ENTITY_B()), aPointB, anOwnerB, aParentB); - AttributePtr anAxisStart, anAxisEnd, aPoint; - FeaturePtr aConstruction, anEllipticArc; + AttributePtr anAxisStart; + + AttributePtr anAxisEnd; + + AttributePtr aPoint; + FeaturePtr aConstruction; + + FeaturePtr anEllipticArc; if (aParentA && aParentA == anOwnerB) { aPoint = aPointB; aConstruction = anOwnerA; @@ -310,13 +324,21 @@ void SketchSolver_ConstraintCoincidence::notify( AttributeRefAttrPtr aRefAttrB = myBaseConstraint->refattr(SketchPlugin_Constraint::ENTITY_B()); if (aRefAttrA && aRefAttrB) { - AttributePoint2DPtr anAttrA, anAttrB; - FeaturePtr anOwnerA, anOwnerB; - FeaturePtr aParentA, aParentB; + AttributePoint2DPtr anAttrA; + + AttributePoint2DPtr anAttrB; + FeaturePtr anOwnerA; + + FeaturePtr anOwnerB; + FeaturePtr aParentA; + + FeaturePtr aParentB; getPointOwnerAndParent(aRefAttrA, anAttrA, anOwnerA, aParentA); getPointOwnerAndParent(aRefAttrB, anAttrB, anOwnerB, aParentB); - EntityWrapperPtr aPoint, anEntity; + EntityWrapperPtr aPoint; + + EntityWrapperPtr anEntity; if (aParentA == anOwnerB) { aPoint = myStorage->entity(anAttrA); anEntity = myStorage->entity(anOwnerB); diff --git a/src/SketchSolver/SketchSolver_ConstraintDistance.cpp b/src/SketchSolver/SketchSolver_ConstraintDistance.cpp index be7420a13..80bceb726 100644 --- a/src/SketchSolver/SketchSolver_ConstraintDistance.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintDistance.cpp @@ -210,7 +210,9 @@ void SketchSolver_ConstraintDistance::adjustConstraint() { if (myIsSigned == isSigned) { // adjust auxiliary point for sign-keeping if (isSigned) { - EntityWrapperPtr aDistPoint, aDistLine; + EntityWrapperPtr aDistPoint; + + EntityWrapperPtr aDistLine; getPointAndLine(myBaseConstraint, myStorage, aDistPoint, aDistLine); adjustOddPoint(aDistPoint, aDistLine, myOddPoint); } @@ -249,7 +251,9 @@ void SketchSolver_ConstraintDistance::update() { // move entities to avoid conflicting constraints if (isZeroSwitch) { - double aDirX, aDirY; + double aDirX; + + double aDirY; // calculate the direction basing on the distanced objects calculateDistanceDirection(myBaseConstraint, myStorage, aDirX, aDirY); moveEntity(myBaseConstraint, myStorage, aDirX, aDirY); @@ -283,7 +287,9 @@ void SketchSolver_ConstraintDistance::addConstraintsToKeepSign() { std::list aGCSConstraints = aConstraint->constraints(); // calculate projection of the point on the line and find a sign of a distance - EntityWrapperPtr aDistPoint, aDistLine; + EntityWrapperPtr aDistPoint; + + EntityWrapperPtr aDistLine; getPointAndLine(myBaseConstraint, myStorage, aDistPoint, aDistLine); std::shared_ptr aLine = PlaneGCSSolver_Tools::line(aDistLine); diff --git a/src/SketchSolver/SketchSolver_ConstraintMirror.cpp b/src/SketchSolver/SketchSolver_ConstraintMirror.cpp index 8f6e1a9c1..62da9b9d2 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMirror.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMirror.cpp @@ -123,7 +123,9 @@ void SketchSolver_ConstraintMirror::adjustConstraint() { std::list aBaseList = aBaseRefList->list(); std::list aMirroredList = aMirroredRefList->list(); - std::list::iterator aBIt, aMIt; + std::list::iterator aBIt; + + std::list::iterator aMIt; for (aBIt = aBaseList.begin(), aMIt = aMirroredList.begin(); aBIt != aBaseList.end() && aMIt != aMirroredList.end(); ++aBIt, ++aMIt) { FeaturePtr aBase = ModelAPI_Feature::feature(*aBIt); @@ -191,7 +193,9 @@ void mirrorEntities(const std::shared_ptr &theMirrorLine, } // mirror all initialized points of features - std::list::iterator anIt0, anIt1; + std::list::iterator anIt0; + + std::list::iterator anIt1; for (anIt0 = aPoints0.begin(), anIt1 = aPoints1.begin(); anIt0 != aPoints0.end() && anIt1 != aPoints1.end(); ++anIt0, ++anIt1) { AttributePoint2DPtr aPt0 = diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp index acde45a56..7b7f4bbe6 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp @@ -161,8 +161,12 @@ void SketchSolver_ConstraintMulti::adjustConstraint() { return; } - FeaturePtr anOriginal, aFeature; - std::list::iterator aXIt, aYIt; + FeaturePtr anOriginal; + + FeaturePtr aFeature; + std::list::iterator aXIt; + + std::list::iterator aYIt; std::list anObjectList = aRefList->list(); auto anObjIt = anObjectList.begin(); @@ -172,8 +176,12 @@ void SketchSolver_ConstraintMulti::adjustConstraint() { continue; // Fill lists of coordinates of points composing a feature - std::list aX, aY; - double aXCoord, aYCoord; + std::list aX; + + std::list aY; + double aXCoord; + + double aYCoord; std::list aPoints = anOriginal->data()->attributes(GeomDataAPI_Point2D::typeId()); auto aPtIt = aPoints.begin(); diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp index 132e3d021..bda9906f4 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp @@ -75,7 +75,9 @@ void SketchSolver_ConstraintMultiTranslation::process() { return; } - EntityWrapperPtr aStartPoint, aEndPoint; + EntityWrapperPtr aStartPoint; + + EntityWrapperPtr aEndPoint; std::list aBaseEntities; getAttributes(aStartPoint, aEndPoint, myIsFullValue, aBaseEntities); if (!myErrorMsg.empty()) diff --git a/src/SketchSolver/SketchSolver_ConstraintPerpendicular.cpp b/src/SketchSolver/SketchSolver_ConstraintPerpendicular.cpp index 6b91f24f7..9860bfc2d 100644 --- a/src/SketchSolver/SketchSolver_ConstraintPerpendicular.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintPerpendicular.cpp @@ -127,7 +127,9 @@ void SketchSolver_ConstraintPerpendicular::rebuild() { return; } - FeaturePtr aFeature1, aFeature2; + FeaturePtr aFeature1; + + FeaturePtr aFeature2; getFeatures(myBaseConstraint, aFeature1, aFeature2); // check number of coincident points @@ -200,7 +202,9 @@ void SketchSolver_ConstraintPerpendicular::notify( if (!myBaseConstraint->data() || !myBaseConstraint->data()->isValid()) return; - FeaturePtr aTgFeat1, aTgFeat2; + FeaturePtr aTgFeat1; + + FeaturePtr aTgFeat2; getFeatures(myBaseConstraint, aTgFeat1, aTgFeat2); bool isRebuild = false; @@ -398,7 +402,9 @@ void calculateIntersectionPoint(EntityWrapperPtr theCurve1, aCurve2 = theCurve1; } - GeomPnt2dPtr aP1, aP2; + GeomPnt2dPtr aP1; + + GeomPnt2dPtr aP2; if (aCurve2->type() == ENTITY_LINE) { std::shared_ptr aLine = PlaneGCSSolver_Tools::line(aCurve2); anEllipse->distance(aLine, aP1, aP2); diff --git a/src/SketchSolver/SketchSolver_ConstraintTangent.cpp b/src/SketchSolver/SketchSolver_ConstraintTangent.cpp index c10d4c536..ceb96209c 100644 --- a/src/SketchSolver/SketchSolver_ConstraintTangent.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintTangent.cpp @@ -194,7 +194,9 @@ void SketchSolver_ConstraintTangent::rebuild() { std::dynamic_pointer_cast(anEdge->entity()); // which boundary is coincident? - GCS::Point aPoint1, aPoint2; + GCS::Point aPoint1; + + GCS::Point aPoint2; for (const auto &aCoincidentPoint : aCoincidentPoints) { if (aCoincidentPoint->owner() == aFeatures[i]) { if (aCoincidentPoint->id() == SketchPlugin_BSpline::START_ID()) { @@ -294,7 +296,9 @@ void SketchSolver_ConstraintTangent::notify( if (!myBaseConstraint->data() || !myBaseConstraint->data()->isValid()) return; - FeaturePtr aTgFeat1, aTgFeat2; + FeaturePtr aTgFeat1; + + FeaturePtr aTgFeat2; getTangentFeatures(myBaseConstraint, aTgFeat1, aTgFeat2); bool isRebuild = false; @@ -572,7 +576,9 @@ ConstraintWrapperPtr createArcLineTangency(EntityWrapperPtr theEntity1, EntityWrapperPtr theEntity2, EntityWrapperPtr theSharedPoint, double *theAngle) { - EdgeWrapperPtr anEntLine, anEntCirc; + EdgeWrapperPtr anEntLine; + + EdgeWrapperPtr anEntCirc; if (theEntity1->type() == ENTITY_LINE) { anEntLine = GCS_EDGE_WRAPPER(theEntity1); anEntCirc = GCS_EDGE_WRAPPER(theEntity2); @@ -654,7 +660,9 @@ void calculateTangencyPoint(EntityWrapperPtr theCurve1, aCurve2 = theCurve1; } - GeomPnt2dPtr aP1, aP2; + GeomPnt2dPtr aP1; + + GeomPnt2dPtr aP2; if (aCurve2->type() == ENTITY_LINE) { std::shared_ptr aLine = PlaneGCSSolver_Tools::line(aCurve2); anEllipse->distance(aLine, aP1, aP2); diff --git a/src/SketcherPrs/SketcherPrs_Angle.cpp b/src/SketcherPrs/SketcherPrs_Angle.cpp index 1148977e3..3b785c5ba 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.cpp +++ b/src/SketcherPrs/SketcherPrs_Angle.cpp @@ -86,7 +86,11 @@ SketcherPrs_Angle::~SketcherPrs_Angle() { delete myStyleListener; } bool SketcherPrs_Angle::IsReadyToDisplay( ModelAPI_Feature *theConstraint, const std::shared_ptr &thePlane) { - gp_Pnt aFirstPoint, aSecondPoint, aCenterPoint; + gp_Pnt aFirstPoint; + + gp_Pnt aSecondPoint; + + gp_Pnt aCenterPoint; return readyToDisplay(theConstraint, thePlane, aFirstPoint, aSecondPoint, aCenterPoint); } @@ -178,7 +182,9 @@ bool SketcherPrs_Angle::readyToDisplay( } gp_Pnt2d aCenterPoint = anAng->center()->impl(); - gp_Pnt2d aFirstPoint, aSecondPoint; + gp_Pnt2d aFirstPoint; + + gp_Pnt2d aSecondPoint; try { if (anAng->angleRadian() > 0.0) { aFirstPoint = anAng->firstPoint()->impl(); @@ -219,7 +225,11 @@ void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d) & DataPtr aData = myConstraint->data(); - gp_Pnt aFirstPoint, aSecondPoint, aCenterPoint; + gp_Pnt aFirstPoint; + + gp_Pnt aSecondPoint; + + gp_Pnt aCenterPoint; bool aReadyToDisplay = readyToDisplay(myConstraint, plane(), aFirstPoint, aSecondPoint, aCenterPoint); if (aReadyToDisplay) { diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index f9e9e5d5c..98d6f1fee 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -128,7 +128,9 @@ SketcherPrs_LengthDimension::~SketcherPrs_LengthDimension() { bool SketcherPrs_LengthDimension::IsReadyToDisplay( ModelAPI_Feature *theConstraint, const std::shared_ptr &thePlane) { - gp_Pnt2d aPnt1, aPnt2; + gp_Pnt2d aPnt1; + + gp_Pnt2d aPnt2; return readyToDisplay(theConstraint, thePlane, aPnt1, aPnt2); } @@ -153,7 +155,9 @@ void SketcherPrs_LengthDimension::Compute( const Standard_Integer theMode) { if (!plane().get()) return; - gp_Pnt2d aP1, aP2; + gp_Pnt2d aP1; + + gp_Pnt2d aP2; bool aReadyToDisplay = readyToDisplay(myConstraint, plane(), aP1, aP2); if (aReadyToDisplay) { if (isEqualPoints(myConstraint, aP1, aP2)) { @@ -161,7 +165,9 @@ void SketcherPrs_LengthDimension::Compute( std::shared_ptr aDirAttr = std::dynamic_pointer_cast(myConstraint->attribute( SketchPlugin_ConstraintDistance::DIRECTION_ID())); - double x = 0.0, y = 0.0; + double x = 0.0; + + double y = 0.0; if (aDirAttr && aDirAttr->isInitialized()) { x = aDirAttr->x(); y = aDirAttr->y(); diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp index 32be0dd07..5e3e23853 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp @@ -200,7 +200,9 @@ gp_Vec getVector(ObjectPtr theShape, GeomDirPtr theDir, gp_Pnt theP) { // 2458: check correct orientation of the vector if (aVec.SquareMagnitude() > Precision::Confusion()) { std::shared_ptr aCircEdge(new GeomAPI_Edge(aShape)); - double aFirstParam, aLastParam; + double aFirstParam; + + double aLastParam; aCircEdge->getRange(aFirstParam, aLastParam); // if parameter is near the LastParam, make the vector go inside // (reverse) diff --git a/src/SketcherPrs/SketcherPrs_Tools.cpp b/src/SketcherPrs/SketcherPrs_Tools.cpp index d944f57d0..348c2c3d5 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.cpp +++ b/src/SketcherPrs/SketcherPrs_Tools.cpp @@ -147,9 +147,12 @@ findGeomPoint(ObjectPtr theObject, const TopoDS_Shape &theShape, std::list anObjectAttiributes = anObjectFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list::const_iterator anIt = - anObjectAttiributes.begin(), - aLast = - anObjectAttiributes.end(); + + anObjectAttiributes.begin(); + + std::list::const_iterator aLast = + + anObjectAttiributes.end(); for (; anIt != aLast && !aGeomPoint; anIt++) { std::shared_ptr anAttributePoint = std::dynamic_pointer_cast(*anIt); diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 9b47292fc..a7d2496ec 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -1018,8 +1018,9 @@ void XGUI_ContextMenuMgr::addViewerMenu(QMenu *theMenu) const { QList anActionsList = theMenu->actions(); int anActionsListSize = anActionsList.size(); QAction *aFirstAction = anActionsList[0]; - QMap::const_iterator anIt = aMenuActions.begin(), - aLast = aMenuActions.end(); + QMap::const_iterator anIt = aMenuActions.begin(); + + QMap::const_iterator aLast = aMenuActions.end(); for (; anIt != aLast; anIt++) { if (anIt.key() > anActionsListSize) theMenu->addAction(anIt.value()); @@ -1041,16 +1042,20 @@ QStringList XGUI_ContextMenuMgr::actionObjectGroups(const QString &theName) { QStringList aGroups; QMap::const_iterator anIt = - myObjBrowserMenus.begin(), - aLast = - myObjBrowserMenus.end(); + + myObjBrowserMenus.begin(); + + QMap::const_iterator aLast = + + myObjBrowserMenus.end(); for (; anIt != aLast; anIt++) { QString aGroupName(anIt.key().c_str()); if (aGroups.contains(aGroupName)) continue; QActionsList anActions = anIt.value(); - QActionsList::const_iterator anAIt = anActions.begin(), - anALast = anActions.end(); + QActionsList::const_iterator anAIt = anActions.begin(); + + QActionsList::const_iterator anALast = anActions.end(); bool aFound = false; for (; anAIt != anALast && !aFound; anAIt++) aFound = (*anAIt)->data().toString() == theName; diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index afada9f61..5faff7d5e 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -104,7 +104,9 @@ void XGUI_DataModel::processEvent( QTreeNodesList aNodes = myRoot->objectCreated(aCreated); ModuleBase_ITreeNode *aParent; int aRow = 0; - QModelIndex aParentIndex1, aParentIndex2; + QModelIndex aParentIndex1; + + QModelIndex aParentIndex2; ObjectPtr aObj; bool aRebuildAll = false; diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 81574a846..8b0d5f831 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -129,7 +129,9 @@ void displayedObjects(const Handle(AIS_InteractiveContext) & theAIS, QString qIntListInfo(const QIntList &theValues, const QString &theSeparator = QString(", ")) { QStringList anInfo; - QIntList::const_iterator anIt = theValues.begin(), aLast = theValues.end(); + QIntList::const_iterator anIt = theValues.begin(); + + QIntList::const_iterator aLast = theValues.end(); for (; anIt != aLast; anIt++) { anInfo.append(QString::number(*anIt)); } @@ -395,8 +397,9 @@ void XGUI_Displayer::redisplayObjects() { Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY); static const ModelAPI_EventCreator *aECreator = ModelAPI_EventCreator::get(); QObjectPtrList aDisplayed = displayedObjects(); - QObjectPtrList::const_iterator anIt = aDisplayed.begin(), - aLast = aDisplayed.end(); + QObjectPtrList::const_iterator anIt = aDisplayed.begin(); + + QObjectPtrList::const_iterator aLast = aDisplayed.end(); for (; anIt != aLast; anIt++) { aECreator->sendUpdated(*anIt, EVENT_DISP); } @@ -415,8 +418,9 @@ void XGUI_Displayer::deactivateObjects(const QObjectPtrList &theObjList, // if (!aTrihedron.IsNull()) // deactivateAIS(aTrihedron); - QObjectPtrList::const_iterator anIt = theObjList.begin(), - aLast = theObjList.end(); + QObjectPtrList::const_iterator anIt = theObjList.begin(); + + QObjectPtrList::const_iterator aLast = theObjList.end(); for (; anIt != aLast; anIt++) { selectionActivate()->deactivate(*anIt, false); } @@ -967,7 +971,11 @@ QColor XGUI_Displayer::setObjectColor(ObjectPtr theObject, return Qt::black; AISObjectPtr anAISObj = getAISObject(theObject); - int aR, aG, aB; + int aR; + + int aG; + + int aB; anAISObj->getColor(aR, aG, aB); anAISObj->setColor(theColor.red(), theColor.green(), theColor.blue()); myWorkshop->updateGroupsText(); @@ -1060,8 +1068,9 @@ void XGUI_Displayer::getPresentations( // find presentations of the feature results std::list aResults; ModelAPI_Tools::allResults(aFeature, aResults); - std::list::const_iterator anIt = aResults.begin(), - aLast = aResults.end(); + std::list::const_iterator anIt = aResults.begin(); + + std::list::const_iterator aLast = aResults.end(); for (; anIt != aLast; ++anIt) { AISObjectPtr aCurAISObj = getAISObject(*anIt); if (aCurAISObj.get() != nullptr) { @@ -1227,10 +1236,18 @@ GeomPlanePtr XGUI_Displayer::getScreenPlane() const { Handle(V3d_Viewer) aViewer = aContext->CurrentViewer(); Handle(V3d_View) aView = aViewer->ActiveViews().First(); if (!aView.IsNull()) { - double aEyeX, aEyeY, aEyeZ; + double aEyeX; + + double aEyeY; + + double aEyeZ; aView->Eye(aEyeX, aEyeY, aEyeZ); - double aProjX, aProjY, aProjZ; + double aProjX; + + double aProjY; + + double aProjZ; aView->Proj(aProjX, aProjY, aProjZ); GeomPointPtr aPnt = GeomPointPtr(new GeomAPI_Pnt(aEyeX, aEyeY, aEyeZ)); diff --git a/src/XGUI/XGUI_InspectionPanel.cpp b/src/XGUI/XGUI_InspectionPanel.cpp index aa2cf8ff7..5af41d612 100644 --- a/src/XGUI/XGUI_InspectionPanel.cpp +++ b/src/XGUI/XGUI_InspectionPanel.cpp @@ -241,7 +241,9 @@ void XGUI_InspectionPanel::setName(const QString &theName) { void XGUI_InspectionPanel::setShapeContent(const TopoDS_Shape &theShape) { try { OCC_CATCH_SIGNALS; - int iType, nbTypes[TopAbs_SHAPE]; + int iType; + + int nbTypes[TopAbs_SHAPE]; for (iType = 0; iType < TopAbs_SHAPE; ++iType) { nbTypes[iType] = 0; } @@ -288,7 +290,9 @@ void XGUI_InspectionPanel::setParamsText(const QString &theText) { //******************************************************************** void XGUI_InspectionPanel::buildFeaturePane(const FeaturePtr &theFeature) { - std::string aXmlCfg, aDescription; + std::string aXmlCfg; + + std::string aDescription; myWorkshop->module()->getXMLRepresentation(theFeature->getKind(), aXmlCfg, aDescription); if (!aXmlCfg.empty()) { diff --git a/src/XGUI/XGUI_MenuMgr.cpp b/src/XGUI/XGUI_MenuMgr.cpp index 0b9d4b6e5..9b552b846 100644 --- a/src/XGUI/XGUI_MenuMgr.cpp +++ b/src/XGUI/XGUI_MenuMgr.cpp @@ -150,7 +150,11 @@ void XGUI_MenuMgr::addFeature( std::shared_ptr XGUI_MenuMgr::findWorkbench(const std::string &theWorkbenchName) { std::list>::const_iterator - anIt = myWorkbenches.begin(), + + anIt = myWorkbenches.begin(); + + std::list>::const_iterator + aLast = myWorkbenches.end(); std::shared_ptr aResultWorkbench; for (; anIt != aLast && !aResultWorkbench; anIt++) { @@ -169,7 +173,11 @@ XGUI_MenuMgr::findWorkbench(const std::string &theWorkbenchName) { void XGUI_MenuMgr::createFeatureActions() { #ifdef HAVE_SALOME std::list>::const_iterator - anIt = myWorkbenches.begin(), + + anIt = myWorkbenches.begin(); + + std::list>::const_iterator + aLast = myWorkbenches.end(); XGUI_SalomeConnector *aSalomeConnector = myWorkshop->salomeConnector(); for (; anIt != aLast; anIt++) { @@ -177,13 +185,17 @@ void XGUI_MenuMgr::createFeatureActions() { std::string aWchName = aWorkbench->getName(); const std::list> &aGroups = aWorkbench->groups(); - auto aGIt = aGroups.begin(), aGLast = aGroups.end(); + auto aGIt = aGroups.begin(); + + auto aGLast = aGroups.end(); for (; aGIt != aGLast; aGIt++) { const std::shared_ptr aGroup = *aGIt; std::string aGName = aGroup->getName(); const std::list> &aFeaturesInfo = aGroup->featuresInfo(); - auto aFIt = aFeaturesInfo.begin(), aFLast = aFeaturesInfo.end(); + auto aFIt = aFeaturesInfo.begin(); + + auto aFLast = aFeaturesInfo.end(); size_t aFSize = aFeaturesInfo.size(); for (size_t i = 0; aFIt != aFLast; aFIt++, i++) { std::shared_ptr aMessage = *aFIt; diff --git a/src/XGUI/XGUI_MenuWorkbench.cpp b/src/XGUI/XGUI_MenuWorkbench.cpp index 085a99e4f..1855ad866 100644 --- a/src/XGUI/XGUI_MenuWorkbench.cpp +++ b/src/XGUI/XGUI_MenuWorkbench.cpp @@ -28,7 +28,11 @@ XGUI_MenuWorkbench::XGUI_MenuWorkbench(const std::string &theName) std::shared_ptr XGUI_MenuWorkbench::findGroup(const std::string &theGroupName) { std::list>::const_iterator - anIt = myGroups.begin(), + + anIt = myGroups.begin(); + + std::list>::const_iterator + aLast = myGroups.end(); std::shared_ptr aResultGroup; for (; anIt != aLast && !aResultGroup; anIt++) { diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 70d257ab7..8b28ef904 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -560,7 +560,13 @@ void XGUI_ObjectsBrowser::setObjectsSelected(const QObjectPtrList &theObjects) { myTreeView->update(aIdx); } - QModelIndex aIndex0, aIndex1, aIndex2, aCurrent; + QModelIndex aIndex0; + + QModelIndex aIndex1; + + QModelIndex aIndex2; + + QModelIndex aCurrent; foreach (ObjectPtr aFeature, aToSelect) { aIndex1 = myDocModel->objectIndex(aFeature, 1); if (aIndex1.isValid()) { diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index bc13eb76a..41ac818e4 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -288,7 +288,9 @@ bool XGUI_OperationMgr::abortAllOperations( } bool XGUI_OperationMgr::commitAllOperations() { - bool isCompositeCommitted = false, anOperationProcessed = false; + bool isCompositeCommitted = false; + + bool anOperationProcessed = false; while (hasOperation()) { ModuleBase_Operation *anOperation = currentOperation(); if (XGUI_Tools::workshop(myWorkshop)->errorMgr()->isApplyEnabled()) { diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 8b795aaf9..f8651de8b 100644 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -140,8 +140,9 @@ void XGUI_PropertyPanel::cleanContent() { /// of restarted operation and after that the mouse release signal come from /// the widget of the previous operation (Point2d widget about mouse is /// released and focus is out of this widget) - QList::const_iterator anIt = myWidgets.begin(), - aLast = myWidgets.end(); + QList::const_iterator anIt = myWidgets.begin(); + + QList::const_iterator aLast = myWidgets.end(); for (; anIt != aLast; anIt++) { QWidget *aWidget = *anIt; if (aWidget) { @@ -294,8 +295,9 @@ void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget *theWidget, ModelAPI_ValidatorsFactory *aValidators = ModelAPI_Session::get()->validators(); - QList::const_iterator anIt = myWidgets.begin(), - aLast = myWidgets.end(); + QList::const_iterator anIt = myWidgets.begin(); + + QList::const_iterator aLast = myWidgets.end(); bool isFoundWidget = false; ModuleBase_Tools::activateWindow(this, "XGUI_PropertyPanel::activateNextWidget()"); @@ -511,8 +513,9 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget *theWidget, return false; } std::string aPreviosAttributeID; - ModuleBase_ModelWidget *aDeactivatedWidget = nullptr, - *anActivatedWidget = nullptr; + ModuleBase_ModelWidget *aDeactivatedWidget = nullptr; + + ModuleBase_ModelWidget *anActivatedWidget = nullptr; if (myActiveWidget) { aPreviosAttributeID = myActiveWidget->attributeID(); myActiveWidget->processValueState(); diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index 01ecc6f1b..8974744b9 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -191,16 +191,20 @@ void XGUI_Selection::getSelectedInBrowser( // objects in the result QObjectPtrList aPresentationObjects; QList::const_iterator aPrsIt = - thePresentations.begin(), - aPrsLast = - thePresentations.end(); + + thePresentations.begin(); + + QList::const_iterator aPrsLast = + + thePresentations.end(); for (; aPrsIt != aPrsLast; aPrsIt++) { aPresentationObjects.push_back((*aPrsIt)->object()); } QObjectPtrList anObjects = selectedObjects(); - QObjectPtrList::const_iterator anIt = anObjects.begin(), - aLast = anObjects.end(); + QObjectPtrList::const_iterator anIt = anObjects.begin(); + + QObjectPtrList::const_iterator aLast = anObjects.end(); for (; anIt != aLast; anIt++) { ObjectPtr anObject = *anIt; if (anObject.get() != nullptr && !aPresentationObjects.contains(anObject)) { diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index 69294afb9..eacf1e67c 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -496,7 +496,9 @@ void XGUI_ViewerProxy::updateHighlight() { Handle(StdSelect_BRepOwner) aOwner; Handle(AIS_InteractiveObject) anIO; bool isDisplayed = false; - TopoDS_Shape aShape, aShp; + TopoDS_Shape aShape; + + TopoDS_Shape aShp; ResultPtr aRes; XGUI_Displayer *aDisplayer = myWorkshop->displayer(); for (aContext->InitDetected(); aContext->MoreDetected(); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 46005ff76..19e579f15 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -796,7 +796,9 @@ void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation *theOperation) { anIsAutoPreview = aFeatureInfo->isAutoPreview(); theOperation->setHelpFileName(aFeatureInfo->helpFileName().c_str()); } else { - std::string aXmlCfg, aDescription; + std::string aXmlCfg; + + std::string aDescription; module()->getXMLRepresentation(aFeatureKind, aXmlCfg, aDescription); ModuleBase_WidgetFactory aFactory(aXmlCfg, moduleConnector()); anIsAutoPreview = @@ -2103,7 +2105,9 @@ void XGUI_Workshop::deleteObjects() { aDone = ModelAPI_Tools::removeFeatures(aFeatures, false); } if (aFolders.size() > 0) { - auto anIt = aFolders.begin(), aLast = aFolders.end(); + auto anIt = aFolders.begin(); + + auto aLast = aFolders.end(); for (; anIt != aLast; anIt++) { FolderPtr aFolder = *anIt; if (aFolder.get()) { @@ -2148,7 +2152,9 @@ void addRefsToFeature( // references to it std::set aMainReferences = theMainList.at(theFeature); - auto anIt = aMainReferences.begin(), aLast = aMainReferences.end(); + auto anIt = aMainReferences.begin(); + + auto aLast = aMainReferences.end(); for (; anIt != aLast; anIt++) { FeaturePtr aRefFeature = *anIt; if (theReferences.find(aRefFeature) == theReferences.end()) @@ -2192,12 +2198,18 @@ void XGUI_Workshop::cleanHistory() { // dependency to bool_1 sk_3() Information: bool_1 is not selected std::set anUnusedObjects; std::map>::const_iterator - aMainIt = aReferences.begin(), + + aMainIt = aReferences.begin(); + + std::map>::const_iterator + aMainLast = aReferences.end(); for (; aMainIt != aMainLast; aMainIt++) { FeaturePtr aMainListFeature = aMainIt->first; std::set aMainRefList = aMainIt->second; - auto aRefIt = aMainRefList.begin(), aRefLast = aMainRefList.end(); + auto aRefIt = aMainRefList.begin(); + + auto aRefLast = aMainRefList.end(); bool aFeatureOutOfTheList = false; for (; aRefIt != aRefLast && !aFeatureOutOfTheList; aRefIt++) { FeaturePtr aRefFeature = *aRefIt; @@ -2323,8 +2335,9 @@ void XGUI_Workshop::moveObjects(const bool theSplit) { DocumentPtr anActiveDocument = aMgr->activeDocument(); FeaturePtr aCurrentFeature = anActiveDocument->currentFeature(true); - std::list::const_iterator anIt = aFList.begin(), - aLast = aFList.end(); + std::list::const_iterator anIt = aFList.begin(); + + std::list::const_iterator aLast = aFList.end(); for (; anIt != aLast; anIt++) { FeaturePtr aFeature = *anIt; if (!aFeature.get() || !myModule->canApplyAction(aFeature, anActionId)) @@ -2450,8 +2463,9 @@ bool XGUI_Workshop::canMoveFeature() { bool aCanMove = !anObjects.empty(); - QObjectPtrList::const_iterator anIt = anObjects.begin(), - aLast = anObjects.end(); + QObjectPtrList::const_iterator anIt = anObjects.begin(); + + QObjectPtrList::const_iterator aLast = anObjects.end(); for (; anIt != aLast && aCanMove; anIt++) { ObjectPtr anObject = *anIt; if (!anObject.get() || !anObject->data().get() || @@ -2572,7 +2586,11 @@ void getDefaultColor(ObjectPtr theObject, const bool isEmptyColorValid, theColor.clear(); // get default color from the preferences manager for the given result if (theColor.empty()) { - std::string aSection, aName, aDefault; + std::string aSection; + + std::string aName; + + std::string aDefault; theObject->colorConfigInfo(aSection, aName, aDefault); if (!aSection.empty() && !aName.empty()) { theColor = Config_PropManager::color(aSection, aName); @@ -2989,7 +3007,9 @@ void XGUI_Workshop::updateColorScaleVisibility() { myViewerProxy->setColorScaleIntervals(2); myViewerProxy->setColorScaleRange(0., 1.); } else { - double aMin, aMax; + double aMin; + + double aMax; aPrs->dataRange(aMin, aMax); myViewerProxy->setColorScaleRange(aMin, aMax); } @@ -3029,7 +3049,11 @@ void XGUI_Workshop::updateGroupsText() { std::vector aColor; ModelAPI_Tools::getColor(aGroup, aColor); if (aColor.empty()) { // default groups colors - std::string aSection, aName, aDefault; + std::string aSection; + + std::string aName; + + std::string aDefault; aGroup->colorConfigInfo(aSection, aName, aDefault); if (!aSection.empty() && !aName.empty()) { aColor = Config_PropManager::color(aSection, aName); @@ -3068,7 +3092,17 @@ void XGUI_Workshop::setNormalView(bool toInvert) { aNormal->reverse(); GeomPointPtr aPos = aPlane->location(); - double aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + double aXmin; + + double aYmin; + + double aZmin; + + double aXmax; + + double aYmax; + + double aZmax; aFace->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); Handle(V3d_View) aView = myViewerProxy->activeView();