{
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;
}
//=================================================================================================
bool BuildPlugin_ValidatorFillingSelection::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
- Events_InfoMessage& theError) const
+ const std::list<std::string>& /*theArguments*/,
+ Events_InfoMessage& theError) const
{
// Get base objects list.
if (theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) {
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;
#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))
bool CollectionPlugin_FieldValidator::isValid(const FeaturePtr& theFeature,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
AttributeSelectionListPtr aSelList =
}
}
// 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);
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);
}
}
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<char>(::tolower(c)); });
return result;
}
#include <Events_InfoMessage.h>
+#include <algorithm>
+
// used only for GUI xml data reading
// LCOV_EXCL_START
Config_DataModelReader::Config_DataModelReader()
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<char>(::toupper(c)); });
bool aIsEmpty = (aEmpty == "FALSE")? false : true;
if (isRootReading) {
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<char>(::toupper(c)); });
myIsResultLink = (isResult == "TRUE")? true : false;
}
}
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
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);
}
}
}
-bool Config_ValidatorReader::processChildren(xmlNodePtr aNode)
+bool Config_ValidatorReader::processChildren(xmlNodePtr /*aNode*/)
{
return true;
}
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);
}
//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;
}
// LCOV_EXCL_START
-bool Config_XMLReader::processChildren(xmlNodePtr aNode)
+bool Config_XMLReader::processChildren(xmlNodePtr /*aNode*/)
{
return true;
}
#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_ */
}
}
- return GeomAlgoAPI_ShapeTools::intersect(anEdge, aFace,
- aPlaneSelection->context()->groupName() == ModelAPI_ResultConstruction::group());
+ return GeomAlgoAPI_ShapeTools::intersect(anEdge, aFace);
}
//==================================================================================================
#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
%}
ExportPtr exportToXAO(const std::shared_ptr<ModelAPI_Document> & 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<ModelAPI_Feature> aFeature =
{
// collect all results into a cashed set
if (theCashedResults.empty()) {
- std::list<ResultPtr> aResults;
std::list<ResultPtr>::const_iterator aRes = theResults.cbegin();
for(; aRes != theResults.cend(); aRes++) {
if (theCashedResults.count(*aRes))
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;
std::set<FeaturePtr> 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);
}
// 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<ModelAPI_Feature> 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<ModelAPI_Feature>(anObj);
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<char>(::toupper(c)); });
std::list<std::string> aFormatList = ExchangePlugin_Tools::split(aFormats, '|');
outFormats.insert(outFormats.end(), aFormatList.begin(), aFormatList.end());
}
ExchangePlugin_FormatValidator::parseFormats(theArguments, aFormats);
std::list<std::string>::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<char>(::toupper(c)); });
// Is file name ends with the format
for (; itFormats != aFormats.end(); ++itFormats) {
std::string aFormat = "." + *itFormats;
// 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);
}
}
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);
}
}
}
//=================================================================================================
-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;
//=================================================================================================
std::shared_ptr<ModelAPI_Feature> FeaturesPlugin_CompositeSketch::subFeature(const int theIndex,
- bool forTree)
+ bool /*forTree*/)
{
FeaturePtr aSubFeature;
if(theIndex == 0) {
}
if (aShape.get()) {
TopoDS_Shape aShp = aShape->impl<TopoDS_Shape>();
- Handle(AIS_RadiusDimension) aDim;
if (thePrevious.get()) {
aAISObj = thePrevious;
Handle(AIS_InteractiveObject) aAIS = aAISObj->impl<Handle(AIS_InteractiveObject)>();
}
case GeomAPI_Shape::COMPOUND: {
aShapeTypeToExplode = GeomAPI_Shape::COMPOUND;
+ break;
}
default:
return; // unsupported type of shape
#include <ModelAPI_Tools.h>
bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
bool aValid = true;
#define _USE_MATH_DEFINES
#include <math.h>
+#ifdef _MSC_VER
+#pragma warning(disable: 4100)
+#endif
+
//==================================================================================================
bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
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) {
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;
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);
}
#include <ModelAPI_AttributeSelectionList.h>
-bool FiltersPlugin_BelongsTo::isSupported(GeomAPI_Shape::ShapeType theType) const
+bool FiltersPlugin_BelongsTo::isSupported(GeomAPI_Shape::ShapeType /*theType*/) const
{
return true;
}
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;
}
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;
}
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;
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;
}
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;
}
#include <GeomAPI_XYZ.h>
-bool FiltersPlugin_OnPlaneSide::isSupported(GeomAPI_Shape::ShapeType theType) const
+bool FiltersPlugin_OnPlaneSide::isSupported(GeomAPI_Shape::ShapeType /*theType*/) const
{
return true;
}
#include <ModelAPI_Session.h>
bool FiltersPlugin_ShapeTypeValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
if (!theAttribute)
}
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;
if (!anAIS.IsNull()) {
Handle(AIS_Shape) aShapeAIS = Handle(AIS_Shape)::DownCast(anAIS);
if (aShapeAIS) {
- std::shared_ptr<GeomAPI_Shape> aResult(new GeomAPI_Shape);
+ aResult.reset(new GeomAPI_Shape);
aResult->setImpl(new TopoDS_Shape(aShapeAIS->Shape()));
- return aResult;
}
}
- return std::shared_ptr<GeomAPI_Shape>();
+ return aResult;
}
void GeomAPI_AISObject::createDistance(std::shared_ptr<GeomAPI_Pnt> theStartPoint,
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<char>(::toupper(c)); });
if (theType == "COMPOUND" || theType == "COMPOUNDS")
return COMPOUND;
if (theType == "COMPSOLID" || theType == "COMPSOLIDS")
#include <memory>
#include <string>
+ #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<class T1, class T2>
std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject)
{
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;
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);
}
//==================================================================================================
//==================================================================================================
void GeomAlgoAPI_MakeShapeList::result(const GeomShapePtr theOldShape,
- OperationType theOperationType,
ListOfShape& theNewShapes)
{
if(myListOfMakeShape.empty()) {
private:
void result(const GeomShapePtr theShape,
- OperationType theOperationType,
ListOfShape& theHistory);
protected:
// 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<GeomAPI_Shape> 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
}
TopoDS_Shape aResult = aBuilder->Shape();
- std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
+ aShape.reset(new GeomAPI_Shape());
aShape->setImpl(new TopoDS_Shape(aResult));
this->setShape(aShape);
this->setDone(true);
#include <Interface_Static.hxx>
bool STEPExport(const std::string& theFileName,
- const std::string& theFormatName,
+ const std::string& /*theFormatName*/,
const std::shared_ptr<GeomAPI_Shape>& theShape,
std::string& theError)
{
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) {
//==================================================================================================
std::list<std::shared_ptr<GeomAPI_Vertex> > GeomAlgoAPI_ShapeTools::intersect(
- const std::shared_ptr<GeomAPI_Edge> theEdge, const std::shared_ptr<GeomAPI_Face> theFace,
- const bool thePointsOutsideFace)
+ const std::shared_ptr<GeomAPI_Edge> theEdge, const std::shared_ptr<GeomAPI_Face> theFace)
{
std::list<std::shared_ptr<GeomAPI_Vertex> > aResult;
if(!theEdge.get() || !theFace.get()) {
GEOMALGOAPI_EXPORT static bool isParallel(const std::shared_ptr<GeomAPI_Edge> theEdge,
const std::shared_ptr<GeomAPI_Face> 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<std::shared_ptr<GeomAPI_Vertex> > intersect(
- const std::shared_ptr<GeomAPI_Edge> theEdge, const std::shared_ptr<GeomAPI_Face> theFace,
- const bool thePointsOutsideFace);
+ const std::shared_ptr<GeomAPI_Edge> theEdge, const std::shared_ptr<GeomAPI_Face> theFace);
typedef std::map<std::shared_ptr<GeomAPI_Pnt>,
std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D> >,
void GeomAlgoAPI_SketchBuilder::build(
const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
- const std::shared_ptr<GeomAPI_Dir>& theDirX,
+ const std::shared_ptr<GeomAPI_Dir>& /*theDirX*/,
const std::shared_ptr<GeomAPI_Dir>& theNorm,
const std::list<std::shared_ptr<GeomAPI_Shape> >& theEdges)
{
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;
}
}
#include <string>
#include <list>
+ #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_ */
#include "ModelAPI_CompositeFeature.h"
bool GeomValidators_ConstructionComposite::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
bool aValid = true;
//=================================================================================================
bool GeomValidators_DifferentShapes::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
bool isValid = false;
#include <ModelAPI_ResultConstruction.h>
bool GeomValidators_Finite::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
bool aValid = true;
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<char>(::tolower(c)); });
if (MyShapeTypes.find(aType) != MyShapeTypes.end())
return MyShapeTypes[aType];
}
if (!aValid && theError.empty()) {
std::string aTypes;
- std::list<std::string>::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;
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
}
}
aToShape = anAttrSel->context()->shape();
}
if (aToShape->isCompound()) {
- GeomAPI_ShapeIterator anIt(aToShape);
- aToShape = anIt.current();
+ GeomAPI_ShapeIterator aSIt(aToShape);
+ aToShape = aSIt.current();
}
}
anIt++;
aFromShape = anAttrSel->context()->shape();
}
if (aFromShape->isCompound()) {
- GeomAPI_ShapeIterator anIt(aFromShape);
- aFromShape = anIt.current();
+ GeomAPI_ShapeIterator aSIt(aFromShape);
+ aFromShape = aSIt.current();
}
}
anIt++;
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);
}
}
}
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);
}
std::string Model_AttributeSelection::namingName(const std::string& theDefaultName)
{
- std::string aName("");
+ std::string aName;
if(!this->isInitialized())
return !theDefaultName.empty() ? theDefaultName : aName;
GeomShapePtr aShape = value();
if (!aShape.get() && context().get())
aShape = context()->shape();
- std::string aName;
if (aShape.get()) {
aName = aShape->shapeTypeStr();
if (myParent) {
NCollection_DataMap<TopoDS_Shape, TopTools_MapOfShape, TopTools_ShapeMapHasher> 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());
}
TopTools_ListOfShape aValShapes;
if (searchNewContext(aDoc, aNewCShape, aContext, aValShape, aContLab, aNewContexts, aValShapes))
{
- std::set<ResultPtr> allContexts, aSkippedContext;
- std::list<ResultPtr>::iterator aNewContext = aNewContexts.begin();
- for(; aNewContext != aNewContexts.end(); aNewContext++)
- allContexts.insert(*aNewContext);
+ std::set<ResultPtr> allContexts(aNewContexts.begin(), aNewContexts.end());
+ std::set<ResultPtr> aSkippedContext;
// if there exist context composite and sub-result(s), leave only sub(s)
std::set<ResultPtr>::iterator aResIter = allContexts.begin();
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);
}
bool Model_AttributeSelectionList::isInList(const ObjectPtr& theContext,
const std::shared_ptr<GeomAPI_Shape>& theSubShape,
- const bool theTemporarily)
+ const bool /*theTemporarily*/)
{
if (myIsCashed) { // the cashing is active
if (theContext.get()) {
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;
#include <GeomDataAPI_Point2D.h>
bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() == ModelAPI_AttributeInteger::typeId()) {
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());
}
}
}
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<ModelAPI_AttributeRefList>(anAttr)->list();
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);
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
#include <memory>
bool Model_FeatureValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
static Model_ValidatorsFactory* aValidators =
ModelAPI_Tools::allResults(aFeature, aResults);
std::list<ResultPtr>::iterator aResIter = aResults.begin();
for(; aResIter != aResults.end(); aResIter++) {
- std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs =
- (*aResIter)->data()->attributes("");
- std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
- for(; anAttr != anAttrs.end(); anAttr++)
+ anAttrs = (*aResIter)->data()->attributes("");
+ for(anAttr = anAttrs.begin(); anAttr != anAttrs.end(); anAttr++)
(*anAttr)->reinit();
}
}
bool Model_Objects::hasCustomName(DataPtr theFeatureData,
ResultPtr theResult,
- int theResultIndex,
+ int /*theResultIndex*/,
std::string& theParentName) const
{
ResultBodyPtr aBodyRes = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theFeatureData->owner());
}
}
-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();
}
}
-int Model_ResultConstruction::facesNum(const bool theUpdateNaming)
+int Model_ResultConstruction::facesNum(const bool /*theUpdateNaming*/)
{
int aResult = 0;
std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
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);
std::list<std::shared_ptr<ModelAPI_Document> > aResult;
aResult.push_back(moduleDocument());
// add subs recursively
- std::list<std::shared_ptr<ModelAPI_Document> >::iterator aDoc = aResult.begin();
- for(; aDoc != aResult.end(); aDoc++) {
- DocumentPtr anAPIDoc = *aDoc;
+ std::list<std::shared_ptr<ModelAPI_Document> >::iterator aDocIt = aResult.begin();
+ for(; aDocIt != aResult.end(); aDocIt++) {
+ DocumentPtr anAPIDoc = *aDocIt;
std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(anAPIDoc);
if (aDoc) {
const std::set<int> aSubs = aDoc->subDocuments();
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);
ModelAPI_Tools::allResults(theFeature, allResults);
std::list<ResultPtr>::iterator aRes = allResults.begin();
for(; aRes != allResults.end(); aRes++) {
- const std::set<std::shared_ptr<ModelAPI_Attribute> >& aRefs = (*aRes)->data()->refsToMe();
- std::set<std::shared_ptr<ModelAPI_Attribute> >::const_iterator aRefIter = aRefs.cbegin();
- for(; aRefIter != aRefs.cend(); aRefIter++) {
- if ((*aRefIter)->isArgument()) {
- FeaturePtr aReferenced = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRefIter)->owner());
+ const std::set<std::shared_ptr<ModelAPI_Attribute> >& aResRefs = (*aRes)->data()->refsToMe();
+ std::set<std::shared_ptr<ModelAPI_Attribute> >::const_iterator aRIter = aResRefs.cbegin();
+ for(; aRIter != aResRefs.cend(); aRIter++) {
+ if ((*aRIter)->isArgument()) {
+ FeaturePtr aReferenced = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRIter)->owner());
if (aReferenced.get()) {
addModified(aReferenced, theFeature);
}
for(; aRefIter != aRefs.cend(); aRefIter++) {
if (!(*aRefIter)->owner()->data()->isValid())
continue;
- FeaturePtr anUpdated = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRefIter)->owner());
+ anUpdated = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRefIter)->owner());
if (anUpdated.get()) {
if (addModified(anUpdated, aReason))
aSomeModified = true;
return myIsStable;
}
-bool ModelAPI_Feature::customAction(const std::string& theActionId)
+bool ModelAPI_Feature::customAction(const std::string& /*theActionId*/)
{
return false;
}
/// 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,
/// 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.
return myDoc;
}
-void ModelAPI_Object::attributeChanged(const std::string& theID)
+void ModelAPI_Object::attributeChanged(const std::string& /*theID*/)
{
}
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
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;
/// \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*/)
{}
};
}
bool removeFeaturesAndReferences(const std::set<FeaturePtr>& theFeatures,
- const bool theFlushRedisplay,
+ const bool /*theFlushRedisplay*/,
const bool theUseComposite,
const bool theUseRecursion)
{
}
else { // filter references to skip composition features of the current feature
std::set<FeaturePtr> aFilteredFeatures;
- std::set<FeaturePtr>::const_iterator anIt = aSelRefFeatures.begin(),
- aLast = aSelRefFeatures.end();
- for (; anIt != aLast; anIt++) {
- FeaturePtr aCFeature = *anIt;
+ std::set<FeaturePtr>::const_iterator aRefIt = aSelRefFeatures.begin(),
+ aRefLast = aSelRefFeatures.end();
+ for (; aRefIt != aRefLast; aRefIt++) {
+ FeaturePtr aCFeature = *aRefIt;
CompositeFeaturePtr aComposite =
std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aCFeature);
if (aComposite.get() && aComposite->isSub(aFeature))
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
for(; aResIter != aResSet.end(); aResIter++) {
std::list<ResultPtr>::const_iterator aGroupRes = (*aResIter)->results().cbegin();
for(; aGroupRes != (*aResIter)->results().cend(); aGroupRes++) {
- const std::set<AttributePtr>& aRefs = (*aGroupRes)->data()->refsToMe();
- std::set<AttributePtr>::const_iterator aRef = aRefs.cbegin();
- for(; aRef != aRefs.cend(); aRef++) {
- FeaturePtr aFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRef)->owner());
+ const std::set<AttributePtr>& aGroupRefs = (*aGroupRes)->data()->refsToMe();
+ std::set<AttributePtr>::const_iterator aRefIt = aGroupRefs.cbegin();
+ for(; aRefIt != aGroupRefs.cend(); aRefIt++) {
+ FeaturePtr aFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*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
%typemap(in) const std::list<int> & (std::list<int> 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);
}
%typecheck(SWIG_TYPECHECK_POINTER) std::list<int>, const std::list<int>& {
- int newmem = 0;
if (PySequence_Check($input)) {
for (Py_ssize_t i = 0; i < PySequence_Size($input); ++i) {
PyObject * item = PySequence_GetItem($input, i);
%typemap(in) const std::list<double> & (std::list<double> 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);
}
%typecheck(SWIG_TYPECHECK_POINTER) std::list<double>, const std::list<double>& {
- int newmem = 0;
if (PyTuple_Check($input)) {
for (Py_ssize_t i = 0; i < PyTuple_Size($input); ++i) {
PyObject * item = PySequence_GetItem($input, i);
/// Dump std::endl
friend
DumpStorageBuffer& operator<<(DumpStorageBuffer& theBuffer,
- std::basic_ostream<char>& (*theEndl)(std::basic_ostream<char>&))
+ std::basic_ostream<char>& (*)(std::basic_ostream<char>&))
{
theBuffer.write("\n");
return theBuffer;
int aFullIndex = 0;
NbFeaturesMap::const_iterator aFIt = myFeatureCount.begin();
for (; aFIt != myFeatureCount.end(); ++aFIt) {
- std::map<std::string, std::pair<int, int> >::const_iterator aFound =
+ std::map<std::string, std::pair<int, int> >::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;
}
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
/// Dump wrapped feature
MODELHIGHAPI_EXPORT
- virtual void dump(ModelHighAPI_Dumper& theDumper) const {}
+ virtual void dump(ModelHighAPI_Dumper& /*theDumper*/) const {}
protected:
std::shared_ptr<ModelAPI_Feature> myFeature; ///< feature of this interface
//--------------------------------------------------------------------------------------
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;
{
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<char>(::tolower(c)); });
if(theShapeTypeStr == "compound") {
aShapeType = GeomAPI_Shape::COMPOUND;
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<char>(::tolower(c)); });
if (aType == "boolean")
return ModelAPI_AttributeTables::BOOLEAN;
else if (aType == "integer")
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");
#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_ */
ModuleBase_ActionInfo::ModuleBase_ActionInfo(const QString &theText)
{
initDefault();
+ text = theText;
}
ModuleBase_ActionInfo::ModuleBase_ActionInfo(const QIcon & theIcon, const QString &theText)
/// \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);
}
#include <vector>
#include <map>
+#ifdef _MSC_VER
+#pragma warning(disable: 4100)
+#endif
+
class QAction;
class QMouseEvent;
class QKeyEvent;
std::shared_ptr<GeomAPI_Vertex> aGeomPrsVertex = getPresentationVertex(aPrs);
if (aGeomPrsVertex.get()) {
const TopoDS_Vertex& aPrsVertex = aGeomPrsVertex->impl<TopoDS_Vertex>();
- std::set<std::shared_ptr<GeomAPI_Vertex> >::const_iterator anIt = aVerticesMap.begin(),
- aLast = aVerticesMap.end();
+ std::set<std::shared_ptr<GeomAPI_Vertex> >::const_iterator aVIt = aVerticesMap.begin(),
+ aVLast = aVerticesMap.end();
bool aFound = false;
- for (; anIt != aLast && !aFound; anIt++) {
- std::shared_ptr<GeomAPI_Vertex> aGeomVertex = *anIt;
+ for (; aVIt != aVLast && !aFound; aVIt++) {
+ std::shared_ptr<GeomAPI_Vertex> aGeomVertex = *aVIt;
const TopoDS_Vertex& aVertex = aGeomVertex->impl<TopoDS_Vertex>();
gp_Pnt aPoint1 = BRep_Tool::Pnt(aVertex);
gp_Pnt aPoint2 = BRep_Tool::Pnt(aPrsVertex);
#include <QIcon>
#include <QVariant>
+#ifdef _MSC_VER
+#pragma warning(disable: 4100)
+#endif
+
class ModuleBase_ITreeNode;
class ModuleBase_IWorkshop;
#include <string>
#include <memory>
+#ifdef _MSC_VER
+#pragma warning(disable: 4100)
+#endif
+
class ModuleBase_ModelWidget;
class ModuleBase_PageBase;
class ModuleBase_IWorkshop;
/// 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<std::string>& theTypes) {}
+ virtual void panelTypes(std::set<std::string>& /*theTypes*/) {}
/// Returns a container of possible page types, which this creator can process
/// The default implementation is empty
#include <memory>
+#ifdef _MSC_VER
+#pragma warning(disable: 4100)
+#endif
+
class Config_WidgetAPI;
class Events_InfoMessage;
class ModuleBase_IPropertyPanel;
myIsModified = true;
}
-void ModuleBase_Operation::onValueStateChanged(int thePreviousState)
+void ModuleBase_Operation::onValueStateChanged(int /*thePreviousState*/)
{
if (propertyPanel()) {
ModuleBase_ModelWidget* aWidget = propertyPanel()->activeWidget();
std::shared_ptr<ModelAPI_AttributeRefList> aCurSelList =
std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(*anIt);
for (int i = 0, aNb = aCurSelList->size(); i < aNb && !aFoundObject; i++) {
- ObjectPtr anObject = aCurSelList->object(i);
- FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anObject);
- if (aFeature.get()) {
- aFoundObject = anObjectFeature == aFeature;
+ ObjectPtr aCurObj = aCurSelList->object(i);
+ FeaturePtr aCurFeat = std::dynamic_pointer_cast<ModelAPI_Feature>(aCurObj);
+ if (aCurFeat.get()) {
+ aFoundObject = anObjectFeature == aCurFeat;
}
}
}
}
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());
/// 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; }
//********************************************************************
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();
#include <ModuleBase_SelectionValidator.h>
-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;
}
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();
}
}
}
-void ModuleBase_WidgetConcealedObjects::onItemToggled(bool theState)
+void ModuleBase_WidgetConcealedObjects::onItemToggled(bool /*theState*/)
{
emit valuesChanged();
updateObject(myFeature);
//********************************************************************
void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const int theShapeType)
{
- QString aShapeTypeName;
-
int idx = 0;
foreach (QString aShapeTypeName, myShapeTypes) {
int aRefType = ModuleBase_Tools::shapeType(aShapeTypeName);
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 {
if (!anObject.get())
continue;
TopoDS_Shape aShape;
- AttributePtr anAttribute = aRefAttrListAttr->attribute(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<ModuleBase_ViewerPrs>(
new ModuleBase_ViewerPrs(anObject, aGeomShape, NULL)));
}
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,
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++) {
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<ModelAPI_ResultBody>(aObj);
TopTools_MapOfShape alreadyThere;
std::list<GeomShapePtr>::const_iterator aShapesIt;
for (aShapesIt = aSubShapes.cbegin(); aShapesIt != aSubShapes.cend(); aShapesIt++) {
- GeomShapePtr aShape = (*aShapesIt);
- TopoDS_Shape aTShape = aShape->impl<TopoDS_Shape>();
+ GeomShapePtr aSubShape = (*aShapesIt);
+ TopoDS_Shape aTShape = aSubShape->impl<TopoDS_Shape>();
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);
}
}
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;
}
AttributeSelectionPtr aSelectAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(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<TopoDS_Shape>();
+ if (aShapePtr.get()) {
+ const TopoDS_Shape aTDShape = aShapePtr->impl<TopoDS_Shape>();
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<ModelAPI_ResultBody>(aResult);
+ ResultPtr aFirstRes = aFeature->firstResult();
+ if (aFirstRes.get()) {
+ ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(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<TopoDS_Shape>();
- AISObjectPtr aIOPtr = myWorkshop->findPresentation(aResult);
+ AISObjectPtr aIOPtr = myWorkshop->findPresentation(aFirstRes);
if (aIOPtr.get()) {
Handle(AIS_InteractiveObject) anIO =
aIOPtr->impl<Handle(AIS_InteractiveObject)>();
/// 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
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<ModelAPI_Feature>(data()->owner());
std::shared_ptr<ModelAPI_ParameterEvalMessage> aProcessMessage =
}
bool ParametersPlugin_VariableValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
AttributeStringPtr aStrAttr = std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
}
bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
+ const std::list<std::string>& /*theArguments*/,
Events_InfoMessage& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
} 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());
}
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();
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();
void PartSet_ExternalObjectsMgr::removeExternalObject(const ObjectPtr& theObject,
const CompositeFeaturePtr& /*theSketch*/,
- const FeaturePtr& theFeature,
+ const FeaturePtr& /*theFeature*/,
ModuleBase_IWorkshop* theWorkshop)
{
if (theObject.get()) {
#define POINT_SIZE 8
-void emptyDeleter(ModelAPI_ResultField* theF)
+void emptyDeleter(ModelAPI_ResultField* /*theF*/)
{
// Do nothing
}
// 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<FeaturePtr> aCoins;
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]";
#include <memory>
+#ifdef _MSC_VER
+#pragma warning(disable: 4100)
+#endif
+
class ModuleBase_IViewWindow;
class ModuleBase_ViewerPrs;
class QMouseEvent;
GeomShapePtr aShape = theShape;
if (!aShape.get()) {
- ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
- if (aResult.get())
- aShape = aResult->shape();
+ ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+ if (aRes.get())
+ aShape = aRes->shape();
}
if (!isSubObject(theObject, theFeature))
appendShapeIfVisible(theWorkshop, theObject, aShape, theObjectShapes);
ObjectPtr anObject;
GeomShapePtr aShape;
if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) {
- AttributeRefAttrPtr anAttr =
+ AttributeRefAttrPtr aRefAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(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()) {
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)) {
launchEditing();
myIsEditLaunching = aPrevLaunchingState;
if (aFeature.get() != NULL) {
- std::shared_ptr<SketchPlugin_Feature> aSPFeature =
+ std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(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<GeomDataAPI_Point2D> aFPAttr =
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aAttr);
#ifdef DEBUG_SKETCHER_ENTITIES
anInfo.append(ModuleBase_Tools::objectInfo(aFeature));
#endif
- std::list<ResultPtr> aResults = aFeature->results();
- std::list<ResultPtr>::const_iterator aIt;
- for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
+ std::list<ResultPtr> 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);
anAISIO = anAIS->impl<Handle(AIS_InteractiveObject)>();
}
if (anAIS.get() != NULL) {
- Handle(AIS_InteractiveObject) anAISIO = anAIS->impl<Handle(AIS_InteractiveObject)>();
+ anAISIO = anAIS->impl<Handle(AIS_InteractiveObject)>();
if (!anAISIO.IsNull()) {
Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAISIO);
}
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)>();
+ Handle(AIS_InteractiveObject) anAISIO = aResAISObj->impl<Handle(AIS_InteractiveObject)>();
SelectMgr_IndexedMapOfOwner aSelectedOwners;
aConnector->workshop()->selector()->selection()->entityOwners(anAISIO, aSelectedOwners);
std::list<ResultPtr> aResults = aFeature->results();
std::list<ResultPtr>::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);
}
}
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*aIt);
if (aFeature.get()) {
std::list<ResultPtr> aRes = aFeature->results();
- std::list<ResultPtr>::const_iterator aIt;
- for (aIt = aRes.cbegin(); aIt != aRes.cend(); ++aIt) {
- ModuleBase_ViewerPrsPtr aPrsPtr(new ModuleBase_ViewerPrs(*aIt));
+ std::list<ResultPtr>::const_iterator aRIt;
+ for (aRIt = aRes.cbegin(); aRIt != aRes.cend(); ++aRIt) {
+ ModuleBase_ViewerPrsPtr aPrsPtr(new ModuleBase_ViewerPrs(*aRIt));
aPrsList.append(aPrsPtr);
}
}
// 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");
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<SketchPlugin_Feature> aSPFeature =
- std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(aCurFeature);
if (aSPFeature.get()) {
bool isAxiliary =
aSPFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
}
} else {
// processing mouse move in active widget of restarted operation
- ModuleBase_ModelWidget* anActiveWidget = module()->activeWidget();
- PartSet_MouseProcessor* aProcessor = dynamic_cast<PartSet_MouseProcessor*>(anActiveWidget);
+ ModuleBase_ModelWidget* anActiveWdg = module()->activeWidget();
+ PartSet_MouseProcessor* aProcessor = dynamic_cast<PartSet_MouseProcessor*>(anActiveWdg);
if (aProcessor)
aProcessor->mouseMoved(theWnd, theEvent);
}
/// Find by result
if (!aCoincident.get()) {
std::list<ResultPtr> aResults = theFeature->results();
- std::list<ResultPtr>::const_iterator aIt;
- for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
- ResultPtr aResult = *aIt;
+ std::list<ResultPtr>::const_iterator aResIt;
+ for (aResIt = aResults.cbegin(); aResIt != aResults.cend(); ++aResIt) {
+ ResultPtr aResult = *aResIt;
aCoincident = findFirstCoincidenceByData(aResult->data(), thePoint);
if (aCoincident.get())
break;
FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
if (!theCoincidencies.contains(aConstrFeature)) {
- std::shared_ptr<GeomAPI_Pnt2d> aPnt = getCoincedencePoint(aConstrFeature);
- if (aPnt.get() && aOrig->isEqual(aPnt)) {
+ std::shared_ptr<GeomAPI_Pnt2d> aCoincPnt = getCoincedencePoint(aConstrFeature);
+ if (aCoincPnt.get() && aOrig->isEqual(aCoincPnt)) {
findCoincidences(aConstrFeature, theList, theCoincidencies,
SketchPlugin_ConstraintCoincidence::ENTITY_A(), theIsAttributes);
findCoincidences(aConstrFeature, theList, theCoincidencies,
// Find by Results
ResultConstructionPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(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
FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
if (!theCoincidencies.contains(aConstrFeature)) {
- std::shared_ptr<GeomAPI_Pnt2d> aPnt = getCoincedencePoint(aConstrFeature);
- if (aPnt.get() && aOrig->isEqual(aPnt)) {
+ std::shared_ptr<GeomAPI_Pnt2d> aCoincPnt = getCoincedencePoint(aConstrFeature);
+ if (aCoincPnt.get() && aOrig->isEqual(aCoincPnt)) {
findCoincidences(aConstrFeature, theList, theCoincidencies,
SketchPlugin_ConstraintCoincidence::ENTITY_A(), theIsAttributes);
findCoincidences(aConstrFeature, theList, theCoincidencies,
aNode = myChildren.takeLast();
delete aNode;
}
- foreach(ModuleBase_ITreeNode* aNode, myChildren) {
- aNode->update();
+ foreach(ModuleBase_ITreeNode* aChildNode, myChildren) {
+ aChildNode->update();
}
}
else {
}
}
}
- foreach(ModuleBase_ITreeNode* aNode, myChildren) {
- aResult.append(aNode->objectCreated(theObjects));
+ foreach(ModuleBase_ITreeNode* aChildNode, myChildren) {
+ aResult.append(aChildNode->objectCreated(theObjects));
}
}
return aResult;
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++;
}
}
}
}
-QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& theObjects)
+QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& /*theObjects*/)
{
QTreeNodesList aResult;
int aFirst = -1, aLast = -1;
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;
}
}
else if (anAttrType == ModelAPI_AttributeSelection::typeId()) {
- AttributeSelectionPtr anAttr =
+ AttributeSelectionPtr anAttrSel =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(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());
}
}
else if (anAttrType == ModelAPI_AttributeReference::typeId()) {
- AttributeReferencePtr anAttr =
+ AttributeReferencePtr anAttrRef =
std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
- ObjectPtr anObject = anAttr->value();
+ ObjectPtr anObject = anAttrRef->value();
// Check selection attributes
anAttrs = aFeature->data()->attributes(ModelAPI_AttributeReference::typeId());
if (anAttrs.size() > 0) {
return false;
}
}
- return true;
}
+ return true;
}
}
else if(anAttrType == ModelAPI_AttributeSelectionList::typeId()) {
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);
(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;
}
// check plane or planar face of any non-sketch object
if (aCanFillSketch) {
- std::shared_ptr<GeomAPI_Face> aGeomFace;
-
GeomShapePtr aGeomShape = thePrs->shape();
if ((!aGeomShape.get() || aGeomShape->isNull()) && aResult.get()) {
aGeomShape = aResult->shape();
}
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<TopoDS_Shape>();
+ if (aSelShape.get() && aSelShape->isPlanar()) {
+ const TopoDS_Shape& aTDShape = aSelShape->impl<TopoDS_Shape>();
setSketchPlane(aTDShape);
isOwnerSet = true;
}
return FeaturePtr();
}
-int PartSetPlugin_Part::numberOfSubs(bool forTree) const
+int PartSetPlugin_Part::numberOfSubs(bool /*forTree*/) const
{
ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
if (aResult.get()) {
return 0;
}
-std::shared_ptr<ModelAPI_Feature> PartSetPlugin_Part::subFeature(const int theIndex, bool forTree)
+std::shared_ptr<ModelAPI_Feature> PartSetPlugin_Part::subFeature(const int theIndex,
+ bool /*forTree*/)
{
ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
if (aResult.get()) {
}
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)) {
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<char>(::tolower(c)); });
if (aTypeLC == "supplementary")
aType = (int)SketcherPrs_Tools::ANGLE_COMPLEMENTARY;
else if (aTypeLC == "backward")
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)
if(anArcType == ARC_TYPE_BY_TANGENT_EDGE()) {
aFilledAttributeName = TANGENT_POINT_ID();
AttributeRefAttrPtr aRefAttr = refattr(aFilledAttributeName);
- FeaturePtr aCreatedFeature = aReentrantMessage->createdFeature();
aRefAttr->setAttr(aCreatedFeature->attribute(SketchPlugin_Arc::END_ID()));
}
else if (anArcType == ARC_TYPE_BY_TRANSVERSAL_LINE()) {
if (aRefAttr.get()) {
if (anAttribute.get()) {
if (!anAttribute->owner().get() || !anAttribute->owner()->data()->isValid()) {
- FeaturePtr aCreatedFeature = aReentrantMessage->createdFeature();
if (aCreatedFeature.get()) {
std::string anID = anAttribute->id();
std::string anArcID;
std::shared_ptr<SketchPlugin_MacroArcReentrantMessage> aReentrantMessage =
std::dynamic_pointer_cast<SketchPlugin_MacroArcReentrantMessage>(theMessage);
if (aReentrantMessage.get()) {
- FeaturePtr aCreatedFeature = aReentrantMessage->createdFeature();
std::string aCircleType = aReentrantMessage->typeOfCreation();
string(CIRCLE_TYPE())->setValue(aCircleType);
aCircBuilder.addPassingPoint(aPassedPoint);
else {
aCircBuilder.addTangentCurve(aTangentCurve);
- AttributePoint2DPtr aPassedPoint =
+ AttributePoint2DPtr aPassedPointAttr =
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aPassedAttr);
- if (aPassedPoint)
- aCircBuilder.setClosestPoint(aPassedPoint->pnt());
+ if (aPassedPointAttr)
+ aCircBuilder.setClosestPoint(aPassedPointAttr->pnt());
}
}
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(),
anInitIter++;
}
ModelAPI_Tools::removeFeaturesAndReferences(aFeaturesToBeRemoved);
+ aFeaturesToBeRemoved.clear();
// change number of copies
if (aCurrentNbCopies != 0 && aNbCopies != aCurrentNbCopies) {
bool isAdd = aNbCopies > aCurrentNbCopies;
aTargetList = aRefListOfRotated->list();
aTargetIter = aTargetList.begin();
ObjectPtr anObjToCopy = *aTargetIter;
- std::set<FeaturePtr> aFeaturesToBeRemoved;
while (aTargetIter != aTargetList.end()) {
aRefListOfRotated->remove(*aTargetIter);
aTargetIter++;
}
}
ModelAPI_Tools::removeFeaturesAndReferences(aFeaturesToBeRemoved);
+ aFeaturesToBeRemoved.clear();
for (aTargetIter = aTargetList.begin(); aTargetIter != aTargetList.end(); aTargetIter++)
aRefListOfRotated->append(*aTargetIter);
bool SketchPlugin_Projection::fillBSpline(FeaturePtr& theProjection,
const GeomCurvePtr& theCurve,
- const GeomPlanePtr& thePlane)
+ const GeomPlanePtr& /*thePlane*/)
{
GeomAPI_BSpline aBSpline(theCurve);
}
else { // non-rational B-spline
aWeightsAttr->setSize((int)aWeights.size());
- std::list<double>::iterator anIt = aWeights.begin();
- for (int anIndex = 0; anIt != aWeights.end(); ++anIt, ++anIndex)
- aWeightsAttr->setValue(anIndex, *anIt);
+ std::list<double>::iterator aWIt = aWeights.begin();
+ for (int anIndex = 0; aWIt != aWeights.end(); ++aWIt, ++anIndex)
+ aWeightsAttr->setValue(anIndex, *aWIt);
}
AttributeDoubleArrayPtr aKnotsAttr =
}
static void copySelection(AttributeSelectionPtr theOld,
- AttributeSelectionPtr theNew,
- MapEntities& theMapOldNew)
+ AttributeSelectionPtr theNew)
{
theNew->selectValue(theOld);
}
}
else if (theNew->attributeType() == ModelAPI_AttributeSelection::typeId()) {
copySelection(std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theOld),
- std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theNew),
- theMapOldNew);
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theNew));
}
}
}
FeaturePtr SketchPlugin_Split::splitClosed(FeaturePtr& theSplitFeature,
- FeaturePtr& theBaseFeatureModified,
- FeaturePtr& theAfterFeature,
- std::set<AttributePoint2DPtr>& thePoints,
- std::set<FeaturePtr>& theCreatedFeatures,
+ FeaturePtr& theBaseFeatureModified,
+ FeaturePtr& /*theAfterFeature*/,
+ std::set<AttributePoint2DPtr>& thePoints,
+ std::set<FeaturePtr>& theCreatedFeatures,
std::set<std::pair<AttributePtr, AttributePtr>>& theModifiedAttributes)
{
FeaturePtr anNewFeature;
void SketchPlugin_Split::arrangePointsOnLine(
const AttributePoint2DPtr& theStartPointAttr,
- const AttributePoint2DPtr& theEndPointAttr,
+ const AttributePoint2DPtr& /*theEndPointAttr*/,
AttributePoint2DPtr& theFirstPointAttr,
AttributePoint2DPtr& theLastPointAttr) const
{
void SketchPlugin_Split::arrangePointsOnArc(
const FeaturePtr& theArc,
const std::shared_ptr<GeomDataAPI_Point2D>& theStartPointAttr,
- const std::shared_ptr<GeomDataAPI_Point2D>& theEndPointAttr,
+ const std::shared_ptr<GeomDataAPI_Point2D>& /*theEndPointAttr*/,
std::shared_ptr<GeomDataAPI_Point2D>& theFirstPointAttr,
std::shared_ptr<GeomDataAPI_Point2D>& theSecondPointAttr) const
{
std::set<FeaturePtr>::const_iterator aCIt = aCoincidences.begin();
for (; aCIt != aCoincidences.end(); ++aCIt) {
FeaturePtr aConstrFeature = *aCIt;
- std::shared_ptr<GeomAPI_Pnt2d> aPnt = getCoincidencePoint(aConstrFeature);
- if(aPnt.get() && aOrig->isEqual(aPnt)) {
+ std::shared_ptr<GeomAPI_Pnt2d> aPnt2d = getCoincidencePoint(aConstrFeature);
+ if(aPnt2d.get() && aOrig->isEqual(aPnt2d)) {
findCoincidences(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A(),
theList, theIsAttrOnly);
findCoincidences(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B(),
// collect all intersection points with other edges for Trim operation only
std::list<FeaturePtr> 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);
}
<< "]" << std::endl;
#endif
- std::shared_ptr<GeomAPI_Pnt> aPoint;
+ std::shared_ptr<GeomAPI_Pnt> 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<AttributePoint2DPtr >, std::list<ObjectPtr > > 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<ObjectPtr>::const_iterator anIt = anInfo.second.begin();
- anIt != anInfo.second.end() && !isEdge; ++anIt) {
- ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(*anIt);
+ for (std::list<ObjectPtr>::const_iterator anInfoIt = anInfo.second.begin();
+ anInfoIt != anInfo.second.end() && !isEdge; ++anInfoIt) {
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(*anInfoIt);
if (aResult) {
GeomShapePtr aShape = aResult->shape();
isEdge = aShape && aShape->isEdge();
}
void SketchPlugin_Trim::arrangePointsOnLine(const AttributePoint2DPtr& theStartPointAttr,
- const AttributePoint2DPtr& theEndPointAttr,
+ const AttributePoint2DPtr& /*theEndPointAttr*/,
std::shared_ptr<GeomAPI_Pnt2d>& theFirstPoint,
std::shared_ptr<GeomAPI_Pnt2d>& theLastPoint) const
{
void SketchPlugin_Trim::arrangePointsOnArc(const FeaturePtr& theArc,
const AttributePoint2DPtr& theStartPointAttr,
- const AttributePoint2DPtr& theEndPointAttr,
+ const AttributePoint2DPtr& /*theEndPointAttr*/,
std::shared_ptr<GeomAPI_Pnt2d>& theFirstPoint,
std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint) const
{
#include <algorithm>
#include <cmath>
+#ifdef _MSC_VER
+#pragma warning(disable: 4100)
+#endif
+
const double tolerance = 1.e-7;
static bool isSpline(FeaturePtr theFeature)
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);
}
-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
}
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;
}
}
}
//*********************************************************************************
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();
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);
//*********************************************************************************
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;
/// 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
}
}
- 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());
xaoObject->setGeometry(geometry);
}
- void parseShapeNode(xmlDocPtr doc, xmlNodePtr shapeNode, Geometry* geometry)
+ void parseShapeNode(xmlDocPtr /*doc*/, xmlNodePtr shapeNode, Geometry* geometry)
{
if (geometry->getFormat() == XAO::BREP)
{
{
std::string aStdDocKind = ModelAPI_Session::get()->activeDocument()->kind();
QString aDocKind = QString::fromStdString(aStdDocKind);
+#ifdef HAVE_SALOME
XGUI_Workshop* aWorkshop = static_cast<XGUI_Workshop*>(parent());
+#endif
foreach(QAction* eachAction, myActions.values()) {
QString aCmdDocKind;
#ifdef HAVE_SALOME
// Check is selection continuous
XGUI_DataModel* aModel = myWorkshop->objectBrowser()->dataModel();
DocumentPtr aDoc = aMgr->activeDocument();
- std::list<FeaturePtr> aFeatures = aSelMgr->getSelectedFeatures();
bool isContinuos = true;
if (aSelected > 1) {
#include <cassert>
+#ifdef _MSC_VER
+#pragma warning(disable: 4100)
+#endif
+
// Constructor *************************************************
#include <set>
+#ifdef _MSC_VER
+#pragma warning(disable: 4702)
+#endif
+
/// defines the local context mouse selection sensitivity
const int MOUSE_SENSITIVITY_IN_PIXEL = 10;
ModelAPI_Tools::allResults(aFeature, aResults);
std::list<ResultPtr>::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<Handle(AIS_InteractiveObject)>();
+ AISObjectPtr aCurAISObj = getAISObject(*anIt);
+ if (aCurAISObj.get() != NULL) {
+ Handle(AIS_InteractiveObject) anAIS = aCurAISObj->impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull() && !thePresentations.Contains(anAIS))
thePresentations.Add(anAIS);
}
// It can happen in case of groups selection
QMap<int, ModuleBase_ViewerPrsPtr>::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<ModelAPI_ResultGroup>(aObject);
- if (aResGroup.get())
+ ModuleBase_ViewerPrsPtr aCurPrs = aIt.value();
+ ObjectPtr aObject = aCurPrs->object();
+ ResultGroupPtr aCurResGroup = std::dynamic_pointer_cast<ModelAPI_ResultGroup>(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<TopoDS_Shape>())) {
aToRemove.insert(aIt.key());
}
// 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());
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);
}
//***************************************************
-void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& theSelected,
- const QItemSelection& theDeselected)
+void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& /*theSelected*/,
+ const QItemSelection& /*theDeselected*/)
{
onSelectionChanged();
}
// 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;
}
}
}
}
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 {
Handle(SelectMgr_Selection) aSelection = theObject->Selection(aMode);
NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> anEntities = aSelection->Entities();
- for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator anIt(anEntities);
- anIt.More();
- anIt.Next()) {
- Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
+ for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::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);
}
aFeature = anActiveDocument->producedByFeature(aResult, aShape);
if (aFeature.get()) {
QList<TopoDS_Shape> 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);
}
}
}
#include <QLabel>
#include <QSlider>
-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);
#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);
std::dynamic_pointer_cast<ModelAPI_ResultPart>(aResult);
if (aResultPart.get() && aResultPart->partDoc().get()) {
// Recursion
- std::list<FeaturePtr> anAllFeatures = allFeatures(aResultPart->partDoc());
- aResultList.insert(aResultList.end(), anAllFeatures.begin(), anAllFeatures.end());
+ std::list<FeaturePtr> aPartFeatures = allFeatures(aResultPart->partDoc());
+ aResultList.insert(aResultList.end(), aPartFeatures.begin(), aPartFeatures.end());
}
}
std::vector<int> 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;
}
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));