From: Artem Zhidkov Date: Sat, 16 May 2020 21:11:54 +0000 (+0300) Subject: Get rid of compilation warnings. Part II. MSVC warnings. X-Git-Tag: V9_5_0b1~2^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=46c0759fa291dad10b713cf02b341d6e9e60c1a4;p=modules%2Fshaper.git Get rid of compilation warnings. Part II. MSVC warnings. --- diff --git a/src/BuildPlugin/BuildPlugin_Solid.cpp b/src/BuildPlugin/BuildPlugin_Solid.cpp index fc6d99f51..cd1cb0c86 100644 --- a/src/BuildPlugin/BuildPlugin_Solid.cpp +++ b/src/BuildPlugin/BuildPlugin_Solid.cpp @@ -57,10 +57,7 @@ GeomShapePtr BuildPlugin_Solid::getSingleSubshape(const GeomShapePtr& theCompoun { if (theCompound->shapeType() == GeomAPI_Shape::COMPOUND) { GeomAPI_ShapeIterator anIt(theCompound); - GeomShapePtr aFoundSub; - for (; anIt.more() && !aFoundSub; anIt.next()) { - return anIt.current(); - } + return anIt.current(); } return theCompound; } diff --git a/src/BuildPlugin/BuildPlugin_Validators.cpp b/src/BuildPlugin/BuildPlugin_Validators.cpp index 78f8e6c9d..ac454e620 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.cpp +++ b/src/BuildPlugin/BuildPlugin_Validators.cpp @@ -460,8 +460,8 @@ bool BuildPlugin_ValidatorSubShapesSelection::isValid(const AttributePtr& theAtt //================================================================================================= bool BuildPlugin_ValidatorFillingSelection::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, - Events_InfoMessage& theError) const + const std::list& /*theArguments*/, + Events_InfoMessage& theError) const { // Get base objects list. if (theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) { diff --git a/src/BuildPlugin/BuildPlugin_Wire.cpp b/src/BuildPlugin/BuildPlugin_Wire.cpp index 7f10590d9..124a03abb 100644 --- a/src/BuildPlugin/BuildPlugin_Wire.cpp +++ b/src/BuildPlugin/BuildPlugin_Wire.cpp @@ -144,9 +144,9 @@ void BuildPlugin_Wire::execute() for (ListOfShape::iterator aWIt = aWires.begin(); aWIt != aWires.end(); ++aWIt) { ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - ListOfShape aSketches; - aSketches.push_back(anIt->second); - aResultBody->storeModified(aSketches, *aWIt, aMakeShapeList); + ListOfShape aSketch; + aSketch.push_back(anIt->second); + aResultBody->storeModified(aSketch, *aWIt, aMakeShapeList); aResultBody->loadModifiedShapes(aMakeShapeList, anIt->second, GeomAPI_Shape::EDGE); setResult(aResultBody, aResultIndex); ++aResultIndex; diff --git a/src/CollectionAPI/CollectionAPI.i b/src/CollectionAPI/CollectionAPI.i index 99a3dfd99..055cc22aa 100644 --- a/src/CollectionAPI/CollectionAPI.i +++ b/src/CollectionAPI/CollectionAPI.i @@ -35,10 +35,6 @@ #include "CollectionAPI_Field.h" #endif // CollectionAPI_swig_H_ -%} - -%{ - #include "ModelHighAPI_swig.h" // fix for SWIG v2.0.4 #define SWIGPY_SLICE_ARG(obj) ((PyObject*)(obj)) diff --git a/src/CollectionPlugin/CollectionPlugin_Validators.cpp b/src/CollectionPlugin/CollectionPlugin_Validators.cpp index 527b61c8d..cf55ae31c 100644 --- a/src/CollectionPlugin/CollectionPlugin_Validators.cpp +++ b/src/CollectionPlugin/CollectionPlugin_Validators.cpp @@ -26,7 +26,7 @@ bool CollectionPlugin_FieldValidator::isValid(const FeaturePtr& theFeature, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { AttributeSelectionListPtr aSelList = diff --git a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp index ea1abe7b7..adf20b11d 100644 --- a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp +++ b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp @@ -598,9 +598,9 @@ bool CollectionPlugin_WidgetField::restoreValueCustom() } } // Restore columns width - for (int i = 0; i < aTable->columnCount(); i++) { - if (i < aColWidth.size()) - aTable->setColumnWidth(i, aColWidth.at(i)); + for (int col = 0; col < aTable->columnCount(); col++) { + if (col < aColWidth.size()) + aTable->setColumnWidth(col, aColWidth.at(col)); } aTable->blockSignals(isBlocked); diff --git a/src/Config/Config_Common.cpp b/src/Config/Config_Common.cpp index efa0efeb9..1e25343d9 100644 --- a/src/Config/Config_Common.cpp +++ b/src/Config/Config_Common.cpp @@ -208,7 +208,7 @@ bool getParametersInfo(xmlNodePtr theNode, std::string& outPropertyId, std::stringstream aPropStringStream(aPropString); char COMMA_DELIM = ','; std::string aParameter; - while (std::getline(aPropStringStream, aParameter, ',')) { + while (std::getline(aPropStringStream, aParameter, COMMA_DELIM)) { outValidatorParameters.push_back(aParameter); } } @@ -285,6 +285,7 @@ bool getBooleanAttribute(xmlNodePtr theNode, const char* theAttributeName, bool CONFIG_EXPORT std::string normalize(const std::string& theString) { std::string result = theString; - std::transform(result.begin(), result.end(), result.begin(), ::tolower); + std::transform(result.begin(), result.end(), result.begin(), + [](char c) { return static_cast(::tolower(c)); }); return result; } diff --git a/src/Config/Config_DataModelReader.cpp b/src/Config/Config_DataModelReader.cpp index bba44d440..55bb37612 100644 --- a/src/Config/Config_DataModelReader.cpp +++ b/src/Config/Config_DataModelReader.cpp @@ -23,6 +23,8 @@ #include +#include + // used only for GUI xml data reading // LCOV_EXCL_START Config_DataModelReader::Config_DataModelReader() @@ -46,10 +48,9 @@ void Config_DataModelReader::processNode(xmlNodePtr theNode) std::string aIcon = getProperty(theNode, NODE_ICON); std::string aEmpty = getProperty(theNode, SHOW_EMPTY); std::string aFeatures = getProperty(theNode, FOLDER_FEATURES); - std::string::iterator aIt; - for (aIt = aEmpty.begin(); aIt != aEmpty.end(); aIt++) { - (*aIt) = toupper(*aIt); - } + + std::transform(aEmpty.begin(), aEmpty.end(), aEmpty.begin(), + [](char c) { return static_cast(::toupper(c)); }); bool aIsEmpty = (aEmpty == "FALSE")? false : true; if (isRootReading) { @@ -72,10 +73,8 @@ void Config_DataModelReader::processNode(xmlNodePtr theNode) isRootReading = false; mySubTypes = getProperty(theNode, GROUP_TYPE); std::string isResult = getProperty(theNode, LINK_ITEM); - std::string::iterator aIt; - for (aIt = isResult.begin(); aIt != isResult.end(); aIt++) { - (*aIt) = toupper(*aIt); - } + std::transform(isResult.begin(), isResult.end(), isResult.begin(), + [](char c) { return static_cast(::toupper(c)); }); myIsResultLink = (isResult == "TRUE")? true : false; } } diff --git a/src/Config/Config_FeatureMessage.cpp b/src/Config/Config_FeatureMessage.cpp index 22ece8357..5e2d25c70 100644 --- a/src/Config/Config_FeatureMessage.cpp +++ b/src/Config/Config_FeatureMessage.cpp @@ -144,9 +144,9 @@ const std::string& Config_FeatureMessage::pluginLibrary() const return myPluginLibrary; } -void Config_FeatureMessage::setPluginLibrary(const std::string& myPluginLibrary) +void Config_FeatureMessage::setPluginLibrary(const std::string& thePluginLibrary) { - this->myPluginLibrary = myPluginLibrary; + this->myPluginLibrary = thePluginLibrary; } // LCOV_EXCL_START diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index f74f3aea5..61c2ec179 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -99,7 +99,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) std::string aCaseNodeID = getProperty(aCaseNode, _ID); std::string aSwitchNodeID = ""; const xmlChar* aName = aCaseNode->name; - xmlNodePtr aSwitchNode; + xmlNodePtr aSwitchNode = 0; if (!xmlStrcmp(aName, (const xmlChar *) WDG_SWITCH_CASE)) { aSwitchNode = hasParentRecursive(aCaseNode, WDG_SWITCH, NULL); } diff --git a/src/Config/Config_ValidatorReader.cpp b/src/Config/Config_ValidatorReader.cpp index 67516e194..e15dfb2ad 100644 --- a/src/Config/Config_ValidatorReader.cpp +++ b/src/Config/Config_ValidatorReader.cpp @@ -68,7 +68,7 @@ void Config_ValidatorReader::cleanup(xmlNodePtr theNode) } } -bool Config_ValidatorReader::processChildren(xmlNodePtr aNode) +bool Config_ValidatorReader::processChildren(xmlNodePtr /*aNode*/) { return true; } diff --git a/src/Config/Config_WidgetReader.cpp b/src/Config/Config_WidgetReader.cpp index 2c0bf1a29..f4fe27432 100644 --- a/src/Config/Config_WidgetReader.cpp +++ b/src/Config/Config_WidgetReader.cpp @@ -107,7 +107,10 @@ std::string Config_WidgetReader::dumpNode(xmlNodePtr theNode) std::string anOwnPanel = getProperty(theNode, PROPERTY_PANEL_ID); if (!anOwnPanel.empty()) { xmlBufferPtr buffer = xmlBufferCreate(); - int size = xmlNodeDump(buffer, theNode->doc, theNode, 0, 0); +#ifdef _DEBUG + int size = +#endif + xmlNodeDump(buffer, theNode->doc, theNode, 0, 0); result = std::string((char*) (buffer->content)); xmlBufferFree(buffer); } @@ -116,7 +119,10 @@ std::string Config_WidgetReader::dumpNode(xmlNodePtr theNode) //Replace all "source" nodes with content; resolveSourceNodes(theNode); xmlBufferPtr buffer = xmlBufferCreate(); - int size = xmlNodeDump(buffer, theNode->doc, theNode, 0, 0); +#ifdef _DEBUG + int size = +#endif + xmlNodeDump(buffer, theNode->doc, theNode, 0, 0); result = std::string((char*) (buffer->content)); xmlBufferFree(buffer); return result; diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index 8f15e0f25..8cba8cd4d 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -203,7 +203,7 @@ void Config_XMLReader::cleanup(xmlNodePtr) } // LCOV_EXCL_START -bool Config_XMLReader::processChildren(xmlNodePtr aNode) +bool Config_XMLReader::processChildren(xmlNodePtr /*aNode*/) { return true; } diff --git a/src/Config/Config_swig.h b/src/Config/Config_swig.h index 1b0d6f300..036c6d697 100644 --- a/src/Config/Config_swig.h +++ b/src/Config/Config_swig.h @@ -26,4 +26,12 @@ #include "Config_ValidatorReader.h" #include "Config_XMLReader.h" + #ifdef _MSC_VER + # pragma warning(disable: 4127) // conditional expression is constant + # pragma warning(disable: 4456) // declaration of variable hides previous local declaration + # pragma warning(disable: 4459) // declaration of variable hides global declaration + # pragma warning(disable: 4701) // potentially uninitialized local variable + # pragma warning(disable: 4703) // potentially uninitialized local pointer variable + #endif + #endif /* SRC_CONFIG_SWIG_H_ */ diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index d990b3f54..9b1744d32 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -304,8 +304,7 @@ std::list > } } - return GeomAlgoAPI_ShapeTools::intersect(anEdge, aFace, - aPlaneSelection->context()->groupName() == ModelAPI_ResultConstruction::group()); + return GeomAlgoAPI_ShapeTools::intersect(anEdge, aFace); } //================================================================================================== diff --git a/src/Events/Events.i b/src/Events/Events.i index e395be12e..92fdf329c 100644 --- a/src/Events/Events.i +++ b/src/Events/Events.i @@ -34,6 +34,11 @@ #include "Events_Loop.h" #include "Events_Message.h" #include "Events_MessageGroup.h" + + #ifdef _MSC_VER + # pragma warning(disable: 4456) // declaration of variable hides previous local declaration + # pragma warning(disable: 4459) // declaration of variable hides global declaration + #endif %} diff --git a/src/ExchangeAPI/ExchangeAPI_Export.cpp b/src/ExchangeAPI/ExchangeAPI_Export.cpp index 830209417..000e178ab 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Export.cpp @@ -181,7 +181,7 @@ ExportPtr exportToXAO(const std::shared_ptr & thePart, ExportPtr exportToXAO(const std::shared_ptr & thePart, const std::string & theFilePath, const ModelHighAPI_Selection& theSelectedShape, - const std::string & theAuthor, const std::string & theGeometryName) + const std::string & /*theAuthor*/, const std::string & /*theGeometryName*/) { apply(); // finish previous operation to make sure all previous operations are done std::shared_ptr aFeature = diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 4253f2bb5..29fcfe43b 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -234,7 +234,6 @@ static bool isInResults(AttributeSelectionListPtr theSelection, { // collect all results into a cashed set if (theCashedResults.empty()) { - std::list aResults; std::list::const_iterator aRes = theResults.cbegin(); for(; aRes != theResults.cend(); aRes++) { if (theCashedResults.count(*aRes)) @@ -511,8 +510,8 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName) int anElementID = 0; if (!isWholePart) { // element index actually is the ID of the selection - AttributeSelectionPtr aSelection = aSelectionList->value(aRow - 1); - int aReferenceID = GeomAlgoAPI_CompoundBuilder::id(aShape, aSelection->value()); + AttributeSelectionPtr aSel = aSelectionList->value(aRow - 1); + int aReferenceID = GeomAlgoAPI_CompoundBuilder::id(aShape, aSel->value()); if (aReferenceID == 0) // selected value does not found in the exported shape continue; diff --git a/src/ExchangePlugin/ExchangePlugin_ExportPart.cpp b/src/ExchangePlugin/ExchangePlugin_ExportPart.cpp index d589a0011..7ef6c5fe6 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportPart.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportPart.cpp @@ -196,9 +196,9 @@ void collectFeatures(DocumentPtr theDocument, std::set aFeaturesToExport; for (int anIndex = 0, aSize = theSelected->size(); anIndex < aSize; ++anIndex) { AttributeSelectionPtr aCurrent = theSelected->value(anIndex); - FeaturePtr aCurrentFeature = ModelAPI_Feature::feature(aCurrent->context()); - if (aCurrentFeature) - aFeaturesToExport.insert(aCurrentFeature); + FeaturePtr aCurFeature = ModelAPI_Feature::feature(aCurrent->context()); + if (aCurFeature) + aFeaturesToExport.insert(aCurFeature); } // recursively collect all features used for the selected results allReferencedFeatures(aFeaturesToExport, aFeaturesToExport); diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index 0b1c6cb95..20dd90a37 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -363,13 +363,13 @@ void ExchangePlugin_ImportFeature::removeFeature( } // LCOV_EXCL_STOP -int ExchangePlugin_ImportFeature::numberOfSubs(bool forTree) const +int ExchangePlugin_ImportFeature::numberOfSubs(bool /*forTree*/) const { return data()->reflist(FEATURES_ID())->size(true); } std::shared_ptr ExchangePlugin_ImportFeature::subFeature( - const int theIndex, bool forTree) + const int theIndex, bool /*forTree*/) { ObjectPtr anObj = data()->reflist(FEATURES_ID())->object(theIndex, false); FeaturePtr aRes = std::dynamic_pointer_cast(anObj); diff --git a/src/ExchangePlugin/ExchangePlugin_Validators.cpp b/src/ExchangePlugin/ExchangePlugin_Validators.cpp index e5df6d535..eb4ea4a15 100644 --- a/src/ExchangePlugin/ExchangePlugin_Validators.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Validators.cpp @@ -46,7 +46,8 @@ bool ExchangePlugin_FormatValidator::parseFormats(const std::list& continue; } std::string aFormats = anArg.substr(0, aSepPos); - std::transform(aFormats.begin(), aFormats.end(), aFormats.begin(), toupper); + std::transform(aFormats.begin(), aFormats.end(), aFormats.begin(), + [](char c) { return static_cast(::toupper(c)); }); std::list aFormatList = ExchangePlugin_Tools::split(aFormats, '|'); outFormats.insert(outFormats.end(), aFormatList.begin(), aFormatList.end()); } @@ -85,7 +86,8 @@ bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute, ExchangePlugin_FormatValidator::parseFormats(theArguments, aFormats); std::list::const_iterator itFormats = aFormats.begin(); size_t aFileNameLen = aFileName.length(); - std::transform(aFileName.begin(), aFileName.end(), aFileName.begin(), toupper); + std::transform(aFileName.begin(), aFileName.end(), aFileName.begin(), + [](char c) { return static_cast(::toupper(c)); }); // Is file name ends with the format for (; itFormats != aFormats.end(); ++itFormats) { std::string aFormat = "." + *itFormats; diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp index b032ae004..0c7f3bab1 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp @@ -97,8 +97,8 @@ void FeaturesPlugin_BooleanSmash::execute() // add unused shapes of compounds/compsolids to the history, // to avoid treating them as unused later when constructing a compound containing // the result of Smash and all unused sub-shapes of multi-level compounds - for (ListOfShape::iterator anIt = aNotUsed.begin(); anIt != aNotUsed.end(); ++anIt) - anObjectsHistory.addObject(*anIt); + for (ListOfShape::iterator aNUIt = aNotUsed.begin(); aNUIt != aNotUsed.end(); ++aNUIt) + anObjectsHistory.addObject(*aNUIt); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index 2a3eed919..4ab108ec7 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -288,13 +288,13 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aCompSolidIt.next()) { GeomShapePtr aSolidInCompSolid = aCompSolidIt.current(); - ListOfShape::iterator anIt = aUsedShapes.begin(); - for(; anIt != aUsedShapes.end(); anIt++) { - if(aSolidInCompSolid->isEqual(*anIt)) { + ListOfShape::iterator aUseIt = aUsedShapes.begin(); + for(; aUseIt != aUsedShapes.end(); anIt++) { + if(aSolidInCompSolid->isEqual(*aUseIt)) { break; } } - if(anIt == aUsedShapes.end()) { + if(aUseIt == aUsedShapes.end()) { aShapesToAdd.push_back(aSolidInCompSolid); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp index f49aa97a8..56f586175 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp @@ -67,7 +67,7 @@ std::shared_ptr FeaturesPlugin_CompositeSketch::addFeature(std } //================================================================================================= -int FeaturesPlugin_CompositeSketch::numberOfSubs(bool forTree) const +int FeaturesPlugin_CompositeSketch::numberOfSubs(bool /*forTree*/) const { ObjectPtr aObj = data()->reference(SKETCH_ID())->value(); return aObj.get() ? 1 : 0; @@ -75,7 +75,7 @@ int FeaturesPlugin_CompositeSketch::numberOfSubs(bool forTree) const //================================================================================================= std::shared_ptr FeaturesPlugin_CompositeSketch::subFeature(const int theIndex, - bool forTree) + bool /*forTree*/) { FeaturePtr aSubFeature; if(theIndex == 0) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp b/src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp index 315f3e707..2a6119eb4 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp @@ -484,7 +484,6 @@ AISObjectPtr FeaturesPlugin_Measurement::radiusDimension(AISObjectPtr thePreviou } if (aShape.get()) { TopoDS_Shape aShp = aShape->impl(); - Handle(AIS_RadiusDimension) aDim; if (thePrevious.get()) { aAISObj = thePrevious; Handle(AIS_InteractiveObject) aAIS = aAISObj->impl(); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp index be47490ad..a582dcc92 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp @@ -302,6 +302,7 @@ void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr theBa } case GeomAPI_Shape::COMPOUND: { aShapeTypeToExplode = GeomAPI_Shape::COMPOUND; + break; } default: return; // unsupported type of shape diff --git a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp index 26573fe20..41a18c8c8 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp @@ -28,7 +28,7 @@ #include bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { bool aValid = true; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index 8b504ec4d..e92148495 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -62,6 +62,10 @@ #define _USE_MATH_DEFINES #include +#ifdef _MSC_VER +#pragma warning(disable: 4100) +#endif + //================================================================================================== bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, const std::list& theArguments, @@ -433,7 +437,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute return false; } - GeomShapePtr aContextShape = aContext->shape(); + aContextShape = aContext->shape(); if(aShape->isEqual(aContextShape)) { // Whole construction selected. Check that it have faces. if(aConstruction->facesNum() > 0) { @@ -1559,16 +1563,16 @@ bool FeaturesPlugin_IntersectionSelection::isValid(const AttributePtr& theAttrib return false; } ResultPtr aContext = anAttrSelection->context(); - if(!aContext.get()) { - FeaturePtr aContFeat = anAttrSelection->contextFeature(); - if (!aContFeat.get() || !aContFeat->results().size() || - aContFeat->firstResult()->groupName() != ModelAPI_ResultBody::group()) { + if (aContext.get()) { + aFeature = ModelAPI_Feature::feature(aContext); + } else { + aFeature = anAttrSelection->contextFeature(); + if (!aFeature.get() || !aFeature->results().size() || + aFeature->firstResult()->groupName() != ModelAPI_ResultBody::group()) { theError = "Error: Empty selection context."; return false; } } - FeaturePtr aFeature = anAttrSelection->contextFeature().get() ? - anAttrSelection->contextFeature() : ModelAPI_Feature::feature(aContext); if (!aFeature.get()) { theError = "Error: empty feature."; return false; diff --git a/src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp b/src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp index 466afecc9..7dfa2e339 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp @@ -93,8 +93,8 @@ void FeaturesPlugin_VersionedChFi::execute() aMakeShapeList, *anIt, aPrefix); setResult(aResultBody, aResultIndex++); - for (ListOfShape::iterator anIt = anEdges.begin(); anIt != anEdges.end(); ++anIt) { - GeomShapePtr aBase = *anIt; + for (ListOfShape::iterator aEIt = anEdges.begin(); aEIt != anEdges.end(); ++aEIt) { + GeomShapePtr aBase = *aEIt; // Store new faces generated from edges and vertices aResultBody->loadGeneratedShapes(aMakeShapeList, aBase, GeomAPI_Shape::EDGE, aPrefix, true); } diff --git a/src/FiltersPlugin/FiltersPlugin_BelongsTo.cpp b/src/FiltersPlugin/FiltersPlugin_BelongsTo.cpp index c42855d05..f21c7b586 100644 --- a/src/FiltersPlugin/FiltersPlugin_BelongsTo.cpp +++ b/src/FiltersPlugin/FiltersPlugin_BelongsTo.cpp @@ -21,7 +21,7 @@ #include -bool FiltersPlugin_BelongsTo::isSupported(GeomAPI_Shape::ShapeType theType) const +bool FiltersPlugin_BelongsTo::isSupported(GeomAPI_Shape::ShapeType /*theType*/) const { return true; } @@ -35,8 +35,8 @@ bool FiltersPlugin_BelongsTo::isOk(const GeomShapePtr& theShape, const ResultPtr if (!aList.get()) return false; for (int i = 0; i < aList->size(); i++) { - AttributeSelectionPtr aAttr = aList->value(i); - GeomShapePtr aGeom = aAttr->value(); + AttributeSelectionPtr aCurAttr = aList->value(i); + GeomShapePtr aGeom = aCurAttr->value(); if (aGeom && aGeom->isSubShape(theShape)) return true; } diff --git a/src/FiltersPlugin/FiltersPlugin_ExternalFaces.cpp b/src/FiltersPlugin/FiltersPlugin_ExternalFaces.cpp index b30bd5591..7596b1d77 100644 --- a/src/FiltersPlugin/FiltersPlugin_ExternalFaces.cpp +++ b/src/FiltersPlugin/FiltersPlugin_ExternalFaces.cpp @@ -31,7 +31,7 @@ bool FiltersPlugin_ExternalFaces::isSupported(GeomAPI_Shape::ShapeType theType) bool FiltersPlugin_ExternalFaces::isOk(const GeomShapePtr& theShape, const ResultPtr& theResult, - const ModelAPI_FiltersArgs& theArgs) const + const ModelAPI_FiltersArgs& /*theArgs*/) const { if (!theShape->isFace()) return false; diff --git a/src/FiltersPlugin/FiltersPlugin_HorizontalFace.cpp b/src/FiltersPlugin/FiltersPlugin_HorizontalFace.cpp index 2ef639695..938d4cd73 100644 --- a/src/FiltersPlugin/FiltersPlugin_HorizontalFace.cpp +++ b/src/FiltersPlugin/FiltersPlugin_HorizontalFace.cpp @@ -28,7 +28,7 @@ bool FiltersPlugin_HorizontalFace::isSupported(GeomAPI_Shape::ShapeType theType) } bool FiltersPlugin_HorizontalFace::isOk(const GeomShapePtr& theShape, const ResultPtr&, - const ModelAPI_FiltersArgs& theArgs) const + const ModelAPI_FiltersArgs& /*theArgs*/) const { if (!theShape->isFace() || !theShape->isPlanar()) return false; diff --git a/src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp b/src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp index 87fa74e0a..ded1efd5f 100644 --- a/src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp +++ b/src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp @@ -35,10 +35,10 @@ bool FiltersPlugin_OnGeometry::isOk(const GeomShapePtr& theShape, const ResultPt if (!aList.get()) return false; for (int i = 0; i < aList->size(); i++) { - AttributeSelectionPtr aAttr = aList->value(i); - GeomShapePtr aGeom = aAttr->value(); + AttributeSelectionPtr aCurAttr = aList->value(i); + GeomShapePtr aGeom = aCurAttr->value(); if (!aGeom) - aGeom = aAttr->context()->shape(); + aGeom = aCurAttr->context()->shape(); if (aGeom && aGeom->isSameGeometry(theShape)) return true; } diff --git a/src/FiltersPlugin/FiltersPlugin_OnPlane.cpp b/src/FiltersPlugin/FiltersPlugin_OnPlane.cpp index 91634e9ad..095117a0e 100644 --- a/src/FiltersPlugin/FiltersPlugin_OnPlane.cpp +++ b/src/FiltersPlugin/FiltersPlugin_OnPlane.cpp @@ -98,9 +98,8 @@ bool FiltersPlugin_OnPlane::isOk(const GeomShapePtr& theShape, const ResultPtr&, if (aFace->isPlanar()) { GeomPlanePtr aPln = aFace->getPlane(); for (int i = 0; i < aList->size(); i++) { - AttributeSelectionPtr aAttr = aList->value(i); - GeomShapePtr aGeom = aAttr->value(); - GeomPlanePtr aPlane = getPlane(aAttr); + AttributeSelectionPtr aCurAttr = aList->value(i); + GeomPlanePtr aPlane = getPlane(aCurAttr); if (aPlane->isCoincident(aPln)) return true; } diff --git a/src/FiltersPlugin/FiltersPlugin_OnPlaneSide.cpp b/src/FiltersPlugin/FiltersPlugin_OnPlaneSide.cpp index 0ec771b3c..9554d53ca 100644 --- a/src/FiltersPlugin/FiltersPlugin_OnPlaneSide.cpp +++ b/src/FiltersPlugin/FiltersPlugin_OnPlaneSide.cpp @@ -27,7 +27,7 @@ #include -bool FiltersPlugin_OnPlaneSide::isSupported(GeomAPI_Shape::ShapeType theType) const +bool FiltersPlugin_OnPlaneSide::isSupported(GeomAPI_Shape::ShapeType /*theType*/) const { return true; } diff --git a/src/FiltersPlugin/FiltersPlugin_Validators.cpp b/src/FiltersPlugin/FiltersPlugin_Validators.cpp index 63c644ca6..c4d6426a9 100644 --- a/src/FiltersPlugin/FiltersPlugin_Validators.cpp +++ b/src/FiltersPlugin/FiltersPlugin_Validators.cpp @@ -25,7 +25,7 @@ #include bool FiltersPlugin_ShapeTypeValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { if (!theAttribute) diff --git a/src/FiltersPlugin/FiltersPlugin_VerticalFace.cpp b/src/FiltersPlugin/FiltersPlugin_VerticalFace.cpp index 01f9154a2..8e4fcde90 100644 --- a/src/FiltersPlugin/FiltersPlugin_VerticalFace.cpp +++ b/src/FiltersPlugin/FiltersPlugin_VerticalFace.cpp @@ -33,7 +33,7 @@ bool FiltersPlugin_VerticalFace::isSupported(GeomAPI_Shape::ShapeType theType) c } bool FiltersPlugin_VerticalFace::isOk(const GeomShapePtr& theShape, const ResultPtr&, - const ModelAPI_FiltersArgs& theArgs) const + const ModelAPI_FiltersArgs& /*theArgs*/) const { static const double THE_TOLERANCE = 1.e-7; diff --git a/src/GeomAPI/GeomAPI_AISObject.cpp b/src/GeomAPI/GeomAPI_AISObject.cpp index 330ee20cb..0cf6c079f 100644 --- a/src/GeomAPI/GeomAPI_AISObject.cpp +++ b/src/GeomAPI/GeomAPI_AISObject.cpp @@ -105,12 +105,11 @@ std::shared_ptr GeomAPI_AISObject::getShape() const if (!anAIS.IsNull()) { Handle(AIS_Shape) aShapeAIS = Handle(AIS_Shape)::DownCast(anAIS); if (aShapeAIS) { - std::shared_ptr aResult(new GeomAPI_Shape); + aResult.reset(new GeomAPI_Shape); aResult->setImpl(new TopoDS_Shape(aShapeAIS->Shape())); - return aResult; } } - return std::shared_ptr(); + return aResult; } void GeomAPI_AISObject::createDistance(std::shared_ptr theStartPoint, diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index 2fb3073a2..99d21c307 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -469,7 +469,8 @@ GeomAPI_Shape::ShapeType GeomAPI_Shape::shapeType() const GeomAPI_Shape::ShapeType GeomAPI_Shape::shapeTypeByStr(std::string theType) { - std::transform(theType.begin(), theType.end(), theType.begin(), ::toupper); + std::transform(theType.begin(), theType.end(), theType.begin(), + [](char c) { return static_cast(::toupper(c)); }); if (theType == "COMPOUND" || theType == "COMPOUNDS") return COMPOUND; if (theType == "COMPSOLID" || theType == "COMPSOLIDS") diff --git a/src/GeomAPI/GeomAPI_swig.h b/src/GeomAPI/GeomAPI_swig.h index 17fcd63bd..5974c2266 100644 --- a/src/GeomAPI/GeomAPI_swig.h +++ b/src/GeomAPI/GeomAPI_swig.h @@ -68,6 +68,14 @@ #include #include + #ifdef _MSC_VER + # pragma warning(disable: 4127) // conditional expression is constant + # pragma warning(disable: 4456) // declaration of variable hides previous local declaration + # pragma warning(disable: 4459) // declaration of variable hides global declaration + # pragma warning(disable: 4701) // potentially uninitialized local variable + # pragma warning(disable: 4703) // potentially uninitialized local pointer variable + #endif + template std::shared_ptr shared_ptr_cast(std::shared_ptr theObject) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp index cc000fc26..f20f60c26 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp @@ -257,7 +257,6 @@ void GeomAlgoAPI_MakeShape::initialize() void GeomAlgoAPI_MakeShape::prepareNamingFaces() { long long index = 1; - GeomAPI_ShapeExplorer anExp(shape(), GeomAPI_Shape::FACE); for(GeomAPI_ShapeExplorer anExp(shape(), GeomAPI_Shape::FACE); anExp.more(); anExp.next()) { GeomShapePtr aFace = anExp.current(); myCreatedFaces["Face_" + std::to_string(index++)] = aFace; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp index 629f12df2..eff0d0fe0 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp @@ -86,14 +86,14 @@ const GeomShapePtr GeomAlgoAPI_MakeShapeList::shape() const void GeomAlgoAPI_MakeShapeList::generated(const GeomShapePtr theOldShape, ListOfShape& theNewShapes) { - result(theOldShape, GeomAlgoAPI_MakeShapeList::Generated, theNewShapes); + result(theOldShape, theNewShapes); } //================================================================================================== void GeomAlgoAPI_MakeShapeList::modified(const GeomShapePtr theOldShape, ListOfShape& theNewShapes) { - result(theOldShape, GeomAlgoAPI_MakeShapeList::Modified, theNewShapes); + result(theOldShape, theNewShapes); } //================================================================================================== @@ -114,7 +114,6 @@ bool GeomAlgoAPI_MakeShapeList::isDeleted(const GeomShapePtr theOldShape) //================================================================================================== void GeomAlgoAPI_MakeShapeList::result(const GeomShapePtr theOldShape, - OperationType theOperationType, ListOfShape& theNewShapes) { if(myListOfMakeShape.empty()) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h index 24cfb2905..9800c1c31 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h @@ -71,7 +71,6 @@ public: private: void result(const GeomShapePtr theShape, - OperationType theOperationType, ListOfShape& theHistory); protected: diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp index de2324617..19787b7cd 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp @@ -234,7 +234,7 @@ void GeomAlgoAPI_Placement::build(const std::shared_ptr& theSourc // store the accumulated information about the result and this delta myTrsf.reset(new GeomAPI_Trsf(new gp_Trsf(aTrsf))); TopoDS_Shape aResult = aSourceShape.Moved(aDelta); - std::shared_ptr aShape(new GeomAPI_Shape()); + aShape.reset(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(aResult)); this->setShape(aShape); this->setDone(true); // it is allways true for simple transformation generation @@ -251,7 +251,7 @@ void GeomAlgoAPI_Placement::build(const std::shared_ptr& theSourc } TopoDS_Shape aResult = aBuilder->Shape(); - std::shared_ptr aShape(new GeomAPI_Shape()); + aShape.reset(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(aResult)); this->setShape(aShape); this->setDone(true); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp index e39e2075a..052a43ed8 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp @@ -29,7 +29,7 @@ #include bool STEPExport(const std::string& theFileName, - const std::string& theFormatName, + const std::string& /*theFormatName*/, const std::shared_ptr& theShape, std::string& theError) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp index 639e9aace..d35f58bad 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp @@ -297,8 +297,8 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( aTempIter(aTempList); aTempIter.More(); aTempIter.Next()) { const TopoDS_Shape& aTempShape = aTempIter.Value(); for(TopTools_IndexedDataMapOfShapeListOfShape::Iterator - anIter(aMapSA); anIter.More(); anIter.Next()) { - TopTools_ListOfShape& aTempListOfShape = anIter.ChangeValue(); + anIter2(aMapSA); anIter2.More(); anIter2.Next()) { + TopTools_ListOfShape& aTempListOfShape = anIter2.ChangeValue(); if(aTempListOfShape.IsEmpty()) { continue; } else if(aTempListOfShape.Size() == 1 && aTempListOfShape.First() == aTempShape) { @@ -872,8 +872,7 @@ bool GeomAlgoAPI_ShapeTools::isParallel(const std::shared_ptr theE //================================================================================================== std::list > GeomAlgoAPI_ShapeTools::intersect( - const std::shared_ptr theEdge, const std::shared_ptr theFace, - const bool thePointsOutsideFace) + const std::shared_ptr theEdge, const std::shared_ptr theFace) { std::list > aResult; if(!theEdge.get() || !theFace.get()) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h index b24f6c177..e321dd3e3 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h @@ -145,12 +145,11 @@ public: GEOMALGOAPI_EXPORT static bool isParallel(const std::shared_ptr theEdge, const std::shared_ptr theFace); - // Computes intersection point between the edge curve and a face surface (only one point, with - // preferences to point that belongs to edge and face boundaries. + /// Computes intersection point between the edge curve and a face surface (only one point, with + /// preferences to point that belongs to edge and face boundaries. /// \returns null if there is no intersection GEOMALGOAPI_EXPORT static std::list > intersect( - const std::shared_ptr theEdge, const std::shared_ptr theFace, - const bool thePointsOutsideFace); + const std::shared_ptr theEdge, const std::shared_ptr theFace); typedef std::map, std::pair >, diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp index ceb786746..867bb355b 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp @@ -202,7 +202,7 @@ static void sortAreas(TopTools_ListOfShape& theAreas, void GeomAlgoAPI_SketchBuilder::build( const std::shared_ptr& theOrigin, - const std::shared_ptr& theDirX, + const std::shared_ptr& /*theDirX*/, const std::shared_ptr& theNorm, const std::list >& theEdges) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp index 3dea07408..bfc4cb149 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp @@ -113,9 +113,9 @@ GeomShapePtr GeomAlgoAPI_WireBuilder::wire(const ListOfShape& theShapes) anEdge.Orientation(TopAbs_FORWARD); // if the edge was already processed, remove it to keep original order of the current wire if (!aProcessedEdges.add(anEdge)) { - for (TopTools_ListIteratorOfListOfShape anIt(aListOfEdges); anIt.More(); anIt.Next()) - if (SetOfEdges::isEqual(anEdge, anIt.Value())) { - aListOfEdges.Remove(anIt); + for (TopTools_ListIteratorOfListOfShape aEIt(aListOfEdges); aEIt.More(); aEIt.Next()) + if (SetOfEdges::isEqual(anEdge, aEIt.Value())) { + aListOfEdges.Remove(aEIt); break; } } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_swig.h b/src/GeomAlgoAPI/GeomAlgoAPI_swig.h index f35a402f0..124e4b913 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_swig.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_swig.h @@ -68,4 +68,11 @@ #include #include + #ifdef _MSC_VER + # pragma warning(disable: 4456) // declaration of variable hides previous local declaration + # pragma warning(disable: 4459) // declaration of variable hides global declaration + # pragma warning(disable: 4701) // potentially uninitialized local variable + # pragma warning(disable: 4703) // potentially uninitialized local pointer variable + #endif + #endif /* SRC_GEOMALGOAPI_GEOMALGOAPI_SWIG_H_ */ diff --git a/src/GeomValidators/GeomValidators_ConstructionComposite.cpp b/src/GeomValidators/GeomValidators_ConstructionComposite.cpp index 1bcb58b77..64f4a404f 100644 --- a/src/GeomValidators/GeomValidators_ConstructionComposite.cpp +++ b/src/GeomValidators/GeomValidators_ConstructionComposite.cpp @@ -26,7 +26,7 @@ #include "ModelAPI_CompositeFeature.h" bool GeomValidators_ConstructionComposite::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { bool aValid = true; diff --git a/src/GeomValidators/GeomValidators_DifferentShapes.cpp b/src/GeomValidators/GeomValidators_DifferentShapes.cpp index 92efa01ef..36f6906e9 100644 --- a/src/GeomValidators/GeomValidators_DifferentShapes.cpp +++ b/src/GeomValidators/GeomValidators_DifferentShapes.cpp @@ -30,7 +30,7 @@ //================================================================================================= bool GeomValidators_DifferentShapes::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { bool isValid = false; diff --git a/src/GeomValidators/GeomValidators_Finite.cpp b/src/GeomValidators/GeomValidators_Finite.cpp index 0b1db5b9e..d0a7f7616 100644 --- a/src/GeomValidators/GeomValidators_Finite.cpp +++ b/src/GeomValidators/GeomValidators_Finite.cpp @@ -25,7 +25,7 @@ #include bool GeomValidators_Finite::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { bool aValid = true; diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp index 5b5fd026a..1db9dd752 100644 --- a/src/GeomValidators/GeomValidators_ShapeType.cpp +++ b/src/GeomValidators/GeomValidators_ShapeType.cpp @@ -63,7 +63,8 @@ GeomValidators_ShapeType::TypeOfShape MyShapeTypes["compound"] = Compound; } std::string aType = std::string(theType.c_str()); - std::transform(aType.begin(), aType.end(), aType.begin(), ::tolower); + std::transform(aType.begin(), aType.end(), aType.begin(), + [](char c) { return static_cast(::tolower(c)); }); if (MyShapeTypes.find(aType) != MyShapeTypes.end()) return MyShapeTypes[aType]; @@ -113,9 +114,8 @@ bool GeomValidators_ShapeType::isValid(const AttributePtr& theAttribute, } if (!aValid && theError.empty()) { std::string aTypes; - std::list::const_iterator anIt = theArguments.begin(), aLast = theArguments.end(); // returns true if the attribute satisfies at least one of given arguments - for (; anIt != aLast; anIt++) { + for (anIt = theArguments.begin(); anIt != aLast; anIt++) { if (!aTypes.empty()) aTypes += ", "; aTypes += *anIt; @@ -169,12 +169,12 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute theError = "It has reference to an empty attribute"; } else { - std::string anAttributeType = aRefAttr->attributeType(); - aValid = anAttributeType == GeomDataAPI_Point2D::typeId(); + std::string anAttrType = aRefAttr->attributeType(); + aValid = anAttrType == GeomDataAPI_Point2D::typeId(); if (!aValid) { // LCOV_EXCL_START theError = "Shape type is \"%1\", it should be \"%2\""; - theError.arg(anAttributeType).arg(getShapeTypeDescription(theShapeType)); + theError.arg(anAttrType).arg(getShapeTypeDescription(theShapeType)); // LCOV_EXCL_STOP } } diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.cpp b/src/GeomValidators/GeomValidators_ZeroOffset.cpp index ff484ce85..294fc500e 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.cpp +++ b/src/GeomValidators/GeomValidators_ZeroOffset.cpp @@ -137,8 +137,8 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& aToShape = anAttrSel->context()->shape(); } if (aToShape->isCompound()) { - GeomAPI_ShapeIterator anIt(aToShape); - aToShape = anIt.current(); + GeomAPI_ShapeIterator aSIt(aToShape); + aToShape = aSIt.current(); } } anIt++; @@ -156,8 +156,8 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& aFromShape = anAttrSel->context()->shape(); } if (aFromShape->isCompound()) { - GeomAPI_ShapeIterator anIt(aFromShape); - aFromShape = anIt.current(); + GeomAPI_ShapeIterator aSIt(aFromShape); + aFromShape = aSIt.current(); } } anIt++; diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 888f0c00a..68c9c3203 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -366,9 +366,9 @@ std::shared_ptr Model_AttributeSelection::internalValue(CenterTyp std::size_t aPartEnd = aSubShapeName.find('/'); if (aPartEnd != std::string::npos && aPartEnd != aSubShapeName.rfind('/')) { std::string aNameInPart = aSubShapeName.substr(aPartEnd + 1); - int anIndex; + int anInd; std::string aType; // to reuse already existing selection the type is not needed - return aPart->shapeInPart(aNameInPart, aType, anIndex); + return aPart->shapeInPart(aNameInPart, aType, anInd); } } } @@ -557,7 +557,7 @@ void Model_AttributeSelection::split( aSubSh->setImpl(new TopoDS_Shape(aSub.Value())); setValue(theContext, aSubSh); for(aSub.Next(); aSub.More(); aSub.Next()) { - GeomShapePtr aSubSh(new GeomAPI_Shape); + aSubSh.reset(new GeomAPI_Shape); aSubSh->setImpl(new TopoDS_Shape(aSub.Value())); myParent->append(theContext, aSubSh); } @@ -752,7 +752,7 @@ static std::map& centersMa std::string Model_AttributeSelection::namingName(const std::string& theDefaultName) { - std::string aName(""); + std::string aName; if(!this->isInitialized()) return !theDefaultName.empty() ? theDefaultName : aName; @@ -761,7 +761,6 @@ std::string Model_AttributeSelection::namingName(const std::string& theDefaultNa GeomShapePtr aShape = value(); if (!aShape.get() && context().get()) aShape = context()->shape(); - std::string aName; if (aShape.get()) { aName = aShape->shapeTypeStr(); if (myParent) { @@ -1252,8 +1251,7 @@ void Model_AttributeSelection::computeValues( NCollection_DataMap aSubs; TopTools_DataMapOfShapeShape::Iterator aContIter(aNewToOld); for(; aContIter.More(); aContIter.Next()) { - TopExp_Explorer aSubExp(aContIter.Key(), aValType); - for(; aSubExp.More(); aSubExp.Next()) { + for(aSubExp.Init(aContIter.Key(), aValType); aSubExp.More(); aSubExp.Next()) { if (!aSubs.IsBound(aSubExp.Current())) { aSubs.Bind(aSubExp.Current(), TopTools_MapOfShape()); } @@ -1703,10 +1701,8 @@ void Model_AttributeSelection::updateInHistory(bool& theRemove) TopTools_ListOfShape aValShapes; if (searchNewContext(aDoc, aNewCShape, aContext, aValShape, aContLab, aNewContexts, aValShapes)) { - std::set allContexts, aSkippedContext; - std::list::iterator aNewContext = aNewContexts.begin(); - for(; aNewContext != aNewContexts.end(); aNewContext++) - allContexts.insert(*aNewContext); + std::set allContexts(aNewContexts.begin(), aNewContexts.end()); + std::set aSkippedContext; // if there exist context composite and sub-result(s), leave only sub(s) std::set::iterator aResIter = allContexts.begin(); @@ -1914,7 +1910,7 @@ bool Model_AttributeSelection::restoreContext(std::string theName, if (theName.find(aDoc->kind()) == 0) { // remove the document identifier from name if exists aSubShapeName = theName.substr(aDoc->kind().size() + 1); aName = aSubShapeName; - std::string::size_type n = aName.find('/'); + n = aName.find('/'); if (n != std::string::npos) { aName = aName.substr(0, n); } diff --git a/src/Model/Model_AttributeSelectionList.cpp b/src/Model/Model_AttributeSelectionList.cpp index b7b60d9f9..4b9846d69 100644 --- a/src/Model/Model_AttributeSelectionList.cpp +++ b/src/Model/Model_AttributeSelectionList.cpp @@ -301,7 +301,7 @@ static bool isIn(GeomShapePtr theInList, GeomShapePtr theShape) { bool Model_AttributeSelectionList::isInList(const ObjectPtr& theContext, const std::shared_ptr& theSubShape, - const bool theTemporarily) + const bool /*theTemporarily*/) { if (myIsCashed) { // the cashing is active if (theContext.get()) { diff --git a/src/Model/Model_AttributeTables.cpp b/src/Model/Model_AttributeTables.cpp index c0e79e4d0..5bd664515 100644 --- a/src/Model/Model_AttributeTables.cpp +++ b/src/Model/Model_AttributeTables.cpp @@ -110,7 +110,8 @@ void Model_AttributeTables::setSize(const int theRows, const int theColumns, con for(int aTable = 0; aTable < theTables; aTable++) { for(int aColumn = 0; aColumn < theColumns; aColumn++) { for(int aRow = 0; aRow < theRows; aRow++) { - int anOldIndex, anIndex = aTable * theRows * theColumns + aRow * theColumns + aColumn; + int anOldIndex = 0; + int anIndex = aTable * theRows * theColumns + aRow * theColumns + aColumn; bool aRestore = aTable < myTables && aColumn < myCols && aRow < myRows; if (aRestore) anOldIndex = aTable * myRows * myCols + aRow * myCols + aColumn; diff --git a/src/Model/Model_AttributeValidator.cpp b/src/Model/Model_AttributeValidator.cpp index 05bc23f74..d29834c93 100644 --- a/src/Model/Model_AttributeValidator.cpp +++ b/src/Model/Model_AttributeValidator.cpp @@ -32,7 +32,7 @@ #include bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { if (theAttribute->attributeType() == ModelAPI_AttributeInteger::typeId()) { diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index b78b1c707..decf415ac 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -268,12 +268,12 @@ AttributePtr Model_Data::addFloatingAttribute( for(; anIter.More(); anIter.Next()) { TCollection_AsciiString aThisName(Handle(TDataStd_Name)::DownCast(anIter.Value())->Get()); if (theID == aThisName.ToCString()) { - TDF_Label aLab = anIter.Value()->Label(); + TDF_Label aChildLab = anIter.Value()->Label(); Handle(TDataStd_Name) aGName; - if (aLab.FindAttribute(kGroupAttributeGroupID, aGName)) { + if (aChildLab.FindAttribute(kGroupAttributeGroupID, aGName)) { TCollection_AsciiString aGroupName(aGName->Get()); if (theGroup == aGroupName.ToCString()) { - return addAttribute(theGroup + "__" + theID, theAttrType, aLab.Tag()); + return addAttribute(theGroup + "__" + theID, theAttrType, aChildLab.Tag()); } } } @@ -739,9 +739,9 @@ void Model_Data::referencesToObjects( if (aRef->isObject()) { aReferenced.push_back(aRef->object()); } else { - AttributePtr anAttr = aRef->attr(); - if (anAttr.get()) - aReferenced.push_back(anAttr->owner()); + AttributePtr aReferredAttr = aRef->attr(); + if (aReferredAttr.get()) + aReferenced.push_back(aReferredAttr->owner()); } } else if (aType == ModelAPI_AttributeRefList::typeId()) { // list of references aReferenced = std::dynamic_pointer_cast(anAttr)->list(); diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 8469e5e75..5a9c7b4c4 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -528,8 +528,8 @@ bool Model_Document::save( if (!aDocName.empty()) { // just copy file TCollection_AsciiString aSubPath(DocFileName(anApp->loadPath().c_str(), aDocName)); - OSD_Path aPath(aSubPath); - OSD_File aFile(aPath); + OSD_Path aCopyPath(aSubPath); + OSD_File aFile(aCopyPath); if (aFile.Exists()) { TCollection_AsciiString aDestinationDir(DocFileName(theDirName, aDocName)); OSD_Path aDestination(aDestinationDir); @@ -764,7 +764,7 @@ static bool isEmptyTransaction(const Handle(TDocStd_Document)& theDoc) { aDelta = theDoc->GetUndos().Last(); TDF_LabelList aDeltaList; aDelta->Labels(aDeltaList); // it clears list, so, use new one and then append to the result - for(TDF_ListIteratorOfLabelList aListIter(aDeltaList); aListIter.More(); aListIter.Next()) { + if (!aDeltaList.IsEmpty()) { return false; } // add also label of the modified attributes diff --git a/src/Model/Model_FeatureValidator.cpp b/src/Model/Model_FeatureValidator.cpp index 12bbab870..794fc048f 100644 --- a/src/Model/Model_FeatureValidator.cpp +++ b/src/Model/Model_FeatureValidator.cpp @@ -32,7 +32,7 @@ #include bool Model_FeatureValidator::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { static Model_ValidatorsFactory* aValidators = diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index d83240df3..69955315d 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -893,10 +893,8 @@ void Model_Objects::synchronizeFeatures( ModelAPI_Tools::allResults(aFeature, aResults); std::list::iterator aResIter = aResults.begin(); for(; aResIter != aResults.end(); aResIter++) { - std::list > anAttrs = - (*aResIter)->data()->attributes(""); - std::list >::iterator anAttr = anAttrs.begin(); - for(; anAttr != anAttrs.end(); anAttr++) + anAttrs = (*aResIter)->data()->attributes(""); + for(anAttr = anAttrs.begin(); anAttr != anAttrs.end(); anAttr++) (*anAttr)->reinit(); } } @@ -1189,7 +1187,7 @@ TDF_Label Model_Objects::resultLabel( bool Model_Objects::hasCustomName(DataPtr theFeatureData, ResultPtr theResult, - int theResultIndex, + int /*theResultIndex*/, std::string& theParentName) const { ResultBodyPtr aBodyRes = std::dynamic_pointer_cast(theFeatureData->owner()); diff --git a/src/Model/Model_ResultBody.cpp b/src/Model/Model_ResultBody.cpp index 1edff2c2e..7d6918c6a 100644 --- a/src/Model/Model_ResultBody.cpp +++ b/src/Model/Model_ResultBody.cpp @@ -128,12 +128,12 @@ void Model_ResultBody::loadFirstLevel(GeomShapePtr theShape, const std::string& } } -int Model_ResultBody::numberOfSubs(bool forTree) const +int Model_ResultBody::numberOfSubs(bool /*forTree*/) const { return int(mySubs.size()); } -ResultBodyPtr Model_ResultBody::subResult(const int theIndex, bool forTree) const +ResultBodyPtr Model_ResultBody::subResult(const int theIndex, bool /*forTree*/) const { if (theIndex >= int(mySubs.size())) return ResultBodyPtr(); diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index ee7f404a7..19776ba2a 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -222,7 +222,7 @@ void Model_ResultConstruction::setInfinite(const bool theInfinite) } } -int Model_ResultConstruction::facesNum(const bool theUpdateNaming) +int Model_ResultConstruction::facesNum(const bool /*theUpdateNaming*/) { int aResult = 0; std::shared_ptr aData = std::dynamic_pointer_cast(data()); @@ -294,8 +294,8 @@ void Model_ResultConstruction::storeShape(std::shared_ptr theShap TopExp_Explorer anExp(aShape, TopAbs_VERTEX); for(int anIndex = 1; anExp.More(); anExp.Next(), anIndex++) { TDF_Label aSubLab = aShapeLab.FindChild(anIndex); - TNaming_Builder aBuilder(aSubLab); - aBuilder.Generated(anExp.Current()); + TNaming_Builder aSubBuilder(aSubLab); + aSubBuilder.Generated(anExp.Current()); std::string aVertexName = aMyName + "_" + (anIndex == 1 ? "StartVertex" : "EndVertex"); TDataStd_Name::Set(aSubLab, aVertexName.c_str()); aMyDoc->addNamingName(aSubLab, aVertexName); diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index 5a1403ef9..de686eebc 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -347,9 +347,9 @@ std::list > Model_Session::allOpenedDocuments std::list > aResult; aResult.push_back(moduleDocument()); // add subs recursively - std::list >::iterator aDoc = aResult.begin(); - for(; aDoc != aResult.end(); aDoc++) { - DocumentPtr anAPIDoc = *aDoc; + std::list >::iterator aDocIt = aResult.begin(); + for(; aDocIt != aResult.end(); aDocIt++) { + DocumentPtr anAPIDoc = *aDocIt; std::shared_ptr aDoc = std::dynamic_pointer_cast(anAPIDoc); if (aDoc) { const std::set aSubs = aDoc->subDocuments(); @@ -647,7 +647,7 @@ void Model_Session::blockAutoUpdate(const bool theBlock) aLoop->send(aMsg); } else { // if there is no operation, start it to avoid modifications outside of transaction - bool isOperation = this->isOperation(); + isOperation = this->isOperation(); if (!isOperation) startOperation("Auto update enabling"); static const Events_ID kAutoOn = aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE); diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 9e8de8d22..5d0eca89f 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -202,11 +202,11 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) { ModelAPI_Tools::allResults(theFeature, allResults); std::list::iterator aRes = allResults.begin(); for(; aRes != allResults.end(); aRes++) { - const std::set >& aRefs = (*aRes)->data()->refsToMe(); - std::set >::const_iterator aRefIter = aRefs.cbegin(); - for(; aRefIter != aRefs.cend(); aRefIter++) { - if ((*aRefIter)->isArgument()) { - FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRefIter)->owner()); + const std::set >& aResRefs = (*aRes)->data()->refsToMe(); + std::set >::const_iterator aRIter = aResRefs.cbegin(); + for(; aRIter != aResRefs.cend(); aRIter++) { + if ((*aRIter)->isArgument()) { + FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRIter)->owner()); if (aReferenced.get()) { addModified(aReferenced, theFeature); } @@ -360,7 +360,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag for(; aRefIter != aRefs.cend(); aRefIter++) { if (!(*aRefIter)->owner()->data()->isValid()) continue; - FeaturePtr anUpdated = std::dynamic_pointer_cast((*aRefIter)->owner()); + anUpdated = std::dynamic_pointer_cast((*aRefIter)->owner()); if (anUpdated.get()) { if (addModified(anUpdated, aReason)) aSomeModified = true; diff --git a/src/ModelAPI/ModelAPI_Feature.cpp b/src/ModelAPI/ModelAPI_Feature.cpp index 72ad94ef5..00a881fdb 100644 --- a/src/ModelAPI/ModelAPI_Feature.cpp +++ b/src/ModelAPI/ModelAPI_Feature.cpp @@ -247,7 +247,7 @@ bool ModelAPI_Feature::isStable() return myIsStable; } -bool ModelAPI_Feature::customAction(const std::string& theActionId) +bool ModelAPI_Feature::customAction(const std::string& /*theActionId*/) { return false; } diff --git a/src/ModelAPI/ModelAPI_Feature.h b/src/ModelAPI/ModelAPI_Feature.h index bf478d4e7..927f8de32 100644 --- a/src/ModelAPI/ModelAPI_Feature.h +++ b/src/ModelAPI/ModelAPI_Feature.h @@ -73,7 +73,7 @@ class ModelAPI_Feature : public ModelAPI_Object /// Computes the attribute value on the base of other attributes if the value can be computed /// \param theAttributeId an attribute index to be computed /// \return a boolean value about it is computed - virtual bool compute(const std::string& theAttributeId) { return false; }; + virtual bool compute(const std::string& /*theAttributeId*/) { return false; }; /// Registers error during the execution, causes the ExecutionFailed state MODELAPI_EXPORT virtual void setError(const std::string& theError, diff --git a/src/ModelAPI/ModelAPI_Filter.h b/src/ModelAPI/ModelAPI_Filter.h index 5e3f77524..ab082f21e 100644 --- a/src/ModelAPI/ModelAPI_Filter.h +++ b/src/ModelAPI/ModelAPI_Filter.h @@ -59,7 +59,7 @@ public: /// Initializes arguments of a filter. If a filter has no arguments, this method may be /// not redefined. - virtual void initAttributes(ModelAPI_FiltersArgs& theArguments) {} + virtual void initAttributes(ModelAPI_FiltersArgs& /*theArguments*/) {} /// Returns XML string which represents GUI of the filter /// by reading corresponding XML file. diff --git a/src/ModelAPI/ModelAPI_Object.cpp b/src/ModelAPI/ModelAPI_Object.cpp index 6390de878..013658ae4 100644 --- a/src/ModelAPI/ModelAPI_Object.cpp +++ b/src/ModelAPI/ModelAPI_Object.cpp @@ -57,7 +57,7 @@ std::shared_ptr ModelAPI_Object::document() const return myDoc; } -void ModelAPI_Object::attributeChanged(const std::string& theID) +void ModelAPI_Object::attributeChanged(const std::string& /*theID*/) { } diff --git a/src/ModelAPI/ModelAPI_Object.h b/src/ModelAPI/ModelAPI_Object.h index e5a563691..3db972621 100644 --- a/src/ModelAPI/ModelAPI_Object.h +++ b/src/ModelAPI/ModelAPI_Object.h @@ -77,8 +77,9 @@ class ModelAPI_Object: public ModelAPI_Entity virtual bool isDisabled() = 0; /// Returns the parameters of color definition in the resources config manager - virtual void colorConfigInfo(std::string& theSection, std::string& theName, - std::string& theDefault) {} + virtual void colorConfigInfo(std::string& /*theSection*/, + std::string& /*theName*/, + std::string& /*theDefault*/) {} /// Called on change of any argument-attribute of this object /// \param theID identifier of changed attribute diff --git a/src/ModelAPI/ModelAPI_Result.cpp b/src/ModelAPI/ModelAPI_Result.cpp index 5220e0aa3..4f5a75a53 100644 --- a/src/ModelAPI/ModelAPI_Result.cpp +++ b/src/ModelAPI/ModelAPI_Result.cpp @@ -80,7 +80,7 @@ bool ModelAPI_Result::isConcealed() return myIsConcealed; } -void ModelAPI_Result::setIsConcealed(const bool theValue, const bool theForced) +void ModelAPI_Result::setIsConcealed(const bool theValue, const bool /*theForced*/) { if (myIsConcealed != theValue) { myIsConcealed = theValue; diff --git a/src/ModelAPI/ModelAPI_ResultGroup.h b/src/ModelAPI/ModelAPI_ResultGroup.h index 59cdff45e..cdbe7cd7e 100644 --- a/src/ModelAPI/ModelAPI_ResultGroup.h +++ b/src/ModelAPI/ModelAPI_ResultGroup.h @@ -55,7 +55,7 @@ public: /// \brief Stores the result of operation made on groups. /// Cleans the storage if empty shape is given. /// param[in] theShape shape to store. - MODELAPI_EXPORT virtual void store(const GeomShapePtr& theShape) + MODELAPI_EXPORT virtual void store(const GeomShapePtr& /*theShape*/) {} }; diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index 8a0cb64f8..9ea14ed93 100644 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -359,7 +359,7 @@ bool allDocumentsActivated(std::string& theNotActivatedNames) } bool removeFeaturesAndReferences(const std::set& theFeatures, - const bool theFlushRedisplay, + const bool /*theFlushRedisplay*/, const bool theUseComposite, const bool theUseRecursion) { @@ -469,10 +469,10 @@ void findReferences(const std::set& theFeatures, } else { // filter references to skip composition features of the current feature std::set aFilteredFeatures; - std::set::const_iterator anIt = aSelRefFeatures.begin(), - aLast = aSelRefFeatures.end(); - for (; anIt != aLast; anIt++) { - FeaturePtr aCFeature = *anIt; + std::set::const_iterator aRefIt = aSelRefFeatures.begin(), + aRefLast = aSelRefFeatures.end(); + for (; aRefIt != aRefLast; aRefIt++) { + FeaturePtr aCFeature = *aRefIt; CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(aCFeature); if (aComposite.get() && aComposite->isSub(aFeature)) @@ -543,7 +543,7 @@ void findAllReferences(const std::set& theFeatures, aResultRefList.insert(aMainRefList.begin(), aMainRefList.end()); for (; anIt != aLast; anIt++) { FeaturePtr aFeature = *anIt; - int aRecLevel = 0; + aRecLevel = 0; #ifdef DEBUG_REMOVE_FEATURES_RECURSE std::cout << " Ref: " << getFeatureInfo(aFeature) << std::endl; #endif @@ -1044,10 +1044,10 @@ std::list referencedFeatures( for(; aResIter != aResSet.end(); aResIter++) { std::list::const_iterator aGroupRes = (*aResIter)->results().cbegin(); for(; aGroupRes != (*aResIter)->results().cend(); aGroupRes++) { - const std::set& aRefs = (*aGroupRes)->data()->refsToMe(); - std::set::const_iterator aRef = aRefs.cbegin(); - for(; aRef != aRefs.cend(); aRef++) { - FeaturePtr aFeat = std::dynamic_pointer_cast((*aRef)->owner()); + const std::set& aGroupRefs = (*aGroupRes)->data()->refsToMe(); + std::set::const_iterator aRefIt = aGroupRefs.cbegin(); + for(; aRefIt != aGroupRefs.cend(); aRefIt++) { + FeaturePtr aFeat = std::dynamic_pointer_cast((*aRefIt)->owner()); if (aFeat.get() && !aGroupOperations.count(aFeat) && !aFeat->results().empty() && aFeat->firstResult()->groupName() == ModelAPI_ResultGroup::group()) { // iterate results of this group operation because it may be without theTarget shape diff --git a/src/ModelHighAPI/ModelHighAPI.i b/src/ModelHighAPI/ModelHighAPI.i index b9ec37cad..6c7101b39 100644 --- a/src/ModelHighAPI/ModelHighAPI.i +++ b/src/ModelHighAPI/ModelHighAPI.i @@ -364,7 +364,6 @@ %typemap(in) const std::list & (std::list temp) { - int newmem = 0; if (PySequence_Check($input)) { for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) { PyObject * item = PySequence_GetItem($input, i); @@ -384,7 +383,6 @@ } %typecheck(SWIG_TYPECHECK_POINTER) std::list, const std::list& { - int newmem = 0; if (PySequence_Check($input)) { for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) { PyObject * item = PySequence_GetItem($input, i); @@ -403,7 +401,6 @@ %typemap(in) const std::list & (std::list temp) { - int newmem = 0; if (PyTuple_Check($input)) { for (Py_ssize_t i = 0; i < PyTuple_Size($input); ++i) { PyObject * item = PySequence_GetItem($input, i); @@ -423,7 +420,6 @@ } %typecheck(SWIG_TYPECHECK_POINTER) std::list, const std::list& { - int newmem = 0; if (PyTuple_Check($input)) { for (Py_ssize_t i = 0; i < PyTuple_Size($input); ++i) { PyObject * item = PySequence_GetItem($input, i); diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index c25f2cbc6..15d10c6aa 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -159,7 +159,7 @@ public: /// Dump std::endl friend DumpStorageBuffer& operator<<(DumpStorageBuffer& theBuffer, - std::basic_ostream& (*theEndl)(std::basic_ostream&)) + std::basic_ostream& (*)(std::basic_ostream&)) { theBuffer.write("\n"); return theBuffer; @@ -633,10 +633,10 @@ const std::string& ModelHighAPI_Dumper::name(const EntityPtr& theEntity, int aFullIndex = 0; NbFeaturesMap::const_iterator aFIt = myFeatureCount.begin(); for (; aFIt != myFeatureCount.end(); ++aFIt) { - std::map >::const_iterator aFound = + std::map >::const_iterator aFoundKind = aFIt->second.find(aKind); - if (aFound != aFIt->second.end()) - aFullIndex += aFound->second.first; + if (aFoundKind != aFIt->second.end()) + aFullIndex += aFoundKind->second.first; } aDefaultName << aKind << "_" << aFullIndex; } diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.h b/src/ModelHighAPI/ModelHighAPI_Dumper.h index 984ca70e2..46eee3ff8 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.h +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.h @@ -352,8 +352,8 @@ public: MODELHIGHAPI_EXPORT virtual void exportVariables() const; /// Export one variable name to another module (implemented in python) - MODELHIGHAPI_EXPORT virtual void exportVariable( - const std::string& theEntry, const std::string& theVarName) const {} + MODELHIGHAPI_EXPORT virtual void exportVariable(const std::string& /*theEntry*/, + const std::string& /*theVarName*/) const {} protected: /// Dump "setName" command if last entity had user-defined name diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.h b/src/ModelHighAPI/ModelHighAPI_Interface.h index 2cc7a6920..47cea396e 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.h +++ b/src/ModelHighAPI/ModelHighAPI_Interface.h @@ -96,7 +96,7 @@ public: /// Dump wrapped feature MODELHIGHAPI_EXPORT - virtual void dump(ModelHighAPI_Dumper& theDumper) const {} + virtual void dump(ModelHighAPI_Dumper& /*theDumper*/) const {} protected: std::shared_ptr myFeature; ///< feature of this interface diff --git a/src/ModelHighAPI/ModelHighAPI_Services.cpp b/src/ModelHighAPI/ModelHighAPI_Services.cpp index dfd3f3447..433f619b0 100644 --- a/src/ModelHighAPI/ModelHighAPI_Services.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Services.cpp @@ -98,9 +98,9 @@ std::shared_ptr standardPlane(const std::string & theName){ //-------------------------------------------------------------------------------------- void begin() { - static size_t aTransactionID = 0; - static size_t aNbTransactions = -1; - size_t aNbUndo = ModelAPI_Session::get()->undoList().size(); + static int aTransactionID = 0; + static int aNbTransactions = -1; + int aNbUndo = (int)ModelAPI_Session::get()->undoList().size(); if (aNbUndo != aNbTransactions) { // the last transaction was not empty, thus increase the ID aNbTransactions = aNbUndo; diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.cpp b/src/ModelHighAPI/ModelHighAPI_Tools.cpp index 3f82be311..4b4b689e3 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Tools.cpp @@ -277,8 +277,8 @@ GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr) { GeomAPI_Shape::ShapeType aShapeType = GeomAPI_Shape::SHAPE; - std::transform(theShapeTypeStr.begin(), theShapeTypeStr.end(), - theShapeTypeStr.begin(), ::tolower); + std::transform(theShapeTypeStr.begin(), theShapeTypeStr.end(), theShapeTypeStr.begin(), + [](char c) { return static_cast(::tolower(c)); }); if(theShapeTypeStr == "compound") { aShapeType = GeomAPI_Shape::COMPOUND; @@ -386,7 +386,8 @@ GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr) { std::string aType = theValueTypeStr; - std::transform(aType.begin(), aType.end(), aType.begin(), ::tolower); + std::transform(aType.begin(), aType.end(), aType.begin(), + [](char c) { return static_cast(::tolower(c)); }); if (aType == "boolean") return ModelAPI_AttributeTables::BOOLEAN; else if (aType == "integer") @@ -546,10 +547,15 @@ static bool checkDump(SessionPtr theSession, return true; } -bool checkPyDump(const std::string& theFilenameNaming, - const std::string& theFilenameGeo, - const std::string& theFilenameWeak, - const checkDumpType theCheckType) +bool checkPyDump( +#ifdef _DEBUG + const std::string&, const std::string&, const std::string&, +#else + const std::string& theFilenameNaming, + const std::string& theFilenameGeo, + const std::string& theFilenameWeak, +#endif + const checkDumpType theCheckType) { static const std::string anErrorByNaming("checkPythonDump by naming"); static const std::string anErrorByGeometry("checkPythonDump by geometry"); diff --git a/src/ModelHighAPI/ModelHighAPI_swig.h b/src/ModelHighAPI/ModelHighAPI_swig.h index 928351bf1..374fd3fd0 100644 --- a/src/ModelHighAPI/ModelHighAPI_swig.h +++ b/src/ModelHighAPI/ModelHighAPI_swig.h @@ -37,4 +37,12 @@ #include "ModelHighAPI_Services.h" #include "ModelHighAPI_Tools.h" + #ifdef _MSC_VER + # pragma warning(disable: 4127) // conditional expression is constant + # pragma warning(disable: 4456) // declaration of variable hides previous local declaration + # pragma warning(disable: 4459) // declaration of variable hides global declaration + # pragma warning(disable: 4701) // potentially uninitialized local variable + # pragma warning(disable: 4703) // potentially uninitialized local pointer variable + #endif + #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SWIG_H_ */ diff --git a/src/ModuleBase/ModuleBase_ActionInfo.cpp b/src/ModuleBase/ModuleBase_ActionInfo.cpp index adc6b2728..8a40f176a 100644 --- a/src/ModuleBase/ModuleBase_ActionInfo.cpp +++ b/src/ModuleBase/ModuleBase_ActionInfo.cpp @@ -29,6 +29,7 @@ ModuleBase_ActionInfo::ModuleBase_ActionInfo() ModuleBase_ActionInfo::ModuleBase_ActionInfo(const QString &theText) { initDefault(); + text = theText; } ModuleBase_ActionInfo::ModuleBase_ActionInfo(const QIcon & theIcon, const QString &theText) diff --git a/src/ModuleBase/ModuleBase_BRepOwner.h b/src/ModuleBase/ModuleBase_BRepOwner.h index d9badcbeb..c9a2002e4 100644 --- a/src/ModuleBase/ModuleBase_BRepOwner.h +++ b/src/ModuleBase/ModuleBase_BRepOwner.h @@ -51,7 +51,7 @@ public: /// \param theStyle a style of presentation /// \param theMode a drawing mode virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& aPM, - const Handle(Prs3d_Drawer)& theStyle, const Standard_Integer theMode = 0) + const Handle(Prs3d_Drawer)& theStyle, const Standard_Integer /*theMode*/ = 0) { Selectable()->HilightOwnerWithColor(aPM, theStyle, this); } diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index d61fbe8bb..557675b18 100644 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -41,6 +41,10 @@ #include #include +#ifdef _MSC_VER +#pragma warning(disable: 4100) +#endif + class QAction; class QMouseEvent; class QKeyEvent; diff --git a/src/ModuleBase/ModuleBase_ISelection.cpp b/src/ModuleBase/ModuleBase_ISelection.cpp index 1aad9754b..5edf3334c 100644 --- a/src/ModuleBase/ModuleBase_ISelection.cpp +++ b/src/ModuleBase/ModuleBase_ISelection.cpp @@ -115,11 +115,11 @@ void ModuleBase_ISelection::filterSelectionOnEqualPoints std::shared_ptr aGeomPrsVertex = getPresentationVertex(aPrs); if (aGeomPrsVertex.get()) { const TopoDS_Vertex& aPrsVertex = aGeomPrsVertex->impl(); - std::set >::const_iterator anIt = aVerticesMap.begin(), - aLast = aVerticesMap.end(); + std::set >::const_iterator aVIt = aVerticesMap.begin(), + aVLast = aVerticesMap.end(); bool aFound = false; - for (; anIt != aLast && !aFound; anIt++) { - std::shared_ptr aGeomVertex = *anIt; + for (; aVIt != aVLast && !aFound; aVIt++) { + std::shared_ptr aGeomVertex = *aVIt; const TopoDS_Vertex& aVertex = aGeomVertex->impl(); gp_Pnt aPoint1 = BRep_Tool::Pnt(aVertex); gp_Pnt aPoint2 = BRep_Tool::Pnt(aPrsVertex); diff --git a/src/ModuleBase/ModuleBase_ITreeNode.h b/src/ModuleBase/ModuleBase_ITreeNode.h index 5fc4e8ed5..551d868b2 100644 --- a/src/ModuleBase/ModuleBase_ITreeNode.h +++ b/src/ModuleBase/ModuleBase_ITreeNode.h @@ -31,6 +31,10 @@ #include #include +#ifdef _MSC_VER +#pragma warning(disable: 4100) +#endif + class ModuleBase_ITreeNode; class ModuleBase_IWorkshop; diff --git a/src/ModuleBase/ModuleBase_IWidgetCreator.h b/src/ModuleBase/ModuleBase_IWidgetCreator.h index 91070a455..624f1c0ae 100644 --- a/src/ModuleBase/ModuleBase_IWidgetCreator.h +++ b/src/ModuleBase/ModuleBase_IWidgetCreator.h @@ -28,6 +28,10 @@ #include #include +#ifdef _MSC_VER +#pragma warning(disable: 4100) +#endif + class ModuleBase_ModelWidget; class ModuleBase_PageBase; class ModuleBase_IWorkshop; @@ -52,7 +56,7 @@ 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 panelTypes(std::set& theTypes) {} + virtual void panelTypes(std::set& /*theTypes*/) {} /// Returns a container of possible page types, which this creator can process /// The default implementation is empty diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index ff3ad3cde..cea25f232 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -34,6 +34,10 @@ #include +#ifdef _MSC_VER +#pragma warning(disable: 4100) +#endif + class Config_WidgetAPI; class Events_InfoMessage; class ModuleBase_IPropertyPanel; diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index 1df6060a6..e8eac4cf8 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -159,7 +159,7 @@ void ModuleBase_Operation::onValuesChanged() myIsModified = true; } -void ModuleBase_Operation::onValueStateChanged(int thePreviousState) +void ModuleBase_Operation::onValueStateChanged(int /*thePreviousState*/) { if (propertyPanel()) { ModuleBase_ModelWidget* aWidget = propertyPanel()->activeWidget(); diff --git a/src/ModuleBase/ModuleBase_OperationFeature.cpp b/src/ModuleBase/ModuleBase_OperationFeature.cpp index 8b3b4c410..ab66c3bf6 100644 --- a/src/ModuleBase/ModuleBase_OperationFeature.cpp +++ b/src/ModuleBase/ModuleBase_OperationFeature.cpp @@ -209,10 +209,10 @@ bool ModuleBase_OperationFeature::hasObject(ObjectPtr theObj) const std::shared_ptr aCurSelList = std::dynamic_pointer_cast(*anIt); for (int i = 0, aNb = aCurSelList->size(); i < aNb && !aFoundObject; i++) { - ObjectPtr anObject = aCurSelList->object(i); - FeaturePtr aFeature = std::dynamic_pointer_cast(anObject); - if (aFeature.get()) { - aFoundObject = anObjectFeature == aFeature; + ObjectPtr aCurObj = aCurSelList->object(i); + FeaturePtr aCurFeat = std::dynamic_pointer_cast(aCurObj); + if (aCurFeat.get()) { + aFoundObject = anObjectFeature == aCurFeat; } } } diff --git a/src/ModuleBase/ModuleBase_PagedContainer.cpp b/src/ModuleBase/ModuleBase_PagedContainer.cpp index 284e4bf7a..267d2d4cf 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.cpp +++ b/src/ModuleBase/ModuleBase_PagedContainer.cpp @@ -48,9 +48,10 @@ ModuleBase_PagedContainer::~ModuleBase_PagedContainer() } int ModuleBase_PagedContainer::addPage(ModuleBase_PageBase* thePage, - const QString& theName, const QString& theCaseId, - const QPixmap& theIcon, - const QString& theTooltip) + const QString& /*theName*/, + const QString& theCaseId, + const QPixmap& /*theIcon*/, + const QString& /*theTooltip*/) { if (!myPages.count()) { setDefaultValue(theCaseId.toStdString()); diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.h b/src/ModuleBase/ModuleBase_ParamSpinBox.h index e3fdde374..c2d4ab11b 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.h +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.h @@ -105,7 +105,7 @@ protected: /// The virtual function is reimplemented in order to avoid extra increasing of value by StepBy /// method - virtual void timerEvent(QTimerEvent *event) {} + virtual void timerEvent(QTimerEvent* /*event*/) {} virtual StepEnabled stepEnabled() const { return StepUpEnabled | StepDownEnabled; } diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 2caa00fb7..9d3a5c616 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -421,7 +421,7 @@ void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& a //******************************************************************** bool ModuleBase_ResultPrs::appendVertexSelection(const Handle(SelectMgr_Selection)& aSelection, - const Standard_Integer theMode) + const Standard_Integer /*theMode*/) { if (Shape().ShapeType() == TopAbs_VERTEX) { const TopoDS_Shape& aShape = Shape(); diff --git a/src/ModuleBase/ModuleBase_SelectionValidator.cpp b/src/ModuleBase/ModuleBase_SelectionValidator.cpp index ff8281747..bed15a9de 100644 --- a/src/ModuleBase/ModuleBase_SelectionValidator.cpp +++ b/src/ModuleBase/ModuleBase_SelectionValidator.cpp @@ -20,8 +20,8 @@ #include -bool ModuleBase_SelectionValidator::isValid(const ModuleBase_ISelection* theSelection, - ModuleBase_Operation* theOperation) const +bool ModuleBase_SelectionValidator::isValid(const ModuleBase_ISelection* /*theSelection*/, + ModuleBase_Operation* /*theOperation*/) const { return true; } diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 40b17fe76..a3697ee37 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -412,7 +412,7 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe hasCompositeOwner |= (ModelAPI_Tools::bodyOwner(aResult) != NULL); if (!hasResultInHistory && aResult.get()) { - FeaturePtr aFeature = ModelAPI_Feature::feature(aResult); + aFeature = ModelAPI_Feature::feature(aResult); hasResultInHistory = aFeature.get() && aFeature->isInHistory(); } diff --git a/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp b/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp index 425e60ae6..2e28a3f93 100644 --- a/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp +++ b/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp @@ -168,7 +168,7 @@ void ModuleBase_WidgetConcealedObjects::addViewRow( } } -void ModuleBase_WidgetConcealedObjects::onItemToggled(bool theState) +void ModuleBase_WidgetConcealedObjects::onItemToggled(bool /*theState*/) { emit valuesChanged(); updateObject(myFeature); diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 451a371ec..5d12d728a 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -743,8 +743,6 @@ QIntList ModuleBase_WidgetMultiSelector::shapeTypes() const //******************************************************************** void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const int theShapeType) { - QString aShapeTypeName; - int idx = 0; foreach (QString aShapeTypeName, myShapeTypes) { int aRefType = ModuleBase_Tools::shapeType(aShapeTypeName); @@ -794,10 +792,10 @@ void ModuleBase_WidgetMultiSelector::updateSelectionList() else if (aType == ModelAPI_AttributeRefAttrList::typeId()) { AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID()); for (int i = 0; i < aRefAttrListAttr->size(); i++) { - AttributePtr anAttribute = aRefAttrListAttr->attribute(i); + AttributePtr anAttr = aRefAttrListAttr->attribute(i); QString aName; - if (anAttribute.get()) { - std::string anAttrName = ModuleBase_Tools::generateName(anAttribute, myWorkshop); + if (anAttr.get()) { + std::string anAttrName = ModuleBase_Tools::generateName(anAttr, myWorkshop); aName = QString::fromStdString(anAttrName); } else { @@ -910,9 +908,9 @@ void ModuleBase_WidgetMultiSelector::convertIndicesToViewerSelection(std::setattribute(i); - if (anAttribute.get()) { - GeomShapePtr aGeomShape = ModuleBase_Tools::getShape(anAttribute, myWorkshop); + AttributePtr anAttr = aRefAttrListAttr->attribute(i); + if (anAttr.get()) { + GeomShapePtr aGeomShape = ModuleBase_Tools::getShape(anAttr, myWorkshop); theValues.append(std::shared_ptr( new ModuleBase_ViewerPrs(anObject, aGeomShape, NULL))); } @@ -983,8 +981,8 @@ bool ModuleBase_WidgetMultiSelector::removeUnusedAttributeObjects for (int i = 0; i < aRefAttrListAttr->size(); i++) { bool aFound = false; if (aRefAttrListAttr->isAttribute(i)) { - AttributePtr anAttribute = aRefAttrListAttr->attribute(i); - aFound = anAttributes.find(anAttribute) != anAttributes.end(); + AttributePtr anAttr = aRefAttrListAttr->attribute(i); + aFound = anAttributes.find(anAttr) != anAttributes.end(); } else { aFound = findInSelection(aRefAttrListAttr->object(i), GeomShapePtr(), aGeomSelection, diff --git a/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp b/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp index f7ed8ee1a..94f2f54c4 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp @@ -324,7 +324,7 @@ ModuleBase_WidgetSelectionFilter::~ModuleBase_WidgetSelectionFilter() aCtx->Remove(myPreview, false); myPreview.Nullify(); if (myListIO.Size() > 0) { - Handle(AIS_InteractiveContext) aCtx = myWorkshop->viewer()->AISContext(); + aCtx = myWorkshop->viewer()->AISContext(); AIS_ListOfInteractive::const_iterator aIt; Handle(AIS_Shape) aShapeIO; for (aIt = myListIO.cbegin(); aIt != myListIO.cend(); aIt++) { @@ -455,7 +455,6 @@ void ModuleBase_WidgetSelectionFilter::onSelect() int aNb = aDoc->size(ModelAPI_ResultBody::group()); ObjectPtr aObj; ResultBodyPtr aBody; - GeomShapePtr aShape; for (int i = 0; i < aNb; i++) { aObj = aDoc->object(ModelAPI_ResultBody::group(), i); aBody = std::dynamic_pointer_cast(aObj); @@ -465,15 +464,15 @@ void ModuleBase_WidgetSelectionFilter::onSelect() TopTools_MapOfShape alreadyThere; std::list::const_iterator aShapesIt; for (aShapesIt = aSubShapes.cbegin(); aShapesIt != aSubShapes.cend(); aShapesIt++) { - GeomShapePtr aShape = (*aShapesIt); - TopoDS_Shape aTShape = aShape->impl(); + GeomShapePtr aSubShape = (*aShapesIt); + TopoDS_Shape aTShape = aSubShape->impl(); if (!alreadyThere.Add(aTShape)) continue; static SessionPtr aSession = ModelAPI_Session::get(); - bool isValid = aSession->filters()->isValid(myFeature, aBody, aShape); + bool isValid = aSession->filters()->isValid(myFeature, aBody, aSubShape); if (isValid) { aBuilder.Add(aComp, aTShape); - ModuleBase_ViewerPrsPtr aValue(new ModuleBase_ViewerPrs(aObj, aShape)); + ModuleBase_ViewerPrsPtr aValue(new ModuleBase_ViewerPrs(aObj, aSubShape)); myValues.append(aValue); } } diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index 30bf30605..7694a6207 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -215,7 +215,7 @@ bool ModuleBase_WidgetSelector::isValidSelectionCustom(const ModuleBase_ViewerPr if (aValid) { // In order to avoid selection of the same object - ResultPtr aResult = myWorkshop->selection()->getResult(thePrs); + aResult = myWorkshop->selection()->getResult(thePrs); FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(aResult); aValid = aSelectedFeature != myFeature; } diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.cpp b/src/ModuleBase/ModuleBase_WidgetValidated.cpp index af4f04e98..feb6a380a 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidated.cpp @@ -155,28 +155,28 @@ bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrsPtr& AttributeSelectionPtr aSelectAttr = std::dynamic_pointer_cast(anAttr); aSelectAttr->setValue(myPresentedObject, GeomShapePtr(), true); - GeomShapePtr aShape = aSelectAttr->value(); - if (!aShape.get() && aSelectAttr->contextFeature().get() && + GeomShapePtr aShapePtr = aSelectAttr->value(); + if (!aShapePtr.get() && aSelectAttr->contextFeature().get() && aSelectAttr->contextFeature()->firstResult().get()) { - aShape = aSelectAttr->contextFeature()->firstResult()->shape(); + aShapePtr = aSelectAttr->contextFeature()->firstResult()->shape(); } - if (aShape.get()) { - const TopoDS_Shape aTDShape = aShape->impl(); + if (aShapePtr.get()) { + const TopoDS_Shape aTDShape = aShapePtr->impl(); Handle(AIS_InteractiveObject) anIO = myWorkshop->selection()->getIO(thePrs); aOwnersList.Append(new StdSelect_BRepOwner(aTDShape, anIO)); } } else { - ResultPtr aResult = aFeature->firstResult(); - if (aResult.get()) { - ResultBodyPtr aBody = std::dynamic_pointer_cast(aResult); + ResultPtr aFirstRes = aFeature->firstResult(); + if (aFirstRes.get()) { + ResultBodyPtr aBody = std::dynamic_pointer_cast(aFirstRes); if (aBody.get() && (aBody->numberOfSubs() > 0)) collectSubBodies(aBody, aOwnersList); else { - GeomShapePtr aShapePtr = ModelAPI_Tools::shape(aResult); + GeomShapePtr aShapePtr = ModelAPI_Tools::shape(aFirstRes); if (aShapePtr.get()) { TopoDS_Shape aTDShape = aShapePtr->impl(); - AISObjectPtr aIOPtr = myWorkshop->findPresentation(aResult); + AISObjectPtr aIOPtr = myWorkshop->findPresentation(aFirstRes); if (aIOPtr.get()) { Handle(AIS_InteractiveObject) anIO = aIOPtr->impl(); diff --git a/src/ModuleBase/ModuleBase_WidgetValidator.h b/src/ModuleBase/ModuleBase_WidgetValidator.h index bd71032db..71a7b55cb 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidator.h +++ b/src/ModuleBase/ModuleBase_WidgetValidator.h @@ -53,7 +53,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidator /// Fills given container with selection modes if the widget has it /// \param [out] theModuleSelectionModes module additional modes, -1 means all default modes /// \param theModes [out] a container of modes - virtual void selectionModes(int& theModuleSelectionModes, QIntList& theModes) {} + virtual void selectionModes(int& /*theModuleSelectionModes*/, QIntList& /*theModes*/) {} /// Appends into container of workshop selection filters /// \param [out] theModuleSelectionFilters module additional modes, -1 means all default modes diff --git a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp index 49121ea3a..9d77b3e29 100644 --- a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp @@ -137,7 +137,8 @@ void ParametersPlugin_Parameter::execute() setError("Expression error.", false); } -double ParametersPlugin_Parameter::evaluate(const std::string& theExpression, std::string& theError) +double ParametersPlugin_Parameter::evaluate(const std::string& /*theExpression*/, + std::string& theError) { FeaturePtr aMyPtr = std::dynamic_pointer_cast(data()->owner()); std::shared_ptr aProcessMessage = diff --git a/src/ParametersPlugin/ParametersPlugin_Validators.cpp b/src/ParametersPlugin/ParametersPlugin_Validators.cpp index ff9f6d53c..e9f49ffe5 100644 --- a/src/ParametersPlugin/ParametersPlugin_Validators.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Validators.cpp @@ -38,7 +38,7 @@ ParametersPlugin_VariableValidator::~ParametersPlugin_VariableValidator() } bool ParametersPlugin_VariableValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { AttributeStringPtr aStrAttr = std::dynamic_pointer_cast(theAttribute); @@ -95,7 +95,7 @@ ParametersPlugin_ExpressionValidator::~ParametersPlugin_ExpressionValidator() } bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index ef597c033..bd89f9a80 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -455,8 +455,7 @@ QList ParametersPlugin_WidgetParamsMgr:: } else aValues << aExpr.c_str(); - std::string aErr = - aParameter->data()->string(ParametersPlugin_Parameter::EXPRESSION_ERROR_ID())->value(); + aErr = aParameter->data()->string(ParametersPlugin_Parameter::EXPRESSION_ERROR_ID())->value(); if (aErr.empty()) { AttributeDoublePtr aValueAttribute = aParam->data()->real(ModelAPI_ResultParameter::VALUE()); aValues << QString::number(aValueAttribute->value()); diff --git a/src/PartSet/PartSet_CenterPrs.cpp b/src/PartSet/PartSet_CenterPrs.cpp index c1d2ff9ff..4b1f076ef 100644 --- a/src/PartSet/PartSet_CenterPrs.cpp +++ b/src/PartSet/PartSet_CenterPrs.cpp @@ -75,7 +75,7 @@ void PartSet_CenterPrs::drawPoint(const Handle(Prs3d_Presentation)& thePrs, } void PartSet_CenterPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& PM, - const SelectMgr_SequenceOfOwner& Seq) + const SelectMgr_SequenceOfOwner& /*Seq*/) { Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( PM ); aSelectionPrs->Clear(); @@ -89,7 +89,7 @@ void PartSet_CenterPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3 void PartSet_CenterPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM, const Handle(Prs3d_Drawer)& theStyle, - const Handle(SelectMgr_EntityOwner)& theOwner) + const Handle(SelectMgr_EntityOwner)& /*theOwner*/) { Handle( Prs3d_Presentation ) aHilightPrs = GetHilightPresentation( thePM ); aHilightPrs->Clear(); diff --git a/src/PartSet/PartSet_ExternalObjectsMgr.cpp b/src/PartSet/PartSet_ExternalObjectsMgr.cpp index 877237fca..7f17c1139 100644 --- a/src/PartSet/PartSet_ExternalObjectsMgr.cpp +++ b/src/PartSet/PartSet_ExternalObjectsMgr.cpp @@ -167,7 +167,7 @@ void PartSet_ExternalObjectsMgr::removeExternal(const CompositeFeaturePtr& theSk void PartSet_ExternalObjectsMgr::removeExternalObject(const ObjectPtr& theObject, const CompositeFeaturePtr& /*theSketch*/, - const FeaturePtr& theFeature, + const FeaturePtr& /*theFeature*/, ModuleBase_IWorkshop* theWorkshop) { if (theObject.get()) { diff --git a/src/PartSet/PartSet_FieldStepPrs.cpp b/src/PartSet/PartSet_FieldStepPrs.cpp index ec091abe1..37d64c6c9 100644 --- a/src/PartSet/PartSet_FieldStepPrs.cpp +++ b/src/PartSet/PartSet_FieldStepPrs.cpp @@ -46,7 +46,7 @@ IMPLEMENT_STANDARD_RTTIEXT(PartSet_FieldStepPrs, ViewerData_AISShape); #define POINT_SIZE 8 -void emptyDeleter(ModelAPI_ResultField* theF) +void emptyDeleter(ModelAPI_ResultField* /*theF*/) { // Do nothing } diff --git a/src/PartSet/PartSet_MenuMgr.cpp b/src/PartSet/PartSet_MenuMgr.cpp index d3c508a5b..640f9f827 100644 --- a/src/PartSet/PartSet_MenuMgr.cpp +++ b/src/PartSet/PartSet_MenuMgr.cpp @@ -173,8 +173,8 @@ bool PartSet_MenuMgr::addViewerMenu(const QMap& theStdActions // Find coincident in these coordinates ObjectPtr aObj = aPrsList.first()->object(); - FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); - FeaturePtr aCoincident = PartSet_Tools::findFirstCoincidence(aFeature, aSelPnt); + FeaturePtr aCoincident = + PartSet_Tools::findFirstCoincidence(ModelAPI_Feature::feature(aObj), aSelPnt); // If we have coincidence then add Detach menu if (aCoincident.get() != NULL) { QList aCoins; @@ -192,8 +192,8 @@ bool PartSet_MenuMgr::addViewerMenu(const QMap& theStdActions theMenuActions[anIndex++] = aSubMenu->menuAction(); QAction* aAction; int i = 0; - foreach (FeaturePtr aCoins, myCoinsideLines) { - QString anItemText = aCoins->data()->name().c_str(); + foreach (FeaturePtr aCoinsL, myCoinsideLines) { + QString anItemText = aCoinsL->data()->name().c_str(); #ifdef _DEBUG if (anIsAttributes[i]) anItemText += " [attribute]"; diff --git a/src/PartSet/PartSet_MouseProcessor.h b/src/PartSet/PartSet_MouseProcessor.h index 4a3f99f31..13619e05c 100644 --- a/src/PartSet/PartSet_MouseProcessor.h +++ b/src/PartSet/PartSet_MouseProcessor.h @@ -24,6 +24,10 @@ #include +#ifdef _MSC_VER +#pragma warning(disable: 4100) +#endif + class ModuleBase_IViewWindow; class ModuleBase_ViewerPrs; class QMouseEvent; diff --git a/src/PartSet/PartSet_OperationPrs.cpp b/src/PartSet/PartSet_OperationPrs.cpp index b6f0e4953..07faae3c4 100644 --- a/src/PartSet/PartSet_OperationPrs.cpp +++ b/src/PartSet/PartSet_OperationPrs.cpp @@ -228,9 +228,9 @@ void PartSet_OperationPrs::addValue(const ObjectPtr& theObject, const GeomShapeP GeomShapePtr aShape = theShape; if (!aShape.get()) { - ResultPtr aResult = std::dynamic_pointer_cast(theObject); - if (aResult.get()) - aShape = aResult->shape(); + ResultPtr aRes = std::dynamic_pointer_cast(theObject); + if (aRes.get()) + aShape = aRes->shape(); } if (!isSubObject(theObject, theFeature)) appendShapeIfVisible(theWorkshop, theObject, aShape, theObjectShapes); @@ -320,19 +320,19 @@ void PartSet_OperationPrs::getFeatureShapes(const FeaturePtr& theFeature, ObjectPtr anObject; GeomShapePtr aShape; if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr anAttr = + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(anAttribute); - if (anAttr->isObject()) { - anObject = anAttr->object(); + if (aRefAttr->isObject()) { + anObject = aRefAttr->object(); } else { - AttributePtr anAttribute = anAttr->attr(); - aShape = PartSet_Tools::findShapeBy2DPoint(anAttribute, theWorkshop); + AttributePtr anAttr = aRefAttr->attr(); + aShape = PartSet_Tools::findShapeBy2DPoint(anAttr, theWorkshop); // the distance point is not found if the point is selected in the 2nd time // TODO: after debug, this check can be removed if (!aShape.get()) continue; - anObject = anAttr->attr()->owner(); + anObject = anAttr->owner(); } } if (anAttrType == ModelAPI_AttributeSelection::typeId()) { diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index 67dd02e09..b83637655 100644 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -97,7 +97,6 @@ void PartSet_OverconstraintListener::getCustomColor(const ObjectPtr& theObject, theColor = Config_PropManager::color("Visualization", "sketch_overconstraint_color"); } if (myIsFullyConstrained) { - FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); // only entity features has custom color when sketch is fully constrained if (aFeature.get() && PartSet_SketcherMgr::isEntity(aFeature->getKind()) && !PartSet_SketcherMgr::isExternalFeature(aFeature)) { diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index aaa1ff6d4..2a494636f 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -519,12 +519,12 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE launchEditing(); myIsEditLaunching = aPrevLaunchingState; if (aFeature.get() != NULL) { - std::shared_ptr aSPFeature = + std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(aFeature); - if (aSPFeature.get() && - (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID() || - aSPFeature->getKind() == SketchPlugin_ConstraintAngle::ID())) { - DataPtr aData = aSPFeature->data(); + if (aSketchFeature.get() && + (aSketchFeature->getKind() == SketchPlugin_ConstraintRadius::ID() || + aSketchFeature->getKind() == SketchPlugin_ConstraintAngle::ID())) { + DataPtr aData = aSketchFeature->data(); AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()); std::shared_ptr aFPAttr = std::dynamic_pointer_cast(aAttr); @@ -1171,9 +1171,8 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) #ifdef DEBUG_SKETCHER_ENTITIES anInfo.append(ModuleBase_Tools::objectInfo(aFeature)); #endif - std::list aResults = aFeature->results(); - std::list::const_iterator aIt; - for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { + std::list aFeatResults = aFeature->results(); + for (aIt = aFeatResults.begin(); aIt != aFeatResults.end(); ++aIt) { if ((*aIt)->isDisplayed()) // Display object if it was created outside of GUI aECreator->sendUpdated((*aIt), EVENT_DISP); @@ -1712,7 +1711,7 @@ bool PartSet_SketcherMgr::setDistanceValueByPreselection(ModuleBase_Operation* t anAISIO = anAIS->impl(); } if (anAIS.get() != NULL) { - Handle(AIS_InteractiveObject) anAISIO = anAIS->impl(); + anAISIO = anAIS->impl(); if (!anAISIO.IsNull()) { Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAISIO); @@ -1786,10 +1785,10 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature, } for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { ResultPtr aResult = *aIt; - AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult); - if (aAISObj.get() == NULL) + AISObjectPtr aResAISObj = aDisplayer->getAISObject(aResult); + if (aResAISObj.get() == NULL) continue; - Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl(); + Handle(AIS_InteractiveObject) anAISIO = aResAISObj->impl(); SelectMgr_IndexedMapOfOwner aSelectedOwners; aConnector->workshop()->selector()->selection()->entityOwners(anAISIO, aSelectedOwners); @@ -2011,8 +2010,8 @@ void PartSet_SketcherMgr::storeSelection(const SelectionType theType, std::list aResults = aFeature->results(); std::list::const_iterator aIt; for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { - ResultPtr aResult = *aIt; - getAttributesOrResults(anOwner, aFeature, aSketch, aResult, + ResultPtr aCurResult = *aIt; + getAttributesOrResults(anOwner, aFeature, aSketch, aCurResult, anInfo.myAttributes, anInfo.myResults, anInfo.myLocalSelectedShapes); } } @@ -2225,9 +2224,9 @@ void PartSet_SketcherMgr::processEvent(const std::shared_ptr& th FeaturePtr aFeature = std::dynamic_pointer_cast(*aIt); if (aFeature.get()) { std::list aRes = aFeature->results(); - std::list::const_iterator aIt; - for (aIt = aRes.cbegin(); aIt != aRes.cend(); ++aIt) { - ModuleBase_ViewerPrsPtr aPrsPtr(new ModuleBase_ViewerPrs(*aIt)); + std::list::const_iterator aRIt; + for (aRIt = aRes.cbegin(); aRIt != aRes.cend(); ++aRIt) { + ModuleBase_ViewerPrsPtr aPrsPtr(new ModuleBase_ViewerPrs(*aRIt)); aPrsList.append(aPrsPtr); } } @@ -2359,8 +2358,8 @@ void PartSet_SketcherMgr::customizeSketchPresentation(const ObjectPtr& theObject // thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol } if (isCopy(aFeature) && !isIncludeToResult(aFeature)) { - double aWidth = thePrs->width(); - thePrs->setWidth(aWidth / 2.5); + double aPrsWidth = thePrs->width(); + thePrs->setWidth(aPrsWidth / 2.5); } double aDeflection = Config_PropManager::real("Visualization", "construction_deflection"); @@ -2397,10 +2396,10 @@ void PartSet_Fitter::fitAll(Handle(V3d_View) theView) for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) { aRes = (*aIt); if (aRes->isDisplayed()) { - FeaturePtr aFeature = ModelAPI_Feature::feature(aRes); - if (aFeature.get()) { + FeaturePtr aCurFeature = ModelAPI_Feature::feature(aRes); + if (aCurFeature.get()) { std::shared_ptr aSPFeature = - std::dynamic_pointer_cast(aFeature); + std::dynamic_pointer_cast(aCurFeature); if (aSPFeature.get()) { bool isAxiliary = aSPFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value(); diff --git a/src/PartSet/PartSet_SketcherReentrantMgr.cpp b/src/PartSet/PartSet_SketcherReentrantMgr.cpp index 0ebd810fa..767df1296 100644 --- a/src/PartSet/PartSet_SketcherReentrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReentrantMgr.cpp @@ -188,8 +188,8 @@ bool PartSet_SketcherReentrantMgr::processMouseMoved(ModuleBase_IViewWindow* the } } else { // processing mouse move in active widget of restarted operation - ModuleBase_ModelWidget* anActiveWidget = module()->activeWidget(); - PartSet_MouseProcessor* aProcessor = dynamic_cast(anActiveWidget); + ModuleBase_ModelWidget* anActiveWdg = module()->activeWidget(); + PartSet_MouseProcessor* aProcessor = dynamic_cast(anActiveWdg); if (aProcessor) aProcessor->mouseMoved(theWnd, theEvent); } diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index c7aed7b39..4934187cd 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -562,9 +562,9 @@ FeaturePtr PartSet_Tools::findFirstCoincidence(const FeaturePtr& theFeature, /// Find by result if (!aCoincident.get()) { std::list aResults = theFeature->results(); - std::list::const_iterator aIt; - for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) { - ResultPtr aResult = *aIt; + std::list::const_iterator aResIt; + for (aResIt = aResults.cbegin(); aResIt != aResults.cend(); ++aResIt) { + ResultPtr aResult = *aResIt; aCoincident = findFirstCoincidenceByData(aResult->data(), thePoint); if (aCoincident.get()) break; @@ -598,8 +598,8 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList& FeaturePtr aConstrFeature = std::dynamic_pointer_cast(aAttr->owner()); if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { if (!theCoincidencies.contains(aConstrFeature)) { - std::shared_ptr aPnt = getCoincedencePoint(aConstrFeature); - if (aPnt.get() && aOrig->isEqual(aPnt)) { + std::shared_ptr aCoincPnt = getCoincedencePoint(aConstrFeature); + if (aCoincPnt.get() && aOrig->isEqual(aCoincPnt)) { findCoincidences(aConstrFeature, theList, theCoincidencies, SketchPlugin_ConstraintCoincidence::ENTITY_A(), theIsAttributes); findCoincidences(aConstrFeature, theList, theCoincidencies, @@ -613,9 +613,9 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList& // Find by Results ResultConstructionPtr aResult = std::dynamic_pointer_cast(aObj); if (aResult.get()) { - FeaturePtr aFeature = ModelAPI_Feature::feature(aPnt->object()); - if (!theList.contains(aFeature)) - theList.append(aFeature); + FeaturePtr aFeat = ModelAPI_Feature::feature(aPnt->object()); + if (!theList.contains(aFeat)) + theList.append(aFeat); theCoincidencies.append(theStartCoin); theIsAttributes.append(false); // point attribute on a feature @@ -626,8 +626,8 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList& FeaturePtr aConstrFeature = std::dynamic_pointer_cast(aAttr->owner()); if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { if (!theCoincidencies.contains(aConstrFeature)) { - std::shared_ptr aPnt = getCoincedencePoint(aConstrFeature); - if (aPnt.get() && aOrig->isEqual(aPnt)) { + std::shared_ptr aCoincPnt = getCoincedencePoint(aConstrFeature); + if (aCoincPnt.get() && aOrig->isEqual(aCoincPnt)) { findCoincidences(aConstrFeature, theList, theCoincidencies, SketchPlugin_ConstraintCoincidence::ENTITY_A(), theIsAttributes); findCoincidences(aConstrFeature, theList, theCoincidencies, diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index 4f2265f50..c63a5eb3a 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -296,8 +296,8 @@ void PartSet_ObjectNode::update() aNode = myChildren.takeLast(); delete aNode; } - foreach(ModuleBase_ITreeNode* aNode, myChildren) { - aNode->update(); + foreach(ModuleBase_ITreeNode* aChildNode, myChildren) { + aChildNode->update(); } } else { @@ -351,8 +351,8 @@ QTreeNodesList PartSet_ObjectNode::objectCreated(const QObjectPtrList& theObject } } } - foreach(ModuleBase_ITreeNode* aNode, myChildren) { - aResult.append(aNode->objectCreated(theObjects)); + foreach(ModuleBase_ITreeNode* aChildNode, myChildren) { + aResult.append(aChildNode->objectCreated(theObjects)); } } return aResult; @@ -389,10 +389,10 @@ QTreeNodesList PartSet_ObjectNode::objectsDeleted( aResult.append(this); int i = 0; ObjectPtr aBody; - foreach(ModuleBase_ITreeNode* aNode, myChildren) { + foreach(ModuleBase_ITreeNode* aChildNode, myChildren) { aBody = subObject(i); - ((PartSet_ObjectNode*)aNode)->setObject(aBody); - aResult.append(aNode->objectsDeleted(theDoc, theGroup)); + ((PartSet_ObjectNode*)aChildNode)->setObject(aBody); + aResult.append(aChildNode->objectsDeleted(theDoc, theGroup)); i++; } } @@ -1119,7 +1119,7 @@ void PartSet_ObjectFolderNode::update() } } -QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& theObjects) +QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& /*theObjects*/) { QTreeNodesList aResult; int aFirst = -1, aLast = -1; @@ -1153,8 +1153,8 @@ QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& the return aResult; } -QTreeNodesList PartSet_ObjectFolderNode::objectsDeleted(const DocumentPtr& theDoc, - const QString& theGroup) +QTreeNodesList PartSet_ObjectFolderNode::objectsDeleted(const DocumentPtr& /*theDoc*/, + const QString& /*theGroup*/) { QTreeNodesList aResult; int aFirst = -1, aLast = -1; diff --git a/src/PartSet/PartSet_Validators.cpp b/src/PartSet/PartSet_Validators.cpp index f65ed4adb..d54d0caee 100644 --- a/src/PartSet/PartSet_Validators.cpp +++ b/src/PartSet/PartSet_Validators.cpp @@ -454,11 +454,11 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute } } else if (anAttrType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttrSel = std::dynamic_pointer_cast(theAttribute); - ResultPtr aContext = anAttr->context(); - FeaturePtr aContextFeature = anAttr->contextFeature(); - GeomShapePtr aShape = anAttr->value(); + ResultPtr aContext = anAttrSel->context(); + FeaturePtr aContextFeature = anAttrSel->contextFeature(); + GeomShapePtr aShape = anAttrSel->value(); // Check selection attributes anAttrs = aFeature->data()->attributes(ModelAPI_AttributeSelection::typeId()); @@ -499,9 +499,9 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute } } else if (anAttrType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr anAttr = + AttributeReferencePtr anAttrRef = std::dynamic_pointer_cast(theAttribute); - ObjectPtr anObject = anAttr->value(); + ObjectPtr anObject = anAttrRef->value(); // Check selection attributes anAttrs = aFeature->data()->attributes(ModelAPI_AttributeReference::typeId()); if (anAttrs.size() > 0) { @@ -517,8 +517,8 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute return false; } } - return true; } + return true; } } else if(anAttrType == ModelAPI_AttributeSelectionList::typeId()) { diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index f8cdc2c76..5fe28ccc8 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -438,7 +438,6 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp) AttributeSelectionListPtr anAttrList = myFeature->data()->selectionList(myAttributeListID); if (aCompFeature->numberOfSubs() > 0) { // set the sub feature to attribute selection list and check whether sketch is valid - SessionPtr aMgr = ModelAPI_Session::get(); const static std::string aNestedOpID("Set Sketch result into Selection list"); aMgr->startOperation(aNestedOpID, false); // false to not attach to Extrusion operation setSketchObjectToList(aCompFeature, anAttrList); @@ -512,7 +511,6 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp) (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID())); ResultPtr aRes = aSelAttr.get() ? aSelAttr->context() : ResultPtr(); if (aRes.get()) { - SessionPtr aMgr = ModelAPI_Session::get(); ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); AttributePtr anAttribute = myFeature->attribute(anObjectsAttribute); std::string aValidatorID; diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index f0ec77b08..a076560ad 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -486,8 +486,6 @@ bool PartSet_WidgetSketchLabel::canFillSketch(const ModuleBase_ViewerPrsPtr& the } // check plane or planar face of any non-sketch object if (aCanFillSketch) { - std::shared_ptr aGeomFace; - GeomShapePtr aGeomShape = thePrs->shape(); if ((!aGeomShape.get() || aGeomShape->isNull()) && aResult.get()) { aGeomShape = aResult->shape(); @@ -540,13 +538,13 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View } else { aSelAttr->setValue(aFeature, GeomShapePtr()); - GeomShapePtr aShape = aSelAttr->value(); - if (!aShape.get() && aSelAttr->contextFeature().get() && + GeomShapePtr aSelShape = aSelAttr->value(); + if (!aSelShape.get() && aSelAttr->contextFeature().get() && aSelAttr->contextFeature()->firstResult().get()) { - aShape = aSelAttr->contextFeature()->firstResult()->shape(); + aSelShape = aSelAttr->contextFeature()->firstResult()->shape(); } - if (aShape.get() && aShape->isPlanar()) { - const TopoDS_Shape& aTDShape = aShape->impl(); + if (aSelShape.get() && aSelShape->isPlanar()) { + const TopoDS_Shape& aTDShape = aSelShape->impl(); setSketchPlane(aTDShape); isOwnerSet = true; } diff --git a/src/PartSetPlugin/PartSetPlugin_Part.cpp b/src/PartSetPlugin/PartSetPlugin_Part.cpp index ff2943722..c94e6dfe6 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Part.cpp @@ -74,7 +74,7 @@ std::shared_ptr PartSetPlugin_Part::addFeature(std::string the return FeaturePtr(); } -int PartSetPlugin_Part::numberOfSubs(bool forTree) const +int PartSetPlugin_Part::numberOfSubs(bool /*forTree*/) const { ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (aResult.get()) { @@ -85,7 +85,8 @@ int PartSetPlugin_Part::numberOfSubs(bool forTree) const return 0; } -std::shared_ptr PartSetPlugin_Part::subFeature(const int theIndex, bool forTree) +std::shared_ptr PartSetPlugin_Part::subFeature(const int theIndex, + bool /*forTree*/) { ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (aResult.get()) { diff --git a/src/Selector/Selector_Primitive.cpp b/src/Selector/Selector_Primitive.cpp index 6fa120db9..d93241f73 100644 --- a/src/Selector/Selector_Primitive.cpp +++ b/src/Selector/Selector_Primitive.cpp @@ -48,7 +48,7 @@ bool Selector_Primitive::restore() } TDF_Label Selector_Primitive::restoreByName(std::string theName, - const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) + const TopAbs_ShapeEnum /*theShapeType*/, Selector_NameGenerator* theNameGenerator) { TDF_Label aContext; if (theNameGenerator->restoreContext(theName, aContext, myFinal)) { diff --git a/src/SketchAPI/SketchAPI_Sketch.cpp b/src/SketchAPI/SketchAPI_Sketch.cpp index 8678c71ab..9bdecc85f 100644 --- a/src/SketchAPI/SketchAPI_Sketch.cpp +++ b/src/SketchAPI/SketchAPI_Sketch.cpp @@ -918,7 +918,8 @@ std::shared_ptr SketchAPI_Sketch::setAngle( if (aVersion == SketchPlugin_ConstraintAngle::THE_VERSION_1) { std::string aTypeLC = theType; - std::transform(aTypeLC.begin(), aTypeLC.end(), aTypeLC.begin(), ::tolower); + std::transform(aTypeLC.begin(), aTypeLC.end(), aTypeLC.begin(), + [](char c) { return static_cast(::tolower(c)); }); if (aTypeLC == "supplementary") aType = (int)SketcherPrs_Tools::ANGLE_COMPLEMENTARY; else if (aTypeLC == "backward") diff --git a/src/SketchPlugin/SketchPlugin_BSplineBase.cpp b/src/SketchPlugin/SketchPlugin_BSplineBase.cpp index a663675c1..4bed76ce3 100644 --- a/src/SketchPlugin/SketchPlugin_BSplineBase.cpp +++ b/src/SketchPlugin/SketchPlugin_BSplineBase.cpp @@ -108,7 +108,8 @@ bool SketchPlugin_BSplineBase::isFixed() { return data()->selection(EXTERNAL_ID())->context().get() != NULL; } -void SketchPlugin_BSplineBase::attributeChanged(const std::string& theID) { +void SketchPlugin_BSplineBase::attributeChanged(const std::string& /*theID*/) +{ } bool SketchPlugin_BSplineBase::customAction(const std::string& theActionId) diff --git a/src/SketchPlugin/SketchPlugin_MacroArc.cpp b/src/SketchPlugin/SketchPlugin_MacroArc.cpp index e705bdd4f..936163dc6 100644 --- a/src/SketchPlugin/SketchPlugin_MacroArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroArc.cpp @@ -407,7 +407,6 @@ std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptrcreatedFeature(); aRefAttr->setAttr(aCreatedFeature->attribute(SketchPlugin_Arc::END_ID())); } else if (anArcType == ARC_TYPE_BY_TRANSVERSAL_LINE()) { @@ -445,7 +444,6 @@ std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptrowner().get() || !anAttribute->owner()->data()->isValid()) { - FeaturePtr aCreatedFeature = aReentrantMessage->createdFeature(); if (aCreatedFeature.get()) { std::string anID = anAttribute->id(); std::string anArcID; diff --git a/src/SketchPlugin/SketchPlugin_MacroCircle.cpp b/src/SketchPlugin/SketchPlugin_MacroCircle.cpp index 6e453b9c7..6822989a2 100644 --- a/src/SketchPlugin/SketchPlugin_MacroCircle.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroCircle.cpp @@ -126,7 +126,6 @@ std::string SketchPlugin_MacroCircle::processEvent( std::shared_ptr aReentrantMessage = std::dynamic_pointer_cast(theMessage); if (aReentrantMessage.get()) { - FeaturePtr aCreatedFeature = aReentrantMessage->createdFeature(); std::string aCircleType = aReentrantMessage->typeOfCreation(); string(CIRCLE_TYPE())->setValue(aCircleType); @@ -289,10 +288,10 @@ void SketchPlugin_MacroCircle::fillByThreePoints() aCircBuilder.addPassingPoint(aPassedPoint); else { aCircBuilder.addTangentCurve(aTangentCurve); - AttributePoint2DPtr aPassedPoint = + AttributePoint2DPtr aPassedPointAttr = std::dynamic_pointer_cast(aPassedAttr); - if (aPassedPoint) - aCircBuilder.setClosestPoint(aPassedPoint->pnt()); + if (aPassedPointAttr) + aCircBuilder.setClosestPoint(aPassedPointAttr->pnt()); } } diff --git a/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp b/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp index fcadd791b..35ae7220d 100644 --- a/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroEllipticArc.cpp @@ -94,7 +94,7 @@ void SketchPlugin_MacroEllipticArc::execute() Events_Loop::loop()->send(aMessage); } -void SketchPlugin_MacroEllipticArc::attributeChanged(const std::string& theID) +void SketchPlugin_MacroEllipticArc::attributeChanged(const std::string& /*theID*/) { static const int NB_POINTS = 4; std::string aPointAttrName[NB_POINTS] = { CENTER_ID(), diff --git a/src/SketchPlugin/SketchPlugin_MultiRotation.cpp b/src/SketchPlugin/SketchPlugin_MultiRotation.cpp index 28b9c5c51..48a290028 100644 --- a/src/SketchPlugin/SketchPlugin_MultiRotation.cpp +++ b/src/SketchPlugin/SketchPlugin_MultiRotation.cpp @@ -152,6 +152,7 @@ void SketchPlugin_MultiRotation::execute() anInitIter++; } ModelAPI_Tools::removeFeaturesAndReferences(aFeaturesToBeRemoved); + aFeaturesToBeRemoved.clear(); // change number of copies if (aCurrentNbCopies != 0 && aNbCopies != aCurrentNbCopies) { bool isAdd = aNbCopies > aCurrentNbCopies; @@ -162,7 +163,6 @@ void SketchPlugin_MultiRotation::execute() aTargetList = aRefListOfRotated->list(); aTargetIter = aTargetList.begin(); ObjectPtr anObjToCopy = *aTargetIter; - std::set aFeaturesToBeRemoved; while (aTargetIter != aTargetList.end()) { aRefListOfRotated->remove(*aTargetIter); aTargetIter++; @@ -195,6 +195,7 @@ void SketchPlugin_MultiRotation::execute() } } ModelAPI_Tools::removeFeaturesAndReferences(aFeaturesToBeRemoved); + aFeaturesToBeRemoved.clear(); for (aTargetIter = aTargetList.begin(); aTargetIter != aTargetList.end(); aTargetIter++) aRefListOfRotated->append(*aTargetIter); diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index 3e343f249..e0e6222bc 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -496,7 +496,7 @@ bool SketchPlugin_Projection::fillEllipticArc(FeaturePtr& theProjection, bool SketchPlugin_Projection::fillBSpline(FeaturePtr& theProjection, const GeomCurvePtr& theCurve, - const GeomPlanePtr& thePlane) + const GeomPlanePtr& /*thePlane*/) { GeomAPI_BSpline aBSpline(theCurve); @@ -526,9 +526,9 @@ bool SketchPlugin_Projection::fillBSpline(FeaturePtr& theProjection, } else { // non-rational B-spline aWeightsAttr->setSize((int)aWeights.size()); - std::list::iterator anIt = aWeights.begin(); - for (int anIndex = 0; anIt != aWeights.end(); ++anIt, ++anIndex) - aWeightsAttr->setValue(anIndex, *anIt); + std::list::iterator aWIt = aWeights.begin(); + for (int anIndex = 0; aWIt != aWeights.end(); ++aWIt, ++anIndex) + aWeightsAttr->setValue(anIndex, *aWIt); } AttributeDoubleArrayPtr aKnotsAttr = diff --git a/src/SketchPlugin/SketchPlugin_SketchCopy.cpp b/src/SketchPlugin/SketchPlugin_SketchCopy.cpp index 24ce8f582..4439c1067 100644 --- a/src/SketchPlugin/SketchPlugin_SketchCopy.cpp +++ b/src/SketchPlugin/SketchPlugin_SketchCopy.cpp @@ -185,8 +185,7 @@ static void copyRefList(AttributeRefListPtr theOld, } static void copySelection(AttributeSelectionPtr theOld, - AttributeSelectionPtr theNew, - MapEntities& theMapOldNew) + AttributeSelectionPtr theNew) { theNew->selectValue(theOld); } @@ -215,8 +214,7 @@ void copyAttribute(AttributePtr theOld, AttributePtr theNew, MapEntities& theMap } else if (theNew->attributeType() == ModelAPI_AttributeSelection::typeId()) { copySelection(std::dynamic_pointer_cast(theOld), - std::dynamic_pointer_cast(theNew), - theMapOldNew); + std::dynamic_pointer_cast(theNew)); } } diff --git a/src/SketchPlugin/SketchPlugin_Split.cpp b/src/SketchPlugin/SketchPlugin_Split.cpp index a8266e630..e4bb31406 100644 --- a/src/SketchPlugin/SketchPlugin_Split.cpp +++ b/src/SketchPlugin/SketchPlugin_Split.cpp @@ -1095,10 +1095,10 @@ FeaturePtr SketchPlugin_Split::splitEllipticArc(FeaturePtr& theSplitFeature, } FeaturePtr SketchPlugin_Split::splitClosed(FeaturePtr& theSplitFeature, - FeaturePtr& theBaseFeatureModified, - FeaturePtr& theAfterFeature, - std::set& thePoints, - std::set& theCreatedFeatures, + FeaturePtr& theBaseFeatureModified, + FeaturePtr& /*theAfterFeature*/, + std::set& thePoints, + std::set& theCreatedFeatures, std::set>& theModifiedAttributes) { FeaturePtr anNewFeature; @@ -1212,7 +1212,7 @@ FeaturePtr SketchPlugin_Split::splitClosed(FeaturePtr& theSplitFeature, void SketchPlugin_Split::arrangePointsOnLine( const AttributePoint2DPtr& theStartPointAttr, - const AttributePoint2DPtr& theEndPointAttr, + const AttributePoint2DPtr& /*theEndPointAttr*/, AttributePoint2DPtr& theFirstPointAttr, AttributePoint2DPtr& theLastPointAttr) const { @@ -1228,7 +1228,7 @@ void SketchPlugin_Split::arrangePointsOnLine( void SketchPlugin_Split::arrangePointsOnArc( const FeaturePtr& theArc, const std::shared_ptr& theStartPointAttr, - const std::shared_ptr& theEndPointAttr, + const std::shared_ptr& /*theEndPointAttr*/, std::shared_ptr& theFirstPointAttr, std::shared_ptr& theSecondPointAttr) const { diff --git a/src/SketchPlugin/SketchPlugin_Tools.cpp b/src/SketchPlugin/SketchPlugin_Tools.cpp index e5d148323..bbdefcbdd 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.cpp +++ b/src/SketchPlugin/SketchPlugin_Tools.cpp @@ -149,8 +149,8 @@ void findCoincidences(const FeaturePtr theStartCoin, std::set::const_iterator aCIt = aCoincidences.begin(); for (; aCIt != aCoincidences.end(); ++aCIt) { FeaturePtr aConstrFeature = *aCIt; - std::shared_ptr aPnt = getCoincidencePoint(aConstrFeature); - if(aPnt.get() && aOrig->isEqual(aPnt)) { + std::shared_ptr aPnt2d = getCoincidencePoint(aConstrFeature); + if(aPnt2d.get() && aOrig->isEqual(aPnt2d)) { findCoincidences(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A(), theList, theIsAttrOnly); findCoincidences(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B(), @@ -761,9 +761,9 @@ void SketchPlugin_SegmentationTools::fillObjectShapes( // collect all intersection points with other edges for Trim operation only std::list aFeatures; for (int i = 0; i < aSketch->numberOfSubs(); i++) { - FeaturePtr aFeature = aSketch->subFeature(i); - if (aFeature.get() && aFeature->getKind() != SketchPlugin_Projection::ID()) - aFeatures.push_back(aFeature); + FeaturePtr aSubFeature = aSketch->subFeature(i); + if (aSubFeature.get() && aSubFeature->getKind() != SketchPlugin_Projection::ID()) + aFeatures.push_back(aSubFeature); } ModelGeomAlgo_Point2D::getPointsIntersectedShape(aFeature, aFeatures, aPoints); } diff --git a/src/SketchPlugin/SketchPlugin_Trim.cpp b/src/SketchPlugin/SketchPlugin_Trim.cpp index 53ca4deb1..e530af81d 100644 --- a/src/SketchPlugin/SketchPlugin_Trim.cpp +++ b/src/SketchPlugin/SketchPlugin_Trim.cpp @@ -354,27 +354,27 @@ void SketchPlugin_Trim::execute() << "]" << std::endl; #endif - std::shared_ptr aPoint; + std::shared_ptr aExtrPoint; if (aStartShapePoint2d.get() && aPoint2d->isEqual(aStartShapePoint2d)) - aPoint = aStartShapePoint; + aExtrPoint = aStartShapePoint; else if (aLastShapePoint2d.get() && aPoint2d->isEqual(aLastShapePoint2d)) - aPoint = aLastShapePoint; + aExtrPoint = aLastShapePoint; - if (!aPoint.get()) + if (!aExtrPoint.get()) continue; std::pair, std::list > anInfo; for (GeomAlgoAPI_ShapeTools::PointToRefsMap::const_iterator aRefIt = aRefsMap.begin(); aRefIt != aRefsMap.end(); aRefIt++) { - if (aRefIt->first->isEqual(aPoint)) { + if (aRefIt->first->isEqual(aExtrPoint)) { anInfo = aRefIt->second; // prefer a segment instead of a point, because further coincidence with a segment // decreases only 1 DoF (instead of 2 for point) and prevents an overconstraint situation. bool isEdge = false; - for (std::list::const_iterator anIt = anInfo.second.begin(); - anIt != anInfo.second.end() && !isEdge; ++anIt) { - ResultPtr aResult = std::dynamic_pointer_cast(*anIt); + for (std::list::const_iterator anInfoIt = anInfo.second.begin(); + anInfoIt != anInfo.second.end() && !isEdge; ++anInfoIt) { + ResultPtr aResult = std::dynamic_pointer_cast(*anInfoIt); if (aResult) { GeomShapePtr aShape = aResult->shape(); isEdge = aShape && aShape->isEdge(); @@ -1086,7 +1086,7 @@ FeaturePtr SketchPlugin_Trim::trimClosed(const std::shared_ptr& t } void SketchPlugin_Trim::arrangePointsOnLine(const AttributePoint2DPtr& theStartPointAttr, - const AttributePoint2DPtr& theEndPointAttr, + const AttributePoint2DPtr& /*theEndPointAttr*/, std::shared_ptr& theFirstPoint, std::shared_ptr& theLastPoint) const { @@ -1104,7 +1104,7 @@ void SketchPlugin_Trim::arrangePointsOnLine(const AttributePoint2DPtr& theStartP void SketchPlugin_Trim::arrangePointsOnArc(const FeaturePtr& theArc, const AttributePoint2DPtr& theStartPointAttr, - const AttributePoint2DPtr& theEndPointAttr, + const AttributePoint2DPtr& /*theEndPointAttr*/, std::shared_ptr& theFirstPoint, std::shared_ptr& theSecondPoint) const { diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 0597d95a0..078c87f76 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -75,6 +75,10 @@ #include #include +#ifdef _MSC_VER +#pragma warning(disable: 4100) +#endif + const double tolerance = 1.e-7; static bool isSpline(FeaturePtr theFeature) diff --git a/src/SketcherPrs/SketcherPrs_Coincident.cpp b/src/SketcherPrs/SketcherPrs_Coincident.cpp index 43bac7a56..85ed2423f 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.cpp +++ b/src/SketcherPrs/SketcherPrs_Coincident.cpp @@ -111,9 +111,9 @@ bool hasEdge(ModelAPI_Feature* theConstraint) void SketcherPrs_Coincident::Compute( - const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, + const Handle(PrsMgr_PresentationManager3d)& /*thePresentationManager*/, const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) + const Standard_Integer /*theMode*/) { gp_Pnt aPoint; bool aReadyToDisplay = readyToDisplay(myConstraint, mySketch->coordinatePlane(), aPoint); @@ -181,8 +181,8 @@ void SketcherPrs_Coincident::Compute( } -void SketcherPrs_Coincident::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, - const Standard_Integer aMode) +void SketcherPrs_Coincident::ComputeSelection(const Handle(SelectMgr_Selection)& /*theSelection*/, + const Standard_Integer /*theMode*/) { // There is no selection of coincident - a point is selected instead of coincidence } diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp index c5c949ffd..98e82a2cc 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp @@ -487,10 +487,10 @@ void SketcherPrs_PositionMgr::deleteConstraint(const SketcherPrs_SymbolPrs* theP aToDel.push_back(aIt->first); else { // Reindex objects positions in order to avoid spaces - PositionsMap::iterator aIt; + PositionsMap::iterator aPMIt; int i = 0; - for (aIt = aPosMap.begin(); aIt != aPosMap.end(); aIt++, i++) - aIt->second = i; + for (aPMIt = aPosMap.begin(); aPMIt != aPosMap.end(); aPMIt++, i++) + aPMIt->second = i; } } } diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 96eaade66..9bd5a88de 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -240,7 +240,7 @@ void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup, //********************************************************************************* void SketcherPrs_SymbolPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, - const SelectMgr_SequenceOfOwner& theOwners) + const SelectMgr_SequenceOfOwner& /*theOwners*/) { Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( thePM ); aSelectionPrs->Clear(); @@ -255,7 +255,7 @@ void SketcherPrs_SymbolPrs::HilightSelected(const Handle(PrsMgr_PresentationMana void SketcherPrs_SymbolPrs::HilightOwnerWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM, const Handle(Prs3d_Drawer)& theStyle, - const Handle(SelectMgr_EntityOwner)& theOwner) + const Handle(SelectMgr_EntityOwner)& /*theOwner*/) { thePM->Color(this, theStyle); @@ -270,9 +270,9 @@ void SketcherPrs_SymbolPrs::HilightOwnerWithColor( //********************************************************************************* void SketcherPrs_SymbolPrs::Compute( - const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, + const Handle(PrsMgr_PresentationManager3d)& /*thePresentationManager*/, const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) + const Standard_Integer /*theMode*/) { if (!plane().get()) return; diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.h b/src/SketcherPrs/SketcherPrs_SymbolPrs.h index 9c475af3e..dfc7ac4be 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.h +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.h @@ -126,11 +126,12 @@ protected: /// Redefine this function in order to add additiona lines of constraint base /// \param thePrs a presentation /// \param theColor a color of additiona lines - virtual void drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const {} + virtual void drawLines(const Handle(Prs3d_Presentation)& /*thePrs*/, + Quantity_Color /*theColor*/) const {} /// Update myPntArray according to presentation positions /// \return true in case of success - virtual bool updateIfReadyToDisplay(double theStep, bool withColor) const { return true; } + virtual bool updateIfReadyToDisplay(double /*theStep*/, bool /*withColor*/) const { return true; } /// Draw a shape into the given presentation scene /// \param theShape the shape to draw diff --git a/src/XAO/XAO_XaoExporter.cxx b/src/XAO/XAO_XaoExporter.cxx index cf06cc226..cddabd7c3 100644 --- a/src/XAO/XAO_XaoExporter.cxx +++ b/src/XAO/XAO_XaoExporter.cxx @@ -298,7 +298,7 @@ namespace { } } - void exportStep(Step* step, Field* field, xmlNodePtr nodeSteps) + void exportStep(Step* step, Field* /*field*/, xmlNodePtr nodeSteps) { xmlNodePtr nodeStep = xmlNewChild(nodeSteps, 0, C_TAG_STEP, 0); xmlNewProp(nodeStep, C_ATTR_STEP_NUMBER, BAD_CAST XaoUtils::intToString(step->getStep()).c_str()); @@ -378,7 +378,7 @@ namespace { xaoObject->setGeometry(geometry); } - void parseShapeNode(xmlDocPtr doc, xmlNodePtr shapeNode, Geometry* geometry) + void parseShapeNode(xmlDocPtr /*doc*/, xmlNodePtr shapeNode, Geometry* geometry) { if (geometry->getFormat() == XAO::BREP) { diff --git a/src/XGUI/XGUI_ActionsMgr.cpp b/src/XGUI/XGUI_ActionsMgr.cpp index a1a63856b..ef9ac7c00 100644 --- a/src/XGUI/XGUI_ActionsMgr.cpp +++ b/src/XGUI/XGUI_ActionsMgr.cpp @@ -390,7 +390,9 @@ void XGUI_ActionsMgr::updateByDocumentKind() { std::string aStdDocKind = ModelAPI_Session::get()->activeDocument()->kind(); QString aDocKind = QString::fromStdString(aStdDocKind); +#ifdef HAVE_SALOME XGUI_Workshop* aWorkshop = static_cast(parent()); +#endif foreach(QAction* eachAction, myActions.values()) { QString aCmdDocKind; #ifdef HAVE_SALOME diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 2972b77c5..8feca1f34 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -396,7 +396,6 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() // Check is selection continuous XGUI_DataModel* aModel = myWorkshop->objectBrowser()->dataModel(); DocumentPtr aDoc = aMgr->activeDocument(); - std::list aFeatures = aSelMgr->getSelectedFeatures(); bool isContinuos = true; if (aSelected > 1) { diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index 8b7ff8c7e..e3a1fb632 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -32,6 +32,10 @@ #include +#ifdef _MSC_VER +#pragma warning(disable: 4100) +#endif + // Constructor ************************************************* diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index e29ed8122..e9d1f320d 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -90,6 +90,10 @@ #include +#ifdef _MSC_VER +#pragma warning(disable: 4702) +#endif + /// defines the local context mouse selection sensitivity const int MOUSE_SENSITIVITY_IN_PIXEL = 10; @@ -1038,9 +1042,9 @@ void XGUI_Displayer::getPresentations(const ObjectPtr& theObject, ModelAPI_Tools::allResults(aFeature, aResults); std::list::const_iterator anIt = aResults.begin(), aLast = aResults.end(); for (; anIt != aLast; ++anIt) { - AISObjectPtr aAISObj = getAISObject(*anIt); - if (aAISObj.get() != NULL) { - Handle(AIS_InteractiveObject) anAIS = aAISObj->impl(); + AISObjectPtr aCurAISObj = getAISObject(*anIt); + if (aCurAISObj.get() != NULL) { + Handle(AIS_InteractiveObject) anAIS = aCurAISObj->impl(); if (!anAIS.IsNull() && !thePresentations.Contains(anAIS)) thePresentations.Add(anAIS); } diff --git a/src/XGUI/XGUI_FacesPanel.cpp b/src/XGUI/XGUI_FacesPanel.cpp index df5c2ddd7..89528ce7c 100644 --- a/src/XGUI/XGUI_FacesPanel.cpp +++ b/src/XGUI/XGUI_FacesPanel.cpp @@ -397,14 +397,14 @@ void XGUI_FacesPanel::processSelection() // It can happen in case of groups selection QMap::const_iterator aIt; for (aIt = myItems.cbegin(); aIt != myItems.cend(); aIt++) { - ModuleBase_ViewerPrsPtr aPrs = aIt.value(); - ObjectPtr aObject = aPrs->object(); - ResultGroupPtr aResGroup = std::dynamic_pointer_cast(aObject); - if (aResGroup.get()) + ModuleBase_ViewerPrsPtr aCurPrs = aIt.value(); + ObjectPtr aObject = aCurPrs->object(); + ResultGroupPtr aCurResGroup = std::dynamic_pointer_cast(aObject); + if (aCurResGroup.get()) continue; if (anObjectToShapes.find(aObject) != anObjectToShapes.end()) { TopoDS_ListOfShape aShapes = anObjectToShapes[aObject]; - GeomShapePtr aShapePtr = aPrs->shape(); + GeomShapePtr aShapePtr = aCurPrs->shape(); if (aShapes.Contains(aShapePtr->impl())) { aToRemove.insert(aIt.key()); } @@ -647,14 +647,14 @@ void XGUI_FacesPanel::onObjectDisplay(ObjectPtr theObject, AISObjectPtr theAIS) // corresponded faces have been restored for (aSIt = aObjectToShapes.begin(); aSIt != aObjectToShapes.end(); aSIt++) { TopoDS_ListOfShape aShapes = aSIt->second; - Handle(ModuleBase_ResultPrs) aPrs = aObjectToPrs[aSIt->first]; - TopoDS_ListOfShape aAlreadyHidden = aPrs->hiddenSubShapes(); + Handle(ModuleBase_ResultPrs) aResPrs = aObjectToPrs[aSIt->first]; + TopoDS_ListOfShape aAlreadyHidden = aResPrs->hiddenSubShapes(); TopoDS_ListOfShape::Iterator aShPIt(aShapes); for (; aShPIt.More(); aShPIt.Next()) { if (aAlreadyHidden.Contains(aShPIt.Value())) aAlreadyHidden.Remove(aShPIt.Value()); } - aPrs->setSubShapeHidden(aAlreadyHidden); + aResPrs->setSubShapeHidden(aAlreadyHidden); aObjects.insert(aSIt->first); } aIdsToRem.insert(aIt.key()); @@ -665,7 +665,6 @@ void XGUI_FacesPanel::onObjectDisplay(ObjectPtr theObject, AISObjectPtr theAIS) if (aPIt != aObjectToPrs.end()) { ObjectPtr aObj = aPIt->first; if (aObj == theObject) { - Handle(ModuleBase_ResultPrs) aPrs = aPIt->second; TopoDS_ListOfShape aShapes = aObjectToShapes[aObj]; aHideShapes.Append(aShapes); aObjects.insert(aObj); diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 86b46cf8b..09f572a62 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -618,8 +618,8 @@ void XGUI_ObjectsBrowser::clearContent() } //*************************************************** -void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& theSelected, - const QItemSelection& theDeselected) +void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& /*theSelected*/, + const QItemSelection& /*theDeselected*/) { onSelectionChanged(); } diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 139fe20b2..3bca93a90 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -466,9 +466,9 @@ void XGUI_OperationMgr::abortOperation(ModuleBase_Operation* theOperation) // all operation from the current to triggered should also be aborted // operations over the parameter one are not aborted(e.g. extrusion cut, sketch abort) while(hasOperation()) { - ModuleBase_Operation* aCurrentOperation = currentOperation(); - aCurrentOperation->abort(); - if(theOperation == aCurrentOperation) + ModuleBase_Operation* aCurOperation = currentOperation(); + aCurOperation->abort(); + if(theOperation == aCurOperation) break; } } diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 565f9d773..e9a137851 100644 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -365,15 +365,15 @@ void findDirectChildren(QWidget* theParent, QList& theWidgets, const b } } else if (anItem->layout()) { - QLayout* aLayout = anItem->layout(); - for (int i = 0, aCount = aLayout->count(); i < aCount; i++) { - QLayoutItem* anItem = aLayout->itemAt(i); - QWidget* aWidget = anItem ? anItem->widget() : 0; - if (aWidget) { - if (aWidget->isVisible()) { - if (aWidget->focusPolicy() != Qt::NoFocus) - theWidgets.append(aWidget); - findDirectChildren(aWidget, theWidgets, false); + QLayout* anItemLayout = anItem->layout(); + for (int it = 0, cnt = anItemLayout->count(); it < cnt; it++) { + QLayoutItem* aCurItem = anItemLayout->itemAt(it); + QWidget* aCurWidget = aCurItem ? aCurItem->widget() : 0; + if (aCurWidget) { + if (aCurWidget->isVisible()) { + if (aCurWidget->focusPolicy() != Qt::NoFocus) + theWidgets.append(aCurWidget); + findDirectChildren(aCurWidget, theWidgets, false); } } else { diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index e38e5c5b5..b7bd0c733 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -446,13 +446,12 @@ void XGUI_Selection::entityOwners(const Handle(AIS_InteractiveObject)& theObject Handle(SelectMgr_Selection) aSelection = theObject->Selection(aMode); NCollection_Vector anEntities = aSelection->Entities(); - for (NCollection_Vector::Iterator anIt(anEntities); - anIt.More(); - anIt.Next()) { - Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value(); + for (NCollection_Vector::Iterator anEntIt(anEntities); + anEntIt.More(); anEntIt.Next()) { + Handle(SelectMgr_SensitiveEntity) anEntity = anEntIt.Value(); if (anEntity.IsNull()) continue; - Handle(SelectMgr_EntityOwner) anOwner = anEntity->BaseSensitive()->OwnerId(); + Handle(SelectMgr_EntityOwner) anOwner = anEntity->BaseSensitive()->OwnerId(); if (!anOwner.IsNull()) theOwners.Add(anOwner); } diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index d10d87c0f..f4e0f36eb 100644 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -249,9 +249,9 @@ void XGUI_SelectionMgr::convertToObjectBrowserSelection( aFeature = anActiveDocument->producedByFeature(aResult, aShape); if (aFeature.get()) { QList aResList = findAllShapes(aResult); - foreach(TopoDS_Shape aShape, aResList) { - if (!aShapeMap.Contains(aShape)) - aShapeMap.Add(aShape); + foreach(TopoDS_Shape aResShape, aResList) { + if (!aShapeMap.Contains(aResShape)) + aShapeMap.Add(aResShape); } } } diff --git a/src/XGUI/XGUI_TransparencyWidget.cpp b/src/XGUI/XGUI_TransparencyWidget.cpp index a69954fac..c579e2cee 100644 --- a/src/XGUI/XGUI_TransparencyWidget.cpp +++ b/src/XGUI/XGUI_TransparencyWidget.cpp @@ -26,7 +26,8 @@ #include #include -XGUI_TransparencyWidget::XGUI_TransparencyWidget(QWidget* theParent, const QString& theLabelText) +XGUI_TransparencyWidget::XGUI_TransparencyWidget(QWidget* theParent, + const QString& /*theLabelText*/) : QWidget(theParent) { QVBoxLayout* aLay = new QVBoxLayout(this); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 94cc72a80..415cd1635 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1037,8 +1037,6 @@ void XGUI_Workshop::openFile(const QString& theDirectory) #ifdef _DEBUG bool aNewPart = Config_PropManager::boolean("Plugins", "create_part_by_start"); if (aNewPart) { - - DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument(); int aSize = aRootDoc->size(ModelAPI_ResultPart::group()); if (aSize > 0 ) { ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), 0); @@ -2255,8 +2253,8 @@ std::list allFeatures(const DocumentPtr& theDocument) std::dynamic_pointer_cast(aResult); if (aResultPart.get() && aResultPart->partDoc().get()) { // Recursion - std::list anAllFeatures = allFeatures(aResultPart->partDoc()); - aResultList.insert(aResultList.end(), anAllFeatures.begin(), anAllFeatures.end()); + std::list aPartFeatures = allFeatures(aResultPart->partDoc()); + aResultList.insert(aResultList.end(), aPartFeatures.begin(), aPartFeatures.end()); } } @@ -3210,9 +3208,9 @@ void XGUI_Workshop::changeIsoLines(const QObjectPtrList& theObjects) std::vector aValues; bool isVisible; if (aResultList.size() == 1) { - ResultPtr aRes = aResultList.first(); - if (aRes.get()) - ModelAPI_Tools::getIsoLines(aRes, isVisible, aValues); + ResultPtr aResult = aResultList.first(); + if (aResult.get()) + ModelAPI_Tools::getIsoLines(aResult, isVisible, aValues); else return; } @@ -3247,8 +3245,8 @@ void XGUI_Workshop::changeIsoLines(const QObjectPtrList& theObjects) aValues[0] = aUNb->value(); aValues[1] = aVNb->value(); - foreach(ResultPtr aRes, aResultList) { - ModelAPI_Tools::setIsoLines(aRes, aValues); + foreach(ResultPtr aResult, aResultList) { + ModelAPI_Tools::setIsoLines(aResult, aValues); } mySelector->clearSelection(); Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));